985687b4e080182c1a3a2173df02b94a5b78b24fBob Halley/*
bd911976d51f102751848568ccf56592fd5f6d77Tinderbox User * Copyright (C) 1999-2002, 2004-2007, 2009, 2015-2017 Internet Systems Consortium, Inc. ("ISC")
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence *
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * file, You can obtain one at http://mozilla.org/MPL/2.0/.
985687b4e080182c1a3a2173df02b94a5b78b24fBob Halley */
985687b4e080182c1a3a2173df02b94a5b78b24fBob Halley
985687b4e080182c1a3a2173df02b94a5b78b24fBob Halley#ifndef DNS_COMPRESS_H
985687b4e080182c1a3a2173df02b94a5b78b24fBob Halley#define DNS_COMPRESS_H 1
985687b4e080182c1a3a2173df02b94a5b78b24fBob Halley
904a5734375869ffb504ed8cde6b68cafadb6d64Bob Halley#include <isc/lang.h>
575737b964590103f60542849d4536b5ccd4eb3cBrian Wellington#include <isc/region.h>
985687b4e080182c1a3a2173df02b94a5b78b24fBob Halley
985687b4e080182c1a3a2173df02b94a5b78b24fBob Halley#include <dns/types.h>
985687b4e080182c1a3a2173df02b94a5b78b24fBob Halley
904a5734375869ffb504ed8cde6b68cafadb6d64Bob HalleyISC_LANG_BEGINDECLS
904a5734375869ffb504ed8cde6b68cafadb6d64Bob Halley
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki/*! \file dns/compress.h
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki * Direct manipulation of the structures is strongly discouraged.
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki *
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki * A name compression context handles compression of multiple DNS names
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki * in relation to a single DNS message. The context can be used to
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki * selectively turn on/off compression for specific names (depending on
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki * the RR type) by using \c dns_compress_setmethods(). Alternately,
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki * compression can be disabled completely using \c
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki * dns_compress_disable().
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki *
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki * \c dns_compress_setmethods() is intended for use by RDATA towire()
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki * implementations, whereas \c dns_compress_disable() is intended to be
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki * used by a nameserver's configuration manager.
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki */
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein#define DNS_COMPRESS_NONE 0x00 /*%< no compression */
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein#define DNS_COMPRESS_GLOBAL14 0x01 /*%< "normal" compression. */
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein#define DNS_COMPRESS_ALL 0x01 /*%< all compression. */
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein#define DNS_COMPRESS_CASESENSITIVE 0x02 /*%< case sensitive compression. */
27bc16fcdc67f9afefefb54ae98dfdae3a5bc1f8Mukund Sivaraman#define DNS_COMPRESS_ENABLED 0x04
27bc16fcdc67f9afefefb54ae98dfdae3a5bc1f8Mukund Sivaraman
27bc16fcdc67f9afefefb54ae98dfdae3a5bc1f8Mukund Sivaraman#define DNS_COMPRESS_READY 0x80000000
ecb6c5782ea248307e86c4bceac6c371d27576a6David Lawrence
575737b964590103f60542849d4536b5ccd4eb3cBrian Wellington#define DNS_COMPRESS_TABLESIZE 64
575737b964590103f60542849d4536b5ccd4eb3cBrian Wellington#define DNS_COMPRESS_INITIALNODES 16
575737b964590103f60542849d4536b5ccd4eb3cBrian Wellington
575737b964590103f60542849d4536b5ccd4eb3cBrian Wellingtontypedef struct dns_compressnode dns_compressnode_t;
575737b964590103f60542849d4536b5ccd4eb3cBrian Wellington
575737b964590103f60542849d4536b5ccd4eb3cBrian Wellingtonstruct dns_compressnode {
575737b964590103f60542849d4536b5ccd4eb3cBrian Wellington isc_region_t r;
575737b964590103f60542849d4536b5ccd4eb3cBrian Wellington isc_uint16_t offset;
575737b964590103f60542849d4536b5ccd4eb3cBrian Wellington isc_uint16_t count;
2d6a6174f108f58458ebafe4120d6df8e28d3e36Brian Wellington isc_uint8_t labels;
575737b964590103f60542849d4536b5ccd4eb3cBrian Wellington dns_compressnode_t *next;
575737b964590103f60542849d4536b5ccd4eb3cBrian Wellington};
575737b964590103f60542849d4536b5ccd4eb3cBrian Wellington
985687b4e080182c1a3a2173df02b94a5b78b24fBob Halleystruct dns_compress {
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein unsigned int magic; /*%< Magic number. */
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein unsigned int allowed; /*%< Allowed methods. */
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein int edns; /*%< Edns version or -1. */
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein /*% Global compression table. */
575737b964590103f60542849d4536b5ccd4eb3cBrian Wellington dns_compressnode_t *table[DNS_COMPRESS_TABLESIZE];
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein /*% Preallocated nodes for the table. */
575737b964590103f60542849d4536b5ccd4eb3cBrian Wellington dns_compressnode_t initialnodes[DNS_COMPRESS_INITIALNODES];
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein isc_uint16_t count; /*%< Number of nodes. */
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein isc_mem_t *mctx; /*%< Memory context. */
985687b4e080182c1a3a2173df02b94a5b78b24fBob Halley};
985687b4e080182c1a3a2173df02b94a5b78b24fBob Halley
942d1a339b1fe617f7d17d66cb5fccce798d15aeBrian Wellingtontypedef enum {
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein DNS_DECOMPRESS_ANY, /*%< Any compression */
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein DNS_DECOMPRESS_STRICT, /*%< Allowed compression */
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein DNS_DECOMPRESS_NONE /*%< No compression */
942d1a339b1fe617f7d17d66cb5fccce798d15aeBrian Wellington} dns_decompresstype_t;
942d1a339b1fe617f7d17d66cb5fccce798d15aeBrian Wellington
985687b4e080182c1a3a2173df02b94a5b78b24fBob Halleystruct dns_decompress {
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein unsigned int magic; /*%< Magic number. */
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein unsigned int allowed; /*%< Allowed methods. */
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein int edns; /*%< Edns version or -1. */
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein dns_decompresstype_t type; /*%< Strict checking */
985687b4e080182c1a3a2173df02b94a5b78b24fBob Halley};
985687b4e080182c1a3a2173df02b94a5b78b24fBob Halley
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrenceisc_result_t
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrencedns_compress_init(dns_compress_t *cctx, int edns, isc_mem_t *mctx);
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein/*%<
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki * Initialise the compression context structure pointed to by
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki * 'cctx'. A freshly initialized context has name compression
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki * enabled, but no methods are set. Please use \c
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki * dns_compress_setmethods() to set a compression method.
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews *
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews * Requires:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li 'cctx' is a valid dns_compress_t structure.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li 'mctx' is an initialized memory context.
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews * Ensures:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li cctx->global is initialized.
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews *
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews * Returns:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li #ISC_R_SUCCESS
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews */
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrewsvoid
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrewsdns_compress_invalidate(dns_compress_t *cctx);
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein/*%<
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews * Invalidate the compression structure pointed to by cctx.
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews *
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews * Requires:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'cctx' to be initialized.
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews */
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrewsvoid
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrewsdns_compress_setmethods(dns_compress_t *cctx, unsigned int allowed);
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein/*%<
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews * Sets allowed compression methods.
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews *
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews * Requires:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'cctx' to be initialized.
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews */
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrewsunsigned int
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrewsdns_compress_getmethods(dns_compress_t *cctx);
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein/*%<
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews * Gets allowed compression methods.
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews *
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews * Requires:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'cctx' to be initialized.
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews *
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews * Returns:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li allowed compression bitmap.
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews */
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecickivoid
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecickidns_compress_disable(dns_compress_t *cctx);
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki/*%<
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki * Disables all name compression in the context. Once disabled,
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki * name compression cannot currently be re-enabled.
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki *
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki * Requires:
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki *\li 'cctx' to be initialized.
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki *
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki */
bfd4b9e11aa9e8c2b43022a6b7a896b26bd5d7a0Witold Krecicki
39c7fc7e00af20144b94ef332943f62c1b3a622fMark Andrewsvoid
39c7fc7e00af20144b94ef332943f62c1b3a622fMark Andrewsdns_compress_setsensitive(dns_compress_t *cctx, isc_boolean_t sensitive);
39c7fc7e00af20144b94ef332943f62c1b3a622fMark Andrews
39c7fc7e00af20144b94ef332943f62c1b3a622fMark Andrews/*
39c7fc7e00af20144b94ef332943f62c1b3a622fMark Andrews * Preserve the case of compressed domain names.
39c7fc7e00af20144b94ef332943f62c1b3a622fMark Andrews *
39c7fc7e00af20144b94ef332943f62c1b3a622fMark Andrews * Requires:
39c7fc7e00af20144b94ef332943f62c1b3a622fMark Andrews * 'cctx' to be initialized.
39c7fc7e00af20144b94ef332943f62c1b3a622fMark Andrews */
39c7fc7e00af20144b94ef332943f62c1b3a622fMark Andrews
39c7fc7e00af20144b94ef332943f62c1b3a622fMark Andrewsisc_boolean_t
39c7fc7e00af20144b94ef332943f62c1b3a622fMark Andrewsdns_compress_getsensitive(dns_compress_t *cctx);
39c7fc7e00af20144b94ef332943f62c1b3a622fMark Andrews/*
3678015d3f91ad80e7ea5fc4c6ee00e16c9f40aeFrancis Dupont * Return whether case is to be preserved when compressing
39c7fc7e00af20144b94ef332943f62c1b3a622fMark Andrews * domain names.
39c7fc7e00af20144b94ef332943f62c1b3a622fMark Andrews *
39c7fc7e00af20144b94ef332943f62c1b3a622fMark Andrews * Requires:
39c7fc7e00af20144b94ef332943f62c1b3a622fMark Andrews * 'cctx' to be initialized.
39c7fc7e00af20144b94ef332943f62c1b3a622fMark Andrews */
39c7fc7e00af20144b94ef332943f62c1b3a622fMark Andrews
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrewsint
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrewsdns_compress_getedns(dns_compress_t *cctx);
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein/*%<
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews * Gets edns value.
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews *
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews * Requires:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'cctx' to be initialized.
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews *
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews * Returns:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li -1 .. 255
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews */
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrewsisc_boolean_t
45e1bd63587102c3bb361eaca42ee7b714fb3542Mark Andrewsdns_compress_findglobal(dns_compress_t *cctx, const dns_name_t *name,
29daf5bc7738f1cdab7914562269e1129c81acdcBrian Wellington dns_name_t *prefix, isc_uint16_t *offset);
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein/*%<
575737b964590103f60542849d4536b5ccd4eb3cBrian Wellington * Finds longest possible match of 'name' in the global compression table.
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews *
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews * Requires:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'cctx' to be initialized.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'name' to be a absolute name.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'prefix' to be initialized.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'offset' to point to an isc_uint16_t.
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews *
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews * Ensures:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'prefix' and 'offset' are valid if ISC_TRUE is returned.
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews *
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews * Returns:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_TRUE / #ISC_FALSE
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews */
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrewsvoid
45e1bd63587102c3bb361eaca42ee7b714fb3542Mark Andrewsdns_compress_add(dns_compress_t *cctx, const dns_name_t *name,
45e1bd63587102c3bb361eaca42ee7b714fb3542Mark Andrews const dns_name_t *prefix, isc_uint16_t offset);
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein/*%<
4d180bd2100d9c848831c08e7f08a75cc21a9c0aBrian Wellington * Add compression pointers for 'name' to the compression table,
575737b964590103f60542849d4536b5ccd4eb3cBrian Wellington * not replacing existing pointers.
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews *
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews * Requires:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'cctx' initialized
4d180bd2100d9c848831c08e7f08a75cc21a9c0aBrian Wellington *
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'name' must be initialized and absolute, and must remain
60103a02c62cadc72fef61b8bdab9694e3fcf57aBrian Wellington * valid until the message compression is complete.
4d180bd2100d9c848831c08e7f08a75cc21a9c0aBrian Wellington *
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'prefix' must be a prefix returned by
473af331834c05fd41b36a6de116a724eae77890Brian Wellington * dns_compress_findglobal(), or the same as 'name'.
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews */
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrewsvoid
c1e7aff941dbf40090fec49300e728ad017d4f0cMark Andrewsdns_compress_rollback(dns_compress_t *cctx, isc_uint16_t offset);
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein/*%<
575737b964590103f60542849d4536b5ccd4eb3cBrian Wellington * Remove any compression pointers from global table >= offset.
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews *
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews * Requires:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'cctx' is initialized.
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews */
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrewsvoid
942d1a339b1fe617f7d17d66cb5fccce798d15aeBrian Wellingtondns_decompress_init(dns_decompress_t *dctx, int edns,
942d1a339b1fe617f7d17d66cb5fccce798d15aeBrian Wellington dns_decompresstype_t type);
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrews
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein/*%<
6a8832f784bd53aa6afbda22f6187cea6490e1e1Andreas Gustafsson * Initializes 'dctx'.
942d1a339b1fe617f7d17d66cb5fccce798d15aeBrian Wellington * Records 'edns' and 'type' into the structure.
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews *
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews * Requires:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'dctx' to be a valid pointer.
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews */
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrewsvoid
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrewsdns_decompress_invalidate(dns_decompress_t *dctx);
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrews
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein/*%<
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews * Invalidates 'dctx'.
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews *
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews * Requires:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'dctx' to be initialized
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews */
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrewsvoid
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrewsdns_decompress_setmethods(dns_decompress_t *dctx, unsigned int allowed);
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrews
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein/*%<
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews * Sets 'dctx->allowed' to 'allowed'.
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews *
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews * Requires:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'dctx' to be initialized
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews */
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrewsunsigned int
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrewsdns_decompress_getmethods(dns_decompress_t *dctx);
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrews
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein/*%<
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews * Returns 'dctx->allowed'
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews *
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews * Requires:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'dctx' to be initialized
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews */
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrewsint
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrewsdns_decompress_edns(dns_decompress_t *dctx);
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrews
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein/*%<
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews * Returns 'dctx->edns'
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews *
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews * Requires:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'dctx' to be initialized
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews */
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews
942d1a339b1fe617f7d17d66cb5fccce798d15aeBrian Wellingtondns_decompresstype_t
942d1a339b1fe617f7d17d66cb5fccce798d15aeBrian Wellingtondns_decompress_type(dns_decompress_t *dctx);
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrews
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein/*%<
942d1a339b1fe617f7d17d66cb5fccce798d15aeBrian Wellington * Returns 'dctx->type'
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews *
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews * Requires:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'dctx' to be initialized
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews */
d0221bfa6a08f7b284b231886928aa5d8ac87fc2Mark Andrews
904a5734375869ffb504ed8cde6b68cafadb6d64Bob HalleyISC_LANG_ENDDECLS
904a5734375869ffb504ed8cde6b68cafadb6d64Bob Halley
985687b4e080182c1a3a2173df02b94a5b78b24fBob Halley#endif /* DNS_COMPRESS_H */