compress.c revision 34eab435ace6e5c8392819d06dd54078124126df
/*
* 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$ */
/*! \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;
unsigned char *tmp;
isc_region_t r;
if (offset > 0x4000)
return;
n = dns_name_countlabels(name);
if (dns_name_isabsolute(prefix))
count--;
if (count == 0)
return;
start = 0;
dns_name_toregion(name, &r);
return;
dns_name_fromregion(&xname, &r);
while (count > 0) {
if (offset >= 0x4000)
break;
/*
* Create a new node and add it.
*/
else {
sizeof(dns_compressnode_t));
if (start == 0)
return;
}
}
if (start == 0)
toffset |= 0x8000;
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
}
}