compress.c revision 70e5a7403f0e0a3bd292b8287c5fed5772c15270
/*
* Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2001 Internet Software Consortium.
*
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: compress.c,v 1.59 2007/06/19 23:47:16 tbox Exp $ */
/*! \file */
#define DNS_NAME_USEINLINE 1
#include <config.h>
#include <dns/compress.h>
#include <dns/fixedname.h>
/***
*** Compression
***/
unsigned int i;
for (i = 0; i < DNS_COMPRESS_TABLESIZE; i++)
return (ISC_R_SUCCESS);
}
void
unsigned int i;
for (i = 0; i < DNS_COMPRESS_TABLESIZE; i++) {
continue;
}
}
}
void
}
unsigned int
}
void
if (sensitive)
else
}
}
int
}
do { \
} while (0)
/*
* Find the longest match of name in the table.
* If match is found return ISC_TRUE. prefix, suffix and offset are updated.
* If no match is found return ISC_FALSE.
*/
{
return (ISC_FALSE);
for (n = 0; n < labels - 1; n++) {
{
break;
} else {
break;
}
}
break;
}
/*
* If node == NULL, we found no match at all.
*/
return (ISC_FALSE);
if (n == 0)
else
return (ISC_TRUE);
}
static inline unsigned int
isc_region_t r;
dns_name_toregion(name, &r);
return (r.length);
}
void
{
unsigned int start;
unsigned int n;
unsigned int count;
unsigned int hash;
unsigned int length;
unsigned int tlength;
n = dns_name_countlabels(name);
if (dns_name_isabsolute(prefix))
count--;
start = 0;
while (count > 0) {
if (offset >= 0x4000)
break;
/*
* Create a new node and add it.
*/
else {
sizeof(dns_compressnode_t));
return;
}
start++;
n--;
count--;
}
}
void
unsigned int i;
for (i = 0; i < DNS_COMPRESS_TABLESIZE; i++) {
/*
* This relies on nodes with greater offsets being
* closer to the beginning of the list, and the
* items with the greatest offsets being at the end
* of the initialnodes[] array.
*/
}
}
}
/***
*** Decompression
***/
void
}
void
}
void
case DNS_DECOMPRESS_ANY:
break;
case DNS_DECOMPRESS_NONE:
break;
case DNS_DECOMPRESS_STRICT:
break;
}
}
unsigned int
}
int
}
}