229N/A $Id: decompression,v 1.3 1999/02/24 06:31:31 marka Exp $
229N/A There are 4 type of compression: global 14 bit, global 16 bit,
229N/A local 14 bit and local 16 bit.
229N/A In general the resolver / nameserver should accept any compression
229N/A method at any time regardless of whether it was legal to
229N/A send it. This fits with the priciple of being liberal with
229N/A what you accept and strict with what you send.
229N/A There are a few cases where it does not make sence to accept
229N/A compression pointers of a given type.
i.e. the first domain name
229N/A in a message, local compression pointers in the ownername of a RR
229N/A When performing regression testing however we should be as strict
229N/A as possible. Hence we need to be able modifiy the behaviour of the
229N/A decompression routines.
229N/A To be able to decompress a domain name we need some or all of the
229N/A following pieces of information.
229N/A 1. where the message starts.
229N/A 2. where the current rdata starts in the message (local compression).
229N/A 3. what the current owner name is (local compression).
229N/A 4. where the domainname we are decompressing starts.
229N/A 5. what are allowable decompression method. These vary across type
229N/A dns_rdata_fromwire will set the allowed decompression methods allowed
229N/A by looking at edns, strict and the type values.
229N/A struct dns_decompress {
229N/A dns_decompress_init(dns_decompress_t *dctx, int edns,
229N/A dctx->ownername is invalidated
229N/A dns_decompress_localinit(dns_decompress_t *dctx, dns_name_t *name,
229N/A initalise dctx->ownername
229N/A record source->current to dctx->rdata
229N/A dns_decompress_invalidate(dns_decompress_t *dctx);
229N/A dns_decompress_localinvalidate(dns_decompress_t *dctx);
invalidate dctx->ownername
dns_decompress_setmethods(dns_decompress_t *dctx, unsigned int allowed);
dns_decompress_getmethods(dns_decompress_t *dctx);
dns_decompress_edns(dns_decompress_t *dctx);
dns_decompress_strict(dns_decompress_t *dctx);
dns_name_fromwire(dns_name_t *name, isc_buffer_t *source,
dns_decompress_t *dctx, isc_boolean_t downcase,