decompression revision 9bff67898d55cddfcec9ce30cc2b1bb6211ec691
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinCopyright (C) 1999, 2000 Internet Software Consortium.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinSee COPYRIGHT in the source root or http://www.isc.org/copyright for terms.
3e14f97f673e8a630f076077de35afdd43dc1587Roger A. Faulkner Name Decompression
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $Id: decompression,v 1.4 2000/06/21 23:43:32 tale Exp $
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin There are 4 type of compression: global 14 bit, global 16 bit,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin local 14 bit and local 16 bit.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin In general the resolver / nameserver should accept any compression
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin method at any time regardless of whether it was legal to
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin send it. This fits with the priciple of being liberal with
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin what you accept and strict with what you send.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin There are a few cases where it does not make sence to accept
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin compression pointers of a given type. i.e. the first domain name
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin in a message, local compression pointers in the ownername of a RR
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin or in a question.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin When performing regression testing however we should be as strict
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin as possible. Hence we need to be able modifiy the behaviour of the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin decompression routines.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin To be able to decompress a domain name we need some or all of the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin following pieces of information.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 1. where the message starts.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 2. where the current rdata starts in the message (local compression).
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 3. what the current owner name is (local compression).
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 4. where the domainname we are decompressing starts.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 5. what are allowable decompression method. These vary across type
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin and edn version.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinImplementation:
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin dns_rdata_fromwire will set the allowed decompression methods allowed
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin by looking at edns, strict and the type values.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin struct dns_decompress {
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin unsigned int magic;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin unsigned int allowed;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin dns_name_t owner_name;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin unsigned int rdata;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin isc_boolean_t strict;