compress.c revision 64e7f8541ddaee30c5e84394602eaeac69cb9b16
/*
* Copyright (C) 1999-2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* 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 INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM 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.46 2001/02/10 01:18:19 bwelling Exp $ */
#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
}
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;
}
break;
}
/*
* If node == NULL, we found no match at all.
*/
return (ISC_FALSE);
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
}
}