compress.h revision bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0
002a514a7a09e0b8700895f4f215e4c60e1b4f56cmarqu/*
002a514a7a09e0b8700895f4f215e4c60e1b4f56cmarqu * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
002a514a7a09e0b8700895f4f215e4c60e1b4f56cmarqu * Copyright (C) 1999-2002 Internet Software Consortium.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Permission to use, copy, modify, and/or distribute this software for any
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * purpose with or without fee is hereby granted, provided that the above
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * copyright notice and this permission notice appear in all copies.
002a514a7a09e0b8700895f4f215e4c60e1b4f56cmarqu *
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
002a514a7a09e0b8700895f4f215e4c60e1b4f56cmarqu * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * PERFORMANCE OF THIS SOFTWARE.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas#ifndef DNS_COMPRESS_H
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas#define DNS_COMPRESS_H 1
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas#include <isc/lang.h>
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas#include <isc/region.h>
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas#include <dns/types.h>
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasISC_LANG_BEGINDECLS
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu/*! \file dns/compress.h
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Direct manipulation of the structures is strongly discouraged.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * A name compression context handles compression of multiple DNS names
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * in relation to a single DNS message. The context can be used to
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu * selectively turn on/off compression for specific names (depending on
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * the RR type) by using \c dns_compress_setmethods(). Alternately,
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * compression can be disabled completely using \c
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * dns_compress_disable().
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * \c dns_compress_setmethods() is intended for use by RDATA towire()
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * implementations, whereas \c dns_compress_disable() is intended to be
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu * used by a nameserver's configuration manager.
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu */
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu#define DNS_COMPRESS_NONE 0x00 /*%< no compression */
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu#define DNS_COMPRESS_GLOBAL14 0x01 /*%< "normal" compression. */
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu#define DNS_COMPRESS_ALL 0x01 /*%< all compression. */
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu#define DNS_COMPRESS_CASESENSITIVE 0x02 /*%< case sensitive compression. */
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas#define DNS_COMPRESS_TABLESIZE 64
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas#define DNS_COMPRESS_INITIALNODES 16
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
36de3346306c17768d6c2e284df34581c4cd0e67cmarqutypedef struct dns_compressnode dns_compressnode_t;
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasstruct dns_compressnode {
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas isc_region_t r;
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas isc_uint16_t offset;
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu isc_uint16_t count;
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas isc_uint8_t labels;
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas dns_compressnode_t *next;
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas};
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqustruct dns_compress {
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu unsigned int magic; /*%< Magic number. */
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu unsigned int allowed; /*%< Allowed methods. */
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu isc_boolean_t enabled; /*%< If the compression is enabled at all. */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas int edns; /*%< Edns version or -1. */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas /*% Global compression table. */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas dns_compressnode_t *table[DNS_COMPRESS_TABLESIZE];
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas /*% Preallocated nodes for the table. */
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu dns_compressnode_t initialnodes[DNS_COMPRESS_INITIALNODES];
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas isc_uint16_t count; /*%< Number of nodes. */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas isc_mem_t *mctx; /*%< Memory context. */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas};
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu
30655a0f93fae148eacdc4e7795479377b4a1a08matiphastypedef enum {
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas DNS_DECOMPRESS_ANY, /*%< Any compression */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas DNS_DECOMPRESS_STRICT, /*%< Allowed compression */
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu DNS_DECOMPRESS_NONE /*%< No compression */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas} dns_decompresstype_t;
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasstruct dns_decompress {
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu unsigned int magic; /*%< Magic number. */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas unsigned int allowed; /*%< Allowed methods. */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas int edns; /*%< Edns version or -1. */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas dns_decompresstype_t type; /*%< Strict checking */
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu};
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasisc_result_t
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasdns_compress_init(dns_compress_t *cctx, int edns, isc_mem_t *mctx);
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu/*%<
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Initialise the compression context structure pointed to by
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * 'cctx'. A freshly initialized context has name compression
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * enabled, but no methods are set. Please use \c
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu * dns_compress_setmethods() to set a compression method.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Requires:
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * \li 'cctx' is a valid dns_compress_t structure.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * \li 'mctx' is an initialized memory context.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Ensures:
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * \li cctx->global is initialized.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Returns:
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * \li #ISC_R_SUCCESS
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * \li failures from dns_rbt_create()
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas */
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu
a6497e78e9df7f139540c920875ba8fe622f9371cwebbvoid
a6497e78e9df7f139540c920875ba8fe622f9371cwebbdns_compress_invalidate(dns_compress_t *cctx);
a6497e78e9df7f139540c920875ba8fe622f9371cwebb
a6497e78e9df7f139540c920875ba8fe622f9371cwebb/*%<
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu * Invalidate the compression structure pointed to by cctx.
a6497e78e9df7f139540c920875ba8fe622f9371cwebb *
a6497e78e9df7f139540c920875ba8fe622f9371cwebb * Requires:
a6497e78e9df7f139540c920875ba8fe622f9371cwebb *\li 'cctx' to be initialized.
a6497e78e9df7f139540c920875ba8fe622f9371cwebb */
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu
a6497e78e9df7f139540c920875ba8fe622f9371cwebbvoid
a6497e78e9df7f139540c920875ba8fe622f9371cwebbdns_compress_setmethods(dns_compress_t *cctx, unsigned int allowed);
a6497e78e9df7f139540c920875ba8fe622f9371cwebb
a6497e78e9df7f139540c920875ba8fe622f9371cwebb/*%<
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu * Sets allowed compression methods.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Requires:
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *\li 'cctx' to be initialized.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas */
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasunsigned int
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasdns_compress_getmethods(dns_compress_t *cctx);
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu/*%<
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Gets allowed compression methods.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Requires:
619df37631a53fcf45cbe42ac39a74f9750fee67cmarqu *\li 'cctx' to be initialized.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Returns:
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *\li allowed compression bitmap.
619df37631a53fcf45cbe42ac39a74f9750fee67cmarqu */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasvoid
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasdns_compress_disable(dns_compress_t *cctx);
619df37631a53fcf45cbe42ac39a74f9750fee67cmarqu/*%<
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Disables all name compression in the context. Once disabled,
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * name compression cannot currently be re-enabled.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Requires:
619df37631a53fcf45cbe42ac39a74f9750fee67cmarqu *\li 'cctx' to be initialized.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarquvoid
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasdns_compress_setsensitive(dns_compress_t *cctx, isc_boolean_t sensitive);
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas/*
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu * Preserve the case of compressed domain names.
619df37631a53fcf45cbe42ac39a74f9750fee67cmarqu *
619df37631a53fcf45cbe42ac39a74f9750fee67cmarqu * Requires:
619df37631a53fcf45cbe42ac39a74f9750fee67cmarqu * 'cctx' to be initialized.
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasisc_boolean_t
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasdns_compress_getsensitive(dns_compress_t *cctx);
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu/*
619df37631a53fcf45cbe42ac39a74f9750fee67cmarqu * Return whether case is to be preserved when compressing
619df37631a53fcf45cbe42ac39a74f9750fee67cmarqu * domain names.
619df37631a53fcf45cbe42ac39a74f9750fee67cmarqu *
619df37631a53fcf45cbe42ac39a74f9750fee67cmarqu * Requires:
36de3346306c17768d6c2e284df34581c4cd0e67cmarqu * 'cctx' to be initialized.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasint
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqudns_compress_getedns(dns_compress_t *cctx);
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas/*%<
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Gets edns value.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Requires:
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu *\li 'cctx' to be initialized.
619df37631a53fcf45cbe42ac39a74f9750fee67cmarqu *
619df37631a53fcf45cbe42ac39a74f9750fee67cmarqu * Returns:
619df37631a53fcf45cbe42ac39a74f9750fee67cmarqu *\li -1 .. 255
619df37631a53fcf45cbe42ac39a74f9750fee67cmarqu */
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasisc_boolean_t
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasdns_compress_findglobal(dns_compress_t *cctx, const dns_name_t *name,
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas dns_name_t *prefix, isc_uint16_t *offset);
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu/*%<
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Finds longest possible match of 'name' in the global compression table.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Requires:
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu *\li 'cctx' to be initialized.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *\li 'name' to be a absolute name.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *\li 'prefix' to be initialized.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *\li 'offset' to point to an isc_uint16_t.
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Ensures:
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *\li 'prefix' and 'offset' are valid if ISC_TRUE is returned.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Returns:
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *\li #ISC_TRUE / #ISC_FALSE
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasvoid
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqudns_compress_add(dns_compress_t *cctx, const dns_name_t *name,
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas const dns_name_t *prefix, isc_uint16_t offset);
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas/*%<
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Add compression pointers for 'name' to the compression table,
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * not replacing existing pointers.
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Requires:
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *\li 'cctx' initialized
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu *\li 'name' must be initialized and absolute, and must remain
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * valid until the message compression is complete.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *\li 'prefix' must be a prefix returned by
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu * dns_compress_findglobal(), or the same as 'name'.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasvoid
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasdns_compress_rollback(dns_compress_t *cctx, isc_uint16_t offset);
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu/*%<
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Remove any compression pointers from global table >= offset.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Requires:
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu *\li 'cctx' is initialized.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasvoid
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqudns_decompress_init(dns_decompress_t *dctx, int edns,
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas dns_decompresstype_t type);
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas/*%<
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu * Initializes 'dctx'.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Records 'edns' and 'type' into the structure.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Requires:
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu *\li 'dctx' to be a valid pointer.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasvoid
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqudns_decompress_invalidate(dns_decompress_t *dctx);
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas/*%<
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Invalidates 'dctx'.
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Requires:
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *\li 'dctx' to be initialized
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas */
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasvoid
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasdns_decompress_setmethods(dns_decompress_t *dctx, unsigned int allowed);
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu/*%<
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Sets 'dctx->allowed' to 'allowed'.
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Requires:
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu *\li 'dctx' to be initialized
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasunsigned int
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqudns_decompress_getmethods(dns_decompress_t *dctx);
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas/*%<
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Returns 'dctx->allowed'
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Requires:
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *\li 'dctx' to be initialized
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas */
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasint
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasdns_decompress_edns(dns_decompress_t *dctx);
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu/*%<
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Returns 'dctx->edns'
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Requires:
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu *\li 'dctx' to be initialized
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasdns_decompresstype_t
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasdns_decompress_type(dns_decompress_t *dctx);
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas/*%<
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Returns 'dctx->type'
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas *
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas * Requires:
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu *\li 'dctx' to be initialized
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
30655a0f93fae148eacdc4e7795479377b4a1a08matiphasISC_LANG_ENDDECLS
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas
ac2de0b006739c10b0ab8917e9c470200c06ee2dcmarqu#endif /* DNS_COMPRESS_H */
30655a0f93fae148eacdc4e7795479377b4a1a08matiphas