+++ /dev/null
-#!/bin/sh
-#
-# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
-# Copyright (C) 2000, 2001, 2003 Internet Software Consortium.
-#
-# Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC 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: isc-config.sh.in,v 1.17 2007/06/19 23:46:59 tbox Exp $
-
-prefix=/home/tridge/project/bind9/prefix
-exec_prefix=${prefix}
-exec_prefix_set=
-
-usage()
-{
- cat << EOF
-Usage: isc-config [OPTIONS] [LIBRARIES]
-Options:
- [--prefix[=DIR]]
- [--exec-prefix[=DIR]]
- [--version]
- [--libs]
- [--cflags]
-Libraries:
- isc
- isccc
- isccfg
- dns
- lwres
- bind9
-EOF
- exit $1
-}
-
-if test $# -eq 0; then
- usage 1 1>&2
-fi
-
-while test $# -gt 0; do
- case "$1" in
- -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) optarg= ;;
- esac
-
- case "$1" in
- --prefix=*)
- prefix=$optarg
- if test "x$exec_prefix_set" = x ; then
- exec_prefix=$prefix
- fi
- ;;
- --prefix)
- echo_prefix=true
- ;;
- --exec-prefix=*)
- exec_prefix=$optarg
- ;;
- --exec-prefix)
- echo_exec_prefix=true
- ;;
- --version)
- echo VERSION=9.6.1-P2
- exit 0
- ;;
- --cflags)
- echo_cflags=true
- ;;
- --libs)
- echo_libs=true;
- ;;
- isc)
- libisc=true;
- ;;
- isccc)
- libisccc=true;
- libisc=true;
- ;;
- isccfg)
- libisccfg=true;
- libisc=true;
- ;;
- dns)
- libdns=true;
- libisc=true;
- ;;
- lwres)
- liblwres=true;
- ;;
- bind9)
- libdns=true;
- libisc=true;
- libisccfg=true;
- libbind9=true;
- ;;
- *)
- usage 1 1>&2
- esac
- shift
-done
-
-if test x"$echo_prefix" = x"true" ; then
- echo $prefix
-fi
-if test x"$echo_exec_prefix" = x"true" ; then
- echo $exec_prefix
-fi
-if test x"$echo_cflags" = x"true"; then
- includes="-I${exec_prefix}/include"
- if test x"$libisc" = x"true"; then
- includes="$includes -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE "
- fi
- echo $includes
-fi
-if test x"$echo_libs" = x"true"; then
- libs=-L${exec_prefix}/lib
- if test x"$liblwres" = x"true" ; then
- libs="$libs -llwres"
- fi
- if test x"$libbind9" = x"true" ; then
- libs="$libs -lbind9"
- fi
- if test x"$libdns" = x"true" ; then
- libs="$libs -ldns -L/usr/lib -lgssapi_krb5 -lcrypto"
- fi
- if test x"$libisccfg" = x"true" ; then
- libs="$libs -lisccfg"
- fi
- if test x"$libisccc" = x"true" ; then
- libs="$libs -lisccc"
- fi
- if test x"$libisc" = x"true" ; then
- libs="$libs -lisc"
- needothers=true
- fi
- if test x"$needothers" = x"true" ; then
- libs="$libs -lcap -lpthread -lxml2"
- fi
- echo $libs
-fi
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: check.h,v 1.9 2007/06/19 23:47:16 tbox Exp $ */
-
-#ifndef BIND9_CHECK_H
-#define BIND9_CHECK_H 1
-
-/*! \file bind9/check.h */
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-#include <isccfg/cfg.h>
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-bind9_check_namedconf(const cfg_obj_t *config, isc_log_t *logctx,
- isc_mem_t *mctx);
-/*%<
- * Check the syntactic validity of a configuration parse tree generated from
- * a named.conf file.
- *
- * Requires:
- *\li config is a valid parse tree
- *
- *\li logctx is a valid logging context.
- *
- * Returns:
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_FAILURE
- */
-
-isc_result_t
-bind9_check_key(const cfg_obj_t *config, isc_log_t *logctx);
-/*%<
- * Same as bind9_check_namedconf(), but for a single 'key' statement.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* BIND9_CHECK_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: getaddresses.h,v 1.9.332.2 2009/01/18 23:47:35 tbox Exp $ */
-
-#ifndef BIND9_GETADDRESSES_H
-#define BIND9_GETADDRESSES_H 1
-
-/*! \file bind9/getaddresses.h */
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-#include <isc/net.h>
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-bind9_getaddresses(const char *hostname, in_port_t port,
- isc_sockaddr_t *addrs, int addrsize, int *addrcount);
-/*%<
- * Use the system resolver to get the addresses associated with a hostname.
- * If successful, the number of addresses found is returned in 'addrcount'.
- * If a hostname lookup is performed and addresses of an unknown family is
- * seen, it is ignored. If more than 'addrsize' addresses are seen, the
- * first 'addrsize' are returned and the remainder silently truncated.
- *
- * This routine may block. If called by a program using the isc_app
- * framework, it should be surrounded by isc_app_block()/isc_app_unblock().
- *
- * Requires:
- *\li 'hostname' is not NULL.
- *\li 'addrs' is not NULL.
- *\li 'addrsize' > 0
- *\li 'addrcount' is not NULL.
- *
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOTFOUND
- *\li #ISC_R_NOFAMILYSUPPORT - 'hostname' is an IPv6 address, and IPv6 is
- * not supported.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* BIND9_GETADDRESSES_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: version.h,v 1.9 2007/06/19 23:47:16 tbox Exp $ */
-
-/*! \file bind9/version.h */
-
-#include <isc/platform.h>
-
-LIBBIND9_EXTERNAL_DATA extern const char bind9_version[];
-
-LIBBIND9_EXTERNAL_DATA extern const unsigned int bind9_libinterface;
-LIBBIND9_EXTERNAL_DATA extern const unsigned int bind9_librevision;
-LIBBIND9_EXTERNAL_DATA extern const unsigned int bind9_libage;
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: acl.h,v 1.31.206.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef DNS_ACL_H
-#define DNS_ACL_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/acl.h
- * \brief
- * Address match list handling.
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-#include <isc/magic.h>
-#include <isc/netaddr.h>
-#include <isc/refcount.h>
-
-#include <dns/name.h>
-#include <dns/types.h>
-#include <dns/iptable.h>
-
-/***
- *** Types
- ***/
-
-typedef enum {
- dns_aclelementtype_ipprefix,
- dns_aclelementtype_keyname,
- dns_aclelementtype_nestedacl,
- dns_aclelementtype_localhost,
- dns_aclelementtype_localnets,
- dns_aclelementtype_any
-#ifdef SUPPORT_GEOIP
- ,
- dns_aclelementtype_ipcountry
-#endif
-} dns_aclelemettype_t;
-
-#ifdef SUPPORT_GEOIP
-typedef char dns_aclipcountry[3];
-#endif
-
-typedef struct dns_aclipprefix dns_aclipprefix_t;
-
-struct dns_aclipprefix {
- isc_netaddr_t address; /* IP4/IP6 */
- unsigned int prefixlen;
-};
-
-struct dns_aclelement {
- dns_aclelemettype_t type;
- isc_boolean_t negative;
- dns_name_t keyname;
- dns_acl_t *nestedacl;
- int node_num;
-#ifdef SUPPORT_GEOIP
- dns_aclipcountry country;
-#endif
-};
-
-struct dns_acl {
- unsigned int magic;
- isc_mem_t *mctx;
- isc_refcount_t refcount;
- dns_iptable_t *iptable;
-#define node_count iptable->radix->num_added_node
- dns_aclelement_t *elements;
- isc_boolean_t has_negatives;
- unsigned int alloc; /*%< Elements allocated */
- unsigned int length; /*%< Elements initialized */
- char *name; /*%< Temporary use only */
- ISC_LINK(dns_acl_t) nextincache; /*%< Ditto */
-};
-
-struct dns_aclenv {
- dns_acl_t *localhost;
- dns_acl_t *localnets;
- isc_boolean_t match_mapped;
-};
-
-#define DNS_ACL_MAGIC ISC_MAGIC('D','a','c','l')
-#define DNS_ACL_VALID(a) ISC_MAGIC_VALID(a, DNS_ACL_MAGIC)
-
-/***
- *** Functions
- ***/
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_acl_create(isc_mem_t *mctx, int n, dns_acl_t **target);
-/*%<
- * Create a new ACL, including an IP table and an array with room
- * for 'n' ACL elements. The elements are uninitialized and the
- * length is 0.
- */
-
-isc_result_t
-dns_acl_any(isc_mem_t *mctx, dns_acl_t **target);
-/*%<
- * Create a new ACL that matches everything.
- */
-
-isc_result_t
-dns_acl_none(isc_mem_t *mctx, dns_acl_t **target);
-/*%<
- * Create a new ACL that matches nothing.
- */
-
-isc_boolean_t
-dns_acl_isany(dns_acl_t *acl);
-/*%<
- * Test whether ACL is set to "{ any; }"
- */
-
-isc_boolean_t
-dns_acl_isnone(dns_acl_t *acl);
-/*%<
- * Test whether ACL is set to "{ none; }"
- */
-
-isc_result_t
-dns_acl_merge(dns_acl_t *dest, dns_acl_t *source, isc_boolean_t pos);
-/*%<
- * Merge the contents of one ACL into another. Call dns_iptable_merge()
- * for the IP tables, then concatenate the element arrays.
- *
- * If pos is set to false, then the nested ACL is to be negated. This
- * means reverse the sense of each *positive* element or IP table node,
- * but leave negatives alone, so as to prevent a double-negative causing
- * an unexpected positive match in the parent ACL.
- */
-
-void
-dns_acl_attach(dns_acl_t *source, dns_acl_t **target);
-
-void
-dns_acl_detach(dns_acl_t **aclp);
-
-isc_boolean_t
-dns_acl_isinsecure(const dns_acl_t *a);
-/*%<
- * Return #ISC_TRUE iff the acl 'a' is considered insecure, that is,
- * if it contains IP addresses other than those of the local host.
- * This is intended for applications such as printing warning
- * messages for suspect ACLs; it is not intended for making access
- * control decisions. We make no guarantee that an ACL for which
- * this function returns #ISC_FALSE is safe.
- */
-
-isc_result_t
-dns_aclenv_init(isc_mem_t *mctx, dns_aclenv_t *env);
-/*%<
- * Initialize ACL environment, setting up localhost and localnets ACLs
- */
-
-void
-dns_aclenv_copy(dns_aclenv_t *t, dns_aclenv_t *s);
-
-void
-dns_aclenv_destroy(dns_aclenv_t *env);
-
-isc_result_t
-dns_acl_match(const isc_netaddr_t *reqaddr,
- const dns_name_t *reqsigner,
- const dns_acl_t *acl,
- const dns_aclenv_t *env,
- int *match,
- const dns_aclelement_t **matchelt);
-/*%<
- * General, low-level ACL matching. This is expected to
- * be useful even for weird stuff like the topology and sortlist statements.
- *
- * Match the address 'reqaddr', and optionally the key name 'reqsigner',
- * against 'acl'. 'reqsigner' may be NULL.
- *
- * If there is a match, '*match' will be set to an integer whose absolute
- * value corresponds to the order in which the matching value was inserted
- * into the ACL. For a positive match, this value will be positive; for a
- * negative match, it will be negative.
- *
- * If there is no match, *match will be set to zero.
- *
- * If there is a match in the element list (either positive or negative)
- * and 'matchelt' is non-NULL, *matchelt will be pointed to the matching
- * element.
- *
- * Returns:
- *\li #ISC_R_SUCCESS Always succeeds.
- */
-
-isc_boolean_t
-dns_aclelement_match(const isc_netaddr_t *reqaddr,
- const dns_name_t *reqsigner,
- const dns_aclelement_t *e,
- const dns_aclenv_t *env,
- const dns_aclelement_t **matchelt);
-/*%<
- * Like dns_acl_match, but matches against the single ACL element 'e'
- * rather than a complete ACL, and returns ISC_TRUE iff it matched.
- *
- * To determine whether the match was positive or negative, the
- * caller should examine e->negative. Since the element 'e' may be
- * a reference to a named ACL or a nested ACL, a matching element
- * returned through 'matchelt' is not necessarily 'e' itself.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_ACL_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: adb.h,v 1.85 2008/04/03 06:09:04 tbox Exp $ */
-
-#ifndef DNS_ADB_H
-#define DNS_ADB_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/adb.h
- *\brief
- * DNS Address Database
- *
- * This module implements an address database (ADB) for mapping a name
- * to an isc_sockaddr_t. It also provides statistical information on
- * how good that address might be.
- *
- * A client will pass in a dns_name_t, and the ADB will walk through
- * the rdataset looking up addresses associated with the name. If it
- * is found on the internal lists, a structure is filled in with the
- * address information and stats for found addresses.
- *
- * If the name cannot be found on the internal lists, a new entry will
- * be created for a name if all the information needed can be found
- * in the zone table or cache. This new address will then be returned.
- *
- * If a request must be made to remote servers to satisfy a name lookup,
- * this module will start fetches to try to complete these addresses. When
- * at least one more completes, an event is sent to the caller. If none of
- * them resolve before the fetch times out, an event indicating this is
- * sent instead.
- *
- * Records are stored internally until a timer expires. The timer is the
- * smaller of the TTL or signature validity period.
- *
- * Lameness is stored per <qname,qtype> tuple, and this data hangs off each
- * address field. When an address is marked lame for a given tuple the address
- * will not be returned to a caller.
- *
- *
- * MP:
- *
- *\li The ADB takes care of all necessary locking.
- *
- *\li Only the task which initiated the name lookup can cancel the lookup.
- *
- *
- * Security:
- *
- *\li None, since all data stored is required to be pre-filtered.
- * (Cache needs to be sane, fetches return bounds-checked and sanity-
- * checked data, caller passes a good dns_name_t for the zone, etc)
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-#include <isc/magic.h>
-#include <isc/mem.h>
-#include <isc/sockaddr.h>
-
-#include <dns/types.h>
-#include <dns/view.h>
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Magic number checks
- ***/
-
-#define DNS_ADBFIND_MAGIC ISC_MAGIC('a','d','b','H')
-#define DNS_ADBFIND_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBFIND_MAGIC)
-#define DNS_ADBADDRINFO_MAGIC ISC_MAGIC('a','d','A','I')
-#define DNS_ADBADDRINFO_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBADDRINFO_MAGIC)
-
-
-/***
- *** TYPES
- ***/
-
-typedef struct dns_adbname dns_adbname_t;
-
-/*!
- *\brief
- * Represents a lookup for a single name.
- *
- * On return, the client can safely use "list", and can reorder the list.
- * Items may not be _deleted_ from this list, however, or added to it
- * other than by using the dns_adb_*() API.
- */
-struct dns_adbfind {
- /* Public */
- unsigned int magic; /*%< RO: magic */
- dns_adbaddrinfolist_t list; /*%< RO: list of addrs */
- unsigned int query_pending; /*%< RO: partial list */
- unsigned int partial_result; /*%< RO: addrs missing */
- unsigned int options; /*%< RO: options */
- isc_result_t result_v4; /*%< RO: v4 result */
- isc_result_t result_v6; /*%< RO: v6 result */
- ISC_LINK(dns_adbfind_t) publink; /*%< RW: client use */
-
- /* Private */
- isc_mutex_t lock; /* locks all below */
- in_port_t port;
- int name_bucket;
- unsigned int flags;
- dns_adbname_t *adbname;
- dns_adb_t *adb;
- isc_event_t event;
- ISC_LINK(dns_adbfind_t) plink;
-};
-
-/*
- * _INET:
- * _INET6:
- * return addresses of that type.
- *
- * _EMPTYEVENT:
- * Only schedule an event if no addresses are known.
- * Must set _WANTEVENT for this to be meaningful.
- *
- * _WANTEVENT:
- * An event is desired. Check this bit in the returned find to see
- * if one will actually be generated.
- *
- * _AVOIDFETCHES:
- * If set, fetches will not be generated unless no addresses are
- * available in any of the address families requested.
- *
- * _STARTATZONE:
- * Fetches will start using the closest zone data or use the root servers.
- * This is useful for reestablishing glue that has expired.
- *
- * _GLUEOK:
- * _HINTOK:
- * Glue or hints are ok. These are used when matching names already
- * in the adb, and when dns databases are searched.
- *
- * _RETURNLAME:
- * Return lame servers in a find, so that all addresses are returned.
- *
- * _LAMEPRUNED:
- * At least one address was omitted from the list because it was lame.
- * This bit will NEVER be set if _RETURNLAME is set in the createfind().
- */
-/*% Return addresses of type INET. */
-#define DNS_ADBFIND_INET 0x00000001
-/*% Return addresses of type INET6. */
-#define DNS_ADBFIND_INET6 0x00000002
-#define DNS_ADBFIND_ADDRESSMASK 0x00000003
-/*%
- * Only schedule an event if no addresses are known.
- * Must set _WANTEVENT for this to be meaningful.
- */
-#define DNS_ADBFIND_EMPTYEVENT 0x00000004
-/*%
- * An event is desired. Check this bit in the returned find to see
- * if one will actually be generated.
- */
-#define DNS_ADBFIND_WANTEVENT 0x00000008
-/*%
- * If set, fetches will not be generated unless no addresses are
- * available in any of the address families requested.
- */
-#define DNS_ADBFIND_AVOIDFETCHES 0x00000010
-/*%
- * Fetches will start using the closest zone data or use the root servers.
- * This is useful for reestablishing glue that has expired.
- */
-#define DNS_ADBFIND_STARTATZONE 0x00000020
-/*%
- * Glue or hints are ok. These are used when matching names already
- * in the adb, and when dns databases are searched.
- */
-#define DNS_ADBFIND_GLUEOK 0x00000040
-/*%
- * Glue or hints are ok. These are used when matching names already
- * in the adb, and when dns databases are searched.
- */
-#define DNS_ADBFIND_HINTOK 0x00000080
-/*%
- * Return lame servers in a find, so that all addresses are returned.
- */
-#define DNS_ADBFIND_RETURNLAME 0x00000100
-/*%
- * Only schedule an event if no addresses are known.
- * Must set _WANTEVENT for this to be meaningful.
- */
-#define DNS_ADBFIND_LAMEPRUNED 0x00000200
-
-/*%
- * The answers to queries come back as a list of these.
- */
-struct dns_adbaddrinfo {
- unsigned int magic; /*%< private */
-
- isc_sockaddr_t sockaddr; /*%< [rw] */
- unsigned int srtt; /*%< [rw] microseconds */
- unsigned int flags; /*%< [rw] */
- dns_adbentry_t *entry; /*%< private */
- ISC_LINK(dns_adbaddrinfo_t) publink;
-};
-
-/*!<
- * The event sent to the caller task is just a plain old isc_event_t. It
- * contains no data other than a simple status, passed in the "type" field
- * to indicate that another address resolved, or all partially resolved
- * addresses have failed to resolve.
- *
- * "sender" is the dns_adbfind_t used to issue this query.
- *
- * This is simply a standard event, with the "type" set to:
- *
- *\li #DNS_EVENT_ADBMOREADDRESSES -- another address resolved.
- *\li #DNS_EVENT_ADBNOMOREADDRESSES -- all pending addresses failed,
- * were canceled, or otherwise will
- * not be usable.
- *\li #DNS_EVENT_ADBCANCELED -- The request was canceled by a
- * 3rd party.
- *\li #DNS_EVENT_ADBNAMEDELETED -- The name was deleted, so this request
- * was canceled.
- *
- * In each of these cases, the addresses returned by the initial call
- * to dns_adb_createfind() can still be used until they are no longer needed.
- */
-
-/****
- **** FUNCTIONS
- ****/
-
-
-isc_result_t
-dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_timermgr_t *tmgr,
- isc_taskmgr_t *taskmgr, dns_adb_t **newadb);
-/*%<
- * Create a new ADB.
- *
- * Notes:
- *
- *\li Generally, applications should not create an ADB directly, but
- * should instead call dns_view_createresolver().
- *
- * Requires:
- *
- *\li 'mem' must be a valid memory context.
- *
- *\li 'view' be a pointer to a valid view.
- *
- *\li 'tmgr' be a pointer to a valid timer manager.
- *
- *\li 'taskmgr' be a pointer to a valid task manager.
- *
- *\li 'newadb' != NULL && '*newadb' == NULL.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS after happiness.
- *\li #ISC_R_NOMEMORY after resource allocation failure.
- */
-
-void
-dns_adb_attach(dns_adb_t *adb, dns_adb_t **adbp);
-/*%
- * Attach to an 'adb' to 'adbp'.
- *
- * Requires:
- *\li 'adb' to be a valid dns_adb_t, created via dns_adb_create().
- *\li 'adbp' to be a valid pointer to a *dns_adb_t which is initialized
- * to NULL.
- */
-
-void
-dns_adb_detach(dns_adb_t **adb);
-/*%
- * Delete the ADB. Sets *ADB to NULL. Cancels any outstanding requests.
- *
- * Requires:
- *
- *\li 'adb' be non-NULL and '*adb' be a valid dns_adb_t, created via
- * dns_adb_create().
- */
-
-void
-dns_adb_whenshutdown(dns_adb_t *adb, isc_task_t *task, isc_event_t **eventp);
-/*%
- * Send '*eventp' to 'task' when 'adb' has shutdown.
- *
- * Requires:
- *
- *\li '*adb' is a valid dns_adb_t.
- *
- *\li eventp != NULL && *eventp is a valid event.
- *
- * Ensures:
- *
- *\li *eventp == NULL
- *
- *\li The event's sender field is set to the value of adb when the event
- * is sent.
- */
-
-void
-dns_adb_shutdown(dns_adb_t *adb);
-/*%<
- * Shutdown 'adb'.
- *
- * Requires:
- *
- * \li '*adb' is a valid dns_adb_t.
- */
-
-isc_result_t
-dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
- void *arg, dns_name_t *name, dns_name_t *qname,
- dns_rdatatype_t qtype, unsigned int options,
- isc_stdtime_t now, dns_name_t *target,
- in_port_t port, dns_adbfind_t **find);
-/*%<
- * Main interface for clients. The adb will look up the name given in
- * "name" and will build up a list of found addresses, and perhaps start
- * internal fetches to resolve names that are unknown currently.
- *
- * If other addresses resolve after this call completes, an event will
- * be sent to the <task, taskaction, arg> with the sender of that event
- * set to a pointer to the dns_adbfind_t returned by this function.
- *
- * If no events will be generated, the *find->result_v4 and/or result_v6
- * members may be examined for address lookup status. The usual #ISC_R_SUCCESS,
- * #ISC_R_FAILURE, #DNS_R_NXDOMAIN, and #DNS_R_NXRRSET are returned, along with
- * #ISC_R_NOTFOUND meaning the ADB has not _yet_ found the values. In this
- * latter case, retrying may produce more addresses.
- *
- * If events will be returned, the result_v[46] members are only valid
- * when that event is actually returned.
- *
- * The list of addresses returned is unordered. The caller must impose
- * any ordering required. The list will not contain "known bad" addresses,
- * however. For instance, it will not return hosts that are known to be
- * lame for the zone in question.
- *
- * The caller cannot (directly) modify the contents of the address list's
- * fields other than the "link" field. All values can be read at any
- * time, however.
- *
- * The "now" parameter is used only for determining which entries that
- * have a specific time to live or expire time should be removed from
- * the running database. If specified as zero, the current time will
- * be retrieved and used.
- *
- * If 'target' is not NULL and 'name' is an alias (i.e. the name is
- * CNAME'd or DNAME'd to another name), then 'target' will be updated with
- * the domain name that 'name' is aliased to.
- *
- * All addresses returned will have the sockaddr's port set to 'port.'
- * The caller may change them directly in the dns_adbaddrinfo_t since
- * they are copies of the internal address only.
- *
- * XXXMLG Document options, especially the flags which control how
- * events are sent.
- *
- * Requires:
- *
- *\li *adb be a valid isc_adb_t object.
- *
- *\li If events are to be sent, *task be a valid task,
- * and isc_taskaction_t != NULL.
- *
- *\li *name is a valid dns_name_t.
- *
- *\li qname != NULL and *qname be a valid dns_name_t.
- *
- *\li target == NULL or target is a valid name with a buffer.
- *
- *\li find != NULL && *find == NULL.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS Addresses might have been returned, and events will be
- * delivered for unresolved addresses.
- *\li #ISC_R_NOMORE Addresses might have been returned, but no events
- * will ever be posted for this context. This is only
- * returned if task != NULL.
- *\li #ISC_R_NOMEMORY insufficient resources
- *\li #DNS_R_ALIAS 'name' is an alias for another name.
- *
- * Calls, and returns error codes from:
- *
- *\li isc_stdtime_get()
- *
- * Notes:
- *
- *\li No internal reference to "name" exists after this function
- * returns.
- */
-
-void
-dns_adb_cancelfind(dns_adbfind_t *find);
-/*%<
- * Cancels the find, and sends the event off to the caller.
- *
- * It is an error to call dns_adb_cancelfind() on a find where
- * no event is wanted, or will ever be sent.
- *
- * Note:
- *
- *\li It is possible that the real completion event was posted just
- * before the dns_adb_cancelfind() call was made. In this case,
- * dns_adb_cancelfind() will do nothing. The event callback needs
- * to be prepared to find this situation (i.e. result is valid but
- * the caller expects it to be canceled).
- *
- * Requires:
- *
- *\li 'find' be a valid dns_adbfind_t pointer.
- *
- *\li events would have been posted to the task. This can be checked
- * with (find->options & DNS_ADBFIND_WANTEVENT).
- *
- * Ensures:
- *
- *\li The event was posted to the task.
- */
-
-void
-dns_adb_destroyfind(dns_adbfind_t **find);
-/*%<
- * Destroys the find reference.
- *
- * Note:
- *
- *\li This can only be called after the event was delivered for a
- * find. Additionally, the event MUST have been freed via
- * isc_event_free() BEFORE this function is called.
- *
- * Requires:
- *
- *\li 'find' != NULL and *find be valid dns_adbfind_t pointer.
- *
- * Ensures:
- *
- *\li No "address found" events will be posted to the originating task
- * after this function returns.
- */
-
-void
-dns_adb_dump(dns_adb_t *adb, FILE *f);
-/*%<
- * This function is only used for debugging. It will dump as much of the
- * state of the running system as possible.
- *
- * Requires:
- *
- *\li adb be valid.
- *
- *\li f != NULL, and is a file open for writing.
- */
-
-void
-dns_adb_dumpfind(dns_adbfind_t *find, FILE *f);
-/*%<
- * This function is only used for debugging. Dump the data associated
- * with a find.
- *
- * Requires:
- *
- *\li find is valid.
- *
- * \li f != NULL, and is a file open for writing.
- */
-
-isc_result_t
-dns_adb_marklame(dns_adb_t *adb, dns_adbaddrinfo_t *addr, dns_name_t *qname,
- dns_rdatatype_t type, isc_stdtime_t expire_time);
-/*%<
- * Mark the given address as lame for the <qname,qtype>. expire_time should
- * be set to the time when the entry should expire. That is, if it is to
- * expire 10 minutes in the future, it should set it to (now + 10 * 60).
- *
- * Requires:
- *
- *\li adb be valid.
- *
- *\li addr be valid.
- *
- *\li qname be the qname used in the dns_adb_createfind() call.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS -- all is well.
- *\li #ISC_R_NOMEMORY -- could not mark address as lame.
- */
-
-/*
- * A reasonable default for RTT adjustments
- */
-#define DNS_ADB_RTTADJDEFAULT 7 /*%< default scale */
-#define DNS_ADB_RTTADJREPLACE 0 /*%< replace with our rtt */
-#define DNS_ADB_RTTADJAGE 10 /*%< age this rtt */
-
-void
-dns_adb_adjustsrtt(dns_adb_t *adb, dns_adbaddrinfo_t *addr,
- unsigned int rtt, unsigned int factor);
-/*%<
- * Mix the round trip time into the existing smoothed rtt.
-
- * The formula used
- * (where srtt is the existing rtt value, and rtt and factor are arguments to
- * this function):
- *
- *\code
- * new_srtt = (old_srtt / 10 * factor) + (rtt / 10 * (10 - factor));
- *\endcode
- *
- * XXXRTH Do we want to publish the formula? What if we want to change how
- * this works later on? Recommend/require that the units are
- * microseconds?
- *
- * Requires:
- *
- *\li adb be valid.
- *
- *\li addr be valid.
- *
- *\li 0 <= factor <= 10
- *
- * Note:
- *
- *\li The srtt in addr will be updated to reflect the new global
- * srtt value. This may include changes made by others.
- */
-
-void
-dns_adb_changeflags(dns_adb_t *adb, dns_adbaddrinfo_t *addr,
- unsigned int bits, unsigned int mask);
-/*%
- * Change Flags.
- *
- * Set the flags as given by:
- *
- *\li newflags = (oldflags & ~mask) | (bits & mask);
- *
- * Requires:
- *
- *\li adb be valid.
- *
- *\li addr be valid.
- */
-
-isc_result_t
-dns_adb_findaddrinfo(dns_adb_t *adb, isc_sockaddr_t *sa,
- dns_adbaddrinfo_t **addrp, isc_stdtime_t now);
-/*%<
- * Return a dns_adbaddrinfo_t that is associated with address 'sa'.
- *
- * Requires:
- *
- *\li adb is valid.
- *
- *\li sa is valid.
- *
- *\li addrp != NULL && *addrp == NULL
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_SHUTTINGDOWN
- */
-
-void
-dns_adb_freeaddrinfo(dns_adb_t *adb, dns_adbaddrinfo_t **addrp);
-/*%<
- * Free a dns_adbaddrinfo_t allocated by dns_adb_findaddrinfo().
- *
- * Requires:
- *
- *\li adb is valid.
- *
- *\li *addrp is a valid dns_adbaddrinfo_t *.
- */
-
-void
-dns_adb_flush(dns_adb_t *adb);
-/*%<
- * Flushes all cached data from the adb.
- *
- * Requires:
- *\li adb is valid.
- */
-
-void
-dns_adb_setadbsize(dns_adb_t *adb, isc_uint32_t size);
-/*%<
- * Set a target memory size. If memory usage exceeds the target
- * size entries will be removed before they would have expired on
- * a random basis.
- *
- * If 'size' is 0 then memory usage is unlimited.
- *
- * Requires:
- *\li 'adb' is valid.
- */
-
-void
-dns_adb_flushname(dns_adb_t *adb, dns_name_t *name);
-/*%<
- * Flush 'name' from the adb cache.
- *
- * Requires:
- *\li 'adb' is valid.
- *\li 'name' is valid.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_ADB_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: byaddr.h,v 1.22 2007/06/19 23:47:16 tbox Exp $ */
-
-#ifndef DNS_BYADDR_H
-#define DNS_BYADDR_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/byaddr.h
- * \brief
- * The byaddr module provides reverse lookup services for IPv4 and IPv6
- * addresses.
- *
- * MP:
- *\li The module ensures appropriate synchronization of data structures it
- * creates and manipulates.
- *
- * Reliability:
- *\li No anticipated impact.
- *
- * Resources:
- *\li TBS
- *
- * Security:
- *\li No anticipated impact.
- *
- * Standards:
- *\li RFCs: 1034, 1035, 2181, TBS
- *\li Drafts: TBS
- */
-
-#include <isc/lang.h>
-#include <isc/event.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/*%
- * A 'dns_byaddrevent_t' is returned when a byaddr completes.
- * The sender field will be set to the byaddr that completed. If 'result'
- * is ISC_R_SUCCESS, then 'names' will contain a list of names associated
- * with the address. The recipient of the event must not change the list
- * and must not refer to any of the name data after the event is freed.
- */
-typedef struct dns_byaddrevent {
- ISC_EVENT_COMMON(struct dns_byaddrevent);
- isc_result_t result;
- dns_namelist_t names;
-} dns_byaddrevent_t;
-
-/*
- * This option is deprecated since we now only consider nibbles.
-#define DNS_BYADDROPT_IPV6NIBBLE 0x0001
- */
-/*% Note DNS_BYADDROPT_IPV6NIBBLE is now deprecated. */
-#define DNS_BYADDROPT_IPV6INT 0x0002
-
-isc_result_t
-dns_byaddr_create(isc_mem_t *mctx, isc_netaddr_t *address, dns_view_t *view,
- unsigned int options, isc_task_t *task,
- isc_taskaction_t action, void *arg, dns_byaddr_t **byaddrp);
-/*%<
- * Find the domain name of 'address'.
- *
- * Notes:
- *
- *\li There is a reverse lookup format for IPv6 addresses, 'nibble'
- *
- *\li The 'nibble' format for that address is
- *
- * \code
- * 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa.
- * \endcode
- *
- *\li #DNS_BYADDROPT_IPV6INT can be used to get nibble lookups under ip6.int.
- *
- * Requires:
- *
- *\li 'mctx' is a valid mctx.
- *
- *\li 'address' is a valid IPv4 or IPv6 address.
- *
- *\li 'view' is a valid view which has a resolver.
- *
- *\li 'task' is a valid task.
- *
- *\li byaddrp != NULL && *byaddrp == NULL
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *
- *\li Any resolver-related error (e.g. #ISC_R_SHUTTINGDOWN) may also be
- * returned.
- */
-
-void
-dns_byaddr_cancel(dns_byaddr_t *byaddr);
-/*%<
- * Cancel 'byaddr'.
- *
- * Notes:
- *
- *\li If 'byaddr' has not completed, post its #DNS_EVENT_BYADDRDONE
- * event with a result code of #ISC_R_CANCELED.
- *
- * Requires:
- *
- *\li 'byaddr' is a valid byaddr.
- */
-
-void
-dns_byaddr_destroy(dns_byaddr_t **byaddrp);
-/*%<
- * Destroy 'byaddr'.
- *
- * Requires:
- *
- *\li '*byaddrp' is a valid byaddr.
- *
- *\li The caller has received the #DNS_EVENT_BYADDRDONE event (either because
- * the byaddr completed or because dns_byaddr_cancel() was called).
- *
- * Ensures:
- *
- *\li *byaddrp == NULL.
- */
-
-isc_result_t
-dns_byaddr_createptrname(isc_netaddr_t *address, isc_boolean_t nibble,
- dns_name_t *name);
-
-isc_result_t
-dns_byaddr_createptrname2(isc_netaddr_t *address, unsigned int options,
- dns_name_t *name);
-/*%<
- * Creates a name that would be used in a PTR query for this address. The
- * nibble flag indicates that the 'nibble' format is to be used if an IPv6
- * address is provided, instead of the 'bitstring' format. Since we dropped
- * the support of the bitstring labels, it is expected that the flag is always
- * set. 'options' are the same as for dns_byaddr_create().
- *
- * Requires:
- *
- * \li 'address' is a valid address.
- * \li 'name' is a valid name with a dedicated buffer.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_BYADDR_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: cache.h,v 1.26 2007/06/19 23:47:16 tbox Exp $ */
-
-#ifndef DNS_CACHE_H
-#define DNS_CACHE_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/cache.h
- * \brief
- * Defines dns_cache_t, the cache object.
- *
- * Notes:
- *\li A cache object contains DNS data of a single class.
- * Multiple classes will be handled by creating multiple
- * views, each with a different class and its own cache.
- *
- * MP:
- *\li See notes at the individual functions.
- *
- * Reliability:
- *
- * Resources:
- *
- * Security:
- *
- * Standards:
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-#include <isc/stdtime.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Functions
- ***/
-
-isc_result_t
-dns_cache_create(isc_mem_t *mctx, isc_taskmgr_t *taskmgr,
- isc_timermgr_t *timermgr, dns_rdataclass_t rdclass,
- const char *db_type, unsigned int db_argc, char **db_argv,
- dns_cache_t **cachep);
-/*%<
- * Create a new DNS cache.
- *
- * Requires:
- *
- *\li 'mctx' is a valid memory context
- *
- *\li 'taskmgr' is a valid task manager and 'timermgr' is a valid timer
- * manager, or both are NULL. If NULL, no periodic cleaning of the
- * cache will take place.
- *
- *\li 'cachep' is a valid pointer, and *cachep == NULL
- *
- * Ensures:
- *
- *\li '*cachep' is attached to the newly created cache
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- */
-
-void
-dns_cache_attach(dns_cache_t *cache, dns_cache_t **targetp);
-/*%<
- * Attach *targetp to cache.
- *
- * Requires:
- *
- *\li 'cache' is a valid cache.
- *
- *\li 'targetp' points to a NULL dns_cache_t *.
- *
- * Ensures:
- *
- *\li *targetp is attached to cache.
- */
-
-void
-dns_cache_detach(dns_cache_t **cachep);
-/*%<
- * Detach *cachep from its cache.
- *
- * Requires:
- *
- *\li 'cachep' points to a valid cache.
- *
- * Ensures:
- *
- *\li *cachep is NULL.
- *
- *\li If '*cachep' is the last reference to the cache,
- * all resources used by the cache will be freed
- */
-
-void
-dns_cache_attachdb(dns_cache_t *cache, dns_db_t **dbp);
-/*%<
- * Attach *dbp to the cache's database.
- *
- * Notes:
- *
- *\li This may be used to get a reference to the database for
- * the purpose of cache lookups (XXX currently it is also
- * the way to add data to the cache, but having a
- * separate dns_cache_add() interface instead would allow
- * more control over memory usage).
- * The caller should call dns_db_detach() on the reference
- * when it is no longer needed.
- *
- * Requires:
- *
- *\li 'cache' is a valid cache.
- *
- *\li 'dbp' points to a NULL dns_db *.
- *
- * Ensures:
- *
- *\li *dbp is attached to the database.
- */
-
-
-isc_result_t
-dns_cache_setfilename(dns_cache_t *cache, const char *filename);
-/*%<
- * If 'filename' is non-NULL, make the cache persistent.
- * The cache's data will be stored in the given file.
- * If 'filename' is NULL, make the cache non-persistent.
- * Files that are no longer used are not unlinked automatically.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li Various file-related failures
- */
-
-isc_result_t
-dns_cache_load(dns_cache_t *cache);
-/*%<
- * If the cache has a file name, load the cache contents from the file.
- * Previous cache contents are not discarded.
- * If no file name has been set, do nothing and return success.
- *
- * MT:
- *\li Multiple simultaneous attempts to load or dump the cache
- * will be serialized with respect to one another, but
- * the cache may be read and updated while the dump is
- * in progress. Updates performed during loading
- * may or may not be preserved, and reads may return
- * either the old or the newly loaded data.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- * \li Various failures depending on the database implementation type
- */
-
-isc_result_t
-dns_cache_dump(dns_cache_t *cache);
-/*%<
- * If the cache has a file name, write the cache contents to disk,
- * overwriting any preexisting file. If no file name has been set,
- * do nothing and return success.
- *
- * MT:
- *\li Multiple simultaneous attempts to load or dump the cache
- * will be serialized with respect to one another, but
- * the cache may be read and updated while the dump is
- * in progress. Updates performed during the dump may
- * or may not be reflected in the dumped file.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- * \li Various failures depending on the database implementation type
- */
-
-isc_result_t
-dns_cache_clean(dns_cache_t *cache, isc_stdtime_t now);
-/*%<
- * Force immediate cleaning of the cache, freeing all rdatasets
- * whose TTL has expired as of 'now' and that have no pending
- * references.
- */
-
-void
-dns_cache_setcleaninginterval(dns_cache_t *cache, unsigned int interval);
-/*%<
- * Set the periodic cache cleaning interval to 'interval' seconds.
- */
-
-void
-dns_cache_setcachesize(dns_cache_t *cache, isc_uint32_t size);
-/*%<
- * Set the maximum cache size. 0 means unlimited.
- */
-
-isc_result_t
-dns_cache_flush(dns_cache_t *cache);
-/*%<
- * Flushes all data from the cache.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- */
-
-isc_result_t
-dns_cache_flushname(dns_cache_t *cache, dns_name_t *name);
-/*
- * Flushes a given name from the cache.
- *
- * Requires:
- *\li 'cache' to be valid.
- *\li 'name' to be valid.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li other error returns.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_CACHE_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: callbacks.h,v 1.24 2007/06/19 23:47:16 tbox Exp $ */
-
-#ifndef DNS_CALLBACKS_H
-#define DNS_CALLBACKS_H 1
-
-/*! \file dns/callbacks.h */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Types
- ***/
-
-struct dns_rdatacallbacks {
- /*%
- * dns_load_master calls this when it has rdatasets to commit.
- */
- dns_addrdatasetfunc_t add;
- /*%
- * dns_load_master / dns_rdata_fromtext call this to issue a error.
- */
- void (*error)(struct dns_rdatacallbacks *, const char *, ...);
- /*%
- * dns_load_master / dns_rdata_fromtext call this to issue a warning.
- */
- void (*warn)(struct dns_rdatacallbacks *, const char *, ...);
- /*%
- * Private data handles for use by the above callback functions.
- */
- void *add_private;
- void *error_private;
- void *warn_private;
-};
-
-/***
- *** Initialization
- ***/
-
-void
-dns_rdatacallbacks_init(dns_rdatacallbacks_t *callbacks);
-/*%<
- * Initialize 'callbacks'.
- *
- *
- * \li 'error' and 'warn' are set to default callbacks that print the
- * error message through the DNS library log context.
- *
- *\li All other elements are initialized to NULL.
- *
- * Requires:
- * \li 'callbacks' is a valid dns_rdatacallbacks_t,
- */
-
-void
-dns_rdatacallbacks_init_stdio(dns_rdatacallbacks_t *callbacks);
-/*%<
- * Like dns_rdatacallbacks_init, but logs to stdio.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_CALLBACKS_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: cert.h,v 1.19 2007/06/19 23:47:16 tbox Exp $ */
-
-#ifndef DNS_CERT_H
-#define DNS_CERT_H 1
-
-/*! \file dns/cert.h */
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_cert_fromtext(dns_cert_t *certp, isc_textregion_t *source);
-/*%<
- * Convert the text 'source' refers to into a certificate type.
- * The text may contain either a mnemonic type name or a decimal type number.
- *
- * Requires:
- *\li 'certp' is a valid pointer.
- *
- *\li 'source' is a valid text region.
- *
- * Returns:
- *\li #ISC_R_SUCCESS on success
- *\li #ISC_R_RANGE numeric type is out of range
- *\li #DNS_R_UNKNOWN mnemonic type is unknown
- */
-
-isc_result_t
-dns_cert_totext(dns_cert_t cert, isc_buffer_t *target);
-/*%<
- * Put a textual representation of certificate type 'cert' into 'target'.
- *
- * Requires:
- *\li 'cert' is a valid cert.
- *
- *\li 'target' is a valid text buffer.
- *
- * Ensures:
- *\li If the result is success:
- * The used space in 'target' is updated.
- *
- * Returns:
- *\li #ISC_R_SUCCESS on success
- *\li #ISC_R_NOSPACE target buffer is too small
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_CERT_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.h,v 1.40.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef DNS_COMPRESS_H
-#define DNS_COMPRESS_H 1
-
-#include <isc/lang.h>
-#include <isc/region.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-#define DNS_COMPRESS_NONE 0x00 /*%< no compression */
-#define DNS_COMPRESS_GLOBAL14 0x01 /*%< "normal" compression. */
-#define DNS_COMPRESS_ALL 0x01 /*%< all compression. */
-#define DNS_COMPRESS_CASESENSITIVE 0x02 /*%< case sensitive compression. */
-
-/*! \file dns/compress.h
- * Direct manipulation of the structures is strongly discouraged.
- */
-
-#define DNS_COMPRESS_TABLESIZE 64
-#define DNS_COMPRESS_INITIALNODES 16
-
-typedef struct dns_compressnode dns_compressnode_t;
-
-struct dns_compressnode {
- isc_region_t r;
- isc_uint16_t offset;
- isc_uint16_t count;
- isc_uint8_t labels;
- dns_compressnode_t *next;
-};
-
-struct dns_compress {
- unsigned int magic; /*%< Magic number. */
- unsigned int allowed; /*%< Allowed methods. */
- int edns; /*%< Edns version or -1. */
- /*% Global compression table. */
- dns_compressnode_t *table[DNS_COMPRESS_TABLESIZE];
- /*% Preallocated nodes for the table. */
- dns_compressnode_t initialnodes[DNS_COMPRESS_INITIALNODES];
- isc_uint16_t count; /*%< Number of nodes. */
- isc_mem_t *mctx; /*%< Memory context. */
-};
-
-typedef enum {
- DNS_DECOMPRESS_ANY, /*%< Any compression */
- DNS_DECOMPRESS_STRICT, /*%< Allowed compression */
- DNS_DECOMPRESS_NONE /*%< No compression */
-} dns_decompresstype_t;
-
-struct dns_decompress {
- unsigned int magic; /*%< Magic number. */
- unsigned int allowed; /*%< Allowed methods. */
- int edns; /*%< Edns version or -1. */
- dns_decompresstype_t type; /*%< Strict checking */
-};
-
-isc_result_t
-dns_compress_init(dns_compress_t *cctx, int edns, isc_mem_t *mctx);
-/*%<
- * Initialise the compression context structure pointed to by 'cctx'.
- *
- * Requires:
- * \li 'cctx' is a valid dns_compress_t structure.
- * \li 'mctx' is an initialized memory context.
- * Ensures:
- * \li cctx->global is initialized.
- *
- * Returns:
- * \li #ISC_R_SUCCESS
- * \li failures from dns_rbt_create()
- */
-
-void
-dns_compress_invalidate(dns_compress_t *cctx);
-
-/*%<
- * Invalidate the compression structure pointed to by cctx.
- *
- * Requires:
- *\li 'cctx' to be initialized.
- */
-
-void
-dns_compress_setmethods(dns_compress_t *cctx, unsigned int allowed);
-
-/*%<
- * Sets allowed compression methods.
- *
- * Requires:
- *\li 'cctx' to be initialized.
- */
-
-unsigned int
-dns_compress_getmethods(dns_compress_t *cctx);
-
-/*%<
- * Gets allowed compression methods.
- *
- * Requires:
- *\li 'cctx' to be initialized.
- *
- * Returns:
- *\li allowed compression bitmap.
- */
-
-void
-dns_compress_setsensitive(dns_compress_t *cctx, isc_boolean_t sensitive);
-
-/*
- * Preserve the case of compressed domain names.
- *
- * Requires:
- * 'cctx' to be initialized.
- */
-
-isc_boolean_t
-dns_compress_getsensitive(dns_compress_t *cctx);
-/*
- * Return whether case is to be preserved when compressing
- * domain names.
- *
- * Requires:
- * 'cctx' to be initialized.
- */
-
-int
-dns_compress_getedns(dns_compress_t *cctx);
-
-/*%<
- * Gets edns value.
- *
- * Requires:
- *\li 'cctx' to be initialized.
- *
- * Returns:
- *\li -1 .. 255
- */
-
-isc_boolean_t
-dns_compress_findglobal(dns_compress_t *cctx, const dns_name_t *name,
- dns_name_t *prefix, isc_uint16_t *offset);
-/*%<
- * Finds longest possible match of 'name' in the global compression table.
- *
- * Requires:
- *\li 'cctx' to be initialized.
- *\li 'name' to be a absolute name.
- *\li 'prefix' to be initialized.
- *\li 'offset' to point to an isc_uint16_t.
- *
- * Ensures:
- *\li 'prefix' and 'offset' are valid if ISC_TRUE is returned.
- *
- * Returns:
- *\li #ISC_TRUE / #ISC_FALSE
- */
-
-void
-dns_compress_add(dns_compress_t *cctx, const dns_name_t *name,
- const dns_name_t *prefix, isc_uint16_t offset);
-/*%<
- * Add compression pointers for 'name' to the compression table,
- * not replacing existing pointers.
- *
- * Requires:
- *\li 'cctx' initialized
- *
- *\li 'name' must be initialized and absolute, and must remain
- * valid until the message compression is complete.
- *
- *\li 'prefix' must be a prefix returned by
- * dns_compress_findglobal(), or the same as 'name'.
- */
-
-void
-dns_compress_rollback(dns_compress_t *cctx, isc_uint16_t offset);
-
-/*%<
- * Remove any compression pointers from global table >= offset.
- *
- * Requires:
- *\li 'cctx' is initialized.
- */
-
-void
-dns_decompress_init(dns_decompress_t *dctx, int edns,
- dns_decompresstype_t type);
-
-/*%<
- * Initializes 'dctx'.
- * Records 'edns' and 'type' into the structure.
- *
- * Requires:
- *\li 'dctx' to be a valid pointer.
- */
-
-void
-dns_decompress_invalidate(dns_decompress_t *dctx);
-
-/*%<
- * Invalidates 'dctx'.
- *
- * Requires:
- *\li 'dctx' to be initialized
- */
-
-void
-dns_decompress_setmethods(dns_decompress_t *dctx, unsigned int allowed);
-
-/*%<
- * Sets 'dctx->allowed' to 'allowed'.
- *
- * Requires:
- *\li 'dctx' to be initialized
- */
-
-unsigned int
-dns_decompress_getmethods(dns_decompress_t *dctx);
-
-/*%<
- * Returns 'dctx->allowed'
- *
- * Requires:
- *\li 'dctx' to be initialized
- */
-
-int
-dns_decompress_edns(dns_decompress_t *dctx);
-
-/*%<
- * Returns 'dctx->edns'
- *
- * Requires:
- *\li 'dctx' to be initialized
- */
-
-dns_decompresstype_t
-dns_decompress_type(dns_decompress_t *dctx);
-
-/*%<
- * Returns 'dctx->type'
- *
- * Requires:
- *\li 'dctx' to be initialized
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_COMPRESS_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: db.h,v 1.93.50.3 2009/01/18 23:25:17 marka Exp $ */
-
-#ifndef DNS_DB_H
-#define DNS_DB_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/db.h
- * \brief
- * The DNS DB interface allows named rdatasets to be stored and retrieved.
- *
- * The dns_db_t type is like a "virtual class". To actually use
- * DBs, an implementation of the class is required.
- *
- * XXX more XXX
- *
- * MP:
- * \li The module ensures appropriate synchronization of data structures it
- * creates and manipulates.
- *
- * Reliability:
- * \li No anticipated impact.
- *
- * Resources:
- * \li TBS
- *
- * Security:
- * \li No anticipated impact.
- *
- * Standards:
- * \li None.
- */
-
-/*****
- ***** Imports
- *****/
-
-#include <isc/lang.h>
-#include <isc/magic.h>
-#include <isc/ondestroy.h>
-#include <isc/stdtime.h>
-
-#include <dns/name.h>
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/*****
- ***** Types
- *****/
-
-typedef struct dns_dbmethods {
- void (*attach)(dns_db_t *source, dns_db_t **targetp);
- void (*detach)(dns_db_t **dbp);
- isc_result_t (*beginload)(dns_db_t *db, dns_addrdatasetfunc_t *addp,
- dns_dbload_t **dbloadp);
- isc_result_t (*endload)(dns_db_t *db, dns_dbload_t **dbloadp);
- isc_result_t (*dump)(dns_db_t *db, dns_dbversion_t *version,
- const char *filename,
- dns_masterformat_t masterformat);
- void (*currentversion)(dns_db_t *db,
- dns_dbversion_t **versionp);
- isc_result_t (*newversion)(dns_db_t *db,
- dns_dbversion_t **versionp);
- void (*attachversion)(dns_db_t *db, dns_dbversion_t *source,
- dns_dbversion_t **targetp);
- void (*closeversion)(dns_db_t *db,
- dns_dbversion_t **versionp,
- isc_boolean_t commit);
- isc_result_t (*findnode)(dns_db_t *db, dns_name_t *name,
- isc_boolean_t create,
- dns_dbnode_t **nodep);
- isc_result_t (*find)(dns_db_t *db, dns_name_t *name,
- dns_dbversion_t *version,
- dns_rdatatype_t type, unsigned int options,
- isc_stdtime_t now,
- dns_dbnode_t **nodep, dns_name_t *foundname,
- dns_rdataset_t *rdataset,
- dns_rdataset_t *sigrdataset);
- isc_result_t (*findzonecut)(dns_db_t *db, dns_name_t *name,
- unsigned int options, isc_stdtime_t now,
- dns_dbnode_t **nodep,
- dns_name_t *foundname,
- dns_rdataset_t *rdataset,
- dns_rdataset_t *sigrdataset);
- void (*attachnode)(dns_db_t *db,
- dns_dbnode_t *source,
- dns_dbnode_t **targetp);
- void (*detachnode)(dns_db_t *db,
- dns_dbnode_t **targetp);
- isc_result_t (*expirenode)(dns_db_t *db, dns_dbnode_t *node,
- isc_stdtime_t now);
- void (*printnode)(dns_db_t *db, dns_dbnode_t *node,
- FILE *out);
- isc_result_t (*createiterator)(dns_db_t *db, unsigned int options,
- dns_dbiterator_t **iteratorp);
- isc_result_t (*findrdataset)(dns_db_t *db, dns_dbnode_t *node,
- dns_dbversion_t *version,
- dns_rdatatype_t type,
- dns_rdatatype_t covers,
- isc_stdtime_t now,
- dns_rdataset_t *rdataset,
- dns_rdataset_t *sigrdataset);
- isc_result_t (*allrdatasets)(dns_db_t *db, dns_dbnode_t *node,
- dns_dbversion_t *version,
- isc_stdtime_t now,
- dns_rdatasetiter_t **iteratorp);
- isc_result_t (*addrdataset)(dns_db_t *db, dns_dbnode_t *node,
- dns_dbversion_t *version,
- isc_stdtime_t now,
- dns_rdataset_t *rdataset,
- unsigned int options,
- dns_rdataset_t *addedrdataset);
- isc_result_t (*subtractrdataset)(dns_db_t *db, dns_dbnode_t *node,
- dns_dbversion_t *version,
- dns_rdataset_t *rdataset,
- unsigned int options,
- dns_rdataset_t *newrdataset);
- isc_result_t (*deleterdataset)(dns_db_t *db, dns_dbnode_t *node,
- dns_dbversion_t *version,
- dns_rdatatype_t type,
- dns_rdatatype_t covers);
- isc_boolean_t (*issecure)(dns_db_t *db);
- unsigned int (*nodecount)(dns_db_t *db);
- isc_boolean_t (*ispersistent)(dns_db_t *db);
- void (*overmem)(dns_db_t *db, isc_boolean_t overmem);
- void (*settask)(dns_db_t *db, isc_task_t *);
- isc_result_t (*getoriginnode)(dns_db_t *db, dns_dbnode_t **nodep);
- void (*transfernode)(dns_db_t *db, dns_dbnode_t **sourcep,
- dns_dbnode_t **targetp);
- isc_result_t (*getnsec3parameters)(dns_db_t *db,
- dns_dbversion_t *version,
- dns_hash_t *hash,
- isc_uint8_t *flags,
- isc_uint16_t *iterations,
- unsigned char *salt,
- size_t *salt_len);
- isc_result_t (*findnsec3node)(dns_db_t *db, dns_name_t *name,
- isc_boolean_t create,
- dns_dbnode_t **nodep);
- isc_result_t (*setsigningtime)(dns_db_t *db,
- dns_rdataset_t *rdataset,
- isc_stdtime_t resign);
- isc_result_t (*getsigningtime)(dns_db_t *db,
- dns_rdataset_t *rdataset,
- dns_name_t *name);
- void (*resigned)(dns_db_t *db, dns_rdataset_t *rdataset,
- dns_dbversion_t *version);
- isc_boolean_t (*isdnssec)(dns_db_t *db);
- dns_stats_t *(*getrrsetstats)(dns_db_t *db);
-} dns_dbmethods_t;
-
-typedef isc_result_t
-(*dns_dbcreatefunc_t)(isc_mem_t *mctx, dns_name_t *name,
- dns_dbtype_t type, dns_rdataclass_t rdclass,
- unsigned int argc, char *argv[], void *driverarg,
- dns_db_t **dbp);
-
-#define DNS_DB_MAGIC ISC_MAGIC('D','N','S','D')
-#define DNS_DB_VALID(db) ISC_MAGIC_VALID(db, DNS_DB_MAGIC)
-
-/*%
- * This structure is actually just the common prefix of a DNS db
- * implementation's version of a dns_db_t.
- * \brief
- * Direct use of this structure by clients is forbidden. DB implementations
- * may change the structure. 'magic' must be DNS_DB_MAGIC for any of the
- * dns_db_ routines to work. DB implementations must maintain all DB
- * invariants.
- */
-struct dns_db {
- unsigned int magic;
- unsigned int impmagic;
- dns_dbmethods_t * methods;
- isc_uint16_t attributes;
- dns_rdataclass_t rdclass;
- dns_name_t origin;
- isc_ondestroy_t ondest;
- isc_mem_t * mctx;
-};
-
-#define DNS_DBATTR_CACHE 0x01
-#define DNS_DBATTR_STUB 0x02
-
-/*@{*/
-/*%
- * Options that can be specified for dns_db_find().
- */
-#define DNS_DBFIND_GLUEOK 0x0001
-#define DNS_DBFIND_VALIDATEGLUE 0x0002
-#define DNS_DBFIND_NOWILD 0x0004
-#define DNS_DBFIND_PENDINGOK 0x0008
-#define DNS_DBFIND_NOEXACT 0x0010
-#define DNS_DBFIND_FORCENSEC 0x0020
-#define DNS_DBFIND_COVERINGNSEC 0x0040
-#define DNS_DBFIND_FORCENSEC3 0x0080
-#define DNS_DBFIND_ADDITIONALOK 0x0100
-/*@}*/
-
-/*@{*/
-/*%
- * Options that can be specified for dns_db_addrdataset().
- */
-#define DNS_DBADD_MERGE 0x01
-#define DNS_DBADD_FORCE 0x02
-#define DNS_DBADD_EXACT 0x04
-#define DNS_DBADD_EXACTTTL 0x08
-/*@}*/
-
-/*%
- * Options that can be specified for dns_db_subtractrdataset().
- */
-#define DNS_DBSUB_EXACT 0x01
-
-/*@{*/
-/*%
- * Iterator options
- */
-#define DNS_DB_RELATIVENAMES 0x1
-#define DNS_DB_NSEC3ONLY 0x2
-#define DNS_DB_NONSEC3 0x4
-/*@}*/
-
-/*****
- ***** Methods
- *****/
-
-/***
- *** Basic DB Methods
- ***/
-
-isc_result_t
-dns_db_create(isc_mem_t *mctx, const char *db_type, dns_name_t *origin,
- dns_dbtype_t type, dns_rdataclass_t rdclass,
- unsigned int argc, char *argv[], dns_db_t **dbp);
-/*%<
- * Create a new database using implementation 'db_type'.
- *
- * Notes:
- * \li All names in the database must be subdomains of 'origin' and in class
- * 'rdclass'. The database makes its own copy of the origin, so the
- * caller may do whatever they like with 'origin' and its storage once the
- * call returns.
- *
- * \li DB implementation-specific parameters are passed using argc and argv.
- *
- * Requires:
- *
- * \li dbp != NULL and *dbp == NULL
- *
- * \li 'origin' is a valid absolute domain name.
- *
- * \li mctx is a valid memory context
- *
- * Ensures:
- *
- * \li A copy of 'origin' has been made for the databases use, and the
- * caller is free to do whatever they want with the name and storage
- * associated with 'origin'.
- *
- * Returns:
- *
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
- * \li #ISC_R_NOTFOUND db_type not found
- *
- * \li Many other errors are possible, depending on what db_type was
- * specified.
- */
-
-void
-dns_db_attach(dns_db_t *source, dns_db_t **targetp);
-/*%<
- * Attach *targetp to source.
- *
- * Requires:
- *
- * \li 'source' is a valid database.
- *
- * \li 'targetp' points to a NULL dns_db_t *.
- *
- * Ensures:
- *
- * \li *targetp is attached to source.
- */
-
-void
-dns_db_detach(dns_db_t **dbp);
-/*%<
- * Detach *dbp from its database.
- *
- * Requires:
- *
- * \li 'dbp' points to a valid database.
- *
- * Ensures:
- *
- * \li *dbp is NULL.
- *
- * \li If '*dbp' is the last reference to the database,
- * all resources used by the database will be freed
- */
-
-isc_result_t
-dns_db_ondestroy(dns_db_t *db, isc_task_t *task, isc_event_t **eventp);
-/*%<
- * Causes 'eventp' to be sent to be sent to 'task' when the database is
- * destroyed.
- *
- * Note; ownership of the eventp is taken from the caller (and *eventp is
- * set to NULL). The sender field of the event is set to 'db' before it is
- * sent to the task.
- */
-
-isc_boolean_t
-dns_db_iscache(dns_db_t *db);
-/*%<
- * Does 'db' have cache semantics?
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * Returns:
- * \li #ISC_TRUE 'db' has cache semantics
- * \li #ISC_FALSE otherwise
- */
-
-isc_boolean_t
-dns_db_iszone(dns_db_t *db);
-/*%<
- * Does 'db' have zone semantics?
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * Returns:
- * \li #ISC_TRUE 'db' has zone semantics
- * \li #ISC_FALSE otherwise
- */
-
-isc_boolean_t
-dns_db_isstub(dns_db_t *db);
-/*%<
- * Does 'db' have stub semantics?
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * Returns:
- * \li #ISC_TRUE 'db' has zone semantics
- * \li #ISC_FALSE otherwise
- */
-
-isc_boolean_t
-dns_db_issecure(dns_db_t *db);
-/*%<
- * Is 'db' secure?
- *
- * Requires:
- *
- * \li 'db' is a valid database with zone semantics.
- *
- * Returns:
- * \li #ISC_TRUE 'db' is secure.
- * \li #ISC_FALSE 'db' is not secure.
- */
-
-isc_boolean_t
-dns_db_isdnssec(dns_db_t *db);
-/*%<
- * Is 'db' secure or partially secure?
- *
- * Requires:
- *
- * \li 'db' is a valid database with zone semantics.
- *
- * Returns:
- * \li #ISC_TRUE 'db' is secure or is partially.
- * \li #ISC_FALSE 'db' is not secure.
- */
-
-dns_name_t *
-dns_db_origin(dns_db_t *db);
-/*%<
- * The origin of the database.
- *
- * Note: caller must not try to change this name.
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * Returns:
- *
- * \li The origin of the database.
- */
-
-dns_rdataclass_t
-dns_db_class(dns_db_t *db);
-/*%<
- * The class of the database.
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * Returns:
- *
- * \li The class of the database.
- */
-
-isc_result_t
-dns_db_beginload(dns_db_t *db, dns_addrdatasetfunc_t *addp,
- dns_dbload_t **dbloadp);
-/*%<
- * Begin loading 'db'.
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * \li This is the first attempt to load 'db'.
- *
- * \li addp != NULL && *addp == NULL
- *
- * \li dbloadp != NULL && *dbloadp == NULL
- *
- * Ensures:
- *
- * \li On success, *addp will be a valid dns_addrdatasetfunc_t suitable
- * for loading 'db'. *dbloadp will be a valid DB load context which
- * should be used as 'arg' when *addp is called.
- *
- * Returns:
- *
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
- *
- * \li Other results are possible, depending upon the database
- * implementation used, syntax errors in the master file, etc.
- */
-
-isc_result_t
-dns_db_endload(dns_db_t *db, dns_dbload_t **dbloadp);
-/*%<
- * Finish loading 'db'.
- *
- * Requires:
- *
- * \li 'db' is a valid database that is being loaded.
- *
- * \li dbloadp != NULL and *dbloadp is a valid database load context.
- *
- * Ensures:
- *
- * \li *dbloadp == NULL
- *
- * Returns:
- *
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
- *
- * \li Other results are possible, depending upon the database
- * implementation used, syntax errors in the master file, etc.
- */
-
-isc_result_t
-dns_db_load(dns_db_t *db, const char *filename);
-
-isc_result_t
-dns_db_load2(dns_db_t *db, const char *filename, dns_masterformat_t format);
-/*%<
- * Load master file 'filename' into 'db'.
- *
- * Notes:
- * \li This routine is equivalent to calling
- *
- *\code
- * dns_db_beginload();
- * dns_master_loadfile();
- * dns_db_endload();
- *\endcode
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * \li This is the first attempt to load 'db'.
- *
- * Returns:
- *
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
- *
- * \li Other results are possible, depending upon the database
- * implementation used, syntax errors in the master file, etc.
- */
-
-isc_result_t
-dns_db_dump(dns_db_t *db, dns_dbversion_t *version, const char *filename);
-
-isc_result_t
-dns_db_dump2(dns_db_t *db, dns_dbversion_t *version, const char *filename,
- dns_masterformat_t masterformat);
-/*%<
- * Dump version 'version' of 'db' to master file 'filename'.
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * \li 'version' is a valid version.
- *
- * Returns:
- *
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
- *
- * \li Other results are possible, depending upon the database
- * implementation used, OS file errors, etc.
- */
-
-/***
- *** Version Methods
- ***/
-
-void
-dns_db_currentversion(dns_db_t *db, dns_dbversion_t **versionp);
-/*%<
- * Open the current version for reading.
- *
- * Requires:
- *
- * \li 'db' is a valid database with zone semantics.
- *
- * \li versionp != NULL && *verisonp == NULL
- *
- * Ensures:
- *
- * \li On success, '*versionp' is attached to the current version.
- *
- */
-
-isc_result_t
-dns_db_newversion(dns_db_t *db, dns_dbversion_t **versionp);
-/*%<
- * Open a new version for reading and writing.
- *
- * Requires:
- *
- * \li 'db' is a valid database with zone semantics.
- *
- * \li versionp != NULL && *verisonp == NULL
- *
- * Ensures:
- *
- * \li On success, '*versionp' is attached to the current version.
- *
- * Returns:
- *
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
- *
- * \li Other results are possible, depending upon the database
- * implementation used.
- */
-
-void
-dns_db_attachversion(dns_db_t *db, dns_dbversion_t *source,
- dns_dbversion_t **targetp);
-/*%<
- * Attach '*targetp' to 'source'.
- *
- * Requires:
- *
- * \li 'db' is a valid database with zone semantics.
- *
- * \li source is a valid open version
- *
- * \li targetp != NULL && *targetp == NULL
- *
- * Ensures:
- *
- * \li '*targetp' is attached to source.
- */
-
-void
-dns_db_closeversion(dns_db_t *db, dns_dbversion_t **versionp,
- isc_boolean_t commit);
-/*%<
- * Close version '*versionp'.
- *
- * Note: if '*versionp' is a read-write version and 'commit' is ISC_TRUE,
- * then all changes made in the version will take effect, otherwise they
- * will be rolled back. The value if 'commit' is ignored for read-only
- * versions.
- *
- * Requires:
- *
- * \li 'db' is a valid database with zone semantics.
- *
- * \li '*versionp' refers to a valid version.
- *
- * \li If committing a writable version, then there must be no other
- * outstanding references to the version (e.g. an active rdataset
- * iterator).
- *
- * Ensures:
- *
- * \li *versionp == NULL
- *
- * \li If *versionp is a read-write version, and commit is ISC_TRUE, then
- * the version will become the current version. If !commit, then all
- * changes made in the version will be undone, and the version will
- * not become the current version.
- */
-
-/***
- *** Node Methods
- ***/
-
-isc_result_t
-dns_db_findnode(dns_db_t *db, dns_name_t *name, isc_boolean_t create,
- dns_dbnode_t **nodep);
-/*%<
- * Find the node with name 'name'.
- *
- * Notes:
- * \li If 'create' is ISC_TRUE and no node with name 'name' exists, then
- * such a node will be created.
- *
- * \li This routine is for finding or creating a node with the specified
- * name. There are no partial matches. It is not suitable for use
- * in building responses to ordinary DNS queries; clients which wish
- * to do that should use dns_db_find() instead.
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * \li 'name' is a valid, non-empty, absolute name.
- *
- * \li nodep != NULL && *nodep == NULL
- *
- * Ensures:
- *
- * \li On success, *nodep is attached to the node with name 'name'.
- *
- * Returns:
- *
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_NOTFOUND If !create and name not found.
- * \li #ISC_R_NOMEMORY Can only happen if create is ISC_TRUE.
- *
- * \li Other results are possible, depending upon the database
- * implementation used.
- */
-
-isc_result_t
-dns_db_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
- dns_rdatatype_t type, unsigned int options, isc_stdtime_t now,
- dns_dbnode_t **nodep, dns_name_t *foundname,
- dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
-/*%<
- * Find the best match for 'name' and 'type' in version 'version' of 'db'.
- *
- * Notes:
- *
- * \li If type == dns_rdataset_any, then rdataset will not be bound.
- *
- * \li If 'options' does not have #DNS_DBFIND_GLUEOK set, then no glue will
- * be returned. For zone databases, glue is as defined in RFC2181.
- * For cache databases, glue is any rdataset with a trust of
- * dns_trust_glue.
- *
- * \li If 'options' does not have #DNS_DBFIND_PENDINGOK set, then no
- * pending data will be returned. This option is only meaningful for
- * cache databases.
- *
- * \li If the #DNS_DBFIND_NOWILD option is set, then wildcard matching will
- * be disabled. This option is only meaningful for zone databases.
- *
- * \li If the #DNS_DBFIND_FORCENSEC option is set, the database is assumed to
- * have NSEC records, and these will be returned when appropriate. This
- * is only necessary when querying a database that was not secure
- * when created.
- *
- * \li If the DNS_DBFIND_COVERINGNSEC option is set, then look for a
- * NSEC record that potentially covers 'name' if a answer cannot
- * be found. Note the returned NSEC needs to be checked to ensure
- * that it is correct. This only affects answers returned from the
- * cache.
- *
- * \li To respond to a query for SIG records, the caller should create a
- * rdataset iterator and extract the signatures from each rdataset.
- *
- * \li Making queries of type ANY with #DNS_DBFIND_GLUEOK is not recommended,
- * because the burden of determining whether a given rdataset is valid
- * glue or not falls upon the caller.
- *
- * \li The 'now' field is ignored if 'db' is a zone database. If 'db' is a
- * cache database, an rdataset will not be found unless it expires after
- * 'now'. Any ANY query will not match unless at least one rdataset at
- * the node expires after 'now'. If 'now' is zero, then the current time
- * will be used.
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * \li 'type' is not SIG, or a meta-RR type other than 'ANY' (e.g. 'OPT').
- *
- * \li 'nodep' is NULL, or nodep is a valid pointer and *nodep == NULL.
- *
- * \li 'foundname' is a valid name with a dedicated buffer.
- *
- * \li 'rdataset' is NULL, or is a valid unassociated rdataset.
- *
- * Ensures,
- * on a non-error completion:
- *
- * \li If nodep != NULL, then it is bound to the found node.
- *
- * \li If foundname != NULL, then it contains the full name of the
- * found node.
- *
- * \li If rdataset != NULL and type != dns_rdatatype_any, then
- * rdataset is bound to the found rdataset.
- *
- * Non-error results are:
- *
- * \li #ISC_R_SUCCESS The desired node and type were
- * found.
- *
- * \li #DNS_R_WILDCARD The desired node and type were
- * found after performing
- * wildcard matching. This is
- * only returned if the
- * #DNS_DBFIND_INDICATEWILD
- * option is set; otherwise
- * #ISC_R_SUCCESS is returned.
- *
- * \li #DNS_R_GLUE The desired node and type were
- * found, but are glue. This
- * result can only occur if
- * the DNS_DBFIND_GLUEOK option
- * is set. This result can only
- * occur if 'db' is a zone
- * database. If type ==
- * dns_rdatatype_any, then the
- * node returned may contain, or
- * consist entirely of invalid
- * glue (i.e. data occluded by a
- * zone cut). The caller must
- * take care not to return invalid
- * glue to a client.
- *
- * \li #DNS_R_DELEGATION The data requested is beneath
- * a zone cut. node, foundname,
- * and rdataset reference the
- * NS RRset of the zone cut.
- * If 'db' is a cache database,
- * then this is the deepest known
- * delegation.
- *
- * \li #DNS_R_ZONECUT type == dns_rdatatype_any, and
- * the desired node is a zonecut.
- * The caller must take care not
- * to return inappropriate glue
- * to a client. This result can
- * only occur if 'db' is a zone
- * database and DNS_DBFIND_GLUEOK
- * is set.
- *
- * \li #DNS_R_DNAME The data requested is beneath
- * a DNAME. node, foundname,
- * and rdataset reference the
- * DNAME RRset.
- *
- * \li #DNS_R_CNAME The rdataset requested was not
- * found, but there is a CNAME
- * at the desired name. node,
- * foundname, and rdataset
- * reference the CNAME RRset.
- *
- * \li #DNS_R_NXDOMAIN The desired name does not
- * exist.
- *
- * \li #DNS_R_NXRRSET The desired name exists, but
- * the desired type does not.
- *
- * \li #ISC_R_NOTFOUND The desired name does not
- * exist, and no delegation could
- * be found. This result can only
- * occur if 'db' is a cache
- * database. The caller should
- * use its nameserver(s) of last
- * resort (e.g. root hints).
- *
- * \li #DNS_R_NCACHENXDOMAIN The desired name does not
- * exist. 'node' is bound to the
- * cache node with the desired
- * name, and 'rdataset' contains
- * the negative caching proof.
- *
- * \li #DNS_R_NCACHENXRRSET The desired type does not
- * exist. 'node' is bound to the
- * cache node with the desired
- * name, and 'rdataset' contains
- * the negative caching proof.
- *
- * \li #DNS_R_EMPTYNAME The name exists but there is
- * no data at the name.
- *
- * \li #DNS_R_COVERINGNSEC The returned data is a NSEC
- * that potentially covers 'name'.
- *
- * Error results:
- *
- * \li #ISC_R_NOMEMORY
- *
- * \li #DNS_R_BADDB Data that is required to be
- * present in the DB, e.g. an NSEC
- * record in a secure zone, is not
- * present.
- *
- * \li Other results are possible, and should all be treated as
- * errors.
- */
-
-isc_result_t
-dns_db_findzonecut(dns_db_t *db, dns_name_t *name,
- unsigned int options, isc_stdtime_t now,
- dns_dbnode_t **nodep, dns_name_t *foundname,
- dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
-/*%<
- * Find the deepest known zonecut which encloses 'name' in 'db'.
- *
- * Notes:
- *
- * \li If the #DNS_DBFIND_NOEXACT option is set, then the zonecut returned
- * (if any) will be the deepest known ancestor of 'name'.
- *
- * \li If 'now' is zero, then the current time will be used.
- *
- * Requires:
- *
- * \li 'db' is a valid database with cache semantics.
- *
- * \li 'nodep' is NULL, or nodep is a valid pointer and *nodep == NULL.
- *
- * \li 'foundname' is a valid name with a dedicated buffer.
- *
- * \li 'rdataset' is NULL, or is a valid unassociated rdataset.
- *
- * Ensures, on a non-error completion:
- *
- * \li If nodep != NULL, then it is bound to the found node.
- *
- * \li If foundname != NULL, then it contains the full name of the
- * found node.
- *
- * \li If rdataset != NULL and type != dns_rdatatype_any, then
- * rdataset is bound to the found rdataset.
- *
- * Non-error results are:
- *
- * \li #ISC_R_SUCCESS
- *
- * \li #ISC_R_NOTFOUND
- *
- * \li Other results are possible, and should all be treated as
- * errors.
- */
-
-void
-dns_db_attachnode(dns_db_t *db, dns_dbnode_t *source, dns_dbnode_t **targetp);
-/*%<
- * Attach *targetp to source.
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * \li 'source' is a valid node.
- *
- * \li 'targetp' points to a NULL dns_dbnode_t *.
- *
- * Ensures:
- *
- * \li *targetp is attached to source.
- */
-
-void
-dns_db_detachnode(dns_db_t *db, dns_dbnode_t **nodep);
-/*%<
- * Detach *nodep from its node.
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * \li 'nodep' points to a valid node.
- *
- * Ensures:
- *
- * \li *nodep is NULL.
- */
-
-void
-dns_db_transfernode(dns_db_t *db, dns_dbnode_t **sourcep,
- dns_dbnode_t **targetp);
-/*%<
- * Transfer a node between pointer.
- *
- * This is equivalent to calling dns_db_attachnode() then dns_db_detachnode().
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * \li '*sourcep' is a valid node.
- *
- * \li 'targetp' points to a NULL dns_dbnode_t *.
- *
- * Ensures:
- *
- * \li '*sourcep' is NULL.
- */
-
-isc_result_t
-dns_db_expirenode(dns_db_t *db, dns_dbnode_t *node, isc_stdtime_t now);
-/*%<
- * Mark as stale all records at 'node' which expire at or before 'now'.
- *
- * Note: if 'now' is zero, then the current time will be used.
- *
- * Requires:
- *
- * \li 'db' is a valid cache database.
- *
- * \li 'node' is a valid node.
- */
-
-void
-dns_db_printnode(dns_db_t *db, dns_dbnode_t *node, FILE *out);
-/*%<
- * Print a textual representation of the contents of the node to
- * 'out'.
- *
- * Note: this function is intended for debugging, not general use.
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * \li 'node' is a valid node.
- */
-
-/***
- *** DB Iterator Creation
- ***/
-
-isc_result_t
-dns_db_createiterator(dns_db_t *db, unsigned int options,
- dns_dbiterator_t **iteratorp);
-/*%<
- * Create an iterator for version 'version' of 'db'.
- *
- * Notes:
- *
- * \li One or more of the following options can be set.
- * #DNS_DB_RELATIVENAMES
- * #DNS_DB_NSEC3ONLY
- * #DNS_DB_NONSEC3
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * \li iteratorp != NULL && *iteratorp == NULL
- *
- * Ensures:
- *
- * \li On success, *iteratorp will be a valid database iterator.
- *
- * Returns:
- *
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
- */
-
-/***
- *** Rdataset Methods
- ***/
-
-/*
- * XXXRTH Should we check for glue and pending data in dns_db_findrdataset()?
- */
-
-isc_result_t
-dns_db_findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
- dns_rdatatype_t type, dns_rdatatype_t covers,
- isc_stdtime_t now, dns_rdataset_t *rdataset,
- dns_rdataset_t *sigrdataset);
-/*%<
- * Search for an rdataset of type 'type' at 'node' that are in version
- * 'version' of 'db'. If found, make 'rdataset' refer to it.
- *
- * Notes:
- *
- * \li If 'version' is NULL, then the current version will be used.
- *
- * \li Care must be used when using this routine to build a DNS response:
- * 'node' should have been found with dns_db_find(), not
- * dns_db_findnode(). No glue checking is done. No checking for
- * pending data is done.
- *
- * \li The 'now' field is ignored if 'db' is a zone database. If 'db' is a
- * cache database, an rdataset will not be found unless it expires after
- * 'now'. If 'now' is zero, then the current time will be used.
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * \li 'node' is a valid node.
- *
- * \li 'rdataset' is a valid, disassociated rdataset.
- *
- * \li 'sigrdataset' is a valid, disassociated rdataset, or it is NULL.
- *
- * \li If 'covers' != 0, 'type' must be SIG.
- *
- * \li 'type' is not a meta-RR type such as 'ANY' or 'OPT'.
- *
- * Ensures:
- *
- * \li On success, 'rdataset' is associated with the found rdataset.
- *
- * Returns:
- *
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_NOTFOUND
- *
- * \li Other results are possible, depending upon the database
- * implementation used.
- */
-
-isc_result_t
-dns_db_allrdatasets(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
- isc_stdtime_t now, dns_rdatasetiter_t **iteratorp);
-/*%<
- * Make '*iteratorp' an rdataset iterator for all rdatasets at 'node' in
- * version 'version' of 'db'.
- *
- * Notes:
- *
- * \li If 'version' is NULL, then the current version will be used.
- *
- * \li The 'now' field is ignored if 'db' is a zone database. If 'db' is a
- * cache database, an rdataset will not be found unless it expires after
- * 'now'. Any ANY query will not match unless at least one rdataset at
- * the node expires after 'now'. If 'now' is zero, then the current time
- * will be used.
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * \li 'node' is a valid node.
- *
- * \li iteratorp != NULL && *iteratorp == NULL
- *
- * Ensures:
- *
- * \li On success, '*iteratorp' is a valid rdataset iterator.
- *
- * Returns:
- *
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_NOTFOUND
- *
- * \li Other results are possible, depending upon the database
- * implementation used.
- */
-
-isc_result_t
-dns_db_addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
- isc_stdtime_t now, dns_rdataset_t *rdataset,
- unsigned int options, dns_rdataset_t *addedrdataset);
-/*%<
- * Add 'rdataset' to 'node' in version 'version' of 'db'.
- *
- * Notes:
- *
- * \li If the database has zone semantics, the #DNS_DBADD_MERGE option is set,
- * and an rdataset of the same type as 'rdataset' already exists at
- * 'node' then the contents of 'rdataset' will be merged with the existing
- * rdataset. If the option is not set, then rdataset will replace any
- * existing rdataset of the same type. If not merging and the
- * #DNS_DBADD_FORCE option is set, then the data will update the database
- * without regard to trust levels. If not forcing the data, then the
- * rdataset will only be added if its trust level is >= the trust level of
- * any existing rdataset. Forcing is only meaningful for cache databases.
- * If #DNS_DBADD_EXACT is set then there must be no rdata in common between
- * the old and new rdata sets. If #DNS_DBADD_EXACTTTL is set then both
- * the old and new rdata sets must have the same ttl.
- *
- * \li The 'now' field is ignored if 'db' is a zone database. If 'db' is
- * a cache database, then the added rdataset will expire no later than
- * now + rdataset->ttl.
- *
- * \li If 'addedrdataset' is not NULL, then it will be attached to the
- * resulting new rdataset in the database, or to the existing data if
- * the existing data was better.
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * \li 'node' is a valid node.
- *
- * \li 'rdataset' is a valid, associated rdataset with the same class
- * as 'db'.
- *
- * \li 'addedrdataset' is NULL, or a valid, unassociated rdataset.
- *
- * \li The database has zone semantics and 'version' is a valid
- * read-write version, or the database has cache semantics
- * and version is NULL.
- *
- * \li If the database has cache semantics, the #DNS_DBADD_MERGE option must
- * not be set.
- *
- * Returns:
- *
- * \li #ISC_R_SUCCESS
- * \li #DNS_R_UNCHANGED The operation did not change anything.
- * \li #ISC_R_NOMEMORY
- * \li #DNS_R_NOTEXACT
- *
- * \li Other results are possible, depending upon the database
- * implementation used.
- */
-
-isc_result_t
-dns_db_subtractrdataset(dns_db_t *db, dns_dbnode_t *node,
- dns_dbversion_t *version, dns_rdataset_t *rdataset,
- unsigned int options, dns_rdataset_t *newrdataset);
-/*%<
- * Remove any rdata in 'rdataset' from 'node' in version 'version' of
- * 'db'.
- *
- * Notes:
- *
- * \li If 'newrdataset' is not NULL, then it will be attached to the
- * resulting new rdataset in the database, unless the rdataset has
- * become nonexistent. If DNS_DBSUB_EXACT is set then all elements
- * of 'rdataset' must exist at 'node'.
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * \li 'node' is a valid node.
- *
- * \li 'rdataset' is a valid, associated rdataset with the same class
- * as 'db'.
- *
- * \li 'newrdataset' is NULL, or a valid, unassociated rdataset.
- *
- * \li The database has zone semantics and 'version' is a valid
- * read-write version.
- *
- * Returns:
- *
- * \li #ISC_R_SUCCESS
- * \li #DNS_R_UNCHANGED The operation did not change anything.
- * \li #DNS_R_NXRRSET All rdata of the same type as those
- * in 'rdataset' have been deleted.
- * \li #DNS_R_NOTEXACT Some part of 'rdataset' did not
- * exist and DNS_DBSUB_EXACT was set.
- *
- * \li Other results are possible, depending upon the database
- * implementation used.
- */
-
-isc_result_t
-dns_db_deleterdataset(dns_db_t *db, dns_dbnode_t *node,
- dns_dbversion_t *version, dns_rdatatype_t type,
- dns_rdatatype_t covers);
-/*%<
- * Make it so that no rdataset of type 'type' exists at 'node' in version
- * version 'version' of 'db'.
- *
- * Notes:
- *
- * \li If 'type' is dns_rdatatype_any, then no rdatasets will exist in
- * 'version' (provided that the dns_db_deleterdataset() isn't followed
- * by one or more dns_db_addrdataset() calls).
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * \li 'node' is a valid node.
- *
- * \li The database has zone semantics and 'version' is a valid
- * read-write version, or the database has cache semantics
- * and version is NULL.
- *
- * \li 'type' is not a meta-RR type, except for dns_rdatatype_any, which is
- * allowed.
- *
- * \li If 'covers' != 0, 'type' must be SIG.
- *
- * Returns:
- *
- * \li #ISC_R_SUCCESS
- * \li #DNS_R_UNCHANGED No rdatasets of 'type' existed before
- * the operation was attempted.
- *
- * \li Other results are possible, depending upon the database
- * implementation used.
- */
-
-isc_result_t
-dns_db_getsoaserial(dns_db_t *db, dns_dbversion_t *ver, isc_uint32_t *serialp);
-/*%<
- * Get the current SOA serial number from a zone database.
- *
- * Requires:
- * \li 'db' is a valid database with zone semantics.
- * \li 'ver' is a valid version.
- */
-
-void
-dns_db_overmem(dns_db_t *db, isc_boolean_t overmem);
-/*%<
- * Enable / disable aggressive cache cleaning.
- */
-
-unsigned int
-dns_db_nodecount(dns_db_t *db);
-/*%<
- * Count the number of nodes in 'db'.
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * Returns:
- * \li The number of nodes in the database
- */
-
-void
-dns_db_settask(dns_db_t *db, isc_task_t *task);
-/*%<
- * If task is set then the final detach maybe performed asynchronously.
- *
- * Requires:
- * \li 'db' is a valid database.
- * \li 'task' to be valid or NULL.
- */
-
-isc_boolean_t
-dns_db_ispersistent(dns_db_t *db);
-/*%<
- * Is 'db' persistent? A persistent database does not need to be loaded
- * from disk or written to disk.
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * Returns:
- * \li #ISC_TRUE 'db' is persistent.
- * \li #ISC_FALSE 'db' is not persistent.
- */
-
-isc_result_t
-dns_db_register(const char *name, dns_dbcreatefunc_t create, void *driverarg,
- isc_mem_t *mctx, dns_dbimplementation_t **dbimp);
-
-/*%<
- * Register a new database implementation and add it to the list of
- * supported implementations.
- *
- * Requires:
- *
- * \li 'name' is not NULL
- * \li 'order' is a valid function pointer
- * \li 'mctx' is a valid memory context
- * \li dbimp != NULL && *dbimp == NULL
- *
- * Returns:
- * \li #ISC_R_SUCCESS The registration succeeded
- * \li #ISC_R_NOMEMORY Out of memory
- * \li #ISC_R_EXISTS A database implementation with the same name exists
- *
- * Ensures:
- *
- * \li *dbimp points to an opaque structure which must be passed to
- * dns_db_unregister().
- */
-
-void
-dns_db_unregister(dns_dbimplementation_t **dbimp);
-/*%<
- * Remove a database implementation from the list of supported
- * implementations. No databases of this type can be active when this
- * is called.
- *
- * Requires:
- * \li dbimp != NULL && *dbimp == NULL
- *
- * Ensures:
- *
- * \li Any memory allocated in *dbimp will be freed.
- */
-
-isc_result_t
-dns_db_getoriginnode(dns_db_t *db, dns_dbnode_t **nodep);
-/*%<
- * Get the origin DB node corresponding to the DB's zone. This function
- * should typically succeed unless the underlying DB implementation doesn't
- * support the feature.
- *
- * Requires:
- *
- * \li 'db' is a valid zone database.
- * \li 'nodep' != NULL && '*nodep' == NULL
- *
- * Ensures:
- * \li On success, '*nodep' will point to the DB node of the zone's origin.
- *
- * Returns:
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_NOTFOUND - the DB implementation does not support this feature.
- */
-
-isc_result_t
-dns_db_getnsec3parameters(dns_db_t *db, dns_dbversion_t *version,
- dns_hash_t *hash, isc_uint8_t *flags,
- isc_uint16_t *interations,
- unsigned char *salt, size_t *salt_length);
-/*%<
- * Get the NSEC3 parameters that are associated with this zone.
- *
- * Requires:
- * \li 'db' is a valid zone database.
- *
- * Returns:
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_NOTFOUND - the DB implementation does not support this feature
- * or this zone does not have NSEC3 records.
- */
-
-isc_result_t
-dns_db_findnsec3node(dns_db_t *db, dns_name_t *name,
- isc_boolean_t create, dns_dbnode_t **nodep);
-/*%<
- * Find the NSEC3 node with name 'name'.
- *
- * Notes:
- * \li If 'create' is ISC_TRUE and no node with name 'name' exists, then
- * such a node will be created.
- *
- * Requires:
- *
- * \li 'db' is a valid database.
- *
- * \li 'name' is a valid, non-empty, absolute name.
- *
- * \li nodep != NULL && *nodep == NULL
- *
- * Ensures:
- *
- * \li On success, *nodep is attached to the node with name 'name'.
- *
- * Returns:
- *
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_NOTFOUND If !create and name not found.
- * \li #ISC_R_NOMEMORY Can only happen if create is ISC_TRUE.
- *
- * \li Other results are possible, depending upon the database
- * implementation used.
- */
-
-isc_result_t
-dns_db_setsigningtime(dns_db_t *db, dns_rdataset_t *rdataset,
- isc_stdtime_t resign);
-/*%<
- * Sets the re-signing time associated with 'rdataset' to 'resign'.
- *
- * Requires:
- * \li 'db' is a valid zone database.
- * \li 'rdataset' to be associated with 'db'.
- *
- * Returns:
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
- * \li #ISC_R_NOTIMPLEMENTED - Not supported by this DB implementation.
- */
-
-isc_result_t
-dns_db_getsigningtime(dns_db_t *db, dns_rdataset_t *rdataset, dns_name_t *name);
-/*%<
- * Return the rdataset with the earliest signing time in the zone.
- * Note: the rdataset is version agnostic.
- *
- * Requires:
- * \li 'db' is a valid zone database.
- * \li 'rdataset' to be initialized but not associated.
- * \li 'name' to be NULL or have a buffer associated with it.
- *
- * Returns:
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_NOTFOUND - No dataset exists.
- */
-
-void
-dns_db_resigned(dns_db_t *db, dns_rdataset_t *rdataset,
- dns_dbversion_t *version);
-/*%<
- * Mark 'rdataset' as not being available to be returned by
- * dns_db_getsigningtime(). If the changes associated with 'version'
- * are committed this will be permanent. If the version is not committed
- * this change will be rolled back when the version is closed.
- *
- * Requires:
- * \li 'db' is a valid zone database.
- * \li 'rdataset' to be associated with 'db'.
- * \li 'version' to be open for writing.
- */
-
-dns_stats_t *
-dns_db_getrrsetstats(dns_db_t *db);
-/*%<
- * Get statistics information counting RRsets stored in the DB, when available.
- * The statistics may not be available depending on the DB implementation.
- *
- * Requires:
- *
- * \li 'db' is a valid database (zone or cache).
- *
- * Returns:
- * \li when available, a pointer to a statistics object created by
- * dns_rdatasetstats_create(); otherwise NULL.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_DB_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: dbiterator.h,v 1.25 2007/06/19 23:47:16 tbox Exp $ */
-
-#ifndef DNS_DBITERATOR_H
-#define DNS_DBITERATOR_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/dbiterator.h
- * \brief
- * The DNS DB Iterator interface allows iteration of all of the nodes in a
- * database.
- *
- * The dns_dbiterator_t type is like a "virtual class". To actually use
- * it, an implementation of the class is required. This implementation is
- * supplied by the database.
- *
- * It is the client's responsibility to call dns_db_detachnode() on all
- * nodes returned.
- *
- * XXX <more> XXX
- *
- * MP:
- *\li The iterator itself is not locked. The caller must ensure
- * synchronization.
- *
- *\li The iterator methods ensure appropriate database locking.
- *
- * Reliability:
- *\li No anticipated impact.
- *
- * Resources:
- *\li TBS
- *
- * Security:
- *\li No anticipated impact.
- *
- * Standards:
- *\li None.
- */
-
-/*****
- ***** Imports
- *****/
-
-#include <isc/lang.h>
-#include <isc/magic.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/*****
- ***** Types
- *****/
-
-typedef struct dns_dbiteratormethods {
- void (*destroy)(dns_dbiterator_t **iteratorp);
- isc_result_t (*first)(dns_dbiterator_t *iterator);
- isc_result_t (*last)(dns_dbiterator_t *iterator);
- isc_result_t (*seek)(dns_dbiterator_t *iterator, dns_name_t *name);
- isc_result_t (*prev)(dns_dbiterator_t *iterator);
- isc_result_t (*next)(dns_dbiterator_t *iterator);
- isc_result_t (*current)(dns_dbiterator_t *iterator,
- dns_dbnode_t **nodep, dns_name_t *name);
- isc_result_t (*pause)(dns_dbiterator_t *iterator);
- isc_result_t (*origin)(dns_dbiterator_t *iterator,
- dns_name_t *name);
-} dns_dbiteratormethods_t;
-
-#define DNS_DBITERATOR_MAGIC ISC_MAGIC('D','N','S','I')
-#define DNS_DBITERATOR_VALID(dbi) ISC_MAGIC_VALID(dbi, DNS_DBITERATOR_MAGIC)
-/*%
- * This structure is actually just the common prefix of a DNS db
- * implementation's version of a dns_dbiterator_t.
- *
- * Clients may use the 'db' field of this structure. Except for that field,
- * direct use of this structure by clients is forbidden. DB implementations
- * may change the structure. 'magic' must be DNS_DBITERATOR_MAGIC for any of
- * the dns_dbiterator routines to work. DB iterator implementations must
- * maintain all DB iterator invariants.
- */
-struct dns_dbiterator {
- /* Unlocked. */
- unsigned int magic;
- dns_dbiteratormethods_t * methods;
- dns_db_t * db;
- isc_boolean_t relative_names;
- isc_boolean_t cleaning;
-};
-
-void
-dns_dbiterator_destroy(dns_dbiterator_t **iteratorp);
-/*%<
- * Destroy '*iteratorp'.
- *
- * Requires:
- *
- *\li '*iteratorp' is a valid iterator.
- *
- * Ensures:
- *
- *\li All resources used by the iterator are freed.
- *
- *\li *iteratorp == NULL.
- */
-
-isc_result_t
-dns_dbiterator_first(dns_dbiterator_t *iterator);
-/*%<
- * Move the node cursor to the first node in the database (if any).
- *
- * Requires:
- *\li 'iterator' is a valid iterator.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMORE There are no nodes in the database.
- *
- *\li Other results are possible, depending on the DB implementation.
- */
-
-isc_result_t
-dns_dbiterator_last(dns_dbiterator_t *iterator);
-/*%<
- * Move the node cursor to the last node in the database (if any).
- *
- * Requires:
- *\li 'iterator' is a valid iterator.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMORE There are no nodes in the database.
- *
- *\li Other results are possible, depending on the DB implementation.
- */
-
-isc_result_t
-dns_dbiterator_seek(dns_dbiterator_t *iterator, dns_name_t *name);
-/*%<
- * Move the node cursor to the node with name 'name'.
- *
- * Requires:
- *\li 'iterator' is a valid iterator.
- *
- *\li 'name' is a valid name.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOTFOUND
- *
- *\li Other results are possible, depending on the DB implementation.
- */
-
-isc_result_t
-dns_dbiterator_prev(dns_dbiterator_t *iterator);
-/*%<
- * Move the node cursor to the previous node in the database (if any).
- *
- * Requires:
- *\li 'iterator' is a valid iterator.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMORE There are no more nodes in the
- * database.
- *
- *\li Other results are possible, depending on the DB implementation.
- */
-
-isc_result_t
-dns_dbiterator_next(dns_dbiterator_t *iterator);
-/*%<
- * Move the node cursor to the next node in the database (if any).
- *
- * Requires:
- *\li 'iterator' is a valid iterator.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMORE There are no more nodes in the
- * database.
- *
- *\li Other results are possible, depending on the DB implementation.
- */
-
-isc_result_t
-dns_dbiterator_current(dns_dbiterator_t *iterator, dns_dbnode_t **nodep,
- dns_name_t *name);
-/*%<
- * Return the current node.
- *
- * Notes:
- *\li If 'name' is not NULL, it will be set to the name of the node.
- *
- * Requires:
- *\li 'iterator' is a valid iterator.
- *
- *\li nodep != NULL && *nodep == NULL
- *
- *\li The node cursor of 'iterator' is at a valid location (i.e. the
- * result of last call to a cursor movement command was ISC_R_SUCCESS).
- *
- *\li 'name' is NULL, or is a valid name with a dedicated buffer.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #DNS_R_NEWORIGIN If this iterator was created with
- * 'relative_names' set to ISC_TRUE,
- * then #DNS_R_NEWORIGIN will be returned
- * when the origin the names are
- * relative to changes. This result
- * can occur only when 'name' is not
- * NULL. This is also a successful
- * result.
- *
- *\li Other results are possible, depending on the DB implementation.
- */
-
-isc_result_t
-dns_dbiterator_pause(dns_dbiterator_t *iterator);
-/*%<
- * Pause iteration.
- *
- * Calling a cursor movement method or dns_dbiterator_current() may cause
- * database locks to be acquired. Rather than reacquire these locks every
- * time one of these routines is called, the locks may simply be held.
- * Calling dns_dbiterator_pause() releases any such locks. Iterator clients
- * should call this routine any time they are not going to execute another
- * iterator method in the immediate future.
- *
- * Requires:
- *\li 'iterator' is a valid iterator.
- *
- * Ensures:
- *\li Any database locks being held for efficiency of iterator access are
- * released.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *
- *\li Other results are possible, depending on the DB implementation.
- */
-
-isc_result_t
-dns_dbiterator_origin(dns_dbiterator_t *iterator, dns_name_t *name);
-/*%<
- * Return the origin to which returned node names are relative.
- *
- * Requires:
- *
- *\li 'iterator' is a valid relative_names iterator.
- *
- *\li 'name' is a valid name with a dedicated buffer.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOSPACE
- *
- *\li Other results are possible, depending on the DB implementation.
- */
-
-void
-dns_dbiterator_setcleanmode(dns_dbiterator_t *iterator, isc_boolean_t mode);
-/*%<
- * Indicate that the given iterator is/is not cleaning the DB.
- *
- * Notes:
- *\li When 'mode' is ISC_TRUE,
- *
- * Requires:
- *\li 'iterator' is a valid iterator.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_DBITERATOR_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: dbtable.h,v 1.23 2007/06/19 23:47:16 tbox Exp $ */
-
-#ifndef DNS_DBTABLE_H
-#define DNS_DBTABLE_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/dbtable.h
- * \brief
- * DNS DB Tables
- *
- * XXX TBS XXX
- *
- * MP:
- *\li The module ensures appropriate synchronization of data structures it
- * creates and manipulates.
- *
- * Reliability:
- *\li No anticipated impact.
- *
- * Resources:
- *\li None.
- *
- * Security:
- *\li No anticipated impact.
- *
- * Standards:
- *\li None.
- */
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-#define DNS_DBTABLEFIND_NOEXACT 0x01
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_dbtable_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
- dns_dbtable_t **dbtablep);
-/*%<
- * Make a new dbtable of class 'rdclass'
- *
- * Requires:
- *\li mctx != NULL
- * \li dbtablep != NULL && *dptablep == NULL
- *\li 'rdclass' is a valid class
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_UNEXPECTED
- */
-
-void
-dns_dbtable_attach(dns_dbtable_t *source, dns_dbtable_t **targetp);
-/*%<
- * Attach '*targetp' to 'source'.
- *
- * Requires:
- *
- *\li 'source' is a valid dbtable.
- *
- *\li 'targetp' points to a NULL dns_dbtable_t *.
- *
- * Ensures:
- *
- *\li *targetp is attached to source.
- */
-
-void
-dns_dbtable_detach(dns_dbtable_t **dbtablep);
-/*%<
- * Detach *dbtablep from its dbtable.
- *
- * Requires:
- *
- *\li '*dbtablep' points to a valid dbtable.
- *
- * Ensures:
- *
- *\li *dbtablep is NULL.
- *
- *\li If '*dbtablep' is the last reference to the dbtable,
- * all resources used by the dbtable will be freed
- */
-
-isc_result_t
-dns_dbtable_add(dns_dbtable_t *dbtable, dns_db_t *db);
-/*%<
- * Add 'db' to 'dbtable'.
- *
- * Requires:
- *\li 'dbtable' is a valid dbtable.
- *
- *\li 'db' is a valid database with the same class as 'dbtable'
- */
-
-void
-dns_dbtable_remove(dns_dbtable_t *dbtable, dns_db_t *db);
-/*%<
- * Remove 'db' from 'dbtable'.
- *
- * Requires:
- *\li 'db' was previously added to 'dbtable'.
- */
-
-void
-dns_dbtable_adddefault(dns_dbtable_t *dbtable, dns_db_t *db);
-/*%<
- * Use 'db' as the result of a dns_dbtable_find() if no better match is
- * available.
- */
-
-void
-dns_dbtable_getdefault(dns_dbtable_t *dbtable, dns_db_t **db);
-/*%<
- * Get the 'db' used as the result of a dns_dbtable_find()
- * if no better match is available.
- */
-
-void
-dns_dbtable_removedefault(dns_dbtable_t *dbtable);
-/*%<
- * Remove the default db from 'dbtable'.
- */
-
-isc_result_t
-dns_dbtable_find(dns_dbtable_t *dbtable, dns_name_t *name,
- unsigned int options, dns_db_t **dbp);
-/*%<
- * Find the deepest match to 'name' in the dbtable, and return it
- *
- * Notes:
- *\li If the DNS_DBTABLEFIND_NOEXACT option is set, the best partial
- * match (if any) to 'name' will be returned.
- *
- * Returns:
- * \li #ISC_R_SUCCESS on success
- *\li something else: no default and match
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_DBTABLE_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: diff.h,v 1.15.120.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef DNS_DIFF_H
-#define DNS_DIFF_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/diff.h
- * \brief
- * A diff is a convenience type representing a list of changes to be
- * made to a database.
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-#include <isc/magic.h>
-
-#include <dns/name.h>
-#include <dns/rdata.h>
-#include <dns/types.h>
-
-/***
- *** Types
- ***/
-
-/*%
- * A dns_difftuple_t represents a single RR being added or deleted.
- * The RR type and class are in the 'rdata' member; the class is always
- * the real one, not a DynDNS meta-class, so that the rdatas can be
- * compared using dns_rdata_compare(). The TTL is significant
- * even for deletions, because a deletion/addition pair cannot
- * be canceled out if the TTL differs (it might be an explicit
- * TTL update).
- *
- * Tuples are also used to represent complete RRs with owner
- * names for a couple of other purposes, such as the
- * individual RRs of a "RRset exists (value dependent)"
- * prerequisite set. In this case, op==DNS_DIFFOP_EXISTS,
- * and the TTL is ignored.
- *
- * DNS_DIFFOP_*RESIGN will cause the 'resign' attribute of the resulting
- * RRset to be recomputed to be 'resign' seconds before the earliest RRSIG
- * timeexpire.
- */
-
-typedef enum {
- DNS_DIFFOP_ADD = 0, /*%< Add an RR. */
- DNS_DIFFOP_DEL = 1, /*%< Delete an RR. */
- DNS_DIFFOP_EXISTS = 2, /*%< Assert RR existence. */
- DNS_DIFFOP_ADDRESIGN = 4, /*%< ADD + RESIGN. */
- DNS_DIFFOP_DELRESIGN = 5, /*%< DEL + RESIGN. */
-} dns_diffop_t;
-
-typedef struct dns_difftuple dns_difftuple_t;
-
-#define DNS_DIFFTUPLE_MAGIC ISC_MAGIC('D','I','F','T')
-#define DNS_DIFFTUPLE_VALID(t) ISC_MAGIC_VALID(t, DNS_DIFFTUPLE_MAGIC)
-
-struct dns_difftuple {
- unsigned int magic;
- isc_mem_t *mctx;
- dns_diffop_t op;
- dns_name_t name;
- dns_ttl_t ttl;
- dns_rdata_t rdata;
- ISC_LINK(dns_difftuple_t) link;
- /* Variable-size name data and rdata follows. */
-};
-
-/*%
- * A dns_diff_t represents a set of changes being applied to
- * a zone. Diffs are also used to represent "RRset exists
- * (value dependent)" prerequisites.
- */
-typedef struct dns_diff dns_diff_t;
-
-#define DNS_DIFF_MAGIC ISC_MAGIC('D','I','F','F')
-#define DNS_DIFF_VALID(t) ISC_MAGIC_VALID(t, DNS_DIFF_MAGIC)
-
-struct dns_diff {
- unsigned int magic;
- isc_mem_t * mctx;
- /*
- * Set the 'resign' attribute to this many second before the
- * earliest RRSIG timeexpire.
- */
- isc_uint32_t resign;
- ISC_LIST(dns_difftuple_t) tuples;
-};
-
-/* Type of comparison function for sorting diffs. */
-typedef int dns_diff_compare_func(const void *, const void *);
-
-/***
- *** Functions
- ***/
-
-ISC_LANG_BEGINDECLS
-
-/**************************************************************************/
-/*
- * Manipulation of diffs and tuples.
- */
-
-isc_result_t
-dns_difftuple_create(isc_mem_t *mctx,
- dns_diffop_t op, dns_name_t *name, dns_ttl_t ttl,
- dns_rdata_t *rdata, dns_difftuple_t **tp);
-/*%<
- * Create a tuple. Deep copies are made of the name and rdata, so
- * they need not remain valid after the call.
- *
- * Requires:
- *\li *tp != NULL && *tp == NULL.
- *
- * Returns:
- *\li ISC_R_SUCCESS
- * \li ISC_R_NOMEMORY
- */
-
-void
-dns_difftuple_free(dns_difftuple_t **tp);
-/*%<
- * Free a tuple.
- *
- * Requires:
- * \li **tp is a valid tuple.
- *
- * Ensures:
- * \li *tp == NULL
- * \li All memory used by the tuple is freed.
- */
-
-isc_result_t
-dns_difftuple_copy(dns_difftuple_t *orig, dns_difftuple_t **copyp);
-/*%<
- * Copy a tuple.
- *
- * Requires:
- * \li 'orig' points to a valid tuple
- *\li copyp != NULL && *copyp == NULL
- */
-
-void
-dns_diff_init(isc_mem_t *mctx, dns_diff_t *diff);
-/*%<
- * Initialize a diff.
- *
- * Requires:
- * \li 'diff' points to an uninitialized dns_diff_t
- * \li allocated by the caller.
- *
- * Ensures:
- * \li '*diff' is a valid, empty diff.
- */
-
-void
-dns_diff_clear(dns_diff_t *diff);
-/*%<
- * Clear a diff, destroying all its tuples.
- *
- * Requires:
- * \li 'diff' points to a valid dns_diff_t.
- *
- * Ensures:
- * \li Any tuples in the diff are destroyed.
- * The diff now empty, but it is still valid
- * and may be reused without calling dns_diff_init
- * again. The only memory used is that of the
- * dns_diff_t structure itself.
- *
- * Notes:
- * \li Managing the memory of the dns_diff_t structure itself
- * is the caller's responsibility.
- */
-
-void
-dns_diff_append(dns_diff_t *diff, dns_difftuple_t **tuple);
-/*%<
- * Append a single tuple to a diff.
- *
- *\li 'diff' is a valid diff.
- * \li '*tuple' is a valid tuple.
- *
- * Ensures:
- *\li *tuple is NULL.
- *\li The tuple has been freed, or will be freed when the diff is cleared.
- */
-
-void
-dns_diff_appendminimal(dns_diff_t *diff, dns_difftuple_t **tuple);
-/*%<
- * Append 'tuple' to 'diff', removing any duplicate
- * or conflicting updates as needed to create a minimal diff.
- *
- * Requires:
- *\li 'diff' is a minimal diff.
- *
- * Ensures:
- *\li 'diff' is still a minimal diff.
- * \li *tuple is NULL.
- * \li The tuple has been freed, or will be freed when the diff is cleared.
- *
- */
-
-isc_result_t
-dns_diff_sort(dns_diff_t *diff, dns_diff_compare_func *compare);
-/*%<
- * Sort 'diff' in-place according to the comparison function 'compare'.
- */
-
-isc_result_t
-dns_diff_apply(dns_diff_t *diff, dns_db_t *db, dns_dbversion_t *ver);
-isc_result_t
-dns_diff_applysilently(dns_diff_t *diff, dns_db_t *db, dns_dbversion_t *ver);
-/*%<
- * Apply 'diff' to the database 'db'.
- *
- * dns_diff_apply() logs warnings about updates with no effect or
- * with inconsistent TTLs; dns_diff_applysilently() does not.
- *
- * For efficiency, the diff should be sorted by owner name.
- * If it is not sorted, operation will still be correct,
- * but less efficient.
- *
- * Requires:
- *\li *diff is a valid diff (possibly empty), containing
- * tuples of type #DNS_DIFFOP_ADD and/or
- * For #DNS_DIFFOP_DEL tuples, the TTL is ignored.
- *
- */
-
-isc_result_t
-dns_diff_load(dns_diff_t *diff, dns_addrdatasetfunc_t addfunc,
- void *add_private);
-/*%<
- * Like dns_diff_apply, but for use when loading a new database
- * instead of modifying an existing one. This bypasses the
- * database transaction mechanisms.
- *
- * Requires:
- *\li 'addfunc' is a valid dns_addradatasetfunc_t obtained from
- * dns_db_beginload()
- *
- *\li 'add_private' points to a corresponding dns_dbload_t *
- * (XXX why is it a void pointer, then?)
- */
-
-isc_result_t
-dns_diff_print(dns_diff_t *diff, FILE *file);
-
-/*%<
- * Print the differences to 'file' or if 'file' is NULL via the
- * logging system.
- *
- * Require:
- *\li 'diff' to be valid.
- *\li 'file' to refer to a open file or NULL.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_UNEXPECTED
- *\li any error from dns_rdataset_totext()
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_DIFF_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: dispatch.h,v 1.60.82.2 2009/01/29 23:47:44 tbox Exp $ */
-
-#ifndef DNS_DISPATCH_H
-#define DNS_DISPATCH_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/dispatch.h
- * \brief
- * DNS Dispatch Management
- * Shared UDP and single-use TCP dispatches for queries and responses.
- *
- * MP:
- *
- *\li All locking is performed internally to each dispatch.
- * Restrictions apply to dns_dispatch_removeresponse().
- *
- * Reliability:
- *
- * Resources:
- *
- * Security:
- *
- *\li Depends on the isc_socket_t and dns_message_t for prevention of
- * buffer overruns.
- *
- * Standards:
- *
- *\li None.
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/buffer.h>
-#include <isc/lang.h>
-#include <isc/socket.h>
-#include <isc/types.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/*%
- * This event is sent to a task when a response comes in.
- * No part of this structure should ever be modified by the caller,
- * other than parts of the buffer. The holy parts of the buffer are
- * the base and size of the buffer. All other parts of the buffer may
- * be used. On event delivery the used region contains the packet.
- *
- * "id" is the received message id,
- *
- * "addr" is the host that sent it to us,
- *
- * "buffer" holds state on the received data.
- *
- * The "free" routine for this event will clean up itself as well as
- * any buffer space allocated from common pools.
- */
-
-struct dns_dispatchevent {
- ISC_EVENT_COMMON(dns_dispatchevent_t); /*%< standard event common */
- isc_result_t result; /*%< result code */
- isc_int32_t id; /*%< message id */
- isc_sockaddr_t addr; /*%< address recv'd from */
- struct in6_pktinfo pktinfo; /*%< reply info for v6 */
- isc_buffer_t buffer; /*%< data buffer */
- isc_uint32_t attributes; /*%< mirrored from socket.h */
-};
-
-/*@{*/
-/*%
- * Attributes for added dispatchers.
- *
- * Values with the mask 0xffff0000 are application defined.
- * Values with the mask 0x0000ffff are library defined.
- *
- * Insane values (like setting both TCP and UDP) are not caught. Don't
- * do that.
- *
- * _PRIVATE
- * The dispatcher cannot be shared.
- *
- * _TCP, _UDP
- * The dispatcher is a TCP or UDP socket.
- *
- * _IPV4, _IPV6
- * The dispatcher uses an IPv4 or IPv6 socket.
- *
- * _NOLISTEN
- * The dispatcher should not listen on the socket.
- *
- * _MAKEQUERY
- * The dispatcher can be used to issue queries to other servers, and
- * accept replies from them.
- *
- * _RANDOMPORT
- * Previously used to indicate that the port of a dispatch UDP must be
- * chosen randomly. This behavior now always applies and the attribute
- * is obsoleted.
- *
- * _EXCLUSIVE
- * A separate socket will be used on-demand for each transaction.
- */
-#define DNS_DISPATCHATTR_PRIVATE 0x00000001U
-#define DNS_DISPATCHATTR_TCP 0x00000002U
-#define DNS_DISPATCHATTR_UDP 0x00000004U
-#define DNS_DISPATCHATTR_IPV4 0x00000008U
-#define DNS_DISPATCHATTR_IPV6 0x00000010U
-#define DNS_DISPATCHATTR_NOLISTEN 0x00000020U
-#define DNS_DISPATCHATTR_MAKEQUERY 0x00000040U
-#define DNS_DISPATCHATTR_CONNECTED 0x00000080U
-/*#define DNS_DISPATCHATTR_RANDOMPORT 0x00000100U*/
-#define DNS_DISPATCHATTR_EXCLUSIVE 0x00000200U
-/*@}*/
-
-isc_result_t
-dns_dispatchmgr_create(isc_mem_t *mctx, isc_entropy_t *entropy,
- dns_dispatchmgr_t **mgrp);
-/*%<
- * Creates a new dispatchmgr object.
- *
- * Requires:
- *\li "mctx" be a valid memory context.
- *
- *\li mgrp != NULL && *mgrp == NULL
- *
- *\li "entropy" may be NULL, in which case an insecure random generator
- * will be used. If it is non-NULL, it must be a valid entropy
- * source.
- *
- * Returns:
- *\li ISC_R_SUCCESS -- all ok
- *
- *\li anything else -- failure
- */
-
-
-void
-dns_dispatchmgr_destroy(dns_dispatchmgr_t **mgrp);
-/*%<
- * Destroys the dispatchmgr when it becomes empty. This could be
- * immediately.
- *
- * Requires:
- *\li mgrp != NULL && *mgrp is a valid dispatchmgr.
- */
-
-
-void
-dns_dispatchmgr_setblackhole(dns_dispatchmgr_t *mgr, dns_acl_t *blackhole);
-/*%<
- * Sets the dispatcher's "blackhole list," a list of addresses that will
- * be ignored by all dispatchers created by the dispatchmgr.
- *
- * Requires:
- * \li mgrp is a valid dispatchmgr
- * \li blackhole is a valid acl
- */
-
-
-dns_acl_t *
-dns_dispatchmgr_getblackhole(dns_dispatchmgr_t *mgr);
-/*%<
- * Gets a pointer to the dispatcher's current blackhole list,
- * without incrementing its reference count.
- *
- * Requires:
- *\li mgr is a valid dispatchmgr
- * Returns:
- *\li A pointer to the current blackhole list, or NULL.
- */
-
-void
-dns_dispatchmgr_setblackportlist(dns_dispatchmgr_t *mgr,
- dns_portlist_t *portlist);
-/*%<
- * This function is deprecated. Use dns_dispatchmgr_setavailports() instead.
- *
- * Requires:
- *\li mgr is a valid dispatchmgr
- */
-
-dns_portlist_t *
-dns_dispatchmgr_getblackportlist(dns_dispatchmgr_t *mgr);
-/*%<
- * This function is deprecated and always returns NULL.
- *
- * Requires:
- *\li mgr is a valid dispatchmgr
- */
-
-isc_result_t
-dns_dispatchmgr_setavailports(dns_dispatchmgr_t *mgr, isc_portset_t *v4portset,
- isc_portset_t *v6portset);
-/*%<
- * Sets a list of UDP ports that can be used for outgoing UDP messages.
- *
- * Requires:
- *\li mgr is a valid dispatchmgr
- *\li v4portset is NULL or a valid port set
- *\li v6portset is NULL or a valid port set
- */
-
-void
-dns_dispatchmgr_setstats(dns_dispatchmgr_t *mgr, isc_stats_t *stats);
-/*%<
- * Sets statistics counter for the dispatchmgr. This function is expected to
- * be called only on zone creation (when necessary).
- * Once installed, it cannot be removed or replaced. Also, there is no
- * interface to get the installed stats from the zone; the caller must keep the
- * stats to reference (e.g. dump) it later.
- *
- * Requires:
- *\li mgr is a valid dispatchmgr with no managed dispatch.
- *\li stats is a valid statistics supporting resolver statistics counters
- * (see dns/stats.h).
- */
-
-isc_result_t
-dns_dispatch_getudp(dns_dispatchmgr_t *mgr, isc_socketmgr_t *sockmgr,
- isc_taskmgr_t *taskmgr, isc_sockaddr_t *localaddr,
- unsigned int buffersize,
- unsigned int maxbuffers, unsigned int maxrequests,
- unsigned int buckets, unsigned int increment,
- unsigned int attributes, unsigned int mask,
- dns_dispatch_t **dispp);
-/*%<
- * Attach to existing dns_dispatch_t if one is found with dns_dispatchmgr_find,
- * otherwise create a new UDP dispatch.
- *
- * Requires:
- *\li All pointer parameters be valid for their respective types.
- *
- *\li dispp != NULL && *disp == NULL
- *
- *\li 512 <= buffersize <= 64k
- *
- *\li maxbuffers > 0
- *
- *\li buckets < 2097169
- *
- *\li increment > buckets
- *
- *\li (attributes & DNS_DISPATCHATTR_TCP) == 0
- *
- * Returns:
- *\li ISC_R_SUCCESS -- success.
- *
- *\li Anything else -- failure.
- */
-
-isc_result_t
-dns_dispatch_createtcp(dns_dispatchmgr_t *mgr, isc_socket_t *sock,
- isc_taskmgr_t *taskmgr, unsigned int buffersize,
- unsigned int maxbuffers, unsigned int maxrequests,
- unsigned int buckets, unsigned int increment,
- unsigned int attributes, dns_dispatch_t **dispp);
-/*%<
- * Create a new dns_dispatch and attach it to the provided isc_socket_t.
- *
- * For all dispatches, "buffersize" is the maximum packet size we will
- * accept.
- *
- * "maxbuffers" and "maxrequests" control the number of buffers in the
- * overall system and the number of buffers which can be allocated to
- * requests.
- *
- * "buckets" is the number of buckets to use, and should be prime.
- *
- * "increment" is used in a collision avoidance function, and needs to be
- * a prime > buckets, and not 2.
- *
- * Requires:
- *
- *\li mgr is a valid dispatch manager.
- *
- *\li sock is a valid.
- *
- *\li task is a valid task that can be used internally to this dispatcher.
- *
- * \li 512 <= buffersize <= 64k
- *
- *\li maxbuffers > 0.
- *
- *\li maxrequests <= maxbuffers.
- *
- *\li buckets < 2097169 (the next prime after 65536 * 32)
- *
- *\li increment > buckets (and prime).
- *
- *\li attributes includes #DNS_DISPATCHATTR_TCP and does not include
- * #DNS_DISPATCHATTR_UDP.
- *
- * Returns:
- *\li ISC_R_SUCCESS -- success.
- *
- *\li Anything else -- failure.
- */
-
-void
-dns_dispatch_attach(dns_dispatch_t *disp, dns_dispatch_t **dispp);
-/*%<
- * Attach to a dispatch handle.
- *
- * Requires:
- *\li disp is valid.
- *
- *\li dispp != NULL && *dispp == NULL
- */
-
-void
-dns_dispatch_detach(dns_dispatch_t **dispp);
-/*%<
- * Detaches from the dispatch.
- *
- * Requires:
- *\li dispp != NULL and *dispp be a valid dispatch.
- */
-
-void
-dns_dispatch_starttcp(dns_dispatch_t *disp);
-/*%<
- * Start processing of a TCP dispatch once the socket connects.
- *
- * Requires:
- *\li 'disp' is valid.
- */
-
-isc_result_t
-dns_dispatch_addresponse2(dns_dispatch_t *disp, isc_sockaddr_t *dest,
- isc_task_t *task, isc_taskaction_t action, void *arg,
- isc_uint16_t *idp, dns_dispentry_t **resp,
- isc_socketmgr_t *sockmgr);
-
-isc_result_t
-dns_dispatch_addresponse(dns_dispatch_t *disp, isc_sockaddr_t *dest,
- isc_task_t *task, isc_taskaction_t action, void *arg,
- isc_uint16_t *idp, dns_dispentry_t **resp);
-/*%<
- * Add a response entry for this dispatch.
- *
- * "*idp" is filled in with the assigned message ID, and *resp is filled in
- * to contain the magic token used to request event flow stop.
- *
- * Arranges for the given task to get a callback for response packets. When
- * the event is delivered, it must be returned using dns_dispatch_freeevent()
- * or through dns_dispatch_removeresponse() for another to be delivered.
- *
- * Requires:
- *\li "idp" be non-NULL.
- *
- *\li "task" "action" and "arg" be set as appropriate.
- *
- *\li "dest" be non-NULL and valid.
- *
- *\li "resp" be non-NULL and *resp be NULL
- *
- *\li "sockmgr" be NULL or a valid socket manager. If 'disp' has
- * the DNS_DISPATCHATTR_EXCLUSIVE attribute, this must not be NULL,
- * which also means dns_dispatch_addresponse() cannot be used.
- *
- * Ensures:
- *
- *\li <id, dest> is a unique tuple. That means incoming messages
- * are identifiable.
- *
- * Returns:
- *
- *\li ISC_R_SUCCESS -- all is well.
- *\li ISC_R_NOMEMORY -- memory could not be allocated.
- *\li ISC_R_NOMORE -- no more message ids can be allocated
- * for this destination.
- */
-
-
-void
-dns_dispatch_removeresponse(dns_dispentry_t **resp,
- dns_dispatchevent_t **sockevent);
-/*%<
- * Stops the flow of responses for the provided id and destination.
- * If "sockevent" is non-NULL, the dispatch event and associated buffer is
- * also returned to the system.
- *
- * Requires:
- *\li "resp" != NULL and "*resp" contain a value previously allocated
- * by dns_dispatch_addresponse();
- *
- *\li May only be called from within the task given as the 'task'
- * argument to dns_dispatch_addresponse() when allocating '*resp'.
- */
-
-isc_socket_t *
-dns_dispatch_getentrysocket(dns_dispentry_t *resp);
-
-isc_socket_t *
-dns_dispatch_getsocket(dns_dispatch_t *disp);
-/*%<
- * Return the socket associated with this dispatcher.
- *
- * Requires:
- *\li disp is valid.
- *
- * Returns:
- *\li The socket the dispatcher is using.
- */
-
-isc_result_t
-dns_dispatch_getlocaladdress(dns_dispatch_t *disp, isc_sockaddr_t *addrp);
-/*%<
- * Return the local address for this dispatch.
- * This currently only works for dispatches using UDP sockets.
- *
- * Requires:
- *\li disp is valid.
- *\li addrp to be non null.
- *
- * Returns:
- *\li ISC_R_SUCCESS
- *\li ISC_R_NOTIMPLEMENTED
- */
-
-void
-dns_dispatch_cancel(dns_dispatch_t *disp);
-/*%<
- * cancel outstanding clients
- *
- * Requires:
- *\li disp is valid.
- */
-
-unsigned int
-dns_dispatch_getattributes(dns_dispatch_t *disp);
-/*%<
- * Return the attributes (DNS_DISPATCHATTR_xxx) of this dispatch. Only the
- * non-changeable attributes are expected to be referenced by the caller.
- *
- * Requires:
- *\li disp is valid.
- */
-
-void
-dns_dispatch_changeattributes(dns_dispatch_t *disp,
- unsigned int attributes, unsigned int mask);
-/*%<
- * Set the bits described by "mask" to the corresponding values in
- * "attributes".
- *
- * That is:
- *
- * \code
- * new = (old & ~mask) | (attributes & mask)
- * \endcode
- *
- * This function has a side effect when #DNS_DISPATCHATTR_NOLISTEN changes.
- * When the flag becomes off, the dispatch will start receiving on the
- * corresponding socket. When the flag becomes on, receive events on the
- * corresponding socket will be canceled.
- *
- * Requires:
- *\li disp is valid.
- *
- *\li attributes are reasonable for the dispatch. That is, setting the UDP
- * attribute on a TCP socket isn't reasonable.
- */
-
-void
-dns_dispatch_importrecv(dns_dispatch_t *disp, isc_event_t *event);
-/*%<
- * Inform the dispatcher of a socket receive. This is used for sockets
- * shared between dispatchers and clients. If the dispatcher fails to copy
- * or send the event, nothing happens.
- *
- * Requires:
- *\li disp is valid, and the attribute DNS_DISPATCHATTR_NOLISTEN is set.
- * event != NULL
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_DISPATCH_H */
+++ /dev/null
-/*
- * Portions Copyright (C) 2005-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Portions Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/*
- * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
- *
- * 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 STICHTING NLNET
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * STICHTING NLNET 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.
- *
- * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
- * conceived and contributed by Rob Butler.
- *
- * 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 ROB BUTLER
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * ROB BUTLER 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: dlz.h,v 1.7.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-/*! \file dns/dlz.h */
-
-#ifndef DLZ_H
-#define DLZ_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*
- * DLZ Interface
- *
- * The DLZ interface allows zones to be looked up using a driver instead of
- * Bind's default in memory zone table.
- *
- *
- * Reliability:
- * No anticipated impact.
- *
- * Resources:
- *
- * Security:
- * No anticipated impact.
- *
- * Standards:
- * None.
- */
-
-/*****
- ***** Imports
- *****/
-
-#include <dns/name.h>
-#include <dns/types.h>
-#include <dns/view.h>
-
-#include <isc/lang.h>
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Types
- ***/
-
-#define DNS_DLZ_MAGIC ISC_MAGIC('D','L','Z','D')
-#define DNS_DLZ_VALID(dlz) ISC_MAGIC_VALID(dlz, DNS_DLZ_MAGIC)
-
-typedef isc_result_t
-(*dns_dlzallowzonexfr_t)(void *driverarg, void *dbdata, isc_mem_t *mctx,
- dns_rdataclass_t rdclass, dns_name_t *name,
- isc_sockaddr_t *clientaddr,
- dns_db_t **dbp);
-
-/*%<
- * Method prototype. Drivers implementing the DLZ interface MUST
- * supply an allow zone transfer method. This method is called when
- * the DNS server is performing a zone transfer query. The driver's
- * method should return ISC_R_SUCCESS and a database pointer to the
- * name server if the zone is supported by the database, and zone
- * transfer is allowed. Otherwise it will return ISC_R_NOTFOUND if
- * the zone is not supported by the database, or ISC_R_NOPERM if zone
- * transfers are not allowed. If an error occurs it should return a
- * result code indicating the type of error.
- */
-
-typedef isc_result_t
-(*dns_dlzcreate_t)(isc_mem_t *mctx, const char *dlzname, unsigned int argc,
- char *argv[], void *driverarg, void **dbdata);
-
-/*%<
- * Method prototype. Drivers implementing the DLZ interface MUST
- * supply a create method. This method is called when the DNS server
- * is starting up and creating drivers for use later.
- */
-
-typedef void
-(*dns_dlzdestroy_t)(void *driverarg, void **dbdata);
-
-/*%<
- * Method prototype. Drivers implementing the DLZ interface MUST
- * supply a destroy method. This method is called when the DNS server
- * is shutting down and no longer needs the driver.
- */
-
-typedef isc_result_t
-(*dns_dlzfindzone_t)(void *driverarg, void *dbdata, isc_mem_t *mctx,
- dns_rdataclass_t rdclass, dns_name_t *name,
- dns_db_t **dbp);
-
-/*%<
-
- * Method prototype. Drivers implementing the DLZ interface MUST
- * supply a find zone method. This method is called when the DNS
- * server is performing a query. The find zone method will be called
- * with the longest possible name first, and continue to be called
- * with successively shorter domain names, until any of the following
- * occur:
- *
- * \li 1) a match is found, and the function returns (ISC_R_SUCCESS)
- *
- * \li 2) a problem occurs, and the functions returns anything other
- * than (ISC_R_NOTFOUND)
- * \li 3) we run out of domain name labels. I.E. we have tried the
- * shortest domain name
- * \li 4) the number of labels in the domain name is less than
- * min_labels for dns_dlzfindzone
- *
- * The driver's find zone method should return ISC_R_SUCCESS and a
- * database pointer to the name server if the zone is supported by the
- * database. Otherwise it will return ISC_R_NOTFOUND, and a null
- * pointer if the zone is not supported. If an error occurs it should
- * return a result code indicating the type of error.
- */
-
-/*% the methods supplied by a DLZ driver */
-typedef struct dns_dlzmethods {
- dns_dlzcreate_t create;
- dns_dlzdestroy_t destroy;
- dns_dlzfindzone_t findzone;
- dns_dlzallowzonexfr_t allowzonexfr;
-} dns_dlzmethods_t;
-
-/*% information about a DLZ driver */
-struct dns_dlzimplementation {
- const char *name;
- const dns_dlzmethods_t *methods;
- isc_mem_t *mctx;
- void *driverarg;
- ISC_LINK(dns_dlzimplementation_t) link;
-};
-
-/*% an instance of a DLZ driver */
-struct dns_dlzdb {
- unsigned int magic;
- isc_mem_t *mctx;
- dns_dlzimplementation_t *implementation;
- void *dbdata;
-};
-
-
-/***
- *** Method declarations
- ***/
-
-isc_result_t
-dns_dlzallowzonexfr(dns_view_t *view, dns_name_t *name,
- isc_sockaddr_t *clientaddr, dns_db_t **dbp);
-
-/*%<
- * This method is called when the DNS server is performing a zone
- * transfer query. It will call the DLZ driver's allow zone transfer
- * method.
- */
-
-isc_result_t
-dns_dlzcreate(isc_mem_t *mctx, const char *dlzname,
- const char *drivername, unsigned int argc,
- char *argv[], dns_dlzdb_t **dbp);
-
-/*%<
- * This method is called when the DNS server is starting up and
- * creating drivers for use later. It will search the DLZ driver list
- * for 'drivername' and return a DLZ driver via dbp if a match is
- * found. If the DLZ driver supplies a create method, this function
- * will call it.
- */
-
-void
-dns_dlzdestroy(dns_dlzdb_t **dbp);
-
-/*%<
- * This method is called when the DNS server is shutting down and no
- * longer needs the driver. If the DLZ driver supplies a destroy
- * methods, this function will call it.
- */
-
-isc_result_t
-dns_dlzfindzone(dns_view_t *view, dns_name_t *name,
- unsigned int minlabels, dns_db_t **dbp);
-
-/*%<
- * This method is called when the DNS server is performing a query.
- * It will call the DLZ driver's find zone method.
- */
-
-isc_result_t
-dns_dlzregister(const char *drivername, const dns_dlzmethods_t *methods,
- void *driverarg, isc_mem_t *mctx,
- dns_dlzimplementation_t **dlzimp);
-
-/*%<
- * Register a dynamically loadable zones (DLZ) driver for the database
- * type 'drivername', implemented by the functions in '*methods'.
- *
- * dlzimp must point to a NULL dlz_implementation_t pointer. That is,
- * dlzimp != NULL && *dlzimp == NULL. It will be assigned a value that
- * will later be used to identify the driver when deregistering it.
- */
-
-isc_result_t
-dns_dlzstrtoargv(isc_mem_t *mctx, char *s, unsigned int *argcp, char ***argvp);
-
-/*%<
- * This method is called when the name server is starting up to parse
- * the DLZ driver command line from named.conf. Basically it splits
- * up a string into and argc / argv. The primary difference of this
- * method is items between braces { } are considered only 1 word. for
- * example the command line "this is { one grouped phrase } and this
- * isn't" would be parsed into:
- *
- * \li argv[0]: "this"
- * \li argv[1]: "is"
- * \li argv{2]: " one grouped phrase "
- * \li argv[3]: "and"
- * \li argv[4]: "this"
- * \li argv{5}: "isn't"
- *
- * braces should NOT be nested, more than one grouping in the command
- * line is allowed. Notice, argv[2] has an extra space at the
- * beginning and end. Extra spaces are not stripped between a
- * grouping. You can do so in your driver if needed, or be sure not
- * to put extra spaces before / after the braces.
- */
-
-void
-dns_dlzunregister(dns_dlzimplementation_t **dlzimp);
-
-/*%<
- * Removes the dlz driver from the list of registered dlz drivers.
- * There must be no active dlz drivers of this type when this function
- * is called.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DLZ_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: dnssec.h,v 1.32.332.4 2009/06/08 23:47:00 tbox Exp $ */
-
-#ifndef DNS_DNSSEC_H
-#define DNS_DNSSEC_H 1
-
-/*! \file dns/dnssec.h */
-
-#include <isc/lang.h>
-#include <isc/stdtime.h>
-
-#include <dns/types.h>
-
-#include <dst/dst.h>
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_dnssec_keyfromrdata(dns_name_t *name, dns_rdata_t *rdata, isc_mem_t *mctx,
- dst_key_t **key);
-/*%<
- * Creates a DST key from a DNS record. Basically a wrapper around
- * dst_key_fromdns().
- *
- * Requires:
- *\li 'name' is not NULL
- *\li 'rdata' is not NULL
- *\li 'mctx' is not NULL
- *\li 'key' is not NULL
- *\li '*key' is NULL
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li DST_R_INVALIDPUBLICKEY
- *\li various errors from dns_name_totext
- */
-
-isc_result_t
-dns_dnssec_sign(dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
- isc_stdtime_t *inception, isc_stdtime_t *expire,
- isc_mem_t *mctx, isc_buffer_t *buffer, dns_rdata_t *sigrdata);
-/*%<
- * Generates a SIG record covering this rdataset. This has no effect
- * on existing SIG records.
- *
- * Requires:
- *\li 'name' (the owner name of the record) is a valid name
- *\li 'set' is a valid rdataset
- *\li 'key' is a valid key
- *\li 'inception' is not NULL
- *\li 'expire' is not NULL
- *\li 'mctx' is not NULL
- *\li 'buffer' is not NULL
- *\li 'sigrdata' is not NULL
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_NOSPACE
- *\li #DNS_R_INVALIDTIME - the expiration is before the inception
- *\li #DNS_R_KEYUNAUTHORIZED - the key cannot sign this data (either
- * it is not a zone key or its flags prevent
- * authentication)
- *\li DST_R_*
- */
-
-isc_result_t
-dns_dnssec_verify(dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
- isc_boolean_t ignoretime, isc_mem_t *mctx,
- dns_rdata_t *sigrdata);
-
-isc_result_t
-dns_dnssec_verify2(dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
- isc_boolean_t ignoretime, isc_mem_t *mctx,
- dns_rdata_t *sigrdata, dns_name_t *wild);
-/*%<
- * Verifies the SIG record covering this rdataset signed by a specific
- * key. This does not determine if the key's owner is authorized to
- * sign this record, as this requires a resolver or database.
- * If 'ignoretime' is ISC_TRUE, temporal validity will not be checked.
- *
- * Requires:
- *\li 'name' (the owner name of the record) is a valid name
- *\li 'set' is a valid rdataset
- *\li 'key' is a valid key
- *\li 'mctx' is not NULL
- *\li 'sigrdata' is a valid rdata containing a SIG record
- *\li 'wild' if non-NULL then is a valid and has a buffer.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li #DNS_R_FROMWILDCARD - the signature is valid and is from
- * a wildcard expansion. dns_dnssec_verify2() only.
- * 'wild' contains the name of the wildcard if non-NULL.
- *\li #DNS_R_SIGINVALID - the signature fails to verify
- *\li #DNS_R_SIGEXPIRED - the signature has expired
- *\li #DNS_R_SIGFUTURE - the signature's validity period has not begun
- *\li #DNS_R_KEYUNAUTHORIZED - the key cannot sign this data (either
- * it is not a zone key or its flags prevent
- * authentication)
- *\li DST_R_*
- */
-
-/*@{*/
-isc_result_t
-dns_dnssec_findzonekeys(dns_db_t *db, dns_dbversion_t *ver, dns_dbnode_t *node,
- dns_name_t *name, isc_mem_t *mctx,
- unsigned int maxkeys, dst_key_t **keys,
- unsigned int *nkeys);
-isc_result_t
-dns_dnssec_findzonekeys2(dns_db_t *db, dns_dbversion_t *ver,
- dns_dbnode_t *node, dns_name_t *name,
- const char *directory, isc_mem_t *mctx,
- unsigned int maxkeys, dst_key_t **keys,
- unsigned int *nkeys);
-/*%<
- * Finds a set of zone keys.
- * XXX temporary - this should be handled in dns_zone_t.
- */
-/*@}*/
-
-isc_result_t
-dns_dnssec_signmessage(dns_message_t *msg, dst_key_t *key);
-/*%<
- * Signs a message with a SIG(0) record. This is implicitly called by
- * dns_message_renderend() if msg->sig0key is not NULL.
- *
- * Requires:
- *\li 'msg' is a valid message
- *\li 'key' is a valid key that can be used for signing
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li DST_R_*
- */
-
-isc_result_t
-dns_dnssec_verifymessage(isc_buffer_t *source, dns_message_t *msg,
- dst_key_t *key);
-/*%<
- * Verifies a message signed by a SIG(0) record. This is not
- * called implicitly by dns_message_parse(). If dns_message_signer()
- * is called before dns_dnssec_verifymessage(), it will return
- * #DNS_R_NOTVERIFIEDYET. dns_dnssec_verifymessage() will set
- * the verified_sig0 flag in msg if the verify succeeds, and
- * the sig0status field otherwise.
- *
- * Requires:
- *\li 'source' is a valid buffer containing the unparsed message
- *\li 'msg' is a valid message
- *\li 'key' is a valid key
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_NOTFOUND - no SIG(0) was found
- *\li #DNS_R_SIGINVALID - the SIG record is not well-formed or
- * was not generated by the key.
- *\li DST_R_*
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_DNSSEC_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: ds.h,v 1.10 2007/06/19 23:47:16 tbox Exp $ */
-
-#ifndef DNS_DS_H
-#define DNS_DS_H 1
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-#define DNS_DSDIGEST_SHA1 (1)
-#define DNS_DSDIGEST_SHA256 (2)
-
-/*
- * Assuming SHA-256 digest type.
- */
-#define DNS_DS_BUFFERSIZE (36)
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_ds_buildrdata(dns_name_t *owner, dns_rdata_t *key,
- unsigned int digest_type, unsigned char *buffer,
- dns_rdata_t *rdata);
-/*%<
- * Build the rdata of a DS record.
- *
- * Requires:
- *\li key Points to a valid DNS KEY record.
- *\li buffer Points to a temporary buffer of at least
- * #DNS_DS_BUFFERSIZE bytes.
- *\li rdata Points to an initialized dns_rdata_t.
- *
- * Ensures:
- * \li *rdata Contains a valid DS rdata. The 'data' member refers
- * to 'buffer'.
- */
-
-isc_boolean_t
-dns_ds_digest_supported(unsigned int digest_type);
-/*%<
- * Is this digest algorithm supported by dns_ds_buildrdata()?
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_DS_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2003 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/***************
- ***************
- *************** THIS FILE IS AUTOMATICALLY GENERATED BY gen.c.
- *************** DO NOT EDIT!
- ***************
- ***************/
-
-/*! \file */
-
-#ifndef DNS_ENUMCLASS_H
-#define DNS_ENUMCLASS_H 1
-
-enum {
- dns_rdataclass_reserved0 = 0,
-#define dns_rdataclass_reserved0 \
- ((dns_rdataclass_t)dns_rdataclass_reserved0)
- dns_rdataclass_in = 1,
-#define dns_rdataclass_in ((dns_rdataclass_t)dns_rdataclass_in)
- dns_rdataclass_chaos = 3,
-#define dns_rdataclass_chaos ((dns_rdataclass_t)dns_rdataclass_chaos)
- dns_rdataclass_ch = 3,
-#define dns_rdataclass_ch ((dns_rdataclass_t)dns_rdataclass_ch)
- dns_rdataclass_hs = 4,
-#define dns_rdataclass_hs ((dns_rdataclass_t)dns_rdataclass_hs)
- dns_rdataclass_none = 254,
-#define dns_rdataclass_none ((dns_rdataclass_t)dns_rdataclass_none)
- dns_rdataclass_any = 255
-#define dns_rdataclass_any ((dns_rdataclass_t)dns_rdataclass_any)
-};
-
-#endif /* DNS_ENUMCLASS_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2003 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/***************
- ***************
- *************** THIS FILE IS AUTOMATICALLY GENERATED BY gen.c.
- *************** DO NOT EDIT!
- ***************
- ***************/
-
-/*! \file */
-
-#ifndef DNS_ENUMTYPE_H
-#define DNS_ENUMTYPE_H 1
-
-enum {
- dns_rdatatype_none = 0,
- dns_rdatatype_a = 1,
- dns_rdatatype_ns = 2,
- dns_rdatatype_md = 3,
- dns_rdatatype_mf = 4,
- dns_rdatatype_cname = 5,
- dns_rdatatype_soa = 6,
- dns_rdatatype_mb = 7,
- dns_rdatatype_mg = 8,
- dns_rdatatype_mr = 9,
- dns_rdatatype_null = 10,
- dns_rdatatype_wks = 11,
- dns_rdatatype_ptr = 12,
- dns_rdatatype_hinfo = 13,
- dns_rdatatype_minfo = 14,
- dns_rdatatype_mx = 15,
- dns_rdatatype_txt = 16,
- dns_rdatatype_rp = 17,
- dns_rdatatype_afsdb = 18,
- dns_rdatatype_x25 = 19,
- dns_rdatatype_isdn = 20,
- dns_rdatatype_rt = 21,
- dns_rdatatype_nsap = 22,
- dns_rdatatype_nsap_ptr = 23,
- dns_rdatatype_sig = 24,
- dns_rdatatype_key = 25,
- dns_rdatatype_px = 26,
- dns_rdatatype_gpos = 27,
- dns_rdatatype_aaaa = 28,
- dns_rdatatype_loc = 29,
- dns_rdatatype_nxt = 30,
- dns_rdatatype_srv = 33,
- dns_rdatatype_naptr = 35,
- dns_rdatatype_kx = 36,
- dns_rdatatype_cert = 37,
- dns_rdatatype_a6 = 38,
- dns_rdatatype_dname = 39,
- dns_rdatatype_opt = 41,
- dns_rdatatype_apl = 42,
- dns_rdatatype_ds = 43,
- dns_rdatatype_sshfp = 44,
- dns_rdatatype_ipseckey = 45,
- dns_rdatatype_rrsig = 46,
- dns_rdatatype_nsec = 47,
- dns_rdatatype_dnskey = 48,
- dns_rdatatype_dhcid = 49,
- dns_rdatatype_nsec3 = 50,
- dns_rdatatype_nsec3param = 51,
- dns_rdatatype_spf = 99,
- dns_rdatatype_unspec = 103,
- dns_rdatatype_tkey = 249,
- dns_rdatatype_tsig = 250,
- dns_rdatatype_dlv = 32769,
- dns_rdatatype_ixfr = 251,
- dns_rdatatype_axfr = 252,
- dns_rdatatype_mailb = 253,
- dns_rdatatype_maila = 254,
- dns_rdatatype_any = 255
-};
-
-#define dns_rdatatype_none ((dns_rdatatype_t)dns_rdatatype_none)
-#define dns_rdatatype_a ((dns_rdatatype_t)dns_rdatatype_a)
-#define dns_rdatatype_ns ((dns_rdatatype_t)dns_rdatatype_ns)
-#define dns_rdatatype_md ((dns_rdatatype_t)dns_rdatatype_md)
-#define dns_rdatatype_mf ((dns_rdatatype_t)dns_rdatatype_mf)
-#define dns_rdatatype_cname ((dns_rdatatype_t)dns_rdatatype_cname)
-#define dns_rdatatype_soa ((dns_rdatatype_t)dns_rdatatype_soa)
-#define dns_rdatatype_mb ((dns_rdatatype_t)dns_rdatatype_mb)
-#define dns_rdatatype_mg ((dns_rdatatype_t)dns_rdatatype_mg)
-#define dns_rdatatype_mr ((dns_rdatatype_t)dns_rdatatype_mr)
-#define dns_rdatatype_null ((dns_rdatatype_t)dns_rdatatype_null)
-#define dns_rdatatype_wks ((dns_rdatatype_t)dns_rdatatype_wks)
-#define dns_rdatatype_ptr ((dns_rdatatype_t)dns_rdatatype_ptr)
-#define dns_rdatatype_hinfo ((dns_rdatatype_t)dns_rdatatype_hinfo)
-#define dns_rdatatype_minfo ((dns_rdatatype_t)dns_rdatatype_minfo)
-#define dns_rdatatype_mx ((dns_rdatatype_t)dns_rdatatype_mx)
-#define dns_rdatatype_txt ((dns_rdatatype_t)dns_rdatatype_txt)
-#define dns_rdatatype_rp ((dns_rdatatype_t)dns_rdatatype_rp)
-#define dns_rdatatype_afsdb ((dns_rdatatype_t)dns_rdatatype_afsdb)
-#define dns_rdatatype_x25 ((dns_rdatatype_t)dns_rdatatype_x25)
-#define dns_rdatatype_isdn ((dns_rdatatype_t)dns_rdatatype_isdn)
-#define dns_rdatatype_rt ((dns_rdatatype_t)dns_rdatatype_rt)
-#define dns_rdatatype_nsap ((dns_rdatatype_t)dns_rdatatype_nsap)
-#define dns_rdatatype_nsap_ptr ((dns_rdatatype_t)dns_rdatatype_nsap_ptr)
-#define dns_rdatatype_sig ((dns_rdatatype_t)dns_rdatatype_sig)
-#define dns_rdatatype_key ((dns_rdatatype_t)dns_rdatatype_key)
-#define dns_rdatatype_px ((dns_rdatatype_t)dns_rdatatype_px)
-#define dns_rdatatype_gpos ((dns_rdatatype_t)dns_rdatatype_gpos)
-#define dns_rdatatype_aaaa ((dns_rdatatype_t)dns_rdatatype_aaaa)
-#define dns_rdatatype_loc ((dns_rdatatype_t)dns_rdatatype_loc)
-#define dns_rdatatype_nxt ((dns_rdatatype_t)dns_rdatatype_nxt)
-#define dns_rdatatype_srv ((dns_rdatatype_t)dns_rdatatype_srv)
-#define dns_rdatatype_naptr ((dns_rdatatype_t)dns_rdatatype_naptr)
-#define dns_rdatatype_kx ((dns_rdatatype_t)dns_rdatatype_kx)
-#define dns_rdatatype_cert ((dns_rdatatype_t)dns_rdatatype_cert)
-#define dns_rdatatype_a6 ((dns_rdatatype_t)dns_rdatatype_a6)
-#define dns_rdatatype_dname ((dns_rdatatype_t)dns_rdatatype_dname)
-#define dns_rdatatype_opt ((dns_rdatatype_t)dns_rdatatype_opt)
-#define dns_rdatatype_apl ((dns_rdatatype_t)dns_rdatatype_apl)
-#define dns_rdatatype_ds ((dns_rdatatype_t)dns_rdatatype_ds)
-#define dns_rdatatype_sshfp ((dns_rdatatype_t)dns_rdatatype_sshfp)
-#define dns_rdatatype_ipseckey ((dns_rdatatype_t)dns_rdatatype_ipseckey)
-#define dns_rdatatype_rrsig ((dns_rdatatype_t)dns_rdatatype_rrsig)
-#define dns_rdatatype_nsec ((dns_rdatatype_t)dns_rdatatype_nsec)
-#define dns_rdatatype_dnskey ((dns_rdatatype_t)dns_rdatatype_dnskey)
-#define dns_rdatatype_dhcid ((dns_rdatatype_t)dns_rdatatype_dhcid)
-#define dns_rdatatype_nsec3 ((dns_rdatatype_t)dns_rdatatype_nsec3)
-#define dns_rdatatype_nsec3param ((dns_rdatatype_t)dns_rdatatype_nsec3param)
-#define dns_rdatatype_spf ((dns_rdatatype_t)dns_rdatatype_spf)
-#define dns_rdatatype_unspec ((dns_rdatatype_t)dns_rdatatype_unspec)
-#define dns_rdatatype_tkey ((dns_rdatatype_t)dns_rdatatype_tkey)
-#define dns_rdatatype_tsig ((dns_rdatatype_t)dns_rdatatype_tsig)
-#define dns_rdatatype_dlv ((dns_rdatatype_t)dns_rdatatype_dlv)
-#define dns_rdatatype_ixfr ((dns_rdatatype_t)dns_rdatatype_ixfr)
-#define dns_rdatatype_axfr ((dns_rdatatype_t)dns_rdatatype_axfr)
-#define dns_rdatatype_mailb ((dns_rdatatype_t)dns_rdatatype_mailb)
-#define dns_rdatatype_maila ((dns_rdatatype_t)dns_rdatatype_maila)
-#define dns_rdatatype_any ((dns_rdatatype_t)dns_rdatatype_any)
-
-#endif /* DNS_ENUMTYPE_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: events.h,v 1.49.332.2 2009/05/07 23:47:12 tbox Exp $ */
-
-#ifndef DNS_EVENTS_H
-#define DNS_EVENTS_H 1
-
-#include <isc/eventclass.h>
-
-/*! \file dns/events.h
- * \brief
- * Registry of DNS event numbers.
- */
-
-#define DNS_EVENT_FETCHCONTROL (ISC_EVENTCLASS_DNS + 0)
-#define DNS_EVENT_FETCHDONE (ISC_EVENTCLASS_DNS + 1)
-#define DNS_EVENT_VIEWRESSHUTDOWN (ISC_EVENTCLASS_DNS + 2)
-#define DNS_EVENT_VIEWADBSHUTDOWN (ISC_EVENTCLASS_DNS + 3)
-#define DNS_EVENT_UPDATE (ISC_EVENTCLASS_DNS + 4)
-#define DNS_EVENT_UPDATEDONE (ISC_EVENTCLASS_DNS + 5)
-#define DNS_EVENT_DISPATCH (ISC_EVENTCLASS_DNS + 6)
-#define DNS_EVENT_TCPMSG (ISC_EVENTCLASS_DNS + 7)
-#define DNS_EVENT_ADBMOREADDRESSES (ISC_EVENTCLASS_DNS + 8)
-#define DNS_EVENT_ADBNOMOREADDRESSES (ISC_EVENTCLASS_DNS + 9)
-#define DNS_EVENT_ADBCANCELED (ISC_EVENTCLASS_DNS + 10)
-#define DNS_EVENT_ADBNAMEDELETED (ISC_EVENTCLASS_DNS + 11)
-#define DNS_EVENT_ADBSHUTDOWN (ISC_EVENTCLASS_DNS + 12)
-#define DNS_EVENT_ADBEXPIRED (ISC_EVENTCLASS_DNS + 13)
-#define DNS_EVENT_ADBCONTROL (ISC_EVENTCLASS_DNS + 14)
-#define DNS_EVENT_CACHECLEAN (ISC_EVENTCLASS_DNS + 15)
-#define DNS_EVENT_BYADDRDONE (ISC_EVENTCLASS_DNS + 16)
-#define DNS_EVENT_ZONECONTROL (ISC_EVENTCLASS_DNS + 17)
-#define DNS_EVENT_DBDESTROYED (ISC_EVENTCLASS_DNS + 18)
-#define DNS_EVENT_VALIDATORDONE (ISC_EVENTCLASS_DNS + 19)
-#define DNS_EVENT_REQUESTDONE (ISC_EVENTCLASS_DNS + 20)
-#define DNS_EVENT_VALIDATORSTART (ISC_EVENTCLASS_DNS + 21)
-#define DNS_EVENT_VIEWREQSHUTDOWN (ISC_EVENTCLASS_DNS + 22)
-#define DNS_EVENT_NOTIFYSENDTOADDR (ISC_EVENTCLASS_DNS + 23)
-#define DNS_EVENT_ZONE (ISC_EVENTCLASS_DNS + 24)
-#define DNS_EVENT_ZONESTARTXFRIN (ISC_EVENTCLASS_DNS + 25)
-#define DNS_EVENT_MASTERQUANTUM (ISC_EVENTCLASS_DNS + 26)
-#define DNS_EVENT_CACHEOVERMEM (ISC_EVENTCLASS_DNS + 27)
-#define DNS_EVENT_MASTERNEXTZONE (ISC_EVENTCLASS_DNS + 28)
-#define DNS_EVENT_IOREADY (ISC_EVENTCLASS_DNS + 29)
-#define DNS_EVENT_LOOKUPDONE (ISC_EVENTCLASS_DNS + 30)
-/* #define DNS_EVENT_unused (ISC_EVENTCLASS_DNS + 31) */
-#define DNS_EVENT_DISPATCHCONTROL (ISC_EVENTCLASS_DNS + 32)
-#define DNS_EVENT_REQUESTCONTROL (ISC_EVENTCLASS_DNS + 33)
-#define DNS_EVENT_DUMPQUANTUM (ISC_EVENTCLASS_DNS + 34)
-#define DNS_EVENT_IMPORTRECVDONE (ISC_EVENTCLASS_DNS + 35)
-#define DNS_EVENT_FREESTORAGE (ISC_EVENTCLASS_DNS + 36)
-#define DNS_EVENT_VIEWACACHESHUTDOWN (ISC_EVENTCLASS_DNS + 37)
-#define DNS_EVENT_ACACHECONTROL (ISC_EVENTCLASS_DNS + 38)
-#define DNS_EVENT_ACACHECLEAN (ISC_EVENTCLASS_DNS + 39)
-#define DNS_EVENT_ACACHEOVERMEM (ISC_EVENTCLASS_DNS + 40)
-#define DNS_EVENT_RBTPRUNE (ISC_EVENTCLASS_DNS + 41)
-
-#define DNS_EVENT_FIRSTEVENT (ISC_EVENTCLASS_DNS + 0)
-#define DNS_EVENT_LASTEVENT (ISC_EVENTCLASS_DNS + 65535)
-
-#endif /* DNS_EVENTS_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: fixedname.h,v 1.19 2007/06/19 23:47:16 tbox Exp $ */
-
-#ifndef DNS_FIXEDNAME_H
-#define DNS_FIXEDNAME_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/fixedname.h
- * \brief
- * Fixed-size Names
- *
- * dns_fixedname_t is a convenience type containing a name, an offsets table,
- * and a dedicated buffer big enough for the longest possible name.
- *
- * MP:
- *\li The caller must ensure any required synchronization.
- *
- * Reliability:
- *\li No anticipated impact.
- *
- * Resources:
- *\li Per dns_fixedname_t:
- *\code
- * sizeof(dns_name_t) + sizeof(dns_offsets_t) +
- * sizeof(isc_buffer_t) + 255 bytes + structure padding
- *\endcode
- *
- * Security:
- *\li No anticipated impact.
- *
- * Standards:
- *\li None.
- */
-
-/*****
- ***** Imports
- *****/
-
-#include <isc/buffer.h>
-
-#include <dns/name.h>
-
-/*****
- ***** Types
- *****/
-
-struct dns_fixedname {
- dns_name_t name;
- dns_offsets_t offsets;
- isc_buffer_t buffer;
- unsigned char data[DNS_NAME_MAXWIRE];
-};
-
-#define dns_fixedname_init(fn) \
- do { \
- dns_name_init(&((fn)->name), (fn)->offsets); \
- isc_buffer_init(&((fn)->buffer), (fn)->data, \
- DNS_NAME_MAXWIRE); \
- dns_name_setbuffer(&((fn)->name), &((fn)->buffer)); \
- } while (0)
-
-#define dns_fixedname_invalidate(fn) \
- dns_name_invalidate(&((fn)->name))
-
-#define dns_fixedname_name(fn) (&((fn)->name))
-
-#endif /* DNS_FIXEDNAME_H */
+++ /dev/null
-/*
- * Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: iptable.h,v 1.4 2007/09/14 01:46:05 marka Exp $ */
-
-#ifndef DNS_IPTABLE_H
-#define DNS_IPTABLE_H 1
-
-#include <isc/lang.h>
-#include <isc/magic.h>
-#include <isc/radix.h>
-
-struct dns_iptable {
- unsigned int magic;
- isc_mem_t *mctx;
- isc_refcount_t refcount;
- isc_radix_tree_t *radix;
- ISC_LINK(dns_iptable_t) nextincache;
-};
-
-#define DNS_IPTABLE_MAGIC ISC_MAGIC('T','a','b','l')
-#define DNS_IPTABLE_VALID(a) ISC_MAGIC_VALID(a, DNS_IPTABLE_MAGIC)
-
-/***
- *** Functions
- ***/
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_iptable_create(isc_mem_t *mctx, dns_iptable_t **target);
-/*
- * Create a new IP table and the underlying radix structure
- */
-
-isc_result_t
-dns_iptable_addprefix(dns_iptable_t *tab, isc_netaddr_t *addr,
- isc_uint16_t bitlen, isc_boolean_t pos);
-/*
- * Add an IP prefix to an existing IP table
- */
-
-isc_result_t
-dns_iptable_merge(dns_iptable_t *tab, dns_iptable_t *source, isc_boolean_t pos);
-/*
- * Merge one IP table into another one.
- */
-
-void
-dns_iptable_attach(dns_iptable_t *source, dns_iptable_t **target);
-
-void
-dns_iptable_detach(dns_iptable_t **tabp);
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_IPTABLE_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: journal.h,v 1.33.120.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef DNS_JOURNAL_H
-#define DNS_JOURNAL_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/journal.h
- * \brief
- * Database journaling.
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-#include <isc/magic.h>
-
-#include <dns/name.h>
-#include <dns/diff.h>
-#include <dns/rdata.h>
-#include <dns/types.h>
-
-/***
- *** Defines.
- ***/
-#define DNS_JOURNALOPT_RESIGN 0x00000001
-
-/***
- *** Types
- ***/
-
-/*%
- * A dns_journal_t represents an open journal file. This is an opaque type.
- *
- * A particular dns_journal_t object may be opened for writing, in which case
- * it can be used for writing transactions to a journal file, or it can be
- * opened for reading, in which case it can be used for reading transactions
- * from (iterating over) a journal file. A single dns_journal_t object may
- * not be used for both purposes.
- */
-typedef struct dns_journal dns_journal_t;
-
-
-/***
- *** Functions
- ***/
-
-ISC_LANG_BEGINDECLS
-
-/**************************************************************************/
-
-isc_result_t
-dns_db_createsoatuple(dns_db_t *db, dns_dbversion_t *ver, isc_mem_t *mctx,
- dns_diffop_t op, dns_difftuple_t **tp);
-/*!< brief
- * Create a diff tuple for the current database SOA.
- * XXX this probably belongs somewhere else.
- */
-
-
-/*@{*/
-#define DNS_SERIAL_GT(a, b) ((int)(((a) - (b)) & 0xFFFFFFFF) > 0)
-#define DNS_SERIAL_GE(a, b) ((int)(((a) - (b)) & 0xFFFFFFFF) >= 0)
-/*!< brief
- * Compare SOA serial numbers. DNS_SERIAL_GT(a, b) returns true iff
- * a is "greater than" b where "greater than" is as defined in RFC1982.
- * DNS_SERIAL_GE(a, b) returns true iff a is "greater than or equal to" b.
- */
-/*@}*/
-
-/**************************************************************************/
-/*
- * Journal object creation and destruction.
- */
-
-isc_result_t
-dns_journal_open(isc_mem_t *mctx, const char *filename, isc_boolean_t write,
- dns_journal_t **journalp);
-/*%<
- * Open the journal file 'filename' and create a dns_journal_t object for it.
- *
- * If 'write' is ISC_TRUE, the journal is open for writing. If it does
- * not exist, it is created.
- *
- * If 'write' is ISC_FALSE, the journal is open for reading. If it does
- * not exist, ISC_R_NOTFOUND is returned.
- */
-
-void
-dns_journal_destroy(dns_journal_t **journalp);
-/*%<
- * Destroy a dns_journal_t, closing any open files and freeing its memory.
- */
-
-/**************************************************************************/
-/*
- * Writing transactions to journals.
- */
-
-isc_result_t
-dns_journal_begin_transaction(dns_journal_t *j);
-/*%<
- * Prepare to write a new transaction to the open journal file 'j'.
- *
- * Requires:
- * \li 'j' is open for writing.
- */
-
-isc_result_t
-dns_journal_writediff(dns_journal_t *j, dns_diff_t *diff);
-/*%<
- * Write 'diff' to the current transaction of journal file 'j'.
- *
- * Requires:
- * \li 'j' is open for writing and dns_journal_begin_transaction()
- * has been called.
- *
- *\li 'diff' is a full or partial, correctly ordered IXFR
- * difference sequence.
- */
-
-isc_result_t
-dns_journal_commit(dns_journal_t *j);
-/*%<
- * Commit the current transaction of journal file 'j'.
- *
- * Requires:
- * \li 'j' is open for writing and dns_journal_begin_transaction()
- * has been called.
- *
- * \li dns_journal_writediff() has been called one or more times
- * to form a complete, correctly ordered IXFR difference
- * sequence.
- */
-
-isc_result_t
-dns_journal_write_transaction(dns_journal_t *j, dns_diff_t *diff);
-/*%
- * Write a complete transaction at once to a journal file,
- * sorting it if necessary, and commit it. Equivalent to calling
- * dns_diff_sort(), dns_journal_begin_transaction(),
- * dns_journal_writediff(), and dns_journal_commit().
- *
- * Requires:
- *\li 'j' is open for writing.
- *
- * \li 'diff' contains exactly one SOA deletion, one SOA addition
- * with a greater serial number, and possibly other changes,
- * in arbitrary order.
- */
-
-/**************************************************************************/
-/*
- * Reading transactions from journals.
- */
-
-isc_uint32_t
-dns_journal_first_serial(dns_journal_t *j);
-isc_uint32_t
-dns_journal_last_serial(dns_journal_t *j);
-/*%<
- * Get the first and last addressable serial number in the journal.
- */
-
-isc_result_t
-dns_journal_iter_init(dns_journal_t *j,
- isc_uint32_t begin_serial, isc_uint32_t end_serial);
-/*%<
- * Prepare to iterate over the transactions that will bring the database
- * from SOA serial number 'begin_serial' to 'end_serial'.
- *
- * Returns:
- *\li ISC_R_SUCCESS
- *\li ISC_R_RANGE begin_serial is outside the addressable range.
- *\li ISC_R_NOTFOUND begin_serial is within the range of addressable
- * serial numbers covered by the journal, but
- * this particular serial number does not exist.
- */
-
-/*@{*/
-isc_result_t
-dns_journal_first_rr(dns_journal_t *j);
-isc_result_t
-dns_journal_next_rr(dns_journal_t *j);
-/*%<
- * Position the iterator at the first/next RR in a journal
- * transaction sequence established using dns_journal_iter_init().
- *
- * Requires:
- * \li dns_journal_iter_init() has been called.
- *
- */
-/*@}*/
-
-void
-dns_journal_current_rr(dns_journal_t *j, dns_name_t **name, isc_uint32_t *ttl,
- dns_rdata_t **rdata);
-/*%<
- * Get the name, ttl, and rdata of the current journal RR.
- *
- * Requires:
- * \li The last call to dns_journal_first_rr() or dns_journal_next_rr()
- * returned ISC_R_SUCCESS.
- */
-
-/**************************************************************************/
-/*
- * Database roll-forward.
- */
-
-isc_result_t
-dns_journal_rollforward(isc_mem_t *mctx, dns_db_t *db, unsigned int options,
- const char *filename);
-/*%<
- * Roll forward (play back) the journal file "filename" into the
- * database "db". This should be called when the server starts
- * after a shutdown or crash.
- *
- * Requires:
- *\li 'mctx' is a valid memory context.
- *\li 'db' is a valid database which does not have a version
- * open for writing.
- *\li 'filename' is the name of the journal file belonging to 'db'.
- *
- * Returns:
- *\li DNS_R_NOJOURNAL when journal does not exist.
- *\li ISC_R_NOTFOUND when current serial in not in journal.
- *\li ISC_R_RANGE when current serial in not in journals range.
- *\li ISC_R_SUCCESS journal has been applied successfully to database.
- * others
- */
-
-isc_result_t
-dns_journal_print(isc_mem_t *mctx, const char *filename, FILE *file);
-/* For debugging not general use */
-
-isc_result_t
-dns_db_diff(isc_mem_t *mctx,
- dns_db_t *dba, dns_dbversion_t *dbvera,
- dns_db_t *dbb, dns_dbversion_t *dbverb,
- const char *journal_filename);
-/*%<
- * Compare the databases 'dba' and 'dbb' and generate a journal
- * entry containing the changes to make 'dba' from 'dbb' (note
- * the order). This journal entry will consist of a single,
- * possibly very large transaction. Append the journal
- * entry to the journal file specified by 'journal_filename'.
- */
-
-isc_result_t
-dns_journal_compact(isc_mem_t *mctx, char *filename, isc_uint32_t serial,
- isc_uint32_t target_size);
-/*%<
- * Attempt to compact the journal if it is greater that 'target_size'.
- * Changes from 'serial' onwards will be preserved. If the journal
- * exists and is non-empty 'serial' must exist in the journal.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_JOURNAL_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: keyflags.h,v 1.16 2007/06/19 23:47:16 tbox Exp $ */
-
-#ifndef DNS_KEYFLAGS_H
-#define DNS_KEYFLAGS_H 1
-
-/*! \file dns/keyflags.h */
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_keyflags_fromtext(dns_keyflags_t *flagsp, isc_textregion_t *source);
-/*%<
- * Convert the text 'source' refers to into a DNSSEC KEY flags value.
- * The text may contain either a set of flag mnemonics separated by
- * vertical bars or a decimal flags value. For compatibility with
- * older versions of BIND and the DNSSEC signer, octal values
- * prefixed with a zero and hexadecimal values prefixed with "0x"
- * are also accepted.
- *
- * Requires:
- *\li 'flagsp' is a valid pointer.
- *
- *\li 'source' is a valid text region.
- *
- * Returns:
- *\li ISC_R_SUCCESS on success
- *\li ISC_R_RANGE numeric flag value is out of range
- *\li DNS_R_UNKNOWN mnemonic flag is unknown
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_KEYFLAGS_H */
+++ /dev/null
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: keytable.h,v 1.16 2007/06/19 23:47:16 tbox Exp $ */
-
-#ifndef DNS_KEYTABLE_H
-#define DNS_KEYTABLE_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file
- * \brief
- * The keytable module provides services for storing and retrieving DNSSEC
- * trusted keys, as well as the ability to find the deepest matching key
- * for a given domain name.
- *
- * MP:
- *\li The module ensures appropriate synchronization of data structures it
- * creates and manipulates.
- *
- * Resources:
- *\li TBS
- *
- * Security:
- *\li No anticipated impact.
- */
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-#include <dst/dst.h>
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_keytable_create(isc_mem_t *mctx, dns_keytable_t **keytablep);
-/*%<
- * Create a keytable.
- *
- * Requires:
- *
- *\li 'mctx' is a valid memory context.
- *
- *\li keytablep != NULL && *keytablep == NULL
- *
- * Ensures:
- *
- *\li On success, *keytablep is a valid, empty key table.
- *
- * Returns:
- *
- *\li ISC_R_SUCCESS
- *
- *\li Any other result indicates failure.
- */
-
-
-void
-dns_keytable_attach(dns_keytable_t *source, dns_keytable_t **targetp);
-/*%<
- * Attach *targetp to source.
- *
- * Requires:
- *
- *\li 'source' is a valid keytable.
- *
- *\li 'targetp' points to a NULL dns_keytable_t *.
- *
- * Ensures:
- *
- *\li *targetp is attached to source.
- */
-
-void
-dns_keytable_detach(dns_keytable_t **keytablep);
-/*%<
- * Detach *keytablep from its keytable.
- *
- * Requires:
- *
- *\li 'keytablep' points to a valid keytable.
- *
- * Ensures:
- *
- *\li *keytablep is NULL.
- *
- *\li If '*keytablep' is the last reference to the keytable,
- * all resources used by the keytable will be freed
- */
-
-isc_result_t
-dns_keytable_add(dns_keytable_t *keytable, dst_key_t **keyp);
-/*%<
- * Add '*keyp' to 'keytable'.
- *
- * Notes:
- *
- *\li Ownership of *keyp is transferred to the keytable.
- *
- * Requires:
- *
- *\li keyp != NULL && *keyp is a valid dst_key_t *.
- *
- * Ensures:
- *
- *\li On success, *keyp == NULL
- *
- * Returns:
- *
- *\li ISC_R_SUCCESS
- *
- *\li Any other result indicates failure.
- */
-
-isc_result_t
-dns_keytable_findkeynode(dns_keytable_t *keytable, dns_name_t *name,
- dns_secalg_t algorithm, dns_keytag_t tag,
- dns_keynode_t **keynodep);
-/*%<
- * Search for a key named 'name', matching 'algorithm' and 'tag' in
- * 'keytable'. This finds the first instance which matches. Use
- * dns_keytable_findnextkeynode() to find other instances.
- *
- * Requires:
- *
- *\li 'keytable' is a valid keytable.
- *
- *\li 'name' is a valid absolute name.
- *
- *\li keynodep != NULL && *keynodep == NULL
- *
- * Returns:
- *
- *\li ISC_R_SUCCESS
- *\li DNS_R_PARTIALMATCH the name existed in the keytable.
- *\li ISC_R_NOTFOUND
- *
- *\li Any other result indicates an error.
- */
-
-isc_result_t
-dns_keytable_findnextkeynode(dns_keytable_t *keytable, dns_keynode_t *keynode,
- dns_keynode_t **nextnodep);
-/*%<
- * Search for the next key with the same properties as 'keynode' in
- * 'keytable' as found by dns_keytable_findkeynode().
- *
- * Requires:
- *
- *\li 'keytable' is a valid keytable.
- *
- *\li 'keynode' is a valid keynode.
- *
- *\li nextnodep != NULL && *nextnodep == NULL
- *
- * Returns:
- *
- *\li ISC_R_SUCCESS
- *\li ISC_R_NOTFOUND
- *
- *\li Any other result indicates an error.
- */
-
-isc_result_t
-dns_keytable_finddeepestmatch(dns_keytable_t *keytable, dns_name_t *name,
- dns_name_t *foundname);
-/*%<
- * Search for the deepest match of 'name' in 'keytable'.
- *
- * Requires:
- *
- *\li 'keytable' is a valid keytable.
- *
- *\li 'name' is a valid absolute name.
- *
- *\li 'foundname' is a name with a dedicated buffer.
- *
- * Returns:
- *
- *\li ISC_R_SUCCESS
- *\li ISC_R_NOTFOUND
- *
- *\li Any other result indicates an error.
- */
-
-void
-dns_keytable_detachkeynode(dns_keytable_t *keytable,
- dns_keynode_t **keynodep);
-/*%<
- * Give back a keynode found via dns_keytable_findkeynode().
- *
- * Requires:
- *
- *\li 'keytable' is a valid keytable.
- *
- *\li *keynodep is a valid keynode returned by a call to
- * dns_keytable_findkeynode().
- *
- * Ensures:
- *
- *\li *keynodep == NULL
- */
-
-isc_result_t
-dns_keytable_issecuredomain(dns_keytable_t *keytable, dns_name_t *name,
- isc_boolean_t *wantdnssecp);
-/*%<
- * Is 'name' at or beneath a trusted key?
- *
- * Requires:
- *
- *\li 'keytable' is a valid keytable.
- *
- *\li 'name' is a valid absolute name.
- *
- *\li '*wantsdnssecp' is a valid isc_boolean_t.
- *
- * Ensures:
- *
- *\li On success, *wantsdnssecp will be ISC_TRUE if and only if 'name'
- * is at or beneath a trusted key.
- *
- * Returns:
- *
- *\li ISC_R_SUCCESS
- *
- *\li Any other result is an error.
- */
-
-dst_key_t *
-dns_keynode_key(dns_keynode_t *keynode);
-/*%<
- * Get the DST key associated with keynode.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_KEYTABLE_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001, 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: keyvalues.h,v 1.23.48.2 2009/06/04 02:56:14 tbox Exp $ */
-
-#ifndef DNS_KEYVALUES_H
-#define DNS_KEYVALUES_H 1
-
-/*! \file dns/keyvalues.h */
-
-/*
- * Flags field of the KEY RR rdata
- */
-#define DNS_KEYFLAG_TYPEMASK 0xC000 /*%< Mask for "type" bits */
-#define DNS_KEYTYPE_AUTHCONF 0x0000 /*%< Key usable for both */
-#define DNS_KEYTYPE_CONFONLY 0x8000 /*%< Key usable for confidentiality */
-#define DNS_KEYTYPE_AUTHONLY 0x4000 /*%< Key usable for authentication */
-#define DNS_KEYTYPE_NOKEY 0xC000 /*%< No key usable for either; no key */
-#define DNS_KEYTYPE_NOAUTH DNS_KEYTYPE_CONFONLY
-#define DNS_KEYTYPE_NOCONF DNS_KEYTYPE_AUTHONLY
-
-#define DNS_KEYFLAG_RESERVED2 0x2000 /*%< reserved - must be zero */
-#define DNS_KEYFLAG_EXTENDED 0x1000 /*%< key has extended flags */
-#define DNS_KEYFLAG_RESERVED4 0x0800 /*%< reserved - must be zero */
-#define DNS_KEYFLAG_RESERVED5 0x0400 /*%< reserved - must be zero */
-#define DNS_KEYFLAG_OWNERMASK 0x0300 /*%< these bits determine the type */
-#define DNS_KEYOWNER_USER 0x0000 /*%< key is assoc. with user */
-#define DNS_KEYOWNER_ENTITY 0x0200 /*%< key is assoc. with entity eg host */
-#define DNS_KEYOWNER_ZONE 0x0100 /*%< key is zone key */
-#define DNS_KEYOWNER_RESERVED 0x0300 /*%< reserved meaning */
-#define DNS_KEYFLAG_REVOKE 0x0080 /*%< key revoked (per rfc5001) */
-#define DNS_KEYFLAG_RESERVED9 0x0040 /*%< reserved - must be zero */
-#define DNS_KEYFLAG_RESERVED10 0x0020 /*%< reserved - must be zero */
-#define DNS_KEYFLAG_RESERVED11 0x0010 /*%< reserved - must be zero */
-#define DNS_KEYFLAG_SIGNATORYMASK 0x000F /*%< key can sign RR's of same name */
-
-#define DNS_KEYFLAG_RESERVEDMASK (DNS_KEYFLAG_RESERVED2 | \
- DNS_KEYFLAG_RESERVED4 | \
- DNS_KEYFLAG_RESERVED5 | \
- DNS_KEYFLAG_RESERVED8 | \
- DNS_KEYFLAG_RESERVED9 | \
- DNS_KEYFLAG_RESERVED10 | \
- DNS_KEYFLAG_RESERVED11 )
-#define DNS_KEYFLAG_KSK 0x0001 /*%< key signing key */
-
-#define DNS_KEYFLAG_RESERVEDMASK2 0xFFFF /*%< no bits defined here */
-
-/* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */
-#define DNS_KEYALG_RSAMD5 1 /*%< RSA with MD5 */
-#define DNS_KEYALG_RSA DNS_KEYALG_RSAMD5
-#define DNS_KEYALG_DH 2 /*%< Diffie Hellman KEY */
-#define DNS_KEYALG_DSA 3 /*%< DSA KEY */
-#define DNS_KEYALG_NSEC3DSA 6
-#define DNS_KEYALG_DSS DNS_ALG_DSA
-#define DNS_KEYALG_ECC 4
-#define DNS_KEYALG_RSASHA1 5
-#define DNS_KEYALG_NSEC3RSASHA1 7
-#define DNS_KEYALG_INDIRECT 252
-#define DNS_KEYALG_PRIVATEDNS 253
-#define DNS_KEYALG_PRIVATEOID 254 /*%< Key begins with OID giving alg */
-
-/* Protocol values */
-#define DNS_KEYPROTO_RESERVED 0
-#define DNS_KEYPROTO_TLS 1
-#define DNS_KEYPROTO_EMAIL 2
-#define DNS_KEYPROTO_DNSSEC 3
-#define DNS_KEYPROTO_IPSEC 4
-#define DNS_KEYPROTO_ANY 255
-
-/* Signatures */
-#define DNS_SIG_RSAMINBITS 512 /*%< Size of a mod or exp in bits */
-#define DNS_SIG_RSAMAXBITS 2552
- /* Total of binary mod and exp */
-#define DNS_SIG_RSAMAXBYTES ((DNS_SIG_RSAMAXBITS+7/8)*2+3)
- /*%< Max length of text sig block */
-#define DNS_SIG_RSAMAXBASE64 (((DNS_SIG_RSAMAXBYTES+2)/3)*4)
-#define DNS_SIG_RSAMINSIZE ((DNS_SIG_RSAMINBITS+7)/8)
-#define DNS_SIG_RSAMAXSIZE ((DNS_SIG_RSAMAXBITS+7)/8)
-
-#define DNS_SIG_DSASIGSIZE 41
-#define DNS_SIG_DSAMINBITS 512
-#define DNS_SIG_DSAMAXBITS 1024
-#define DNS_SIG_DSAMINBYTES 213
-#define DNS_SIG_DSAMAXBYTES 405
-
-#endif /* DNS_KEYVALUES_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: lib.h,v 1.16 2007/06/19 23:47:17 tbox Exp $ */
-
-#ifndef DNS_LIB_H
-#define DNS_LIB_H 1
-
-/*! \file dns/lib.h */
-
-#include <isc/types.h>
-#include <isc/lang.h>
-
-ISC_LANG_BEGINDECLS
-
-/*%
- * Tuning: external query load in packets per seconds.
- */
-LIBDNS_EXTERNAL_DATA extern unsigned int dns_pps;
-LIBDNS_EXTERNAL_DATA extern isc_msgcat_t *dns_msgcat;
-
-void
-dns_lib_initmsgcat(void);
-/*%<
- * Initialize the DNS library's message catalog, dns_msgcat, if it
- * has not already been initialized.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_LIB_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001, 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: log.h,v 1.42.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-/*! \file dns/log.h
- * \author Principal Authors: DCL */
-
-#ifndef DNS_LOG_H
-#define DNS_LOG_H 1
-
-#include <isc/lang.h>
-#include <isc/log.h>
-
-LIBDNS_EXTERNAL_DATA extern isc_log_t *dns_lctx;
-LIBDNS_EXTERNAL_DATA extern isc_logcategory_t dns_categories[];
-LIBDNS_EXTERNAL_DATA extern isc_logmodule_t dns_modules[];
-
-#define DNS_LOGCATEGORY_NOTIFY (&dns_categories[0])
-#define DNS_LOGCATEGORY_DATABASE (&dns_categories[1])
-#define DNS_LOGCATEGORY_SECURITY (&dns_categories[2])
-/* DNS_LOGCATEGORY_CONFIG superseded by CFG_LOGCATEGORY_CONFIG */
-#define DNS_LOGCATEGORY_DNSSEC (&dns_categories[4])
-#define DNS_LOGCATEGORY_RESOLVER (&dns_categories[5])
-#define DNS_LOGCATEGORY_XFER_IN (&dns_categories[6])
-#define DNS_LOGCATEGORY_XFER_OUT (&dns_categories[7])
-#define DNS_LOGCATEGORY_DISPATCH (&dns_categories[8])
-#define DNS_LOGCATEGORY_LAME_SERVERS (&dns_categories[9])
-#define DNS_LOGCATEGORY_DELEGATION_ONLY (&dns_categories[10])
-#define DNS_LOGCATEGORY_EDNS_DISABLED (&dns_categories[11])
-
-/* Backwards compatibility. */
-#define DNS_LOGCATEGORY_GENERAL ISC_LOGCATEGORY_GENERAL
-
-#define DNS_LOGMODULE_DB (&dns_modules[0])
-#define DNS_LOGMODULE_RBTDB (&dns_modules[1])
-#define DNS_LOGMODULE_RBTDB64 (&dns_modules[2])
-#define DNS_LOGMODULE_RBT (&dns_modules[3])
-#define DNS_LOGMODULE_RDATA (&dns_modules[4])
-#define DNS_LOGMODULE_MASTER (&dns_modules[5])
-#define DNS_LOGMODULE_MESSAGE (&dns_modules[6])
-#define DNS_LOGMODULE_CACHE (&dns_modules[7])
-#define DNS_LOGMODULE_CONFIG (&dns_modules[8])
-#define DNS_LOGMODULE_RESOLVER (&dns_modules[9])
-#define DNS_LOGMODULE_ZONE (&dns_modules[10])
-#define DNS_LOGMODULE_JOURNAL (&dns_modules[11])
-#define DNS_LOGMODULE_ADB (&dns_modules[12])
-#define DNS_LOGMODULE_XFER_IN (&dns_modules[13])
-#define DNS_LOGMODULE_XFER_OUT (&dns_modules[14])
-#define DNS_LOGMODULE_ACL (&dns_modules[15])
-#define DNS_LOGMODULE_VALIDATOR (&dns_modules[16])
-#define DNS_LOGMODULE_DISPATCH (&dns_modules[17])
-#define DNS_LOGMODULE_REQUEST (&dns_modules[18])
-#define DNS_LOGMODULE_MASTERDUMP (&dns_modules[19])
-#define DNS_LOGMODULE_TSIG (&dns_modules[20])
-#define DNS_LOGMODULE_TKEY (&dns_modules[21])
-#define DNS_LOGMODULE_SDB (&dns_modules[22])
-#define DNS_LOGMODULE_DIFF (&dns_modules[23])
-#define DNS_LOGMODULE_HINTS (&dns_modules[24])
-#define DNS_LOGMODULE_ACACHE (&dns_modules[25])
-#define DNS_LOGMODULE_DLZ (&dns_modules[26])
-
-ISC_LANG_BEGINDECLS
-
-void
-dns_log_init(isc_log_t *lctx);
-/*%
- * Make the libdns categories and modules available for use with the
- * ISC logging library.
- *
- * Requires:
- *\li lctx is a valid logging context.
- *
- *\li dns_log_init() is called only once.
- *
- * Ensures:
- * \li The categories and modules defined above are available for
- * use by isc_log_usechannnel() and isc_log_write().
- */
-
-void
-dns_log_setcontext(isc_log_t *lctx);
-/*%
- * Make the libdns library use the provided context for logging internal
- * messages.
- *
- * Requires:
- *\li lctx is a valid logging context.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_LOG_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: master.h,v 1.51 2008/04/02 02:37:42 marka Exp $ */
-
-#ifndef DNS_MASTER_H
-#define DNS_MASTER_H 1
-
-/*! \file dns/master.h */
-
-/***
- *** Imports
- ***/
-
-#include <stdio.h>
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-/*
- * Flags to be passed in the 'options' argument in the functions below.
- */
-#define DNS_MASTER_AGETTL 0x00000001 /*%< Age the ttl based on $DATE. */
-#define DNS_MASTER_MANYERRORS 0x00000002 /*%< Continue processing on errors. */
-#define DNS_MASTER_NOINCLUDE 0x00000004 /*%< Disallow $INCLUDE directives. */
-#define DNS_MASTER_ZONE 0x00000008 /*%< Loading a zone master file. */
-#define DNS_MASTER_HINT 0x00000010 /*%< Loading a hint master file. */
-#define DNS_MASTER_SLAVE 0x00000020 /*%< Loading a slave master file. */
-#define DNS_MASTER_CHECKNS 0x00000040 /*%<
- * Check NS records to see
- * if they are an address
- */
-#define DNS_MASTER_FATALNS 0x00000080 /*%<
- * Treat DNS_MASTER_CHECKNS
- * matches as fatal
- */
-#define DNS_MASTER_CHECKNAMES 0x00000100
-#define DNS_MASTER_CHECKNAMESFAIL 0x00000200
-#define DNS_MASTER_CHECKWILDCARD 0x00000400 /* Check for internal wildcards. */
-#define DNS_MASTER_CHECKMX 0x00000800
-#define DNS_MASTER_CHECKMXFAIL 0x00001000
-
-#define DNS_MASTER_RESIGN 0x00002000
-
-ISC_LANG_BEGINDECLS
-
-/*
- * Structures that implement the "raw" format for master dump.
- * These are provided for a reference purpose only; in the actual
- * encoding, we directly read/write each field so that the encoded data
- * is always "packed", regardless of the hardware architecture.
- */
-#define DNS_RAWFORMAT_VERSION 0
-
-/* Common header */
-typedef struct {
- isc_uint32_t format; /* must be
- * dns_masterformat_raw */
- isc_uint32_t version; /* compatibility for future
- * extensions */
- isc_uint32_t dumptime; /* timestamp on creation
- * (currently unused)
- */
-} dns_masterrawheader_t;
-
-/* The structure for each RRset */
-typedef struct {
- isc_uint32_t totallen; /* length of the data for this
- * RRset, including the
- * "header" part */
- dns_rdataclass_t rdclass; /* 16-bit class */
- dns_rdatatype_t type; /* 16-bit type */
- dns_rdatatype_t covers; /* same as type */
- dns_ttl_t ttl; /* 32-bit TTL */
- isc_uint32_t nrdata; /* number of RRs in this set */
- /* followed by encoded owner name, and then rdata */
-} dns_masterrawrdataset_t;
-
-/***
- *** Function
- ***/
-
-isc_result_t
-dns_master_loadfile(const char *master_file,
- dns_name_t *top,
- dns_name_t *origin,
- dns_rdataclass_t zclass,
- unsigned int options,
- dns_rdatacallbacks_t *callbacks,
- isc_mem_t *mctx);
-
-isc_result_t
-dns_master_loadfile2(const char *master_file,
- dns_name_t *top,
- dns_name_t *origin,
- dns_rdataclass_t zclass,
- unsigned int options,
- dns_rdatacallbacks_t *callbacks,
- isc_mem_t *mctx,
- dns_masterformat_t format);
-
-isc_result_t
-dns_master_loadfile3(const char *master_file,
- dns_name_t *top,
- dns_name_t *origin,
- dns_rdataclass_t zclass,
- unsigned int options,
- isc_uint32_t resign,
- dns_rdatacallbacks_t *callbacks,
- isc_mem_t *mctx,
- dns_masterformat_t format);
-
-isc_result_t
-dns_master_loadstream(FILE *stream,
- dns_name_t *top,
- dns_name_t *origin,
- dns_rdataclass_t zclass,
- unsigned int options,
- dns_rdatacallbacks_t *callbacks,
- isc_mem_t *mctx);
-
-isc_result_t
-dns_master_loadbuffer(isc_buffer_t *buffer,
- dns_name_t *top,
- dns_name_t *origin,
- dns_rdataclass_t zclass,
- unsigned int options,
- dns_rdatacallbacks_t *callbacks,
- isc_mem_t *mctx);
-
-isc_result_t
-dns_master_loadlexer(isc_lex_t *lex,
- dns_name_t *top,
- dns_name_t *origin,
- dns_rdataclass_t zclass,
- unsigned int options,
- dns_rdatacallbacks_t *callbacks,
- isc_mem_t *mctx);
-
-isc_result_t
-dns_master_loadfileinc(const char *master_file,
- dns_name_t *top,
- dns_name_t *origin,
- dns_rdataclass_t zclass,
- unsigned int options,
- dns_rdatacallbacks_t *callbacks,
- isc_task_t *task,
- dns_loaddonefunc_t done, void *done_arg,
- dns_loadctx_t **ctxp, isc_mem_t *mctx);
-
-isc_result_t
-dns_master_loadfileinc2(const char *master_file,
- dns_name_t *top,
- dns_name_t *origin,
- dns_rdataclass_t zclass,
- unsigned int options,
- dns_rdatacallbacks_t *callbacks,
- isc_task_t *task,
- dns_loaddonefunc_t done, void *done_arg,
- dns_loadctx_t **ctxp, isc_mem_t *mctx,
- dns_masterformat_t format);
-
-isc_result_t
-dns_master_loadfileinc3(const char *master_file,
- dns_name_t *top,
- dns_name_t *origin,
- dns_rdataclass_t zclass,
- unsigned int options,
- isc_uint32_t resign,
- dns_rdatacallbacks_t *callbacks,
- isc_task_t *task,
- dns_loaddonefunc_t done, void *done_arg,
- dns_loadctx_t **ctxp, isc_mem_t *mctx,
- dns_masterformat_t format);
-
-isc_result_t
-dns_master_loadstreaminc(FILE *stream,
- dns_name_t *top,
- dns_name_t *origin,
- dns_rdataclass_t zclass,
- unsigned int options,
- dns_rdatacallbacks_t *callbacks,
- isc_task_t *task,
- dns_loaddonefunc_t done, void *done_arg,
- dns_loadctx_t **ctxp, isc_mem_t *mctx);
-
-isc_result_t
-dns_master_loadbufferinc(isc_buffer_t *buffer,
- dns_name_t *top,
- dns_name_t *origin,
- dns_rdataclass_t zclass,
- unsigned int options,
- dns_rdatacallbacks_t *callbacks,
- isc_task_t *task,
- dns_loaddonefunc_t done, void *done_arg,
- dns_loadctx_t **ctxp, isc_mem_t *mctx);
-
-isc_result_t
-dns_master_loadlexerinc(isc_lex_t *lex,
- dns_name_t *top,
- dns_name_t *origin,
- dns_rdataclass_t zclass,
- unsigned int options,
- dns_rdatacallbacks_t *callbacks,
- isc_task_t *task,
- dns_loaddonefunc_t done, void *done_arg,
- dns_loadctx_t **ctxp, isc_mem_t *mctx);
-
-/*%<
- * Loads a RFC1305 master file from a file, stream, buffer, or existing
- * lexer into rdatasets and then calls 'callbacks->commit' to commit the
- * rdatasets. Rdata memory belongs to dns_master_load and will be
- * reused / released when the callback completes. dns_load_master will
- * abort if callbacks->commit returns any value other than ISC_R_SUCCESS.
- *
- * If 'DNS_MASTER_AGETTL' is set and the master file contains one or more
- * $DATE directives, the TTLs of the data will be aged accordingly.
- *
- * 'callbacks->commit' is assumed to call 'callbacks->error' or
- * 'callbacks->warn' to generate any error messages required.
- *
- * 'done' is called with 'done_arg' and a result code when the loading
- * is completed or has failed. If the initial setup fails 'done' is
- * not called.
- *
- * 'resign' the number of seconds before a RRSIG expires that it should
- * be re-signed. 0 is used if not provided.
- *
- * Requires:
- *\li 'master_file' points to a valid string.
- *\li 'lexer' points to a valid lexer.
- *\li 'top' points to a valid name.
- *\li 'origin' points to a valid name.
- *\li 'callbacks->commit' points to a valid function.
- *\li 'callbacks->error' points to a valid function.
- *\li 'callbacks->warn' points to a valid function.
- *\li 'mctx' points to a valid memory context.
- *\li 'task' and 'done' to be valid.
- *\li 'lmgr' to be valid.
- *\li 'ctxp != NULL && ctxp == NULL'.
- *
- * Returns:
- *\li ISC_R_SUCCESS upon successfully loading the master file.
- *\li ISC_R_SEENINCLUDE upon successfully loading the master file with
- * a $INCLUDE statement.
- *\li ISC_R_NOMEMORY out of memory.
- *\li ISC_R_UNEXPECTEDEND expected to be able to read a input token and
- * there was not one.
- *\li ISC_R_UNEXPECTED
- *\li DNS_R_NOOWNER failed to specify a ownername.
- *\li DNS_R_NOTTL failed to specify a ttl.
- *\li DNS_R_BADCLASS record class did not match zone class.
- *\li DNS_R_CONTINUE load still in progress (dns_master_load*inc() only).
- *\li Any dns_rdata_fromtext() error code.
- *\li Any error code from callbacks->commit().
- */
-
-void
-dns_loadctx_detach(dns_loadctx_t **ctxp);
-/*%<
- * Detach from the load context.
- *
- * Requires:
- *\li '*ctxp' to be valid.
- *
- * Ensures:
- *\li '*ctxp == NULL'
- */
-
-void
-dns_loadctx_attach(dns_loadctx_t *source, dns_loadctx_t **target);
-/*%<
- * Attach to the load context.
- *
- * Requires:
- *\li 'source' to be valid.
- *\li 'target != NULL && *target == NULL'.
- */
-
-void
-dns_loadctx_cancel(dns_loadctx_t *ctx);
-/*%<
- * Cancel loading the zone file associated with this load context.
- *
- * Requires:
- *\li 'ctx' to be valid
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_MASTER_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: masterdump.h,v 1.42 2008/09/24 02:46:23 marka Exp $ */
-
-#ifndef DNS_MASTERDUMP_H
-#define DNS_MASTERDUMP_H 1
-
-/*! \file dns/masterdump.h */
-
-/***
- *** Imports
- ***/
-
-#include <stdio.h>
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-/***
- *** Types
- ***/
-
-typedef struct dns_master_style dns_master_style_t;
-
-/***
- *** Definitions
- ***/
-
-/*
- * Flags affecting master file formatting. Flags 0x0000FFFF
- * define the formatting of the rdata part and are defined in
- * rdata.h.
- */
-
-/*% Omit the owner name when possible. */
-#define DNS_STYLEFLAG_OMIT_OWNER 0x00010000U
-
-/*%
- * Omit the TTL when possible. If DNS_STYLEFLAG_TTL is
- * also set, this means no TTLs are ever printed
- * because $TTL directives are generated before every
- * change in the TTL. In this case, no columns need to
- * be reserved for the TTL. Master files generated with
- * these options will be rejected by BIND 4.x because it
- * does not recognize the $TTL directive.
- *
- * If DNS_STYLEFLAG_TTL is not also set, the TTL will be
- * omitted when it is equal to the previous TTL.
- * This is correct according to RFC1035, but the
- * TTLs may be silently misinterpreted by older
- * versions of BIND which use the SOA MINTTL as a
- * default TTL value.
- */
-#define DNS_STYLEFLAG_OMIT_TTL 0x00020000U
-
-/*% Omit the class when possible. */
-#define DNS_STYLEFLAG_OMIT_CLASS 0x00040000U
-
-/*% Output $TTL directives. */
-#define DNS_STYLEFLAG_TTL 0x00080000U
-
-/*%
- * Output $ORIGIN directives and print owner names relative to
- * the origin when possible.
- */
-#define DNS_STYLEFLAG_REL_OWNER 0x00100000U
-
-/*% Print domain names in RR data in relative form when possible.
- For this to take effect, DNS_STYLEFLAG_REL_OWNER must also be set. */
-#define DNS_STYLEFLAG_REL_DATA 0x00200000U
-
-/*% Print the trust level of each rdataset. */
-#define DNS_STYLEFLAG_TRUST 0x00400000U
-
-/*% Print negative caching entries. */
-#define DNS_STYLEFLAG_NCACHE 0x00800000U
-
-/*% Never print the TTL. */
-#define DNS_STYLEFLAG_NO_TTL 0x01000000U
-
-/*% Never print the CLASS. */
-#define DNS_STYLEFLAG_NO_CLASS 0x02000000U
-
-/*% Report re-signing time. */
-#define DNS_STYLEFLAG_RESIGN 0x04000000U
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Constants
- ***/
-
-/*%
- * The default master file style.
- *
- * This uses $TTL directives to avoid the need to dedicate a
- * tab stop for the TTL. The class is only printed for the first
- * rrset in the file and shares a tab stop with the RR type.
- */
-LIBDNS_EXTERNAL_DATA extern const dns_master_style_t dns_master_style_default;
-
-/*%
- * A master file style that dumps zones to a very generic format easily
- * imported/checked with external tools.
- */
-LIBDNS_EXTERNAL_DATA extern const dns_master_style_t dns_master_style_full;
-
-/*%
- * A master file style that prints explicit TTL values on each
- * record line, never using $TTL statements. The TTL has a tab
- * stop of its own, but the class and type share one.
- */
-LIBDNS_EXTERNAL_DATA extern const dns_master_style_t
- dns_master_style_explicitttl;
-
-/*%
- * A master style format designed for cache files. It prints explicit TTL
- * values on each record line and never uses $ORIGIN or relative names.
- */
-LIBDNS_EXTERNAL_DATA extern const dns_master_style_t dns_master_style_cache;
-
-/*%
- * A master style that prints name, ttl, class, type, and value on
- * every line. Similar to explicitttl above, but more verbose.
- * Intended for generating master files which can be easily parsed
- * by perl scripts and similar applications.
- */
-LIBDNS_EXTERNAL_DATA extern const dns_master_style_t dns_master_style_simple;
-
-/*%
- * The style used for debugging, "dig" output, etc.
- */
-LIBDNS_EXTERNAL_DATA extern const dns_master_style_t dns_master_style_debug;
-
-/***
- *** Functions
- ***/
-
-void
-dns_dumpctx_attach(dns_dumpctx_t *source, dns_dumpctx_t **target);
-/*%<
- * Attach to a dump context.
- *
- * Require:
- *\li 'source' to be valid.
- *\li 'target' to be non NULL and '*target' to be NULL.
- */
-
-void
-dns_dumpctx_detach(dns_dumpctx_t **dctxp);
-/*%<
- * Detach from a dump context.
- *
- * Require:
- *\li 'dctxp' to point to a valid dump context.
- *
- * Ensures:
- *\li '*dctxp' is NULL.
- */
-
-void
-dns_dumpctx_cancel(dns_dumpctx_t *dctx);
-/*%<
- * Cancel a in progress dump.
- *
- * Require:
- *\li 'dctx' to be valid.
- */
-
-dns_dbversion_t *
-dns_dumpctx_version(dns_dumpctx_t *dctx);
-/*%<
- * Return the version handle (if any) of the database being dumped.
- *
- * Require:
- *\li 'dctx' to be valid.
- */
-
-dns_db_t *
-dns_dumpctx_db(dns_dumpctx_t *dctx);
-/*%<
- * Return the database being dumped.
- *
- * Require:
- *\li 'dctx' to be valid.
- */
-
-
-/*@{*/
-isc_result_t
-dns_master_dumptostreaminc(isc_mem_t *mctx, dns_db_t *db,
- dns_dbversion_t *version,
- const dns_master_style_t *style, FILE *f,
- isc_task_t *task, dns_dumpdonefunc_t done,
- void *done_arg, dns_dumpctx_t **dctxp);
-
-isc_result_t
-dns_master_dumptostream(isc_mem_t *mctx, dns_db_t *db,
- dns_dbversion_t *version,
- const dns_master_style_t *style, FILE *f);
-
-isc_result_t
-dns_master_dumptostream2(isc_mem_t *mctx, dns_db_t *db,
- dns_dbversion_t *version,
- const dns_master_style_t *style,
- dns_masterformat_t format, FILE *f);
-/*%<
- * Dump the database 'db' to the steam 'f' in the specified format by
- * 'format'. If the format is dns_masterformat_text (the RFC1035 format),
- * 'style' specifies the file style (e.g., &dns_master_style_default).
- *
- * dns_master_dumptostream() is an old form of dns_master_dumptostream2(),
- * which always specifies the dns_masterformat_text format.
- *
- * Temporary dynamic memory may be allocated from 'mctx'.
- *
- * Require:
- *\li 'task' to be valid.
- *\li 'done' to be non NULL.
- *\li 'dctxp' to be non NULL && '*dctxp' to be NULL.
- *
- * Returns:
- *\li ISC_R_SUCCESS
- *\li ISC_R_CONTINUE dns_master_dumptostreaminc() only.
- *\li ISC_R_NOMEMORY
- *\li Any database or rrset iterator error.
- *\li Any dns_rdata_totext() error code.
- */
-/*@}*/
-
-/*@{*/
-isc_result_t
-dns_master_dumpinc(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
- const dns_master_style_t *style, const char *filename,
- isc_task_t *task, dns_dumpdonefunc_t done, void *done_arg,
- dns_dumpctx_t **dctxp);
-
-isc_result_t
-dns_master_dumpinc2(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
- const dns_master_style_t *style, const char *filename,
- isc_task_t *task, dns_dumpdonefunc_t done, void *done_arg, dns_dumpctx_t **dctxp, dns_masterformat_t format);
-
-isc_result_t
-dns_master_dump(isc_mem_t *mctx, dns_db_t *db,
- dns_dbversion_t *version,
- const dns_master_style_t *style, const char *filename);
-
-isc_result_t
-dns_master_dump2(isc_mem_t *mctx, dns_db_t *db,
- dns_dbversion_t *version,
- const dns_master_style_t *style, const char *filename,
- dns_masterformat_t format);
-
-/*%<
- * Dump the database 'db' to the file 'filename' in the specified format by
- * 'format'. If the format is dns_masterformat_text (the RFC1035 format),
- * 'style' specifies the file style (e.g., &dns_master_style_default).
- *
- * dns_master_dumpinc() and dns_master_dump() are old forms of _dumpinc2()
- * and _dump2(), respectively, which always specify the dns_masterformat_text
- * format.
- *
- * Temporary dynamic memory may be allocated from 'mctx'.
- *
- * Returns:
- *\li ISC_R_SUCCESS
- *\li ISC_R_CONTINUE dns_master_dumpinc() only.
- *\li ISC_R_NOMEMORY
- *\li Any database or rrset iterator error.
- *\li Any dns_rdata_totext() error code.
- */
-/*@}*/
-
-isc_result_t
-dns_master_rdatasettotext(dns_name_t *owner_name,
- dns_rdataset_t *rdataset,
- const dns_master_style_t *style,
- isc_buffer_t *target);
-/*%<
- * Convert 'rdataset' to text format, storing the result in 'target'.
- *
- * Notes:
- *\li The rdata cursor position will be changed.
- *
- * Requires:
- *\li 'rdataset' is a valid non-question rdataset.
- *
- *\li 'rdataset' is not empty.
- */
-
-isc_result_t
-dns_master_questiontotext(dns_name_t *owner_name,
- dns_rdataset_t *rdataset,
- const dns_master_style_t *style,
- isc_buffer_t *target);
-
-isc_result_t
-dns_master_dumpnodetostream(isc_mem_t *mctx, dns_db_t *db,
- dns_dbversion_t *version,
- dns_dbnode_t *node, dns_name_t *name,
- const dns_master_style_t *style,
- FILE *f);
-
-isc_result_t
-dns_master_dumpnode(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
- dns_dbnode_t *node, dns_name_t *name,
- const dns_master_style_t *style, const char *filename);
-
-isc_result_t
-dns_master_stylecreate(dns_master_style_t **style, unsigned int flags,
- unsigned int ttl_column, unsigned int class_column,
- unsigned int type_column, unsigned int rdata_column,
- unsigned int line_length, unsigned int tab_width,
- isc_mem_t *mctx);
-
-void
-dns_master_styledestroy(dns_master_style_t **style, isc_mem_t *mctx);
-
-const char *
-dns_trust_totext(dns_trust_t trust);
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_MASTERDUMP_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: message.h,v 1.125.118.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef DNS_MESSAGE_H
-#define DNS_MESSAGE_H 1
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-#include <isc/magic.h>
-
-#include <dns/compress.h>
-#include <dns/masterdump.h>
-#include <dns/types.h>
-
-#include <dst/dst.h>
-
-/*! \file dns/message.h
- * \brief Message Handling Module
- *
- * How this beast works:
- *
- * When a dns message is received in a buffer, dns_message_fromwire() is called
- * on the memory region. Various items are checked including the format
- * of the message (if counts are right, if counts consume the entire sections,
- * and if sections consume the entire message) and known pseudo-RRs in the
- * additional data section are analyzed and removed.
- *
- * TSIG checking is also done at this layer, and any DNSSEC transaction
- * signatures should also be checked here.
- *
- * Notes on using the gettemp*() and puttemp*() functions:
- *
- * These functions return items (names, rdatasets, etc) allocated from some
- * internal state of the dns_message_t.
- *
- * Names and rdatasets must be put back into the dns_message_t in
- * one of two ways. Assume a name was allocated via
- * dns_message_gettempname():
- *
- *\li (1) insert it into a section, using dns_message_addname().
- *
- *\li (2) return it to the message using dns_message_puttempname().
- *
- * The same applies to rdatasets.
- *
- * On the other hand, offsets, rdatalists and rdatas allocated using
- * dns_message_gettemp*() will always be freed automatically
- * when the message is reset or destroyed; calling dns_message_puttemp*()
- * on rdatalists and rdatas is optional and serves only to enable the item
- * to be reused multiple times during the lifetime of the message; offsets
- * cannot be reused.
- *
- * Buffers allocated using isc_buffer_allocate() can be automatically freed
- * as well by giving the buffer to the message using dns_message_takebuffer().
- * Doing this will cause the buffer to be freed using isc_buffer_free()
- * when the section lists are cleared, such as in a reset or in a destroy.
- * Since the buffer itself exists until the message is destroyed, this sort
- * of code can be written:
- *
- * \code
- * buffer = isc_buffer_allocate(mctx, 512);
- * name = NULL;
- * name = dns_message_gettempname(message, &name);
- * dns_name_init(name, NULL);
- * result = dns_name_fromtext(name, &source, dns_rootname, ISC_FALSE,
- * buffer);
- * dns_message_takebuffer(message, &buffer);
- * \endcode
- *
- *
- * TODO:
- *
- * XXX Needed: ways to set and retrieve EDNS information, add rdata to a
- * section, move rdata from one section to another, remove rdata, etc.
- */
-
-#define DNS_MESSAGEFLAG_QR 0x8000U
-#define DNS_MESSAGEFLAG_AA 0x0400U
-#define DNS_MESSAGEFLAG_TC 0x0200U
-#define DNS_MESSAGEFLAG_RD 0x0100U
-#define DNS_MESSAGEFLAG_RA 0x0080U
-#define DNS_MESSAGEFLAG_AD 0x0020U
-#define DNS_MESSAGEFLAG_CD 0x0010U
-
-/*%< EDNS0 extended message flags */
-#define DNS_MESSAGEEXTFLAG_DO 0x8000U
-
-/*%< EDNS0 extended OPT codes */
-#define DNS_OPT_NSID 0x0003 /*%< NSID opt code */
-
-#define DNS_MESSAGE_REPLYPRESERVE (DNS_MESSAGEFLAG_RD|DNS_MESSAGEFLAG_CD)
-#define DNS_MESSAGEEXTFLAG_REPLYPRESERVE (DNS_MESSAGEEXTFLAG_DO)
-
-#define DNS_MESSAGE_HEADERLEN 12 /*%< 6 isc_uint16_t's */
-
-#define DNS_MESSAGE_MAGIC ISC_MAGIC('M','S','G','@')
-#define DNS_MESSAGE_VALID(msg) ISC_MAGIC_VALID(msg, DNS_MESSAGE_MAGIC)
-
-/*
- * Ordering here matters. DNS_SECTION_ANY must be the lowest and negative,
- * and DNS_SECTION_MAX must be one greater than the last used section.
- */
-typedef int dns_section_t;
-#define DNS_SECTION_ANY (-1)
-#define DNS_SECTION_QUESTION 0
-#define DNS_SECTION_ANSWER 1
-#define DNS_SECTION_AUTHORITY 2
-#define DNS_SECTION_ADDITIONAL 3
-#define DNS_SECTION_MAX 4
-
-typedef int dns_pseudosection_t;
-#define DNS_PSEUDOSECTION_ANY (-1)
-#define DNS_PSEUDOSECTION_OPT 0
-#define DNS_PSEUDOSECTION_TSIG 1
-#define DNS_PSEUDOSECTION_SIG0 2
-#define DNS_PSEUDOSECTION_MAX 3
-
-typedef int dns_messagetextflag_t;
-#define DNS_MESSAGETEXTFLAG_NOCOMMENTS 0x0001
-#define DNS_MESSAGETEXTFLAG_NOHEADERS 0x0002
-
-/*
- * Dynamic update names for these sections.
- */
-#define DNS_SECTION_ZONE DNS_SECTION_QUESTION
-#define DNS_SECTION_PREREQUISITE DNS_SECTION_ANSWER
-#define DNS_SECTION_UPDATE DNS_SECTION_AUTHORITY
-
-/*
- * These tell the message library how the created dns_message_t will be used.
- */
-#define DNS_MESSAGE_INTENTUNKNOWN 0 /*%< internal use only */
-#define DNS_MESSAGE_INTENTPARSE 1 /*%< parsing messages */
-#define DNS_MESSAGE_INTENTRENDER 2 /*%< rendering */
-
-/*
- * Control behavior of parsing
- */
-#define DNS_MESSAGEPARSE_PRESERVEORDER 0x0001 /*%< preserve rdata order */
-#define DNS_MESSAGEPARSE_BESTEFFORT 0x0002 /*%< return a message if a
- recoverable parse error
- occurs */
-#define DNS_MESSAGEPARSE_CLONEBUFFER 0x0004 /*%< save a copy of the
- source buffer */
-#define DNS_MESSAGEPARSE_IGNORETRUNCATION 0x0008 /*%< truncation errors are
- * not fatal. */
-
-/*
- * Control behavior of rendering
- */
-#define DNS_MESSAGERENDER_ORDERED 0x0001 /*%< don't change order */
-#define DNS_MESSAGERENDER_PARTIAL 0x0002 /*%< allow a partial rdataset */
-#define DNS_MESSAGERENDER_OMITDNSSEC 0x0004 /*%< omit DNSSEC records */
-#define DNS_MESSAGERENDER_PREFER_A 0x0008 /*%< prefer A records in
- additional section. */
-#define DNS_MESSAGERENDER_PREFER_AAAA 0x0010 /*%< prefer AAAA records in
- additional section. */
-
-typedef struct dns_msgblock dns_msgblock_t;
-
-struct dns_message {
- /* public from here down */
- unsigned int magic;
-
- dns_messageid_t id;
- unsigned int flags;
- dns_rcode_t rcode;
- unsigned int opcode;
- dns_rdataclass_t rdclass;
-
- /* 4 real, 1 pseudo */
- unsigned int counts[DNS_SECTION_MAX];
-
- /* private from here down */
- dns_namelist_t sections[DNS_SECTION_MAX];
- dns_name_t *cursors[DNS_SECTION_MAX];
- dns_rdataset_t *opt;
- dns_rdataset_t *sig0;
- dns_rdataset_t *tsig;
-
- int state;
- unsigned int from_to_wire : 2;
- unsigned int header_ok : 1;
- unsigned int question_ok : 1;
- unsigned int tcp_continuation : 1;
- unsigned int verified_sig : 1;
- unsigned int verify_attempted : 1;
- unsigned int free_query : 1;
- unsigned int free_saved : 1;
-
- unsigned int opt_reserved;
- unsigned int sig_reserved;
- unsigned int reserved; /* reserved space (render) */
-
- isc_buffer_t *buffer;
- dns_compress_t *cctx;
-
- isc_mem_t *mctx;
- isc_mempool_t *namepool;
- isc_mempool_t *rdspool;
-
- isc_bufferlist_t scratchpad;
- isc_bufferlist_t cleanup;
-
- ISC_LIST(dns_msgblock_t) rdatas;
- ISC_LIST(dns_msgblock_t) rdatalists;
- ISC_LIST(dns_msgblock_t) offsets;
-
- ISC_LIST(dns_rdata_t) freerdata;
- ISC_LIST(dns_rdatalist_t) freerdatalist;
-
- dns_rcode_t tsigstatus;
- dns_rcode_t querytsigstatus;
- dns_name_t *tsigname; /* Owner name of TSIG, if any */
- dns_rdataset_t *querytsig;
- dns_tsigkey_t *tsigkey;
- dst_context_t *tsigctx;
- int sigstart;
- int timeadjust;
-
- dns_name_t *sig0name; /* Owner name of SIG0, if any */
- dst_key_t *sig0key;
- dns_rcode_t sig0status;
- isc_region_t query;
- isc_region_t saved;
-
- dns_rdatasetorderfunc_t order;
- const void * order_arg;
-};
-
-/***
- *** Functions
- ***/
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_message_create(isc_mem_t *mctx, unsigned int intent, dns_message_t **msgp);
-
-/*%<
- * Create msg structure.
- *
- * This function will allocate some internal blocks of memory that are
- * expected to be needed for parsing or rendering nearly any type of message.
- *
- * Requires:
- *\li 'mctx' be a valid memory context.
- *
- *\li 'msgp' be non-null and '*msg' be NULL.
- *
- *\li 'intent' must be one of DNS_MESSAGE_INTENTPARSE or
- * #DNS_MESSAGE_INTENTRENDER.
- *
- * Ensures:
- *\li The data in "*msg" is set to indicate an unused and empty msg
- * structure.
- *
- * Returns:
- *\li #ISC_R_NOMEMORY -- out of memory
- *\li #ISC_R_SUCCESS -- success
- */
-
-void
-dns_message_reset(dns_message_t *msg, unsigned int intent);
-/*%<
- * Reset a message structure to default state. All internal lists are freed
- * or reset to a default state as well. This is simply a more efficient
- * way to call dns_message_destroy() followed by dns_message_allocate(),
- * since it avoid many memory allocations.
- *
- * If any data loanouts (buffers, names, rdatas, etc) were requested,
- * the caller must no longer use them after this call.
- *
- * The intended next use of the message will be 'intent'.
- *
- * Requires:
- *
- *\li 'msg' be valid.
- *
- *\li 'intent' is DNS_MESSAGE_INTENTPARSE or DNS_MESSAGE_INTENTRENDER
- */
-
-void
-dns_message_destroy(dns_message_t **msgp);
-/*%<
- * Destroy all state in the message.
- *
- * Requires:
- *
- *\li 'msgp' be valid.
- *
- * Ensures:
- *\li '*msgp' == NULL
- */
-
-isc_result_t
-dns_message_sectiontotext(dns_message_t *msg, dns_section_t section,
- const dns_master_style_t *style,
- dns_messagetextflag_t flags,
- isc_buffer_t *target);
-
-isc_result_t
-dns_message_pseudosectiontotext(dns_message_t *msg,
- dns_pseudosection_t section,
- const dns_master_style_t *style,
- dns_messagetextflag_t flags,
- isc_buffer_t *target);
-/*%<
- * Convert section 'section' or 'pseudosection' of message 'msg' to
- * a cleartext representation
- *
- * Notes:
- * \li See dns_message_totext for meanings of flags.
- *
- * Requires:
- *
- *\li 'msg' is a valid message.
- *
- *\li 'style' is a valid master dump style.
- *
- *\li 'target' is a valid buffer.
- *
- *\li 'section' is a valid section label.
- *
- * Ensures:
- *
- *\li If the result is success:
- * The used space in 'target' is updated.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOSPACE
- *\li #ISC_R_NOMORE
- *
- *\li Note: On error return, *target may be partially filled with data.
-*/
-
-isc_result_t
-dns_message_totext(dns_message_t *msg, const dns_master_style_t *style,
- dns_messagetextflag_t flags, isc_buffer_t *target);
-/*%<
- * Convert all sections of message 'msg' to a cleartext representation
- *
- * Notes:
- * \li In flags, If #DNS_MESSAGETEXTFLAG_OMITDOT is set, then the
- * final '.' in absolute names will not be emitted. If
- * #DNS_MESSAGETEXTFLAG_NOCOMMENTS is cleared, lines beginning
- * with ";;" will be emitted indicating section name. If
- * #DNS_MESSAGETEXTFLAG_NOHEADERS is cleared, header lines will
- * be emitted.
- *
- * Requires:
- *
- *\li 'msg' is a valid message.
- *
- *\li 'style' is a valid master dump style.
- *
- *\li 'target' is a valid buffer.
- *
- * Ensures:
- *
- *\li If the result is success:
- * The used space in 'target' is updated.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOSPACE
- *\li #ISC_R_NOMORE
- *
- *\li Note: On error return, *target may be partially filled with data.
- */
-
-isc_result_t
-dns_message_parse(dns_message_t *msg, isc_buffer_t *source,
- unsigned int options);
-/*%<
- * Parse raw wire data in 'source' as a DNS message.
- *
- * OPT records are detected and stored in the pseudo-section "opt".
- * TSIGs are detected and stored in the pseudo-section "tsig".
- *
- * If #DNS_MESSAGEPARSE_PRESERVEORDER is set, or if the opcode of the message
- * is UPDATE, a separate dns_name_t object will be created for each RR in the
- * message. Each such dns_name_t will have a single rdataset containing the
- * single RR, and the order of the RRs in the message is preserved.
- * Otherwise, only one dns_name_t object will be created for each unique
- * owner name in the section, and each such dns_name_t will have a list
- * of rdatasets. To access the names and their data, use
- * dns_message_firstname() and dns_message_nextname().
- *
- * If #DNS_MESSAGEPARSE_BESTEFFORT is set, errors in message content will
- * not be considered FORMERRs. If the entire message can be parsed, it
- * will be returned and DNS_R_RECOVERABLE will be returned.
- *
- * If #DNS_MESSAGEPARSE_IGNORETRUNCATION is set then return as many complete
- * RR's as possible, DNS_R_RECOVERABLE will be returned.
- *
- * OPT and TSIG records are always handled specially, regardless of the
- * 'preserve_order' setting.
- *
- * Requires:
- *\li "msg" be valid.
- *
- *\li "buffer" be a wire format buffer.
- *
- * Ensures:
- *\li The buffer's data format is correct.
- *
- *\li The buffer's contents verify as correct regarding header bits, buffer
- * and rdata sizes, etc.
- *
- * Returns:
- *\li #ISC_R_SUCCESS -- all is well
- *\li #ISC_R_NOMEMORY -- no memory
- *\li #DNS_R_RECOVERABLE -- the message parsed properly, but contained
- * errors.
- *\li Many other errors possible XXXMLG
- */
-
-isc_result_t
-dns_message_renderbegin(dns_message_t *msg, dns_compress_t *cctx,
- isc_buffer_t *buffer);
-/*%<
- * Begin rendering on a message. Only one call can be made to this function
- * per message.
- *
- * The compression context is "owned" by the message library until
- * dns_message_renderend() is called. It must be invalidated by the caller.
- *
- * The buffer is "owned" by the message library until dns_message_renderend()
- * is called.
- *
- * Requires:
- *
- *\li 'msg' be valid.
- *
- *\li 'cctx' be valid.
- *
- *\li 'buffer' is a valid buffer.
- *
- * Side Effects:
- *
- *\li The buffer is cleared before it is used.
- *
- * Returns:
- *\li #ISC_R_SUCCESS -- all is well
- *\li #ISC_R_NOSPACE -- output buffer is too small
- */
-
-isc_result_t
-dns_message_renderchangebuffer(dns_message_t *msg, isc_buffer_t *buffer);
-/*%<
- * Reset the buffer. This can be used after growing the old buffer
- * on a ISC_R_NOSPACE return from most of the render functions.
- *
- * On successful completion, the old buffer is no longer used by the
- * library. The new buffer is owned by the library until
- * dns_message_renderend() is called.
- *
- * Requires:
- *
- *\li 'msg' be valid.
- *
- *\li dns_message_renderbegin() was called.
- *
- *\li buffer != NULL.
- *
- * Returns:
- *\li #ISC_R_NOSPACE -- new buffer is too small
- *\li #ISC_R_SUCCESS -- all is well.
- */
-
-isc_result_t
-dns_message_renderreserve(dns_message_t *msg, unsigned int space);
-/*%<
- * XXXMLG should use size_t rather than unsigned int once the buffer
- * API is cleaned up
- *
- * Reserve "space" bytes in the given buffer.
- *
- * Requires:
- *
- *\li 'msg' be valid.
- *
- *\li dns_message_renderbegin() was called.
- *
- * Returns:
- *\li #ISC_R_SUCCESS -- all is well.
- *\li #ISC_R_NOSPACE -- not enough free space in the buffer.
- */
-
-void
-dns_message_renderrelease(dns_message_t *msg, unsigned int space);
-/*%<
- * XXXMLG should use size_t rather than unsigned int once the buffer
- * API is cleaned up
- *
- * Release "space" bytes in the given buffer that was previously reserved.
- *
- * Requires:
- *
- *\li 'msg' be valid.
- *
- *\li 'space' is less than or equal to the total amount of space reserved
- * via prior calls to dns_message_renderreserve().
- *
- *\li dns_message_renderbegin() was called.
- */
-
-isc_result_t
-dns_message_rendersection(dns_message_t *msg, dns_section_t section,
- unsigned int options);
-/*%<
- * Render all names, rdatalists, etc from the given section at the
- * specified priority or higher.
- *
- * Requires:
- *\li 'msg' be valid.
- *
- *\li 'section' be a valid section.
- *
- *\li dns_message_renderbegin() was called.
- *
- * Returns:
- *\li #ISC_R_SUCCESS -- all records were written, and there are
- * no more records for this section.
- *\li #ISC_R_NOSPACE -- Not enough room in the buffer to write
- * all records requested.
- *\li #DNS_R_MOREDATA -- All requested records written, and there
- * are records remaining for this section.
- */
-
-void
-dns_message_renderheader(dns_message_t *msg, isc_buffer_t *target);
-/*%<
- * Render the message header. This is implicitly called by
- * dns_message_renderend().
- *
- * Requires:
- *
- *\li 'msg' be a valid message.
- *
- *\li dns_message_renderbegin() was called.
- *
- *\li 'target' is a valid buffer with enough space to hold a message header
- */
-
-isc_result_t
-dns_message_renderend(dns_message_t *msg);
-/*%<
- * Finish rendering to the buffer. Note that more data can be in the
- * 'msg' structure. Destroying the structure will free this, or in a multi-
- * part EDNS1 message this data can be rendered to another buffer later.
- *
- * Requires:
- *
- *\li 'msg' be a valid message.
- *
- *\li dns_message_renderbegin() was called.
- *
- * Returns:
- *\li #ISC_R_SUCCESS -- all is well.
- */
-
-void
-dns_message_renderreset(dns_message_t *msg);
-/*%<
- * Reset the message so that it may be rendered again.
- *
- * Notes:
- *
- *\li If dns_message_renderbegin() has been called, dns_message_renderend()
- * must be called before calling this function.
- *
- * Requires:
- *
- *\li 'msg' be a valid message with rendering intent.
- */
-
-isc_result_t
-dns_message_firstname(dns_message_t *msg, dns_section_t section);
-/*%<
- * Set internal per-section name pointer to the beginning of the section.
- *
- * The functions dns_message_firstname() and dns_message_nextname() may
- * be used for iterating over the owner names in a section.
- *
- * Requires:
- *
- *\li 'msg' be valid.
- *
- *\li 'section' be a valid section.
- *
- * Returns:
- *\li #ISC_R_SUCCESS -- All is well.
- *\li #ISC_R_NOMORE -- No names on given section.
- */
-
-isc_result_t
-dns_message_nextname(dns_message_t *msg, dns_section_t section);
-/*%<
- * Sets the internal per-section name pointer to point to the next name
- * in that section.
- *
- * Requires:
- *
- * \li 'msg' be valid.
- *
- *\li 'section' be a valid section.
- *
- *\li dns_message_firstname() must have been called on this section,
- * and the result was ISC_R_SUCCESS.
- *
- * Returns:
- *\li #ISC_R_SUCCESS -- All is well.
- *\li #ISC_R_NOMORE -- No more names in given section.
- */
-
-void
-dns_message_currentname(dns_message_t *msg, dns_section_t section,
- dns_name_t **name);
-/*%<
- * Sets 'name' to point to the name where the per-section internal name
- * pointer is currently set.
- *
- * This function returns the name in the database, so any data associated
- * with it (via the name's "list" member) contains the actual rdatasets.
- *
- * Requires:
- *
- *\li 'msg' be valid.
- *
- *\li 'name' be non-NULL, and *name be NULL.
- *
- *\li 'section' be a valid section.
- *
- *\li dns_message_firstname() must have been called on this section,
- * and the result of it and any dns_message_nextname() calls was
- * #ISC_R_SUCCESS.
- */
-
-isc_result_t
-dns_message_findname(dns_message_t *msg, dns_section_t section,
- dns_name_t *target, dns_rdatatype_t type,
- dns_rdatatype_t covers, dns_name_t **foundname,
- dns_rdataset_t **rdataset);
-/*%<
- * Search for a name in the specified section. If it is found, *name is
- * set to point to the name, and *rdataset is set to point to the found
- * rdataset (if type is specified as other than dns_rdatatype_any).
- *
- * Requires:
- *\li 'msg' be valid.
- *
- *\li 'section' be a valid section.
- *
- *\li If a pointer to the name is desired, 'foundname' should be non-NULL.
- * If it is non-NULL, '*foundname' MUST be NULL.
- *
- *\li If a type other than dns_datatype_any is searched for, 'rdataset'
- * may be non-NULL, '*rdataset' be NULL, and will point at the found
- * rdataset. If the type is dns_datatype_any, 'rdataset' must be NULL.
- *
- *\li 'target' be a valid name.
- *
- *\li 'type' be a valid type.
- *
- *\li If 'type' is dns_rdatatype_rrsig, 'covers' must be a valid type.
- * Otherwise it should be 0.
- *
- * Returns:
- *\li #ISC_R_SUCCESS -- all is well.
- *\li #DNS_R_NXDOMAIN -- name does not exist in that section.
- *\li #DNS_R_NXRRSET -- The name does exist, but the desired
- * type does not.
- */
-
-isc_result_t
-dns_message_findtype(dns_name_t *name, dns_rdatatype_t type,
- dns_rdatatype_t covers, dns_rdataset_t **rdataset);
-/*%<
- * Search the name for the specified type. If it is found, *rdataset is
- * filled in with a pointer to that rdataset.
- *
- * Requires:
- *\li if '**rdataset' is non-NULL, *rdataset needs to be NULL.
- *
- *\li 'type' be a valid type, and NOT dns_rdatatype_any.
- *
- *\li If 'type' is dns_rdatatype_rrsig, 'covers' must be a valid type.
- * Otherwise it should be 0.
- *
- * Returns:
- *\li #ISC_R_SUCCESS -- all is well.
- *\li #ISC_R_NOTFOUND -- the desired type does not exist.
- */
-
-isc_result_t
-dns_message_find(dns_name_t *name, dns_rdataclass_t rdclass,
- dns_rdatatype_t type, dns_rdatatype_t covers,
- dns_rdataset_t **rdataset);
-/*%<
- * Search the name for the specified rdclass and type. If it is found,
- * *rdataset is filled in with a pointer to that rdataset.
- *
- * Requires:
- *\li if '**rdataset' is non-NULL, *rdataset needs to be NULL.
- *
- *\li 'type' be a valid type, and NOT dns_rdatatype_any.
- *
- *\li If 'type' is dns_rdatatype_rrsig, 'covers' must be a valid type.
- * Otherwise it should be 0.
- *
- * Returns:
- *\li #ISC_R_SUCCESS -- all is well.
- *\li #ISC_R_NOTFOUND -- the desired type does not exist.
- */
-
-void
-dns_message_movename(dns_message_t *msg, dns_name_t *name,
- dns_section_t fromsection,
- dns_section_t tosection);
-/*%<
- * Move a name from one section to another.
- *
- * Requires:
- *
- *\li 'msg' be valid.
- *
- *\li 'name' must be a name already in 'fromsection'.
- *
- *\li 'fromsection' must be a valid section.
- *
- *\li 'tosection' must be a valid section.
- */
-
-void
-dns_message_addname(dns_message_t *msg, dns_name_t *name,
- dns_section_t section);
-/*%<
- * Adds the name to the given section.
- *
- * It is the caller's responsibility to enforce any unique name requirements
- * in a section.
- *
- * Requires:
- *
- *\li 'msg' be valid, and be a renderable message.
- *
- *\li 'name' be a valid absolute name.
- *
- *\li 'section' be a named section.
- */
-
-void
-dns_message_removename(dns_message_t *msg, dns_name_t *name,
- dns_section_t section);
-/*%<
- * Remove a existing name from a given section.
- *
- * It is the caller's responsibility to ensure the name is part of the
- * given section.
- *
- * Requires:
- *
- *\li 'msg' be valid, and be a renderable message.
- *
- *\li 'name' be a valid absolute name.
- *
- *\li 'section' be a named section.
- */
-
-
-/*
- * LOANOUT FUNCTIONS
- *
- * Each of these functions loan a particular type of data to the caller.
- * The storage for these will vanish when the message is destroyed or
- * reset, and must NOT be used after these operations.
- */
-
-isc_result_t
-dns_message_gettempname(dns_message_t *msg, dns_name_t **item);
-/*%<
- * Return a name that can be used for any temporary purpose, including
- * inserting into the message's linked lists. The name must be returned
- * to the message code using dns_message_puttempname() or inserted into
- * one of the message's sections before the message is destroyed.
- *
- * It is the caller's responsibility to initialize this name.
- *
- * Requires:
- *\li msg be a valid message
- *
- *\li item != NULL && *item == NULL
- *
- * Returns:
- *\li #ISC_R_SUCCESS -- All is well.
- *\li #ISC_R_NOMEMORY -- No item can be allocated.
- */
-
-isc_result_t
-dns_message_gettempoffsets(dns_message_t *msg, dns_offsets_t **item);
-/*%<
- * Return an offsets array that can be used for any temporary purpose,
- * such as attaching to a temporary name. The offsets will be freed
- * when the message is destroyed or reset.
- *
- * Requires:
- *\li msg be a valid message
- *
- *\li item != NULL && *item == NULL
- *
- * Returns:
- *\li #ISC_R_SUCCESS -- All is well.
- *\li #ISC_R_NOMEMORY -- No item can be allocated.
- */
-
-isc_result_t
-dns_message_gettemprdata(dns_message_t *msg, dns_rdata_t **item);
-/*%<
- * Return a rdata that can be used for any temporary purpose, including
- * inserting into the message's linked lists. The rdata will be freed
- * when the message is destroyed or reset.
- *
- * Requires:
- *\li msg be a valid message
- *
- *\li item != NULL && *item == NULL
- *
- * Returns:
- *\li #ISC_R_SUCCESS -- All is well.
- *\li #ISC_R_NOMEMORY -- No item can be allocated.
- */
-
-isc_result_t
-dns_message_gettemprdataset(dns_message_t *msg, dns_rdataset_t **item);
-/*%<
- * Return a rdataset that can be used for any temporary purpose, including
- * inserting into the message's linked lists. The name must be returned
- * to the message code using dns_message_puttempname() or inserted into
- * one of the message's sections before the message is destroyed.
- *
- * Requires:
- *\li msg be a valid message
- *
- *\li item != NULL && *item == NULL
- *
- * Returns:
- *\li #ISC_R_SUCCESS -- All is well.
- *\li #ISC_R_NOMEMORY -- No item can be allocated.
- */
-
-isc_result_t
-dns_message_gettemprdatalist(dns_message_t *msg, dns_rdatalist_t **item);
-/*%<
- * Return a rdatalist that can be used for any temporary purpose, including
- * inserting into the message's linked lists. The rdatalist will be
- * destroyed when the message is destroyed or reset.
- *
- * Requires:
- *\li msg be a valid message
- *
- *\li item != NULL && *item == NULL
- *
- * Returns:
- *\li #ISC_R_SUCCESS -- All is well.
- *\li #ISC_R_NOMEMORY -- No item can be allocated.
- */
-
-void
-dns_message_puttempname(dns_message_t *msg, dns_name_t **item);
-/*%<
- * Return a borrowed name to the message's name free list.
- *
- * Requires:
- *\li msg be a valid message
- *
- *\li item != NULL && *item point to a name returned by
- * dns_message_gettempname()
- *
- * Ensures:
- *\li *item == NULL
- */
-
-void
-dns_message_puttemprdata(dns_message_t *msg, dns_rdata_t **item);
-/*%<
- * Return a borrowed rdata to the message's rdata free list.
- *
- * Requires:
- *\li msg be a valid message
- *
- *\li item != NULL && *item point to a rdata returned by
- * dns_message_gettemprdata()
- *
- * Ensures:
- *\li *item == NULL
- */
-
-void
-dns_message_puttemprdataset(dns_message_t *msg, dns_rdataset_t **item);
-/*%<
- * Return a borrowed rdataset to the message's rdataset free list.
- *
- * Requires:
- *\li msg be a valid message
- *
- *\li item != NULL && *item point to a rdataset returned by
- * dns_message_gettemprdataset()
- *
- * Ensures:
- *\li *item == NULL
- */
-
-void
-dns_message_puttemprdatalist(dns_message_t *msg, dns_rdatalist_t **item);
-/*%<
- * Return a borrowed rdatalist to the message's rdatalist free list.
- *
- * Requires:
- *\li msg be a valid message
- *
- *\li item != NULL && *item point to a rdatalist returned by
- * dns_message_gettemprdatalist()
- *
- * Ensures:
- *\li *item == NULL
- */
-
-isc_result_t
-dns_message_peekheader(isc_buffer_t *source, dns_messageid_t *idp,
- unsigned int *flagsp);
-/*%<
- * Assume the remaining region of "source" is a DNS message. Peek into
- * it and fill in "*idp" with the message id, and "*flagsp" with the flags.
- *
- * Requires:
- *
- *\li source != NULL
- *
- * Ensures:
- *
- *\li if (idp != NULL) *idp == message id.
- *
- *\li if (flagsp != NULL) *flagsp == message flags.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS -- all is well.
- *
- *\li #ISC_R_UNEXPECTEDEND -- buffer doesn't contain enough for a header.
- */
-
-isc_result_t
-dns_message_reply(dns_message_t *msg, isc_boolean_t want_question_section);
-/*%<
- * Start formatting a reply to the query in 'msg'.
- *
- * Requires:
- *
- *\li 'msg' is a valid message with parsing intent, and contains a query.
- *
- * Ensures:
- *
- *\li The message will have a rendering intent. If 'want_question_section'
- * is true, the message opcode is query or notify, and the question
- * section is present and properly formatted, then the question section
- * will be included in the reply. All other sections will be cleared.
- * The QR flag will be set, the RD flag will be preserved, and all other
- * flags will be cleared.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS -- all is well.
- *
- *\li #DNS_R_FORMERR -- the header or question section of the
- * message is invalid, replying is impossible.
- * If DNS_R_FORMERR is returned when
- * want_question_section is ISC_FALSE, then
- * it's the header section that's bad;
- * otherwise either of the header or question
- * sections may be bad.
- */
-
-dns_rdataset_t *
-dns_message_getopt(dns_message_t *msg);
-/*%<
- * Get the OPT record for 'msg'.
- *
- * Requires:
- *
- *\li 'msg' is a valid message.
- *
- * Returns:
- *
- *\li The OPT rdataset of 'msg', or NULL if there isn't one.
- */
-
-isc_result_t
-dns_message_setopt(dns_message_t *msg, dns_rdataset_t *opt);
-/*%<
- * Set the OPT record for 'msg'.
- *
- * Requires:
- *
- *\li 'msg' is a valid message with rendering intent
- * and no sections have been rendered.
- *
- *\li 'opt' is a valid OPT record.
- *
- * Ensures:
- *
- *\li The OPT record has either been freed or ownership of it has
- * been transferred to the message.
- *
- *\li If ISC_R_SUCCESS was returned, the OPT record will be rendered
- * when dns_message_renderend() is called.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS -- all is well.
- *
- *\li #ISC_R_NOSPACE -- there is no space for the OPT record.
- */
-
-dns_rdataset_t *
-dns_message_gettsig(dns_message_t *msg, dns_name_t **owner);
-/*%<
- * Get the TSIG record and owner for 'msg'.
- *
- * Requires:
- *
- *\li 'msg' is a valid message.
- *\li 'owner' is NULL or *owner is NULL.
- *
- * Returns:
- *
- *\li The TSIG rdataset of 'msg', or NULL if there isn't one.
- *
- * Ensures:
- *
- * \li If 'owner' is not NULL, it will point to the owner name.
- */
-
-isc_result_t
-dns_message_settsigkey(dns_message_t *msg, dns_tsigkey_t *key);
-/*%<
- * Set the tsig key for 'msg'. This is only necessary for when rendering a
- * query or parsing a response. The key (if non-NULL) is attached to, and
- * will be detached when the message is destroyed.
- *
- * Requires:
- *
- *\li 'msg' is a valid message with rendering intent,
- * dns_message_renderbegin() has been called, and no sections have been
- * rendered.
- *\li 'key' is a valid tsig key or NULL.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS -- all is well.
- *
- *\li #ISC_R_NOSPACE -- there is no space for the TSIG record.
- */
-
-dns_tsigkey_t *
-dns_message_gettsigkey(dns_message_t *msg);
-/*%<
- * Gets the tsig key for 'msg'.
- *
- * Requires:
- *
- *\li 'msg' is a valid message
- */
-
-isc_result_t
-dns_message_setquerytsig(dns_message_t *msg, isc_buffer_t *querytsig);
-/*%<
- * Indicates that 'querytsig' is the TSIG from the signed query for which
- * 'msg' is the response. This is also used for chained TSIGs in TCP
- * responses.
- *
- * Requires:
- *
- *\li 'querytsig' is a valid buffer as returned by dns_message_getquerytsig()
- * or NULL
- *
- *\li 'msg' is a valid message
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- */
-
-isc_result_t
-dns_message_getquerytsig(dns_message_t *msg, isc_mem_t *mctx,
- isc_buffer_t **querytsig);
-/*%<
- * Gets the tsig from the TSIG from the signed query 'msg'. This is also used
- * for chained TSIGs in TCP responses. Unlike dns_message_gettsig, this makes
- * a copy of the data, so can be used if the message is destroyed.
- *
- * Requires:
- *
- *\li 'msg' is a valid signed message
- *\li 'mctx' is a valid memory context
- *\li querytsig != NULL && *querytsig == NULL
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *
- * Ensures:
- *\li 'tsig' points to NULL or an allocated buffer which must be freed
- * by the caller.
- */
-
-dns_rdataset_t *
-dns_message_getsig0(dns_message_t *msg, dns_name_t **owner);
-/*%<
- * Get the SIG(0) record and owner for 'msg'.
- *
- * Requires:
- *
- *\li 'msg' is a valid message.
- *\li 'owner' is NULL or *owner is NULL.
- *
- * Returns:
- *
- *\li The SIG(0) rdataset of 'msg', or NULL if there isn't one.
- *
- * Ensures:
- *
- * \li If 'owner' is not NULL, it will point to the owner name.
- */
-
-isc_result_t
-dns_message_setsig0key(dns_message_t *msg, dst_key_t *key);
-/*%<
- * Set the SIG(0) key for 'msg'.
- *
- * Requires:
- *
- *\li 'msg' is a valid message with rendering intent,
- * dns_message_renderbegin() has been called, and no sections have been
- * rendered.
- *\li 'key' is a valid sig key or NULL.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS -- all is well.
- *
- *\li #ISC_R_NOSPACE -- there is no space for the SIG(0) record.
- */
-
-dst_key_t *
-dns_message_getsig0key(dns_message_t *msg);
-/*%<
- * Gets the SIG(0) key for 'msg'.
- *
- * Requires:
- *
- *\li 'msg' is a valid message
- */
-
-void
-dns_message_takebuffer(dns_message_t *msg, isc_buffer_t **buffer);
-/*%<
- * Give the *buffer to the message code to clean up when it is no
- * longer needed. This is usually when the message is reset or
- * destroyed.
- *
- * Requires:
- *
- *\li msg be a valid message.
- *
- *\li buffer != NULL && *buffer is a valid isc_buffer_t, which was
- * dynamically allocated via isc_buffer_allocate().
- */
-
-isc_result_t
-dns_message_signer(dns_message_t *msg, dns_name_t *signer);
-/*%<
- * If this message was signed, return the identity of the signer.
- * Unless ISC_R_NOTFOUND is returned, signer will reflect the name of the
- * key that signed the message.
- *
- * Requires:
- *
- *\li msg is a valid parsed message.
- *\li signer is a valid name
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS - the message was signed, and *signer
- * contains the signing identity
- *
- *\li #ISC_R_NOTFOUND - no TSIG or SIG(0) record is present in the
- * message
- *
- *\li #DNS_R_TSIGVERIFYFAILURE - the message was signed by a TSIG, but the
- * signature failed to verify
- *
- *\li #DNS_R_TSIGERRORSET - the message was signed by a TSIG and
- * verified, but the query was rejected by
- * the server
- *
- *\li #DNS_R_NOIDENTITY - the message was signed by a TSIG and
- * verified, but the key has no identity since
- * it was generated by an unsigned TKEY process
- *
- *\li #DNS_R_SIGINVALID - the message was signed by a SIG(0), but
- * the signature failed to verify
- *
- *\li #DNS_R_NOTVERIFIEDYET - the message was signed by a TSIG or SIG(0),
- * but the signature has not been verified yet
- */
-
-isc_result_t
-dns_message_checksig(dns_message_t *msg, dns_view_t *view);
-/*%<
- * If this message was signed, verify the signature.
- *
- * Requires:
- *
- *\li msg is a valid parsed message.
- *\li view is a valid view or NULL
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS - the message was unsigned, or the message
- * was signed correctly.
- *
- *\li #DNS_R_EXPECTEDTSIG - A TSIG was expected, but not seen
- *\li #DNS_R_UNEXPECTEDTSIG - A TSIG was seen but not expected
- *\li #DNS_R_TSIGVERIFYFAILURE - The TSIG failed to verify
- */
-
-isc_result_t
-dns_message_rechecksig(dns_message_t *msg, dns_view_t *view);
-/*%<
- * Reset the signature state and then if the message was signed,
- * verify the message.
- *
- * Requires:
- *
- *\li msg is a valid parsed message.
- *\li view is a valid view or NULL
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS - the message was unsigned, or the message
- * was signed correctly.
- *
- *\li #DNS_R_EXPECTEDTSIG - A TSIG was expected, but not seen
- *\li #DNS_R_UNEXPECTEDTSIG - A TSIG was seen but not expected
- *\li #DNS_R_TSIGVERIFYFAILURE - The TSIG failed to verify
- */
-
-void
-dns_message_resetsig(dns_message_t *msg);
-/*%<
- * Reset the signature state.
- *
- * Requires:
- *\li 'msg' is a valid parsed message.
- */
-
-isc_region_t *
-dns_message_getrawmessage(dns_message_t *msg);
-/*%<
- * Retrieve the raw message in compressed wire format. The message must
- * have been successfully parsed for it to have been saved.
- *
- * Requires:
- *\li msg is a valid parsed message.
- *
- * Returns:
- *\li NULL if there is no saved message.
- * a pointer to a region which refers the dns message.
- */
-
-void
-dns_message_setsortorder(dns_message_t *msg, dns_rdatasetorderfunc_t order,
- const void *order_arg);
-/*%<
- * Define the order in which RR sets get rendered by
- * dns_message_rendersection() to be the ascending order
- * defined by the integer value returned by 'order' when
- * given each RR and 'arg' as arguments. If 'order' and
- * 'order_arg' are NULL, a default order is used.
- *
- * Requires:
- *\li msg be a valid message.
- *\li order_arg is NULL if and only if order is NULL.
- */
-
-void
-dns_message_settimeadjust(dns_message_t *msg, int timeadjust);
-/*%<
- * Adjust the time used to sign/verify a message by timeadjust.
- * Currently only TSIG.
- *
- * Requires:
- *\li msg be a valid message.
- */
-
-int
-dns_message_gettimeadjust(dns_message_t *msg);
-/*%<
- * Return the current time adjustment.
- *
- * Requires:
- *\li msg be a valid message.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_MESSAGE_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: name.h,v 1.126.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef DNS_NAME_H
-#define DNS_NAME_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/name.h
- * \brief
- * Provides facilities for manipulating DNS names and labels, including
- * conversions to and from wire format and text format.
- *
- * Given the large number of names possible in a nameserver, and because
- * names occur in rdata, it was important to come up with a very efficient
- * way of storing name data, but at the same time allow names to be
- * manipulated. The decision was to store names in uncompressed wire format,
- * and not to make them fully abstracted objects; i.e. certain parts of the
- * server know names are stored that way. This saves a lot of memory, and
- * makes adding names to messages easy. Having much of the server know
- * the representation would be perilous, and we certainly don't want each
- * user of names to be manipulating such a low-level structure. This is
- * where the Names and Labels module comes in. The module allows name or
- * label handles to be created and attached to uncompressed wire format
- * regions. All name operations and conversions are done through these
- * handles.
- *
- * MP:
- *\li Clients of this module must impose any required synchronization.
- *
- * Reliability:
- *\li This module deals with low-level byte streams. Errors in any of
- * the functions are likely to crash the server or corrupt memory.
- *
- * Resources:
- *\li None.
- *
- * Security:
- *
- *\li *** WARNING ***
- *
- *\li dns_name_fromwire() deals with raw network data. An error in
- * this routine could result in the failure or hijacking of the server.
- *
- * Standards:
- *\li RFC1035
- *\li Draft EDNS0 (0)
- *\li Draft Binary Labels (2)
- *
- */
-
-/***
- *** Imports
- ***/
-
-#include <stdio.h>
-
-#include <isc/boolean.h>
-#include <isc/lang.h>
-#include <isc/magic.h>
-#include <isc/region.h> /* Required for storage size of dns_label_t. */
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/*****
- ***** Labels
- *****
- ***** A 'label' is basically a region. It contains one DNS wire format
- ***** label of type 00 (ordinary).
- *****/
-
-/*****
- ***** Names
- *****
- ***** A 'name' is a handle to a binary region. It contains a sequence of one
- ***** or more DNS wire format labels of type 00 (ordinary).
- ***** Note that all names are not required to end with the root label,
- ***** as they are in the actual DNS wire protocol.
- *****/
-
-/***
- *** Compression pointer chaining limit
- ***/
-
-#define DNS_POINTER_MAXHOPS 16
-
-/***
- *** Types
- ***/
-
-/*%
- * Clients are strongly discouraged from using this type directly, with
- * the exception of the 'link' and 'list' fields which may be used directly
- * for whatever purpose the client desires.
- */
-struct dns_name {
- unsigned int magic;
- unsigned char * ndata;
- unsigned int length;
- unsigned int labels;
- unsigned int attributes;
- unsigned char * offsets;
- isc_buffer_t * buffer;
- ISC_LINK(dns_name_t) link;
- ISC_LIST(dns_rdataset_t) list;
-};
-
-#define DNS_NAME_MAGIC ISC_MAGIC('D','N','S','n')
-
-#define DNS_NAMEATTR_ABSOLUTE 0x0001
-#define DNS_NAMEATTR_READONLY 0x0002
-#define DNS_NAMEATTR_DYNAMIC 0x0004
-#define DNS_NAMEATTR_DYNOFFSETS 0x0008
-#define DNS_NAMEATTR_NOCOMPRESS 0x0010
-/*
- * Attributes below 0x0100 reserved for name.c usage.
- */
-#define DNS_NAMEATTR_CACHE 0x0100 /*%< Used by resolver. */
-#define DNS_NAMEATTR_ANSWER 0x0200 /*%< Used by resolver. */
-#define DNS_NAMEATTR_NCACHE 0x0400 /*%< Used by resolver. */
-#define DNS_NAMEATTR_CHAINING 0x0800 /*%< Used by resolver. */
-#define DNS_NAMEATTR_CHASE 0x1000 /*%< Used by resolver. */
-#define DNS_NAMEATTR_WILDCARD 0x2000 /*%< Used by server. */
-
-#define DNS_NAME_DOWNCASE 0x0001
-#define DNS_NAME_CHECKNAMES 0x0002 /*%< Used by rdata. */
-#define DNS_NAME_CHECKNAMESFAIL 0x0004 /*%< Used by rdata. */
-#define DNS_NAME_CHECKREVERSE 0x0008 /*%< Used by rdata. */
-#define DNS_NAME_CHECKMX 0x0010 /*%< Used by rdata. */
-#define DNS_NAME_CHECKMXFAIL 0x0020 /*%< Used by rdata. */
-
-LIBDNS_EXTERNAL_DATA extern dns_name_t *dns_rootname;
-LIBDNS_EXTERNAL_DATA extern dns_name_t *dns_wildcardname;
-
-/*%
- * Standard size of a wire format name
- */
-#define DNS_NAME_MAXWIRE 255
-
-/*
- * Text output filter procedure.
- * 'target' is the buffer to be converted. The region to be converted
- * is from 'buffer'->base + 'used_org' to the end of the used region.
- */
-typedef isc_result_t (*dns_name_totextfilter_t)(isc_buffer_t *target,
- unsigned int used_org,
- isc_boolean_t absolute);
-
-/***
- *** Initialization
- ***/
-
-void
-dns_name_init(dns_name_t *name, unsigned char *offsets);
-/*%<
- * Initialize 'name'.
- *
- * Notes:
- * \li 'offsets' is never required to be non-NULL, but specifying a
- * dns_offsets_t for 'offsets' will improve the performance of most
- * name operations if the name is used more than once.
- *
- * Requires:
- * \li 'name' is not NULL and points to a struct dns_name.
- *
- * \li offsets == NULL or offsets is a dns_offsets_t.
- *
- * Ensures:
- * \li 'name' is a valid name.
- * \li dns_name_countlabels(name) == 0
- * \li dns_name_isabsolute(name) == ISC_FALSE
- */
-
-void
-dns_name_reset(dns_name_t *name);
-/*%<
- * Reinitialize 'name'.
- *
- * Notes:
- * \li This function distinguishes itself from dns_name_init() in two
- * key ways:
- *
- * \li + If any buffer is associated with 'name' (via dns_name_setbuffer()
- * or by being part of a dns_fixedname_t) the link to the buffer
- * is retained but the buffer itself is cleared.
- *
- * \li + Of the attributes associated with 'name', all are retained except
- * DNS_NAMEATTR_ABSOLUTE.
- *
- * Requires:
- * \li 'name' is a valid name.
- *
- * Ensures:
- * \li 'name' is a valid name.
- * \li dns_name_countlabels(name) == 0
- * \li dns_name_isabsolute(name) == ISC_FALSE
- */
-
-void
-dns_name_invalidate(dns_name_t *name);
-/*%<
- * Make 'name' invalid.
- *
- * Requires:
- * \li 'name' is a valid name.
- *
- * Ensures:
- * \li If assertion checking is enabled, future attempts to use 'name'
- * without initializing it will cause an assertion failure.
- *
- * \li If the name had a dedicated buffer, that association is ended.
- */
-
-
-/***
- *** Dedicated Buffers
- ***/
-
-void
-dns_name_setbuffer(dns_name_t *name, isc_buffer_t *buffer);
-/*%<
- * Dedicate a buffer for use with 'name'.
- *
- * Notes:
- * \li Specification of a target buffer in dns_name_fromwire(),
- * dns_name_fromtext(), and dns_name_concatenate() is optional if
- * 'name' has a dedicated buffer.
- *
- * \li The caller must not write to buffer until the name has been
- * invalidated or is otherwise known not to be in use.
- *
- * \li If buffer is NULL and the name previously had a dedicated buffer,
- * than that buffer is no longer dedicated to use with this name.
- * The caller is responsible for ensuring that the storage used by
- * the name remains valid.
- *
- * Requires:
- * \li 'name' is a valid name.
- *
- * \li 'buffer' is a valid binary buffer and 'name' doesn't have a
- * dedicated buffer already, or 'buffer' is NULL.
- */
-
-isc_boolean_t
-dns_name_hasbuffer(const dns_name_t *name);
-/*%<
- * Does 'name' have a dedicated buffer?
- *
- * Requires:
- * \li 'name' is a valid name.
- *
- * Returns:
- * \li ISC_TRUE 'name' has a dedicated buffer.
- * \li ISC_FALSE 'name' does not have a dedicated buffer.
- */
-
-/***
- *** Properties
- ***/
-
-isc_boolean_t
-dns_name_isabsolute(const dns_name_t *name);
-/*%<
- * Does 'name' end in the root label?
- *
- * Requires:
- * \li 'name' is a valid name
- *
- * Returns:
- * \li TRUE The last label in 'name' is the root label.
- * \li FALSE The last label in 'name' is not the root label.
- */
-
-isc_boolean_t
-dns_name_iswildcard(const dns_name_t *name);
-/*%<
- * Is 'name' a wildcard name?
- *
- * Requires:
- * \li 'name' is a valid name
- *
- * \li dns_name_countlabels(name) > 0
- *
- * Returns:
- * \li TRUE The least significant label of 'name' is '*'.
- * \li FALSE The least significant label of 'name' is not '*'.
- */
-
-unsigned int
-dns_name_hash(dns_name_t *name, isc_boolean_t case_sensitive);
-/*%<
- * Provide a hash value for 'name'.
- *
- * Note: if 'case_sensitive' is ISC_FALSE, then names which differ only in
- * case will have the same hash value.
- *
- * Requires:
- * \li 'name' is a valid name
- *
- * Returns:
- * \li A hash value
- */
-
-unsigned int
-dns_name_fullhash(dns_name_t *name, isc_boolean_t case_sensitive);
-/*%<
- * Provide a hash value for 'name'. Unlike dns_name_hash(), this function
- * always takes into account of the entire name to calculate the hash value.
- *
- * Note: if 'case_sensitive' is ISC_FALSE, then names which differ only in
- * case will have the same hash value.
- *
- * Requires:
- *\li 'name' is a valid name
- *
- * Returns:
- *\li A hash value
- */
-
-unsigned int
-dns_name_hashbylabel(dns_name_t *name, isc_boolean_t case_sensitive);
-/*%<
- * Provide a hash value for 'name', where the hash value is the sum
- * of the hash values of each label.
- *
- * Note: if 'case_sensitive' is ISC_FALSE, then names which differ only in
- * case will have the same hash value.
- *
- * Requires:
- *\li 'name' is a valid name
- *
- * Returns:
- *\li A hash value
- */
-
-/*
- *** Comparisons
- ***/
-
-dns_namereln_t
-dns_name_fullcompare(const dns_name_t *name1, const dns_name_t *name2,
- int *orderp, unsigned int *nlabelsp);
-/*%<
- * Determine the relative ordering under the DNSSEC order relation of
- * 'name1' and 'name2', and also determine the hierarchical
- * relationship of the names.
- *
- * Note: It makes no sense for one of the names to be relative and the
- * other absolute. If both names are relative, then to be meaningfully
- * compared the caller must ensure that they are both relative to the
- * same domain.
- *
- * Requires:
- *\li 'name1' is a valid name
- *
- *\li dns_name_countlabels(name1) > 0
- *
- *\li 'name2' is a valid name
- *
- *\li dns_name_countlabels(name2) > 0
- *
- *\li orderp and nlabelsp are valid pointers.
- *
- *\li Either name1 is absolute and name2 is absolute, or neither is.
- *
- * Ensures:
- *
- *\li *orderp is < 0 if name1 < name2, 0 if name1 = name2, > 0 if
- * name1 > name2.
- *
- *\li *nlabelsp is the number of common significant labels.
- *
- * Returns:
- *\li dns_namereln_none There's no hierarchical relationship
- * between name1 and name2.
- *\li dns_namereln_contains name1 properly contains name2; i.e.
- * name2 is a proper subdomain of name1.
- *\li dns_namereln_subdomain name1 is a proper subdomain of name2.
- *\li dns_namereln_equal name1 and name2 are equal.
- *\li dns_namereln_commonancestor name1 and name2 share a common
- * ancestor.
- */
-
-int
-dns_name_compare(const dns_name_t *name1, const dns_name_t *name2);
-/*%<
- * Determine the relative ordering under the DNSSEC order relation of
- * 'name1' and 'name2'.
- *
- * Note: It makes no sense for one of the names to be relative and the
- * other absolute. If both names are relative, then to be meaningfully
- * compared the caller must ensure that they are both relative to the
- * same domain.
- *
- * Requires:
- * \li 'name1' is a valid name
- *
- * \li 'name2' is a valid name
- *
- * \li Either name1 is absolute and name2 is absolute, or neither is.
- *
- * Returns:
- * \li < 0 'name1' is less than 'name2'
- * \li 0 'name1' is equal to 'name2'
- * \li > 0 'name1' is greater than 'name2'
- */
-
-isc_boolean_t
-dns_name_equal(const dns_name_t *name1, const dns_name_t *name2);
-/*%<
- * Are 'name1' and 'name2' equal?
- *
- * Notes:
- * \li Because it only needs to test for equality, dns_name_equal() can be
- * significantly faster than dns_name_fullcompare() or dns_name_compare().
- *
- * \li Offsets tables are not used in the comparision.
- *
- * \li It makes no sense for one of the names to be relative and the
- * other absolute. If both names are relative, then to be meaningfully
- * compared the caller must ensure that they are both relative to the
- * same domain.
- *
- * Requires:
- * \li 'name1' is a valid name
- *
- * \li 'name2' is a valid name
- *
- * \li Either name1 is absolute and name2 is absolute, or neither is.
- *
- * Returns:
- * \li ISC_TRUE 'name1' and 'name2' are equal
- * \li ISC_FALSE 'name1' and 'name2' are not equal
- */
-
-isc_boolean_t
-dns_name_caseequal(const dns_name_t *name1, const dns_name_t *name2);
-/*%<
- * Case sensitive version of dns_name_equal().
- */
-
-int
-dns_name_rdatacompare(const dns_name_t *name1, const dns_name_t *name2);
-/*%<
- * Compare two names as if they are part of rdata in DNSSEC canonical
- * form.
- *
- * Requires:
- * \li 'name1' is a valid absolute name
- *
- * \li dns_name_countlabels(name1) > 0
- *
- * \li 'name2' is a valid absolute name
- *
- * \li dns_name_countlabels(name2) > 0
- *
- * Returns:
- * \li < 0 'name1' is less than 'name2'
- * \li 0 'name1' is equal to 'name2'
- * \li > 0 'name1' is greater than 'name2'
- */
-
-isc_boolean_t
-dns_name_issubdomain(const dns_name_t *name1, const dns_name_t *name2);
-/*%<
- * Is 'name1' a subdomain of 'name2'?
- *
- * Notes:
- * \li name1 is a subdomain of name2 if name1 is contained in name2, or
- * name1 equals name2.
- *
- * \li It makes no sense for one of the names to be relative and the
- * other absolute. If both names are relative, then to be meaningfully
- * compared the caller must ensure that they are both relative to the
- * same domain.
- *
- * Requires:
- * \li 'name1' is a valid name
- *
- * \li 'name2' is a valid name
- *
- * \li Either name1 is absolute and name2 is absolute, or neither is.
- *
- * Returns:
- * \li TRUE 'name1' is a subdomain of 'name2'
- * \li FALSE 'name1' is not a subdomain of 'name2'
- */
-
-isc_boolean_t
-dns_name_matcheswildcard(const dns_name_t *name, const dns_name_t *wname);
-/*%<
- * Does 'name' match the wildcard specified in 'wname'?
- *
- * Notes:
- * \li name matches the wildcard specified in wname if all labels
- * following the wildcard in wname are identical to the same number
- * of labels at the end of name.
- *
- * \li It makes no sense for one of the names to be relative and the
- * other absolute. If both names are relative, then to be meaningfully
- * compared the caller must ensure that they are both relative to the
- * same domain.
- *
- * Requires:
- * \li 'name' is a valid name
- *
- * \li dns_name_countlabels(name) > 0
- *
- * \li 'wname' is a valid name
- *
- * \li dns_name_countlabels(wname) > 0
- *
- * \li dns_name_iswildcard(wname) is true
- *
- * \li Either name is absolute and wname is absolute, or neither is.
- *
- * Returns:
- * \li TRUE 'name' matches the wildcard specified in 'wname'
- * \li FALSE 'name' does not match the wildcard specified in 'wname'
- */
-
-/***
- *** Labels
- ***/
-
-unsigned int
-dns_name_countlabels(const dns_name_t *name);
-/*%<
- * How many labels does 'name' have?
- *
- * Notes:
- * \li In this case, as in other places, a 'label' is an ordinary label.
- *
- * Requires:
- * \li 'name' is a valid name
- *
- * Ensures:
- * \li The result is <= 128.
- *
- * Returns:
- * \li The number of labels in 'name'.
- */
-
-void
-dns_name_getlabel(const dns_name_t *name, unsigned int n, dns_label_t *label);
-/*%<
- * Make 'label' refer to the 'n'th least significant label of 'name'.
- *
- * Notes:
- * \li Numbering starts at 0.
- *
- * \li Given "rc.vix.com.", the label 0 is "rc", and label 3 is the
- * root label.
- *
- * \li 'label' refers to the same memory as 'name', so 'name' must not
- * be changed while 'label' is still in use.
- *
- * Requires:
- * \li n < dns_name_countlabels(name)
- */
-
-void
-dns_name_getlabelsequence(const dns_name_t *source, unsigned int first,
- unsigned int n, dns_name_t *target);
-/*%<
- * Make 'target' refer to the 'n' labels including and following 'first'
- * in 'source'.
- *
- * Notes:
- * \li Numbering starts at 0.
- *
- * \li Given "rc.vix.com.", the label 0 is "rc", and label 3 is the
- * root label.
- *
- * \li 'target' refers to the same memory as 'source', so 'source'
- * must not be changed while 'target' is still in use.
- *
- * Requires:
- * \li 'source' and 'target' are valid names.
- *
- * \li first < dns_name_countlabels(name)
- *
- * \li first + n <= dns_name_countlabels(name)
- */
-
-
-void
-dns_name_clone(const dns_name_t *source, dns_name_t *target);
-/*%<
- * Make 'target' refer to the same name as 'source'.
- *
- * Notes:
- *
- * \li 'target' refers to the same memory as 'source', so 'source'
- * must not be changed while 'target' is still in use.
- *
- * \li This call is functionally equivalent to:
- *
- * \code
- * dns_name_getlabelsequence(source, 0,
- * dns_name_countlabels(source),
- * target);
- * \endcode
- *
- * but is more efficient. Also, dns_name_clone() works even if 'source'
- * is empty.
- *
- * Requires:
- *
- * \li 'source' is a valid name.
- *
- * \li 'target' is a valid name that is not read-only.
- */
-
-/***
- *** Conversions
- ***/
-
-void
-dns_name_fromregion(dns_name_t *name, const isc_region_t *r);
-/*%<
- * Make 'name' refer to region 'r'.
- *
- * Note:
- * \li If the conversion encounters a root label before the end of the
- * region the conversion stops and the length is set to the length
- * so far converted. A maximum of 255 bytes is converted.
- *
- * Requires:
- * \li The data in 'r' is a sequence of one or more type 00 or type 01000001
- * labels.
- */
-
-void
-dns_name_toregion(dns_name_t *name, isc_region_t *r);
-/*%<
- * Make 'r' refer to 'name'.
- *
- * Requires:
- *
- * \li 'name' is a valid name.
- *
- * \li 'r' is a valid region.
- */
-
-isc_result_t
-dns_name_fromwire(dns_name_t *name, isc_buffer_t *source,
- dns_decompress_t *dctx, unsigned int options,
- isc_buffer_t *target);
-/*%<
- * Copy the possibly-compressed name at source (active region) into target,
- * decompressing it.
- *
- * Notes:
- * \li Decompression policy is controlled by 'dctx'.
- *
- * \li If DNS_NAME_DOWNCASE is set, any uppercase letters in 'source' will be
- * downcased when they are copied into 'target'.
- *
- * Security:
- *
- * \li *** WARNING ***
- *
- * \li This routine will often be used when 'source' contains raw network
- * data. A programming error in this routine could result in a denial
- * of service, or in the hijacking of the server.
- *
- * Requires:
- *
- * \li 'name' is a valid name.
- *
- * \li 'source' is a valid buffer and the first byte of the active
- * region should be the first byte of a DNS wire format domain name.
- *
- * \li 'target' is a valid buffer or 'target' is NULL and 'name' has
- * a dedicated buffer.
- *
- * \li 'dctx' is a valid decompression context.
- *
- * Ensures:
- *
- * If result is success:
- * \li If 'target' is not NULL, 'name' is attached to it.
- *
- * \li Uppercase letters are downcased in the copy iff
- * DNS_NAME_DOWNCASE is set in options.
- *
- * \li The current location in source is advanced, and the used space
- * in target is updated.
- *
- * Result:
- * \li Success
- * \li Bad Form: Label Length
- * \li Bad Form: Unknown Label Type
- * \li Bad Form: Name Length
- * \li Bad Form: Compression type not allowed
- * \li Bad Form: Bad compression pointer
- * \li Bad Form: Input too short
- * \li Resource Limit: Too many compression pointers
- * \li Resource Limit: Not enough space in buffer
- */
-
-isc_result_t
-dns_name_towire(const dns_name_t *name, dns_compress_t *cctx,
- isc_buffer_t *target);
-/*%<
- * Convert 'name' into wire format, compressing it as specified by the
- * compression context 'cctx', and storing the result in 'target'.
- *
- * Notes:
- * \li If the compression context allows global compression, then the
- * global compression table may be updated.
- *
- * Requires:
- * \li 'name' is a valid name
- *
- * \li dns_name_countlabels(name) > 0
- *
- * \li dns_name_isabsolute(name) == TRUE
- *
- * \li target is a valid buffer.
- *
- * \li Any offsets specified in a global compression table are valid
- * for buffer.
- *
- * Ensures:
- *
- * If the result is success:
- *
- * \li The used space in target is updated.
- *
- * Returns:
- * \li Success
- * \li Resource Limit: Not enough space in buffer
- */
-
-isc_result_t
-dns_name_fromtext(dns_name_t *name, isc_buffer_t *source,
- dns_name_t *origin, unsigned int options,
- isc_buffer_t *target);
-/*%<
- * Convert the textual representation of a DNS name at source
- * into uncompressed wire form stored in target.
- *
- * Notes:
- * \li Relative domain names will have 'origin' appended to them
- * unless 'origin' is NULL, in which case relative domain names
- * will remain relative.
- *
- * \li If DNS_NAME_DOWNCASE is set in 'options', any uppercase letters
- * in 'source' will be downcased when they are copied into 'target'.
- *
- * Requires:
- *
- * \li 'name' is a valid name.
- *
- * \li 'source' is a valid buffer.
- *
- * \li 'target' is a valid buffer or 'target' is NULL and 'name' has
- * a dedicated buffer.
- *
- * Ensures:
- *
- * If result is success:
- * \li If 'target' is not NULL, 'name' is attached to it.
- *
- * \li Uppercase letters are downcased in the copy iff
- * DNS_NAME_DOWNCASE is set in 'options'.
- *
- * \li The current location in source is advanced, and the used space
- * in target is updated.
- *
- * Result:
- *\li #ISC_R_SUCCESS
- *\li #DNS_R_EMPTYLABEL
- *\li #DNS_R_LABELTOOLONG
- *\li #DNS_R_BADESCAPE
- *\li (#DNS_R_BADBITSTRING: should not be returned)
- *\li (#DNS_R_BITSTRINGTOOLONG: should not be returned)
- *\li #DNS_R_BADDOTTEDQUAD
- *\li #ISC_R_NOSPACE
- *\li #ISC_R_UNEXPECTEDEND
- */
-
-isc_result_t
-dns_name_totext(dns_name_t *name, isc_boolean_t omit_final_dot,
- isc_buffer_t *target);
-/*%<
- * Convert 'name' into text format, storing the result in 'target'.
- *
- * Notes:
- *\li If 'omit_final_dot' is true, then the final '.' in absolute
- * names other than the root name will be omitted.
- *
- *\li If dns_name_countlabels == 0, the name will be "@", representing the
- * current origin as described by RFC1035.
- *
- *\li The name is not NUL terminated.
- *
- * Requires:
- *
- *\li 'name' is a valid name
- *
- *\li 'target' is a valid buffer.
- *
- *\li if dns_name_isabsolute == FALSE, then omit_final_dot == FALSE
- *
- * Ensures:
- *
- *\li If the result is success:
- * the used space in target is updated.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOSPACE
- */
-
-#define DNS_NAME_MAXTEXT 1023
-/*%<
- * The maximum length of the text representation of a domain
- * name as generated by dns_name_totext(). This does not
- * include space for a terminating NULL.
- *
- * This definition is conservative - the actual maximum
- * is 1004, derived as follows:
- *
- * A backslash-decimal escaped character takes 4 bytes.
- * A wire-encoded name can be up to 255 bytes and each
- * label is one length byte + at most 63 bytes of data.
- * Maximizing the label lengths gives us a name of
- * three 63-octet labels, one 61-octet label, and the
- * root label:
- *
- * 1 + 63 + 1 + 63 + 1 + 63 + 1 + 61 + 1 = 255
- *
- * When printed, this is (3 * 63 + 61) * 4
- * bytes for the escaped label data + 4 bytes for the
- * dot terminating each label = 1004 bytes total.
- */
-
-isc_result_t
-dns_name_tofilenametext(dns_name_t *name, isc_boolean_t omit_final_dot,
- isc_buffer_t *target);
-/*%<
- * Convert 'name' into an alternate text format appropriate for filenames,
- * storing the result in 'target'. The name data is downcased, guaranteeing
- * that the filename does not depend on the case of the converted name.
- *
- * Notes:
- *\li If 'omit_final_dot' is true, then the final '.' in absolute
- * names other than the root name will be omitted.
- *
- *\li The name is not NUL terminated.
- *
- * Requires:
- *
- *\li 'name' is a valid absolute name
- *
- *\li 'target' is a valid buffer.
- *
- * Ensures:
- *
- *\li If the result is success:
- * the used space in target is updated.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOSPACE
- */
-
-isc_result_t
-dns_name_downcase(dns_name_t *source, dns_name_t *name,
- isc_buffer_t *target);
-/*%<
- * Downcase 'source'.
- *
- * Requires:
- *
- *\li 'source' and 'name' are valid names.
- *
- *\li If source == name, then
- * 'source' must not be read-only
- *
- *\li Otherwise,
- * 'target' is a valid buffer or 'target' is NULL and
- * 'name' has a dedicated buffer.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOSPACE
- *
- * Note: if source == name, then the result will always be ISC_R_SUCCESS.
- */
-
-isc_result_t
-dns_name_concatenate(dns_name_t *prefix, dns_name_t *suffix,
- dns_name_t *name, isc_buffer_t *target);
-/*%<
- * Concatenate 'prefix' and 'suffix'.
- *
- * Requires:
- *
- *\li 'prefix' is a valid name or NULL.
- *
- *\li 'suffix' is a valid name or NULL.
- *
- *\li 'name' is a valid name or NULL.
- *
- *\li 'target' is a valid buffer or 'target' is NULL and 'name' has
- * a dedicated buffer.
- *
- *\li If 'prefix' is absolute, 'suffix' must be NULL or the empty name.
- *
- * Ensures:
- *
- *\li On success,
- * If 'target' is not NULL and 'name' is not NULL, then 'name'
- * is attached to it.
- * The used space in target is updated.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOSPACE
- *\li #DNS_R_NAMETOOLONG
- */
-
-void
-dns_name_split(dns_name_t *name, unsigned int suffixlabels,
- dns_name_t *prefix, dns_name_t *suffix);
-/*%<
- *
- * Split 'name' into two pieces on a label boundary.
- *
- * Notes:
- * \li 'name' is split such that 'suffix' holds the most significant
- * 'suffixlabels' labels. All other labels are stored in 'prefix'.
- *
- *\li Copying name data is avoided as much as possible, so 'prefix'
- * and 'suffix' will end up pointing at the data for 'name'.
- *
- *\li It is legitimate to pass a 'prefix' or 'suffix' that has
- * its name data stored someplace other than the dedicated buffer.
- * This is useful to avoid name copying in the calling function.
- *
- *\li It is also legitimate to pass a 'prefix' or 'suffix' that is
- * the same dns_name_t as 'name'.
- *
- * Requires:
- *\li 'name' is a valid name.
- *
- *\li 'suffixlabels' cannot exceed the number of labels in 'name'.
- *
- * \li 'prefix' is a valid name or NULL, and cannot be read-only.
- *
- *\li 'suffix' is a valid name or NULL, and cannot be read-only.
- *
- *\li If non-NULL, 'prefix' and 'suffix' must have dedicated buffers.
- *
- *\li 'prefix' and 'suffix' cannot point to the same buffer.
- *
- * Ensures:
- *
- *\li On success:
- * If 'prefix' is not NULL it will contain the least significant
- * labels.
- * If 'suffix' is not NULL it will contain the most significant
- * labels. dns_name_countlabels(suffix) will be equal to
- * suffixlabels.
- *
- *\li On failure:
- * Either 'prefix' or 'suffix' is invalidated (depending
- * on which one the problem was encountered with).
- *
- * Returns:
- *\li #ISC_R_SUCCESS No worries. (This function should always success).
- */
-
-isc_result_t
-dns_name_dup(const dns_name_t *source, isc_mem_t *mctx,
- dns_name_t *target);
-/*%<
- * Make 'target' a dynamically allocated copy of 'source'.
- *
- * Requires:
- *
- *\li 'source' is a valid non-empty name.
- *
- *\li 'target' is a valid name that is not read-only.
- *
- *\li 'mctx' is a valid memory context.
- */
-
-isc_result_t
-dns_name_dupwithoffsets(dns_name_t *source, isc_mem_t *mctx,
- dns_name_t *target);
-/*%<
- * Make 'target' a read-only dynamically allocated copy of 'source'.
- * 'target' will also have a dynamically allocated offsets table.
- *
- * Requires:
- *
- *\li 'source' is a valid non-empty name.
- *
- *\li 'target' is a valid name that is not read-only.
- *
- *\li 'target' has no offsets table.
- *
- *\li 'mctx' is a valid memory context.
- */
-
-void
-dns_name_free(dns_name_t *name, isc_mem_t *mctx);
-/*%<
- * Free 'name'.
- *
- * Requires:
- *
- *\li 'name' is a valid name created previously in 'mctx' by dns_name_dup().
- *
- *\li 'mctx' is a valid memory context.
- *
- * Ensures:
- *
- *\li All dynamic resources used by 'name' are freed and the name is
- * invalidated.
- */
-
-isc_result_t
-dns_name_digest(dns_name_t *name, dns_digestfunc_t digest, void *arg);
-/*%<
- * Send 'name' in DNSSEC canonical form to 'digest'.
- *
- * Requires:
- *
- *\li 'name' is a valid name.
- *
- *\li 'digest' is a valid dns_digestfunc_t.
- *
- * Ensures:
- *
- *\li If successful, the DNSSEC canonical form of 'name' will have been
- * sent to 'digest'.
- *
- *\li If digest() returns something other than ISC_R_SUCCESS, that result
- * will be returned as the result of dns_name_digest().
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *
- *\li Many other results are possible if not successful.
- *
- */
-
-isc_boolean_t
-dns_name_dynamic(dns_name_t *name);
-/*%<
- * Returns whether there is dynamic memory associated with this name.
- *
- * Requires:
- *
- *\li 'name' is a valid name.
- *
- * Returns:
- *
- *\li 'ISC_TRUE' if the name is dynamic otherwise 'ISC_FALSE'.
- */
-
-isc_result_t
-dns_name_print(dns_name_t *name, FILE *stream);
-/*%<
- * Print 'name' on 'stream'.
- *
- * Requires:
- *
- *\li 'name' is a valid name.
- *
- *\li 'stream' is a valid stream.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *
- *\li Any error that dns_name_totext() can return.
- */
-
-void
-dns_name_format(dns_name_t *name, char *cp, unsigned int size);
-/*%<
- * Format 'name' as text appropriate for use in log messages.
- *
- * Store the formatted name at 'cp', writing no more than
- * 'size' bytes. The resulting string is guaranteed to be
- * null terminated.
- *
- * The formatted name will have a terminating dot only if it is
- * the root.
- *
- * This function cannot fail, instead any errors are indicated
- * in the returned text.
- *
- * Requires:
- *
- *\li 'name' is a valid name.
- *
- *\li 'cp' points a valid character array of size 'size'.
- *
- *\li 'size' > 0.
- *
- */
-
-isc_result_t
-dns_name_settotextfilter(dns_name_totextfilter_t proc);
-/*%<
- * Set / clear a thread specific function 'proc' to be called at the
- * end of dns_name_totext().
- *
- * Note: Under Windows you need to call "dns_name_settotextfilter(NULL);"
- * prior to exiting the thread otherwise memory will be leaked.
- * For other platforms, which are pthreads based, this is still a good
- * idea but not required.
- *
- * Returns
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_UNEXPECTED
- */
-
-#define DNS_NAME_FORMATSIZE (DNS_NAME_MAXTEXT + 1)
-/*%<
- * Suggested size of buffer passed to dns_name_format().
- * Includes space for the terminating NULL.
- */
-
-isc_result_t
-dns_name_copy(dns_name_t *source, dns_name_t *dest, isc_buffer_t *target);
-/*%<
- * Makes 'dest' refer to a copy of the name in 'source'. The data are
- * either copied to 'target' or the dedicated buffer in 'dest'.
- *
- * Requires:
- * \li 'source' is a valid name.
- *
- * \li 'dest' is an initialized name with a dedicated buffer.
- *
- * \li 'target' is NULL or an initialized buffer.
- *
- * \li Either dest has a dedicated buffer or target != NULL.
- *
- * Ensures:
- *
- *\li On success, the used space in target is updated.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOSPACE
- */
-
-isc_boolean_t
-dns_name_ishostname(const dns_name_t *name, isc_boolean_t wildcard);
-/*%<
- * Return if 'name' is a valid hostname. RFC 952 / RFC 1123.
- * If 'wildcard' is ISC_TRUE then allow the first label of name to
- * be a wildcard.
- * The root is also accepted.
- *
- * Requires:
- * 'name' to be valid.
- */
-
-
-isc_boolean_t
-dns_name_ismailbox(const dns_name_t *name);
-/*%<
- * Return if 'name' is a valid mailbox. RFC 821.
- *
- * Requires:
- * \li 'name' to be valid.
- */
-
-isc_boolean_t
-dns_name_internalwildcard(const dns_name_t *name);
-/*%<
- * Return if 'name' contains a internal wildcard name.
- *
- * Requires:
- * \li 'name' to be valid.
- */
-
-void
-dns_name_destroy(void);
-/*%<
- * Cleanup dns_name_settotextfilter() / dns_name_totext() state.
- *
- * This should be called as part of the final cleanup process.
- *
- * Note: dns_name_settotextfilter(NULL); should be called for all
- * threads which have called dns_name_settotextfilter() with a
- * non-NULL argument prior to calling dns_name_destroy();
- */
-
-ISC_LANG_ENDDECLS
-
-/*
- *** High Performance Macros
- ***/
-
-/*
- * WARNING: Use of these macros by applications may require recompilation
- * of the application in some situations where calling the function
- * would not.
- *
- * WARNING: No assertion checking is done for these macros.
- */
-
-#define DNS_NAME_INIT(n, o) \
-do { \
- (n)->magic = DNS_NAME_MAGIC; \
- (n)->ndata = NULL; \
- (n)->length = 0; \
- (n)->labels = 0; \
- (n)->attributes = 0; \
- (n)->offsets = (o); \
- (n)->buffer = NULL; \
- ISC_LINK_INIT((n), link); \
- ISC_LIST_INIT((n)->list); \
-} while (0)
-
-#define DNS_NAME_RESET(n) \
-do { \
- (n)->ndata = NULL; \
- (n)->length = 0; \
- (n)->labels = 0; \
- (n)->attributes &= ~DNS_NAMEATTR_ABSOLUTE; \
- if ((n)->buffer != NULL) \
- isc_buffer_clear((n)->buffer); \
-} while (0)
-
-#define DNS_NAME_SETBUFFER(n, b) \
- (n)->buffer = (b)
-
-#define DNS_NAME_ISABSOLUTE(n) \
- (((n)->attributes & DNS_NAMEATTR_ABSOLUTE) != 0 ? ISC_TRUE : ISC_FALSE)
-
-#define DNS_NAME_COUNTLABELS(n) \
- ((n)->labels)
-
-#define DNS_NAME_TOREGION(n, r) \
-do { \
- (r)->base = (n)->ndata; \
- (r)->length = (n)->length; \
-} while (0)
-
-#define DNS_NAME_SPLIT(n, l, p, s) \
-do { \
- dns_name_t *_n = (n); \
- dns_name_t *_p = (p); \
- dns_name_t *_s = (s); \
- unsigned int _l = (l); \
- if (_p != NULL) \
- dns_name_getlabelsequence(_n, 0, _n->labels - _l, _p); \
- if (_s != NULL) \
- dns_name_getlabelsequence(_n, _n->labels - _l, _l, _s); \
-} while (0)
-
-#ifdef DNS_NAME_USEINLINE
-
-#define dns_name_init(n, o) DNS_NAME_INIT(n, o)
-#define dns_name_reset(n) DNS_NAME_RESET(n)
-#define dns_name_setbuffer(n, b) DNS_NAME_SETBUFFER(n, b)
-#define dns_name_countlabels(n) DNS_NAME_COUNTLABELS(n)
-#define dns_name_isabsolute(n) DNS_NAME_ISABSOLUTE(n)
-#define dns_name_toregion(n, r) DNS_NAME_TOREGION(n, r)
-#define dns_name_split(n, l, p, s) DNS_NAME_SPLIT(n, l, p, s)
-
-#endif /* DNS_NAME_USEINLINE */
-
-#endif /* DNS_NAME_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: ncache.h,v 1.25 2008/09/25 04:02:39 tbox Exp $ */
-
-#ifndef DNS_NCACHE_H
-#define DNS_NCACHE_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/ncache.h
- *\brief
- * DNS Ncache
- *
- * XXX TBS XXX
- *
- * MP:
- *\li The caller must ensure any required synchronization.
- *
- * Reliability:
- *\li No anticipated impact.
- *
- * Resources:
- *\li TBS
- *
- * Security:
- *\li No anticipated impact.
- *
- * Standards:
- *\li RFC2308
- */
-
-#include <isc/lang.h>
-#include <isc/stdtime.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/*%
- * _OMITDNSSEC:
- * Omit DNSSEC records when rendering.
- */
-#define DNS_NCACHETOWIRE_OMITDNSSEC 0x0001
-
-isc_result_t
-dns_ncache_add(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node,
- dns_rdatatype_t covers, isc_stdtime_t now, dns_ttl_t minttl, dns_ttl_t maxttl,
- dns_rdataset_t *addedrdataset);
-isc_result_t
-dns_ncache_addoptout(dns_message_t *message, dns_db_t *cache,
- dns_dbnode_t *node, dns_rdatatype_t covers,
- isc_stdtime_t now, dns_ttl_t minttl, dns_ttl_t maxttl,
- isc_boolean_t optout, dns_rdataset_t *addedrdataset);
-/*%<
- * Convert the authority data from 'message' into a negative cache
- * rdataset, and store it in 'cache' at 'node' with a TTL limited to
- * 'maxttl'.
- *
- * The 'covers' argument is the RR type whose nonexistence we are caching,
- * or dns_rdatatype_any when caching a NXDOMAIN response.
- *
- * 'optout' indicates a DNS_RATASETATTR_OPTOUT should be set.
- *
- * Note:
- *\li If 'addedrdataset' is not NULL, then it will be attached to the added
- * rdataset. See dns_db_addrdataset() for more details.
- *
- * Requires:
- *\li 'message' is a valid message with a properly formatting negative cache
- * authority section.
- *
- *\li The requirements of dns_db_addrdataset() apply to 'cache', 'node',
- * 'now', and 'addedrdataset'.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOSPACE
- *
- *\li Any result code of dns_db_addrdataset() is a possible result code
- * of dns_ncache_add().
- */
-
-isc_result_t
-dns_ncache_towire(dns_rdataset_t *rdataset, dns_compress_t *cctx,
- isc_buffer_t *target, unsigned int options,
- unsigned int *countp);
-/*%<
- * Convert the negative caching rdataset 'rdataset' to wire format,
- * compressing names as specified in 'cctx', and storing the result in
- * 'target'. If 'omit_dnssec' is set, DNSSEC records will not
- * be added to 'target'.
- *
- * Notes:
- *\li The number of RRs added to target will be added to *countp.
- *
- * Requires:
- *\li 'rdataset' is a valid negative caching rdataset.
- *
- *\li 'rdataset' is not empty.
- *
- *\li 'countp' is a valid pointer.
- *
- * Ensures:
- *\li On a return of ISC_R_SUCCESS, 'target' contains a wire format
- * for the data contained in 'rdataset'. Any error return leaves
- * the buffer unchanged.
- *
- *\li *countp has been incremented by the number of RRs added to
- * target.
- *
- * Returns:
- *\li #ISC_R_SUCCESS - all ok
- *\li #ISC_R_NOSPACE - 'target' doesn't have enough room
- *
- *\li Any error returned by dns_rdata_towire(), dns_rdataset_next(),
- * dns_name_towire().
- */
-
-isc_result_t
-dns_ncache_getrdataset(dns_rdataset_t *ncacherdataset, dns_name_t *name,
- dns_rdatatype_t type, dns_rdataset_t *rdataset);
-/*%<
- * Search the negative caching rdataset for an rdataset with the
- * specified name and type.
- *
- * Requires:
- *\li 'ncacherdataset' is a valid negative caching rdataset.
- *
- *\li 'ncacherdataset' is not empty.
- *
- *\li 'name' is a valid name.
- *
- *\li 'type' is not SIG, or a meta-RR type.
- *
- *\li 'rdataset' is a valid disassociated rdataset.
- *
- * Ensures:
- *\li On a return of ISC_R_SUCCESS, 'rdataset' is bound to the found
- * rdataset.
- *
- * Returns:
- *\li #ISC_R_SUCCESS - the rdataset was found.
- *\li #ISC_R_NOTFOUND - the rdataset was not found.
- *
- */
-
-void
-dns_ncache_current(dns_rdataset_t *ncacherdataset, dns_name_t *found,
- dns_rdataset_t *rdataset);
-
-/*%<
- * Extract the current rdataset and name from a ncache entry.
- *
- * Requires:
- * \li 'ncacherdataset' to be valid and to be a negative cache entry
- * \li 'found' to be valid.
- * \li 'rdataset' to be unassociated.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_NCACHE_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001, 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: nsec.h,v 1.12 2008/09/25 04:02:39 tbox Exp $ */
-
-#ifndef DNS_NSEC_H
-#define DNS_NSEC_H 1
-
-/*! \file dns/nsec.h */
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-#include <dns/name.h>
-
-#define DNS_NSEC_BUFFERSIZE (DNS_NAME_MAXWIRE + 8192 + 512)
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_nsec_buildrdata(dns_db_t *db, dns_dbversion_t *version,
- dns_dbnode_t *node, dns_name_t *target,
- unsigned char *buffer, dns_rdata_t *rdata);
-/*%<
- * Build the rdata of a NSEC record.
- *
- * Requires:
- *\li buffer Points to a temporary buffer of at least
- * DNS_NSEC_BUFFERSIZE bytes.
- *\li rdata Points to an initialized dns_rdata_t.
- *
- * Ensures:
- * \li *rdata Contains a valid NSEC rdata. The 'data' member refers
- * to 'buffer'.
- */
-
-isc_result_t
-dns_nsec_build(dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node,
- dns_name_t *target, dns_ttl_t ttl);
-/*%<
- * Build a NSEC record and add it to a database.
- */
-
-isc_boolean_t
-dns_nsec_typepresent(dns_rdata_t *nsec, dns_rdatatype_t type);
-/*%<
- * Determine if a type is marked as present in an NSEC record.
- *
- * Requires:
- *\li 'nsec' points to a valid rdataset of type NSEC
- */
-
-isc_result_t
-dns_nsec_nseconly(dns_db_t *db, dns_dbversion_t *version,
- isc_boolean_t *answer);
-/*
- * Report whether the DNSKEY RRset has a NSEC only algorithm. Unknown
- * algorithms are assumed to support NSEC3.
- *
- * Requires:
- * 'answer' to be non NULL.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_NSEC_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001, 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: peer.h,v 1.33.118.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef DNS_PEER_H
-#define DNS_PEER_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/peer.h
- * \brief
- * Data structures for peers (e.g. a 'server' config file statement)
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-#include <isc/magic.h>
-#include <isc/netaddr.h>
-
-#include <dns/types.h>
-
-#define DNS_PEERLIST_MAGIC ISC_MAGIC('s','e','R','L')
-#define DNS_PEER_MAGIC ISC_MAGIC('S','E','r','v')
-
-#define DNS_PEERLIST_VALID(ptr) ISC_MAGIC_VALID(ptr, DNS_PEERLIST_MAGIC)
-#define DNS_PEER_VALID(ptr) ISC_MAGIC_VALID(ptr, DNS_PEER_MAGIC)
-
-/***
- *** Types
- ***/
-
-struct dns_peerlist {
- unsigned int magic;
- isc_uint32_t refs;
-
- isc_mem_t *mem;
-
- ISC_LIST(dns_peer_t) elements;
-};
-
-struct dns_peer {
- unsigned int magic;
- isc_uint32_t refs;
-
- isc_mem_t *mem;
-
- isc_netaddr_t address;
- unsigned int prefixlen;
- isc_boolean_t bogus;
- dns_transfer_format_t transfer_format;
- isc_uint32_t transfers;
- isc_boolean_t support_ixfr;
- isc_boolean_t provide_ixfr;
- isc_boolean_t request_ixfr;
- isc_boolean_t support_edns;
- isc_boolean_t request_nsid;
- dns_name_t *key;
- isc_sockaddr_t *transfer_source;
- isc_sockaddr_t *notify_source;
- isc_sockaddr_t *query_source;
- isc_uint16_t udpsize; /* receive size */
- isc_uint16_t maxudp; /* transmit size */
-
- isc_uint32_t bitflags;
-
- ISC_LINK(dns_peer_t) next;
-};
-
-/***
- *** Functions
- ***/
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_peerlist_new(isc_mem_t *mem, dns_peerlist_t **list);
-
-void
-dns_peerlist_attach(dns_peerlist_t *source, dns_peerlist_t **target);
-
-void
-dns_peerlist_detach(dns_peerlist_t **list);
-
-/*
- * After return caller still holds a reference to peer.
- */
-void
-dns_peerlist_addpeer(dns_peerlist_t *peers, dns_peer_t *peer);
-
-/*
- * Ditto. */
-isc_result_t
-dns_peerlist_peerbyaddr(dns_peerlist_t *peers, isc_netaddr_t *addr,
- dns_peer_t **retval);
-
-/*
- * What he said.
- */
-isc_result_t
-dns_peerlist_currpeer(dns_peerlist_t *peers, dns_peer_t **retval);
-
-isc_result_t
-dns_peer_new(isc_mem_t *mem, isc_netaddr_t *ipaddr, dns_peer_t **peer);
-
-isc_result_t
-dns_peer_newprefix(isc_mem_t *mem, isc_netaddr_t *ipaddr,
- unsigned int prefixlen, dns_peer_t **peer);
-
-void
-dns_peer_attach(dns_peer_t *source, dns_peer_t **target);
-
-void
-dns_peer_detach(dns_peer_t **list);
-
-isc_result_t
-dns_peer_setbogus(dns_peer_t *peer, isc_boolean_t newval);
-
-isc_result_t
-dns_peer_getbogus(dns_peer_t *peer, isc_boolean_t *retval);
-
-isc_result_t
-dns_peer_setrequestixfr(dns_peer_t *peer, isc_boolean_t newval);
-
-isc_result_t
-dns_peer_getrequestixfr(dns_peer_t *peer, isc_boolean_t *retval);
-
-isc_result_t
-dns_peer_setprovideixfr(dns_peer_t *peer, isc_boolean_t newval);
-
-isc_result_t
-dns_peer_getprovideixfr(dns_peer_t *peer, isc_boolean_t *retval);
-
-isc_result_t
-dns_peer_setrequestnsid(dns_peer_t *peer, isc_boolean_t newval);
-
-isc_result_t
-dns_peer_getrequestnsid(dns_peer_t *peer, isc_boolean_t *retval);
-
-isc_result_t
-dns_peer_setsupportedns(dns_peer_t *peer, isc_boolean_t newval);
-
-isc_result_t
-dns_peer_getsupportedns(dns_peer_t *peer, isc_boolean_t *retval);
-
-isc_result_t
-dns_peer_settransfers(dns_peer_t *peer, isc_uint32_t newval);
-
-isc_result_t
-dns_peer_gettransfers(dns_peer_t *peer, isc_uint32_t *retval);
-
-isc_result_t
-dns_peer_settransferformat(dns_peer_t *peer, dns_transfer_format_t newval);
-
-isc_result_t
-dns_peer_gettransferformat(dns_peer_t *peer, dns_transfer_format_t *retval);
-
-isc_result_t
-dns_peer_setkeybycharp(dns_peer_t *peer, const char *keyval);
-
-isc_result_t
-dns_peer_getkey(dns_peer_t *peer, dns_name_t **retval);
-
-isc_result_t
-dns_peer_setkey(dns_peer_t *peer, dns_name_t **keyval);
-
-isc_result_t
-dns_peer_settransfersource(dns_peer_t *peer,
- const isc_sockaddr_t *transfer_source);
-
-isc_result_t
-dns_peer_gettransfersource(dns_peer_t *peer, isc_sockaddr_t *transfer_source);
-
-isc_result_t
-dns_peer_setudpsize(dns_peer_t *peer, isc_uint16_t udpsize);
-
-isc_result_t
-dns_peer_getudpsize(dns_peer_t *peer, isc_uint16_t *udpsize);
-
-isc_result_t
-dns_peer_setmaxudp(dns_peer_t *peer, isc_uint16_t maxudp);
-
-isc_result_t
-dns_peer_getmaxudp(dns_peer_t *peer, isc_uint16_t *maxudp);
-
-isc_result_t
-dns_peer_setnotifysource(dns_peer_t *peer, const isc_sockaddr_t *notify_source);
-
-isc_result_t
-dns_peer_getnotifysource(dns_peer_t *peer, isc_sockaddr_t *notify_source);
-
-isc_result_t
-dns_peer_setquerysource(dns_peer_t *peer, const isc_sockaddr_t *query_source);
-
-isc_result_t
-dns_peer_getquerysource(dns_peer_t *peer, isc_sockaddr_t *query_source);
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_PEER_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: portlist.h,v 1.9 2007/06/19 23:47:17 tbox Exp $ */
-
-/*! \file dns/portlist.h */
-
-#include <isc/lang.h>
-#include <isc/net.h>
-#include <isc/types.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_portlist_create(isc_mem_t *mctx, dns_portlist_t **portlistp);
-/*%<
- * Create a port list.
- *
- * Requires:
- *\li 'mctx' to be valid.
- *\li 'portlistp' to be non NULL and '*portlistp' to be NULL;
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_UNEXPECTED
- */
-
-isc_result_t
-dns_portlist_add(dns_portlist_t *portlist, int af, in_port_t port);
-/*%<
- * Add the given <port,af> tuple to the portlist.
- *
- * Requires:
- *\li 'portlist' to be valid.
- *\li 'af' to be AF_INET or AF_INET6
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- */
-
-void
-dns_portlist_remove(dns_portlist_t *portlist, int af, in_port_t port);
-/*%<
- * Remove the given <port,af> tuple to the portlist.
- *
- * Requires:
- *\li 'portlist' to be valid.
- *\li 'af' to be AF_INET or AF_INET6
- */
-
-isc_boolean_t
-dns_portlist_match(dns_portlist_t *portlist, int af, in_port_t port);
-/*%<
- * Find the given <port,af> tuple to the portlist.
- *
- * Requires:
- *\li 'portlist' to be valid.
- *\li 'af' to be AF_INET or AF_INET6
- *
- * Returns
- * \li #ISC_TRUE if the tuple is found, ISC_FALSE otherwise.
- */
-
-void
-dns_portlist_attach(dns_portlist_t *portlist, dns_portlist_t **portlistp);
-/*%<
- * Attach to a port list.
- *
- * Requires:
- *\li 'portlist' to be valid.
- *\li 'portlistp' to be non NULL and '*portlistp' to be NULL;
- */
-
-void
-dns_portlist_detach(dns_portlist_t **portlistp);
-/*%<
- * Detach from a port list.
- *
- * Requires:
- *\li '*portlistp' to be valid.
- */
-
-ISC_LANG_ENDDECLS
+++ /dev/null
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: rbt.h,v 1.71.48.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef DNS_RBT_H
-#define DNS_RBT_H 1
-
-/*! \file dns/rbt.h */
-
-#include <isc/lang.h>
-#include <isc/magic.h>
-#include <isc/refcount.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-#define DNS_RBT_USEHASH 1
-
-/*@{*/
-/*%
- * Option values for dns_rbt_findnode() and dns_rbt_findname().
- * These are used to form a bitmask.
- */
-#define DNS_RBTFIND_NOOPTIONS 0x00
-#define DNS_RBTFIND_EMPTYDATA 0x01
-#define DNS_RBTFIND_NOEXACT 0x02
-#define DNS_RBTFIND_NOPREDECESSOR 0x04
-/*@}*/
-
-#ifndef DNS_RBT_USEISCREFCOUNT
-#ifdef ISC_REFCOUNT_HAVEATOMIC
-#define DNS_RBT_USEISCREFCOUNT 1
-#endif
-#endif
-
-/*
- * These should add up to 30.
- */
-#define DNS_RBT_LOCKLENGTH 10
-#define DNS_RBT_REFLENGTH 20
-
-#define DNS_RBTNODE_MAGIC ISC_MAGIC('R','B','N','O')
-#if DNS_RBT_USEMAGIC
-#define DNS_RBTNODE_VALID(n) ISC_MAGIC_VALID(n, DNS_RBTNODE_MAGIC)
-#else
-#define DNS_RBTNODE_VALID(n) ISC_TRUE
-#endif
-
-/*%
- * This is the structure that is used for each node in the red/black
- * tree of trees. NOTE WELL: the implementation manages this as a variable
- * length structure, with the actual wire-format name and other data
- * appended to this structure. Allocating a contiguous block of memory for
- * multiple dns_rbtnode structures will not work.
- */
-typedef struct dns_rbtnode dns_rbtnode_t;
-struct dns_rbtnode {
-#if DNS_RBT_USEMAGIC
- unsigned int magic;
-#endif
- dns_rbtnode_t *parent;
- dns_rbtnode_t *left;
- dns_rbtnode_t *right;
- dns_rbtnode_t *down;
-#ifdef DNS_RBT_USEHASH
- dns_rbtnode_t *hashnext;
-#endif
-
- /*%
- * Used for LRU cache. This linked list is used to mark nodes which
- * have no data any longer, but we cannot unlink at that exact moment
- * because we did not or could not obtain a write lock on the tree.
- */
- ISC_LINK(dns_rbtnode_t) deadlink;
-
- /*@{*/
- /*!
- * The following bitfields add up to a total bitwidth of 32.
- * The range of values necessary for each item is indicated,
- * but in the case of "attributes" the field is wider to accommodate
- * possible future expansion. "offsetlen" could be one bit
- * narrower by always adjusting its value by 1 to find the real
- * offsetlen, but doing so does not gain anything (except perhaps
- * another bit for "attributes", which doesn't yet need any more).
- *
- * In each case below the "range" indicated is what's _necessary_ for
- * the bitfield to hold, not what it actually _can_ hold.
- */
- unsigned int is_root : 1; /*%< range is 0..1 */
- unsigned int color : 1; /*%< range is 0..1 */
- unsigned int find_callback : 1; /*%< range is 0..1 */
- unsigned int attributes : 3; /*%< range is 0..2 */
- unsigned int nsec3 : 1; /*%< range is 0..1 */
- unsigned int namelen : 8; /*%< range is 1..255 */
- unsigned int offsetlen : 8; /*%< range is 1..128 */
- unsigned int padbytes : 9; /*%< range is 0..380 */
- /*@}*/
-
-#ifdef DNS_RBT_USEHASH
- unsigned int hashval;
-#endif
-
- /*@{*/
- /*!
- * These values are used in the RBT DB implementation. The appropriate
- * node lock must be held before accessing them.
- */
- void *data;
- unsigned int dirty:1;
- unsigned int wild:1;
- unsigned int locknum:DNS_RBT_LOCKLENGTH;
-#ifndef DNS_RBT_USEISCREFCOUNT
- unsigned int references:DNS_RBT_REFLENGTH;
-#else
- isc_refcount_t references; /* note that this is not in the bitfield */
-#endif
- /*@}*/
-};
-
-typedef isc_result_t (*dns_rbtfindcallback_t)(dns_rbtnode_t *node,
- dns_name_t *name,
- void *callback_arg);
-
-/*****
- ***** Chain Info
- *****/
-
-/*!
- * A chain is used to keep track of the sequence of nodes to reach any given
- * node from the root of the tree. Originally nodes did not have parent
- * pointers in them (for memory usage reasons) so there was no way to find
- * the path back to the root from any given node. Now that nodes have parent
- * pointers, chains might be going away in a future release, though the
- * movement functionality would remain.
- *
- * In any event, parent information, whether via parent pointers or chains, is
- * necessary information for iterating through the tree or for basic internal
- * tree maintenance issues (ie, the rotations that are done to rebalance the
- * tree when a node is added). The obvious implication of this is that for a
- * chain to remain valid, the tree has to be locked down against writes for the
- * duration of the useful life of the chain, because additions or removals can
- * change the path from the root to the node the chain has targeted.
- *
- * The dns_rbtnodechain_ functions _first, _last, _prev and _next all take
- * dns_name_t parameters for the name and the origin, which can be NULL. If
- * non-NULL, 'name' will end up pointing to the name data and offsets that are
- * stored at the node (and thus it will be read-only), so it should be a
- * regular dns_name_t that has been initialized with dns_name_init. When
- * 'origin' is non-NULL, it will get the name of the origin stored in it, so it
- * needs to have its own buffer space and offsets, which is most easily
- * accomplished with a dns_fixedname_t. It is _not_ necessary to reinitialize
- * either 'name' or 'origin' between calls to the chain functions.
- *
- * NOTE WELL: even though the name data at the root of the tree of trees will
- * be absolute (typically just "."), it will will be made into a relative name
- * with an origin of "." -- an empty name when the node is ".". This is
- * because a common on operation on 'name' and 'origin' is to use
- * dns_name_concatenate() on them to generate the complete name. An empty name
- * can be detected when dns_name_countlabels == 0, and is printed by
- * dns_name_totext()/dns_name_format() as "@", consistent with RFC1035's
- * definition of "@" as the current origin.
- *
- * dns_rbtnodechain_current is similar to the _first, _last, _prev and _next
- * functions but additionally can provide the node to which the chain points.
- */
-
-/*%
- * The number of level blocks to allocate at a time. Currently the maximum
- * number of levels is allocated directly in the structure, but future
- * revisions of this code might have a static initial block with dynamic
- * growth. Allocating space for 256 levels when the tree is almost never that
- * deep is wasteful, but it's not clear that it matters, since the waste is
- * only 2MB for 1000 concurrently active chains on a system with 64-bit
- * pointers.
- */
-#define DNS_RBT_LEVELBLOCK 254
-
-typedef struct dns_rbtnodechain {
- unsigned int magic;
- isc_mem_t * mctx;
- /*%
- * The terminal node of the chain. It is not in levels[].
- * This is ostensibly private ... but in a pinch it could be
- * used tell that the chain points nowhere without needing to
- * call dns_rbtnodechain_current().
- */
- dns_rbtnode_t * end;
- /*%
- * The maximum number of labels in a name is 128; bitstrings mean
- * a conceptually very large number (which I have not bothered to
- * compute) of logical levels because splitting can potentially occur
- * at each bit. However, DNSSEC restricts the number of "logical"
- * labels in a name to 255, meaning only 254 pointers are needed
- * in the worst case.
- */
- dns_rbtnode_t * levels[DNS_RBT_LEVELBLOCK];
- /*%
- * level_count indicates how deep the chain points into the
- * tree of trees, and is the index into the levels[] array.
- * Thus, levels[level_count - 1] is the last level node stored.
- * A chain that points to the top level of the tree of trees has
- * a level_count of 0, the first level has a level_count of 1, and
- * so on.
- */
- unsigned int level_count;
- /*%
- * level_matches tells how many levels matched above the node
- * returned by dns_rbt_findnode(). A match (partial or exact) found
- * in the first level thus results in level_matches being set to 1.
- * This is used by the rbtdb to set the start point for a recursive
- * search of superdomains until the RR it is looking for is found.
- */
- unsigned int level_matches;
-} dns_rbtnodechain_t;
-
-/*****
- ***** Public interfaces.
- *****/
-isc_result_t
-dns_rbt_create(isc_mem_t *mctx, void (*deleter)(void *, void *),
- void *deleter_arg, dns_rbt_t **rbtp);
-/*%<
- * Initialize a red-black tree of trees.
- *
- * Notes:
- *\li The deleter argument, if non-null, points to a function that is
- * responsible for cleaning up any memory associated with the data
- * pointer of a node when the node is deleted. It is passed the
- * deleted node's data pointer as its first argument and deleter_arg
- * as its second argument.
- *
- * Requires:
- * \li mctx is a pointer to a valid memory context.
- *\li rbtp != NULL && *rbtp == NULL
- *\li arg == NULL iff deleter == NULL
- *
- * Ensures:
- *\li If result is ISC_R_SUCCESS:
- * *rbtp points to a valid red-black tree manager
- *
- *\li If result is failure:
- * *rbtp does not point to a valid red-black tree manager.
- *
- * Returns:
- *\li #ISC_R_SUCCESS Success
- *\li #ISC_R_NOMEMORY Resource limit: Out of Memory
- */
-
-isc_result_t
-dns_rbt_addname(dns_rbt_t *rbt, dns_name_t *name, void *data);
-/*%<
- * Add 'name' to the tree of trees, associated with 'data'.
- *
- * Notes:
- *\li 'data' is never required to be non-NULL, but specifying it
- * when the name is added is faster than searching for 'name'
- * again and then setting the data pointer. The lack of a data pointer
- * for a node also has other ramifications regarding whether
- * dns_rbt_findname considers a node to exist, or dns_rbt_deletename
- * joins nodes.
- *
- * Requires:
- *\li rbt is a valid rbt manager.
- *\li dns_name_isabsolute(name) == TRUE
- *
- * Ensures:
- *\li 'name' is not altered in any way.
- *
- *\li Any external references to nodes in the tree are unaffected by
- * node splits that are necessary to insert the new name.
- *
- *\li If result is #ISC_R_SUCCESS:
- * 'name' is findable in the red/black tree of trees in O(log N).
- * The data pointer of the node for 'name' is set to 'data'.
- *
- *\li If result is #ISC_R_EXISTS or #ISC_R_NOSPACE:
- * The tree of trees is unaltered.
- *
- *\li If result is #ISC_R_NOMEMORY:
- * No guarantees.
- *
- * Returns:
- *\li #ISC_R_SUCCESS Success
- *\li #ISC_R_EXISTS The name already exists with associated data.
- *\li #ISC_R_NOSPACE The name had more logical labels than are allowed.
- *\li #ISC_R_NOMEMORY Resource Limit: Out of Memory
- */
-
-isc_result_t
-dns_rbt_addnode(dns_rbt_t *rbt, dns_name_t *name, dns_rbtnode_t **nodep);
-
-/*%<
- * Just like dns_rbt_addname, but returns the address of the node.
- *
- * Requires:
- *\li rbt is a valid rbt structure.
- *\li dns_name_isabsolute(name) == TRUE
- *\li nodep != NULL && *nodep == NULL
- *
- * Ensures:
- *\li 'name' is not altered in any way.
- *
- *\li Any external references to nodes in the tree are unaffected by
- * node splits that are necessary to insert the new name.
- *
- *\li If result is ISC_R_SUCCESS:
- * 'name' is findable in the red/black tree of trees in O(log N).
- * *nodep is the node that was added for 'name'.
- *
- *\li If result is ISC_R_EXISTS:
- * The tree of trees is unaltered.
- * *nodep is the existing node for 'name'.
- *
- *\li If result is ISC_R_NOMEMORY:
- * No guarantees.
- *
- * Returns:
- *\li #ISC_R_SUCCESS Success
- *\li #ISC_R_EXISTS The name already exists, possibly without data.
- *\li #ISC_R_NOMEMORY Resource Limit: Out of Memory
- */
-
-isc_result_t
-dns_rbt_findname(dns_rbt_t *rbt, dns_name_t *name, unsigned int options,
- dns_name_t *foundname, void **data);
-/*%<
- * Get the data pointer associated with 'name'.
- *
- * Notes:
- *\li When #DNS_RBTFIND_NOEXACT is set, the closest matching superdomain is
- * returned (also subject to #DNS_RBTFIND_EMPTYDATA), even when there is
- * an exact match in the tree.
- *
- *\li A node that has no data is considered not to exist for this function,
- * unless the #DNS_RBTFIND_EMPTYDATA option is set.
- *
- * Requires:
- *\li rbt is a valid rbt manager.
- *\li dns_name_isabsolute(name) == TRUE
- *\li data != NULL && *data == NULL
- *
- * Ensures:
- *\li 'name' and the tree are not altered in any way.
- *
- *\li If result is ISC_R_SUCCESS:
- * *data is the data associated with 'name'.
- *
- *\li If result is DNS_R_PARTIALMATCH:
- * *data is the data associated with the deepest superdomain
- * of 'name' which has data.
- *
- *\li If result is ISC_R_NOTFOUND:
- * Neither the name nor a superdomain was found with data.
- *
- * Returns:
- *\li #ISC_R_SUCCESS Success
- *\li #DNS_R_PARTIALMATCH Superdomain found with data
- *\li #ISC_R_NOTFOUND No match
- *\li #ISC_R_NOSPACE Concatenating nodes to form foundname failed
- */
-
-isc_result_t
-dns_rbt_findnode(dns_rbt_t *rbt, dns_name_t *name, dns_name_t *foundname,
- dns_rbtnode_t **node, dns_rbtnodechain_t *chain,
- unsigned int options, dns_rbtfindcallback_t callback,
- void *callback_arg);
-/*%<
- * Find the node for 'name'.
- *
- * Notes:
- *\li A node that has no data is considered not to exist for this function,
- * unless the DNS_RBTFIND_EMPTYDATA option is set. This applies to both
- * exact matches and partial matches.
- *
- *\li If the chain parameter is non-NULL, then the path through the tree
- * to the DNSSEC predecessor of the searched for name is maintained,
- * unless the DNS_RBTFIND_NOPREDECESSOR or DNS_RBTFIND_NOEXACT option
- * is used. (For more details on those options, see below.)
- *
- *\li If there is no predecessor, then the chain will point to nowhere, as
- * indicated by chain->end being NULL or dns_rbtnodechain_current
- * returning ISC_R_NOTFOUND. Note that in a normal Internet DNS RBT
- * there will always be a predecessor for all names except the root
- * name, because '.' will exist and '.' is the predecessor of
- * everything. But you can certainly construct a trivial tree and a
- * search for it that has no predecessor.
- *
- *\li Within the chain structure, the 'levels' member of the structure holds
- * the root node of each level except the first.
- *
- *\li The 'level_count' of the chain indicates how deep the chain to the
- * predecessor name is, as an index into the 'levels[]' array. It does
- * not count name elements, per se, but only levels of the tree of trees,
- * the distinction arising because multiple labels from a name can be
- * stored on only one level. It is also does not include the level
- * that has the node, since that level is not stored in levels[].
- *
- *\li The chain's 'level_matches' is not directly related to the predecessor.
- * It is the number of levels above the level of the found 'node',
- * regardless of whether it was a partial match or exact match. When
- * the node is found in the top level tree, or no node is found at all,
- * level_matches is 0.
- *
- *\li When DNS_RBTFIND_NOEXACT is set, the closest matching superdomain is
- * returned (also subject to DNS_RBTFIND_EMPTYDATA), even when
- * there is an exact match in the tree. In this case, the chain
- * will not point to the DNSSEC predecessor, but will instead point
- * to the exact match, if there was any. Thus the preceding paragraphs
- * should have "exact match" substituted for "predecessor" to describe
- * how the various elements of the chain are set. This was done to
- * ensure that the chain's state was sane, and to prevent problems that
- * occurred when running the predecessor location code under conditions
- * it was not designed for. It is not clear *where* the chain should
- * point when DNS_RBTFIND_NOEXACT is set, so if you end up using a chain
- * with this option because you want a particular node, let us know
- * where you want the chain pointed, so this can be made more firm.
- *
- * Requires:
- *\li rbt is a valid rbt manager.
- *\li dns_name_isabsolute(name) == TRUE.
- *\li node != NULL && *node == NULL.
- *\li #DNS_RBTFIND_NOEXACT and DNS_RBTFIND_NOPREDECESSOR are mutually
- * exclusive.
- *
- * Ensures:
- *\li 'name' and the tree are not altered in any way.
- *
- *\li If result is ISC_R_SUCCESS:
- *\verbatim
- * *node is the terminal node for 'name'.
-
- * 'foundname' and 'name' represent the same name (though not
- * the same memory).
-
- * 'chain' points to the DNSSEC predecessor, if any, of 'name'.
- *
- * chain->level_matches and chain->level_count are equal.
- *\endverbatim
- *
- * If result is DNS_R_PARTIALMATCH:
- *\verbatim
- * *node is the data associated with the deepest superdomain
- * of 'name' which has data.
- *
- * 'foundname' is the name of deepest superdomain (which has
- * data, unless the DNS_RBTFIND_EMPTYDATA option is set).
- *
- * 'chain' points to the DNSSEC predecessor, if any, of 'name'.
- *\endverbatim
- *
- *\li If result is ISC_R_NOTFOUND:
- *\verbatim
- * Neither the name nor a superdomain was found. *node is NULL.
- *
- * 'chain' points to the DNSSEC predecessor, if any, of 'name'.
- *
- * chain->level_matches is 0.
- *\endverbatim
- *
- * Returns:
- *\li #ISC_R_SUCCESS Success
- *\li #DNS_R_PARTIALMATCH Superdomain found with data
- *\li #ISC_R_NOTFOUND No match, or superdomain with no data
- *\li #ISC_R_NOSPACE Concatenating nodes to form foundname failed
- */
-
-isc_result_t
-dns_rbt_deletename(dns_rbt_t *rbt, dns_name_t *name, isc_boolean_t recurse);
-/*%<
- * Delete 'name' from the tree of trees.
- *
- * Notes:
- *\li When 'name' is removed, if recurse is ISC_TRUE then all of its
- * subnames are removed too.
- *
- * Requires:
- *\li rbt is a valid rbt manager.
- *\li dns_name_isabsolute(name) == TRUE
- *
- * Ensures:
- *\li 'name' is not altered in any way.
- *
- *\li Does NOT ensure that any external references to nodes in the tree
- * are unaffected by node joins.
- *
- *\li If result is ISC_R_SUCCESS:
- * 'name' does not appear in the tree with data; however,
- * the node for the name might still exist which can be
- * found with dns_rbt_findnode (but not dns_rbt_findname).
- *
- *\li If result is ISC_R_NOTFOUND:
- * 'name' does not appear in the tree with data, because
- * it did not appear in the tree before the function was called.
- *
- *\li If result is something else:
- * See result codes for dns_rbt_findnode (if it fails, the
- * node is not deleted) or dns_rbt_deletenode (if it fails,
- * the node is deleted, but the tree is not optimized when
- * it could have been).
- *
- * Returns:
- *\li #ISC_R_SUCCESS Success
- *\li #ISC_R_NOTFOUND No match
- *\li something_else Any return code from dns_rbt_findnode except
- * DNS_R_PARTIALMATCH (which causes ISC_R_NOTFOUND
- * to be returned instead), and any code from
- * dns_rbt_deletenode.
- */
-
-isc_result_t
-dns_rbt_deletenode(dns_rbt_t *rbt, dns_rbtnode_t *node, isc_boolean_t recurse);
-/*%<
- * Delete 'node' from the tree of trees.
- *
- * Notes:
- *\li When 'node' is removed, if recurse is ISC_TRUE then all nodes
- * in levels down from it are removed too.
- *
- * Requires:
- *\li rbt is a valid rbt manager.
- *\li node != NULL.
- *
- * Ensures:
- *\li Does NOT ensure that any external references to nodes in the tree
- * are unaffected by node joins.
- *
- *\li If result is ISC_R_SUCCESS:
- * 'node' does not appear in the tree with data; however,
- * the node might still exist if it serves as a pointer to
- * a lower tree level as long as 'recurse' was false, hence
- * the node could can be found with dns_rbt_findnode when
- * that function's empty_data_ok parameter is true.
- *
- *\li If result is ISC_R_NOMEMORY or ISC_R_NOSPACE:
- * The node was deleted, but the tree structure was not
- * optimized.
- *
- * Returns:
- *\li #ISC_R_SUCCESS Success
- *\li #ISC_R_NOMEMORY Resource Limit: Out of Memory when joining nodes.
- *\li #ISC_R_NOSPACE dns_name_concatenate failed when joining nodes.
- */
-
-void
-dns_rbt_namefromnode(dns_rbtnode_t *node, dns_name_t *name);
-/*%<
- * Convert the sequence of labels stored at 'node' into a 'name'.
- *
- * Notes:
- *\li This function does not return the full name, from the root, but
- * just the labels at the indicated node.
- *
- *\li The name data pointed to by 'name' is the information stored
- * in the node, not a copy. Altering the data at this pointer
- * will likely cause grief.
- *
- * Requires:
- * \li name->offsets == NULL
- *
- * Ensures:
- * \li 'name' is DNS_NAMEATTR_READONLY.
- *
- * \li 'name' will point directly to the labels stored after the
- * dns_rbtnode_t struct.
- *
- * \li 'name' will have offsets that also point to the information stored
- * as part of the node.
- */
-
-isc_result_t
-dns_rbt_fullnamefromnode(dns_rbtnode_t *node, dns_name_t *name);
-/*%<
- * Like dns_rbt_namefromnode, but returns the full name from the root.
- *
- * Notes:
- * \li Unlike dns_rbt_namefromnode, the name will not point directly
- * to node data. Rather, dns_name_concatenate will be used to copy
- * the name data from each node into the 'name' argument.
- *
- * Requires:
- * \li name != NULL
- * \li name has a dedicated buffer.
- *
- * Returns:
- * \li ISC_R_SUCCESS
- * \li ISC_R_NOSPACE (possible via dns_name_concatenate)
- * \li DNS_R_NAMETOOLONG (possible via dns_name_concatenate)
- */
-
-char *
-dns_rbt_formatnodename(dns_rbtnode_t *node, char *printname,
- unsigned int size);
-/*%<
- * Format the full name of a node for printing, using dns_name_format().
- *
- * Notes:
- * \li 'size' is the length of the printname buffer. This should be
- * DNS_NAME_FORMATSIZE or larger.
- *
- * Requires:
- * \li node and printname are not NULL.
- *
- * Returns:
- * \li The 'printname' pointer.
- */
-
-unsigned int
-dns_rbt_nodecount(dns_rbt_t *rbt);
-/*%<
- * Obtain the number of nodes in the tree of trees.
- *
- * Requires:
- * \li rbt is a valid rbt manager.
- */
-
-void
-dns_rbt_destroy(dns_rbt_t **rbtp);
-isc_result_t
-dns_rbt_destroy2(dns_rbt_t **rbtp, unsigned int quantum);
-/*%<
- * Stop working with a red-black tree of trees.
- * If 'quantum' is zero then the entire tree will be destroyed.
- * If 'quantum' is non zero then up to 'quantum' nodes will be destroyed
- * allowing the rbt to be incrementally destroyed by repeated calls to
- * dns_rbt_destroy2(). Once dns_rbt_destroy2() has been called no other
- * operations than dns_rbt_destroy()/dns_rbt_destroy2() should be
- * performed on the tree of trees.
- *
- * Requires:
- * \li *rbt is a valid rbt manager.
- *
- * Ensures on ISC_R_SUCCESS:
- * \li All space allocated by the RBT library has been returned.
- *
- * \li *rbt is invalidated as an rbt manager.
- *
- * Returns:
- * \li ISC_R_SUCCESS
- * \li ISC_R_QUOTA if 'quantum' nodes have been destroyed.
- */
-
-void
-dns_rbt_printall(dns_rbt_t *rbt);
-/*%<
- * Print an ASCII representation of the internal structure of the red-black
- * tree of trees.
- *
- * Notes:
- * \li The name stored at each node, along with the node's color, is printed.
- * Then the down pointer, left and right pointers are displayed
- * recursively in turn. NULL down pointers are silently omitted;
- * NULL left and right pointers are printed.
- */
-
-/*****
- ***** Chain Functions
- *****/
-
-void
-dns_rbtnodechain_init(dns_rbtnodechain_t *chain, isc_mem_t *mctx);
-/*%<
- * Initialize 'chain'.
- *
- * Requires:
- *\li 'chain' is a valid pointer.
- *
- *\li 'mctx' is a valid memory context.
- *
- * Ensures:
- *\li 'chain' is suitable for use.
- */
-
-void
-dns_rbtnodechain_reset(dns_rbtnodechain_t *chain);
-/*%<
- * Free any dynamic storage associated with 'chain', and then reinitialize
- * 'chain'.
- *
- * Requires:
- *\li 'chain' is a valid pointer.
- *
- * Ensures:
- *\li 'chain' is suitable for use, and uses no dynamic storage.
- */
-
-void
-dns_rbtnodechain_invalidate(dns_rbtnodechain_t *chain);
-/*%<
- * Free any dynamic storage associated with 'chain', and then invalidates it.
- *
- * Notes:
- *\li Future calls to any dns_rbtnodechain_ function will need to call
- * dns_rbtnodechain_init on the chain first (except, of course,
- * dns_rbtnodechain_init itself).
- *
- * Requires:
- *\li 'chain' is a valid chain.
- *
- * Ensures:
- *\li 'chain' is no longer suitable for use, and uses no dynamic storage.
- */
-
-isc_result_t
-dns_rbtnodechain_current(dns_rbtnodechain_t *chain, dns_name_t *name,
- dns_name_t *origin, dns_rbtnode_t **node);
-/*%<
- * Provide the name, origin and node to which the chain is currently pointed.
- *
- * Notes:
- *\li The tree need not have be locked against additions for the chain
- * to remain valid, however there are no guarantees if any deletion
- * has been made since the chain was established.
- *
- * Requires:
- *\li 'chain' is a valid chain.
- *
- * Ensures:
- *\li 'node', if non-NULL, is the node to which the chain was pointed
- * by dns_rbt_findnode, dns_rbtnodechain_first or dns_rbtnodechain_last.
- * If none were called for the chain since it was initialized or reset,
- * or if the was no predecessor to the name searched for with
- * dns_rbt_findnode, then '*node' is NULL and ISC_R_NOTFOUND is returned.
- *
- *\li 'name', if non-NULL, is the name stored at the terminal level of
- * the chain. This is typically a single label, like the "www" of
- * "www.isc.org", but need not be so. At the root of the tree of trees,
- * if the node is "." then 'name' is ".", otherwise it is relative to ".".
- * (Minimalist and atypical case: if the tree has just the name
- * "isc.org." then the root node's stored name is "isc.org." but 'name'
- * will be "isc.org".)
- *
- *\li 'origin', if non-NULL, is the sequence of labels in the levels
- * above the terminal level, such as "isc.org." in the above example.
- * 'origin' is always "." for the root node.
- *
- *
- * Returns:
- *\li #ISC_R_SUCCESS name, origin & node were successfully set.
- *\li #ISC_R_NOTFOUND The chain does not point to any node.
- *\li <something_else> Any error return from dns_name_concatenate.
- */
-
-isc_result_t
-dns_rbtnodechain_first(dns_rbtnodechain_t *chain, dns_rbt_t *rbt,
- dns_name_t *name, dns_name_t *origin);
-/*%<
- * Set the chain to the lexically first node in the tree of trees.
- *
- * Notes:
- *\li By the definition of ordering for DNS names, the root of the tree of
- * trees is the very first node, since everything else in the megatree
- * uses it as a common suffix.
- *
- * Requires:
- *\li 'chain' is a valid chain.
- *\li 'rbt' is a valid rbt manager.
- *
- * Ensures:
- *\li The chain points to the very first node of the tree.
- *
- *\li 'name' and 'origin', if non-NULL, are set as described for
- * dns_rbtnodechain_current. Thus 'origin' will always be ".".
- *
- * Returns:
- *\li #DNS_R_NEWORIGIN The name & origin were successfully set.
- *\li <something_else> Any error result from dns_rbtnodechain_current.
- */
-
-isc_result_t
-dns_rbtnodechain_last(dns_rbtnodechain_t *chain, dns_rbt_t *rbt,
- dns_name_t *name, dns_name_t *origin);
-/*%<
- * Set the chain to the lexically last node in the tree of trees.
- *
- * Requires:
- *\li 'chain' is a valid chain.
- *\li 'rbt' is a valid rbt manager.
- *
- * Ensures:
- *\li The chain points to the very last node of the tree.
- *
- *\li 'name' and 'origin', if non-NULL, are set as described for
- * dns_rbtnodechain_current.
- *
- * Returns:
- *\li #DNS_R_NEWORIGIN The name & origin were successfully set.
- *\li #ISC_R_NOMEMORY Resource Limit: Out of Memory building chain.
- *\li <something_else> Any error result from dns_name_concatenate.
- */
-
-isc_result_t
-dns_rbtnodechain_prev(dns_rbtnodechain_t *chain, dns_name_t *name,
- dns_name_t *origin);
-/*%<
- * Adjusts chain to point the DNSSEC predecessor of the name to which it
- * is currently pointed.
- *
- * Requires:
- *\li 'chain' is a valid chain.
- *\li 'chain' has been pointed somewhere in the tree with dns_rbt_findnode,
- * dns_rbtnodechain_first or dns_rbtnodechain_last -- and remember that
- * dns_rbt_findnode is not guaranteed to point the chain somewhere,
- * since there may have been no predecessor to the searched for name.
- *
- * Ensures:
- *\li The chain is pointed to the predecessor of its current target.
- *
- *\li 'name' and 'origin', if non-NULL, are set as described for
- * dns_rbtnodechain_current.
- *
- *\li 'origin' is only if a new origin was found.
- *
- * Returns:
- *\li #ISC_R_SUCCESS The predecessor was found and 'name' was set.
- *\li #DNS_R_NEWORIGIN The predecessor was found with a different
- * origin and 'name' and 'origin' were set.
- *\li #ISC_R_NOMORE There was no predecessor.
- *\li <something_else> Any error result from dns_rbtnodechain_current.
- */
-
-isc_result_t
-dns_rbtnodechain_next(dns_rbtnodechain_t *chain, dns_name_t *name,
- dns_name_t *origin);
-/*%<
- * Adjusts chain to point the DNSSEC successor of the name to which it
- * is currently pointed.
- *
- * Requires:
- *\li 'chain' is a valid chain.
- *\li 'chain' has been pointed somewhere in the tree with dns_rbt_findnode,
- * dns_rbtnodechain_first or dns_rbtnodechain_last -- and remember that
- * dns_rbt_findnode is not guaranteed to point the chain somewhere,
- * since there may have been no predecessor to the searched for name.
- *
- * Ensures:
- *\li The chain is pointed to the successor of its current target.
- *
- *\li 'name' and 'origin', if non-NULL, are set as described for
- * dns_rbtnodechain_current.
- *
- *\li 'origin' is only if a new origin was found.
- *
- * Returns:
- *\li #ISC_R_SUCCESS The successor was found and 'name' was set.
- *\li #DNS_R_NEWORIGIN The successor was found with a different
- * origin and 'name' and 'origin' were set.
- *\li #ISC_R_NOMORE There was no successor.
- *\li <something_else> Any error result from dns_name_concatenate.
- */
-
-isc_result_t
-dns_rbtnodechain_down(dns_rbtnodechain_t *chain, dns_name_t *name,
- dns_name_t *origin);
-/*%<
- * Descend down if possible.
- */
-
-isc_result_t
-dns_rbtnodechain_nextflat(dns_rbtnodechain_t *chain, dns_name_t *name);
-/*%<
- * Find the next node at the current depth in DNSSEC order.
- */
-
-/*
- * Wrapper macros for manipulating the rbtnode reference counter:
- * Since we selectively use isc_refcount_t for the reference counter of
- * a rbtnode, operations on the counter depend on the actual type of it.
- * The following macros provide a common interface to these operations,
- * hiding the back-end. The usage is the same as that of isc_refcount_xxx().
- */
-#ifdef DNS_RBT_USEISCREFCOUNT
-#define dns_rbtnode_refinit(node, n) \
- do { \
- isc_refcount_init(&(node)->references, (n)); \
- } while (0)
-#define dns_rbtnode_refdestroy(node) \
- do { \
- isc_refcount_destroy(&(node)->references); \
- } while (0)
-#define dns_rbtnode_refcurrent(node) \
- isc_refcount_current(&(node)->references)
-#define dns_rbtnode_refincrement0(node, refs) \
- do { \
- isc_refcount_increment0(&(node)->references, (refs)); \
- } while (0)
-#define dns_rbtnode_refincrement(node, refs) \
- do { \
- isc_refcount_increment(&(node)->references, (refs)); \
- } while (0)
-#define dns_rbtnode_refdecrement(node, refs) \
- do { \
- isc_refcount_decrement(&(node)->references, (refs)); \
- } while (0)
-#else /* DNS_RBT_USEISCREFCOUNT */
-#define dns_rbtnode_refinit(node, n) ((node)->references = (n))
-#define dns_rbtnode_refdestroy(node) (REQUIRE((node)->references == 0))
-#define dns_rbtnode_refcurrent(node) ((node)->references)
-#define dns_rbtnode_refincrement0(node, refs) \
- do { \
- unsigned int *_tmp = (unsigned int *)(refs); \
- (node)->references++; \
- if ((_tmp) != NULL) \
- (*_tmp) = (node)->references; \
- } while (0)
-#define dns_rbtnode_refincrement(node, refs) \
- do { \
- REQUIRE((node)->references > 0); \
- (node)->references++; \
- if ((refs) != NULL) \
- (*refs) = (node)->references; \
- } while (0)
-#define dns_rbtnode_refdecrement(node, refs) \
- do { \
- REQUIRE((node)->references > 0); \
- (node)->references--; \
- if ((refs) != NULL) \
- (*refs) = (node)->references; \
- } while (0)
-#endif /* DNS_RBT_USEISCREFCOUNT */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_RBT_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: rcode.h,v 1.21 2008/09/25 04:02:39 tbox Exp $ */
-
-#ifndef DNS_RCODE_H
-#define DNS_RCODE_H 1
-
-/*! \file dns/rcode.h */
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t dns_rcode_fromtext(dns_rcode_t *rcodep, isc_textregion_t *source);
-/*%<
- * Convert the text 'source' refers to into a DNS error value.
- *
- * Requires:
- *\li 'rcodep' is a valid pointer.
- *
- *\li 'source' is a valid text region.
- *
- * Returns:
- *\li #ISC_R_SUCCESS on success
- *\li #DNS_R_UNKNOWN type is unknown
- */
-
-isc_result_t dns_rcode_totext(dns_rcode_t rcode, isc_buffer_t *target);
-/*%<
- * Put a textual representation of error 'rcode' into 'target'.
- *
- * Requires:
- *\li 'rcode' is a valid rcode.
- *
- *\li 'target' is a valid text buffer.
- *
- * Ensures:
- *\li If the result is success:
- * The used space in 'target' is updated.
- *
- * Returns:
- *\li #ISC_R_SUCCESS on success
- *\li #ISC_R_NOSPACE target buffer is too small
- */
-
-isc_result_t dns_tsigrcode_fromtext(dns_rcode_t *rcodep,
- isc_textregion_t *source);
-/*%<
- * Convert the text 'source' refers to into a TSIG/TKEY error value.
- *
- * Requires:
- *\li 'rcodep' is a valid pointer.
- *
- *\li 'source' is a valid text region.
- *
- * Returns:
- *\li #ISC_R_SUCCESS on success
- *\li #DNS_R_UNKNOWN type is unknown
- */
-
-isc_result_t dns_tsigrcode_totext(dns_rcode_t rcode, isc_buffer_t *target);
-/*%<
- * Put a textual representation of TSIG/TKEY error 'rcode' into 'target'.
- *
- * Requires:
- *\li 'rcode' is a valid TSIG/TKEY error code.
- *
- *\li 'target' is a valid text buffer.
- *
- * Ensures:
- *\li If the result is success:
- * The used space in 'target' is updated.
- *
- * Returns:
- *\li #ISC_R_SUCCESS on success
- *\li #ISC_R_NOSPACE target buffer is too small
- */
-
-isc_result_t
-dns_hashalg_fromtext(unsigned char *hashalg, isc_textregion_t *source);
-/*%<
- * Convert the text 'source' refers to into a has algorithm value.
- *
- * Requires:
- *\li 'hashalg' is a valid pointer.
- *
- *\li 'source' is a valid text region.
- *
- * Returns:
- *\li #ISC_R_SUCCESS on success
- *\li #DNS_R_UNKNOWN type is unknown
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_RCODE_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: rdata.h,v 1.70.120.3 2009/02/16 00:29:27 marka Exp $ */
-
-#ifndef DNS_RDATA_H
-#define DNS_RDATA_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/rdata.h
- * \brief
- * Provides facilities for manipulating DNS rdata, including conversions to
- * and from wire format and text format.
- *
- * Given the large amount of rdata possible in a nameserver, it was important
- * to come up with a very efficient way of storing rdata, but at the same
- * time allow it to be manipulated.
- *
- * The decision was to store rdata in uncompressed wire format,
- * and not to make it a fully abstracted object; i.e. certain parts of the
- * server know rdata is stored that way. This saves a lot of memory, and
- * makes adding rdata to messages easy. Having much of the server know
- * the representation would be perilous, and we certainly don't want each
- * user of rdata to be manipulating such a low-level structure. This is
- * where the rdata module comes in. The module allows rdata handles to be
- * created and attached to uncompressed wire format regions. All rdata
- * operations and conversions are done through these handles.
- *
- * Implementation Notes:
- *
- *\li The routines in this module are expected to be synthesized by the
- * build process from a set of source files, one per rdata type. For
- * portability, it's probably best that the building be done by a C
- * program. Adding a new rdata type will be a simple matter of adding
- * a file to a directory and rebuilding the server. *All* knowledge of
- * the format of a particular rdata type is in this file.
- *
- * MP:
- *\li Clients of this module must impose any required synchronization.
- *
- * Reliability:
- *\li This module deals with low-level byte streams. Errors in any of
- * the functions are likely to crash the server or corrupt memory.
- *
- *\li Rdata is typed, and the caller must know what type of rdata it has.
- * A caller that gets this wrong could crash the server.
- *
- *\li The fromstruct() and tostruct() routines use a void * pointer to
- * represent the structure. The caller must ensure that it passes a
- * pointer to the appropriate type, or the server could crash or memory
- * could be corrupted.
- *
- * Resources:
- *\li None.
- *
- * Security:
- *
- *\li *** WARNING ***
- * dns_rdata_fromwire() deals with raw network data. An error in
- * this routine could result in the failure or hijacking of the server.
- *
- * Standards:
- *\li RFC1035
- *\li Draft EDNS0 (0)
- *\li Draft EDNS1 (0)
- *\li Draft Binary Labels (2)
- *\li Draft Local Compression (1)
- *\li Various RFCs for particular types; these will be documented in the
- * sources files of the types.
- *
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-#include <dns/name.h>
-
-ISC_LANG_BEGINDECLS
-
-
-/***
- *** Types
- ***/
-
-/*%
- ***** An 'rdata' is a handle to a binary region. The handle has an RR
- ***** class and type, and the data in the binary region is in the format
- ***** of the given class and type.
- *****/
-/*%
- * Clients are strongly discouraged from using this type directly, with
- * the exception of the 'link' field which may be used directly for whatever
- * purpose the client desires.
- */
-struct dns_rdata {
- unsigned char * data;
- unsigned int length;
- dns_rdataclass_t rdclass;
- dns_rdatatype_t type;
- unsigned int flags;
- ISC_LINK(dns_rdata_t) link;
-};
-
-#define DNS_RDATA_INIT { NULL, 0, 0, 0, 0, {(void*)(-1), (void *)(-1)}}
-
-#define DNS_RDATA_UPDATE 0x0001 /*%< update pseudo record. */
-#define DNS_RDATA_OFFLINE 0x0002 /*%< RRSIG has a offline key. */
-
-/*
- * Flags affecting rdata formatting style. Flags 0xFFFF0000
- * are used by masterfile-level formatting and defined elsewhere.
- * See additional comments at dns_rdata_tofmttext().
- */
-
-/*% Split the rdata into multiple lines to try to keep it
- within the "width". */
-#define DNS_STYLEFLAG_MULTILINE 0x00000001U
-
-/*% Output explanatory comments. */
-#define DNS_STYLEFLAG_COMMENT 0x00000002U
-
-#define DNS_RDATA_DOWNCASE DNS_NAME_DOWNCASE
-#define DNS_RDATA_CHECKNAMES DNS_NAME_CHECKNAMES
-#define DNS_RDATA_CHECKNAMESFAIL DNS_NAME_CHECKNAMESFAIL
-#define DNS_RDATA_CHECKREVERSE DNS_NAME_CHECKREVERSE
-#define DNS_RDATA_CHECKMX DNS_NAME_CHECKMX
-#define DNS_RDATA_CHECKMXFAIL DNS_NAME_CHECKMXFAIL
-
-/***
- *** Initialization
- ***/
-
-void
-dns_rdata_init(dns_rdata_t *rdata);
-/*%<
- * Make 'rdata' empty.
- *
- * Requires:
- * 'rdata' is a valid rdata (i.e. not NULL, points to a struct dns_rdata)
- */
-
-void
-dns_rdata_reset(dns_rdata_t *rdata);
-/*%<
- * Make 'rdata' empty.
- *
- * Requires:
- *\li 'rdata' is a previously initialized rdata and is not linked.
- */
-
-void
-dns_rdata_clone(const dns_rdata_t *src, dns_rdata_t *target);
-/*%<
- * Clone 'target' from 'src'.
- *
- * Requires:
- *\li 'src' to be initialized.
- *\li 'target' to be initialized.
- */
-
-/***
- *** Comparisons
- ***/
-
-int
-dns_rdata_compare(const dns_rdata_t *rdata1, const dns_rdata_t *rdata2);
-/*%<
- * Determine the relative ordering under the DNSSEC order relation of
- * 'rdata1' and 'rdata2'.
- *
- * Requires:
- *
- *\li 'rdata1' is a valid, non-empty rdata
- *
- *\li 'rdata2' is a valid, non-empty rdata
- *
- * Returns:
- *\li < 0 'rdata1' is less than 'rdata2'
- *\li 0 'rdata1' is equal to 'rdata2'
- *\li > 0 'rdata1' is greater than 'rdata2'
- */
-
-/***
- *** Conversions
- ***/
-
-void
-dns_rdata_fromregion(dns_rdata_t *rdata, dns_rdataclass_t rdclass,
- dns_rdatatype_t type, isc_region_t *r);
-/*%<
- * Make 'rdata' refer to region 'r'.
- *
- * Requires:
- *
- *\li The data in 'r' is properly formatted for whatever type it is.
- */
-
-void
-dns_rdata_toregion(const dns_rdata_t *rdata, isc_region_t *r);
-/*%<
- * Make 'r' refer to 'rdata'.
- */
-
-isc_result_t
-dns_rdata_fromwire(dns_rdata_t *rdata, dns_rdataclass_t rdclass,
- dns_rdatatype_t type, isc_buffer_t *source,
- dns_decompress_t *dctx, unsigned int options,
- isc_buffer_t *target);
-/*%<
- * Copy the possibly-compressed rdata at source into the target region.
- *
- * Notes:
- *\li Name decompression policy is controlled by 'dctx'.
- *
- * 'options'
- *\li DNS_RDATA_DOWNCASE downcase domain names when they are copied
- * into target.
- *
- * Requires:
- *
- *\li 'rdclass' and 'type' are valid.
- *
- *\li 'source' is a valid buffer, and the active region of 'source'
- * references the rdata to be processed.
- *
- *\li 'target' is a valid buffer.
- *
- *\li 'dctx' is a valid decompression context.
- *
- * Ensures,
- * if result is success:
- * \li If 'rdata' is not NULL, it is attached to the target.
- * \li The conditions dns_name_fromwire() ensures for names hold
- * for all names in the rdata.
- * \li The current location in source is advanced, and the used space
- * in target is updated.
- *
- * Result:
- *\li Success
- *\li Any non-success status from dns_name_fromwire()
- *\li Various 'Bad Form' class failures depending on class and type
- *\li Bad Form: Input too short
- *\li Resource Limit: Not enough space
- */
-
-isc_result_t
-dns_rdata_towire(dns_rdata_t *rdata, dns_compress_t *cctx,
- isc_buffer_t *target);
-/*%<
- * Convert 'rdata' into wire format, compressing it as specified by the
- * compression context 'cctx', and storing the result in 'target'.
- *
- * Notes:
- *\li If the compression context allows global compression, then the
- * global compression table may be updated.
- *
- * Requires:
- *\li 'rdata' is a valid, non-empty rdata
- *
- *\li target is a valid buffer
- *
- *\li Any offsets specified in a global compression table are valid
- * for target.
- *
- * Ensures,
- * if the result is success:
- * \li The used space in target is updated.
- *
- * Returns:
- *\li Success
- *\li Any non-success status from dns_name_towire()
- *\li Resource Limit: Not enough space
- */
-
-isc_result_t
-dns_rdata_fromtext(dns_rdata_t *rdata, dns_rdataclass_t rdclass,
- dns_rdatatype_t type, isc_lex_t *lexer, dns_name_t *origin,
- unsigned int options, isc_mem_t *mctx,
- isc_buffer_t *target, dns_rdatacallbacks_t *callbacks);
-/*%<
- * Convert the textual representation of a DNS rdata into uncompressed wire
- * form stored in the target region. Tokens constituting the text of the rdata
- * are taken from 'lexer'.
- *
- * Notes:
- *\li Relative domain names in the rdata will have 'origin' appended to them.
- * A NULL origin implies "origin == dns_rootname".
- *
- *
- * 'options'
- *\li DNS_RDATA_DOWNCASE downcase domain names when they are copied
- * into target.
- *\li DNS_RDATA_CHECKNAMES perform checknames checks.
- *\li DNS_RDATA_CHECKNAMESFAIL fail if the checknames check fail. If
- * not set a warning will be issued.
- *\li DNS_RDATA_CHECKREVERSE this should set if the owner name ends
- * in IP6.ARPA, IP6.INT or IN-ADDR.ARPA.
- *
- * Requires:
- *
- *\li 'rdclass' and 'type' are valid.
- *
- *\li 'lexer' is a valid isc_lex_t.
- *
- *\li 'mctx' is a valid isc_mem_t.
- *
- *\li 'target' is a valid region.
- *
- *\li 'origin' if non NULL it must be absolute.
- *
- *\li 'callbacks' to be NULL or callbacks->warn and callbacks->error be
- * initialized.
- *
- * Ensures,
- * if result is success:
- *\li If 'rdata' is not NULL, it is attached to the target.
-
- *\li The conditions dns_name_fromtext() ensures for names hold
- * for all names in the rdata.
-
- *\li The used space in target is updated.
- *
- * Result:
- *\li Success
- *\li Translated result codes from isc_lex_gettoken
- *\li Various 'Bad Form' class failures depending on class and type
- *\li Bad Form: Input too short
- *\li Resource Limit: Not enough space
- *\li Resource Limit: Not enough memory
- */
-
-isc_result_t
-dns_rdata_totext(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target);
-/*%<
- * Convert 'rdata' into text format, storing the result in 'target'.
- * The text will consist of a single line, with fields separated by
- * single spaces.
- *
- * Notes:
- *\li If 'origin' is not NULL, then any names in the rdata that are
- * subdomains of 'origin' will be made relative it.
- *
- *\li XXX Do we *really* want to support 'origin'? I'm inclined towards "no"
- * at the moment.
- *
- * Requires:
- *
- *\li 'rdata' is a valid, non-empty rdata
- *
- *\li 'origin' is NULL, or is a valid name
- *
- *\li 'target' is a valid text buffer
- *
- * Ensures,
- * if the result is success:
- *
- * \li The used space in target is updated.
- *
- * Returns:
- *\li Success
- *\li Any non-success status from dns_name_totext()
- *\li Resource Limit: Not enough space
- */
-
-isc_result_t
-dns_rdata_tofmttext(dns_rdata_t *rdata, dns_name_t *origin, unsigned int flags,
- unsigned int width, const char *linebreak,
- isc_buffer_t *target);
-/*%<
- * Like dns_rdata_totext, but do formatted output suitable for
- * database dumps. This is intended for use by dns_db_dump();
- * library users are discouraged from calling it directly.
- *
- * If (flags & #DNS_STYLEFLAG_MULTILINE) != 0, attempt to stay
- * within 'width' by breaking the text into multiple lines.
- * The string 'linebreak' is inserted between lines, and parentheses
- * are added when necessary. Because RRs contain unbreakable elements
- * such as domain names whose length is variable, unpredictable, and
- * potentially large, there is no guarantee that the lines will
- * not exceed 'width' anyway.
- *
- * If (flags & #DNS_STYLEFLAG_MULTILINE) == 0, the rdata is always
- * printed as a single line, and no parentheses are used.
- * The 'width' and 'linebreak' arguments are ignored.
- *
- * If (flags & #DNS_STYLEFLAG_COMMENT) != 0, output explanatory
- * comments next to things like the SOA timer fields. Some
- * comments (e.g., the SOA ones) are only printed when multiline
- * output is selected.
- */
-
-isc_result_t
-dns_rdata_fromstruct(dns_rdata_t *rdata, dns_rdataclass_t rdclass,
- dns_rdatatype_t type, void *source, isc_buffer_t *target);
-/*%<
- * Convert the C structure representation of an rdata into uncompressed wire
- * format in 'target'.
- *
- * XXX Should we have a 'size' parameter as a sanity check on target?
- *
- * Requires:
- *
- *\li 'rdclass' and 'type' are valid.
- *
- *\li 'source' points to a valid C struct for the class and type.
- *
- *\li 'target' is a valid buffer.
- *
- *\li All structure pointers to memory blocks should be NULL if their
- * corresponding length values are zero.
- *
- * Ensures,
- * if result is success:
- * \li If 'rdata' is not NULL, it is attached to the target.
- *
- * \li The used space in 'target' is updated.
- *
- * Result:
- *\li Success
- *\li Various 'Bad Form' class failures depending on class and type
- *\li Resource Limit: Not enough space
- */
-
-isc_result_t
-dns_rdata_tostruct(dns_rdata_t *rdata, void *target, isc_mem_t *mctx);
-/*%<
- * Convert an rdata into its C structure representation.
- *
- * If 'mctx' is NULL then 'rdata' must persist while 'target' is being used.
- *
- * If 'mctx' is non NULL then memory will be allocated if required.
- *
- * Requires:
- *
- *\li 'rdata' is a valid, non-empty rdata.
- *
- *\li 'target' to point to a valid pointer for the type and class.
- *
- * Result:
- *\li Success
- *\li Resource Limit: Not enough memory
- */
-
-void
-dns_rdata_freestruct(void *source);
-/*%<
- * Free dynamic memory attached to 'source' (if any).
- *
- * Requires:
- *
- *\li 'source' to point to the structure previously filled in by
- * dns_rdata_tostruct().
- */
-
-isc_boolean_t
-dns_rdatatype_ismeta(dns_rdatatype_t type);
-/*%<
- * Return true iff the rdata type 'type' is a meta-type
- * like ANY or AXFR.
- */
-
-isc_boolean_t
-dns_rdatatype_issingleton(dns_rdatatype_t type);
-/*%<
- * Return true iff the rdata type 'type' is a singleton type,
- * like CNAME or SOA.
- *
- * Requires:
- * \li 'type' is a valid rdata type.
- *
- */
-
-isc_boolean_t
-dns_rdataclass_ismeta(dns_rdataclass_t rdclass);
-/*%<
- * Return true iff the rdata class 'rdclass' is a meta-class
- * like ANY or NONE.
- */
-
-isc_boolean_t
-dns_rdatatype_isdnssec(dns_rdatatype_t type);
-/*%<
- * Return true iff 'type' is one of the DNSSEC
- * rdata types that may exist alongside a CNAME record.
- *
- * Requires:
- * \li 'type' is a valid rdata type.
- */
-
-isc_boolean_t
-dns_rdatatype_iszonecutauth(dns_rdatatype_t type);
-/*%<
- * Return true iff rdata of type 'type' is considered authoritative
- * data (not glue) in the NSEC chain when it occurs in the parent zone
- * at a zone cut.
- *
- * Requires:
- * \li 'type' is a valid rdata type.
- *
- */
-
-isc_boolean_t
-dns_rdatatype_isknown(dns_rdatatype_t type);
-/*%<
- * Return true iff the rdata type 'type' is known.
- *
- * Requires:
- * \li 'type' is a valid rdata type.
- *
- */
-
-
-isc_result_t
-dns_rdata_additionaldata(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
- void *arg);
-/*%<
- * Call 'add' for each name and type from 'rdata' which is subject to
- * additional section processing.
- *
- * Requires:
- *
- *\li 'rdata' is a valid, non-empty rdata.
- *
- *\li 'add' is a valid dns_additionalfunc_t.
- *
- * Ensures:
- *
- *\li If successful, then add() will have been called for each name
- * and type subject to additional section processing.
- *
- *\li If add() returns something other than #ISC_R_SUCCESS, that result
- * will be returned as the result of dns_rdata_additionaldata().
- *
- * Returns:
- *
- *\li ISC_R_SUCCESS
- *
- *\li Many other results are possible if not successful.
- */
-
-isc_result_t
-dns_rdata_digest(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg);
-/*%<
- * Send 'rdata' in DNSSEC canonical form to 'digest'.
- *
- * Note:
- *\li 'digest' may be called more than once by dns_rdata_digest(). The
- * concatenation of all the regions, in the order they were given
- * to 'digest', will be the DNSSEC canonical form of 'rdata'.
- *
- * Requires:
- *
- *\li 'rdata' is a valid, non-empty rdata.
- *
- *\li 'digest' is a valid dns_digestfunc_t.
- *
- * Ensures:
- *
- *\li If successful, then all of the rdata's data has been sent, in
- * DNSSEC canonical form, to 'digest'.
- *
- *\li If digest() returns something other than ISC_R_SUCCESS, that result
- * will be returned as the result of dns_rdata_digest().
- *
- * Returns:
- *
- *\li ISC_R_SUCCESS
- *
- *\li Many other results are possible if not successful.
- */
-
-isc_boolean_t
-dns_rdatatype_questiononly(dns_rdatatype_t type);
-/*%<
- * Return true iff rdata of type 'type' can only appear in the question
- * section of a properly formatted message.
- *
- * Requires:
- * \li 'type' is a valid rdata type.
- *
- */
-
-isc_boolean_t
-dns_rdatatype_notquestion(dns_rdatatype_t type);
-/*%<
- * Return true iff rdata of type 'type' can not appear in the question
- * section of a properly formatted message.
- *
- * Requires:
- * \li 'type' is a valid rdata type.
- *
- */
-
-isc_boolean_t
-dns_rdatatype_atparent(dns_rdatatype_t type);
-/*%<
- * Return true iff rdata of type 'type' should appear at the parent of
- * a zone cut.
- *
- * Requires:
- * \li 'type' is a valid rdata type.
- *
- */
-
-unsigned int
-dns_rdatatype_attributes(dns_rdatatype_t rdtype);
-/*%<
- * Return attributes for the given type.
- *
- * Requires:
- *\li 'rdtype' are known.
- *
- * Returns:
- *\li a bitmask consisting of the following flags.
- */
-
-/*% only one may exist for a name */
-#define DNS_RDATATYPEATTR_SINGLETON 0x00000001U
-/*% requires no other data be present */
-#define DNS_RDATATYPEATTR_EXCLUSIVE 0x00000002U
-/*% Is a meta type */
-#define DNS_RDATATYPEATTR_META 0x00000004U
-/*% Is a DNSSEC type, like RRSIG or NSEC */
-#define DNS_RDATATYPEATTR_DNSSEC 0x00000008U
-/*% Is a zone cut authority type */
-#define DNS_RDATATYPEATTR_ZONECUTAUTH 0x00000010U
-/*% Is reserved (unusable) */
-#define DNS_RDATATYPEATTR_RESERVED 0x00000020U
-/*% Is an unknown type */
-#define DNS_RDATATYPEATTR_UNKNOWN 0x00000040U
-/*% Is META, and can only be in a question section */
-#define DNS_RDATATYPEATTR_QUESTIONONLY 0x00000080U
-/*% is META, and can NOT be in a question section */
-#define DNS_RDATATYPEATTR_NOTQUESTION 0x00000100U
-/*% Is present at zone cuts in the parent, not the child */
-#define DNS_RDATATYPEATTR_ATPARENT 0x00000200U
-
-dns_rdatatype_t
-dns_rdata_covers(dns_rdata_t *rdata);
-/*%<
- * Return the rdatatype that this type covers.
- *
- * Requires:
- *\li 'rdata' is a valid, non-empty rdata.
- *
- *\li 'rdata' is a type that covers other rdata types.
- *
- * Returns:
- *\li The type covered.
- */
-
-isc_boolean_t
-dns_rdata_checkowner(dns_name_t* name, dns_rdataclass_t rdclass,
- dns_rdatatype_t type, isc_boolean_t wildcard);
-/*
- * Returns whether this is a valid ownername for this <type,class>.
- * If wildcard is true allow the first label to be a wildcard if
- * appropriate.
- *
- * Requires:
- * 'name' is a valid name.
- */
-
-isc_boolean_t
-dns_rdata_checknames(dns_rdata_t *rdata, dns_name_t *owner, dns_name_t *bad);
-/*
- * Returns whether 'rdata' contains valid domain names. The checks are
- * sensitive to the owner name.
- *
- * If 'bad' is non-NULL and a domain name fails the check the
- * the offending name will be return in 'bad' by cloning from
- * the 'rdata' contents.
- *
- * Requires:
- * 'rdata' to be valid.
- * 'owner' to be valid.
- * 'bad' to be NULL or valid.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_RDATA_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: rdataclass.h,v 1.24 2007/06/19 23:47:17 tbox Exp $ */
-
-#ifndef DNS_RDATACLASS_H
-#define DNS_RDATACLASS_H 1
-
-/*! \file dns/rdataclass.h */
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_rdataclass_fromtext(dns_rdataclass_t *classp, isc_textregion_t *source);
-/*%<
- * Convert the text 'source' refers to into a DNS class.
- *
- * Requires:
- *\li 'classp' is a valid pointer.
- *
- *\li 'source' is a valid text region.
- *
- * Returns:
- *\li #ISC_R_SUCCESS on success
- *\li #DNS_R_UNKNOWN class is unknown
- */
-
-isc_result_t
-dns_rdataclass_totext(dns_rdataclass_t rdclass, isc_buffer_t *target);
-/*%<
- * Put a textual representation of class 'rdclass' into 'target'.
- *
- * Requires:
- *\li 'rdclass' is a valid class.
- *
- *\li 'target' is a valid text buffer.
- *
- * Ensures,
- * if the result is success:
- *\li The used space in 'target' is updated.
- *
- * Returns:
- *\li #ISC_R_SUCCESS on success
- *\li #ISC_R_NOSPACE target buffer is too small
- */
-
-void
-dns_rdataclass_format(dns_rdataclass_t rdclass,
- char *array, unsigned int size);
-/*%<
- * Format a human-readable representation of the class 'rdclass'
- * into the character array 'array', which is of size 'size'.
- * The resulting string is guaranteed to be null-terminated.
- */
-
-#define DNS_RDATACLASS_FORMATSIZE sizeof("CLASS65535")
-/*%<
- * Minimum size of array to pass to dns_rdataclass_format().
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_RDATACLASS_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: rdatalist.h,v 1.22 2008/04/03 06:09:05 tbox Exp $ */
-
-#ifndef DNS_RDATALIST_H
-#define DNS_RDATALIST_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/rdatalist.h
- * \brief
- * A DNS rdatalist is a list of rdata of a common type and class.
- *
- * MP:
- *\li Clients of this module must impose any required synchronization.
- *
- * Reliability:
- *\li No anticipated impact.
- *
- * Resources:
- *\li TBS
- *
- * Security:
- *\li No anticipated impact.
- *
- * Standards:
- *\li None.
- */
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-/*%
- * Clients may use this type directly.
- */
-struct dns_rdatalist {
- dns_rdataclass_t rdclass;
- dns_rdatatype_t type;
- dns_rdatatype_t covers;
- dns_ttl_t ttl;
- ISC_LIST(dns_rdata_t) rdata;
- ISC_LINK(dns_rdatalist_t) link;
-};
-
-ISC_LANG_BEGINDECLS
-
-void
-dns_rdatalist_init(dns_rdatalist_t *rdatalist);
-/*%<
- * Initialize rdatalist.
- *
- * Ensures:
- *\li All fields of rdatalist have been initialized to their default
- * values.
- */
-
-isc_result_t
-dns_rdatalist_tordataset(dns_rdatalist_t *rdatalist,
- dns_rdataset_t *rdataset);
-/*%<
- * Make 'rdataset' refer to the rdata in 'rdatalist'.
- *
- * Note:
- *\li The caller must ensure that 'rdatalist' remains valid and unchanged
- * while 'rdataset' is associated with it.
- *
- * Requires:
- *
- *\li 'rdatalist' is a valid rdatalist.
- *
- *\li 'rdataset' is a valid rdataset that is not currently associated with
- * any rdata.
- *
- * Ensures,
- * on success,
- *
- *\li 'rdataset' is associated with the rdata in rdatalist.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- */
-
-isc_result_t
-dns_rdatalist_fromrdataset(dns_rdataset_t *rdataset,
- dns_rdatalist_t **rdatalist);
-/*%<
- * Point 'rdatalist' to the rdatalist in 'rdataset'.
- *
- * Requires:
- *
- *\li 'rdatalist' is a pointer to a NULL dns_rdatalist_t pointer.
- *
- *\li 'rdataset' is a valid rdataset associated with an rdatalist.
- *
- * Ensures,
- * on success,
- *
- *\li 'rdatalist' is pointed to the rdatalist in rdataset.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_RDATALIST_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: rdataset.h,v 1.65.50.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef DNS_RDATASET_H
-#define DNS_RDATASET_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/rdataset.h
- * \brief
- * A DNS rdataset is a handle that can be associated with a collection of
- * rdata all having a common owner name, class, and type.
- *
- * The dns_rdataset_t type is like a "virtual class". To actually use
- * rdatasets, an implementation of the method suite (e.g. "slabbed rdata") is
- * required.
- *
- * XXX <more> XXX
- *
- * MP:
- *\li Clients of this module must impose any required synchronization.
- *
- * Reliability:
- *\li No anticipated impact.
- *
- * Resources:
- *\li TBS
- *
- * Security:
- *\li No anticipated impact.
- *
- * Standards:
- *\li None.
- */
-
-#include <isc/lang.h>
-#include <isc/magic.h>
-#include <isc/stdtime.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-typedef enum {
- dns_rdatasetadditional_fromauth,
- dns_rdatasetadditional_fromcache,
- dns_rdatasetadditional_fromglue
-} dns_rdatasetadditional_t;
-
-typedef struct dns_rdatasetmethods {
- void (*disassociate)(dns_rdataset_t *rdataset);
- isc_result_t (*first)(dns_rdataset_t *rdataset);
- isc_result_t (*next)(dns_rdataset_t *rdataset);
- void (*current)(dns_rdataset_t *rdataset,
- dns_rdata_t *rdata);
- void (*clone)(dns_rdataset_t *source,
- dns_rdataset_t *target);
- unsigned int (*count)(dns_rdataset_t *rdataset);
- isc_result_t (*addnoqname)(dns_rdataset_t *rdataset,
- dns_name_t *name);
- isc_result_t (*getnoqname)(dns_rdataset_t *rdataset,
- dns_name_t *name,
- dns_rdataset_t *neg,
- dns_rdataset_t *negsig);
- isc_result_t (*addclosest)(dns_rdataset_t *rdataset,
- dns_name_t *name);
- isc_result_t (*getclosest)(dns_rdataset_t *rdataset,
- dns_name_t *name,
- dns_rdataset_t *neg,
- dns_rdataset_t *negsig);
- isc_result_t (*getadditional)(dns_rdataset_t *rdataset,
- dns_rdatasetadditional_t type,
- dns_rdatatype_t qtype,
- dns_acache_t *acache,
- dns_zone_t **zonep,
- dns_db_t **dbp,
- dns_dbversion_t **versionp,
- dns_dbnode_t **nodep,
- dns_name_t *fname,
- dns_message_t *msg,
- isc_stdtime_t now);
- isc_result_t (*setadditional)(dns_rdataset_t *rdataset,
- dns_rdatasetadditional_t type,
- dns_rdatatype_t qtype,
- dns_acache_t *acache,
- dns_zone_t *zone,
- dns_db_t *db,
- dns_dbversion_t *version,
- dns_dbnode_t *node,
- dns_name_t *fname);
- isc_result_t (*putadditional)(dns_acache_t *acache,
- dns_rdataset_t *rdataset,
- dns_rdatasetadditional_t type,
- dns_rdatatype_t qtype);
-} dns_rdatasetmethods_t;
-
-#define DNS_RDATASET_MAGIC ISC_MAGIC('D','N','S','R')
-#define DNS_RDATASET_VALID(set) ISC_MAGIC_VALID(set, DNS_RDATASET_MAGIC)
-
-/*%
- * Direct use of this structure by clients is strongly discouraged, except
- * for the 'link' field which may be used however the client wishes. The
- * 'private', 'current', and 'index' fields MUST NOT be changed by clients.
- * rdataset implementations may change any of the fields.
- */
-struct dns_rdataset {
- unsigned int magic; /* XXX ? */
- dns_rdatasetmethods_t * methods;
- ISC_LINK(dns_rdataset_t) link;
- /*
- * XXX do we need these, or should they be retrieved by methods?
- * Leaning towards the latter, since they are not frequently required
- * once you have the rdataset.
- */
- dns_rdataclass_t rdclass;
- dns_rdatatype_t type;
- dns_ttl_t ttl;
- dns_trust_t trust;
- dns_rdatatype_t covers;
- /*
- * attributes
- */
- unsigned int attributes;
- /*%
- * the counter provides the starting point in the "cyclic" order.
- * The value ISC_UINT32_MAX has a special meaning of "picking up a
- * random value." in order to take care of databases that do not
- * increment the counter.
- */
- isc_uint32_t count;
- /*
- * This RRSIG RRset should be re-generated around this time.
- * Only valid if DNS_RDATASETATTR_RESIGN is set in attributes.
- */
- isc_stdtime_t resign;
- /*@{*/
- /*%
- * These are for use by the rdataset implementation, and MUST NOT
- * be changed by clients.
- */
- void * private1;
- void * private2;
- void * private3;
- unsigned int privateuint4;
- void * private5;
- void * private6;
- void * private7;
- /*@}*/
-
-};
-
-/*!
- * \def DNS_RDATASETATTR_RENDERED
- * Used by message.c to indicate that the rdataset was rendered.
- *
- * \def DNS_RDATASETATTR_TTLADJUSTED
- * Used by message.c to indicate that the rdataset's rdata had differing
- * TTL values, and the rdataset->ttl holds the smallest.
- *
- * \def DNS_RDATASETATTR_LOADORDER
- * Output the RRset in load order.
- */
-
-#define DNS_RDATASETATTR_QUESTION 0x00000001
-#define DNS_RDATASETATTR_RENDERED 0x00000002 /*%< Used by message.c */
-#define DNS_RDATASETATTR_ANSWERED 0x00000004 /*%< Used by server. */
-#define DNS_RDATASETATTR_CACHE 0x00000008 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_ANSWER 0x00000010 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_ANSWERSIG 0x00000020 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_EXTERNAL 0x00000040 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_NCACHE 0x00000080 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_CHAINING 0x00000100 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_TTLADJUSTED 0x00000200 /*%< Used by message.c */
-#define DNS_RDATASETATTR_FIXEDORDER 0x00000400
-#define DNS_RDATASETATTR_RANDOMIZE 0x00000800
-#define DNS_RDATASETATTR_CHASE 0x00001000 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_NXDOMAIN 0x00002000
-#define DNS_RDATASETATTR_NOQNAME 0x00004000
-#define DNS_RDATASETATTR_CHECKNAMES 0x00008000 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_REQUIREDGLUE 0x00010000
-#define DNS_RDATASETATTR_LOADORDER 0x00020000
-#define DNS_RDATASETATTR_RESIGN 0x00040000
-#define DNS_RDATASETATTR_CLOSEST 0x00080000
-#define DNS_RDATASETATTR_OPTOUT 0x00100000 /*%< OPTOUT proof */
-
-#define DNS_RDATASETATTR_SINGLE 0x10000000 /* Only return 1 answer */
-
-/*%
- * _OMITDNSSEC:
- * Omit DNSSEC records when rendering ncache records.
- */
-#define DNS_RDATASETTOWIRE_OMITDNSSEC 0x0001
-
-void
-dns_rdataset_init(dns_rdataset_t *rdataset);
-/*%<
- * Make 'rdataset' a valid, disassociated rdataset.
- *
- * Requires:
- *\li 'rdataset' is not NULL.
- *
- * Ensures:
- *\li 'rdataset' is a valid, disassociated rdataset.
- */
-
-void
-dns_rdataset_invalidate(dns_rdataset_t *rdataset);
-/*%<
- * Invalidate 'rdataset'.
- *
- * Requires:
- *\li 'rdataset' is a valid, disassociated rdataset.
- *
- * Ensures:
- *\li If assertion checking is enabled, future attempts to use 'rdataset'
- * without initializing it will cause an assertion failure.
- */
-
-void
-dns_rdataset_disassociate(dns_rdataset_t *rdataset);
-/*%<
- * Disassociate 'rdataset' from its rdata, allowing it to be reused.
- *
- * Notes:
- *\li The client must ensure it has no references to rdata in the rdataset
- * before disassociating.
- *
- * Requires:
- *\li 'rdataset' is a valid, associated rdataset.
- *
- * Ensures:
- *\li 'rdataset' is a valid, disassociated rdataset.
- */
-
-isc_boolean_t
-dns_rdataset_isassociated(dns_rdataset_t *rdataset);
-/*%<
- * Is 'rdataset' associated?
- *
- * Requires:
- *\li 'rdataset' is a valid rdataset.
- *
- * Returns:
- *\li #ISC_TRUE 'rdataset' is associated.
- *\li #ISC_FALSE 'rdataset' is not associated.
- */
-
-void
-dns_rdataset_makequestion(dns_rdataset_t *rdataset, dns_rdataclass_t rdclass,
- dns_rdatatype_t type);
-/*%<
- * Make 'rdataset' a valid, associated, question rdataset, with a
- * question class of 'rdclass' and type 'type'.
- *
- * Notes:
- *\li Question rdatasets have a class and type, but no rdata.
- *
- * Requires:
- *\li 'rdataset' is a valid, disassociated rdataset.
- *
- * Ensures:
- *\li 'rdataset' is a valid, associated, question rdataset.
- */
-
-void
-dns_rdataset_clone(dns_rdataset_t *source, dns_rdataset_t *target);
-/*%<
- * Make 'target' refer to the same rdataset as 'source'.
- *
- * Requires:
- *\li 'source' is a valid, associated rdataset.
- *
- *\li 'target' is a valid, dissociated rdataset.
- *
- * Ensures:
- *\li 'target' references the same rdataset as 'source'.
- */
-
-unsigned int
-dns_rdataset_count(dns_rdataset_t *rdataset);
-/*%<
- * Return the number of records in 'rdataset'.
- *
- * Requires:
- *\li 'rdataset' is a valid, associated rdataset.
- *
- * Returns:
- *\li The number of records in 'rdataset'.
- */
-
-isc_result_t
-dns_rdataset_first(dns_rdataset_t *rdataset);
-/*%<
- * Move the rdata cursor to the first rdata in the rdataset (if any).
- *
- * Requires:
- *\li 'rdataset' is a valid, associated rdataset.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMORE There are no rdata in the set.
- */
-
-isc_result_t
-dns_rdataset_next(dns_rdataset_t *rdataset);
-/*%<
- * Move the rdata cursor to the next rdata in the rdataset (if any).
- *
- * Requires:
- *\li 'rdataset' is a valid, associated rdataset.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMORE There are no more rdata in the set.
- */
-
-void
-dns_rdataset_current(dns_rdataset_t *rdataset, dns_rdata_t *rdata);
-/*%<
- * Make 'rdata' refer to the current rdata.
- *
- * Notes:
- *
- *\li The data returned in 'rdata' is valid for the life of the
- * rdataset; in particular, subsequent changes in the cursor position
- * do not invalidate 'rdata'.
- *
- * Requires:
- *\li 'rdataset' is a valid, associated rdataset.
- *
- *\li The rdata cursor of 'rdataset' is at a valid location (i.e. the
- * result of last call to a cursor movement command was ISC_R_SUCCESS).
- *
- * Ensures:
- *\li 'rdata' refers to the rdata at the rdata cursor location of
- *\li 'rdataset'.
- */
-
-isc_result_t
-dns_rdataset_totext(dns_rdataset_t *rdataset,
- dns_name_t *owner_name,
- isc_boolean_t omit_final_dot,
- isc_boolean_t question,
- isc_buffer_t *target);
-/*%<
- * Convert 'rdataset' to text format, storing the result in 'target'.
- *
- * Notes:
- *\li The rdata cursor position will be changed.
- *
- *\li The 'question' flag should normally be #ISC_FALSE. If it is
- * #ISC_TRUE, the TTL and rdata fields are not printed. This is
- * for use when printing an rdata representing a question section.
- *
- *\li This interface is deprecated; use dns_master_rdatasettottext()
- * and/or dns_master_questiontotext() instead.
- *
- * Requires:
- *\li 'rdataset' is a valid rdataset.
- *
- *\li 'rdataset' is not empty.
- */
-
-isc_result_t
-dns_rdataset_towire(dns_rdataset_t *rdataset,
- dns_name_t *owner_name,
- dns_compress_t *cctx,
- isc_buffer_t *target,
- unsigned int options,
- unsigned int *countp);
-/*%<
- * Convert 'rdataset' to wire format, compressing names as specified
- * in 'cctx', and storing the result in 'target'.
- *
- * Notes:
- *\li The rdata cursor position will be changed.
- *
- *\li The number of RRs added to target will be added to *countp.
- *
- * Requires:
- *\li 'rdataset' is a valid rdataset.
- *
- *\li 'rdataset' is not empty.
- *
- *\li 'countp' is a valid pointer.
- *
- * Ensures:
- *\li On a return of ISC_R_SUCCESS, 'target' contains a wire format
- * for the data contained in 'rdataset'. Any error return leaves
- * the buffer unchanged.
- *
- *\li *countp has been incremented by the number of RRs added to
- * target.
- *
- * Returns:
- *\li #ISC_R_SUCCESS - all ok
- *\li #ISC_R_NOSPACE - 'target' doesn't have enough room
- *
- *\li Any error returned by dns_rdata_towire(), dns_rdataset_next(),
- * dns_name_towire().
- */
-
-isc_result_t
-dns_rdataset_towiresorted(dns_rdataset_t *rdataset,
- const dns_name_t *owner_name,
- dns_compress_t *cctx,
- isc_buffer_t *target,
- dns_rdatasetorderfunc_t order,
- const void *order_arg,
- unsigned int options,
- unsigned int *countp);
-/*%<
- * Like dns_rdataset_towire(), but sorting the rdatasets according to
- * the integer value returned by 'order' when called with the rdataset
- * and 'order_arg' as arguments.
- *
- * Requires:
- *\li All the requirements of dns_rdataset_towire(), and
- * that order_arg is NULL if and only if order is NULL.
- */
-
-isc_result_t
-dns_rdataset_towirepartial(dns_rdataset_t *rdataset,
- const dns_name_t *owner_name,
- dns_compress_t *cctx,
- isc_buffer_t *target,
- dns_rdatasetorderfunc_t order,
- const void *order_arg,
- unsigned int options,
- unsigned int *countp,
- void **state);
-/*%<
- * Like dns_rdataset_towiresorted() except that a partial rdataset
- * may be written.
- *
- * Requires:
- *\li All the requirements of dns_rdataset_towiresorted().
- * If 'state' is non NULL then the current position in the
- * rdataset will be remembered if the rdataset in not
- * completely written and should be passed on on subsequent
- * calls (NOT CURRENTLY IMPLEMENTED).
- *
- * Returns:
- *\li #ISC_R_SUCCESS if all of the records were written.
- *\li #ISC_R_NOSPACE if unable to fit in all of the records. *countp
- * will be updated to reflect the number of records
- * written.
- */
-
-isc_result_t
-dns_rdataset_additionaldata(dns_rdataset_t *rdataset,
- dns_additionaldatafunc_t add, void *arg);
-/*%<
- * For each rdata in rdataset, call 'add' for each name and type in the
- * rdata which is subject to additional section processing.
- *
- * Requires:
- *
- *\li 'rdataset' is a valid, non-question rdataset.
- *
- *\li 'add' is a valid dns_additionaldatafunc_t
- *
- * Ensures:
- *
- *\li If successful, dns_rdata_additionaldata() will have been called for
- * each rdata in 'rdataset'.
- *
- *\li If a call to dns_rdata_additionaldata() is not successful, the
- * result returned will be the result of dns_rdataset_additionaldata().
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *
- *\li Any error that dns_rdata_additionaldata() can return.
- */
-
-isc_result_t
-dns_rdataset_getnoqname(dns_rdataset_t *rdataset, dns_name_t *name,
- dns_rdataset_t *neg, dns_rdataset_t *negsig);
-/*%<
- * Return the noqname proof for this record.
- *
- * Requires:
- *\li 'rdataset' to be valid and #DNS_RDATASETATTR_NOQNAME to be set.
- *\li 'name' to be valid.
- *\li 'neg' and 'negsig' to be valid and not associated.
- */
-
-isc_result_t
-dns_rdataset_addnoqname(dns_rdataset_t *rdataset, dns_name_t *name);
-/*%<
- * Associate a noqname proof with this record.
- * Sets #DNS_RDATASETATTR_NOQNAME if successful.
- * Adjusts the 'rdataset->ttl' to minimum of the 'rdataset->ttl' and
- * the 'nsec'/'nsec3' and 'rrsig(nsec)'/'rrsig(nsec3)' ttl.
- *
- * Requires:
- *\li 'rdataset' to be valid and #DNS_RDATASETATTR_NOQNAME to be set.
- *\li 'name' to be valid and have NSEC or NSEC3 and associated RRSIG
- * rdatasets.
- */
-
-isc_result_t
-dns_rdataset_getclosest(dns_rdataset_t *rdataset, dns_name_t *name,
- dns_rdataset_t *nsec, dns_rdataset_t *nsecsig);
-/*%<
- * Return the closest encloser for this record.
- *
- * Requires:
- *\li 'rdataset' to be valid and #DNS_RDATASETATTR_CLOSEST to be set.
- *\li 'name' to be valid.
- *\li 'nsec' and 'nsecsig' to be valid and not associated.
- */
-
-isc_result_t
-dns_rdataset_addclosest(dns_rdataset_t *rdataset, dns_name_t *name);
-/*%<
- * Associate a closest encloset proof with this record.
- * Sets #DNS_RDATASETATTR_CLOSEST if successful.
- * Adjusts the 'rdataset->ttl' to minimum of the 'rdataset->ttl' and
- * the 'nsec' and 'rrsig(nsec)' ttl.
- *
- * Requires:
- *\li 'rdataset' to be valid and #DNS_RDATASETATTR_CLOSEST to be set.
- *\li 'name' to be valid and have NSEC3 and RRSIG(NSEC3) rdatasets.
- */
-
-isc_result_t
-dns_rdataset_getadditional(dns_rdataset_t *rdataset,
- dns_rdatasetadditional_t type,
- dns_rdatatype_t qtype,
- dns_acache_t *acache,
- dns_zone_t **zonep,
- dns_db_t **dbp,
- dns_dbversion_t **versionp,
- dns_dbnode_t **nodep,
- dns_name_t *fname,
- dns_message_t *msg,
- isc_stdtime_t now);
-/*%<
- * Get cached additional information from the DB node for a particular
- * 'rdataset.' 'type' is one of dns_rdatasetadditional_fromauth,
- * dns_rdatasetadditional_fromcache, and dns_rdatasetadditional_fromglue,
- * which specifies the origin of the information. 'qtype' is intended to
- * be used for specifying a particular rdata type in the cached information.
- *
- * Requires:
- * \li 'rdataset' is a valid rdataset.
- * \li 'acache' can be NULL, in which case this function will simply return
- * ISC_R_FAILURE.
- * \li For the other pointers, see dns_acache_getentry().
- *
- * Ensures:
- * \li See dns_acache_getentry().
- *
- * Returns:
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_FAILURE - additional information caching is not supported.
- * \li #ISC_R_NOTFOUND - the corresponding DB node has not cached additional
- * information for 'rdataset.'
- * \li Any error that dns_acache_getentry() can return.
- */
-
-isc_result_t
-dns_rdataset_setadditional(dns_rdataset_t *rdataset,
- dns_rdatasetadditional_t type,
- dns_rdatatype_t qtype,
- dns_acache_t *acache,
- dns_zone_t *zone,
- dns_db_t *db,
- dns_dbversion_t *version,
- dns_dbnode_t *node,
- dns_name_t *fname);
-/*%<
- * Set cached additional information to the DB node for a particular
- * 'rdataset.' See dns_rdataset_getadditional for the semantics of 'type'
- * and 'qtype'.
- *
- * Requires:
- * \li 'rdataset' is a valid rdataset.
- * \li 'acache' can be NULL, in which case this function will simply return
- * ISC_R_FAILURE.
- * \li For the other pointers, see dns_acache_setentry().
- *
- * Ensures:
- * \li See dns_acache_setentry().
- *
- * Returns:
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_FAILURE - additional information caching is not supported.
- * \li #ISC_R_NOMEMORY
- * \li Any error that dns_acache_setentry() can return.
- */
-
-isc_result_t
-dns_rdataset_putadditional(dns_acache_t *acache,
- dns_rdataset_t *rdataset,
- dns_rdatasetadditional_t type,
- dns_rdatatype_t qtype);
-/*%<
- * Discard cached additional information stored in the DB node for a particular
- * 'rdataset.' See dns_rdataset_getadditional for the semantics of 'type'
- * and 'qtype'.
- *
- * Requires:
- * \li 'rdataset' is a valid rdataset.
- * \li 'acache' can be NULL, in which case this function will simply return
- * ISC_R_FAILURE.
- *
- * Ensures:
- * \li See dns_acache_cancelentry().
- *
- * Returns:
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_FAILURE - additional information caching is not supported.
- * \li #ISC_R_NOTFOUND - the corresponding DB node has not cached additional
- * information for 'rdataset.'
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_RDATASET_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: rdatasetiter.h,v 1.21 2007/06/19 23:47:17 tbox Exp $ */
-
-#ifndef DNS_RDATASETITER_H
-#define DNS_RDATASETITER_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/rdatasetiter.h
- * \brief
- * The DNS Rdataset Iterator interface allows iteration of all of the
- * rdatasets at a node.
- *
- * The dns_rdatasetiter_t type is like a "virtual class". To actually use
- * it, an implementation of the class is required. This implementation is
- * supplied by the database.
- *
- * It is the client's responsibility to call dns_rdataset_disassociate()
- * on all rdatasets returned.
- *
- * XXX more XXX
- *
- * MP:
- *\li The iterator itself is not locked. The caller must ensure
- * synchronization.
- *
- *\li The iterator methods ensure appropriate database locking.
- *
- * Reliability:
- *\li No anticipated impact.
- *
- * Resources:
- *\li TBS
- *
- * Security:
- *\li No anticipated impact.
- *
- * Standards:
- *\li None.
- */
-
-/*****
- ***** Imports
- *****/
-
-#include <isc/lang.h>
-#include <isc/magic.h>
-#include <isc/stdtime.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/*****
- ***** Types
- *****/
-
-typedef struct dns_rdatasetitermethods {
- void (*destroy)(dns_rdatasetiter_t **iteratorp);
- isc_result_t (*first)(dns_rdatasetiter_t *iterator);
- isc_result_t (*next)(dns_rdatasetiter_t *iterator);
- void (*current)(dns_rdatasetiter_t *iterator,
- dns_rdataset_t *rdataset);
-} dns_rdatasetitermethods_t;
-
-#define DNS_RDATASETITER_MAGIC ISC_MAGIC('D','N','S','i')
-#define DNS_RDATASETITER_VALID(i) ISC_MAGIC_VALID(i, DNS_RDATASETITER_MAGIC)
-
-/*%
- * This structure is actually just the common prefix of a DNS db
- * implementation's version of a dns_rdatasetiter_t.
- * \brief
- * Direct use of this structure by clients is forbidden. DB implementations
- * may change the structure. 'magic' must be #DNS_RDATASETITER_MAGIC for
- * any of the dns_rdatasetiter routines to work. DB implementations must
- * maintain all DB rdataset iterator invariants.
- */
-struct dns_rdatasetiter {
- /* Unlocked. */
- unsigned int magic;
- dns_rdatasetitermethods_t * methods;
- dns_db_t * db;
- dns_dbnode_t * node;
- dns_dbversion_t * version;
- isc_stdtime_t now;
-};
-
-void
-dns_rdatasetiter_destroy(dns_rdatasetiter_t **iteratorp);
-/*%<
- * Destroy '*iteratorp'.
- *
- * Requires:
- *
- *\li '*iteratorp' is a valid iterator.
- *
- * Ensures:
- *
- *\li All resources used by the iterator are freed.
- *
- *\li *iteratorp == NULL.
- */
-
-isc_result_t
-dns_rdatasetiter_first(dns_rdatasetiter_t *iterator);
-/*%<
- * Move the rdataset cursor to the first rdataset at the node (if any).
- *
- * Requires:
- *\li 'iterator' is a valid iterator.
- *
- * Returns:
- *\li ISC_R_SUCCESS
- *\li ISC_R_NOMORE There are no rdatasets at the node.
- *
- *\li Other results are possible, depending on the DB implementation.
- */
-
-isc_result_t
-dns_rdatasetiter_next(dns_rdatasetiter_t *iterator);
-/*%<
- * Move the rdataset cursor to the next rdataset at the node (if any).
- *
- * Requires:
- *\li 'iterator' is a valid iterator.
- *
- * Returns:
- *\li ISC_R_SUCCESS
- *\li ISC_R_NOMORE There are no more rdatasets at the
- * node.
- *
- *\li Other results are possible, depending on the DB implementation.
- */
-
-void
-dns_rdatasetiter_current(dns_rdatasetiter_t *iterator,
- dns_rdataset_t *rdataset);
-/*%<
- * Return the current rdataset.
- *
- * Requires:
- *\li 'iterator' is a valid iterator.
- *
- *\li 'rdataset' is a valid, disassociated rdataset.
- *
- *\li The rdataset cursor of 'iterator' is at a valid location (i.e. the
- * result of last call to a cursor movement command was #ISC_R_SUCCESS).
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_RDATASETITER_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: rdataslab.h,v 1.33 2008/04/01 23:47:10 tbox Exp $ */
-
-#ifndef DNS_RDATASLAB_H
-#define DNS_RDATASLAB_H 1
-
-/*! \file dns/rdataslab.h
- * \brief
- * Implements storage of rdatasets into slabs of memory.
- *
- * MP:
- *\li Clients of this module must impose any required synchronization.
- *
- * Reliability:
- *\li This module deals with low-level byte streams. Errors in any of
- * the functions are likely to crash the server or corrupt memory.
- *
- *\li If the caller passes invalid memory references, these functions are
- * likely to crash the server or corrupt memory.
- *
- * Resources:
- *\li None.
- *
- * Security:
- *\li None.
- *
- * Standards:
- *\li None.
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-#define DNS_RDATASLAB_FORCE 0x1
-#define DNS_RDATASLAB_EXACT 0x2
-
-#define DNS_RDATASLAB_OFFLINE 0x01 /* RRSIG is for offline DNSKEY */
-#define DNS_RDATASLAB_WARNMASK 0x0E /*%< RRSIG(DNSKEY) expired
- * warnings number mask. */
-#define DNS_RDATASLAB_WARNSHIFT 1 /*%< How many bits to shift to find
- * remaining expired warning number. */
-
-
-/***
- *** Functions
- ***/
-
-isc_result_t
-dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx,
- isc_region_t *region, unsigned int reservelen);
-/*%<
- * Slabify a rdataset. The slab area will be allocated and returned
- * in 'region'.
- *
- * Requires:
- *\li 'rdataset' is valid.
- *
- * Ensures:
- *\li 'region' will have base pointing to the start of allocated memory,
- * with the slabified region beginning at region->base + reservelen.
- * region->length contains the total length allocated.
- *
- * Returns:
- *\li ISC_R_SUCCESS - successful completion
- *\li ISC_R_NOMEMORY - no memory.
- *\li XXX others
- */
-
-void
-dns_rdataslab_tordataset(unsigned char *slab, unsigned int reservelen,
- dns_rdataclass_t rdclass, dns_rdatatype_t rdtype,
- dns_rdatatype_t covers, dns_ttl_t ttl,
- dns_rdataset_t *rdataset);
-/*%<
- * Construct an rdataset from a slab.
- *
- * Requires:
- *\li 'slab' points to a slab.
- *\li 'rdataset' is disassociated.
- *
- * Ensures:
- *\li 'rdataset' is associated and points to a valid rdataest.
- */
-unsigned int
-dns_rdataslab_size(unsigned char *slab, unsigned int reservelen);
-/*%<
- * Return the total size of an rdataslab.
- *
- * Requires:
- *\li 'slab' points to a slab.
- *
- * Returns:
- *\li The number of bytes in the slab, including the reservelen.
- */
-
-isc_result_t
-dns_rdataslab_merge(unsigned char *oslab, unsigned char *nslab,
- unsigned int reservelen, isc_mem_t *mctx,
- dns_rdataclass_t rdclass, dns_rdatatype_t type,
- unsigned int flags, unsigned char **tslabp);
-/*%<
- * Merge 'oslab' and 'nslab'.
- */
-
-isc_result_t
-dns_rdataslab_subtract(unsigned char *mslab, unsigned char *sslab,
- unsigned int reservelen, isc_mem_t *mctx,
- dns_rdataclass_t rdclass, dns_rdatatype_t type,
- unsigned int flags, unsigned char **tslabp);
-/*%<
- * Subtract 'sslab' from 'mslab'. If 'exact' is true then all elements
- * of 'sslab' must exist in 'mslab'.
- *
- * XXX
- * valid flags are DNS_RDATASLAB_EXACT
- */
-
-isc_boolean_t
-dns_rdataslab_equal(unsigned char *slab1, unsigned char *slab2,
- unsigned int reservelen);
-/*%<
- * Compare two rdataslabs for equality. This does _not_ do a full
- * DNSSEC comparison.
- *
- * Requires:
- *\li 'slab1' and 'slab2' point to slabs.
- *
- * Returns:
- *\li ISC_TRUE if the slabs are equal, ISC_FALSE otherwise.
- */
-isc_boolean_t
-dns_rdataslab_equalx(unsigned char *slab1, unsigned char *slab2,
- unsigned int reservelen, dns_rdataclass_t rdclass,
- dns_rdatatype_t type);
-/*%<
- * Compare two rdataslabs for DNSSEC equality.
- *
- * Requires:
- *\li 'slab1' and 'slab2' point to slabs.
- *
- * Returns:
- *\li ISC_TRUE if the slabs are equal, #ISC_FALSE otherwise.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_RDATASLAB_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2003 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/***************
- ***************
- *************** THIS FILE IS AUTOMATICALLY GENERATED BY gen.c.
- *************** DO NOT EDIT!
- ***************
- ***************/
-
-/*! \file */
-
-/*
- * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: rdatastructpre.h,v 1.16 2007/06/19 23:47:17 tbox Exp $ */
-
-#ifndef DNS_RDATASTRUCT_H
-#define DNS_RDATASTRUCT_H 1
-
-#include <isc/lang.h>
-#include <isc/sockaddr.h>
-
-#include <dns/name.h>
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-typedef struct dns_rdatacommon {
- dns_rdataclass_t rdclass;
- dns_rdatatype_t rdtype;
- ISC_LINK(struct dns_rdatacommon) link;
-} dns_rdatacommon_t;
-
-#define DNS_RDATACOMMON_INIT(_data, _rdtype, _rdclass) \
- do { \
- (_data)->common.rdtype = (_rdtype); \
- (_data)->common.rdclass = (_rdclass); \
- ISC_LINK_INIT(&(_data)->common, link); \
- } while (0)
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/* */
-#ifndef IN_1_A_1_H
-#define IN_1_A_1_H 1
-
-/* $Id: a_1.h,v 1.28 2007/06/19 23:47:17 tbox Exp $ */
-
-typedef struct dns_rdata_in_a {
- dns_rdatacommon_t common;
- struct in_addr in_addr;
-} dns_rdata_in_a_t;
-
-#endif /* IN_1_A_1_H */
-/*
- * Copyright (C) 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: a_1.h,v 1.5 2007/06/19 23:47:17 tbox Exp $ */
-
-/* by Bjorn.Victor@it.uu.se, 2005-05-07 */
-/* Based on generic/mx_15.h */
-
-#ifndef CH_3_A_1_H
-#define CH_3_A_1_H 1
-
-typedef isc_uint16_t ch_addr_t;
-
-typedef struct dns_rdata_ch_a {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- dns_name_t ch_addr_dom; /* ch-addr domain for back mapping */
- ch_addr_t ch_addr; /* chaos address (16 bit) network order */
-} dns_rdata_ch_a_t;
-
-#endif /* CH_3_A_1_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/* */
-#ifndef HS_4_A_1_H
-#define HS_4_A_1_H 1
-
-/* $Id: a_1.h,v 1.12 2007/06/19 23:47:17 tbox Exp $ */
-
-typedef struct dns_rdata_hs_a {
- dns_rdatacommon_t common;
- struct in_addr in_addr;
-} dns_rdata_hs_a_t;
-
-#endif /* HS_4_A_1_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/* */
-#ifndef GENERIC_NS_2_H
-#define GENERIC_NS_2_H 1
-
-/* $Id: ns_2.h,v 1.27 2007/06/19 23:47:17 tbox Exp $ */
-
-typedef struct dns_rdata_ns {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- dns_name_t name;
-} dns_rdata_ns_t;
-
-
-#endif /* GENERIC_NS_2_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/* */
-#ifndef GENERIC_MD_3_H
-#define GENERIC_MD_3_H 1
-
-/* $Id: md_3.h,v 1.28 2007/06/19 23:47:17 tbox Exp $ */
-
-typedef struct dns_rdata_md {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- dns_name_t md;
-} dns_rdata_md_t;
-
-
-#endif /* GENERIC_MD_3_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/* */
-#ifndef GENERIC_MF_4_H
-#define GENERIC_MF_4_H 1
-
-/* $Id: mf_4.h,v 1.26 2007/06/19 23:47:17 tbox Exp $ */
-
-typedef struct dns_rdata_mf {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- dns_name_t mf;
-} dns_rdata_mf_t;
-
-#endif /* GENERIC_MF_4_H */
-/*
- * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: cname_5.h,v 1.26 2007/06/19 23:47:17 tbox Exp $ */
-
-#ifndef GENERIC_CNAME_5_H
-#define GENERIC_CNAME_5_H 1
-
-typedef struct dns_rdata_cname {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- dns_name_t cname;
-} dns_rdata_cname_t;
-
-#endif /* GENERIC_CNAME_5_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/* */
-#ifndef GENERIC_SOA_6_H
-#define GENERIC_SOA_6_H 1
-
-/* $Id: soa_6.h,v 1.32 2007/06/19 23:47:17 tbox Exp $ */
-
-typedef struct dns_rdata_soa {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- dns_name_t origin;
- dns_name_t contact;
- isc_uint32_t serial; /*%< host order */
- isc_uint32_t refresh; /*%< host order */
- isc_uint32_t retry; /*%< host order */
- isc_uint32_t expire; /*%< host order */
- isc_uint32_t minimum; /*%< host order */
-} dns_rdata_soa_t;
-
-
-#endif /* GENERIC_SOA_6_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/* */
-#ifndef GENERIC_MB_7_H
-#define GENERIC_MB_7_H 1
-
-/* $Id: mb_7.h,v 1.27 2007/06/19 23:47:17 tbox Exp $ */
-
-typedef struct dns_rdata_mb {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- dns_name_t mb;
-} dns_rdata_mb_t;
-
-#endif /* GENERIC_MB_7_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/* */
-#ifndef GENERIC_MG_8_H
-#define GENERIC_MG_8_H 1
-
-/* $Id: mg_8.h,v 1.26 2007/06/19 23:47:17 tbox Exp $ */
-
-typedef struct dns_rdata_mg {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- dns_name_t mg;
-} dns_rdata_mg_t;
-
-#endif /* GENERIC_MG_8_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/* */
-#ifndef GENERIC_MR_9_H
-#define GENERIC_MR_9_H 1
-
-/* $Id: mr_9.h,v 1.26 2007/06/19 23:47:17 tbox Exp $ */
-
-typedef struct dns_rdata_mr {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- dns_name_t mr;
-} dns_rdata_mr_t;
-
-#endif /* GENERIC_MR_9_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/* */
-#ifndef GENERIC_NULL_10_H
-#define GENERIC_NULL_10_H 1
-
-/* $Id: null_10.h,v 1.25 2007/06/19 23:47:17 tbox Exp $ */
-
-typedef struct dns_rdata_null {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- isc_uint16_t length;
- unsigned char *data;
-} dns_rdata_null_t;
-
-
-#endif /* GENERIC_NULL_10_H */
-/*
- * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef IN_1_WKS_11_H
-#define IN_1_WKS_11_H 1
-
-/* $Id: wks_11.h,v 1.22 2007/06/19 23:47:17 tbox Exp $ */
-
-typedef struct dns_rdata_in_wks {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- struct in_addr in_addr;
- isc_uint16_t protocol;
- unsigned char *map;
- isc_uint16_t map_len;
-} dns_rdata_in_wks_t;
-
-#endif /* IN_1_WKS_11_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/* */
-#ifndef GENERIC_PTR_12_H
-#define GENERIC_PTR_12_H 1
-
-/* $Id: ptr_12.h,v 1.27 2007/06/19 23:47:17 tbox Exp $ */
-
-typedef struct dns_rdata_ptr {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- dns_name_t ptr;
-} dns_rdata_ptr_t;
-
-#endif /* GENERIC_PTR_12_H */
-/*
- * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef GENERIC_HINFO_13_H
-#define GENERIC_HINFO_13_H 1
-
-/* $Id: hinfo_13.h,v 1.25 2007/06/19 23:47:17 tbox Exp $ */
-
-typedef struct dns_rdata_hinfo {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- char *cpu;
- char *os;
- isc_uint8_t cpu_len;
- isc_uint8_t os_len;
-} dns_rdata_hinfo_t;
-
-#endif /* GENERIC_HINFO_13_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/* */
-#ifndef GENERIC_MINFO_14_H
-#define GENERIC_MINFO_14_H 1
-
-/* $Id: minfo_14.h,v 1.27 2007/06/19 23:47:17 tbox Exp $ */
-
-typedef struct dns_rdata_minfo {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- dns_name_t rmailbox;
- dns_name_t emailbox;
-} dns_rdata_minfo_t;
-
-#endif /* GENERIC_MINFO_14_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/* */
-#ifndef GENERIC_MX_15_H
-#define GENERIC_MX_15_H 1
-
-/* $Id: mx_15.h,v 1.29 2007/06/19 23:47:17 tbox Exp $ */
-
-typedef struct dns_rdata_mx {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- isc_uint16_t pref;
- dns_name_t mx;
-} dns_rdata_mx_t;
-
-#endif /* GENERIC_MX_15_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/* */
-#ifndef GENERIC_TXT_16_H
-#define GENERIC_TXT_16_H 1
-
-/* $Id: txt_16.h,v 1.28 2007/06/19 23:47:17 tbox Exp $ */
-
-typedef struct dns_rdata_txt_string {
- isc_uint8_t length;
- unsigned char *data;
-} dns_rdata_txt_string_t;
-
-typedef struct dns_rdata_txt {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- unsigned char *txt;
- isc_uint16_t txt_len;
- /* private */
- isc_uint16_t offset;
-} dns_rdata_txt_t;
-
-/*
- * ISC_LANG_BEGINDECLS and ISC_LANG_ENDDECLS are already done
- * via rdatastructpre.h and rdatastructsuf.h.
- */
-
-isc_result_t
-dns_rdata_txt_first(dns_rdata_txt_t *);
-
-isc_result_t
-dns_rdata_txt_next(dns_rdata_txt_t *);
-
-isc_result_t
-dns_rdata_txt_current(dns_rdata_txt_t *, dns_rdata_txt_string_t *);
-
-#endif /* GENERIC_TXT_16_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef GENERIC_RP_17_H
-#define GENERIC_RP_17_H 1
-
-/* $Id: rp_17.h,v 1.21 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief Per RFC1183 */
-
-typedef struct dns_rdata_rp {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- dns_name_t mail;
- dns_name_t text;
-} dns_rdata_rp_t;
-
-
-#endif /* GENERIC_RP_17_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef GENERIC_AFSDB_18_H
-#define GENERIC_AFSDB_18_H 1
-
-/* $Id: afsdb_18.h,v 1.20 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief Per RFC1183 */
-
-typedef struct dns_rdata_afsdb {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- isc_uint16_t subtype;
- dns_name_t server;
-} dns_rdata_afsdb_t;
-
-#endif /* GENERIC_AFSDB_18_H */
-
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef GENERIC_X25_19_H
-#define GENERIC_X25_19_H 1
-
-/* $Id: x25_19.h,v 1.18 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief Per RFC1183 */
-
-typedef struct dns_rdata_x25 {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- unsigned char *x25;
- isc_uint8_t x25_len;
-} dns_rdata_x25_t;
-
-#endif /* GENERIC_X25_19_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef GENERIC_ISDN_20_H
-#define GENERIC_ISDN_20_H 1
-
-/* $Id: isdn_20.h,v 1.18 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief Per RFC1183 */
-
-typedef struct dns_rdata_isdn {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- char *isdn;
- char *subaddress;
- isc_uint8_t isdn_len;
- isc_uint8_t subaddress_len;
-} dns_rdata_isdn_t;
-
-#endif /* GENERIC_ISDN_20_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef GENERIC_RT_21_H
-#define GENERIC_RT_21_H 1
-
-/* $Id: rt_21.h,v 1.21 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief Per RFC1183 */
-
-typedef struct dns_rdata_rt {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- isc_uint16_t preference;
- dns_name_t host;
-} dns_rdata_rt_t;
-
-#endif /* GENERIC_RT_21_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef IN_1_NSAP_22_H
-#define IN_1_NSAP_22_H 1
-
-/* $Id: nsap_22.h,v 1.18 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief Per RFC1706 */
-
-typedef struct dns_rdata_in_nsap {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- unsigned char *nsap;
- isc_uint16_t nsap_len;
-} dns_rdata_in_nsap_t;
-
-#endif /* IN_1_NSAP_22_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef IN_1_NSAP_PTR_23_H
-#define IN_1_NSAP_PTR_23_H 1
-
-/* $Id: nsap-ptr_23.h,v 1.19 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief Per RFC1348. Obsoleted in RFC 1706 - use PTR instead. */
-
-typedef struct dns_rdata_in_nsap_ptr {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- dns_name_t owner;
-} dns_rdata_in_nsap_ptr_t;
-
-#endif /* IN_1_NSAP_PTR_23_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef GENERIC_SIG_24_H
-#define GENERIC_SIG_24_H 1
-
-/* $Id: sig_24.h,v 1.26 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief Per RFC2535 */
-
-typedef struct dns_rdata_sig_t {
- dns_rdatacommon_t common;
- isc_mem_t * mctx;
- dns_rdatatype_t covered;
- dns_secalg_t algorithm;
- isc_uint8_t labels;
- isc_uint32_t originalttl;
- isc_uint32_t timeexpire;
- isc_uint32_t timesigned;
- isc_uint16_t keyid;
- dns_name_t signer;
- isc_uint16_t siglen;
- unsigned char * signature;
-} dns_rdata_sig_t;
-
-
-#endif /* GENERIC_SIG_24_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef GENERIC_KEY_25_H
-#define GENERIC_KEY_25_H 1
-
-/* $Id: key_25.h,v 1.19 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief Per RFC2535 */
-
-typedef struct dns_rdata_key_t {
- dns_rdatacommon_t common;
- isc_mem_t * mctx;
- isc_uint16_t flags;
- isc_uint8_t protocol;
- isc_uint8_t algorithm;
- isc_uint16_t datalen;
- unsigned char * data;
-} dns_rdata_key_t;
-
-
-#endif /* GENERIC_KEY_25_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef IN_1_PX_26_H
-#define IN_1_PX_26_H 1
-
-/* $Id: px_26.h,v 1.19 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief Per RFC2163 */
-
-typedef struct dns_rdata_in_px {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- isc_uint16_t preference;
- dns_name_t map822;
- dns_name_t mapx400;
-} dns_rdata_in_px_t;
-
-#endif /* IN_1_PX_26_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef GENERIC_GPOS_27_H
-#define GENERIC_GPOS_27_H 1
-
-/* $Id: gpos_27.h,v 1.17 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief per RFC1712 */
-
-typedef struct dns_rdata_gpos {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- char *longitude;
- char *latitude;
- char *altitude;
- isc_uint8_t long_len;
- isc_uint8_t lat_len;
- isc_uint8_t alt_len;
-} dns_rdata_gpos_t;
-
-#endif /* GENERIC_GPOS_27_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef IN_1_AAAA_28_H
-#define IN_1_AAAA_28_H 1
-
-/* $Id: aaaa_28.h,v 1.21 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief Per RFC1886 */
-
-typedef struct dns_rdata_in_aaaa {
- dns_rdatacommon_t common;
- struct in6_addr in6_addr;
-} dns_rdata_in_aaaa_t;
-
-#endif /* IN_1_AAAA_28_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef GENERIC_LOC_29_H
-#define GENERIC_LOC_29_H 1
-
-/* $Id: loc_29.h,v 1.19 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief Per RFC1876 */
-
-typedef struct dns_rdata_loc_0 {
- isc_uint8_t version; /* must be first and zero */
- isc_uint8_t size;
- isc_uint8_t horizontal;
- isc_uint8_t vertical;
- isc_uint32_t latitude;
- isc_uint32_t longitude;
- isc_uint32_t altitude;
-} dns_rdata_loc_0_t;
-
-typedef struct dns_rdata_loc {
- dns_rdatacommon_t common;
- union {
- dns_rdata_loc_0_t v0;
- } v;
-} dns_rdata_loc_t;
-
-#endif /* GENERIC_LOC_29_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef GENERIC_NXT_30_H
-#define GENERIC_NXT_30_H 1
-
-/* $Id: nxt_30.h,v 1.25 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief RFC2535 */
-
-typedef struct dns_rdata_nxt {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- dns_name_t next;
- unsigned char *typebits;
- isc_uint16_t len;
-} dns_rdata_nxt_t;
-
-#endif /* GENERIC_NXT_30_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef IN_1_SRV_33_H
-#define IN_1_SRV_33_H 1
-
-/* $Id: srv_33.h,v 1.19 2007/06/19 23:47:17 tbox Exp $ */
-
-/* Reviewed: Fri Mar 17 13:01:00 PST 2000 by bwelling */
-
-/*!
- * \brief Per RFC2782 */
-
-typedef struct dns_rdata_in_srv {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- isc_uint16_t priority;
- isc_uint16_t weight;
- isc_uint16_t port;
- dns_name_t target;
-} dns_rdata_in_srv_t;
-
-#endif /* IN_1_SRV_33_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef IN_1_NAPTR_35_H
-#define IN_1_NAPTR_35_H 1
-
-/* $Id: naptr_35.h,v 1.23 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief Per RFC2915 */
-
-typedef struct dns_rdata_in_naptr {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- isc_uint16_t order;
- isc_uint16_t preference;
- char *flags;
- isc_uint8_t flags_len;
- char *service;
- isc_uint8_t service_len;
- char *regexp;
- isc_uint8_t regexp_len;
- dns_name_t replacement;
-} dns_rdata_in_naptr_t;
-
-#endif /* IN_1_NAPTR_35_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef IN_1_KX_36_H
-#define IN_1_KX_36_H 1
-
-/* $Id: kx_36.h,v 1.20 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief Per RFC2230 */
-
-typedef struct dns_rdata_in_kx {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- isc_uint16_t preference;
- dns_name_t exchange;
-} dns_rdata_in_kx_t;
-
-#endif /* IN_1_KX_36_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: cert_37.h,v 1.20 2007/06/19 23:47:17 tbox Exp $ */
-
-#ifndef GENERIC_CERT_37_H
-#define GENERIC_CERT_37_H 1
-
-/*% RFC2538 */
-typedef struct dns_rdata_cert {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- isc_uint16_t type;
- isc_uint16_t key_tag;
- isc_uint8_t algorithm;
- isc_uint16_t length;
- unsigned char *certificate;
-} dns_rdata_cert_t;
-
-#endif /* GENERIC_CERT_37_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef IN_1_A6_38_H
-#define IN_1_A6_38_H 1
-
-/* $Id: a6_38.h,v 1.24 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief Per RFC2874 */
-
-typedef struct dns_rdata_in_a6 {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- dns_name_t prefix;
- isc_uint8_t prefixlen;
- struct in6_addr in6_addr;
-} dns_rdata_in_a6_t;
-
-#endif /* IN_1_A6_38_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef GENERIC_DNAME_39_H
-#define GENERIC_DNAME_39_H 1
-
-/* $Id: dname_39.h,v 1.21 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief per RFC2672 */
-
-typedef struct dns_rdata_dname {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- dns_name_t dname;
-} dns_rdata_dname_t;
-
-#endif /* GENERIC_DNAME_39_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef GENERIC_OPT_41_H
-#define GENERIC_OPT_41_H 1
-
-/* $Id: opt_41.h,v 1.18 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief Per RFC2671 */
-
-typedef struct dns_rdata_opt_opcode {
- isc_uint16_t opcode;
- isc_uint16_t length;
- unsigned char *data;
-} dns_rdata_opt_opcode_t;
-
-typedef struct dns_rdata_opt {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- unsigned char *options;
- isc_uint16_t length;
- /* private */
- isc_uint16_t offset;
-} dns_rdata_opt_t;
-
-/*
- * ISC_LANG_BEGINDECLS and ISC_LANG_ENDDECLS are already done
- * via rdatastructpre.h and rdatastructsuf.h.
- */
-
-isc_result_t
-dns_rdata_opt_first(dns_rdata_opt_t *);
-
-isc_result_t
-dns_rdata_opt_next(dns_rdata_opt_t *);
-
-isc_result_t
-dns_rdata_opt_current(dns_rdata_opt_t *, dns_rdata_opt_opcode_t *);
-
-#endif /* GENERIC_OPT_41_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/* */
-#ifndef IN_1_APL_42_H
-#define IN_1_APL_42_H 1
-
-/* $Id: apl_42.h,v 1.6 2007/06/19 23:47:17 tbox Exp $ */
-
-typedef struct dns_rdata_apl_ent {
- isc_boolean_t negative;
- isc_uint16_t family;
- isc_uint8_t prefix;
- isc_uint8_t length;
- unsigned char *data;
-} dns_rdata_apl_ent_t;
-
-typedef struct dns_rdata_in_apl {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- /* type & class specific elements */
- unsigned char *apl;
- isc_uint16_t apl_len;
- /* private */
- isc_uint16_t offset;
-} dns_rdata_in_apl_t;
-
-/*
- * ISC_LANG_BEGINDECLS and ISC_LANG_ENDDECLS are already done
- * via rdatastructpre.h and rdatastructsuf.h.
- */
-
-isc_result_t
-dns_rdata_apl_first(dns_rdata_in_apl_t *);
-
-isc_result_t
-dns_rdata_apl_next(dns_rdata_in_apl_t *);
-
-isc_result_t
-dns_rdata_apl_current(dns_rdata_in_apl_t *, dns_rdata_apl_ent_t *);
-
-#endif /* IN_1_APL_42_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: ds_43.h,v 1.7 2007/06/19 23:47:17 tbox Exp $ */
-
-#ifndef GENERIC_DS_43_H
-#define GENERIC_DS_43_H 1
-
-/*!
- * \brief per draft-ietf-dnsext-delegation-signer-05.txt */
-typedef struct dns_rdata_ds {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- isc_uint16_t key_tag;
- isc_uint8_t algorithm;
- isc_uint8_t digest_type;
- isc_uint16_t length;
- unsigned char *digest;
-} dns_rdata_ds_t;
-
-#endif /* GENERIC_DS_43_H */
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: sshfp_44.h,v 1.8 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief Per RFC 4255 */
-
-#ifndef GENERIC_SSHFP_44_H
-#define GENERIC_SSHFP_44_H 1
-
-typedef struct dns_rdata_sshfp {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- isc_uint8_t algorithm;
- isc_uint8_t digest_type;
- isc_uint16_t length;
- unsigned char *digest;
-} dns_rdata_sshfp_t;
-
-#endif /* GENERIC_SSHFP_44_H */
-/*
- * Copyright (C) 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: ipseckey_45.h,v 1.4 2007/06/19 23:47:17 tbox Exp $ */
-
-#ifndef GENERIC_IPSECKEY_45_H
-#define GENERIC_IPSECKEY_45_H 1
-
-typedef struct dns_rdata_ipseckey {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- isc_uint8_t precedence;
- isc_uint8_t gateway_type;
- isc_uint8_t algorithm;
- struct in_addr in_addr; /* gateway type 1 */
- struct in6_addr in6_addr; /* gateway type 2 */
- dns_name_t gateway; /* gateway type 3 */
- unsigned char *key;
- isc_uint16_t keylength;
-} dns_rdata_ipseckey_t;
-
-#endif /* GENERIC_IPSECKEY_45_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef GENERIC_DNSSIG_46_H
-#define GENERIC_DNSSIG_46_H 1
-
-/* $Id: rrsig_46.h,v 1.7 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief Per RFC2535 */
-typedef struct dns_rdata_rrsig {
- dns_rdatacommon_t common;
- isc_mem_t * mctx;
- dns_rdatatype_t covered;
- dns_secalg_t algorithm;
- isc_uint8_t labels;
- isc_uint32_t originalttl;
- isc_uint32_t timeexpire;
- isc_uint32_t timesigned;
- isc_uint16_t keyid;
- dns_name_t signer;
- isc_uint16_t siglen;
- unsigned char * signature;
-} dns_rdata_rrsig_t;
-
-
-#endif /* GENERIC_DNSSIG_46_H */
-/*
- * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef GENERIC_NSEC_47_H
-#define GENERIC_NSEC_47_H 1
-
-/* $Id: nsec_47.h,v 1.10 2008/07/15 23:47:21 tbox Exp $ */
-
-/*!
- * \brief Per RFC 3845 */
-
-typedef struct dns_rdata_nsec {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- dns_name_t next;
- unsigned char *typebits;
- isc_uint16_t len;
-} dns_rdata_nsec_t;
-
-#endif /* GENERIC_NSEC_47_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef GENERIC_DNSKEY_48_H
-#define GENERIC_DNSKEY_48_H 1
-
-/* $Id: dnskey_48.h,v 1.7 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief per RFC2535 */
-
-typedef struct dns_rdata_dnskey {
- dns_rdatacommon_t common;
- isc_mem_t * mctx;
- isc_uint16_t flags;
- isc_uint8_t protocol;
- isc_uint8_t algorithm;
- isc_uint16_t datalen;
- unsigned char * data;
-} dns_rdata_dnskey_t;
-
-
-#endif /* GENERIC_DNSKEY_48_H */
-/*
- * Copyright (C) 2006, 2007 Internet Systems Consortium, Inc. ("ISC")
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/* */
-#ifndef IN_1_DHCID_49_H
-#define IN_1_DHCID_49_H 1
-
-/* $Id: dhcid_49.h,v 1.5 2007/06/19 23:47:17 tbox Exp $ */
-
-typedef struct dns_rdata_in_dhcid {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- unsigned char *dhcid;
- unsigned int length;
-} dns_rdata_in_dhcid_t;
-
-#endif /* IN_1_DHCID_49_H */
-/*
- * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC")
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-
-#ifndef GENERIC_NSEC3_50_H
-#define GENERIC_NSEC3_50_H 1
-
-/* $Id: nsec3_50.h,v 1.4 2008/09/25 04:02:39 tbox Exp $ */
-
-/*!
- * \brief Per RFC 5155 */
-
-#include <isc/iterated_hash.h>
-
-typedef struct dns_rdata_nsec3 {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- dns_hash_t hash;
- unsigned char flags;
- dns_iterations_t iterations;
- unsigned char salt_length;
- unsigned char next_length;
- isc_uint16_t len;
- unsigned char *salt;
- unsigned char *next;
- unsigned char *typebits;
-} dns_rdata_nsec3_t;
-
-/*
- * The corresponding NSEC3 interval is OPTOUT indicating possible
- * insecure delegations.
- */
-#define DNS_NSEC3FLAG_OPTOUT 0x01U
-
-/*%
- * Non-standard, NSEC3PARAM only.
- *
- * Create a corresponding NSEC3 chain.
- * Once the NSEC3 chain is complete this flag will be removed to signal
- * that there is a complete chain.
- *
- * This flag is automatically set when a NSEC3PARAM record is added to
- * the zone via UPDATE.
- *
- * NSEC3PARAM records with this flag set are supposed to be ignored by
- * RFC 5155 compliant nameservers.
- */
-#define DNS_NSEC3FLAG_CREATE 0x80U
-
-/*%
- * Non-standard, NSEC3PARAM only.
- *
- * The corresponding NSEC3 set is to be removed once the NSEC chain
- * has been generated.
- *
- * This flag is automatically set when the last active NSEC3PARAM record
- * is removed from the zone via UPDATE.
- *
- * NSEC3PARAM records with this flag set are supposed to be ignored by
- * RFC 5155 compliant nameservers.
- */
-#define DNS_NSEC3FLAG_REMOVE 0x40U
-
-/*%
- * Non-standard, NSEC3PARAM only.
- *
- * Used to identify NSEC3PARAM records added in this UPDATE request.
- */
-#define DNS_NSEC3FLAG_UPDATE 0x20U
-
-/*%
- * Non-standard, NSEC3PARAM only.
- *
- * Prevent the creation of a NSEC chain before the last NSEC3 chain
- * is removed. This will normally only be set when the zone is
- * transitioning from secure with NSEC3 chains to insecure.
- */
-#define DNS_NSEC3FLAG_NONSEC 0x10U
-
-#endif /* GENERIC_NSEC3_50_H */
-/*
- * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC")
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-
-#ifndef GENERIC_NSEC3PARAM_51_H
-#define GENERIC_NSEC3PARAM_51_H 1
-
-/* $Id: nsec3param_51.h,v 1.4 2008/09/25 04:02:39 tbox Exp $ */
-
-/*!
- * \brief Per RFC 5155 */
-
-#include <isc/iterated_hash.h>
-
-typedef struct dns_rdata_nsec3param {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- dns_hash_t hash;
- unsigned char flags; /* DNS_NSEC3FLAG_* */
- dns_iterations_t iterations;
- unsigned char salt_length;
- unsigned char *salt;
-} dns_rdata_nsec3param_t;
-
-#endif /* GENERIC_NSEC3PARAM_51_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef GENERIC_SPF_99_H
-#define GENERIC_SPF_99_H 1
-
-/* $Id: spf_99.h,v 1.4 2007/06/19 23:47:17 tbox Exp $ */
-
-typedef struct dns_rdata_spf_string {
- isc_uint8_t length;
- unsigned char *data;
-} dns_rdata_spf_string_t;
-
-typedef struct dns_rdata_spf {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- unsigned char *txt;
- isc_uint16_t txt_len;
- /* private */
- isc_uint16_t offset;
-} dns_rdata_spf_t;
-
-/*
- * ISC_LANG_BEGINDECLS and ISC_LANG_ENDDECLS are already done
- * via rdatastructpre.h and rdatastructsuf.h.
- */
-
-isc_result_t
-dns_rdata_spf_first(dns_rdata_spf_t *);
-
-isc_result_t
-dns_rdata_spf_next(dns_rdata_spf_t *);
-
-isc_result_t
-dns_rdata_spf_current(dns_rdata_spf_t *, dns_rdata_spf_string_t *);
-
-#endif /* GENERIC_SPF_99_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/* */
-#ifndef GENERIC_UNSPEC_103_H
-#define GENERIC_UNSPEC_103_H 1
-
-/* $Id: unspec_103.h,v 1.17 2007/06/19 23:47:17 tbox Exp $ */
-
-typedef struct dns_rdata_unspec_t {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- unsigned char *data;
- isc_uint16_t datalen;
-} dns_rdata_unspec_t;
-
-#endif /* GENERIC_UNSPEC_103_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001, 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef GENERIC_TKEY_249_H
-#define GENERIC_TKEY_249_H 1
-
-/* $Id: tkey_249.h,v 1.24 2007/06/19 23:47:17 tbox Exp $ */
-
-/*!
- * \brief Per draft-ietf-dnsind-tkey-00.txt */
-
-typedef struct dns_rdata_tkey {
- dns_rdatacommon_t common;
- isc_mem_t * mctx;
- dns_name_t algorithm;
- isc_uint32_t inception;
- isc_uint32_t expire;
- isc_uint16_t mode;
- isc_uint16_t error;
- isc_uint16_t keylen;
- unsigned char * key;
- isc_uint16_t otherlen;
- unsigned char * other;
-} dns_rdata_tkey_t;
-
-
-#endif /* GENERIC_TKEY_249_H */
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: tsig_250.h,v 1.25 2007/06/19 23:47:17 tbox Exp $ */
-
-#ifndef ANY_255_TSIG_250_H
-#define ANY_255_TSIG_250_H 1
-
-/*% RFC2845 */
-typedef struct dns_rdata_any_tsig {
- dns_rdatacommon_t common;
- isc_mem_t * mctx;
- dns_name_t algorithm;
- isc_uint64_t timesigned;
- isc_uint16_t fudge;
- isc_uint16_t siglen;
- unsigned char * signature;
- isc_uint16_t originalid;
- isc_uint16_t error;
- isc_uint16_t otherlen;
- unsigned char * other;
-} dns_rdata_any_tsig_t;
-
-#endif /* ANY_255_TSIG_250_H */
-/*
- * Copyright (C) 2004, 2006, 2007 Internet Systems Consortium, Inc. ("ISC")
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: dlv_32769.h,v 1.5 2007/06/19 23:47:17 tbox Exp $ */
-
-/* draft-ietf-dnsext-delegation-signer-05.txt */
-#ifndef GENERIC_DLV_32769_H
-#define GENERIC_DLV_32769_H 1
-
-typedef struct dns_rdata_dlv {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- isc_uint16_t key_tag;
- isc_uint8_t algorithm;
- isc_uint8_t digest_type;
- isc_uint16_t length;
- unsigned char *digest;
-} dns_rdata_dlv_t;
-
-#endif /* GENERIC_DLV_32769_H */
-/*
- * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: rdatastructsuf.h,v 1.10 2007/06/19 23:47:17 tbox Exp $ */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_RDATASTRUCT_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: rdatatype.h,v 1.26 2008/09/25 04:02:39 tbox Exp $ */
-
-#ifndef DNS_RDATATYPE_H
-#define DNS_RDATATYPE_H 1
-
-/*! \file dns/rdatatype.h */
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_rdatatype_fromtext(dns_rdatatype_t *typep, isc_textregion_t *source);
-/*%<
- * Convert the text 'source' refers to into a DNS rdata type.
- *
- * Requires:
- *\li 'typep' is a valid pointer.
- *
- *\li 'source' is a valid text region.
- *
- * Returns:
- *\li ISC_R_SUCCESS on success
- *\li DNS_R_UNKNOWN type is unknown
- */
-
-isc_result_t
-dns_rdatatype_totext(dns_rdatatype_t type, isc_buffer_t *target);
-/*%<
- * Put a textual representation of type 'type' into 'target'.
- *
- * Requires:
- *\li 'type' is a valid type.
- *
- *\li 'target' is a valid text buffer.
- *
- * Ensures,
- * if the result is success:
- *\li The used space in 'target' is updated.
- *
- * Returns:
- *\li #ISC_R_SUCCESS on success
- *\li #ISC_R_NOSPACE target buffer is too small
- */
-
-void
-dns_rdatatype_format(dns_rdatatype_t rdtype,
- char *array, unsigned int size);
-/*%<
- * Format a human-readable representation of the type 'rdtype'
- * into the character array 'array', which is of size 'size'.
- * The resulting string is guaranteed to be null-terminated.
- */
-
-#define DNS_RDATATYPE_FORMATSIZE sizeof("NSEC3PARAM")
-
-/*%<
- * Minimum size of array to pass to dns_rdatatype_format().
- * May need to be adjusted if a new RR type with a very long
- * name is defined.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_RDATATYPE_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: request.h,v 1.27.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef DNS_REQUEST_H
-#define DNS_REQUEST_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/request.h
- *
- * \brief
- * The request module provides simple request/response services useful for
- * sending SOA queries, DNS Notify messages, and dynamic update requests.
- *
- * MP:
- *\li The module ensures appropriate synchronization of data structures it
- * creates and manipulates.
- *
- * Resources:
- *\li TBS
- *
- * Security:
- *\li No anticipated impact.
- */
-
-#include <isc/lang.h>
-#include <isc/event.h>
-
-#include <dns/types.h>
-
-#define DNS_REQUESTOPT_TCP 0x00000001U
-
-typedef struct dns_requestevent {
- ISC_EVENT_COMMON(struct dns_requestevent);
- isc_result_t result;
- dns_request_t *request;
-} dns_requestevent_t;
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_requestmgr_create(isc_mem_t *mctx, isc_timermgr_t *timermgr,
- isc_socketmgr_t *socketmgr, isc_taskmgr_t *taskmgr,
- dns_dispatchmgr_t *dispatchmgr,
- dns_dispatch_t *dispatchv4, dns_dispatch_t *dispatchv6,
- dns_requestmgr_t **requestmgrp);
-/*%<
- * Create a request manager.
- *
- * Requires:
- *
- *\li 'mctx' is a valid memory context.
- *
- *\li 'timermgr' is a valid timer manager.
- *
- *\li 'socketmgr' is a valid socket manager.
- *
- *\li 'taskmgr' is a valid task manager.
- *
- *\li 'dispatchv4' is a valid dispatcher with an IPv4 UDP socket, or is NULL.
- *
- *\li 'dispatchv6' is a valid dispatcher with an IPv6 UDP socket, or is NULL.
- *
- *\li requestmgrp != NULL && *requestmgrp == NULL
- *
- * Ensures:
- *
- *\li On success, *requestmgrp is a valid request manager.
- *
- * Returns:
- *
- *\li ISC_R_SUCCESS
- *
- *\li Any other result indicates failure.
- */
-
-void
-dns_requestmgr_whenshutdown(dns_requestmgr_t *requestmgr, isc_task_t *task,
- isc_event_t **eventp);
-/*%<
- * Send '*eventp' to 'task' when 'requestmgr' has completed shutdown.
- *
- * Notes:
- *
- *\li It is not safe to detach the last reference to 'requestmgr' until
- * shutdown is complete.
- *
- * Requires:
- *
- *\li 'requestmgr' is a valid request manager.
- *
- *\li 'task' is a valid task.
- *
- *\li *eventp is a valid event.
- *
- * Ensures:
- *
- *\li *eventp == NULL.
- */
-
-void
-dns_requestmgr_shutdown(dns_requestmgr_t *requestmgr);
-/*%<
- * Start the shutdown process for 'requestmgr'.
- *
- * Notes:
- *
- *\li This call has no effect if the request manager is already shutting
- * down.
- *
- * Requires:
- *
- *\li 'requestmgr' is a valid requestmgr.
- */
-
-void
-dns_requestmgr_attach(dns_requestmgr_t *source, dns_requestmgr_t **targetp);
-/*%<
- * Attach to the request manager. dns_requestmgr_shutdown() must not
- * have been called on 'source' prior to calling dns_requestmgr_attach().
- *
- * Requires:
- *
- *\li 'source' is a valid requestmgr.
- *
- *\li 'targetp' to be non NULL and '*targetp' to be NULL.
- */
-
-void
-dns_requestmgr_detach(dns_requestmgr_t **requestmgrp);
-/*%<
- * Detach from the given requestmgr. If this is the final detach
- * requestmgr will be destroyed. dns_requestmgr_shutdown() must
- * be called before the final detach.
- *
- * Requires:
- *
- *\li '*requestmgrp' is a valid requestmgr.
- *
- * Ensures:
- *\li '*requestmgrp' is NULL.
- */
-
-isc_result_t
-dns_request_create(dns_requestmgr_t *requestmgr, dns_message_t *message,
- isc_sockaddr_t *address, unsigned int options,
- dns_tsigkey_t *key,
- unsigned int timeout, isc_task_t *task,
- isc_taskaction_t action, void *arg,
- dns_request_t **requestp);
-/*%<
- * Create and send a request.
- *
- * Notes:
- *
- *\li 'message' will be rendered and sent to 'address'. If the
- * #DNS_REQUESTOPT_TCP option is set, TCP will be used. The request
- * will timeout after 'timeout' seconds.
- *
- *\li When the request completes, successfully, due to a timeout, or
- * because it was canceled, a completion event will be sent to 'task'.
- *
- * Requires:
- *
- *\li 'message' is a valid DNS message.
- *
- *\li 'address' is a valid sockaddr.
- *
- *\li 'timeout' > 0
- *
- *\li 'task' is a valid task.
- *
- *\li requestp != NULL && *requestp == NULL
- */
-
-/*% See dns_request_createvia3() */
-isc_result_t
-dns_request_createvia(dns_requestmgr_t *requestmgr, dns_message_t *message,
- isc_sockaddr_t *srcaddr, isc_sockaddr_t *destaddr,
- unsigned int options, dns_tsigkey_t *key,
- unsigned int timeout, isc_task_t *task,
- isc_taskaction_t action, void *arg,
- dns_request_t **requestp);
-
-/*% See dns_request_createvia3() */
-isc_result_t
-dns_request_createvia2(dns_requestmgr_t *requestmgr, dns_message_t *message,
- isc_sockaddr_t *srcaddr, isc_sockaddr_t *destaddr,
- unsigned int options, dns_tsigkey_t *key,
- unsigned int timeout, unsigned int udptimeout,
- isc_task_t *task, isc_taskaction_t action, void *arg,
- dns_request_t **requestp);
-
-isc_result_t
-dns_request_createvia3(dns_requestmgr_t *requestmgr, dns_message_t *message,
- isc_sockaddr_t *srcaddr, isc_sockaddr_t *destaddr,
- unsigned int options, dns_tsigkey_t *key,
- unsigned int timeout, unsigned int udptimeout,
- unsigned int udpretries, isc_task_t *task,
- isc_taskaction_t action, void *arg,
- dns_request_t **requestp);
-/*%<
- * Create and send a request.
- *
- * Notes:
- *
- *\li 'message' will be rendered and sent to 'address'. If the
- * #DNS_REQUESTOPT_TCP option is set, TCP will be used. The request
- * will timeout after 'timeout' seconds. UDP requests will be resent
- * at 'udptimeout' intervals if non-zero or 'udpretries' is non-zero.
- *
- *\li When the request completes, successfully, due to a timeout, or
- * because it was canceled, a completion event will be sent to 'task'.
- *
- * Requires:
- *
- *\li 'message' is a valid DNS message.
- *
- *\li 'dstaddr' is a valid sockaddr.
- *
- *\li 'srcaddr' is a valid sockaddr or NULL.
- *
- *\li 'srcaddr' and 'dstaddr' are the same protocol family.
- *
- *\li 'timeout' > 0
- *
- *\li 'task' is a valid task.
- *
- *\li requestp != NULL && *requestp == NULL
- */
-
-/*% See dns_request_createraw3() */
-isc_result_t
-dns_request_createraw(dns_requestmgr_t *requestmgr, isc_buffer_t *msgbuf,
- isc_sockaddr_t *srcaddr, isc_sockaddr_t *destaddr,
- unsigned int options, unsigned int timeout,
- isc_task_t *task, isc_taskaction_t action, void *arg,
- dns_request_t **requestp);
-
-/*% See dns_request_createraw3() */
-isc_result_t
-dns_request_createraw2(dns_requestmgr_t *requestmgr, isc_buffer_t *msgbuf,
- isc_sockaddr_t *srcaddr, isc_sockaddr_t *destaddr,
- unsigned int options, unsigned int timeout,
- unsigned int udptimeout, isc_task_t *task,
- isc_taskaction_t action, void *arg,
- dns_request_t **requestp);
-
-isc_result_t
-dns_request_createraw3(dns_requestmgr_t *requestmgr, isc_buffer_t *msgbuf,
- isc_sockaddr_t *srcaddr, isc_sockaddr_t *destaddr,
- unsigned int options, unsigned int timeout,
- unsigned int udptimeout, unsigned int udpretries,
- isc_task_t *task, isc_taskaction_t action, void *arg,
- dns_request_t **requestp);
-/*!<
- * \brief Create and send a request.
- *
- * Notes:
- *
- *\li 'msgbuf' will be sent to 'destaddr' after setting the id. If the
- * #DNS_REQUESTOPT_TCP option is set, TCP will be used. The request
- * will timeout after 'timeout' seconds. UDP requests will be resent
- * at 'udptimeout' intervals if non-zero or if 'udpretries' is not zero.
- *
- *\li When the request completes, successfully, due to a timeout, or
- * because it was canceled, a completion event will be sent to 'task'.
- *
- * Requires:
- *
- *\li 'msgbuf' is a valid DNS message in compressed wire format.
- *
- *\li 'destaddr' is a valid sockaddr.
- *
- *\li 'srcaddr' is a valid sockaddr or NULL.
- *
- *\li 'srcaddr' and 'dstaddr' are the same protocol family.
- *
- *\li 'timeout' > 0
- *
- *\li 'task' is a valid task.
- *
- *\li requestp != NULL && *requestp == NULL
- */
-
-void
-dns_request_cancel(dns_request_t *request);
-/*%<
- * Cancel 'request'.
- *
- * Requires:
- *
- *\li 'request' is a valid request.
- *
- * Ensures:
- *
- *\li If the completion event for 'request' has not yet been sent, it
- * will be sent, and the result code will be ISC_R_CANCELED.
- */
-
-isc_result_t
-dns_request_getresponse(dns_request_t *request, dns_message_t *message,
- unsigned int options);
-/*%<
- * Get the response to 'request' by filling in 'message'.
- *
- * 'options' is passed to dns_message_parse(). See dns_message_parse()
- * for more details.
- *
- * Requires:
- *
- *\li 'request' is a valid request for which the caller has received the
- * completion event.
- *
- *\li The result code of the completion event was #ISC_R_SUCCESS.
- *
- * Returns:
- *
- *\li ISC_R_SUCCESS
- *
- *\li Any result that dns_message_parse() can return.
- */
-
-isc_boolean_t
-dns_request_usedtcp(dns_request_t *request);
-/*%<
- * Return whether this query used TCP or not. Setting #DNS_REQUESTOPT_TCP
- * in the call to dns_request_create() will cause the function to return
- * #ISC_TRUE, otherwise the result is based on the query message size.
- *
- * Requires:
- *\li 'request' is a valid request.
- *
- * Returns:
- *\li ISC_TRUE if TCP was used.
- *\li ISC_FALSE if UDP was used.
- */
-
-void
-dns_request_destroy(dns_request_t **requestp);
-/*%<
- * Destroy 'request'.
- *
- * Requires:
- *
- *\li 'request' is a valid request for which the caller has received the
- * completion event.
- *
- * Ensures:
- *
- *\li *requestp == NULL
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_REQUEST_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001, 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: resolver.h,v 1.60.56.3 2009/01/29 22:40:35 jinmei Exp $ */
-
-#ifndef DNS_RESOLVER_H
-#define DNS_RESOLVER_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/resolver.h
- *
- * \brief
- * This is the BIND 9 resolver, the module responsible for resolving DNS
- * requests by iteratively querying authoritative servers and following
- * referrals. This is a "full resolver", not to be confused with
- * the stub resolvers most people associate with the word "resolver".
- * The full resolver is part of the caching name server or resolver
- * daemon the stub resolver talks to.
- *
- * MP:
- *\li The module ensures appropriate synchronization of data structures it
- * creates and manipulates.
- *
- * Reliability:
- *\li No anticipated impact.
- *
- * Resources:
- *\li TBS
- *
- * Security:
- *\li No anticipated impact.
- *
- * Standards:
- *\li RFCs: 1034, 1035, 2181, TBS
- *\li Drafts: TBS
- */
-
-#include <isc/lang.h>
-#include <isc/socket.h>
-
-#include <dns/types.h>
-#include <dns/fixedname.h>
-
-ISC_LANG_BEGINDECLS
-
-/*%
- * A dns_fetchevent_t is sent when a 'fetch' completes. Any of 'db',
- * 'node', 'rdataset', and 'sigrdataset' may be bound. It is the
- * receiver's responsibility to detach before freeing the event.
- * \brief
- * 'rdataset', 'sigrdataset', 'client' and 'id' are the values that were
- * supplied when dns_resolver_createfetch() was called. They are returned
- * to the caller so that they may be freed.
- */
-typedef struct dns_fetchevent {
- ISC_EVENT_COMMON(struct dns_fetchevent);
- dns_fetch_t * fetch;
- isc_result_t result;
- dns_rdatatype_t qtype;
- dns_db_t * db;
- dns_dbnode_t * node;
- dns_rdataset_t * rdataset;
- dns_rdataset_t * sigrdataset;
- dns_fixedname_t foundname;
- isc_sockaddr_t * client;
- dns_messageid_t id;
-} dns_fetchevent_t;
-
-/*
- * Options that modify how a 'fetch' is done.
- */
-#define DNS_FETCHOPT_TCP 0x01 /*%< Use TCP. */
-#define DNS_FETCHOPT_UNSHARED 0x02 /*%< See below. */
-#define DNS_FETCHOPT_RECURSIVE 0x04 /*%< Set RD? */
-#define DNS_FETCHOPT_NOEDNS0 0x08 /*%< Do not use EDNS. */
-#define DNS_FETCHOPT_FORWARDONLY 0x10 /*%< Only use forwarders. */
-#define DNS_FETCHOPT_NOVALIDATE 0x20 /*%< Disable validation. */
-#define DNS_FETCHOPT_EDNS512 0x40 /*%< Advertise a 512 byte
- UDP buffer. */
-#define DNS_FETCHOPT_WANTNSID 0x80 /*%< Request NSID */
-
-#define DNS_FETCHOPT_EDNSVERSIONSET 0x00800000
-#define DNS_FETCHOPT_EDNSVERSIONMASK 0xff000000
-#define DNS_FETCHOPT_EDNSVERSIONSHIFT 24
-
-/*
- * Upper bounds of class of query RTT (ms). Corresponds to
- * dns_resstatscounter_queryrttX statistics counters.
- */
-#define DNS_RESOLVER_QRYRTTCLASS0 10
-#define DNS_RESOLVER_QRYRTTCLASS0STR "10"
-#define DNS_RESOLVER_QRYRTTCLASS1 100
-#define DNS_RESOLVER_QRYRTTCLASS1STR "100"
-#define DNS_RESOLVER_QRYRTTCLASS2 500
-#define DNS_RESOLVER_QRYRTTCLASS2STR "500"
-#define DNS_RESOLVER_QRYRTTCLASS3 800
-#define DNS_RESOLVER_QRYRTTCLASS3STR "800"
-#define DNS_RESOLVER_QRYRTTCLASS4 1600
-#define DNS_RESOLVER_QRYRTTCLASS4STR "1600"
-
-/*
- * XXXRTH Should this API be made semi-private? (I.e.
- * _dns_resolver_create()).
- */
-
-#define DNS_RESOLVER_CHECKNAMES 0x01
-#define DNS_RESOLVER_CHECKNAMESFAIL 0x02
-
-isc_result_t
-dns_resolver_create(dns_view_t *view,
- isc_taskmgr_t *taskmgr, unsigned int ntasks,
- isc_socketmgr_t *socketmgr,
- isc_timermgr_t *timermgr,
- unsigned int options,
- dns_dispatchmgr_t *dispatchmgr,
- dns_dispatch_t *dispatchv4,
- dns_dispatch_t *dispatchv6,
- dns_resolver_t **resp);
-
-/*%<
- * Create a resolver.
- *
- * Notes:
- *
- *\li Generally, applications should not create a resolver directly, but
- * should instead call dns_view_createresolver().
- *
- * Requires:
- *
- *\li 'view' is a valid view.
- *
- *\li 'taskmgr' is a valid task manager.
- *
- *\li 'ntasks' > 0.
- *
- *\li 'socketmgr' is a valid socket manager.
- *
- *\li 'timermgr' is a valid timer manager.
- *
- *\li 'dispatchv4' is a valid dispatcher with an IPv4 UDP socket, or is NULL.
- *
- *\li 'dispatchv6' is a valid dispatcher with an IPv6 UDP socket, or is NULL.
- *
- *\li resp != NULL && *resp == NULL.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS On success.
- *
- *\li Anything else Failure.
- */
-
-void
-dns_resolver_freeze(dns_resolver_t *res);
-/*%<
- * Freeze resolver.
- *
- * Notes:
- *
- *\li Certain configuration changes cannot be made after the resolver
- * is frozen. Fetches cannot be created until the resolver is frozen.
- *
- * Requires:
- *
- *\li 'res' is a valid, unfrozen resolver.
- *
- * Ensures:
- *
- *\li 'res' is frozen.
- */
-
-void
-dns_resolver_prime(dns_resolver_t *res);
-/*%<
- * Prime resolver.
- *
- * Notes:
- *
- *\li Resolvers which have a forwarding policy other than dns_fwdpolicy_only
- * need to be primed with the root nameservers, otherwise the root
- * nameserver hints data may be used indefinitely. This function requests
- * that the resolver start a priming fetch, if it isn't already priming.
- *
- * Requires:
- *
- *\li 'res' is a valid, frozen resolver.
- */
-
-
-void
-dns_resolver_whenshutdown(dns_resolver_t *res, isc_task_t *task,
- isc_event_t **eventp);
-/*%<
- * Send '*eventp' to 'task' when 'res' has completed shutdown.
- *
- * Notes:
- *
- *\li It is not safe to detach the last reference to 'res' until
- * shutdown is complete.
- *
- * Requires:
- *
- *\li 'res' is a valid resolver.
- *
- *\li 'task' is a valid task.
- *
- *\li *eventp is a valid event.
- *
- * Ensures:
- *
- *\li *eventp == NULL.
- */
-
-void
-dns_resolver_shutdown(dns_resolver_t *res);
-/*%<
- * Start the shutdown process for 'res'.
- *
- * Notes:
- *
- *\li This call has no effect if the resolver is already shutting down.
- *
- * Requires:
- *
- *\li 'res' is a valid resolver.
- */
-
-void
-dns_resolver_attach(dns_resolver_t *source, dns_resolver_t **targetp);
-
-void
-dns_resolver_detach(dns_resolver_t **resp);
-
-isc_result_t
-dns_resolver_createfetch(dns_resolver_t *res, dns_name_t *name,
- dns_rdatatype_t type,
- dns_name_t *domain, dns_rdataset_t *nameservers,
- dns_forwarders_t *forwarders,
- unsigned int options, isc_task_t *task,
- isc_taskaction_t action, void *arg,
- dns_rdataset_t *rdataset,
- dns_rdataset_t *sigrdataset,
- dns_fetch_t **fetchp);
-
-isc_result_t
-dns_resolver_createfetch2(dns_resolver_t *res, dns_name_t *name,
- dns_rdatatype_t type,
- dns_name_t *domain, dns_rdataset_t *nameservers,
- dns_forwarders_t *forwarders,
- isc_sockaddr_t *client, isc_uint16_t id,
- unsigned int options, isc_task_t *task,
- isc_taskaction_t action, void *arg,
- dns_rdataset_t *rdataset,
- dns_rdataset_t *sigrdataset,
- dns_fetch_t **fetchp);
-/*%<
- * Recurse to answer a question.
- *
- * Notes:
- *
- *\li This call starts a query for 'name', type 'type'.
- *
- *\li The 'domain' is a parent domain of 'name' for which
- * a set of name servers 'nameservers' is known. If no
- * such name server information is available, set
- * 'domain' and 'nameservers' to NULL.
- *
- *\li 'forwarders' is unimplemented, and subject to change when
- * we figure out how selective forwarding will work.
- *
- *\li When the fetch completes (successfully or otherwise), a
- * #DNS_EVENT_FETCHDONE event with action 'action' and arg 'arg' will be
- * posted to 'task'.
- *
- *\li The values of 'rdataset' and 'sigrdataset' will be returned in
- * the FETCHDONE event.
- *
- *\li 'client' and 'id' are used for duplicate query detection. '*client'
- * must remain stable until after 'action' has been called or
- * dns_resolver_cancelfetch() is called.
- *
- * Requires:
- *
- *\li 'res' is a valid resolver that has been frozen.
- *
- *\li 'name' is a valid name.
- *
- *\li 'type' is not a meta type other than ANY.
- *
- *\li 'domain' is a valid name or NULL.
- *
- *\li 'nameservers' is a valid NS rdataset (whose owner name is 'domain')
- * iff. 'domain' is not NULL.
- *
- *\li 'forwarders' is NULL.
- *
- *\li 'client' is a valid sockaddr or NULL.
- *
- *\li 'options' contains valid options.
- *
- *\li 'rdataset' is a valid, disassociated rdataset.
- *
- *\li 'sigrdataset' is NULL, or is a valid, disassociated rdataset.
- *
- *\li fetchp != NULL && *fetchp == NULL.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS Success
- *\li #DNS_R_DUPLICATE
- *\li #DNS_R_DROP
- *
- *\li Many other values are possible, all of which indicate failure.
- */
-
-void
-dns_resolver_cancelfetch(dns_fetch_t *fetch);
-/*%<
- * Cancel 'fetch'.
- *
- * Notes:
- *
- *\li If 'fetch' has not completed, post its FETCHDONE event with a
- * result code of #ISC_R_CANCELED.
- *
- * Requires:
- *
- *\li 'fetch' is a valid fetch.
- */
-
-void
-dns_resolver_destroyfetch(dns_fetch_t **fetchp);
-/*%<
- * Destroy 'fetch'.
- *
- * Requires:
- *
- *\li '*fetchp' is a valid fetch.
- *
- *\li The caller has received the FETCHDONE event (either because the
- * fetch completed or because dns_resolver_cancelfetch() was called).
- *
- * Ensures:
- *
- *\li *fetchp == NULL.
- */
-
-void
-dns_resolver_logfetch(dns_fetch_t *fetch, isc_log_t *lctx,
- isc_logcategory_t *category, isc_logmodule_t *module,
- int level, isc_boolean_t duplicateok);
-/*%<
- * Dump a log message on internal state at the completion of given 'fetch'.
- * 'lctx', 'category', 'module', and 'level' are used to write the log message.
- * By default, only one log message is written even if the corresponding fetch
- * context serves multiple clients; if 'duplicateok' is true the suppression
- * is disabled and the message can be written every time this function is
- * called.
- *
- * Requires:
- *
- *\li 'fetch' is a valid fetch, and has completed.
- */
-
-dns_dispatchmgr_t *
-dns_resolver_dispatchmgr(dns_resolver_t *resolver);
-
-dns_dispatch_t *
-dns_resolver_dispatchv4(dns_resolver_t *resolver);
-
-dns_dispatch_t *
-dns_resolver_dispatchv6(dns_resolver_t *resolver);
-
-isc_socketmgr_t *
-dns_resolver_socketmgr(dns_resolver_t *resolver);
-
-isc_taskmgr_t *
-dns_resolver_taskmgr(dns_resolver_t *resolver);
-
-isc_uint32_t
-dns_resolver_getlamettl(dns_resolver_t *resolver);
-/*%<
- * Get the resolver's lame-ttl. zero => no lame processing.
- *
- * Requires:
- *\li 'resolver' to be valid.
- */
-
-void
-dns_resolver_setlamettl(dns_resolver_t *resolver, isc_uint32_t lame_ttl);
-/*%<
- * Set the resolver's lame-ttl. zero => no lame processing.
- *
- * Requires:
- *\li 'resolver' to be valid.
- */
-
-unsigned int
-dns_resolver_nrunning(dns_resolver_t *resolver);
-/*%<
- * Return the number of currently running resolutions in this
- * resolver. This is may be less than the number of outstanding
- * fetches due to multiple identical fetches, or more than the
- * number of of outstanding fetches due to the fact that resolution
- * can continue even though a fetch has been canceled.
- */
-
-isc_result_t
-dns_resolver_addalternate(dns_resolver_t *resolver, isc_sockaddr_t *alt,
- dns_name_t *name, in_port_t port);
-/*%<
- * Add alternate addresses to be tried in the event that the nameservers
- * for a zone are not available in the address families supported by the
- * operating system.
- *
- * Require:
- * \li only one of 'name' or 'alt' to be valid.
- */
-
-void
-dns_resolver_setudpsize(dns_resolver_t *resolver, isc_uint16_t udpsize);
-/*%<
- * Set the EDNS UDP buffer size advertised by the server.
- */
-
-isc_uint16_t
-dns_resolver_getudpsize(dns_resolver_t *resolver);
-/*%<
- * Get the current EDNS UDP buffer size.
- */
-
-void
-dns_resolver_reset_algorithms(dns_resolver_t *resolver);
-/*%<
- * Clear the disabled DNSSEC algorithms.
- */
-
-isc_result_t
-dns_resolver_disable_algorithm(dns_resolver_t *resolver, dns_name_t *name,
- unsigned int alg);
-/*%<
- * Mark the give DNSSEC algorithm as disabled and below 'name'.
- * Valid algorithms are less than 256.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_RANGE
- *\li #ISC_R_NOMEMORY
- */
-
-isc_boolean_t
-dns_resolver_algorithm_supported(dns_resolver_t *resolver, dns_name_t *name,
- unsigned int alg);
-/*%<
- * Check if the given algorithm is supported by this resolver.
- * This checks if the algorithm has been disabled via
- * dns_resolver_disable_algorithm() then the underlying
- * crypto libraries if not specifically disabled.
- */
-
-isc_boolean_t
-dns_resolver_digest_supported(dns_resolver_t *resolver, unsigned int digest_type);
-/*%<
- * Is this digest type supported.
- */
-
-void
-dns_resolver_resetmustbesecure(dns_resolver_t *resolver);
-
-isc_result_t
-dns_resolver_setmustbesecure(dns_resolver_t *resolver, dns_name_t *name,
- isc_boolean_t value);
-
-isc_boolean_t
-dns_resolver_getmustbesecure(dns_resolver_t *resolver, dns_name_t *name);
-
-void
-dns_resolver_setclientsperquery(dns_resolver_t *resolver,
- isc_uint32_t min, isc_uint32_t max);
-
-void
-dns_resolver_getclientsperquery(dns_resolver_t *resolver, isc_uint32_t *cur,
- isc_uint32_t *min, isc_uint32_t *max);
-
-isc_boolean_t
-dns_resolver_getzeronosoattl(dns_resolver_t *resolver);
-
-void
-dns_resolver_setzeronosoattl(dns_resolver_t *resolver, isc_boolean_t state);
-
-unsigned int
-dns_resolver_getoptions(dns_resolver_t *resolver);
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_RESOLVER_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: result.h,v 1.116 2008/09/25 04:02:39 tbox Exp $ */
-
-#ifndef DNS_RESULT_H
-#define DNS_RESULT_H 1
-
-/*! \file dns/result.h */
-
-#include <isc/lang.h>
-#include <isc/resultclass.h>
-
-#include <dns/types.h>
-
-/*
- * Nothing in this file truly depends on <isc/result.h>, but the
- * DNS result codes are considered to be publicly derived from
- * the ISC result codes, so including this file buys you the ISC_R_
- * namespace too.
- */
-#include <isc/result.h> /* Contractual promise. */
-
-/*
- * DNS library result codes
- */
-#define DNS_R_LABELTOOLONG (ISC_RESULTCLASS_DNS + 0)
-#define DNS_R_BADESCAPE (ISC_RESULTCLASS_DNS + 1)
-/*
- * Since we dropped the support of bitstring labels, deprecate the related
- * result codes too.
-
-#define DNS_R_BADBITSTRING (ISC_RESULTCLASS_DNS + 2)
-#define DNS_R_BITSTRINGTOOLONG (ISC_RESULTCLASS_DNS + 3)
-*/
-#define DNS_R_EMPTYLABEL (ISC_RESULTCLASS_DNS + 4)
-#define DNS_R_BADDOTTEDQUAD (ISC_RESULTCLASS_DNS + 5)
-#define DNS_R_INVALIDNS (ISC_RESULTCLASS_DNS + 6)
-#define DNS_R_UNKNOWN (ISC_RESULTCLASS_DNS + 7)
-#define DNS_R_BADLABELTYPE (ISC_RESULTCLASS_DNS + 8)
-#define DNS_R_BADPOINTER (ISC_RESULTCLASS_DNS + 9)
-#define DNS_R_TOOMANYHOPS (ISC_RESULTCLASS_DNS + 10)
-#define DNS_R_DISALLOWED (ISC_RESULTCLASS_DNS + 11)
-#define DNS_R_EXTRATOKEN (ISC_RESULTCLASS_DNS + 12)
-#define DNS_R_EXTRADATA (ISC_RESULTCLASS_DNS + 13)
-#define DNS_R_TEXTTOOLONG (ISC_RESULTCLASS_DNS + 14)
-#define DNS_R_NOTZONETOP (ISC_RESULTCLASS_DNS + 15)
-#define DNS_R_SYNTAX (ISC_RESULTCLASS_DNS + 16)
-#define DNS_R_BADCKSUM (ISC_RESULTCLASS_DNS + 17)
-#define DNS_R_BADAAAA (ISC_RESULTCLASS_DNS + 18)
-#define DNS_R_NOOWNER (ISC_RESULTCLASS_DNS + 19)
-#define DNS_R_NOTTL (ISC_RESULTCLASS_DNS + 20)
-#define DNS_R_BADCLASS (ISC_RESULTCLASS_DNS + 21)
-#define DNS_R_NAMETOOLONG (ISC_RESULTCLASS_DNS + 22)
-#define DNS_R_PARTIALMATCH (ISC_RESULTCLASS_DNS + 23)
-#define DNS_R_NEWORIGIN (ISC_RESULTCLASS_DNS + 24)
-#define DNS_R_UNCHANGED (ISC_RESULTCLASS_DNS + 25)
-#define DNS_R_BADTTL (ISC_RESULTCLASS_DNS + 26)
-#define DNS_R_NOREDATA (ISC_RESULTCLASS_DNS + 27)
-#define DNS_R_CONTINUE (ISC_RESULTCLASS_DNS + 28)
-#define DNS_R_DELEGATION (ISC_RESULTCLASS_DNS + 29)
-#define DNS_R_GLUE (ISC_RESULTCLASS_DNS + 30)
-#define DNS_R_DNAME (ISC_RESULTCLASS_DNS + 31)
-#define DNS_R_CNAME (ISC_RESULTCLASS_DNS + 32)
-#define DNS_R_BADDB (ISC_RESULTCLASS_DNS + 33)
-#define DNS_R_ZONECUT (ISC_RESULTCLASS_DNS + 34)
-#define DNS_R_BADZONE (ISC_RESULTCLASS_DNS + 35)
-#define DNS_R_MOREDATA (ISC_RESULTCLASS_DNS + 36)
-#define DNS_R_UPTODATE (ISC_RESULTCLASS_DNS + 37)
-#define DNS_R_TSIGVERIFYFAILURE (ISC_RESULTCLASS_DNS + 38)
-#define DNS_R_TSIGERRORSET (ISC_RESULTCLASS_DNS + 39)
-#define DNS_R_SIGINVALID (ISC_RESULTCLASS_DNS + 40)
-#define DNS_R_SIGEXPIRED (ISC_RESULTCLASS_DNS + 41)
-#define DNS_R_SIGFUTURE (ISC_RESULTCLASS_DNS + 42)
-#define DNS_R_KEYUNAUTHORIZED (ISC_RESULTCLASS_DNS + 43)
-#define DNS_R_INVALIDTIME (ISC_RESULTCLASS_DNS + 44)
-#define DNS_R_EXPECTEDTSIG (ISC_RESULTCLASS_DNS + 45)
-#define DNS_R_UNEXPECTEDTSIG (ISC_RESULTCLASS_DNS + 46)
-#define DNS_R_INVALIDTKEY (ISC_RESULTCLASS_DNS + 47)
-#define DNS_R_HINT (ISC_RESULTCLASS_DNS + 48)
-#define DNS_R_DROP (ISC_RESULTCLASS_DNS + 49)
-#define DNS_R_NOTLOADED (ISC_RESULTCLASS_DNS + 50)
-#define DNS_R_NCACHENXDOMAIN (ISC_RESULTCLASS_DNS + 51)
-#define DNS_R_NCACHENXRRSET (ISC_RESULTCLASS_DNS + 52)
-#define DNS_R_WAIT (ISC_RESULTCLASS_DNS + 53)
-#define DNS_R_NOTVERIFIEDYET (ISC_RESULTCLASS_DNS + 54)
-#define DNS_R_NOIDENTITY (ISC_RESULTCLASS_DNS + 55)
-#define DNS_R_NOJOURNAL (ISC_RESULTCLASS_DNS + 56)
-#define DNS_R_ALIAS (ISC_RESULTCLASS_DNS + 57)
-#define DNS_R_USETCP (ISC_RESULTCLASS_DNS + 58)
-#define DNS_R_NOVALIDSIG (ISC_RESULTCLASS_DNS + 59)
-#define DNS_R_NOVALIDNSEC (ISC_RESULTCLASS_DNS + 60)
-#define DNS_R_NOTINSECURE (ISC_RESULTCLASS_DNS + 61)
-#define DNS_R_UNKNOWNSERVICE (ISC_RESULTCLASS_DNS + 62)
-#define DNS_R_RECOVERABLE (ISC_RESULTCLASS_DNS + 63)
-#define DNS_R_UNKNOWNOPT (ISC_RESULTCLASS_DNS + 64)
-#define DNS_R_UNEXPECTEDID (ISC_RESULTCLASS_DNS + 65)
-#define DNS_R_SEENINCLUDE (ISC_RESULTCLASS_DNS + 66)
-#define DNS_R_NOTEXACT (ISC_RESULTCLASS_DNS + 67)
-#define DNS_R_BLACKHOLED (ISC_RESULTCLASS_DNS + 68)
-#define DNS_R_BADALG (ISC_RESULTCLASS_DNS + 69)
-#define DNS_R_METATYPE (ISC_RESULTCLASS_DNS + 70)
-#define DNS_R_CNAMEANDOTHER (ISC_RESULTCLASS_DNS + 71)
-#define DNS_R_SINGLETON (ISC_RESULTCLASS_DNS + 72)
-#define DNS_R_HINTNXRRSET (ISC_RESULTCLASS_DNS + 73)
-#define DNS_R_NOMASTERFILE (ISC_RESULTCLASS_DNS + 74)
-#define DNS_R_UNKNOWNPROTO (ISC_RESULTCLASS_DNS + 75)
-#define DNS_R_CLOCKSKEW (ISC_RESULTCLASS_DNS + 76)
-#define DNS_R_BADIXFR (ISC_RESULTCLASS_DNS + 77)
-#define DNS_R_NOTAUTHORITATIVE (ISC_RESULTCLASS_DNS + 78)
-#define DNS_R_NOVALIDKEY (ISC_RESULTCLASS_DNS + 79)
-#define DNS_R_OBSOLETE (ISC_RESULTCLASS_DNS + 80)
-#define DNS_R_FROZEN (ISC_RESULTCLASS_DNS + 81)
-#define DNS_R_UNKNOWNFLAG (ISC_RESULTCLASS_DNS + 82)
-#define DNS_R_EXPECTEDRESPONSE (ISC_RESULTCLASS_DNS + 83)
-#define DNS_R_NOVALIDDS (ISC_RESULTCLASS_DNS + 84)
-#define DNS_R_NSISADDRESS (ISC_RESULTCLASS_DNS + 85)
-#define DNS_R_REMOTEFORMERR (ISC_RESULTCLASS_DNS + 86)
-#define DNS_R_TRUNCATEDTCP (ISC_RESULTCLASS_DNS + 87)
-#define DNS_R_LAME (ISC_RESULTCLASS_DNS + 88)
-#define DNS_R_UNEXPECTEDRCODE (ISC_RESULTCLASS_DNS + 89)
-#define DNS_R_UNEXPECTEDOPCODE (ISC_RESULTCLASS_DNS + 90)
-#define DNS_R_CHASEDSSERVERS (ISC_RESULTCLASS_DNS + 91)
-#define DNS_R_EMPTYNAME (ISC_RESULTCLASS_DNS + 92)
-#define DNS_R_EMPTYWILD (ISC_RESULTCLASS_DNS + 93)
-#define DNS_R_BADBITMAP (ISC_RESULTCLASS_DNS + 94)
-#define DNS_R_FROMWILDCARD (ISC_RESULTCLASS_DNS + 95)
-#define DNS_R_BADOWNERNAME (ISC_RESULTCLASS_DNS + 96)
-#define DNS_R_BADNAME (ISC_RESULTCLASS_DNS + 97)
-#define DNS_R_DYNAMIC (ISC_RESULTCLASS_DNS + 98)
-#define DNS_R_UNKNOWNCOMMAND (ISC_RESULTCLASS_DNS + 99)
-#define DNS_R_MUSTBESECURE (ISC_RESULTCLASS_DNS + 100)
-#define DNS_R_COVERINGNSEC (ISC_RESULTCLASS_DNS + 101)
-#define DNS_R_MXISADDRESS (ISC_RESULTCLASS_DNS + 102)
-#define DNS_R_DUPLICATE (ISC_RESULTCLASS_DNS + 103)
-#define DNS_R_INVALIDNSEC3 (ISC_RESULTCLASS_DNS + 104)
-
-#define DNS_R_NRESULTS 105 /*%< Number of results */
-
-/*
- * DNS wire format rcodes.
- *
- * By making these their own class we can easily convert them into the
- * wire-format rcode value simply by masking off the resultclass.
- */
-#define DNS_R_NOERROR (ISC_RESULTCLASS_DNSRCODE + 0)
-#define DNS_R_FORMERR (ISC_RESULTCLASS_DNSRCODE + 1)
-#define DNS_R_SERVFAIL (ISC_RESULTCLASS_DNSRCODE + 2)
-#define DNS_R_NXDOMAIN (ISC_RESULTCLASS_DNSRCODE + 3)
-#define DNS_R_NOTIMP (ISC_RESULTCLASS_DNSRCODE + 4)
-#define DNS_R_REFUSED (ISC_RESULTCLASS_DNSRCODE + 5)
-#define DNS_R_YXDOMAIN (ISC_RESULTCLASS_DNSRCODE + 6)
-#define DNS_R_YXRRSET (ISC_RESULTCLASS_DNSRCODE + 7)
-#define DNS_R_NXRRSET (ISC_RESULTCLASS_DNSRCODE + 8)
-#define DNS_R_NOTAUTH (ISC_RESULTCLASS_DNSRCODE + 9)
-#define DNS_R_NOTZONE (ISC_RESULTCLASS_DNSRCODE + 10)
-#define DNS_R_BADVERS (ISC_RESULTCLASS_DNSRCODE + 16)
-
-#define DNS_R_NRCODERESULTS 17 /*%< Number of rcode results */
-
-#define DNS_RESULT_ISRCODE(result) \
- (ISC_RESULTCLASS_INCLASS(ISC_RESULTCLASS_DNSRCODE, (result)))
-
-ISC_LANG_BEGINDECLS
-
-const char *
-dns_result_totext(isc_result_t);
-
-void
-dns_result_register(void);
-
-dns_rcode_t
-dns_result_torcode(isc_result_t result);
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_RESULT_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: rootns.h,v 1.16 2007/06/19 23:47:17 tbox Exp $ */
-
-#ifndef DNS_ROOTNS_H
-#define DNS_ROOTNS_H 1
-
-/*! \file dns/rootns.h */
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_rootns_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
- const char *filename, dns_db_t **target);
-
-void
-dns_root_checkhints(dns_view_t *view, dns_db_t *hints, dns_db_t *db);
-/*
- * Reports differences between hints and the real roots.
- *
- * Requires view, hints and (cache) db to be valid.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_ROOTNS_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: sdb.h,v 1.21.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef DNS_SDB_H
-#define DNS_SDB_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/sdb.h
- * \brief
- * Simple database API.
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-/***
- *** Types
- ***/
-
-/*%
- * A simple database. This is an opaque type.
- */
-typedef struct dns_sdb dns_sdb_t;
-
-/*%
- * A simple database lookup in progress. This is an opaque type.
- */
-typedef struct dns_sdblookup dns_sdblookup_t;
-
-/*%
- * A simple database traversal in progress. This is an opaque type.
- */
-typedef struct dns_sdballnodes dns_sdballnodes_t;
-
-typedef isc_result_t
-(*dns_sdblookupfunc_t)(const char *zone, const char *name, void *dbdata,
- dns_sdblookup_t *);
-
-typedef isc_result_t
-(*dns_sdbauthorityfunc_t)(const char *zone, void *dbdata, dns_sdblookup_t *);
-
-typedef isc_result_t
-(*dns_sdballnodesfunc_t)(const char *zone, void *dbdata,
- dns_sdballnodes_t *allnodes);
-
-typedef isc_result_t
-(*dns_sdbcreatefunc_t)(const char *zone, int argc, char **argv,
- void *driverdata, void **dbdata);
-
-typedef void
-(*dns_sdbdestroyfunc_t)(const char *zone, void *driverdata, void **dbdata);
-
-
-typedef struct dns_sdbmethods {
- dns_sdblookupfunc_t lookup;
- dns_sdbauthorityfunc_t authority;
- dns_sdballnodesfunc_t allnodes;
- dns_sdbcreatefunc_t create;
- dns_sdbdestroyfunc_t destroy;
-} dns_sdbmethods_t;
-
-/***
- *** Functions
- ***/
-
-ISC_LANG_BEGINDECLS
-
-#define DNS_SDBFLAG_RELATIVEOWNER 0x00000001U
-#define DNS_SDBFLAG_RELATIVERDATA 0x00000002U
-#define DNS_SDBFLAG_THREADSAFE 0x00000004U
-
-isc_result_t
-dns_sdb_register(const char *drivername, const dns_sdbmethods_t *methods,
- void *driverdata, unsigned int flags, isc_mem_t *mctx,
- dns_sdbimplementation_t **sdbimp);
-/*%<
- * Register a simple database driver for the database type 'drivername',
- * implemented by the functions in '*methods'.
- *
- * sdbimp must point to a NULL dns_sdbimplementation_t pointer. That is,
- * sdbimp != NULL && *sdbimp == NULL. It will be assigned a value that
- * will later be used to identify the driver when deregistering it.
- *
- * The name server will perform lookups in the database by calling the
- * function 'lookup', passing it a printable zone name 'zone', a printable
- * domain name 'name', and a copy of the argument 'dbdata' that
- * was potentially returned by the create function. The 'dns_sdblookup_t'
- * argument to 'lookup' and 'authority' is an opaque pointer to be passed to
- * ns_sdb_putrr().
- *
- * The lookup function returns the lookup results to the name server
- * by calling ns_sdb_putrr() once for each record found. On success,
- * the return value of the lookup function should be ISC_R_SUCCESS.
- * If the domain name 'name' does not exist, the lookup function should
- * ISC_R_NOTFOUND. Any other return value is treated as an error.
- *
- * Lookups at the zone apex will cause the server to also call the
- * function 'authority' (if non-NULL), which must provide an SOA record
- * and NS records for the zone by calling ns_sdb_putrr() once for each of
- * these records. The 'authority' function may be NULL if invoking
- * the 'lookup' function on the zone apex will return SOA and NS records.
- *
- * The allnodes function, if non-NULL, fills in an opaque structure to be
- * used by a database iterator. This allows the zone to be transferred.
- * This may use a considerable amount of memory for large zones, and the
- * zone transfer may not be fully RFC1035 compliant if the zone is
- * frequently changed.
- *
- * The create function will be called for each zone configured
- * into the name server using this database type. It can be used
- * to create a "database object" containing zone specific data,
- * which can make use of the database arguments specified in the
- * name server configuration.
- *
- * The destroy function will be called to free the database object
- * when its zone is destroyed.
- *
- * The create and destroy functions may be NULL.
- *
- * If flags includes DNS_SDBFLAG_RELATIVEOWNER, the lookup and authority
- * functions will be called with relative names rather than absolute names.
- * The string "@" represents the zone apex in this case.
- *
- * If flags includes DNS_SDBFLAG_RELATIVERDATA, the rdata strings may
- * include relative names. Otherwise, all names in the rdata string must
- * be absolute. Be aware that if relative names are allowed, any
- * absolute names must contain a trailing dot.
- *
- * If flags includes DNS_SDBFLAG_THREADSAFE, the driver must be able to
- * handle multiple lookups in parallel. Otherwise, calls into the driver
- * are serialized.
- */
-
-void
-dns_sdb_unregister(dns_sdbimplementation_t **sdbimp);
-/*%<
- * Removes the simple database driver from the list of registered database
- * types. There must be no active databases of this type when this function
- * is called.
- */
-
-/*% See dns_sdb_putradata() */
-isc_result_t
-dns_sdb_putrr(dns_sdblookup_t *lookup, const char *type, dns_ttl_t ttl,
- const char *data);
-isc_result_t
-dns_sdb_putrdata(dns_sdblookup_t *lookup, dns_rdatatype_t type, dns_ttl_t ttl,
- const unsigned char *rdata, unsigned int rdlen);
-/*%<
- * Add a single resource record to the lookup structure to be
- * returned in the query response. dns_sdb_putrr() takes the
- * resource record in master file text format as a null-terminated
- * string, and dns_sdb_putrdata() takes the raw RDATA in
- * uncompressed wire format.
- */
-
-/*% See dns_sdb_putnamerdata() */
-isc_result_t
-dns_sdb_putnamedrr(dns_sdballnodes_t *allnodes, const char *name,
- const char *type, dns_ttl_t ttl, const char *data);
-isc_result_t
-dns_sdb_putnamedrdata(dns_sdballnodes_t *allnodes, const char *name,
- dns_rdatatype_t type, dns_ttl_t ttl,
- const void *rdata, unsigned int rdlen);
-/*%<
- * Add a single resource record to the allnodes structure to be
- * included in a zone transfer response, in text or wire
- * format as above.
- */
-
-isc_result_t
-dns_sdb_putsoa(dns_sdblookup_t *lookup, const char *mname, const char *rname,
- isc_uint32_t serial);
-/*%<
- * This function may optionally be called from the 'authority' callback
- * to simplify construction of the SOA record for 'zone'. It will
- * provide a SOA listing 'mname' as as the master server and 'rname' as
- * the responsible person mailbox. It is the responsibility of the
- * driver to increment the serial number between responses if necessary.
- * All other SOA fields will have reasonable default values.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_SDB_H */
+++ /dev/null
-/*
- * Portions Copyright (C) 2005-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Portions Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/*
- * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
- *
- * 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 STICHTING NLNET
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * STICHTING NLNET 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.
- *
- * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
- * conceived and contributed by Rob Butler.
- *
- * 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 ROB BUTLER
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * ROB BUTLER 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: sdlz.h,v 1.7.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-/*! \file dns/sdlz.h */
-
-#ifndef SDLZ_H
-#define SDLZ_H 1
-
-#include <dns/dlz.h>
-
-ISC_LANG_BEGINDECLS
-
-#define DNS_SDLZFLAG_THREADSAFE 0x00000001U
-#define DNS_SDLZFLAG_RELATIVEOWNER 0x00000002U
-#define DNS_SDLZFLAG_RELATIVERDATA 0x00000004U
-
- /* A simple DLZ database. */
-typedef struct dns_sdlz_db dns_sdlz_db_t;
-
- /* A simple DLZ database lookup in progress. */
-typedef struct dns_sdlzlookup dns_sdlzlookup_t;
-
- /* A simple DLZ database traversal in progress. */
-typedef struct dns_sdlzallnodes dns_sdlzallnodes_t;
-
-
-typedef isc_result_t
-(*dns_sdlzallnodesfunc_t)(const char *zone, void *driverarg, void *dbdata,
- dns_sdlzallnodes_t *allnodes);
-
-/*%<
- * Method prototype. Drivers implementing the SDLZ interface may
- * supply an all nodes method. This method is called when the DNS
- * server is performing a zone transfer query, after the allow zone
- * transfer method has been called. This method is only called if the
- * allow zone transfer method returned ISC_R_SUCCESS. This method and
- * the allow zone transfer method are both required for zone transfers
- * to be supported. If the driver generates data dynamically (instead
- * of searching in a database for it) it should not implement this
- * function as a zone transfer would be meaningless. A SDLZ driver
- * does not have to implement an all nodes method.
- */
-
-typedef isc_result_t
-(*dns_sdlzallowzonexfr_t)(void *driverarg, void *dbdata, const char *name,
- const char *client);
-
-/*%<
- * Method prototype. Drivers implementing the SDLZ interface may
- * supply an allow zone transfer method. This method is called when
- * the DNS server is performing a zone transfer query, before the all
- * nodes method can be called. This method and the all node method
- * are both required for zone transfers to be supported. If the
- * driver generates data dynamically (instead of searching in a
- * database for it) it should not implement this function as a zone
- * transfer would be meaningless. A SDLZ driver does not have to
- * implement an allow zone transfer method.
- *
- * This method should return ISC_R_SUCCESS if the zone is supported by
- * the database and a zone transfer is allowed for the specified
- * client. If the zone is supported by the database, but zone
- * transfers are not allowed for the specified client this method
- * should return ISC_R_NOPERM.. Lastly the method should return
- * ISC_R_NOTFOUND if the zone is not supported by the database. If an
- * error occurs it should return a result code indicating the type of
- * error.
- */
-
-typedef isc_result_t
-(*dns_sdlzauthorityfunc_t)(const char *zone, void *driverarg, void *dbdata,
- dns_sdlzlookup_t *lookup);
-
-/*%<
- * Method prototype. Drivers implementing the SDLZ interface may
- * supply an authority method. This method is called when the DNS
- * server is performing a query, after both the find zone and lookup
- * methods have been called. This method is required if the lookup
- * function does not supply authority information for the dns
- * record. A SDLZ driver does not have to implement an authority
- * method.
- */
-
-typedef isc_result_t
-(*dns_sdlzcreate_t)(const char *dlzname, unsigned int argc, char *argv[],
- void *driverarg, void **dbdata);
-
-/*%<
- * Method prototype. Drivers implementing the SDLZ interface may
- * supply a create method. This method is called when the DNS server
- * is starting up and creating drivers for use later. A SDLZ driver
- * does not have to implement a create method.
- */
-
-typedef void
-(*dns_sdlzdestroy_t)(void *driverarg, void *dbdata);
-
-/*%<
- * Method prototype. Drivers implementing the SDLZ interface may
- * supply a destroy method. This method is called when the DNS server
- * is shutting down and no longer needs the driver. A SDLZ driver does
- * not have to implement a destroy method.
- */
-
-typedef isc_result_t
-(*dns_sdlzfindzone_t)(void *driverarg, void *dbdata, const char *name);
-
-/*%<
- * Method prototype. Drivers implementing the SDLZ interface MUST
- * supply a find zone method. This method is called when the DNS
- * server is performing a query to to determine if 'name' is a
- * supported dns zone. The find zone method will be called with the
- * longest possible name first, and continue to be called with
- * successively shorter domain names, until any of the following
- * occur:
- *
- * \li 1) the function returns (ISC_R_SUCCESS) indicating a zone name
- * match.
- *
- * \li 2) a problem occurs, and the functions returns anything other than
- * (ISC_R_NOTFOUND)
- *
- * \li 3) we run out of domain name labels. I.E. we have tried the
- * shortest domain name
- *
- * \li 4) the number of labels in the domain name is less than min_labels
- * for dns_dlzfindzone
- *
- * The driver's find zone method should return ISC_R_SUCCESS if the
- * zone is supported by the database. Otherwise it should return
- * ISC_R_NOTFOUND, if the zone is not supported. If an error occurs
- * it should return a result code indicating the type of error.
- */
-
-typedef isc_result_t
-(*dns_sdlzlookupfunc_t)(const char *zone, const char *name, void *driverarg,
- void *dbdata, dns_sdlzlookup_t *lookup);
-
-/*%<
- * Method prototype. Drivers implementing the SDLZ interface MUST
- * supply a lookup method. This method is called when the DNS server
- * is performing a query, after the find zone and before any other
- * methods have been called. This function returns record DNS record
- * information using the dns_sdlz_putrr and dns_sdlz_putsoa functions.
- * If this function supplies authority information for the DNS record
- * the authority method is not required. If it does not, the
- * authority function is required. A SDLZ driver must implement a
- * lookup method.
- */
-
-typedef struct dns_sdlzmethods {
- dns_sdlzcreate_t create;
- dns_sdlzdestroy_t destroy;
- dns_sdlzfindzone_t findzone;
- dns_sdlzlookupfunc_t lookup;
- dns_sdlzauthorityfunc_t authority;
- dns_sdlzallnodesfunc_t allnodes;
- dns_sdlzallowzonexfr_t allowzonexfr;
-} dns_sdlzmethods_t;
-
-isc_result_t
-dns_sdlzregister(const char *drivername, const dns_sdlzmethods_t *methods,
- void *driverarg, unsigned int flags, isc_mem_t *mctx,
- dns_sdlzimplementation_t **sdlzimp);
-/*%<
- * Register a dynamically loadable zones (dlz) driver for the database
- * type 'drivername', implemented by the functions in '*methods'.
- *
- * sdlzimp must point to a NULL dns_sdlzimplementation_t pointer.
- * That is, sdlzimp != NULL && *sdlzimp == NULL. It will be assigned
- * a value that will later be used to identify the driver when
- * deregistering it.
- */
-
-void
-dns_sdlzunregister(dns_sdlzimplementation_t **sdlzimp);
-
-/*%<
- * Removes the sdlz driver from the list of registered sdlz drivers.
- * There must be no active sdlz drivers of this type when this
- * function is called.
- */
-
-isc_result_t
-dns_sdlz_putnamedrr(dns_sdlzallnodes_t *allnodes, const char *name,
- const char *type, dns_ttl_t ttl, const char *data);
-/*%<
- * Add a single resource record to the allnodes structure to be later
- * parsed into a zone transfer response.
- */
-
-isc_result_t
-dns_sdlz_putrr(dns_sdlzlookup_t *lookup, const char *type, dns_ttl_t ttl,
- const char *data);
-/*%<
- * Add a single resource record to the lookup structure to be later
- * parsed into a query response.
- */
-
-isc_result_t
-dns_sdlz_putsoa(dns_sdlzlookup_t *lookup, const char *mname, const char *rname,
- isc_uint32_t serial);
-/*%<
- * This function may optionally be called from the 'authority'
- * callback to simplify construction of the SOA record for 'zone'. It
- * will provide a SOA listing 'mname' as as the master server and
- * 'rname' as the responsible person mailbox. It is the
- * responsibility of the driver to increment the serial number between
- * responses if necessary. All other SOA fields will have reasonable
- * default values.
- */
-
-
-ISC_LANG_ENDDECLS
-
-#endif /* SDLZ_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: secalg.h,v 1.19 2007/06/19 23:47:17 tbox Exp $ */
-
-#ifndef DNS_SECALG_H
-#define DNS_SECALG_H 1
-
-/*! \file dns/secalg.h */
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_secalg_fromtext(dns_secalg_t *secalgp, isc_textregion_t *source);
-/*%<
- * Convert the text 'source' refers to into a DNSSEC security algorithm value.
- * The text may contain either a mnemonic algorithm name or a decimal algorithm
- * number.
- *
- * Requires:
- *\li 'secalgp' is a valid pointer.
- *
- *\li 'source' is a valid text region.
- *
- * Returns:
- *\li ISC_R_SUCCESS on success
- *\li ISC_R_RANGE numeric type is out of range
- *\li DNS_R_UNKNOWN mnemonic type is unknown
- */
-
-isc_result_t
-dns_secalg_totext(dns_secalg_t secalg, isc_buffer_t *target);
-/*%<
- * Put a textual representation of the DNSSEC security algorithm 'secalg'
- * into 'target'.
- *
- * Requires:
- *\li 'secalg' is a valid secalg.
- *
- *\li 'target' is a valid text buffer.
- *
- * Ensures,
- * if the result is success:
- *\li The used space in 'target' is updated.
- *
- * Returns:
- *\li ISC_R_SUCCESS on success
- *\li ISC_R_NOSPACE target buffer is too small
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_SECALG_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: secproto.h,v 1.16 2007/06/19 23:47:17 tbox Exp $ */
-
-#ifndef DNS_SECPROTO_H
-#define DNS_SECPROTO_H 1
-
-/*! \file dns/secproto.h */
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_secproto_fromtext(dns_secproto_t *secprotop, isc_textregion_t *source);
-/*%<
- * Convert the text 'source' refers to into a DNSSEC security protocol value.
- * The text may contain either a mnemonic protocol name or a decimal protocol
- * number.
- *
- * Requires:
- *\li 'secprotop' is a valid pointer.
- *
- *\li 'source' is a valid text region.
- *
- * Returns:
- *\li ISC_R_SUCCESS on success
- *\li ISC_R_RANGE numeric type is out of range
- *\li DNS_R_UNKNOWN mnemonic type is unknown
- */
-
-isc_result_t
-dns_secproto_totext(dns_secproto_t secproto, isc_buffer_t *target);
-/*%<
- * Put a textual representation of the DNSSEC security protocol 'secproto'
- * into 'target'.
- *
- * Requires:
- *\li 'secproto' is a valid secproto.
- *
- *\li 'target' is a valid text buffer.
- *
- * Ensures,
- * if the result is success:
- * \li The used space in 'target' is updated.
- *
- * Returns:
- *\li ISC_R_SUCCESS on success
- *\li ISC_R_NOSPACE target buffer is too small
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_SECPROTO_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: soa.h,v 1.9 2007/06/19 23:47:17 tbox Exp $ */
-
-#ifndef DNS_SOA_H
-#define DNS_SOA_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/soa.h
- * \brief
- * SOA utilities.
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-isc_uint32_t
-dns_soa_getserial(dns_rdata_t *rdata);
-isc_uint32_t
-dns_soa_getrefresh(dns_rdata_t *rdata);
-isc_uint32_t
-dns_soa_getretry(dns_rdata_t *rdata);
-isc_uint32_t
-dns_soa_getexpire(dns_rdata_t *rdata);
-isc_uint32_t
-dns_soa_getminimum(dns_rdata_t *rdata);
-/*
- * Extract an integer field from the rdata of a SOA record.
- *
- * Requires:
- * rdata refers to the rdata of a well-formed SOA record.
- */
-
-void
-dns_soa_setserial(isc_uint32_t val, dns_rdata_t *rdata);
-void
-dns_soa_setrefresh(isc_uint32_t val, dns_rdata_t *rdata);
-void
-dns_soa_setretry(isc_uint32_t val, dns_rdata_t *rdata);
-void
-dns_soa_setexpire(isc_uint32_t val, dns_rdata_t *rdata);
-void
-dns_soa_setminimum(isc_uint32_t val, dns_rdata_t *rdata);
-/*
- * Change an integer field of a SOA record by modifying the
- * rdata in-place.
- *
- * Requires:
- * rdata refers to the rdata of a well-formed SOA record.
- */
-
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_SOA_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001, 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: ssu.h,v 1.24 2008/01/18 23:46:58 tbox Exp $ */
-
-#ifndef DNS_SSU_H
-#define DNS_SSU_H 1
-
-/*! \file dns/ssu.h */
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-#define DNS_SSUMATCHTYPE_NAME 0
-#define DNS_SSUMATCHTYPE_SUBDOMAIN 1
-#define DNS_SSUMATCHTYPE_WILDCARD 2
-#define DNS_SSUMATCHTYPE_SELF 3
-#define DNS_SSUMATCHTYPE_SELFSUB 4
-#define DNS_SSUMATCHTYPE_SELFWILD 5
-#define DNS_SSUMATCHTYPE_SELFKRB5 6
-#define DNS_SSUMATCHTYPE_SELFMS 7
-#define DNS_SSUMATCHTYPE_SUBDOMAINMS 8
-#define DNS_SSUMATCHTYPE_SUBDOMAINKRB5 9
-#define DNS_SSUMATCHTYPE_TCPSELF 10
-#define DNS_SSUMATCHTYPE_6TO4SELF 11
-#define DNS_SSUMATCHTYPE_MAX 11 /* max value */
-
-isc_result_t
-dns_ssutable_create(isc_mem_t *mctx, dns_ssutable_t **table);
-/*%<
- * Creates a table that will be used to store simple-secure-update rules.
- * Note: all locking must be provided by the client.
- *
- * Requires:
- *\li 'mctx' is a valid memory context
- *\li 'table' is not NULL, and '*table' is NULL
- *
- * Returns:
- *\li ISC_R_SUCCESS
- *\li ISC_R_NOMEMORY
- */
-
-void
-dns_ssutable_attach(dns_ssutable_t *source, dns_ssutable_t **targetp);
-/*%<
- * Attach '*targetp' to 'source'.
- *
- * Requires:
- *\li 'source' is a valid SSU table
- *\li 'targetp' points to a NULL dns_ssutable_t *.
- *
- * Ensures:
- *\li *targetp is attached to source.
- */
-
-void
-dns_ssutable_detach(dns_ssutable_t **tablep);
-/*%<
- * Detach '*tablep' from its simple-secure-update rule table.
- *
- * Requires:
- *\li 'tablep' points to a valid dns_ssutable_t
- *
- * Ensures:
- *\li *tablep is NULL
- *\li If '*tablep' is the last reference to the SSU table, all
- * resources used by the table will be freed.
- */
-
-isc_result_t
-dns_ssutable_addrule(dns_ssutable_t *table, isc_boolean_t grant,
- dns_name_t *identity, unsigned int matchtype,
- dns_name_t *name, unsigned int ntypes,
- dns_rdatatype_t *types);
-/*%<
- * Adds a new rule to a simple-secure-update rule table. The rule
- * either grants or denies update privileges of an identity (or set of
- * identities) to modify a name (or set of names) or certain types present
- * at that name.
- *
- * Notes:
- *\li If 'matchtype' is of SELF type, this rule only matches if the
- * name to be updated matches the signing identity.
- *
- *\li If 'ntypes' is 0, this rule applies to all types except
- * NS, SOA, RRSIG, and NSEC.
- *
- *\li If 'types' includes ANY, this rule applies to all types
- * except NSEC.
- *
- * Requires:
- *\li 'table' is a valid SSU table
- *\li 'identity' is a valid absolute name
- *\li 'matchtype' must be one of the defined constants.
- *\li 'name' is a valid absolute name
- *\li If 'ntypes' > 0, 'types' must not be NULL
- *
- * Returns:
- *\li ISC_R_SUCCESS
- *\li ISC_R_NOMEMORY
- */
-
-isc_boolean_t
-dns_ssutable_checkrules(dns_ssutable_t *table, dns_name_t *signer,
- dns_name_t *name, isc_netaddr_t *tcpaddr,
- dns_rdatatype_t type);
-/*%<
- * Checks that the attempted update of (name, type) is allowed according
- * to the rules specified in the simple-secure-update rule table. If
- * no rules are matched, access is denied.
- *
- * Notes:
- * 'tcpaddr' should only be set if the request received
- * via TCP. This provides a weak assurance that the
- * request was not spoofed. 'tcpaddr' is to to validate
- * DNS_SSUMATCHTYPE_TCPSELF and DNS_SSUMATCHTYPE_6TO4SELF
- * rules.
- *
- * For DNS_SSUMATCHTYPE_TCPSELF the addresses are mapped to
- * the standard reverse names under IN-ADDR.ARPA and IP6.ARPA.
- * RFC 1035, Section 3.5, "IN-ADDR.ARPA domain" and RFC 3596,
- * Section 2.5, "IP6.ARPA Domain".
- *
- * For DNS_SSUMATCHTYPE_6TO4SELF, IPv4 address are converted
- * to a 6to4 prefix (48 bits) per the rules in RFC 3056. Only
- * the top 48 bits of the IPv6 address are mapped to the reverse
- * name. This is independent of whether the most significant 16
- * bits match 2002::/16, assigned for 6to4 prefixes, or not.
- *
- * Requires:
- *\li 'table' is a valid SSU table
- *\li 'signer' is NULL or a valid absolute name
- *\li 'tcpaddr' is NULL or a valid network address.
- *\li 'name' is a valid absolute name
- */
-
-
-/*% Accessor functions to extract rule components */
-isc_boolean_t dns_ssurule_isgrant(const dns_ssurule_t *rule);
-/*% Accessor functions to extract rule components */
-dns_name_t * dns_ssurule_identity(const dns_ssurule_t *rule);
-/*% Accessor functions to extract rule components */
-unsigned int dns_ssurule_matchtype(const dns_ssurule_t *rule);
-/*% Accessor functions to extract rule components */
-dns_name_t * dns_ssurule_name(const dns_ssurule_t *rule);
-/*% Accessor functions to extract rule components */
-unsigned int dns_ssurule_types(const dns_ssurule_t *rule,
- dns_rdatatype_t **types);
-
-isc_result_t dns_ssutable_firstrule(const dns_ssutable_t *table,
- dns_ssurule_t **rule);
-/*%<
- * Initiates a rule iterator. There is no need to maintain any state.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMORE
- */
-
-isc_result_t dns_ssutable_nextrule(dns_ssurule_t *rule,
- dns_ssurule_t **nextrule);
-/*%<
- * Returns the next rule in the table.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMORE
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_SSU_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: tcpmsg.h,v 1.22 2007/06/19 23:47:17 tbox Exp $ */
-
-#ifndef DNS_TCPMSG_H
-#define DNS_TCPMSG_H 1
-
-/*! \file dns/tcpmsg.h */
-
-#include <isc/buffer.h>
-#include <isc/lang.h>
-#include <isc/socket.h>
-
-typedef struct dns_tcpmsg {
- /* private (don't touch!) */
- unsigned int magic;
- isc_uint16_t size;
- isc_buffer_t buffer;
- unsigned int maxsize;
- isc_mem_t *mctx;
- isc_socket_t *sock;
- isc_task_t *task;
- isc_taskaction_t action;
- void *arg;
- isc_event_t event;
- /* public (read-only) */
- isc_result_t result;
- isc_sockaddr_t address;
-} dns_tcpmsg_t;
-
-ISC_LANG_BEGINDECLS
-
-void
-dns_tcpmsg_init(isc_mem_t *mctx, isc_socket_t *sock, dns_tcpmsg_t *tcpmsg);
-/*%<
- * Associate a tcp message state with a given memory context and
- * TCP socket.
- *
- * Requires:
- *
- *\li "mctx" and "sock" be non-NULL and valid types.
- *
- *\li "sock" be a read/write TCP socket.
- *
- *\li "tcpmsg" be non-NULL and an uninitialized or invalidated structure.
- *
- * Ensures:
- *
- *\li "tcpmsg" is a valid structure.
- */
-
-void
-dns_tcpmsg_setmaxsize(dns_tcpmsg_t *tcpmsg, unsigned int maxsize);
-/*%<
- * Set the maximum packet size to "maxsize"
- *
- * Requires:
- *
- *\li "tcpmsg" be valid.
- *
- *\li 512 <= "maxsize" <= 65536
- */
-
-isc_result_t
-dns_tcpmsg_readmessage(dns_tcpmsg_t *tcpmsg,
- isc_task_t *task, isc_taskaction_t action, void *arg);
-/*%<
- * Schedule an event to be delivered when a DNS message is readable, or
- * when an error occurs on the socket.
- *
- * Requires:
- *
- *\li "tcpmsg" be valid.
- *
- *\li "task", "taskaction", and "arg" be valid.
- *
- * Returns:
- *
- *\li ISC_R_SUCCESS -- no error
- *\li Anything that the isc_socket_recv() call can return. XXXMLG
- *
- * Notes:
- *
- *\li The event delivered is a fully generic event. It will contain no
- * actual data. The sender will be a pointer to the dns_tcpmsg_t.
- * The result code inside that structure should be checked to see
- * what the final result was.
- */
-
-void
-dns_tcpmsg_cancelread(dns_tcpmsg_t *tcpmsg);
-/*%<
- * Cancel a readmessage() call. The event will still be posted with a
- * CANCELED result code.
- *
- * Requires:
- *
- *\li "tcpmsg" be valid.
- */
-
-void
-dns_tcpmsg_keepbuffer(dns_tcpmsg_t *tcpmsg, isc_buffer_t *buffer);
-/*%<
- * If a dns buffer is to be kept between calls, this function marks the
- * internal state-machine buffer as invalid, and copies all the contents
- * of the state into "buffer".
- *
- * Requires:
- *
- *\li "tcpmsg" be valid.
- *
- *\li "buffer" be non-NULL.
- */
-
-void
-dns_tcpmsg_invalidate(dns_tcpmsg_t *tcpmsg);
-/*%<
- * Clean up all allocated state, and invalidate the structure.
- *
- * Requires:
- *
- *\li "tcpmsg" be valid.
- *
- * Ensures:
- *
- *\li "tcpmsg" is invalidated and disassociated with all memory contexts,
- * sockets, etc.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_TCPMSG_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: time.h,v 1.17 2007/06/19 23:47:17 tbox Exp $ */
-
-#ifndef DNS_TIME_H
-#define DNS_TIME_H 1
-
-/*! \file dns/time.h */
-
-/***
- *** Imports
- ***/
-
-#include <isc/buffer.h>
-#include <isc/lang.h>
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Functions
- ***/
-
-isc_result_t
-dns_time64_fromtext(const char *source, isc_int64_t *target);
-/*%<
- * Convert a date and time in YYYYMMDDHHMMSS text format at 'source'
- * into to a 64-bit count of seconds since Jan 1 1970 0:00 GMT.
- * Store the count at 'target'.
- */
-
-isc_result_t
-dns_time32_fromtext(const char *source, isc_uint32_t *target);
-/*%<
- * Like dns_time64_fromtext, but returns the second count modulo 2^32
- * as per RFC2535.
- */
-
-
-isc_result_t
-dns_time64_totext(isc_int64_t value, isc_buffer_t *target);
-/*%<
- * Convert a 64-bit count of seconds since Jan 1 1970 0:00 GMT into
- * a YYYYMMDDHHMMSS text representation and append it to 'target'.
- */
-
-isc_result_t
-dns_time32_totext(isc_uint32_t value, isc_buffer_t *target);
-/*%<
- * Like dns_time64_totext, but for a 32-bit cyclic time value.
- * Of those dates whose counts of seconds since Jan 1 1970 0:00 GMT
- * are congruent with 'value' modulo 2^32, the one closest to the
- * current date is chosen.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_TIME_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: tkey.h,v 1.26.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef DNS_TKEY_H
-#define DNS_TKEY_H 1
-
-/*! \file dns/tkey.h */
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-#include <dst/dst.h>
-#include <dst/gssapi.h>
-
-ISC_LANG_BEGINDECLS
-
-/* Key agreement modes */
-#define DNS_TKEYMODE_SERVERASSIGNED 1
-#define DNS_TKEYMODE_DIFFIEHELLMAN 2
-#define DNS_TKEYMODE_GSSAPI 3
-#define DNS_TKEYMODE_RESOLVERASSIGNED 4
-#define DNS_TKEYMODE_DELETE 5
-
-struct dns_tkeyctx {
- dst_key_t *dhkey;
- dns_name_t *domain;
- gss_cred_id_t gsscred;
- isc_mem_t *mctx;
- isc_entropy_t *ectx;
-};
-
-isc_result_t
-dns_tkeyctx_create(isc_mem_t *mctx, isc_entropy_t *ectx,
- dns_tkeyctx_t **tctxp);
-/*%<
- * Create an empty TKEY context.
- *
- * Requires:
- *\li 'mctx' is not NULL
- *\li 'tctx' is not NULL
- *\li '*tctx' is NULL
- *
- * Returns
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li return codes from dns_name_fromtext()
- */
-
-void
-dns_tkeyctx_destroy(dns_tkeyctx_t **tctxp);
-/*%<
- * Frees all data associated with the TKEY context
- *
- * Requires:
- *\li 'tctx' is not NULL
- *\li '*tctx' is not NULL
- */
-
-isc_result_t
-dns_tkey_processquery(dns_message_t *msg, dns_tkeyctx_t *tctx,
- dns_tsig_keyring_t *ring);
-/*%<
- * Processes a query containing a TKEY record, adding or deleting TSIG
- * keys if necessary, and modifies the message to contain the response.
- *
- * Requires:
- *\li 'msg' is a valid message
- *\li 'tctx' is a valid TKEY context
- *\li 'ring' is a valid TSIG keyring
- *
- * Returns
- *\li #ISC_R_SUCCESS msg was updated (the TKEY operation succeeded,
- * or msg now includes a TKEY with an error set)
- * DNS_R_FORMERR the packet was malformed (missing a TKEY
- * or KEY).
- *\li other An error occurred while processing the message
- */
-
-isc_result_t
-dns_tkey_builddhquery(dns_message_t *msg, dst_key_t *key, dns_name_t *name,
- dns_name_t *algorithm, isc_buffer_t *nonce,
- isc_uint32_t lifetime);
-/*%<
- * Builds a query containing a TKEY that will generate a shared
- * secret using a Diffie-Hellman key exchange. The shared key
- * will be of the specified algorithm (only DNS_TSIG_HMACMD5_NAME
- * is supported), and will be named either 'name',
- * 'name' + server chosen domain, or random data + server chosen domain
- * if 'name' == dns_rootname. If nonce is not NULL, it supplies
- * random data used in the shared secret computation. The key is
- * requested to have the specified lifetime (in seconds)
- *
- *
- * Requires:
- *\li 'msg' is a valid message
- *\li 'key' is a valid Diffie Hellman dst key
- *\li 'name' is a valid name
- *\li 'algorithm' is a valid name
- *
- * Returns:
- *\li #ISC_R_SUCCESS msg was successfully updated to include the
- * query to be sent
- *\li other an error occurred while building the message
- */
-
-isc_result_t
-dns_tkey_buildgssquery(dns_message_t *msg, dns_name_t *name, dns_name_t *gname,
- isc_buffer_t *intoken, isc_uint32_t lifetime,
- gss_ctx_id_t *context, isc_boolean_t win2k);
-/*%<
- * Builds a query containing a TKEY that will generate a GSSAPI context.
- * The key is requested to have the specified lifetime (in seconds).
- *
- * Requires:
- *\li 'msg' is a valid message
- *\li 'name' is a valid name
- *\li 'gname' is a valid name
- *\li 'context' is a pointer to a valid gss_ctx_id_t
- * (which may have the value GSS_C_NO_CONTEXT)
- *\li 'win2k' when true says to turn on some hacks to work
- * with the non-standard GSS-TSIG of Windows 2000
- *
- * Returns:
- *\li ISC_R_SUCCESS msg was successfully updated to include the
- * query to be sent
- *\li other an error occurred while building the message
- */
-
-
-isc_result_t
-dns_tkey_builddeletequery(dns_message_t *msg, dns_tsigkey_t *key);
-/*%<
- * Builds a query containing a TKEY record that will delete the
- * specified shared secret from the server.
- *
- * Requires:
- *\li 'msg' is a valid message
- *\li 'key' is a valid TSIG key
- *
- * Returns:
- *\li #ISC_R_SUCCESS msg was successfully updated to include the
- * query to be sent
- *\li other an error occurred while building the message
- */
-
-isc_result_t
-dns_tkey_processdhresponse(dns_message_t *qmsg, dns_message_t *rmsg,
- dst_key_t *key, isc_buffer_t *nonce,
- dns_tsigkey_t **outkey, dns_tsig_keyring_t *ring);
-/*%<
- * Processes a response to a query containing a TKEY that was
- * designed to generate a shared secret using a Diffie-Hellman key
- * exchange. If the query was successful, a new shared key
- * is created and added to the list of shared keys.
- *
- * Requires:
- *\li 'qmsg' is a valid message (the query)
- *\li 'rmsg' is a valid message (the response)
- *\li 'key' is a valid Diffie Hellman dst key
- *\li 'outkey' is either NULL or a pointer to NULL
- *\li 'ring' is a valid keyring or NULL
- *
- * Returns:
- *\li #ISC_R_SUCCESS the shared key was successfully added
- *\li #ISC_R_NOTFOUND an error occurred while looking for a
- * component of the query or response
- */
-
-isc_result_t
-dns_tkey_processgssresponse(dns_message_t *qmsg, dns_message_t *rmsg,
- dns_name_t *gname, gss_ctx_id_t *context,
- isc_buffer_t *outtoken, dns_tsigkey_t **outkey,
- dns_tsig_keyring_t *ring);
-/*%<
- * XXX
- */
-
-isc_result_t
-dns_tkey_processdeleteresponse(dns_message_t *qmsg, dns_message_t *rmsg,
- dns_tsig_keyring_t *ring);
-/*%<
- * Processes a response to a query containing a TKEY that was
- * designed to delete a shared secret. If the query was successful,
- * the shared key is deleted from the list of shared keys.
- *
- * Requires:
- *\li 'qmsg' is a valid message (the query)
- *\li 'rmsg' is a valid message (the response)
- *\li 'ring' is not NULL
- *
- * Returns:
- *\li #ISC_R_SUCCESS the shared key was successfully deleted
- *\li #ISC_R_NOTFOUND an error occurred while looking for a
- * component of the query or response
- */
-
-
-isc_result_t
-dns_tkey_gssnegotiate(dns_message_t *qmsg, dns_message_t *rmsg,
- dns_name_t *server, gss_ctx_id_t *context,
- dns_tsigkey_t **outkey, dns_tsig_keyring_t *ring,
- isc_boolean_t win2k);
-
-/*
- * Client side negotiation of GSS-TSIG. Process the response
- * to a TKEY, and establish a TSIG key if negotiation was successful.
- * Build a response to the input TKEY message. Can take multiple
- * calls to successfully establish the context.
- *
- * Requires:
- * 'qmsg' is a valid message, the original TKEY request;
- * it will be filled with the new message to send
- * 'rmsg' is a valid message, the incoming TKEY message
- * 'server' is the server name
- * 'context' is the input context handle
- * 'outkey' receives the established key, if non-NULL;
- * if non-NULL must point to NULL
- * 'ring' is the keyring in which to establish the key,
- * or NULL
- * 'win2k' when true says to turn on some hacks to work
- * with the non-standard GSS-TSIG of Windows 2000
- *
- * Returns:
- * ISC_R_SUCCESS context was successfully established
- * ISC_R_NOTFOUND couldn't find a needed part of the query
- * or response
- * DNS_R_CONTINUE additional context negotiation is required;
- * send the new qmsg to the server
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_TKEY_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: tsig.h,v 1.51 2007/06/19 23:47:17 tbox Exp $ */
-
-#ifndef DNS_TSIG_H
-#define DNS_TSIG_H 1
-
-/*! \file dns/tsig.h */
-
-#include <isc/lang.h>
-#include <isc/refcount.h>
-#include <isc/rwlock.h>
-#include <isc/stdtime.h>
-
-#include <dns/types.h>
-#include <dns/name.h>
-
-#include <dst/dst.h>
-
-/*
- * Algorithms.
- */
-LIBDNS_EXTERNAL_DATA extern dns_name_t *dns_tsig_hmacmd5_name;
-#define DNS_TSIG_HMACMD5_NAME dns_tsig_hmacmd5_name
-LIBDNS_EXTERNAL_DATA extern dns_name_t *dns_tsig_gssapi_name;
-#define DNS_TSIG_GSSAPI_NAME dns_tsig_gssapi_name
-LIBDNS_EXTERNAL_DATA extern dns_name_t *dns_tsig_gssapims_name;
-#define DNS_TSIG_GSSAPIMS_NAME dns_tsig_gssapims_name
-LIBDNS_EXTERNAL_DATA extern dns_name_t *dns_tsig_hmacsha1_name;
-#define DNS_TSIG_HMACSHA1_NAME dns_tsig_hmacsha1_name
-LIBDNS_EXTERNAL_DATA extern dns_name_t *dns_tsig_hmacsha224_name;
-#define DNS_TSIG_HMACSHA224_NAME dns_tsig_hmacsha224_name
-LIBDNS_EXTERNAL_DATA extern dns_name_t *dns_tsig_hmacsha256_name;
-#define DNS_TSIG_HMACSHA256_NAME dns_tsig_hmacsha256_name
-LIBDNS_EXTERNAL_DATA extern dns_name_t *dns_tsig_hmacsha384_name;
-#define DNS_TSIG_HMACSHA384_NAME dns_tsig_hmacsha384_name
-LIBDNS_EXTERNAL_DATA extern dns_name_t *dns_tsig_hmacsha512_name;
-#define DNS_TSIG_HMACSHA512_NAME dns_tsig_hmacsha512_name
-
-/*%
- * Default fudge value.
- */
-#define DNS_TSIG_FUDGE 300
-
-struct dns_tsig_keyring {
- dns_rbt_t *keys;
- unsigned int writecount;
- isc_rwlock_t lock;
- isc_mem_t *mctx;
-};
-
-struct dns_tsigkey {
- /* Unlocked */
- unsigned int magic; /*%< Magic number. */
- isc_mem_t *mctx;
- dst_key_t *key; /*%< Key */
- dns_name_t name; /*%< Key name */
- dns_name_t *algorithm; /*%< Algorithm name */
- dns_name_t *creator; /*%< name that created secret */
- isc_boolean_t generated; /*%< was this generated? */
- isc_stdtime_t inception; /*%< start of validity period */
- isc_stdtime_t expire; /*%< end of validity period */
- dns_tsig_keyring_t *ring; /*%< the enclosing keyring */
- isc_refcount_t refs; /*%< reference counter */
-};
-
-#define dns_tsigkey_identity(tsigkey) \
- ((tsigkey) == NULL ? NULL : \
- (tsigkey)->generated ? ((tsigkey)->creator) : \
- (&((tsigkey)->name)))
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_tsigkey_create(dns_name_t *name, dns_name_t *algorithm,
- unsigned char *secret, int length, isc_boolean_t generated,
- dns_name_t *creator, isc_stdtime_t inception,
- isc_stdtime_t expire, isc_mem_t *mctx,
- dns_tsig_keyring_t *ring, dns_tsigkey_t **key);
-
-isc_result_t
-dns_tsigkey_createfromkey(dns_name_t *name, dns_name_t *algorithm,
- dst_key_t *dstkey, isc_boolean_t generated,
- dns_name_t *creator, isc_stdtime_t inception,
- isc_stdtime_t expire, isc_mem_t *mctx,
- dns_tsig_keyring_t *ring, dns_tsigkey_t **key);
-/*%<
- * Creates a tsig key structure and saves it in the keyring. If key is
- * not NULL, *key will contain a copy of the key. The keys validity
- * period is specified by (inception, expire), and will not expire if
- * inception == expire. If the key was generated, the creating identity,
- * if there is one, should be in the creator parameter. Specifying an
- * unimplemented algorithm will cause failure only if dstkey != NULL; this
- * allows a transient key with an invalid algorithm to exist long enough
- * to generate a BADKEY response.
- *
- * Requires:
- *\li 'name' is a valid dns_name_t
- *\li 'algorithm' is a valid dns_name_t
- *\li 'secret' is a valid pointer
- *\li 'length' is an integer >= 0
- *\li 'key' is a valid dst key or NULL
- *\li 'creator' points to a valid dns_name_t or is NULL
- *\li 'mctx' is a valid memory context
- *\li 'ring' is a valid TSIG keyring or NULL
- *\li 'key' or '*key' must be NULL
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_EXISTS - a key with this name already exists
- *\li #ISC_R_NOTIMPLEMENTED - algorithm is not implemented
- *\li #ISC_R_NOMEMORY
- */
-
-void
-dns_tsigkey_attach(dns_tsigkey_t *source, dns_tsigkey_t **targetp);
-/*%<
- * Attach '*targetp' to 'source'.
- *
- * Requires:
- *\li 'key' is a valid TSIG key
- *
- * Ensures:
- *\li *targetp is attached to source.
- */
-
-void
-dns_tsigkey_detach(dns_tsigkey_t **keyp);
-/*%<
- * Detaches from the tsig key structure pointed to by '*key'.
- *
- * Requires:
- *\li 'keyp' is not NULL and '*keyp' is a valid TSIG key
- *
- * Ensures:
- *\li 'keyp' points to NULL
- */
-
-void
-dns_tsigkey_setdeleted(dns_tsigkey_t *key);
-/*%<
- * Prevents this key from being used again. It will be deleted when
- * no references exist.
- *
- * Requires:
- *\li 'key' is a valid TSIG key on a keyring
- */
-
-isc_result_t
-dns_tsig_sign(dns_message_t *msg);
-/*%<
- * Generates a TSIG record for this message
- *
- * Requires:
- *\li 'msg' is a valid message
- *\li 'msg->tsigkey' is a valid TSIG key
- *\li 'msg->tsig' is NULL
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_NOSPACE
- *\li #DNS_R_EXPECTEDTSIG
- * - this is a response & msg->querytsig is NULL
- */
-
-isc_result_t
-dns_tsig_verify(isc_buffer_t *source, dns_message_t *msg,
- dns_tsig_keyring_t *ring1, dns_tsig_keyring_t *ring2);
-/*%<
- * Verifies the TSIG record in this message
- *
- * Requires:
- *\li 'source' is a valid buffer containing the unparsed message
- *\li 'msg' is a valid message
- *\li 'msg->tsigkey' is a valid TSIG key if this is a response
- *\li 'msg->tsig' is NULL
- *\li 'msg->querytsig' is not NULL if this is a response
- *\li 'ring1' and 'ring2' are each either a valid keyring or NULL
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li #DNS_R_EXPECTEDTSIG - A TSIG was expected but not seen
- *\li #DNS_R_UNEXPECTEDTSIG - A TSIG was seen but not expected
- *\li #DNS_R_TSIGERRORSET - the TSIG verified but ->error was set
- * and this is a query
- *\li #DNS_R_CLOCKSKEW - the TSIG failed to verify because of
- * the time was out of the allowed range.
- *\li #DNS_R_TSIGVERIFYFAILURE - the TSIG failed to verify
- *\li #DNS_R_EXPECTEDRESPONSE - the message was set over TCP and
- * should have been a response,
- * but was not.
- */
-
-isc_result_t
-dns_tsigkey_find(dns_tsigkey_t **tsigkey, dns_name_t *name,
- dns_name_t *algorithm, dns_tsig_keyring_t *ring);
-/*%<
- * Returns the TSIG key corresponding to this name and (possibly)
- * algorithm. Also increments the key's reference counter.
- *
- * Requires:
- *\li 'tsigkey' is not NULL
- *\li '*tsigkey' is NULL
- *\li 'name' is a valid dns_name_t
- *\li 'algorithm' is a valid dns_name_t or NULL
- *\li 'ring' is a valid keyring
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOTFOUND
- */
-
-
-isc_result_t
-dns_tsigkeyring_create(isc_mem_t *mctx, dns_tsig_keyring_t **ringp);
-/*%<
- * Create an empty TSIG key ring.
- *
- * Requires:
- *\li 'mctx' is not NULL
- *\li 'ringp' is not NULL, and '*ringp' is NULL
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- */
-
-
-void
-dns_tsigkeyring_destroy(dns_tsig_keyring_t **ringp);
-/*%<
- * Destroy a TSIG key ring.
- *
- * Requires:
- *\li 'ringp' is not NULL
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_TSIG_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: ttl.h,v 1.19 2007/06/19 23:47:17 tbox Exp $ */
-
-#ifndef DNS_TTL_H
-#define DNS_TTL_H 1
-
-/*! \file dns/ttl.h */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Functions
- ***/
-
-isc_result_t
-dns_ttl_totext(isc_uint32_t src, isc_boolean_t verbose,
- isc_buffer_t *target);
-/*%<
- * Output a TTL or other time interval in a human-readable form.
- * The time interval is given as a count of seconds in 'src'.
- * The text representation is appended to 'target'.
- *
- * If 'verbose' is ISC_FALSE, use the terse BIND 8 style, like "1w2d3h4m5s".
- *
- * If 'verbose' is ISC_TRUE, use a verbose style like the SOA comments
- * in "dig", like "1 week 2 days 3 hours 4 minutes 5 seconds".
- *
- * Returns:
- * \li ISC_R_SUCCESS
- * \li ISC_R_NOSPACE
- */
-
-isc_result_t
-dns_counter_fromtext(isc_textregion_t *source, isc_uint32_t *ttl);
-/*%<
- * Converts a counter from either a plain number or a BIND 8 style value.
- *
- * Returns:
- *\li ISC_R_SUCCESS
- *\li DNS_R_SYNTAX
- */
-
-isc_result_t
-dns_ttl_fromtext(isc_textregion_t *source, isc_uint32_t *ttl);
-/*%<
- * Converts a ttl from either a plain number or a BIND 8 style value.
- *
- * Returns:
- *\li ISC_R_SUCCESS
- *\li DNS_R_BADTTL
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_TTL_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: types.h,v 1.130.50.3.12.1 2009/11/18 23:58:04 marka Exp $ */
-
-#ifndef DNS_TYPES_H
-#define DNS_TYPES_H 1
-
-/*! \file dns/types.h
- * \brief
- * Including this file gives you type declarations suitable for use in
- * .h files, which lets us avoid circular type reference problems.
- * \brief
- * To actually use a type or get declarations of its methods, you must
- * include the appropriate .h file too.
- */
-
-#include <isc/types.h>
-
-typedef struct dns_acache dns_acache_t;
-typedef struct dns_acacheentry dns_acacheentry_t;
-typedef struct dns_acachestats dns_acachestats_t;
-typedef struct dns_acl dns_acl_t;
-typedef struct dns_aclelement dns_aclelement_t;
-typedef struct dns_aclenv dns_aclenv_t;
-typedef struct dns_adb dns_adb_t;
-typedef struct dns_adbaddrinfo dns_adbaddrinfo_t;
-typedef ISC_LIST(dns_adbaddrinfo_t) dns_adbaddrinfolist_t;
-typedef struct dns_adbentry dns_adbentry_t;
-typedef struct dns_adbfind dns_adbfind_t;
-typedef ISC_LIST(dns_adbfind_t) dns_adbfindlist_t;
-typedef struct dns_byaddr dns_byaddr_t;
-typedef struct dns_cache dns_cache_t;
-typedef isc_uint16_t dns_cert_t;
-typedef struct dns_compress dns_compress_t;
-typedef struct dns_db dns_db_t;
-typedef struct dns_dbimplementation dns_dbimplementation_t;
-typedef struct dns_dbiterator dns_dbiterator_t;
-typedef void dns_dbload_t;
-typedef void dns_dbnode_t;
-typedef struct dns_dbtable dns_dbtable_t;
-typedef void dns_dbversion_t;
-typedef struct dns_dlzimplementation dns_dlzimplementation_t;
-typedef struct dns_dlzdb dns_dlzdb_t;
-typedef struct dns_sdlzimplementation dns_sdlzimplementation_t;
-typedef struct dns_decompress dns_decompress_t;
-typedef struct dns_dispatch dns_dispatch_t;
-typedef struct dns_dispatchevent dns_dispatchevent_t;
-typedef struct dns_dispatchlist dns_dispatchlist_t;
-typedef struct dns_dispatchmgr dns_dispatchmgr_t;
-typedef struct dns_dispentry dns_dispentry_t;
-typedef struct dns_dumpctx dns_dumpctx_t;
-typedef struct dns_fetch dns_fetch_t;
-typedef struct dns_fixedname dns_fixedname_t;
-typedef struct dns_forwarders dns_forwarders_t;
-typedef struct dns_fwdtable dns_fwdtable_t;
-typedef struct dns_iptable dns_iptable_t;
-typedef isc_uint32_t dns_iterations_t;
-typedef isc_uint16_t dns_keyflags_t;
-typedef struct dns_keynode dns_keynode_t;
-typedef struct dns_keytable dns_keytable_t;
-typedef isc_uint16_t dns_keytag_t;
-typedef struct dns_loadctx dns_loadctx_t;
-typedef struct dns_loadmgr dns_loadmgr_t;
-typedef struct dns_message dns_message_t;
-typedef isc_uint16_t dns_messageid_t;
-typedef isc_region_t dns_label_t;
-typedef struct dns_lookup dns_lookup_t;
-typedef struct dns_name dns_name_t;
-typedef ISC_LIST(dns_name_t) dns_namelist_t;
-typedef isc_uint16_t dns_opcode_t;
-typedef unsigned char dns_offsets_t[128];
-typedef struct dns_order dns_order_t;
-typedef struct dns_peer dns_peer_t;
-typedef struct dns_peerlist dns_peerlist_t;
-typedef struct dns_portlist dns_portlist_t;
-typedef struct dns_rbt dns_rbt_t;
-typedef isc_uint16_t dns_rcode_t;
-typedef struct dns_rdata dns_rdata_t;
-typedef struct dns_rdatacallbacks dns_rdatacallbacks_t;
-typedef isc_uint16_t dns_rdataclass_t;
-typedef struct dns_rdatalist dns_rdatalist_t;
-typedef struct dns_rdataset dns_rdataset_t;
-typedef ISC_LIST(dns_rdataset_t) dns_rdatasetlist_t;
-typedef struct dns_rdatasetiter dns_rdatasetiter_t;
-typedef isc_uint16_t dns_rdatatype_t;
-typedef struct dns_request dns_request_t;
-typedef struct dns_requestmgr dns_requestmgr_t;
-typedef struct dns_resolver dns_resolver_t;
-typedef struct dns_sdbimplementation dns_sdbimplementation_t;
-typedef isc_uint8_t dns_secalg_t;
-typedef isc_uint8_t dns_secproto_t;
-typedef struct dns_signature dns_signature_t;
-typedef struct dns_ssurule dns_ssurule_t;
-typedef struct dns_ssutable dns_ssutable_t;
-typedef struct dns_stats dns_stats_t;
-typedef isc_uint32_t dns_rdatastatstype_t;
-typedef struct dns_tkeyctx dns_tkeyctx_t;
-typedef isc_uint16_t dns_trust_t;
-typedef struct dns_tsig_keyring dns_tsig_keyring_t;
-typedef struct dns_tsigkey dns_tsigkey_t;
-typedef isc_uint32_t dns_ttl_t;
-typedef struct dns_validator dns_validator_t;
-typedef struct dns_view dns_view_t;
-typedef ISC_LIST(dns_view_t) dns_viewlist_t;
-typedef struct dns_zone dns_zone_t;
-typedef ISC_LIST(dns_zone_t) dns_zonelist_t;
-typedef struct dns_zonemgr dns_zonemgr_t;
-typedef struct dns_zt dns_zt_t;
-
-/*
- * If we are not using GSSAPI, define the types we use as opaque types here.
- */
-#ifndef GSSAPI
-typedef struct not_defined_gss_cred_id *gss_cred_id_t;
-typedef struct not_defined_gss_ctx *gss_ctx_id_t;
-#endif
-typedef struct dst_gssapi_signverifyctx dst_gssapi_signverifyctx_t;
-
-typedef enum {
- dns_hash_sha1 = 1
-} dns_hash_t;
-
-typedef enum {
- dns_fwdpolicy_none = 0,
- dns_fwdpolicy_first = 1,
- dns_fwdpolicy_only = 2
-} dns_fwdpolicy_t;
-
-typedef enum {
- dns_namereln_none = 0,
- dns_namereln_contains = 1,
- dns_namereln_subdomain = 2,
- dns_namereln_equal = 3,
- dns_namereln_commonancestor = 4
-} dns_namereln_t;
-
-typedef enum {
- dns_one_answer, dns_many_answers
-} dns_transfer_format_t;
-
-typedef enum {
- dns_dbtype_zone = 0, dns_dbtype_cache = 1, dns_dbtype_stub = 3
-} dns_dbtype_t;
-
-typedef enum {
- dns_notifytype_no = 0,
- dns_notifytype_yes = 1,
- dns_notifytype_explicit = 2,
- dns_notifytype_masteronly = 3
-} dns_notifytype_t;
-
-typedef enum {
- dns_dialuptype_no = 0,
- dns_dialuptype_yes = 1,
- dns_dialuptype_notify = 2,
- dns_dialuptype_notifypassive = 3,
- dns_dialuptype_refresh = 4,
- dns_dialuptype_passive = 5
-} dns_dialuptype_t;
-
-typedef enum {
- dns_masterformat_none = 0,
- dns_masterformat_text = 1,
- dns_masterformat_raw = 2
-} dns_masterformat_t;
-
-/*
- * These are generated by gen.c.
- */
-#include <dns/enumtype.h> /* Provides dns_rdatatype_t. */
-#include <dns/enumclass.h> /* Provides dns_rdataclass_t. */
-
-/*%
- * rcodes.
- */
-enum {
- /*
- * Standard rcodes.
- */
- dns_rcode_noerror = 0,
-#define dns_rcode_noerror ((dns_rcode_t)dns_rcode_noerror)
- dns_rcode_formerr = 1,
-#define dns_rcode_formerr ((dns_rcode_t)dns_rcode_formerr)
- dns_rcode_servfail = 2,
-#define dns_rcode_servfail ((dns_rcode_t)dns_rcode_servfail)
- dns_rcode_nxdomain = 3,
-#define dns_rcode_nxdomain ((dns_rcode_t)dns_rcode_nxdomain)
- dns_rcode_notimp = 4,
-#define dns_rcode_notimp ((dns_rcode_t)dns_rcode_notimp)
- dns_rcode_refused = 5,
-#define dns_rcode_refused ((dns_rcode_t)dns_rcode_refused)
- dns_rcode_yxdomain = 6,
-#define dns_rcode_yxdomain ((dns_rcode_t)dns_rcode_yxdomain)
- dns_rcode_yxrrset = 7,
-#define dns_rcode_yxrrset ((dns_rcode_t)dns_rcode_yxrrset)
- dns_rcode_nxrrset = 8,
-#define dns_rcode_nxrrset ((dns_rcode_t)dns_rcode_nxrrset)
- dns_rcode_notauth = 9,
-#define dns_rcode_notauth ((dns_rcode_t)dns_rcode_notauth)
- dns_rcode_notzone = 10,
-#define dns_rcode_notzone ((dns_rcode_t)dns_rcode_notzone)
- /*
- * Extended rcodes.
- */
- dns_rcode_badvers = 16
-#define dns_rcode_badvers ((dns_rcode_t)dns_rcode_badvers)
-};
-
-/*%
- * TSIG errors.
- */
-enum {
- dns_tsigerror_badsig = 16,
- dns_tsigerror_badkey = 17,
- dns_tsigerror_badtime = 18,
- dns_tsigerror_badmode = 19,
- dns_tsigerror_badname = 20,
- dns_tsigerror_badalg = 21,
- dns_tsigerror_badtrunc = 22
-};
-
-/*%
- * Opcodes.
- */
-enum {
- dns_opcode_query = 0,
-#define dns_opcode_query ((dns_opcode_t)dns_opcode_query)
- dns_opcode_iquery = 1,
-#define dns_opcode_iquery ((dns_opcode_t)dns_opcode_iquery)
- dns_opcode_status = 2,
-#define dns_opcode_status ((dns_opcode_t)dns_opcode_status)
- dns_opcode_notify = 4,
-#define dns_opcode_notify ((dns_opcode_t)dns_opcode_notify)
- dns_opcode_update = 5 /* dynamic update */
-#define dns_opcode_update ((dns_opcode_t)dns_opcode_update)
-};
-
-/*%
- * Trust levels. Must be kept in sync with trustnames[] in masterdump.c.
- */
-enum {
- /* Sentinel value; no data should have this trust level. */
- dns_trust_none = 0,
-#define dns_trust_none ((dns_trust_t)dns_trust_none)
-
- /*%
- * Subject to DNSSEC validation but has not yet been validated
- * dns_trust_pending_additional (from the additional section).
- */
- dns_trust_pending_additional = 1,
-#define dns_trust_pending_additional \
- ((dns_trust_t)dns_trust_pending_additional)
-
- dns_trust_pending_answer = 2,
-#define dns_trust_pending_answer ((dns_trust_t)dns_trust_pending_answer)
-
- /*% Received in the additional section of a response. */
- dns_trust_additional = 3,
-#define dns_trust_additional ((dns_trust_t)dns_trust_additional)
-
- /* Received in a referral response. */
- dns_trust_glue = 4,
-#define dns_trust_glue ((dns_trust_t)dns_trust_glue)
-
- /* Answer from a non-authoritative server */
- dns_trust_answer = 5,
-#define dns_trust_answer ((dns_trust_t)dns_trust_answer)
-
- /* Received in the authority section as part of an
- authoritative response */
- dns_trust_authauthority = 6,
-#define dns_trust_authauthority ((dns_trust_t)dns_trust_authauthority)
-
- /* Answer from an authoritative server */
- dns_trust_authanswer = 7,
-#define dns_trust_authanswer ((dns_trust_t)dns_trust_authanswer)
-
- /* Successfully DNSSEC validated */
- dns_trust_secure = 8,
-#define dns_trust_secure ((dns_trust_t)dns_trust_secure)
-
- /* This server is authoritative */
- dns_trust_ultimate = 9
-#define dns_trust_ultimate ((dns_trust_t)dns_trust_ultimate)
-};
-
-#define DNS_TRUST_PENDING(x) ((x) == dns_trust_pending_answer || \
- (x) == dns_trust_pending_additional)
-#define DNS_TRUST_ADDITIONAL(x) ((x) == dns_trust_additional || \
- (x) == dns_trust_pending_additional)
-#define DNS_TRUST_GLUE(x) ((x) == dns_trust_glue)
-
-
-/*%
- * Name checking severities.
- */
-typedef enum {
- dns_severity_ignore,
- dns_severity_warn,
- dns_severity_fail
-} dns_severity_t;
-
-/*
- * Functions.
- */
-typedef void
-(*dns_dumpdonefunc_t)(void *, isc_result_t);
-
-typedef void
-(*dns_loaddonefunc_t)(void *, isc_result_t);
-
-typedef isc_result_t
-(*dns_addrdatasetfunc_t)(void *, dns_name_t *, dns_rdataset_t *);
-
-typedef isc_result_t
-(*dns_additionaldatafunc_t)(void *, dns_name_t *, dns_rdatatype_t);
-
-typedef isc_result_t
-(*dns_digestfunc_t)(void *, isc_region_t *);
-
-typedef void
-(*dns_xfrindone_t)(dns_zone_t *, isc_result_t);
-
-typedef void
-(*dns_updatecallback_t)(void *, isc_result_t, dns_message_t *);
-
-typedef int
-(*dns_rdatasetorderfunc_t)(const dns_rdata_t *, const void *);
-
-typedef isc_boolean_t
-(*dns_checkmxfunc_t)(dns_zone_t *, dns_name_t *, dns_name_t *);
-
-typedef isc_boolean_t
-(*dns_checksrvfunc_t)(dns_zone_t *, dns_name_t *, dns_name_t *);
-
-typedef isc_boolean_t
-(*dns_checknsfunc_t)(dns_zone_t *, dns_name_t *, dns_name_t *,
- dns_rdataset_t *, dns_rdataset_t *);
-
-typedef isc_boolean_t
-(*dns_isselffunc_t)(dns_view_t *, dns_tsigkey_t *, isc_sockaddr_t *,
- isc_sockaddr_t *, dns_rdataclass_t, void *);
-
-#endif /* DNS_TYPES_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: validator.h,v 1.41.48.3 2009/01/18 23:25:17 marka Exp $ */
-
-#ifndef DNS_VALIDATOR_H
-#define DNS_VALIDATOR_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/validator.h
- *
- * \brief
- * DNS Validator
- * This is the BIND 9 validator, the module responsible for validating the
- * rdatasets and negative responses (messages). It makes use of zones in
- * the view and may fetch RRset to complete trust chains. It implements
- * DNSSEC as specified in RFC 4033, 4034 and 4035.
- *
- * It can also optionally implement ISC's DNSSEC look-aside validation.
- *
- * Correct operation is critical to preventing spoofed answers from secure
- * zones being accepted.
- *
- * MP:
- *\li The module ensures appropriate synchronization of data structures it
- * creates and manipulates.
- *
- * Reliability:
- *\li No anticipated impact.
- *
- * Resources:
- *\li TBS
- *
- * Security:
- *\li No anticipated impact.
- *
- * Standards:
- *\li RFCs: 1034, 1035, 2181, 4033, 4034, 4035.
- */
-
-#include <isc/lang.h>
-#include <isc/event.h>
-#include <isc/mutex.h>
-
-#include <dns/fixedname.h>
-#include <dns/types.h>
-#include <dns/rdataset.h>
-#include <dns/rdatastruct.h> /* for dns_rdata_rrsig_t */
-
-#include <dst/dst.h>
-
-/*%
- * A dns_validatorevent_t is sent when a 'validation' completes.
- * \brief
- * 'name', 'rdataset', 'sigrdataset', and 'message' are the values that were
- * supplied when dns_validator_create() was called. They are returned to the
- * caller so that they may be freed.
- *
- * If the RESULT is ISC_R_SUCCESS and the answer is secure then
- * proofs[] will contain the names of the NSEC records that hold the
- * various proofs. Note the same name may appear multiple times.
- */
-typedef struct dns_validatorevent {
- ISC_EVENT_COMMON(struct dns_validatorevent);
- dns_validator_t * validator;
- isc_result_t result;
- /*
- * Name and type of the response to be validated.
- */
- dns_name_t * name;
- dns_rdatatype_t type;
- /*
- * Rdata and RRSIG (if any) for positive responses.
- */
- dns_rdataset_t * rdataset;
- dns_rdataset_t * sigrdataset;
- /*
- * The full response. Required for negative responses.
- * Also required for positive wildcard responses.
- */
- dns_message_t * message;
- /*
- * Proofs to be cached.
- */
- dns_name_t * proofs[4];
- /*
- * Optout proof seen.
- */
- isc_boolean_t optout;
-} dns_validatorevent_t;
-
-#define DNS_VALIDATOR_NOQNAMEPROOF 0
-#define DNS_VALIDATOR_NODATAPROOF 1
-#define DNS_VALIDATOR_NOWILDCARDPROOF 2
-#define DNS_VALIDATOR_CLOSESTENCLOSER 3
-
-/*%
- * A validator object represents a validation in progress.
- * \brief
- * Clients are strongly discouraged from using this type directly, with
- * the exception of the 'link' field, which may be used directly for
- * whatever purpose the client desires.
- */
-struct dns_validator {
- /* Unlocked. */
- unsigned int magic;
- isc_mutex_t lock;
- dns_view_t * view;
- /* Locked by lock. */
- unsigned int options;
- unsigned int attributes;
- dns_validatorevent_t * event;
- dns_fetch_t * fetch;
- dns_validator_t * subvalidator;
- dns_validator_t * parent;
- dns_keytable_t * keytable;
- dns_keynode_t * keynode;
- dst_key_t * key;
- dns_rdata_rrsig_t * siginfo;
- isc_task_t * task;
- isc_taskaction_t action;
- void * arg;
- unsigned int labels;
- dns_rdataset_t * currentset;
- isc_boolean_t seensig;
- dns_rdataset_t * keyset;
- dns_rdataset_t * dsset;
- dns_rdataset_t * soaset;
- dns_rdataset_t * nsecset;
- dns_rdataset_t * nsec3set;
- dns_name_t * soaname;
- dns_rdataset_t frdataset;
- dns_rdataset_t fsigrdataset;
- dns_fixedname_t fname;
- dns_fixedname_t wild;
- dns_fixedname_t nearest;
- dns_fixedname_t closest;
- ISC_LINK(dns_validator_t) link;
- dns_rdataset_t dlv;
- dns_fixedname_t dlvsep;
- isc_boolean_t havedlvsep;
- isc_boolean_t mustbesecure;
- unsigned int dlvlabels;
- unsigned int depth;
-};
-
-/*%
- * dns_validator_create() options.
- */
-#define DNS_VALIDATOR_DLV 1U
-#define DNS_VALIDATOR_DEFER 2U
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_validator_create(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
- dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset,
- dns_message_t *message, unsigned int options,
- isc_task_t *task, isc_taskaction_t action, void *arg,
- dns_validator_t **validatorp);
-/*%<
- * Start a DNSSEC validation.
- *
- * This validates a response to the question given by
- * 'name' and 'type'.
- *
- * To validate a positive response, the response data is
- * given by 'rdataset' and 'sigrdataset'. If 'sigrdataset'
- * is NULL, the data is presumed insecure and an attempt
- * is made to prove its insecurity by finding the appropriate
- * null key.
- *
- * The complete response message may be given in 'message',
- * to make available any authority section NSECs that may be
- * needed for validation of a response resulting from a
- * wildcard expansion (though no such wildcard validation
- * is implemented yet). If the complete response message
- * is not available, 'message' is NULL.
- *
- * To validate a negative response, the complete negative response
- * message is given in 'message'. The 'rdataset', and
- * 'sigrdataset' arguments must be NULL, but the 'name' and 'type'
- * arguments must be provided.
- *
- * The validation is performed in the context of 'view'.
- *
- * When the validation finishes, a dns_validatorevent_t with
- * the given 'action' and 'arg' are sent to 'task'.
- * Its 'result' field will be ISC_R_SUCCESS iff the
- * response was successfully proven to be either secure or
- * part of a known insecure domain.
- *
- * options:
- * If DNS_VALIDATOR_DLV is set the caller knows there is not a
- * trusted key and the validator should immediately attempt to validate
- * the answer by looking for an appropriate DLV RRset.
- */
-
-void
-dns_validator_send(dns_validator_t *validator);
-/*%<
- * Send a deferred validation request
- *
- * Requires:
- * 'validator' to points to a valid DNSSEC validator.
- */
-
-void
-dns_validator_cancel(dns_validator_t *validator);
-/*%<
- * Cancel a DNSSEC validation in progress.
- *
- * Requires:
- *\li 'validator' points to a valid DNSSEC validator, which
- * may or may not already have completed.
- *
- * Ensures:
- *\li It the validator has not already sent its completion
- * event, it will send it with result code ISC_R_CANCELED.
- */
-
-void
-dns_validator_destroy(dns_validator_t **validatorp);
-/*%<
- * Destroy a DNSSEC validator.
- *
- * Requires:
- *\li '*validatorp' points to a valid DNSSEC validator.
- * \li The validator must have completed and sent its completion
- * event.
- *
- * Ensures:
- *\li All resources used by the validator are freed.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_VALIDATOR_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: version.h,v 1.9 2007/06/19 23:47:17 tbox Exp $ */
-
-/*! \file dns/version.h */
-
-#include <isc/platform.h>
-
-LIBDNS_EXTERNAL_DATA extern const char dns_version[];
-
-LIBDNS_EXTERNAL_DATA extern const unsigned int dns_libinterface;
-LIBDNS_EXTERNAL_DATA extern const unsigned int dns_librevision;
-LIBDNS_EXTERNAL_DATA extern const unsigned int dns_libage;
+++ /dev/null
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: view.h,v 1.111.88.4 2009/01/29 22:40:35 jinmei Exp $ */
-
-#ifndef DNS_VIEW_H
-#define DNS_VIEW_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/view.h
- * \brief
- * DNS View
- *
- * A "view" is a DNS namespace, together with an optional resolver and a
- * forwarding policy. A "DNS namespace" is a (possibly empty) set of
- * authoritative zones together with an optional cache and optional
- * "hints" information.
- *
- * Views start out "unfrozen". In this state, core attributes like
- * the cache, set of zones, and forwarding policy may be set. While
- * "unfrozen", the caller (e.g. nameserver configuration loading
- * code), must ensure exclusive access to the view. When the view is
- * "frozen", the core attributes become immutable, and the view module
- * will ensure synchronization. Freezing allows the view's core attributes
- * to be accessed without locking.
- *
- * MP:
- *\li Before the view is frozen, the caller must ensure synchronization.
- *
- *\li After the view is frozen, the module guarantees appropriate
- * synchronization of any data structures it creates and manipulates.
- *
- * Reliability:
- *\li No anticipated impact.
- *
- * Resources:
- *\li TBS
- *
- * Security:
- *\li No anticipated impact.
- *
- * Standards:
- *\li None.
- */
-
-#include <stdio.h>
-
-#include <isc/lang.h>
-#include <isc/magic.h>
-#include <isc/event.h>
-#include <isc/mutex.h>
-#include <isc/net.h>
-#include <isc/refcount.h>
-#include <isc/rwlock.h>
-#include <isc/stdtime.h>
-
-#include <dns/acl.h>
-#include <dns/fixedname.h>
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-struct dns_view {
- /* Unlocked. */
- unsigned int magic;
- isc_mem_t * mctx;
- dns_rdataclass_t rdclass;
- char * name;
- dns_zt_t * zonetable;
- dns_dlzdb_t * dlzdatabase;
- dns_resolver_t * resolver;
- dns_adb_t * adb;
- dns_requestmgr_t * requestmgr;
- dns_acache_t * acache;
- dns_cache_t * cache;
- dns_db_t * cachedb;
- dns_db_t * hints;
- dns_keytable_t * secroots;
- dns_keytable_t * trustedkeys;
- isc_mutex_t lock;
- isc_boolean_t frozen;
- isc_task_t * task;
- isc_event_t resevent;
- isc_event_t adbevent;
- isc_event_t reqevent;
- isc_stats_t * resstats;
- dns_stats_t * resquerystats;
-
- /* Configurable data. */
- dns_tsig_keyring_t * statickeys;
- dns_tsig_keyring_t * dynamickeys;
- dns_peerlist_t * peers;
- dns_order_t * order;
- dns_fwdtable_t * fwdtable;
- isc_boolean_t recursion;
- isc_boolean_t auth_nxdomain;
- isc_boolean_t additionalfromcache;
- isc_boolean_t additionalfromauth;
- isc_boolean_t minimalresponses;
- isc_boolean_t enablednssec;
- isc_boolean_t enablevalidation;
- isc_boolean_t acceptexpired;
- dns_transfer_format_t transfer_format;
- dns_acl_t * queryacl;
- dns_acl_t * queryonacl;
- dns_acl_t * recursionacl;
- dns_acl_t * recursiononacl;
- dns_acl_t * sortlist;
- dns_acl_t * notifyacl;
- dns_acl_t * transferacl;
- dns_acl_t * updateacl;
- dns_acl_t * upfwdacl;
- isc_boolean_t requestixfr;
- isc_boolean_t provideixfr;
- isc_boolean_t requestnsid;
- dns_ttl_t maxcachettl;
- dns_ttl_t maxncachettl;
- dns_ttl_t mincachettl;
- dns_ttl_t minncachettl;
- in_port_t dstport;
- dns_aclenv_t aclenv;
- dns_rdatatype_t preferred_glue;
- isc_boolean_t flush;
- dns_namelist_t * delonly;
- isc_boolean_t rootdelonly;
- dns_namelist_t * rootexclude;
- isc_boolean_t checknames;
- dns_name_t * dlv;
- dns_fixedname_t dlv_fixed;
- isc_uint16_t maxudp;
-
- /*
- * Configurable data for server use only,
- * locked by server configuration lock.
- */
- dns_acl_t * matchclients;
- dns_acl_t * matchdestinations;
- isc_boolean_t matchrecursiveonly;
-
- /* Locked by themselves. */
- isc_refcount_t references;
-
- /* Locked by lock. */
- unsigned int weakrefs;
- unsigned int attributes;
- /* Under owner's locking control. */
- ISC_LINK(struct dns_view) link;
-};
-
-#define DNS_VIEW_MAGIC ISC_MAGIC('V','i','e','w')
-#define DNS_VIEW_VALID(view) ISC_MAGIC_VALID(view, DNS_VIEW_MAGIC)
-
-#define DNS_VIEWATTR_RESSHUTDOWN 0x01
-#define DNS_VIEWATTR_ADBSHUTDOWN 0x02
-#define DNS_VIEWATTR_REQSHUTDOWN 0x04
-
-isc_result_t
-dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
- const char *name, dns_view_t **viewp);
-/*%<
- * Create a view.
- *
- * Notes:
- *
- *\li The newly created view has no cache, no resolver, and an empty
- * zone table. The view is not frozen.
- *
- * Requires:
- *
- *\li 'mctx' is a valid memory context.
- *
- *\li 'rdclass' is a valid class.
- *
- *\li 'name' is a valid C string.
- *
- *\li viewp != NULL && *viewp == NULL
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *
- *\li Other errors are possible.
- */
-
-void
-dns_view_attach(dns_view_t *source, dns_view_t **targetp);
-/*%<
- * Attach '*targetp' to 'source'.
- *
- * Requires:
- *
- *\li 'source' is a valid, frozen view.
- *
- *\li 'targetp' points to a NULL dns_view_t *.
- *
- * Ensures:
- *
- *\li *targetp is attached to source.
- *
- *\li While *targetp is attached, the view will not shut down.
- */
-
-void
-dns_view_detach(dns_view_t **viewp);
-/*%<
- * Detach '*viewp' from its view.
- *
- * Requires:
- *
- *\li 'viewp' points to a valid dns_view_t *
- *
- * Ensures:
- *
- *\li *viewp is NULL.
- */
-
-void
-dns_view_flushanddetach(dns_view_t **viewp);
-/*%<
- * Detach '*viewp' from its view. If this was the last reference
- * uncommitted changed in zones will be flushed to disk.
- *
- * Requires:
- *
- *\li 'viewp' points to a valid dns_view_t *
- *
- * Ensures:
- *
- *\li *viewp is NULL.
- */
-
-void
-dns_view_weakattach(dns_view_t *source, dns_view_t **targetp);
-/*%<
- * Weakly attach '*targetp' to 'source'.
- *
- * Requires:
- *
- *\li 'source' is a valid, frozen view.
- *
- *\li 'targetp' points to a NULL dns_view_t *.
- *
- * Ensures:
- *
- *\li *targetp is attached to source.
- *
- * \li While *targetp is attached, the view will not be freed.
- */
-
-void
-dns_view_weakdetach(dns_view_t **targetp);
-/*%<
- * Detach '*viewp' from its view.
- *
- * Requires:
- *
- *\li 'viewp' points to a valid dns_view_t *.
- *
- * Ensures:
- *
- *\li *viewp is NULL.
- */
-
-isc_result_t
-dns_view_createresolver(dns_view_t *view,
- isc_taskmgr_t *taskmgr, unsigned int ntasks,
- isc_socketmgr_t *socketmgr,
- isc_timermgr_t *timermgr,
- unsigned int options,
- dns_dispatchmgr_t *dispatchmgr,
- dns_dispatch_t *dispatchv4,
- dns_dispatch_t *dispatchv6);
-/*%<
- * Create a resolver and address database for the view.
- *
- * Requires:
- *
- *\li 'view' is a valid, unfrozen view.
- *
- *\li 'view' does not have a resolver already.
- *
- *\li The requirements of dns_resolver_create() apply to 'taskmgr',
- * 'ntasks', 'socketmgr', 'timermgr', 'options', 'dispatchv4', and
- * 'dispatchv6'.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *
- *\li Any error that dns_resolver_create() can return.
- */
-
-void
-dns_view_setcache(dns_view_t *view, dns_cache_t *cache);
-/*%<
- * Set the view's cache database.
- *
- * Requires:
- *
- *\li 'view' is a valid, unfrozen view.
- *
- *\li 'cache' is a valid cache.
- *
- * Ensures:
- *
- * \li The cache of 'view' is 'cached.
- *
- *\li If this is not the first call to dns_view_setcache() for this
- * view, then previously set cache is detached.
- */
-
-void
-dns_view_sethints(dns_view_t *view, dns_db_t *hints);
-/*%<
- * Set the view's hints database.
- *
- * Requires:
- *
- *\li 'view' is a valid, unfrozen view, whose hints database has not been
- * set.
- *
- *\li 'hints' is a valid zone database.
- *
- * Ensures:
- *
- * \li The hints database of 'view' is 'hints'.
- */
-
-void
-dns_view_setkeyring(dns_view_t *view, dns_tsig_keyring_t *ring);
-/*%<
- * Set the view's static TSIG keys
- *
- * Requires:
- *
- * \li 'view' is a valid, unfrozen view, whose static TSIG keyring has not
- * been set.
- *
- *\li 'ring' is a valid TSIG keyring
- *
- * Ensures:
- *
- *\li The static TSIG keyring of 'view' is 'ring'.
- */
-
-void
-dns_view_setdstport(dns_view_t *view, in_port_t dstport);
-/*%<
- * Set the view's destination port. This is the port to
- * which outgoing queries are sent. The default is 53,
- * the standard DNS port.
- *
- * Requires:
- *
- *\li 'view' is a valid view.
- *
- *\li 'dstport' is a valid TCP/UDP port number.
- *
- * Ensures:
- *\li External name servers will be assumed to be listening
- * on 'dstport'. For servers whose address has already
- * obtained obtained at the time of the call, the view may
- * continue to use the previously set port until the address
- * times out from the view's address database.
- */
-
-
-isc_result_t
-dns_view_addzone(dns_view_t *view, dns_zone_t *zone);
-/*%<
- * Add zone 'zone' to 'view'.
- *
- * Requires:
- *
- *\li 'view' is a valid, unfrozen view.
- *
- *\li 'zone' is a valid zone.
- */
-
-void
-dns_view_freeze(dns_view_t *view);
-/*%<
- * Freeze view.
- *
- * Requires:
- *
- *\li 'view' is a valid, unfrozen view.
- *
- * Ensures:
- *
- *\li 'view' is frozen.
- */
-
-isc_result_t
-dns_view_find(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
- isc_stdtime_t now, unsigned int options, isc_boolean_t use_hints,
- dns_db_t **dbp, dns_dbnode_t **nodep, dns_name_t *foundname,
- dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
-/*%<
- * Find an rdataset whose owner name is 'name', and whose type is
- * 'type'.
- *
- * Notes:
- *
- *\li See the description of dns_db_find() for information about 'options'.
- * If the caller sets #DNS_DBFIND_GLUEOK, it must ensure that 'name'
- * and 'type' are appropriate for glue retrieval.
- *
- *\li If 'now' is zero, then the current time will be used.
- *
- *\li If 'use_hints' is ISC_TRUE, and the view has a hints database, then
- * it will be searched last. If the answer is found in the hints
- * database, the result code will be DNS_R_HINT. If the name is found
- * in the hints database but not the type, the result code will be
- * #DNS_R_HINTNXRRSET.
- *
- *\li 'foundname' must meet the requirements of dns_db_find().
- *
- *\li If 'sigrdataset' is not NULL, and there is a SIG rdataset which
- * covers 'type', then 'sigrdataset' will be bound to it.
- *
- * Requires:
- *
- *\li 'view' is a valid, frozen view.
- *
- *\li 'name' is valid name.
- *
- *\li 'type' is a valid dns_rdatatype_t, and is not a meta query type
- * except dns_rdatatype_any.
- *
- *\li dbp == NULL || *dbp == NULL
- *
- *\li nodep == NULL || *nodep == NULL. If nodep != NULL, dbp != NULL.
- *
- *\li 'foundname' is a valid name with a dedicated buffer or NULL.
- *
- *\li 'rdataset' is a valid, disassociated rdataset.
- *
- *\li 'sigrdataset' is NULL, or is a valid, disassociated rdataset.
- *
- * Ensures:
- *
- *\li In successful cases, 'rdataset', and possibly 'sigrdataset', are
- * bound to the found data.
- *
- *\li If dbp != NULL, it points to the database containing the data.
- *
- *\li If nodep != NULL, it points to the database node containing the data.
- *
- *\li If foundname != NULL, it contains the full name of the found data.
- *
- * Returns:
- *
- *\li Any result that dns_db_find() can return, with the exception of
- * #DNS_R_DELEGATION.
- */
-
-isc_result_t
-dns_view_simplefind(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
- isc_stdtime_t now, unsigned int options,
- isc_boolean_t use_hints,
- dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
-/*%<
- * Find an rdataset whose owner name is 'name', and whose type is
- * 'type'.
- *
- * Notes:
- *
- *\li This routine is appropriate for simple, exact-match queries of the
- * view. 'name' must be a canonical name; there is no DNAME or CNAME
- * processing.
- *
- *\li See the description of dns_db_find() for information about 'options'.
- * If the caller sets DNS_DBFIND_GLUEOK, it must ensure that 'name'
- * and 'type' are appropriate for glue retrieval.
- *
- *\li If 'now' is zero, then the current time will be used.
- *
- *\li If 'use_hints' is ISC_TRUE, and the view has a hints database, then
- * it will be searched last. If the answer is found in the hints
- * database, the result code will be DNS_R_HINT. If the name is found
- * in the hints database but not the type, the result code will be
- * DNS_R_HINTNXRRSET.
- *
- *\li If 'sigrdataset' is not NULL, and there is a SIG rdataset which
- * covers 'type', then 'sigrdataset' will be bound to it.
- *
- * Requires:
- *
- *\li 'view' is a valid, frozen view.
- *
- *\li 'name' is valid name.
- *
- *\li 'type' is a valid dns_rdatatype_t, and is not a meta query type
- * (e.g. dns_rdatatype_any), or dns_rdatatype_rrsig.
- *
- *\li 'rdataset' is a valid, disassociated rdataset.
- *
- *\li 'sigrdataset' is NULL, or is a valid, disassociated rdataset.
- *
- * Ensures:
- *
- *\li In successful cases, 'rdataset', and possibly 'sigrdataset', are
- * bound to the found data.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS Success; result is desired type.
- *\li DNS_R_GLUE Success; result is glue.
- *\li DNS_R_HINT Success; result is a hint.
- *\li DNS_R_NCACHENXDOMAIN Success; result is a ncache entry.
- *\li DNS_R_NCACHENXRRSET Success; result is a ncache entry.
- *\li DNS_R_NXDOMAIN The name does not exist.
- *\li DNS_R_NXRRSET The rrset does not exist.
- *\li #ISC_R_NOTFOUND No matching data found,
- * or an error occurred.
- */
-
-/*% See dns_view_findzonecut2() */
-isc_result_t
-dns_view_findzonecut(dns_view_t *view, dns_name_t *name, dns_name_t *fname,
- isc_stdtime_t now, unsigned int options,
- isc_boolean_t use_hints,
- dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
-
-isc_result_t
-dns_view_findzonecut2(dns_view_t *view, dns_name_t *name, dns_name_t *fname,
- isc_stdtime_t now, unsigned int options,
- isc_boolean_t use_hints, isc_boolean_t use_cache,
- dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
-/*%<
- * Find the best known zonecut containing 'name'.
- *
- * This uses local authority, cache, and optionally hints data.
- * No external queries are performed.
- *
- * Notes:
- *
- *\li If 'now' is zero, then the current time will be used.
- *
- *\li If 'use_hints' is ISC_TRUE, and the view has a hints database, then
- * it will be searched last.
- *
- *\li If 'use_cache' is ISC_TRUE, and the view has a cache, then it will be
- * searched.
- *
- *\li If 'sigrdataset' is not NULL, and there is a SIG rdataset which
- * covers 'type', then 'sigrdataset' will be bound to it.
- *
- *\li If the DNS_DBFIND_NOEXACT option is set, then the zonecut returned
- * (if any) will be the deepest known ancestor of 'name'.
- *
- * Requires:
- *
- *\li 'view' is a valid, frozen view.
- *
- *\li 'name' is valid name.
- *
- *\li 'rdataset' is a valid, disassociated rdataset.
- *
- *\li 'sigrdataset' is NULL, or is a valid, disassociated rdataset.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS Success.
- *
- *\li Many other results are possible.
- */
-
-isc_result_t
-dns_viewlist_find(dns_viewlist_t *list, const char *name,
- dns_rdataclass_t rdclass, dns_view_t **viewp);
-/*%<
- * Search for a view with name 'name' and class 'rdclass' in 'list'.
- * If found, '*viewp' is (strongly) attached to it.
- *
- * Requires:
- *
- *\li 'viewp' points to a NULL dns_view_t *.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS A matching view was found.
- *\li #ISC_R_NOTFOUND No matching view was found.
- */
-
-isc_result_t
-dns_viewlist_findzone(dns_viewlist_t *list, dns_name_t *name, isc_boolean_t allclasses,
- dns_rdataclass_t rdclass, dns_zone_t **zonep);
-
-/*%<
- * Search zone with 'name' in view with 'rdclass' in viewlist 'list'
- * If found, zone is returned in *zonep. If allclasses is set rdclass is ignored
- *
- * Returns:
- *\li #ISC_R_SUCCESS A matching zone was found.
- *\li #ISC_R_NOTFOUND No matching zone was found.
- */
-
-isc_result_t
-dns_view_findzone(dns_view_t *view, dns_name_t *name, dns_zone_t **zonep);
-/*%<
- * Search for the zone 'name' in the zone table of 'view'.
- * If found, 'zonep' is (strongly) attached to it. There
- * are no partial matches.
- *
- * Requires:
- *
- *\li 'zonep' points to a NULL dns_zone_t *.
- *
- * Returns:
- *\li #ISC_R_SUCCESS A matching zone was found.
- *\li #ISC_R_NOTFOUND No matching zone was found.
- *\li others An error occurred.
- */
-
-isc_result_t
-dns_view_load(dns_view_t *view, isc_boolean_t stop);
-
-isc_result_t
-dns_view_loadnew(dns_view_t *view, isc_boolean_t stop);
-/*%<
- * Load zones attached to this view. dns_view_load() loads
- * all zones whose master file has changed since the last
- * load; dns_view_loadnew() loads only zones that have never
- * been loaded.
- *
- * If 'stop' is ISC_TRUE, stop on the first error and return it.
- * If 'stop' is ISC_FALSE, ignore errors.
- *
- * Requires:
- *
- *\li 'view' is valid.
- */
-
-isc_result_t
-dns_view_gettsig(dns_view_t *view, dns_name_t *keyname,
- dns_tsigkey_t **keyp);
-/*%<
- * Find the TSIG key configured in 'view' with name 'keyname',
- * if any.
- *
- * Requires:
- *\li keyp points to a NULL dns_tsigkey_t *.
- *
- * Returns:
- *\li #ISC_R_SUCCESS A key was found and '*keyp' now points to it.
- *\li #ISC_R_NOTFOUND No key was found.
- *\li others An error occurred.
- */
-
-isc_result_t
-dns_view_getpeertsig(dns_view_t *view, isc_netaddr_t *peeraddr,
- dns_tsigkey_t **keyp);
-/*%<
- * Find the TSIG key configured in 'view' for the server whose
- * address is 'peeraddr', if any.
- *
- * Requires:
- * keyp points to a NULL dns_tsigkey_t *.
- *
- * Returns:
- *\li #ISC_R_SUCCESS A key was found and '*keyp' now points to it.
- *\li #ISC_R_NOTFOUND No key was found.
- *\li others An error occurred.
- */
-
-isc_result_t
-dns_view_checksig(dns_view_t *view, isc_buffer_t *source, dns_message_t *msg);
-/*%<
- * Verifies the signature of a message.
- *
- * Requires:
- *
- *\li 'view' is a valid view.
- *\li 'source' is a valid buffer containing the message
- *\li 'msg' is a valid message
- *
- * Returns:
- *\li see dns_tsig_verify()
- */
-
-void
-dns_view_dialup(dns_view_t *view);
-/*%<
- * Perform dialup-time maintenance on the zones of 'view'.
- */
-
-isc_result_t
-dns_view_dumpdbtostream(dns_view_t *view, FILE *fp);
-/*%<
- * Dump the current state of the view 'view' to the stream 'fp'
- * for purposes of analysis or debugging.
- *
- * Currently the dumped state includes the view's cache; in the future
- * it may also include other state such as the address database.
- * It will not not include authoritative data since it is voluminous and
- * easily obtainable by other means.
- *
- * Requires:
- *
- *\li 'view' is valid.
- *
- *\li 'fp' refers to a file open for writing.
- *
- * Returns:
- * \li ISC_R_SUCCESS The cache was successfully dumped.
- * \li others An error occurred (see dns_master_dump)
- */
-
-isc_result_t
-dns_view_flushcache(dns_view_t *view);
-/*%<
- * Flush the view's cache (and ADB).
- *
- * Requires:
- * 'view' is valid.
- *
- * No other tasks are executing.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- */
-
-isc_result_t
-dns_view_flushname(dns_view_t *view, dns_name_t *);
-/*%<
- * Flush the given name from the view's cache (and ADB).
- *
- * Requires:
- *\li 'view' is valid.
- *\li 'name' is valid.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- * other returns are failures.
- */
-
-isc_result_t
-dns_view_adddelegationonly(dns_view_t *view, dns_name_t *name);
-/*%<
- * Add the given name to the delegation only table.
- *
- *
- * Requires:
- *\li 'view' is valid.
- *\li 'name' is valid.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- */
-
-isc_result_t
-dns_view_excludedelegationonly(dns_view_t *view, dns_name_t *name);
-/*%<
- * Add the given name to be excluded from the root-delegation-only.
- *
- *
- * Requires:
- *\li 'view' is valid.
- *\li 'name' is valid.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- */
-
-isc_boolean_t
-dns_view_isdelegationonly(dns_view_t *view, dns_name_t *name);
-/*%<
- * Check if 'name' is in the delegation only table or if
- * rootdelonly is set that name is not being excluded.
- *
- * Requires:
- *\li 'view' is valid.
- *\li 'name' is valid.
- *
- * Returns:
- *\li #ISC_TRUE if the name is the table.
- *\li #ISC_FALSE otherwise.
- */
-
-void
-dns_view_setrootdelonly(dns_view_t *view, isc_boolean_t value);
-/*%<
- * Set the root delegation only flag.
- *
- * Requires:
- *\li 'view' is valid.
- */
-
-isc_boolean_t
-dns_view_getrootdelonly(dns_view_t *view);
-/*%<
- * Get the root delegation only flag.
- *
- * Requires:
- *\li 'view' is valid.
- */
-
-isc_result_t
-dns_view_freezezones(dns_view_t *view, isc_boolean_t freeze);
-/*%<
- * Freeze/thaw updates to master zones.
- *
- * Requires:
- * \li 'view' is valid.
- */
-
-void
-dns_view_setresstats(dns_view_t *view, isc_stats_t *stats);
-/*%<
- * Set a general resolver statistics counter set 'stats' for 'view'.
- *
- * Requires:
- * \li 'view' is valid and is not frozen.
- *
- *\li stats is a valid statistics supporting resolver statistics counters
- * (see dns/stats.h).
- */
-
-void
-dns_view_getresstats(dns_view_t *view, isc_stats_t **statsp);
-/*%<
- * Get the general statistics counter set for 'view'. If a statistics set is
- * set '*statsp' will be attached to the set; otherwise, '*statsp' will be
- * untouched.
- *
- * Requires:
- * \li 'view' is valid and is not frozen.
- *
- *\li 'statsp' != NULL && '*statsp' != NULL
- */
-
-void
-dns_view_setresquerystats(dns_view_t *view, dns_stats_t *stats);
-/*%<
- * Set a statistics counter set of rdata type, 'stats', for 'view'. Once the
- * statistic set is installed, view's resolver will count outgoing queries
- * per rdata type.
- *
- * Requires:
- * \li 'view' is valid and is not frozen.
- *
- *\li stats is a valid statistics created by dns_rdatatypestats_create().
- */
-
-void
-dns_view_getresquerystats(dns_view_t *view, dns_stats_t **statsp);
-/*%<
- * Get the rdatatype statistics counter set for 'view'. If a statistics set is
- * set '*statsp' will be attached to the set; otherwise, '*statsp' will be
- * untouched.
- *
- * Requires:
- * \li 'view' is valid and is not frozen.
- *
- *\li 'statsp' != NULL && '*statsp' != NULL
- */
-
-#endif /* DNS_VIEW_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001, 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: xfrin.h,v 1.28.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef DNS_XFRIN_H
-#define DNS_XFRIN_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file dns/xfrin.h
- * \brief
- * Incoming zone transfers (AXFR + IXFR).
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-/***
- *** Types
- ***/
-
-/*%
- * A transfer in progress. This is an opaque type.
- */
-typedef struct dns_xfrin_ctx dns_xfrin_ctx_t;
-
-/***
- *** Functions
- ***/
-
-ISC_LANG_BEGINDECLS
-
-/*% see dns_xfrin_create2() */
-isc_result_t
-dns_xfrin_create(dns_zone_t *zone, dns_rdatatype_t xfrtype,
- isc_sockaddr_t *masteraddr, dns_tsigkey_t *tsigkey,
- isc_mem_t *mctx, isc_timermgr_t *timermgr,
- isc_socketmgr_t *socketmgr, isc_task_t *task,
- dns_xfrindone_t done, dns_xfrin_ctx_t **xfrp);
-
-isc_result_t
-dns_xfrin_create2(dns_zone_t *zone, dns_rdatatype_t xfrtype,
- isc_sockaddr_t *masteraddr, isc_sockaddr_t *sourceaddr,
- dns_tsigkey_t *tsigkey, isc_mem_t *mctx,
- isc_timermgr_t *timermgr, isc_socketmgr_t *socketmgr,
- isc_task_t *task, dns_xfrindone_t done,
- dns_xfrin_ctx_t **xfrp);
-/*%<
- * Attempt to start an incoming zone transfer of 'zone'
- * from 'masteraddr', creating a dns_xfrin_ctx_t object to
- * manage it. Attach '*xfrp' to the newly created object.
- *
- * Iff ISC_R_SUCCESS is returned, '*done' is guaranteed to be
- * called in the context of 'task', with 'zone' and a result
- * code as arguments when the transfer finishes.
- *
- * Requires:
- *\li 'xfrtype' is dns_rdatatype_axfr, dns_rdatatype_ixfr
- * or dns_rdatatype_soa (soa query followed by axfr if
- * serial is greater than current serial).
- *
- *\li If 'xfrtype' is dns_rdatatype_ixfr or dns_rdatatype_soa,
- * the zone has a database.
- */
-
-void
-dns_xfrin_shutdown(dns_xfrin_ctx_t *xfr);
-/*%<
- * If the zone transfer 'xfr' has already finished,
- * do nothing. Otherwise, abort it and cause it to call
- * its done callback with a status of ISC_R_CANCELED.
- */
-
-void
-dns_xfrin_detach(dns_xfrin_ctx_t **xfrp);
-/*%<
- * Detach a reference to a zone transfer object.
- * Caller to maintain external locking if required.
- */
-
-void
-dns_xfrin_attach(dns_xfrin_ctx_t *source, dns_xfrin_ctx_t **target);
-/*%<
- * Caller to maintain external locking if required.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_XFRIN_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: zone.h,v 1.160.50.4 2009/01/29 22:40:35 jinmei Exp $ */
-
-#ifndef DNS_ZONE_H
-#define DNS_ZONE_H 1
-
-/*! \file dns/zone.h */
-
-/***
- *** Imports
- ***/
-
-#include <stdio.h>
-
-#include <isc/formatcheck.h>
-#include <isc/lang.h>
-#include <isc/rwlock.h>
-
-#include <dns/masterdump.h>
-#include <dns/rdatastruct.h>
-#include <dns/types.h>
-
-typedef enum {
- dns_zone_none,
- dns_zone_master,
- dns_zone_slave,
- dns_zone_stub
-} dns_zonetype_t;
-
-#define DNS_ZONEOPT_SERVERS 0x00000001U /*%< perform server checks */
-#define DNS_ZONEOPT_PARENTS 0x00000002U /*%< perform parent checks */
-#define DNS_ZONEOPT_CHILDREN 0x00000004U /*%< perform child checks */
-#define DNS_ZONEOPT_NOTIFY 0x00000008U /*%< perform NOTIFY */
-#define DNS_ZONEOPT_MANYERRORS 0x00000010U /*%< return many errors on load */
-#define DNS_ZONEOPT_IXFRFROMDIFFS 0x00000020U /*%< calculate differences */
-#define DNS_ZONEOPT_NOMERGE 0x00000040U /*%< don't merge journal */
-#define DNS_ZONEOPT_CHECKNS 0x00000080U /*%< check if NS's are addresses */
-#define DNS_ZONEOPT_FATALNS 0x00000100U /*%< DNS_ZONEOPT_CHECKNS is fatal */
-#define DNS_ZONEOPT_MULTIMASTER 0x00000200U /*%< this zone has multiple masters */
-#define DNS_ZONEOPT_USEALTXFRSRC 0x00000400U /*%< use alternate transfer sources */
-#define DNS_ZONEOPT_CHECKNAMES 0x00000800U /*%< check-names */
-#define DNS_ZONEOPT_CHECKNAMESFAIL 0x00001000U /*%< fatal check-name failures */
-#define DNS_ZONEOPT_CHECKWILDCARD 0x00002000U /*%< check for internal wildcards */
-#define DNS_ZONEOPT_CHECKMX 0x00004000U /*%< check-mx */
-#define DNS_ZONEOPT_CHECKMXFAIL 0x00008000U /*%< fatal check-mx failures */
-#define DNS_ZONEOPT_CHECKINTEGRITY 0x00010000U /*%< perform integrity checks */
-#define DNS_ZONEOPT_CHECKSIBLING 0x00020000U /*%< perform sibling glue checks */
-#define DNS_ZONEOPT_NOCHECKNS 0x00040000U /*%< disable IN NS address checks */
-#define DNS_ZONEOPT_WARNMXCNAME 0x00080000U /*%< warn on MX CNAME check */
-#define DNS_ZONEOPT_IGNOREMXCNAME 0x00100000U /*%< ignore MX CNAME check */
-#define DNS_ZONEOPT_WARNSRVCNAME 0x00200000U /*%< warn on SRV CNAME check */
-#define DNS_ZONEOPT_IGNORESRVCNAME 0x00400000U /*%< ignore SRV CNAME check */
-#define DNS_ZONEOPT_UPDATECHECKKSK 0x00800000U /*%< check dnskey KSK flag */
-#define DNS_ZONEOPT_TRYTCPREFRESH 0x01000000U /*%< try tcp refresh on udp failure */
-#define DNS_ZONEOPT_NOTIFYTOSOA 0x02000000U /*%< Notify the SOA MNAME */
-#define DNS_ZONEOPT_NSEC3TESTZONE 0x04000000U /*%< nsec3-test-zone */
-
-#ifndef NOMINUM_PUBLIC
-/*
- * Nominum specific options build down.
- */
-#define DNS_ZONEOPT_NOTIFYFORWARD 0x80000000U /* forward notify to master */
-#endif /* NOMINUM_PUBLIC */
-
-#ifndef DNS_ZONE_MINREFRESH
-#define DNS_ZONE_MINREFRESH 300 /*%< 5 minutes */
-#endif
-#ifndef DNS_ZONE_MAXREFRESH
-#define DNS_ZONE_MAXREFRESH 2419200 /*%< 4 weeks */
-#endif
-#ifndef DNS_ZONE_DEFAULTREFRESH
-#define DNS_ZONE_DEFAULTREFRESH 3600 /*%< 1 hour */
-#endif
-#ifndef DNS_ZONE_MINRETRY
-#define DNS_ZONE_MINRETRY 300 /*%< 5 minutes */
-#endif
-#ifndef DNS_ZONE_MAXRETRY
-#define DNS_ZONE_MAXRETRY 1209600 /*%< 2 weeks */
-#endif
-#ifndef DNS_ZONE_DEFAULTRETRY
-#define DNS_ZONE_DEFAULTRETRY 60 /*%< 1 minute, subject to
- exponential backoff */
-#endif
-
-#define DNS_ZONESTATE_XFERRUNNING 1
-#define DNS_ZONESTATE_XFERDEFERRED 2
-#define DNS_ZONESTATE_SOAQUERY 3
-#define DNS_ZONESTATE_ANY 4
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Functions
- ***/
-
-isc_result_t
-dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx);
-/*%<
- * Creates a new empty zone and attach '*zonep' to it.
- *
- * Requires:
- *\li 'zonep' to point to a NULL pointer.
- *\li 'mctx' to be a valid memory context.
- *
- * Ensures:
- *\li '*zonep' refers to a valid zone.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_UNEXPECTED
- */
-
-void
-dns_zone_setclass(dns_zone_t *zone, dns_rdataclass_t rdclass);
-/*%<
- * Sets the class of a zone. This operation can only be performed
- * once on a zone.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li dns_zone_setclass() not to have been called since the zone was
- * created.
- *\li 'rdclass' != dns_rdataclass_none.
- */
-
-dns_rdataclass_t
-dns_zone_getclass(dns_zone_t *zone);
-/*%<
- * Returns the current zone class.
- *
- * Requires:
- *\li 'zone' to be a valid zone.
- */
-
-isc_uint32_t
-dns_zone_getserial(dns_zone_t *zone);
-/*%<
- * Returns the current serial number of the zone.
- *
- * Requires:
- *\li 'zone' to be a valid zone.
- */
-
-void
-dns_zone_settype(dns_zone_t *zone, dns_zonetype_t type);
-/*%<
- * Sets the zone type. This operation can only be performed once on
- * a zone.
- *
- * Requires:
- *\li 'zone' to be a valid zone.
- *\li dns_zone_settype() not to have been called since the zone was
- * created.
- *\li 'type' != dns_zone_none
- */
-
-void
-dns_zone_setview(dns_zone_t *zone, dns_view_t *view);
-/*%<
- * Associate the zone with a view.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- */
-
-dns_view_t *
-dns_zone_getview(dns_zone_t *zone);
-/*%<
- * Returns the zone's associated view.
- *
- * Requires:
- *\li 'zone' to be a valid zone.
- */
-
-isc_result_t
-dns_zone_setorigin(dns_zone_t *zone, const dns_name_t *origin);
-/*%<
- * Sets the zones origin to 'origin'.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li 'origin' to be non NULL.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- */
-
-dns_name_t *
-dns_zone_getorigin(dns_zone_t *zone);
-/*%<
- * Returns the value of the origin.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- */
-
-isc_result_t
-dns_zone_setfile(dns_zone_t *zone, const char *file);
-
-isc_result_t
-dns_zone_setfile2(dns_zone_t *zone, const char *file,
- dns_masterformat_t format);
-/*%<
- * Sets the name of the master file in the format of 'format' from which
- * the zone loads its database to 'file'.
- *
- * For zones that have no associated master file, 'file' will be NULL.
- *
- * For zones with persistent databases, the file name
- * setting is ignored.
- *
- * dns_zone_setfile() is a backward-compatible form of
- * dns_zone_setfile2(), which always specifies the
- * dns_masterformat_text (RFC1035) format.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *
- * Returns:
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_SUCCESS
- */
-
-const char *
-dns_zone_getfile(dns_zone_t *zone);
-/*%<
- * Gets the name of the zone's master file, if any.
- *
- * Requires:
- *\li 'zone' to be valid initialised zone.
- *
- * Returns:
- *\li Pointer to null-terminated file name, or NULL.
- */
-
-isc_result_t
-dns_zone_load(dns_zone_t *zone);
-
-isc_result_t
-dns_zone_loadnew(dns_zone_t *zone);
-/*%<
- * Cause the database to be loaded from its backing store.
- * Confirm that the minimum requirements for the zone type are
- * met, otherwise DNS_R_BADZONE is returned.
- *
- * dns_zone_loadnew() only loads zones that are not yet loaded.
- * dns_zone_load() also loads zones that are already loaded and
- * and whose master file has changed since the last load.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *
- * Returns:
- *\li #ISC_R_UNEXPECTED
- *\li #ISC_R_SUCCESS
- *\li DNS_R_CONTINUE Incremental load has been queued.
- *\li DNS_R_UPTODATE The zone has already been loaded based on
- * file system timestamps.
- *\li DNS_R_BADZONE
- *\li Any result value from dns_db_load().
- */
-
-void
-dns_zone_attach(dns_zone_t *source, dns_zone_t **target);
-/*%<
- * Attach '*target' to 'source' incrementing its external
- * reference count.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li 'target' to be non NULL and '*target' to be NULL.
- */
-
-void
-dns_zone_detach(dns_zone_t **zonep);
-/*%<
- * Detach from a zone decrementing its external reference count.
- * If this was the last external reference to the zone it will be
- * shut down and eventually freed.
- *
- * Require:
- *\li 'zonep' to point to a valid zone.
- */
-
-void
-dns_zone_iattach(dns_zone_t *source, dns_zone_t **target);
-/*%<
- * Attach '*target' to 'source' incrementing its internal
- * reference count. This is intended for use by operations
- * such as zone transfers that need to prevent the zone
- * object from being freed but not from shutting down.
- *
- * Require:
- *\li The caller is running in the context of the zone's task.
- *\li 'zone' to be a valid zone.
- *\li 'target' to be non NULL and '*target' to be NULL.
- */
-
-void
-dns_zone_idetach(dns_zone_t **zonep);
-/*%<
- * Detach from a zone decrementing its internal reference count.
- * If there are no more internal or external references to the
- * zone, it will be freed.
- *
- * Require:
- *\li The caller is running in the context of the zone's task.
- *\li 'zonep' to point to a valid zone.
- */
-
-void
-dns_zone_setflag(dns_zone_t *zone, unsigned int flags, isc_boolean_t value);
-/*%<
- * Sets ('value' == 'ISC_TRUE') / clears ('value' == 'IS_FALSE')
- * zone flags. Valid flag bits are DNS_ZONE_F_*.
- *
- * Requires
- *\li 'zone' to be a valid zone.
- */
-
-isc_result_t
-dns_zone_getdb(dns_zone_t *zone, dns_db_t **dbp);
-/*%<
- * Attach '*dbp' to the database to if it exists otherwise
- * return DNS_R_NOTLOADED.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li 'dbp' to be != NULL && '*dbp' == NULL.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li DNS_R_NOTLOADED
- */
-
-isc_result_t
-dns_zone_setdbtype(dns_zone_t *zone,
- unsigned int dbargc, const char * const *dbargv);
-/*%<
- * Sets the database type to dbargv[0] and database arguments
- * to subsequent dbargv elements.
- * 'db_type' is not checked to see if it is a valid database type.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li 'database' to be non NULL.
- *\li 'dbargc' to be >= 1
- *\li 'dbargv' to point to dbargc NULL-terminated strings
- *
- * Returns:
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_SUCCESS
- */
-
-isc_result_t
-dns_zone_getdbtype(dns_zone_t *zone, char ***argv, isc_mem_t *mctx);
-/*%<
- * Returns the current dbtype. isc_mem_free() should be used
- * to free 'argv' after use.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li 'argv' to be non NULL and *argv to be NULL.
- *\li 'mctx' to be valid.
- *
- * Returns:
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_SUCCESS
- */
-
-void
-dns_zone_markdirty(dns_zone_t *zone);
-/*%<
- * Mark a zone as 'dirty'.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- */
-
-void
-dns_zone_expire(dns_zone_t *zone);
-/*%<
- * Mark the zone as expired. If the zone requires dumping cause it to
- * be initiated. Set the refresh and retry intervals to there default
- * values and unload the zone.
- *
- * Require
- *\li 'zone' to be a valid zone.
- */
-
-void
-dns_zone_refresh(dns_zone_t *zone);
-/*%<
- * Initiate zone up to date checks. The zone must already be being
- * managed.
- *
- * Require
- *\li 'zone' to be a valid zone.
- */
-
-isc_result_t
-dns_zone_flush(dns_zone_t *zone);
-/*%<
- * Write the zone to database if there are uncommitted changes.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- */
-
-isc_result_t
-dns_zone_dump(dns_zone_t *zone);
-/*%<
- * Write the zone to database.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- */
-
-isc_result_t
-dns_zone_dumptostream(dns_zone_t *zone, FILE *fd);
-
-isc_result_t
-dns_zone_dumptostream2(dns_zone_t *zone, FILE *fd, dns_masterformat_t format,
- const dns_master_style_t *style);
-/*%<
- * Write the zone to stream 'fd' in the specified 'format'.
- * If the 'format' is dns_masterformat_text (RFC1035), 'style' also
- * specifies the file style (e.g., &dns_master_style_default).
- *
- * dns_zone_dumptostream() is a backward-compatible form of
- * dns_zone_dumptostream2(), which always uses the dns_masterformat_text
- * format and the dns_master_style_default style.
- *
- * Note that dns_zone_dumptostream2() is the most flexible form. It
- * can also provide the functionality of dns_zone_fulldumptostream().
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li 'fd' to be a stream open for writing.
- */
-
-isc_result_t
-dns_zone_fulldumptostream(dns_zone_t *zone, FILE *fd);
-/*%<
- * The same as dns_zone_dumptostream, but dumps the zone with
- * different dump settings (dns_master_style_full).
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li 'fd' to be a stream open for writing.
- */
-
-void
-dns_zone_maintenance(dns_zone_t *zone);
-/*%<
- * Perform regular maintenance on the zone. This is called as a
- * result of a zone being managed.
- *
- * Require
- *\li 'zone' to be a valid zone.
- */
-
-isc_result_t
-dns_zone_setmasters(dns_zone_t *zone, const isc_sockaddr_t *masters,
- isc_uint32_t count);
-isc_result_t
-dns_zone_setmasterswithkeys(dns_zone_t *zone,
- const isc_sockaddr_t *masters,
- dns_name_t **keynames,
- isc_uint32_t count);
-/*%<
- * Set the list of master servers for the zone.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li 'masters' array of isc_sockaddr_t with port set or NULL.
- *\li 'count' the number of masters.
- *\li 'keynames' array of dns_name_t's for tsig keys or NULL.
- *
- * \li dns_zone_setmasters() is just a wrapper to setmasterswithkeys(),
- * passing NULL in the keynames field.
- *
- * \li If 'masters' is NULL then 'count' must be zero.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li Any result dns_name_dup() can return, if keynames!=NULL
- */
-
-isc_result_t
-dns_zone_setalsonotify(dns_zone_t *zone, const isc_sockaddr_t *notify,
- isc_uint32_t count);
-/*%<
- * Set the list of additional servers to be notified when
- * a zone changes. To clear the list use 'count = 0'.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li 'notify' to be non-NULL if count != 0.
- *\li 'count' to be the number of notifiees.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- */
-
-void
-dns_zone_unload(dns_zone_t *zone);
-/*%<
- * detach the database from the zone structure.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- */
-
-void
-dns_zone_setoption(dns_zone_t *zone, unsigned int option, isc_boolean_t value);
-/*%<
- * Set given options on ('value' == ISC_TRUE) or off ('value' ==
- * #ISC_FALSE).
- *
- * Require:
- *\li 'zone' to be a valid zone.
- */
-
-unsigned int
-dns_zone_getoptions(dns_zone_t *zone);
-/*%<
- * Returns the current zone options.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- */
-
-void
-dns_zone_setminrefreshtime(dns_zone_t *zone, isc_uint32_t val);
-/*%<
- * Set the minimum refresh time.
- *
- * Requires:
- *\li 'zone' is valid.
- *\li val > 0.
- */
-
-void
-dns_zone_setmaxrefreshtime(dns_zone_t *zone, isc_uint32_t val);
-/*%<
- * Set the maximum refresh time.
- *
- * Requires:
- *\li 'zone' is valid.
- *\li val > 0.
- */
-
-void
-dns_zone_setminretrytime(dns_zone_t *zone, isc_uint32_t val);
-/*%<
- * Set the minimum retry time.
- *
- * Requires:
- *\li 'zone' is valid.
- *\li val > 0.
- */
-
-void
-dns_zone_setmaxretrytime(dns_zone_t *zone, isc_uint32_t val);
-/*%<
- * Set the maximum retry time.
- *
- * Requires:
- *\li 'zone' is valid.
- * val > 0.
- */
-
-isc_result_t
-dns_zone_setxfrsource4(dns_zone_t *zone, const isc_sockaddr_t *xfrsource);
-isc_result_t
-dns_zone_setaltxfrsource4(dns_zone_t *zone,
- const isc_sockaddr_t *xfrsource);
-/*%<
- * Set the source address to be used in IPv4 zone transfers.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li 'xfrsource' to contain the address.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- */
-
-isc_sockaddr_t *
-dns_zone_getxfrsource4(dns_zone_t *zone);
-isc_sockaddr_t *
-dns_zone_getaltxfrsource4(dns_zone_t *zone);
-/*%<
- * Returns the source address set by a previous dns_zone_setxfrsource4
- * call, or the default of inaddr_any, port 0.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- */
-
-isc_result_t
-dns_zone_setxfrsource6(dns_zone_t *zone, const isc_sockaddr_t *xfrsource);
-isc_result_t
-dns_zone_setaltxfrsource6(dns_zone_t *zone,
- const isc_sockaddr_t *xfrsource);
-/*%<
- * Set the source address to be used in IPv6 zone transfers.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li 'xfrsource' to contain the address.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- */
-
-isc_sockaddr_t *
-dns_zone_getxfrsource6(dns_zone_t *zone);
-isc_sockaddr_t *
-dns_zone_getaltxfrsource6(dns_zone_t *zone);
-/*%<
- * Returns the source address set by a previous dns_zone_setxfrsource6
- * call, or the default of in6addr_any, port 0.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- */
-
-isc_result_t
-dns_zone_setnotifysrc4(dns_zone_t *zone, const isc_sockaddr_t *notifysrc);
-/*%<
- * Set the source address to be used with IPv4 NOTIFY messages.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li 'notifysrc' to contain the address.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- */
-
-isc_sockaddr_t *
-dns_zone_getnotifysrc4(dns_zone_t *zone);
-/*%<
- * Returns the source address set by a previous dns_zone_setnotifysrc4
- * call, or the default of inaddr_any, port 0.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- */
-
-isc_result_t
-dns_zone_setnotifysrc6(dns_zone_t *zone, const isc_sockaddr_t *notifysrc);
-/*%<
- * Set the source address to be used with IPv6 NOTIFY messages.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li 'notifysrc' to contain the address.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- */
-
-isc_sockaddr_t *
-dns_zone_getnotifysrc6(dns_zone_t *zone);
-/*%<
- * Returns the source address set by a previous dns_zone_setnotifysrc6
- * call, or the default of in6addr_any, port 0.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- */
-
-void
-dns_zone_setnotifyacl(dns_zone_t *zone, dns_acl_t *acl);
-/*%<
- * Sets the notify acl list for the zone.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li 'acl' to be a valid acl.
- */
-
-void
-dns_zone_setqueryacl(dns_zone_t *zone, dns_acl_t *acl);
-/*%<
- * Sets the query acl list for the zone.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li 'acl' to be a valid acl.
- */
-
-void
-dns_zone_setqueryonacl(dns_zone_t *zone, dns_acl_t *acl);
-/*%<
- * Sets the query-on acl list for the zone.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li 'acl' to be a valid acl.
- */
-
-void
-dns_zone_setupdateacl(dns_zone_t *zone, dns_acl_t *acl);
-/*%<
- * Sets the update acl list for the zone.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li 'acl' to be valid acl.
- */
-
-void
-dns_zone_setforwardacl(dns_zone_t *zone, dns_acl_t *acl);
-/*%<
- * Sets the forward unsigned updates acl list for the zone.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li 'acl' to be valid acl.
- */
-
-void
-dns_zone_setxfracl(dns_zone_t *zone, dns_acl_t *acl);
-/*%<
- * Sets the transfer acl list for the zone.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li 'acl' to be valid acl.
- */
-
-dns_acl_t *
-dns_zone_getnotifyacl(dns_zone_t *zone);
-/*%<
- * Returns the current notify acl or NULL.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *
- * Returns:
- *\li acl a pointer to the acl.
- *\li NULL
- */
-
-dns_acl_t *
-dns_zone_getqueryacl(dns_zone_t *zone);
-/*%<
- * Returns the current query acl or NULL.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *
- * Returns:
- *\li acl a pointer to the acl.
- *\li NULL
- */
-
-dns_acl_t *
-dns_zone_getqueryonacl(dns_zone_t *zone);
-/*%<
- * Returns the current query-on acl or NULL.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *
- * Returns:
- *\li acl a pointer to the acl.
- *\li NULL
- */
-
-dns_acl_t *
-dns_zone_getupdateacl(dns_zone_t *zone);
-/*%<
- * Returns the current update acl or NULL.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *
- * Returns:
- *\li acl a pointer to the acl.
- *\li NULL
- */
-
-dns_acl_t *
-dns_zone_getforwardacl(dns_zone_t *zone);
-/*%<
- * Returns the current forward unsigned updates acl or NULL.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *
- * Returns:
- *\li acl a pointer to the acl.
- *\li NULL
- */
-
-dns_acl_t *
-dns_zone_getxfracl(dns_zone_t *zone);
-/*%<
- * Returns the current transfer acl or NULL.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *
- * Returns:
- *\li acl a pointer to the acl.
- *\li NULL
- */
-
-void
-dns_zone_clearupdateacl(dns_zone_t *zone);
-/*%<
- * Clear the current update acl.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- */
-
-void
-dns_zone_clearforwardacl(dns_zone_t *zone);
-/*%<
- * Clear the current forward unsigned updates acl.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- */
-
-void
-dns_zone_clearnotifyacl(dns_zone_t *zone);
-/*%<
- * Clear the current notify acl.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- */
-
-void
-dns_zone_clearqueryacl(dns_zone_t *zone);
-/*%<
- * Clear the current query acl.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- */
-
-void
-dns_zone_clearqueryonacl(dns_zone_t *zone);
-/*%<
- * Clear the current query-on acl.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- */
-
-void
-dns_zone_clearxfracl(dns_zone_t *zone);
-/*%<
- * Clear the current transfer acl.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- */
-
-isc_boolean_t
-dns_zone_getupdatedisabled(dns_zone_t *zone);
-/*%<
- * Return update disabled.
- * Transient unless called when running in isc_task_exclusive() mode.
- */
-
-void
-dns_zone_setupdatedisabled(dns_zone_t *zone, isc_boolean_t state);
-/*%<
- * Set update disabled.
- * Should only be called only when running in isc_task_exclusive() mode.
- * Failure to do so may result in updates being committed after the
- * call has been made.
- */
-
-isc_boolean_t
-dns_zone_getzeronosoattl(dns_zone_t *zone);
-/*%<
- * Return zero-no-soa-ttl status.
- */
-
-void
-dns_zone_setzeronosoattl(dns_zone_t *zone, isc_boolean_t state);
-/*%<
- * Set zero-no-soa-ttl status.
- */
-
-void
-dns_zone_setchecknames(dns_zone_t *zone, dns_severity_t severity);
-/*%<
- * Set the severity of name checking when loading a zone.
- *
- * Require:
- * \li 'zone' to be a valid zone.
- */
-
-dns_severity_t
-dns_zone_getchecknames(dns_zone_t *zone);
-/*%<
- * Return the current severity of name checking.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- */
-
-void
-dns_zone_setjournalsize(dns_zone_t *zone, isc_int32_t size);
-/*%<
- * Sets the journal size for the zone.
- *
- * Requires:
- *\li 'zone' to be a valid zone.
- */
-
-isc_int32_t
-dns_zone_getjournalsize(dns_zone_t *zone);
-/*%<
- * Return the journal size as set with a previous call to
- * dns_zone_setjournalsize().
- *
- * Requires:
- *\li 'zone' to be a valid zone.
- */
-
-isc_result_t
-dns_zone_notifyreceive(dns_zone_t *zone, isc_sockaddr_t *from,
- dns_message_t *msg);
-/*%<
- * Tell the zone that it has received a NOTIFY message from another
- * server. This may cause some zone maintenance activity to occur.
- *
- * Requires:
- *\li 'zone' to be a valid zone.
- *\li '*from' to contain the address of the server from which 'msg'
- * was received.
- *\li 'msg' a message with opcode NOTIFY and qr clear.
- *
- * Returns:
- *\li DNS_R_REFUSED
- *\li DNS_R_NOTIMP
- *\li DNS_R_FORMERR
- *\li DNS_R_SUCCESS
- */
-
-void
-dns_zone_setmaxxfrin(dns_zone_t *zone, isc_uint32_t maxxfrin);
-/*%<
- * Set the maximum time (in seconds) that a zone transfer in (AXFR/IXFR)
- * of this zone will use before being aborted.
- *
- * Requires:
- * \li 'zone' to be valid initialised zone.
- */
-
-isc_uint32_t
-dns_zone_getmaxxfrin(dns_zone_t *zone);
-/*%<
- * Returns the maximum transfer time for this zone. This will be
- * either the value set by the last call to dns_zone_setmaxxfrin() or
- * the default value of 1 hour.
- *
- * Requires:
- *\li 'zone' to be valid initialised zone.
- */
-
-void
-dns_zone_setmaxxfrout(dns_zone_t *zone, isc_uint32_t maxxfrout);
-/*%<
- * Set the maximum time (in seconds) that a zone transfer out (AXFR/IXFR)
- * of this zone will use before being aborted.
- *
- * Requires:
- * \li 'zone' to be valid initialised zone.
- */
-
-isc_uint32_t
-dns_zone_getmaxxfrout(dns_zone_t *zone);
-/*%<
- * Returns the maximum transfer time for this zone. This will be
- * either the value set by the last call to dns_zone_setmaxxfrout() or
- * the default value of 1 hour.
- *
- * Requires:
- *\li 'zone' to be valid initialised zone.
- */
-
-isc_result_t
-dns_zone_setjournal(dns_zone_t *zone, const char *journal);
-/*%<
- * Sets the filename used for journaling updates / IXFR transfers.
- * The default journal name is set by dns_zone_setfile() to be
- * "file.jnl". If 'journal' is NULL, the zone will have no
- * journal name.
- *
- * Requires:
- *\li 'zone' to be a valid zone.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- */
-
-char *
-dns_zone_getjournal(dns_zone_t *zone);
-/*%<
- * Returns the journal name associated with this zone.
- * If no journal has been set this will be NULL.
- *
- * Requires:
- *\li 'zone' to be valid initialised zone.
- */
-
-dns_zonetype_t
-dns_zone_gettype(dns_zone_t *zone);
-/*%<
- * Returns the type of the zone (master/slave/etc.)
- *
- * Requires:
- *\li 'zone' to be valid initialised zone.
- */
-
-void
-dns_zone_settask(dns_zone_t *zone, isc_task_t *task);
-/*%<
- * Give a zone a task to work with. Any current task will be detached.
- *
- * Requires:
- *\li 'zone' to be valid.
- *\li 'task' to be valid.
- */
-
-void
-dns_zone_gettask(dns_zone_t *zone, isc_task_t **target);
-/*%<
- * Attach '*target' to the zone's task.
- *
- * Requires:
- *\li 'zone' to be valid initialised zone.
- *\li 'zone' to have a task.
- *\li 'target' to be != NULL && '*target' == NULL.
- */
-
-void
-dns_zone_notify(dns_zone_t *zone);
-/*%<
- * Generate notify events for this zone.
- *
- * Requires:
- *\li 'zone' to be a valid zone.
- */
-
-isc_result_t
-dns_zone_replacedb(dns_zone_t *zone, dns_db_t *db, isc_boolean_t dump);
-/*%<
- * Replace the database of "zone" with a new database "db".
- *
- * If "dump" is ISC_TRUE, then the new zone contents are dumped
- * into to the zone's master file for persistence. When replacing
- * a zone database by one just loaded from a master file, set
- * "dump" to ISC_FALSE to avoid a redundant redump of the data just
- * loaded. Otherwise, it should be set to ISC_TRUE.
- *
- * If the "diff-on-reload" option is enabled in the configuration file,
- * the differences between the old and the new database are added to the
- * journal file, and the master file dump is postponed.
- *
- * Requires:
- * \li 'zone' to be a valid zone.
- *
- * Returns:
- * \li DNS_R_SUCCESS
- * \li DNS_R_BADZONE zone failed basic consistency checks:
- * * a single SOA must exist
- * * some NS records must exist.
- * Others
- */
-
-isc_uint32_t
-dns_zone_getidlein(dns_zone_t *zone);
-/*%<
- * Requires:
- * \li 'zone' to be a valid zone.
- *
- * Returns:
- * \li number of seconds of idle time before we abort the transfer in.
- */
-
-void
-dns_zone_setidlein(dns_zone_t *zone, isc_uint32_t idlein);
-/*%<
- * \li Set the idle timeout for transfer the.
- * \li Zero set the default value, 1 hour.
- *
- * Requires:
- * \li 'zone' to be a valid zone.
- */
-
-isc_uint32_t
-dns_zone_getidleout(dns_zone_t *zone);
-/*%<
- *
- * Requires:
- * \li 'zone' to be a valid zone.
- *
- * Returns:
- * \li number of seconds of idle time before we abort a transfer out.
- */
-
-void
-dns_zone_setidleout(dns_zone_t *zone, isc_uint32_t idleout);
-/*%<
- * \li Set the idle timeout for transfers out.
- * \li Zero set the default value, 1 hour.
- *
- * Requires:
- * \li 'zone' to be a valid zone.
- */
-
-void
-dns_zone_getssutable(dns_zone_t *zone, dns_ssutable_t **table);
-/*%<
- * Get the simple-secure-update policy table.
- *
- * Requires:
- * \li 'zone' to be a valid zone.
- */
-
-void
-dns_zone_setssutable(dns_zone_t *zone, dns_ssutable_t *table);
-/*%<
- * Set / clear the simple-secure-update policy table.
- *
- * Requires:
- * \li 'zone' to be a valid zone.
- */
-
-isc_mem_t *
-dns_zone_getmctx(dns_zone_t *zone);
-/*%<
- * Get the memory context of a zone.
- *
- * Requires:
- * \li 'zone' to be a valid zone.
- */
-
-dns_zonemgr_t *
-dns_zone_getmgr(dns_zone_t *zone);
-/*%<
- * If 'zone' is managed return the zone manager otherwise NULL.
- *
- * Requires:
- * \li 'zone' to be a valid zone.
- */
-
-void
-dns_zone_setsigvalidityinterval(dns_zone_t *zone, isc_uint32_t interval);
-/*%<
- * Set the zone's RRSIG validity interval. This is the length of time
- * for which DNSSEC signatures created as a result of dynamic updates
- * to secure zones will remain valid, in seconds.
- *
- * Requires:
- * \li 'zone' to be a valid zone.
- */
-
-isc_uint32_t
-dns_zone_getsigvalidityinterval(dns_zone_t *zone);
-/*%<
- * Get the zone's RRSIG validity interval.
- *
- * Requires:
- * \li 'zone' to be a valid zone.
- */
-
-void
-dns_zone_setsigresigninginterval(dns_zone_t *zone, isc_uint32_t interval);
-/*%<
- * Set the zone's RRSIG re-signing interval. A dynamic zone's RRSIG's
- * will be re-signed 'interval' amount of time before they expire.
- *
- * Requires:
- * \li 'zone' to be a valid zone.
- */
-
-isc_uint32_t
-dns_zone_getsigresigninginterval(dns_zone_t *zone);
-/*%<
- * Get the zone's RRSIG re-signing interval.
- *
- * Requires:
- * \li 'zone' to be a valid zone.
- */
-
-void
-dns_zone_setnotifytype(dns_zone_t *zone, dns_notifytype_t notifytype);
-/*%<
- * Sets zone notify method to "notifytype"
- */
-
-isc_result_t
-dns_zone_forwardupdate(dns_zone_t *zone, dns_message_t *msg,
- dns_updatecallback_t callback, void *callback_arg);
-/*%<
- * Forward 'msg' to each master in turn until we get an answer or we
- * have exhausted the list of masters. 'callback' will be called with
- * ISC_R_SUCCESS if we get an answer and the returned message will be
- * passed as 'answer_message', otherwise a non ISC_R_SUCCESS result code
- * will be passed and answer_message will be NULL. The callback function
- * is responsible for destroying 'answer_message'.
- * (callback)(callback_arg, result, answer_message);
- *
- * Require:
- *\li 'zone' to be valid
- *\li 'msg' to be valid.
- *\li 'callback' to be non NULL.
- * Returns:
- *\li #ISC_R_SUCCESS if the message has been forwarded,
- *\li #ISC_R_NOMEMORY
- *\li Others
- */
-
-isc_result_t
-dns_zone_next(dns_zone_t *zone, dns_zone_t **next);
-/*%<
- * Find the next zone in the list of managed zones.
- *
- * Requires:
- *\li 'zone' to be valid
- *\li The zone manager for the indicated zone MUST be locked
- * by the caller. This is not checked.
- *\li 'next' be non-NULL, and '*next' be NULL.
- *
- * Ensures:
- *\li 'next' points to a valid zone (result ISC_R_SUCCESS) or to NULL
- * (result ISC_R_NOMORE).
- */
-
-
-
-isc_result_t
-dns_zone_first(dns_zonemgr_t *zmgr, dns_zone_t **first);
-/*%<
- * Find the first zone in the list of managed zones.
- *
- * Requires:
- *\li 'zonemgr' to be valid
- *\li The zone manager for the indicated zone MUST be locked
- * by the caller. This is not checked.
- *\li 'first' be non-NULL, and '*first' be NULL
- *
- * Ensures:
- *\li 'first' points to a valid zone (result ISC_R_SUCCESS) or to NULL
- * (result ISC_R_NOMORE).
- */
-
-isc_result_t
-dns_zone_setkeydirectory(dns_zone_t *zone, const char *directory);
-/*%<
- * Sets the name of the directory where private keys used for
- * online signing of dynamic zones are found.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *
- * Returns:
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_SUCCESS
- */
-
-const char *
-dns_zone_getkeydirectory(dns_zone_t *zone);
-/*%<
- * Gets the name of the directory where private keys used for
- * online signing of dynamic zones are found.
- *
- * Requires:
- *\li 'zone' to be valid initialised zone.
- *
- * Returns:
- * Pointer to null-terminated file name, or NULL.
- */
-
-
-isc_result_t
-dns_zonemgr_create(isc_mem_t *mctx, isc_taskmgr_t *taskmgr,
- isc_timermgr_t *timermgr, isc_socketmgr_t *socketmgr,
- dns_zonemgr_t **zmgrp);
-/*%<
- * Create a zone manager.
- *
- * Requires:
- *\li 'mctx' to be a valid memory context.
- *\li 'taskmgr' to be a valid task manager.
- *\li 'timermgr' to be a valid timer manager.
- *\li 'zmgrp' to point to a NULL pointer.
- */
-
-isc_result_t
-dns_zonemgr_managezone(dns_zonemgr_t *zmgr, dns_zone_t *zone);
-/*%<
- * Bring the zone under control of a zone manager.
- *
- * Require:
- *\li 'zmgr' to be a valid zone manager.
- *\li 'zone' to be a valid zone.
- */
-
-isc_result_t
-dns_zonemgr_forcemaint(dns_zonemgr_t *zmgr);
-/*%<
- * Force zone maintenance of all zones managed by 'zmgr' at its
- * earliest convenience.
- */
-
-void
-dns_zonemgr_resumexfrs(dns_zonemgr_t *zmgr);
-/*%<
- * Attempt to start any stalled zone transfers.
- */
-
-void
-dns_zonemgr_shutdown(dns_zonemgr_t *zmgr);
-/*%<
- * Shut down the zone manager.
- *
- * Requires:
- *\li 'zmgr' to be a valid zone manager.
- */
-
-void
-dns_zonemgr_attach(dns_zonemgr_t *source, dns_zonemgr_t **target);
-/*%<
- * Attach '*target' to 'source' incrementing its external
- * reference count.
- *
- * Require:
- *\li 'zone' to be a valid zone.
- *\li 'target' to be non NULL and '*target' to be NULL.
- */
-
-void
-dns_zonemgr_detach(dns_zonemgr_t **zmgrp);
-/*%<
- * Detach from a zone manager.
- *
- * Requires:
- *\li '*zmgrp' is a valid, non-NULL zone manager pointer.
- *
- * Ensures:
- *\li '*zmgrp' is NULL.
- */
-
-void
-dns_zonemgr_releasezone(dns_zonemgr_t *zmgr, dns_zone_t *zone);
-/*%<
- * Release 'zone' from the managed by 'zmgr'. 'zmgr' is implicitly
- * detached from 'zone'.
- *
- * Requires:
- *\li 'zmgr' to be a valid zone manager.
- *\li 'zone' to be a valid zone.
- *\li 'zmgr' == 'zone->zmgr'
- *
- * Ensures:
- *\li 'zone->zmgr' == NULL;
- */
-
-void
-dns_zonemgr_settransfersin(dns_zonemgr_t *zmgr, isc_uint32_t value);
-/*%<
- * Set the maximum number of simultaneous transfers in allowed by
- * the zone manager.
- *
- * Requires:
- *\li 'zmgr' to be a valid zone manager.
- */
-
-isc_uint32_t
-dns_zonemgr_getttransfersin(dns_zonemgr_t *zmgr);
-/*%<
- * Return the maximum number of simultaneous transfers in allowed.
- *
- * Requires:
- *\li 'zmgr' to be a valid zone manager.
- */
-
-void
-dns_zonemgr_settransfersperns(dns_zonemgr_t *zmgr, isc_uint32_t value);
-/*%<
- * Set the number of zone transfers allowed per nameserver.
- *
- * Requires:
- *\li 'zmgr' to be a valid zone manager
- */
-
-isc_uint32_t
-dns_zonemgr_getttransfersperns(dns_zonemgr_t *zmgr);
-/*%<
- * Return the number of transfers allowed per nameserver.
- *
- * Requires:
- *\li 'zmgr' to be a valid zone manager.
- */
-
-void
-dns_zonemgr_setiolimit(dns_zonemgr_t *zmgr, isc_uint32_t iolimit);
-/*%<
- * Set the number of simultaneous file descriptors available for
- * reading and writing masterfiles.
- *
- * Requires:
- *\li 'zmgr' to be a valid zone manager.
- *\li 'iolimit' to be positive.
- */
-
-isc_uint32_t
-dns_zonemgr_getiolimit(dns_zonemgr_t *zmgr);
-/*%<
- * Get the number of simultaneous file descriptors available for
- * reading and writing masterfiles.
- *
- * Requires:
- *\li 'zmgr' to be a valid zone manager.
- */
-
-void
-dns_zonemgr_setserialqueryrate(dns_zonemgr_t *zmgr, unsigned int value);
-/*%<
- * Set the number of SOA queries sent per second.
- *
- * Requires:
- *\li 'zmgr' to be a valid zone manager
- */
-
-unsigned int
-dns_zonemgr_getserialqueryrate(dns_zonemgr_t *zmgr);
-/*%<
- * Return the number of SOA queries sent per second.
- *
- * Requires:
- *\li 'zmgr' to be a valid zone manager.
- */
-
-unsigned int
-dns_zonemgr_getcount(dns_zonemgr_t *zmgr, int state);
-/*%<
- * Returns the number of zones in the specified state.
- *
- * Requires:
- *\li 'zmgr' to be a valid zone manager.
- *\li 'state' to be a valid DNS_ZONESTATE_ constant.
- */
-
-void
-dns_zonemgr_unreachableadd(dns_zonemgr_t *zmgr, isc_sockaddr_t *remote,
- isc_sockaddr_t *local, isc_time_t *now);
-/*%<
- * Add the pair of addresses to the unreachable cache.
- *
- * Requires:
- *\li 'zmgr' to be a valid zone manager.
- *\li 'remote' to be a valid sockaddr.
- *\li 'local' to be a valid sockaddr.
- */
-
-void
-dns_zone_forcereload(dns_zone_t *zone);
-/*%<
- * Force a reload of specified zone.
- *
- * Requires:
- *\li 'zone' to be a valid zone.
- */
-
-isc_boolean_t
-dns_zone_isforced(dns_zone_t *zone);
-/*%<
- * Check if the zone is waiting a forced reload.
- *
- * Requires:
- * \li 'zone' to be a valid zone.
- */
-
-isc_result_t
-dns_zone_setstatistics(dns_zone_t *zone, isc_boolean_t on);
-/*%<
- * This function is obsoleted by dns_zone_setrequeststats().
- */
-
-isc_uint64_t *
-dns_zone_getstatscounters(dns_zone_t *zone);
-/*%<
- * This function is obsoleted by dns_zone_getrequeststats().
- */
-
-void
-dns_zone_setstats(dns_zone_t *zone, isc_stats_t *stats);
-/*%<
- * Set a general zone-maintenance statistics set 'stats' for 'zone'. This
- * function is expected to be called only on zone creation (when necessary).
- * Once installed, it cannot be removed or replaced. Also, there is no
- * interface to get the installed stats from the zone; the caller must keep the
- * stats to reference (e.g. dump) it later.
- *
- * Requires:
- * \li 'zone' to be a valid zone and does not have a statistics set already
- * installed.
- *
- *\li stats is a valid statistics supporting zone statistics counters
- * (see dns/stats.h).
- */
-
-void
-dns_zone_setrequeststats(dns_zone_t *zone, isc_stats_t *stats);
-/*%<
- * Set an additional statistics set to zone. It is attached in the zone
- * but is not counted in the zone module; only the caller updates the counters.
- *
- * Requires:
- * \li 'zone' to be a valid zone.
- *
- *\li stats is a valid statistics.
- */
-
-isc_stats_t *
-dns_zone_getrequeststats(dns_zone_t *zone);
-/*%<
- * Get the additional statistics for zone, if one is installed.
- *
- * Requires:
- * \li 'zone' to be a valid zone.
- *
- * Returns:
- * \li when available, a pointer to the statistics set installed in zone;
- * otherwise NULL.
- */
-
-void
-dns_zone_dialup(dns_zone_t *zone);
-/*%<
- * Perform dialup-time maintenance on 'zone'.
- */
-
-void
-dns_zone_setdialup(dns_zone_t *zone, dns_dialuptype_t dialup);
-/*%<
- * Set the dialup type of 'zone' to 'dialup'.
- *
- * Requires:
- * \li 'zone' to be valid initialised zone.
- *\li 'dialup' to be a valid dialup type.
- */
-
-void
-dns_zone_log(dns_zone_t *zone, int level, const char *msg, ...)
- ISC_FORMAT_PRINTF(3, 4);
-/*%<
- * Log the message 'msg...' at 'level', including text that identifies
- * the message as applying to 'zone'.
- */
-
-void
-dns_zone_logc(dns_zone_t *zone, isc_logcategory_t *category, int level,
- const char *msg, ...) ISC_FORMAT_PRINTF(4, 5);
-/*%<
- * Log the message 'msg...' at 'level', including text that identifies
- * the message as applying to 'zone'.
- */
-
-void
-dns_zone_name(dns_zone_t *zone, char *buf, size_t len);
-/*%<
- * Return the name of the zone with class and view.
- *
- * Requires:
- *\li 'zone' to be valid.
- *\li 'buf' to be non NULL.
- */
-
-isc_result_t
-dns_zone_checknames(dns_zone_t *zone, dns_name_t *name, dns_rdata_t *rdata);
-/*%<
- * Check if this record meets the check-names policy.
- *
- * Requires:
- * 'zone' to be valid.
- * 'name' to be valid.
- * 'rdata' to be valid.
- *
- * Returns:
- * DNS_R_SUCCESS passed checks.
- * DNS_R_BADOWNERNAME failed ownername checks.
- * DNS_R_BADNAME failed rdata checks.
- */
-
-void
-dns_zone_setacache(dns_zone_t *zone, dns_acache_t *acache);
-/*%<
- * Associate the zone with an additional cache.
- *
- * Require:
- * 'zone' to be a valid zone.
- * 'acache' to be a non NULL pointer.
- *
- * Ensures:
- * 'zone' will have a reference to 'acache'
- */
-
-void
-dns_zone_setcheckmx(dns_zone_t *zone, dns_checkmxfunc_t checkmx);
-/*%<
- * Set the post load integrity callback function 'checkmx'.
- * 'checkmx' will be called if the MX is not within the zone.
- *
- * Require:
- * 'zone' to be a valid zone.
- */
-
-void
-dns_zone_setchecksrv(dns_zone_t *zone, dns_checkmxfunc_t checksrv);
-/*%<
- * Set the post load integrity callback function 'checksrv'.
- * 'checksrv' will be called if the SRV TARGET is not within the zone.
- *
- * Require:
- * 'zone' to be a valid zone.
- */
-
-void
-dns_zone_setcheckns(dns_zone_t *zone, dns_checknsfunc_t checkns);
-/*%<
- * Set the post load integrity callback function 'checkmx'.
- * 'checkmx' will be called if the MX is not within the zone.
- *
- * Require:
- * 'zone' to be a valid zone.
- */
-
-void
-dns_zone_setnotifydelay(dns_zone_t *zone, isc_uint32_t delay);
-/*%<
- * Set the minimum delay between sets of notify messages.
- *
- * Requires:
- * 'zone' to be valid.
- */
-
-isc_uint32_t
-dns_zone_getnotifydelay(dns_zone_t *zone);
-/*%<
- * Get the minimum delay between sets of notify messages.
- *
- * Requires:
- * 'zone' to be valid.
- */
-
-void
-dns_zone_setisself(dns_zone_t *zone, dns_isselffunc_t isself, void *arg);
-/*%<
- * Set the isself callback function and argument.
- *
- * isc_boolean_t
- * isself(dns_view_t *myview, dns_tsigkey_t *mykey, isc_netaddr_t *srcaddr,
- * isc_netaddr_t *destaddr, dns_rdataclass_t rdclass, void *arg);
- *
- * 'isself' returns ISC_TRUE if a non-recursive query from 'srcaddr' to
- * 'destaddr' with optional key 'mykey' for class 'rdclass' would be
- * delivered to 'myview'.
- */
-
-void
-dns_zone_setnodes(dns_zone_t *zone, isc_uint32_t nodes);
-/*%<
- * Set the number of nodes that will be checked per quantum.
- */
-
-void
-dns_zone_setsignatures(dns_zone_t *zone, isc_uint32_t signatures);
-/*%<
- * Set the number of signatures that will be generated per quantum.
- */
-
-isc_result_t
-dns_zone_signwithkey(dns_zone_t *zone, dns_secalg_t algorithm,
- isc_uint16_t keyid, isc_boolean_t delete);
-/*%<
- * Initiate/resume signing of the entire zone with the zone DNSKEY(s)
- * that match the given algorithm and keyid.
- */
-
-isc_result_t
-dns_zone_addnsec3chain(dns_zone_t *zone, dns_rdata_nsec3param_t *nsec3param);
-/*%<
- * Incrementally add a NSEC3 chain that corresponds to 'nsec3param'.
- */
-
-void
-dns_zone_setprivatetype(dns_zone_t *zone, dns_rdatatype_t type);
-dns_rdatatype_t
-dns_zone_getprivatetype(dns_zone_t *zone);
-/*
- * Get/Set the private record type. It is expected that these interfaces
- * will not be permanent.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_ZONE_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: zonekey.h,v 1.10 2007/06/19 23:47:17 tbox Exp $ */
-
-#ifndef DNS_ZONEKEY_H
-#define DNS_ZONEKEY_H 1
-
-/*! \file dns/zonekey.h */
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-ISC_LANG_BEGINDECLS
-
-isc_boolean_t
-dns_zonekey_iszonekey(dns_rdata_t *keyrdata);
-/*%<
- * Determines if the key record contained in the rdata is a zone key.
- *
- * Requires:
- * 'keyrdata' is not NULL.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_ZONEKEY_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: zt.h,v 1.38 2007/06/19 23:47:17 tbox Exp $ */
-
-#ifndef DNS_ZT_H
-#define DNS_ZT_H 1
-
-/*! \file dns/zt.h */
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-#define DNS_ZTFIND_NOEXACT 0x01
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-dns_zt_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, dns_zt_t **zt);
-/*%<
- * Creates a new zone table.
- *
- * Requires:
- * \li 'mctx' to be initialized.
- *
- * Returns:
- * \li #ISC_R_SUCCESS on success.
- * \li #ISC_R_NOMEMORY
- */
-
-isc_result_t
-dns_zt_mount(dns_zt_t *zt, dns_zone_t *zone);
-/*%<
- * Mounts the zone on the zone table.
- *
- * Requires:
- * \li 'zt' to be valid
- * \li 'zone' to be valid
- *
- * Returns:
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_EXISTS
- * \li #ISC_R_NOSPACE
- * \li #ISC_R_NOMEMORY
- */
-
-isc_result_t
-dns_zt_unmount(dns_zt_t *zt, dns_zone_t *zone);
-/*%<
- * Unmount the given zone from the table.
- *
- * Requires:
- * 'zt' to be valid
- * \li 'zone' to be valid
- *
- * Returns:
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_NOTFOUND
- * \li #ISC_R_NOMEMORY
- */
-
-isc_result_t
-dns_zt_find(dns_zt_t *zt, dns_name_t *name, unsigned int options,
- dns_name_t *foundname, dns_zone_t **zone);
-/*%<
- * Find the best match for 'name' in 'zt'. If foundname is non NULL
- * then the name of the zone found is returned.
- *
- * Notes:
- * \li If the DNS_ZTFIND_NOEXACT is set, the best partial match (if any)
- * to 'name' will be returned.
- *
- * Requires:
- * \li 'zt' to be valid
- * \li 'name' to be valid
- * \li 'foundname' to be initialized and associated with a fixedname or NULL
- * \li 'zone' to be non NULL and '*zone' to be NULL
- *
- * Returns:
- * \li #ISC_R_SUCCESS
- * \li #DNS_R_PARTIALMATCH
- * \li #ISC_R_NOTFOUND
- * \li #ISC_R_NOSPACE
- */
-
-void
-dns_zt_detach(dns_zt_t **ztp);
-/*%<
- * Detach the given zonetable, if the reference count goes to zero the
- * zonetable will be freed. In either case 'ztp' is set to NULL.
- *
- * Requires:
- * \li '*ztp' to be valid
- */
-
-void
-dns_zt_flushanddetach(dns_zt_t **ztp);
-/*%<
- * Detach the given zonetable, if the reference count goes to zero the
- * zonetable will be flushed and then freed. In either case 'ztp' is
- * set to NULL.
- *
- * Requires:
- * \li '*ztp' to be valid
- */
-
-void
-dns_zt_attach(dns_zt_t *zt, dns_zt_t **ztp);
-/*%<
- * Attach 'zt' to '*ztp'.
- *
- * Requires:
- * \li 'zt' to be valid
- * \li '*ztp' to be NULL
- */
-
-isc_result_t
-dns_zt_load(dns_zt_t *zt, isc_boolean_t stop);
-
-isc_result_t
-dns_zt_loadnew(dns_zt_t *zt, isc_boolean_t stop);
-/*%<
- * Load all zones in the table. If 'stop' is ISC_TRUE,
- * stop on the first error and return it. If 'stop'
- * is ISC_FALSE, ignore errors.
- *
- * dns_zt_loadnew() only loads zones that are not yet loaded.
- * dns_zt_load() also loads zones that are already loaded and
- * and whose master file has changed since the last load.
- *
- * Requires:
- * \li 'zt' to be valid
- */
-
-isc_result_t
-dns_zt_freezezones(dns_zt_t *zt, isc_boolean_t freeze);
-/*%<
- * Freeze/thaw updates to master zones.
- * Any pending updates will be flushed.
- * Zones will be reloaded on thaw.
- */
-
-isc_result_t
-dns_zt_apply(dns_zt_t *zt, isc_boolean_t stop,
- isc_result_t (*action)(dns_zone_t *, void *), void *uap);
-
-isc_result_t
-dns_zt_apply2(dns_zt_t *zt, isc_boolean_t stop, isc_result_t *sub,
- isc_result_t (*action)(dns_zone_t *, void *), void *uap);
-/*%<
- * Apply a given 'action' to all zone zones in the table.
- * If 'stop' is 'ISC_TRUE' then walking the zone tree will stop if
- * 'action' does not return ISC_R_SUCCESS.
- *
- * Requires:
- * \li 'zt' to be valid.
- * \li 'action' to be non NULL.
- *
- * Returns:
- * \li ISC_R_SUCCESS if action was applied to all nodes. If 'stop' is
- * ISC_FALSE and 'sub' is non NULL then the first error (if any)
- * reported by 'action' is returned in '*sub';
- * any error code from 'action'.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_ZT_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: dst.h,v 1.12 2008/09/24 02:46:23 marka Exp $ */
-
-#ifndef DST_DST_H
-#define DST_DST_H 1
-
-/*! \file dst/dst.h */
-
-#include <isc/lang.h>
-
-#include <dns/types.h>
-
-#include <dst/gssapi.h>
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Types
- ***/
-
-/*%
- * The dst_key structure is opaque. Applications should use the accessor
- * functions provided to retrieve key attributes. If an application needs
- * to set attributes, new accessor functions will be written.
- */
-
-typedef struct dst_key dst_key_t;
-typedef struct dst_context dst_context_t;
-
-/* DST algorithm codes */
-#define DST_ALG_UNKNOWN 0
-#define DST_ALG_RSAMD5 1
-#define DST_ALG_RSA DST_ALG_RSAMD5 /*%< backwards compatibility */
-#define DST_ALG_DH 2
-#define DST_ALG_DSA 3
-#define DST_ALG_ECC 4
-#define DST_ALG_RSASHA1 5
-#define DST_ALG_NSEC3DSA 6
-#define DST_ALG_NSEC3RSASHA1 7
-#define DST_ALG_HMACMD5 157
-#define DST_ALG_GSSAPI 160
-#define DST_ALG_HMACSHA1 161 /* XXXMPA */
-#define DST_ALG_HMACSHA224 162 /* XXXMPA */
-#define DST_ALG_HMACSHA256 163 /* XXXMPA */
-#define DST_ALG_HMACSHA384 164 /* XXXMPA */
-#define DST_ALG_HMACSHA512 165 /* XXXMPA */
-#define DST_ALG_PRIVATE 254
-#define DST_ALG_EXPAND 255
-#define DST_MAX_ALGS 255
-
-/*% A buffer of this size is large enough to hold any key */
-#define DST_KEY_MAXSIZE 1280
-
-/*%
- * A buffer of this size is large enough to hold the textual representation
- * of any key
- */
-#define DST_KEY_MAXTEXTSIZE 2048
-
-/*% 'Type' for dst_read_key() */
-#define DST_TYPE_KEY 0x1000000 /* KEY key */
-#define DST_TYPE_PRIVATE 0x2000000
-#define DST_TYPE_PUBLIC 0x4000000
-
-/***
- *** Functions
- ***/
-
-isc_result_t
-dst_lib_init(isc_mem_t *mctx, isc_entropy_t *ectx, unsigned int eflags);
-/*%<
- * Initializes the DST subsystem.
- *
- * Requires:
- * \li "mctx" is a valid memory context
- * \li "ectx" is a valid entropy context
- *
- * Returns:
- * \li ISC_R_SUCCESS
- * \li ISC_R_NOMEMORY
- *
- * Ensures:
- * \li DST is properly initialized.
- */
-
-void
-dst_lib_destroy(void);
-/*%<
- * Releases all resources allocated by DST.
- */
-
-isc_boolean_t
-dst_algorithm_supported(unsigned int alg);
-/*%<
- * Checks that a given algorithm is supported by DST.
- *
- * Returns:
- * \li ISC_TRUE
- * \li ISC_FALSE
- */
-
-isc_result_t
-dst_context_create(dst_key_t *key, isc_mem_t *mctx, dst_context_t **dctxp);
-/*%<
- * Creates a context to be used for a sign or verify operation.
- *
- * Requires:
- * \li "key" is a valid key.
- * \li "mctx" is a valid memory context.
- * \li dctxp != NULL && *dctxp == NULL
- *
- * Returns:
- * \li ISC_R_SUCCESS
- * \li ISC_R_NOMEMORY
- *
- * Ensures:
- * \li *dctxp will contain a usable context.
- */
-
-void
-dst_context_destroy(dst_context_t **dctxp);
-/*%<
- * Destroys all memory associated with a context.
- *
- * Requires:
- * \li *dctxp != NULL && *dctxp == NULL
- *
- * Ensures:
- * \li *dctxp == NULL
- */
-
-isc_result_t
-dst_context_adddata(dst_context_t *dctx, const isc_region_t *data);
-/*%<
- * Incrementally adds data to the context to be used in a sign or verify
- * operation.
- *
- * Requires:
- * \li "dctx" is a valid context
- * \li "data" is a valid region
- *
- * Returns:
- * \li ISC_R_SUCCESS
- * \li DST_R_SIGNFAILURE
- * \li all other errors indicate failure
- */
-
-isc_result_t
-dst_context_sign(dst_context_t *dctx, isc_buffer_t *sig);
-/*%<
- * Computes a signature using the data and key stored in the context.
- *
- * Requires:
- * \li "dctx" is a valid context.
- * \li "sig" is a valid buffer.
- *
- * Returns:
- * \li ISC_R_SUCCESS
- * \li DST_R_VERIFYFAILURE
- * \li all other errors indicate failure
- *
- * Ensures:
- * \li "sig" will contain the signature
- */
-
-isc_result_t
-dst_context_verify(dst_context_t *dctx, isc_region_t *sig);
-/*%<
- * Verifies the signature using the data and key stored in the context.
- *
- * Requires:
- * \li "dctx" is a valid context.
- * \li "sig" is a valid region.
- *
- * Returns:
- * \li ISC_R_SUCCESS
- * \li all other errors indicate failure
- *
- * Ensures:
- * \li "sig" will contain the signature
- */
-
-isc_result_t
-dst_key_computesecret(const dst_key_t *pub, const dst_key_t *priv,
- isc_buffer_t *secret);
-/*%<
- * Computes a shared secret from two (Diffie-Hellman) keys.
- *
- * Requires:
- * \li "pub" is a valid key that can be used to derive a shared secret
- * \li "priv" is a valid private key that can be used to derive a shared secret
- * \li "secret" is a valid buffer
- *
- * Returns:
- * \li ISC_R_SUCCESS
- * \li any other result indicates failure
- *
- * Ensures:
- * \li If successful, secret will contain the derived shared secret.
- */
-
-isc_result_t
-dst_key_fromfile(dns_name_t *name, dns_keytag_t id, unsigned int alg, int type,
- const char *directory, isc_mem_t *mctx, dst_key_t **keyp);
-/*%<
- * Reads a key from permanent storage. The key can either be a public or
- * private key, and is specified by name, algorithm, and id. If a private key
- * is specified, the public key must also be present. If directory is NULL,
- * the current directory is assumed.
- *
- * Requires:
- * \li "name" is a valid absolute dns name.
- * \li "id" is a valid key tag identifier.
- * \li "alg" is a supported key algorithm.
- * \li "type" is DST_TYPE_PUBLIC, DST_TYPE_PRIVATE, or the bitwise union.
- * DST_TYPE_KEY look for a KEY record otherwise DNSKEY
- * \li "mctx" is a valid memory context.
- * \li "keyp" is not NULL and "*keyp" is NULL.
- *
- * Returns:
- * \li ISC_R_SUCCESS
- * \li any other result indicates failure
- *
- * Ensures:
- * \li If successful, *keyp will contain a valid key.
- */
-
-isc_result_t
-dst_key_fromnamedfile(const char *filename, int type, isc_mem_t *mctx,
- dst_key_t **keyp);
-/*%<
- * Reads a key from permanent storage. The key can either be a public or
- * key, and is specified by filename. If a private key is specified, the
- * public key must also be present.
- *
- * Requires:
- * \li "filename" is not NULL
- * \li "type" is DST_TYPE_PUBLIC, DST_TYPE_PRIVATE, or the bitwise union
- * DST_TYPE_KEY look for a KEY record otherwise DNSKEY
- * \li "mctx" is a valid memory context
- * \li "keyp" is not NULL and "*keyp" is NULL.
- *
- * Returns:
- * \li ISC_R_SUCCESS
- * \li any other result indicates failure
- *
- * Ensures:
- * \li If successful, *keyp will contain a valid key.
- */
-
-
-isc_result_t
-dst_key_read_public(const char *filename, int type,
- isc_mem_t *mctx, dst_key_t **keyp);
-/*%<
- * Reads a public key from permanent storage. The key must be a public key.
- *
- * Requires:
- * \li "filename" is not NULL
- * \li "type" is DST_TYPE_KEY look for a KEY record otherwise DNSKEY
- * \li "mctx" is a valid memory context
- * \li "keyp" is not NULL and "*keyp" is NULL.
- *
- * Returns:
- * \li ISC_R_SUCCESS
- * \li DST_R_BADKEYTYPE if the key type is not the expected one
- * \li ISC_R_UNEXPECTEDTOKEN if the file can not be parsed as a public key
- * \li any other result indicates failure
- *
- * Ensures:
- * \li If successful, *keyp will contain a valid key.
- */
-
-isc_result_t
-dst_key_tofile(const dst_key_t *key, int type, const char *directory);
-/*%<
- * Writes a key to permanent storage. The key can either be a public or
- * private key. Public keys are written in DNS format and private keys
- * are written as a set of base64 encoded values. If directory is NULL,
- * the current directory is assumed.
- *
- * Requires:
- * \li "key" is a valid key.
- * \li "type" is DST_TYPE_PUBLIC, DST_TYPE_PRIVATE, or the bitwise union
- *
- * Returns:
- * \li ISC_R_SUCCESS
- * \li any other result indicates failure
- */
-
-isc_result_t
-dst_key_fromdns(dns_name_t *name, dns_rdataclass_t rdclass,
- isc_buffer_t *source, isc_mem_t *mctx, dst_key_t **keyp);
-/*%<
- * Converts a DNS KEY record into a DST key.
- *
- * Requires:
- * \li "name" is a valid absolute dns name.
- * \li "source" is a valid buffer. There must be at least 4 bytes available.
- * \li "mctx" is a valid memory context.
- * \li "keyp" is not NULL and "*keyp" is NULL.
- *
- * Returns:
- * \li ISC_R_SUCCESS
- * \li any other result indicates failure
- *
- * Ensures:
- * \li If successful, *keyp will contain a valid key, and the consumed
- * pointer in data will be advanced.
- */
-
-isc_result_t
-dst_key_todns(const dst_key_t *key, isc_buffer_t *target);
-/*%<
- * Converts a DST key into a DNS KEY record.
- *
- * Requires:
- * \li "key" is a valid key.
- * \li "target" is a valid buffer. There must be at least 4 bytes unused.
- *
- * Returns:
- * \li ISC_R_SUCCESS
- * \li any other result indicates failure
- *
- * Ensures:
- * \li If successful, the used pointer in 'target' is advanced by at least 4.
- */
-
-isc_result_t
-dst_key_frombuffer(dns_name_t *name, unsigned int alg,
- unsigned int flags, unsigned int protocol,
- dns_rdataclass_t rdclass,
- isc_buffer_t *source, isc_mem_t *mctx, dst_key_t **keyp);
-/*%<
- * Converts a buffer containing DNS KEY RDATA into a DST key.
- *
- * Requires:
- *\li "name" is a valid absolute dns name.
- *\li "alg" is a supported key algorithm.
- *\li "source" is a valid buffer.
- *\li "mctx" is a valid memory context.
- *\li "keyp" is not NULL and "*keyp" is NULL.
- *
- * Returns:
- *\li ISC_R_SUCCESS
- * \li any other result indicates failure
- *
- * Ensures:
- *\li If successful, *keyp will contain a valid key, and the consumed
- * pointer in source will be advanced.
- */
-
-isc_result_t
-dst_key_tobuffer(const dst_key_t *key, isc_buffer_t *target);
-/*%<
- * Converts a DST key into DNS KEY RDATA format.
- *
- * Requires:
- *\li "key" is a valid key.
- *\li "target" is a valid buffer.
- *
- * Returns:
- *\li ISC_R_SUCCESS
- * \li any other result indicates failure
- *
- * Ensures:
- *\li If successful, the used pointer in 'target' is advanced.
- */
-
-isc_result_t
-dst_key_privatefrombuffer(dst_key_t *key, isc_buffer_t *buffer);
-/*%<
- * Converts a public key into a private key, reading the private key
- * information from the buffer. The buffer should contain the same data
- * as the .private key file would.
- *
- * Requires:
- *\li "key" is a valid public key.
- *\li "buffer" is not NULL.
- *
- * Returns:
- *\li ISC_R_SUCCESS
- * \li any other result indicates failure
- *
- * Ensures:
- *\li If successful, key will contain a valid private key.
- */
-
-gss_ctx_id_t
-dst_key_getgssctx(const dst_key_t *key);
-/*%<
- * Returns the opaque key data.
- * Be cautions when using this value unless you know what you are doing.
- *
- * Requires:
- *\li "key" is not NULL.
- *
- * Returns:
- *\li gssctx key data, possibly NULL.
- */
-
-isc_result_t
-dst_key_fromgssapi(dns_name_t *name, gss_ctx_id_t gssctx, isc_mem_t *mctx,
- dst_key_t **keyp);
-/*%<
- * Converts a GSSAPI opaque context id into a DST key.
- *
- * Requires:
- *\li "name" is a valid absolute dns name.
- *\li "gssctx" is a GSSAPI context id.
- *\li "mctx" is a valid memory context.
- *\li "keyp" is not NULL and "*keyp" is NULL.
- *
- * Returns:
- *\li ISC_R_SUCCESS
- * \li any other result indicates failure
- *
- * Ensures:
- *\li If successful, *keyp will contain a valid key and be responsible for
- * the context id.
- */
-
-isc_result_t
-dst_key_fromlabel(dns_name_t *name, int alg, unsigned int flags,
- unsigned int protocol, dns_rdataclass_t rdclass,
- const char *engine, const char *label, const char *pin,
- isc_mem_t *mctx, dst_key_t **keyp);
-
-isc_result_t
-dst_key_generate(dns_name_t *name, unsigned int alg,
- unsigned int bits, unsigned int param,
- unsigned int flags, unsigned int protocol,
- dns_rdataclass_t rdclass,
- isc_mem_t *mctx, dst_key_t **keyp);
-/*%<
- * Generate a DST key (or keypair) with the supplied parameters. The
- * interpretation of the "param" field depends on the algorithm:
- * \code
- * RSA: exponent
- * 0 use exponent 3
- * !0 use Fermat4 (2^16 + 1)
- * DH: generator
- * 0 default - use well known prime if bits == 768 or 1024,
- * otherwise use 2 as the generator.
- * !0 use this value as the generator.
- * DSA: unused
- * HMACMD5: entropy
- * 0 default - require good entropy
- * !0 lack of good entropy is ok
- *\endcode
- *
- * Requires:
- *\li "name" is a valid absolute dns name.
- *\li "keyp" is not NULL and "*keyp" is NULL.
- *
- * Returns:
- *\li ISC_R_SUCCESS
- * \li any other result indicates failure
- *
- * Ensures:
- *\li If successful, *keyp will contain a valid key.
- */
-
-isc_boolean_t
-dst_key_compare(const dst_key_t *key1, const dst_key_t *key2);
-/*%<
- * Compares two DST keys.
- *
- * Requires:
- *\li "key1" is a valid key.
- *\li "key2" is a valid key.
- *
- * Returns:
- *\li ISC_TRUE
- * \li ISC_FALSE
- */
-
-isc_boolean_t
-dst_key_paramcompare(const dst_key_t *key1, const dst_key_t *key2);
-/*%<
- * Compares the parameters of two DST keys. This is used to determine if
- * two (Diffie-Hellman) keys can be used to derive a shared secret.
- *
- * Requires:
- *\li "key1" is a valid key.
- *\li "key2" is a valid key.
- *
- * Returns:
- *\li ISC_TRUE
- * \li ISC_FALSE
- */
-
-void
-dst_key_free(dst_key_t **keyp);
-/*%<
- * Release all memory associated with the key.
- *
- * Requires:
- *\li "keyp" is not NULL and "*keyp" is a valid key.
- *
- * Ensures:
- *\li All memory associated with "*keyp" will be freed.
- *\li *keyp == NULL
- */
-
-/*%<
- * Accessor functions to obtain key fields.
- *
- * Require:
- *\li "key" is a valid key.
- */
-dns_name_t *
-dst_key_name(const dst_key_t *key);
-
-unsigned int
-dst_key_size(const dst_key_t *key);
-
-unsigned int
-dst_key_proto(const dst_key_t *key);
-
-unsigned int
-dst_key_alg(const dst_key_t *key);
-
-isc_uint32_t
-dst_key_flags(const dst_key_t *key);
-
-dns_keytag_t
-dst_key_id(const dst_key_t *key);
-
-dns_rdataclass_t
-dst_key_class(const dst_key_t *key);
-
-isc_boolean_t
-dst_key_isprivate(const dst_key_t *key);
-
-isc_boolean_t
-dst_key_iszonekey(const dst_key_t *key);
-
-isc_boolean_t
-dst_key_isnullkey(const dst_key_t *key);
-
-isc_result_t
-dst_key_buildfilename(const dst_key_t *key, int type,
- const char *directory, isc_buffer_t *out);
-/*%<
- * Generates the filename used by dst to store the specified key.
- * If directory is NULL, the current directory is assumed.
- *
- * Requires:
- *\li "key" is a valid key
- *\li "type" is either DST_TYPE_PUBLIC, DST_TYPE_PRIVATE, or 0 for no suffix.
- *\li "out" is a valid buffer
- *
- * Ensures:
- *\li the file name will be written to "out", and the used pointer will
- * be advanced.
- */
-
-isc_result_t
-dst_key_sigsize(const dst_key_t *key, unsigned int *n);
-/*%<
- * Computes the size of a signature generated by the given key.
- *
- * Requires:
- *\li "key" is a valid key.
- *\li "n" is not NULL
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li DST_R_UNSUPPORTEDALG
- *
- * Ensures:
- *\li "n" stores the size of a generated signature
- */
-
-isc_result_t
-dst_key_secretsize(const dst_key_t *key, unsigned int *n);
-/*%<
- * Computes the size of a shared secret generated by the given key.
- *
- * Requires:
- *\li "key" is a valid key.
- *\li "n" is not NULL
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li DST_R_UNSUPPORTEDALG
- *
- * Ensures:
- *\li "n" stores the size of a generated shared secret
- */
-
-isc_uint16_t
-dst_region_computeid(const isc_region_t *source, unsigned int alg);
-/*%<
- * Computes the key id of the key stored in the provided region with the
- * given algorithm.
- *
- * Requires:
- *\li "source" contains a valid, non-NULL region.
- *
- * Returns:
- *\li the key id
- */
-
-isc_uint16_t
-dst_key_getbits(const dst_key_t *key);
-/*
- * Get the number of digest bits required (0 == MAX).
- *
- * Requires:
- * "key" is a valid key.
- */
-
-void
-dst_key_setbits(dst_key_t *key, isc_uint16_t bits);
-/*
- * Set the number of digest bits required (0 == MAX).
- *
- * Requires:
- * "key" is a valid key.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DST_DST_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: gssapi.h,v 1.9.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef DST_GSSAPI_H
-#define DST_GSSAPI_H 1
-
-/*! \file dst/gssapi.h */
-
-#include <isc/formatcheck.h>
-#include <isc/lang.h>
-#include <isc/platform.h>
-#include <isc/types.h>
-#include <dns/types.h>
-
-#ifdef GSSAPI
-#ifdef _WINDOWS
-/*
- * MSVC does not like macros in #include lines.
- */
-#include <gssapi/gssapi.h>
-#else
-#include ISC_PLATFORM_GSSAPIHEADER
-#endif
-#ifndef GSS_SPNEGO_MECHANISM
-#define GSS_SPNEGO_MECHANISM ((void*)0)
-#endif
-#endif
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Types
- ***/
-
-/***
- *** Functions
- ***/
-
-isc_result_t
-dst_gssapi_acquirecred(dns_name_t *name, isc_boolean_t initiate,
- gss_cred_id_t *cred);
-/*
- * Acquires GSS credentials.
- *
- * Requires:
- * 'name' is a valid name, preferably one known by the GSS provider
- * 'initiate' indicates whether the credentials are for initiating or
- * accepting contexts
- * 'cred' is a pointer to NULL, which will be allocated with the
- * credential handle. Call dst_gssapi_releasecred to free
- * the memory.
- *
- * Returns:
- * ISC_R_SUCCESS msg was successfully updated to include the
- * query to be sent
- * other an error occurred while building the message
- */
-
-isc_result_t
-dst_gssapi_releasecred(gss_cred_id_t *cred);
-/*
- * Releases GSS credentials. Calling this function does release the
- * memory allocated for the credential in dst_gssapi_acquirecred()
- *
- * Requires:
- * 'mctx' is a valid memory context
- * 'cred' is a pointer to the credential to be released
- *
- * Returns:
- * ISC_R_SUCCESS credential was released successfully
- * other an error occurred while releaseing
- * the credential
- */
-
-isc_result_t
-dst_gssapi_initctx(dns_name_t *name, isc_buffer_t *intoken,
- isc_buffer_t *outtoken, gss_ctx_id_t *gssctx);
-/*
- * Initiates a GSS context.
- *
- * Requires:
- * 'name' is a valid name, preferably one known by the GSS
- * provider
- * 'intoken' is a token received from the acceptor, or NULL if
- * there isn't one
- * 'outtoken' is a buffer to receive the token generated by
- * gss_init_sec_context() to be sent to the acceptor
- * 'context' is a pointer to a valid gss_ctx_id_t
- * (which may have the value GSS_C_NO_CONTEXT)
- *
- * Returns:
- * ISC_R_SUCCESS msg was successfully updated to include the
- * query to be sent
- * other an error occurred while building the message
- */
-
-isc_result_t
-dst_gssapi_acceptctx(gss_cred_id_t cred,
- isc_region_t *intoken, isc_buffer_t **outtoken,
- gss_ctx_id_t *context, dns_name_t *principal,
- isc_mem_t *mctx);
-/*
- * Accepts a GSS context.
- *
- * Requires:
- * 'mctx' is a valid memory context
- * 'cred' is the acceptor's valid GSS credential handle
- * 'intoken' is a token received from the initiator
- * 'outtoken' is a pointer a buffer pointer used to return the token
- * generated by gss_accept_sec_context() to be sent to the
- * initiator
- * 'context' is a valid pointer to receive the generated context handle.
- * On the initial call, it should be a pointer to NULL, which
- * will be allocated as a gss_ctx_id_t. Subsequent calls
- * should pass in the handle generated on the first call.
- * Call dst_gssapi_releasecred to delete the context and free
- * the memory.
- *
- * Requires:
- * 'outtoken' to != NULL && *outtoken == NULL.
- *
- * Returns:
- * ISC_R_SUCCESS msg was successfully updated to include the
- * query to be sent
- * other an error occurred while building the message
- */
-
-isc_result_t
-dst_gssapi_deletectx(isc_mem_t *mctx, gss_ctx_id_t *gssctx);
-/*
- * Destroys a GSS context. This function deletes the context from the GSS
- * provider and then frees the memory used by the context pointer.
- *
- * Requires:
- * 'mctx' is a valid memory context
- * 'context' is a valid GSS context
- *
- * Returns:
- * ISC_R_SUCCESS
- */
-
-
-void
-gss_log(int level, const char *fmt, ...)
-ISC_FORMAT_PRINTF(2, 3);
-/*
- * Logging function for GSS.
- *
- * Requires
- * 'level' is the log level to be used, as an integer
- * 'fmt' is a printf format specifier
- */
-
-char *
-gss_error_tostring(isc_uint32_t major, isc_uint32_t minor,
- char *buf, size_t buflen);
-/*
- * Render a GSS major status/minor status pair into a string
- *
- * Requires:
- * 'major' is a GSS major status code
- * 'minor' is a GSS minor status code
- *
- * Returns:
- * A string containing the text representation of the error codes.
- * Users should copy the string if they wish to keep it.
- */
-
-isc_boolean_t
-dst_gssapi_identitymatchesrealmkrb5(dns_name_t *signer, dns_name_t *name,
- dns_name_t *realm);
-/*
- * Compare a "signer" (in the format of a Kerberos-format Kerberos5
- * principal: host/example.com@EXAMPLE.COM) to the realm name stored
- * in "name" (which represents the realm name).
- *
- */
-
-isc_boolean_t
-dst_gssapi_identitymatchesrealmms(dns_name_t *signer, dns_name_t *name,
- dns_name_t *realm);
-/*
- * Compare a "signer" (in the format of a Kerberos-format Kerberos5
- * principal: host/example.com@EXAMPLE.COM) to the realm name stored
- * in "name" (which represents the realm name).
- *
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DST_GSSAPI_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: lib.h,v 1.7 2007/06/19 23:47:17 tbox Exp $ */
-
-#ifndef DST_LIB_H
-#define DST_LIB_H 1
-
-/*! \file dst/lib.h */
-
-#include <isc/types.h>
-#include <isc/lang.h>
-
-ISC_LANG_BEGINDECLS
-
-LIBDNS_EXTERNAL_DATA extern isc_msgcat_t *dst_msgcat;
-
-void
-dst_lib_initmsgcat(void);
-/*
- * Initialize the DST library's message catalog, dst_msgcat, if it
- * has not already been initialized.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* DST_LIB_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: result.h,v 1.9 2008/04/01 23:47:10 tbox Exp $ */
-
-#ifndef DST_RESULT_H
-#define DST_RESULT_H 1
-
-/*! \file dst/result.h */
-
-#include <isc/lang.h>
-#include <isc/resultclass.h>
-
-/*
- * Nothing in this file truly depends on <isc/result.h>, but the
- * DST result codes are considered to be publicly derived from
- * the ISC result codes, so including this file buys you the ISC_R_
- * namespace too.
- */
-#include <isc/result.h> /* Contractual promise. */
-
-#define DST_R_UNSUPPORTEDALG (ISC_RESULTCLASS_DST + 0)
-#define DST_R_OPENSSLFAILURE (ISC_RESULTCLASS_DST + 1)
-#define DST_R_NOCRYPTO (ISC_RESULTCLASS_DST + 2)
-#define DST_R_NULLKEY (ISC_RESULTCLASS_DST + 3)
-#define DST_R_INVALIDPUBLICKEY (ISC_RESULTCLASS_DST + 4)
-#define DST_R_INVALIDPRIVATEKEY (ISC_RESULTCLASS_DST + 5)
-/* 6 is unused */
-#define DST_R_WRITEERROR (ISC_RESULTCLASS_DST + 7)
-#define DST_R_INVALIDPARAM (ISC_RESULTCLASS_DST + 8)
-/* 9 is unused */
-/* 10 is unused */
-#define DST_R_SIGNFAILURE (ISC_RESULTCLASS_DST + 11)
-/* 12 is unused */
-/* 13 is unused */
-#define DST_R_VERIFYFAILURE (ISC_RESULTCLASS_DST + 14)
-#define DST_R_NOTPUBLICKEY (ISC_RESULTCLASS_DST + 15)
-#define DST_R_NOTPRIVATEKEY (ISC_RESULTCLASS_DST + 16)
-#define DST_R_KEYCANNOTCOMPUTESECRET (ISC_RESULTCLASS_DST + 17)
-#define DST_R_COMPUTESECRETFAILURE (ISC_RESULTCLASS_DST + 18)
-#define DST_R_NORANDOMNESS (ISC_RESULTCLASS_DST + 19)
-#define DST_R_BADKEYTYPE (ISC_RESULTCLASS_DST + 20)
-#define DST_R_NOENGINE (ISC_RESULTCLASS_DST + 21)
-
-#define DST_R_NRESULTS 22 /* Number of results */
-
-ISC_LANG_BEGINDECLS
-
-const char *
-dst_result_totext(isc_result_t);
-
-void
-dst_result_register(void);
-
-ISC_LANG_ENDDECLS
-
-#endif /* DST_RESULT_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: app.h,v 1.8 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_APP_H
-#define ISC_APP_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isc/app.h
- * \brief ISC Application Support
- *
- * Dealing with program termination can be difficult, especially in a
- * multithreaded program. The routines in this module help coordinate
- * the shutdown process. They are used as follows by the initial (main)
- * thread of the application:
- *
- *\li isc_app_start(); Call very early in main(), before
- * any other threads have been created.
- *
- *\li isc_app_run(); This will post any on-run events,
- * and then block until application
- * shutdown is requested. A shutdown
- * request is made by calling
- * isc_app_shutdown(), or by sending
- * SIGINT or SIGTERM to the process.
- * After isc_app_run() returns, the
- * application should shutdown itself.
- *
- *\li isc_app_finish(); Call very late in main().
- *
- * Applications that want to use SIGHUP/isc_app_reload() to trigger reloading
- * should check the result of isc_app_run() and call the reload routine if
- * the result is ISC_R_RELOAD. They should then call isc_app_run() again
- * to resume waiting for reload or termination.
- *
- * Use of this module is not required. In particular, isc_app_start() is
- * NOT an ISC library initialization routine.
- *
- * \li MP:
- * Clients must ensure that isc_app_start(), isc_app_run(), and
- * isc_app_finish() are called at most once. isc_app_shutdown()
- * is safe to use by any thread (provided isc_app_start() has been
- * called previously).
- *
- * \li Reliability:
- * No anticipated impact.
- *
- * \li Resources:
- * None.
- *
- * \li Security:
- * No anticipated impact.
- *
- * \li Standards:
- * None.
- */
-
-#include <isc/eventclass.h>
-#include <isc/lang.h>
-#include <isc/result.h>
-
-typedef isc_event_t isc_appevent_t;
-
-#define ISC_APPEVENT_FIRSTEVENT (ISC_EVENTCLASS_APP + 0)
-#define ISC_APPEVENT_SHUTDOWN (ISC_EVENTCLASS_APP + 1)
-#define ISC_APPEVENT_LASTEVENT (ISC_EVENTCLASS_APP + 65535)
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-isc_app_start(void);
-/*!<
- * \brief Start an ISC library application.
- *
- * Notes:
- * This call should be made before any other ISC library call, and as
- * close to the beginning of the application as possible.
- */
-
-isc_result_t
-isc_app_onrun(isc_mem_t *mctx, isc_task_t *task, isc_taskaction_t action,
- void *arg);
-/*!<
- * \brief Request delivery of an event when the application is run.
- *
- * Requires:
- * isc_app_start() has been called.
- *
- * Returns:
- * ISC_R_SUCCESS
- * ISC_R_NOMEMORY
- */
-
-isc_result_t
-isc_app_run(void);
-/*!<
- * \brief Run an ISC library application.
- *
- * Notes:
- *\li The caller (typically the initial thread of an application) will
- * block until shutdown is requested. When the call returns, the
- * caller should start shutting down the application.
- *
- * Requires:
- *\li isc_app_start() has been called.
- *
- * Ensures:
- *\li Any events requested via isc_app_onrun() will have been posted (in
- * FIFO order) before isc_app_run() blocks.
- *
- * Returns:
- *\li ISC_R_SUCCESS Shutdown has been requested.
- *\li ISC_R_RELOAD Reload has been requested.
- */
-
-isc_result_t
-isc_app_shutdown(void);
-/*!<
- * \brief Request application shutdown.
- *
- * Notes:
- *\li It is safe to call isc_app_shutdown() multiple times. Shutdown will
- * only be triggered once.
- *
- * Requires:
- *\li isc_app_run() has been called.
- *
- * Returns:
- *\li ISC_R_SUCCESS
- *\li ISC_R_UNEXPECTED
- */
-
-isc_result_t
-isc_app_reload(void);
-/*!<
- * \brief Request application reload.
- *
- * Requires:
- *\li isc_app_run() has been called.
- *
- * Returns:
- *\li ISC_R_SUCCESS
- *\li ISC_R_UNEXPECTED
- */
-
-void
-isc_app_finish(void);
-/*!<
- * \brief Finish an ISC library application.
- *
- * Notes:
- *\li This call should be made at or near the end of main().
- *
- * Requires:
- *\li isc_app_start() has been called.
- *
- * Ensures:
- *\li Any resources allocated by isc_app_start() have been released.
- */
-
-void
-isc_app_block(void);
-/*!<
- * \brief Indicate that a blocking operation will be performed.
- *
- * Notes:
- *\li If a blocking operation is in process, a call to isc_app_shutdown()
- * or an external signal will abort the program, rather than allowing
- * clean shutdown. This is primarily useful for reading user input.
- *
- * Requires:
- * \li isc_app_start() has been called.
- * \li No other blocking operations are in progress.
- */
-
-void
-isc_app_unblock(void);
-/*!<
- * \brief Indicate that a blocking operation is complete.
- *
- * Notes:
- * \li When a blocking operation has completed, return the program to a
- * state where a call to isc_app_shutdown() or an external signal will
- * shutdown normally.
- *
- * Requires:
- * \li isc_app_start() has been called.
- * \li isc_app_block() has been called by the same thread.
- */
-
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_APP_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1997-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: assertions.h,v 1.26 2008/10/15 23:47:31 tbox Exp $
- */
-/*! \file isc/assertions.h
- */
-
-#ifndef ISC_ASSERTIONS_H
-#define ISC_ASSERTIONS_H 1
-
-#include <isc/lang.h>
-#include <isc/platform.h>
-
-ISC_LANG_BEGINDECLS
-
-/*% isc assertion type */
-typedef enum {
- isc_assertiontype_require,
- isc_assertiontype_ensure,
- isc_assertiontype_insist,
- isc_assertiontype_invariant
-} isc_assertiontype_t;
-
-typedef void (*isc_assertioncallback_t)(const char *, int, isc_assertiontype_t,
- const char *);
-
-/* coverity[+kill] */
-LIBISC_EXTERNAL_DATA extern isc_assertioncallback_t isc_assertion_failed;
-
-void
-isc_assertion_setcallback(isc_assertioncallback_t);
-
-const char *
-isc_assertion_typetotext(isc_assertiontype_t type);
-
-#if defined(ISC_CHECK_ALL) || defined(__COVERITY__)
-#define ISC_CHECK_REQUIRE 1
-#define ISC_CHECK_ENSURE 1
-#define ISC_CHECK_INSIST 1
-#define ISC_CHECK_INVARIANT 1
-#endif
-
-#if defined(ISC_CHECK_NONE) && !defined(__COVERITY__)
-#define ISC_CHECK_REQUIRE 0
-#define ISC_CHECK_ENSURE 0
-#define ISC_CHECK_INSIST 0
-#define ISC_CHECK_INVARIANT 0
-#endif
-
-#ifndef ISC_CHECK_REQUIRE
-#define ISC_CHECK_REQUIRE 1
-#endif
-
-#ifndef ISC_CHECK_ENSURE
-#define ISC_CHECK_ENSURE 1
-#endif
-
-#ifndef ISC_CHECK_INSIST
-#define ISC_CHECK_INSIST 1
-#endif
-
-#ifndef ISC_CHECK_INVARIANT
-#define ISC_CHECK_INVARIANT 1
-#endif
-
-#if ISC_CHECK_REQUIRE != 0
-#define ISC_REQUIRE(cond) \
- ((void) ((cond) || \
- ((isc_assertion_failed)(__FILE__, __LINE__, \
- isc_assertiontype_require, \
- #cond), 0)))
-#else
-#define ISC_REQUIRE(cond) ((void) 0)
-#endif /* ISC_CHECK_REQUIRE */
-
-#if ISC_CHECK_ENSURE != 0
-#define ISC_ENSURE(cond) \
- ((void) ((cond) || \
- ((isc_assertion_failed)(__FILE__, __LINE__, \
- isc_assertiontype_ensure, \
- #cond), 0)))
-#else
-#define ISC_ENSURE(cond) ((void) 0)
-#endif /* ISC_CHECK_ENSURE */
-
-#if ISC_CHECK_INSIST != 0
-#define ISC_INSIST(cond) \
- ((void) ((cond) || \
- ((isc_assertion_failed)(__FILE__, __LINE__, \
- isc_assertiontype_insist, \
- #cond), 0)))
-#else
-#define ISC_INSIST(cond) ((void) 0)
-#endif /* ISC_CHECK_INSIST */
-
-#if ISC_CHECK_INVARIANT != 0
-#define ISC_INVARIANT(cond) \
- ((void) ((cond) || \
- ((isc_assertion_failed)(__FILE__, __LINE__, \
- isc_assertiontype_invariant, \
- #cond), 0)))
-#else
-#define ISC_INVARIANT(cond) ((void) 0)
-#endif /* ISC_CHECK_INVARIANT */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_ASSERTIONS_H */
+++ /dev/null
-/*
- * Copyright (C) 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: atomic.h,v 1.10 2008/01/24 23:47:00 tbox Exp $ */
-
-#ifndef ISC_ATOMIC_H
-#define ISC_ATOMIC_H 1
-
-#include <isc/platform.h>
-#include <isc/types.h>
-
-#ifdef ISC_PLATFORM_USEGCCASM
-/*
- * This routine atomically increments the value stored in 'p' by 'val', and
- * returns the previous value.
- */
-static __inline__ isc_int32_t
-isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
- isc_int32_t prev = val;
-
- __asm__ volatile(
-#ifdef ISC_PLATFORM_USETHREADS
- "lock;"
-#endif
- "xadd %0, %1"
- :"=q"(prev)
- :"m"(*p), "0"(prev)
- :"memory", "cc");
-
- return (prev);
-}
-
-#ifdef ISC_PLATFORM_HAVEXADDQ
-static __inline__ isc_int64_t
-isc_atomic_xaddq(isc_int64_t *p, isc_int64_t val) {
- isc_int64_t prev = val;
-
- __asm__ volatile(
-#ifdef ISC_PLATFORM_USETHREADS
- "lock;"
-#endif
- "xaddq %0, %1"
- :"=q"(prev)
- :"m"(*p), "0"(prev)
- :"memory", "cc");
-
- return (prev);
-}
-#endif /* ISC_PLATFORM_HAVEXADDQ */
-
-/*
- * This routine atomically stores the value 'val' in 'p'.
- */
-static __inline__ void
-isc_atomic_store(isc_int32_t *p, isc_int32_t val) {
- __asm__ volatile(
-#ifdef ISC_PLATFORM_USETHREADS
- /*
- * xchg should automatically lock memory, but we add it
- * explicitly just in case (it at least doesn't harm)
- */
- "lock;"
-#endif
-
- "xchgl %1, %0"
- :
- : "r"(val), "m"(*p)
- : "memory");
-}
-
-/*
- * This routine atomically replaces the value in 'p' with 'val', if the
- * original value is equal to 'cmpval'. The original value is returned in any
- * case.
- */
-static __inline__ isc_int32_t
-isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) {
- __asm__ volatile(
-#ifdef ISC_PLATFORM_USETHREADS
- "lock;"
-#endif
- "cmpxchgl %1, %2"
- : "=a"(cmpval)
- : "r"(val), "m"(*p), "a"(cmpval)
- : "memory");
-
- return (cmpval);
-}
-
-#elif defined(ISC_PLATFORM_USESTDASM)
-/*
- * The followings are "generic" assembly code which implements the same
- * functionality in case the gcc extension cannot be used. It should be
- * better to avoid inlining below, since we directly refer to specific
- * positions of the stack frame, which would not actually point to the
- * intended address in the embedded mnemonic.
- */
-#include <isc/util.h> /* for 'UNUSED' macro */
-
-static isc_int32_t
-isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
- UNUSED(p);
- UNUSED(val);
-
- __asm (
- "movl 8(%ebp), %ecx\n"
- "movl 12(%ebp), %edx\n"
-#ifdef ISC_PLATFORM_USETHREADS
- "lock;"
-#endif
- "xadd %edx, (%ecx)\n"
-
- /*
- * set the return value directly in the register so that we
- * can avoid guessing the correct position in the stack for a
- * local variable.
- */
- "movl %edx, %eax"
- );
-}
-
-static void
-isc_atomic_store(isc_int32_t *p, isc_int32_t val) {
- UNUSED(p);
- UNUSED(val);
-
- __asm (
- "movl 8(%ebp), %ecx\n"
- "movl 12(%ebp), %edx\n"
-#ifdef ISC_PLATFORM_USETHREADS
- "lock;"
-#endif
- "xchgl (%ecx), %edx\n"
- );
-}
-
-static isc_int32_t
-isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) {
- UNUSED(p);
- UNUSED(cmpval);
- UNUSED(val);
-
- __asm (
- "movl 8(%ebp), %ecx\n"
- "movl 12(%ebp), %eax\n" /* must be %eax for cmpxchgl */
- "movl 16(%ebp), %edx\n"
-#ifdef ISC_PLATFORM_USETHREADS
- "lock;"
-#endif
-
- /*
- * If (%ecx) == %eax then (%ecx) := %edx.
- % %eax is set to old (%ecx), which will be the return value.
- */
- "cmpxchgl %edx, (%ecx)"
- );
-}
-#else /* !ISC_PLATFORM_USEGCCASM && !ISC_PLATFORM_USESTDASM */
-
-#error "unsupported compiler. disable atomic ops by --disable-atomic"
-
-#endif
-#endif /* ISC_ATOMIC_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: base64.h,v 1.22 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_BASE64_H
-#define ISC_BASE64_H 1
-
-/*! \file isc/base64.h */
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Functions
- ***/
-
-isc_result_t
-isc_base64_totext(isc_region_t *source, int wordlength,
- const char *wordbreak, isc_buffer_t *target);
-/*!<
- * \brief Convert data into base64 encoded text.
- *
- * Notes:
- *\li The base64 encoded text in 'target' will be divided into
- * words of at most 'wordlength' characters, separated by
- * the 'wordbreak' string. No parentheses will surround
- * the text.
- *
- * Requires:
- *\li 'source' is a region containing binary data
- *\li 'target' is a text buffer containing available space
- *\li 'wordbreak' points to a null-terminated string of
- * zero or more whitespace characters
- *
- * Ensures:
- *\li target will contain the base64 encoded version of the data
- * in source. The 'used' pointer in target will be advanced as
- * necessary.
- */
-
-isc_result_t
-isc_base64_decodestring(const char *cstr, isc_buffer_t *target);
-/*!<
- * \brief Decode a null-terminated base64 string.
- *
- * Requires:
- *\li 'cstr' is non-null.
- *\li 'target' is a valid buffer.
- *
- * Returns:
- *\li #ISC_R_SUCCESS -- the entire decoded representation of 'cstring'
- * fit in 'target'.
- *\li #ISC_R_BADBASE64 -- 'cstr' is not a valid base64 encoding.
- *
- * Other error returns are any possible error code from:
- *\li isc_lex_create(),
- *\li isc_lex_openbuffer(),
- *\li isc_base64_tobuffer().
- */
-
-isc_result_t
-isc_base64_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length);
-/*!<
- * \brief Convert base64 encoded text from a lexer context into data.
- *
- * Requires:
- *\li 'lex' is a valid lexer context
- *\li 'target' is a buffer containing binary data
- *\li 'length' is an integer
- *
- * Ensures:
- *\li target will contain the data represented by the base64 encoded
- * string parsed by the lexer. No more than length bytes will be read,
- * if length is positive. The 'used' pointer in target will be
- * advanced as necessary.
- */
-
-
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_BASE64_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: bitstring.h,v 1.14 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_BITSTRING_H
-#define ISC_BITSTRING_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isc/bitstring.h
- *
- * \brief Bitstring manipulation functions.
- *
- * A bitstring is a packed array of bits, stored in a contiguous
- * sequence of octets. The "most significant bit" (msb) of a bitstring
- * is the high bit of the first octet. The "least significant bit" of a
- * bitstring is the low bit of the last octet.
- *
- * Two bit numbering schemes are supported, "msb0" and "lsb0".
- *
- * In the "msb0" scheme, bit number 0 designates the most significant bit,
- * and any padding bits required to make the bitstring a multiple of 8 bits
- * long are added to the least significant end of the last octet.
- *
- * In the "lsb0" scheme, bit number 0 designates the least significant bit,
- * and any padding bits required to make the bitstring a multiple of 8 bits
- * long are added to the most significant end of the first octet.
- *
- * E.g., consider the bitstring "11010001111". This bitstring is 11 bits
- * long and will take two octets. Let "p" denote a pad bit. In the msb0
- * encoding, it would be
- *
- * \verbatim
- * Octet 0 Octet 1
- * |
- * 1 1 0 1 0 0 0 1 | 1 1 1 p p p p p
- * ^ | ^
- * | |
- * bit 0 bit 15
- * \endverbatim
- *
- * In the lsb0 encoding, it would be
- *
- * \verbatim
- * Octet 0 Octet 1
- * |
- * p p p p p 1 1 0 | 1 0 0 0 1 1 1 1
- * ^ | ^
- * | |
- * bit 15 bit 0
- * \endverbatim
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Types
- ***/
-
-struct isc_bitstring {
- unsigned int magic;
- unsigned char * data;
- unsigned int length;
- unsigned int size;
- isc_boolean_t lsb0;
-};
-
-/***
- *** Functions
- ***/
-
-void
-isc_bitstring_init(isc_bitstring_t *bitstring, unsigned char *data,
- unsigned int length, unsigned int size, isc_boolean_t lsb0);
-/*!<
- * \brief Make 'bitstring' refer to the bitstring of 'size' bits starting
- * at 'data'. 'length' bits of the bitstring are valid. If 'lsb0'
- * is set then, bit 0 refers to the least significant bit of the
- * bitstring. Otherwise bit 0 is the most significant bit.
- *
- * Requires:
- *
- *\li 'bitstring' points to a isc_bitstring_t.
- *
- *\li 'data' points to an array of unsigned char large enough to hold
- * 'size' bits.
- *
- *\li 'length' <= 'size'.
- *
- * Ensures:
- *
- *\li 'bitstring' is a valid bitstring.
- */
-
-void
-isc_bitstring_invalidate(isc_bitstring_t *bitstring);
-/*!<
- * \brief Invalidate 'bitstring'.
- *
- * Requires:
- *
- *\li 'bitstring' is a valid bitstring.
- *
- * Ensures:
- *
- *\li 'bitstring' is not a valid bitstring.
- */
-
-void
-isc_bitstring_copy(isc_bitstring_t *source, unsigned int sbitpos,
- isc_bitstring_t *target, unsigned int tbitpos,
- unsigned int n);
-/*!<
- * \brief Starting at bit 'sbitpos', copy 'n' bits from 'source' to
- * the 'n' bits of 'target' starting at 'tbitpos'.
- *
- * Requires:
- *
- *\li 'source' and target are valid bitstrings with the same lsb0 setting.
- *
- *\li 'sbitpos' + 'n' is less than or equal to the length of 'source'.
- *
- *\li 'tbitpos' + 'n' is less than or equal to the size of 'target'.
- *
- * Ensures:
- *
- *\li The specified bits have been copied, and the length of 'target'
- * adjusted (if required).
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_BITSTRING_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: boolean.h,v 1.19 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_BOOLEAN_H
-#define ISC_BOOLEAN_H 1
-
-/*! \file isc/boolean.h */
-
-typedef enum { isc_boolean_false = 0, isc_boolean_true = 1 } isc_boolean_t;
-
-#define ISC_FALSE isc_boolean_false
-#define ISC_TRUE isc_boolean_true
-#define ISC_TF(x) ((x) ? ISC_TRUE : ISC_FALSE)
-
-#endif /* ISC_BOOLEAN_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: buffer.h,v 1.53 2008/09/25 04:02:39 tbox Exp $ */
-
-#ifndef ISC_BUFFER_H
-#define ISC_BUFFER_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isc/buffer.h
- *
- * \brief A buffer is a region of memory, together with a set of related subregions.
- * Buffers are used for parsing and I/O operations.
- *
- * The 'used region' and the 'available' region are disjoint, and their
- * union is the buffer's region. The used region extends from the beginning
- * of the buffer region to the last used byte. The available region
- * extends from one byte greater than the last used byte to the end of the
- * buffer's region. The size of the used region can be changed using various
- * buffer commands. Initially, the used region is empty.
- *
- * The used region is further subdivided into two disjoint regions: the
- * 'consumed region' and the 'remaining region'. The union of these two
- * regions is the used region. The consumed region extends from the beginning
- * of the used region to the byte before the 'current' offset (if any). The
- * 'remaining' region the current pointer to the end of the used
- * region. The size of the consumed region can be changed using various
- * buffer commands. Initially, the consumed region is empty.
- *
- * The 'active region' is an (optional) subregion of the remaining region.
- * It extends from the current offset to an offset in the remaining region
- * that is selected with isc_buffer_setactive(). Initially, the active region
- * is empty. If the current offset advances beyond the chosen offset, the
- * active region will also be empty.
- *
- * \verbatim
- * /------------entire length---------------\
- * /----- used region -----\/-- available --\
- * +----------------------------------------+
- * | consumed | remaining | |
- * +----------------------------------------+
- * a b c d e
- *
- * a == base of buffer.
- * b == current pointer. Can be anywhere between a and d.
- * c == active pointer. Meaningful between b and d.
- * d == used pointer.
- * e == length of buffer.
- *
- * a-e == entire length of buffer.
- * a-d == used region.
- * a-b == consumed region.
- * b-d == remaining region.
- * b-c == optional active region.
- *\endverbatim
- *
- * The following invariants are maintained by all routines:
- *
- *\code
- * length > 0
- *
- * base is a valid pointer to length bytes of memory
- *
- * 0 <= used <= length
- *
- * 0 <= current <= used
- *
- * 0 <= active <= used
- * (although active < current implies empty active region)
- *\endcode
- *
- * \li MP:
- * Buffers have no synchronization. Clients must ensure exclusive
- * access.
- *
- * \li Reliability:
- * No anticipated impact.
- *
- * \li Resources:
- * Memory: 1 pointer + 6 unsigned integers per buffer.
- *
- * \li Security:
- * No anticipated impact.
- *
- * \li Standards:
- * None.
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-#include <isc/magic.h>
-#include <isc/types.h>
-
-/*!
- * To make many functions be inline macros (via \#define) define this.
- * If it is undefined, a function will be used.
- */
-/* #define ISC_BUFFER_USEINLINE */
-
-ISC_LANG_BEGINDECLS
-
-/*@{*/
-/*!
- *** Magic numbers
- ***/
-#define ISC_BUFFER_MAGIC 0x42756621U /* Buf!. */
-#define ISC_BUFFER_VALID(b) ISC_MAGIC_VALID(b, ISC_BUFFER_MAGIC)
-/*@}*/
-
-/*
- * The following macros MUST be used only on valid buffers. It is the
- * caller's responsibility to ensure this by using the ISC_BUFFER_VALID
- * check above, or by calling another isc_buffer_*() function (rather than
- * another macro.)
- */
-
-/*@{*/
-/*!
- * Fundamental buffer elements. (A through E in the introductory comment.)
- */
-#define isc_buffer_base(b) ((void *)(b)->base) /*a*/
-#define isc_buffer_current(b) \
- ((void *)((unsigned char *)(b)->base + (b)->current)) /*b*/
-#define isc_buffer_active(b) \
- ((void *)((unsigned char *)(b)->base + (b)->active)) /*c*/
-#define isc_buffer_used(b) \
- ((void *)((unsigned char *)(b)->base + (b)->used)) /*d*/
-#define isc_buffer_length(b) ((b)->length) /*e*/
-/*@}*/
-
-/*@{*/
-/*!
- * Derived lengths. (Described in the introductory comment.)
- */
-#define isc_buffer_usedlength(b) ((b)->used) /* d-a */
-#define isc_buffer_consumedlength(b) ((b)->current) /* b-a */
-#define isc_buffer_remaininglength(b) ((b)->used - (b)->current) /* d-b */
-#define isc_buffer_activelength(b) ((b)->active - (b)->current) /* c-b */
-#define isc_buffer_availablelength(b) ((b)->length - (b)->used) /* e-d */
-/*@}*/
-
-/*!
- * Note that the buffer structure is public. This is principally so buffer
- * operations can be implemented using macros. Applications are strongly
- * discouraged from directly manipulating the structure.
- */
-
-struct isc_buffer {
- unsigned int magic;
- void *base;
- /*@{*/
- /*! The following integers are byte offsets from 'base'. */
- unsigned int length;
- unsigned int used;
- unsigned int current;
- unsigned int active;
- /*@}*/
- /*! linkable */
- ISC_LINK(isc_buffer_t) link;
- /*! private internal elements */
- isc_mem_t *mctx;
-};
-
-/***
- *** Functions
- ***/
-
-isc_result_t
-isc_buffer_allocate(isc_mem_t *mctx, isc_buffer_t **dynbuffer,
- unsigned int length);
-/*!<
- * \brief Allocate a dynamic linkable buffer which has "length" bytes in the
- * data region.
- *
- * Requires:
- *\li "mctx" is valid.
- *
- *\li "dynbuffer" is non-NULL, and "*dynbuffer" is NULL.
- *
- * Returns:
- *\li ISC_R_SUCCESS - success
- *\li ISC_R_NOMEMORY - no memory available
- *
- * Note:
- *\li Changing the buffer's length field is not permitted.
- */
-
-void
-isc_buffer_free(isc_buffer_t **dynbuffer);
-/*!<
- * \brief Release resources allocated for a dynamic buffer.
- *
- * Requires:
- *\li "dynbuffer" is not NULL.
- *
- *\li "*dynbuffer" is a valid dynamic buffer.
- *
- * Ensures:
- *\li "*dynbuffer" will be NULL on return, and all memory associated with
- * the dynamic buffer is returned to the memory context used in
- * isc_buffer_allocate().
- */
-
-void
-isc__buffer_init(isc_buffer_t *b, const void *base, unsigned int length);
-/*!<
- * \brief Make 'b' refer to the 'length'-byte region starting at base.
- *
- * Requires:
- *
- *\li 'length' > 0
- *
- *\li 'base' is a pointer to a sequence of 'length' bytes.
- *
- */
-
-void
-isc__buffer_initnull(isc_buffer_t *b);
-/*!<
- *\brief Initialize a buffer 'b' with a null data and zero length/
- */
-
-void
-isc_buffer_reinit(isc_buffer_t *b, void *base, unsigned int length);
-/*!<
- * \brief Make 'b' refer to the 'length'-byte region starting at base.
- * Any existing data will be copied.
- *
- * Requires:
- *
- *\li 'length' > 0 AND length >= previous length
- *
- *\li 'base' is a pointer to a sequence of 'length' bytes.
- *
- */
-
-void
-isc__buffer_invalidate(isc_buffer_t *b);
-/*!<
- * \brief Make 'b' an invalid buffer.
- *
- * Requires:
- *\li 'b' is a valid buffer.
- *
- * Ensures:
- *\li If assertion checking is enabled, future attempts to use 'b' without
- * calling isc_buffer_init() on it will cause an assertion failure.
- */
-
-void
-isc__buffer_region(isc_buffer_t *b, isc_region_t *r);
-/*!<
- * \brief Make 'r' refer to the region of 'b'.
- *
- * Requires:
- *
- *\li 'b' is a valid buffer.
- *
- *\li 'r' points to a region structure.
- */
-
-void
-isc__buffer_usedregion(isc_buffer_t *b, isc_region_t *r);
-/*!<
- * \brief Make 'r' refer to the used region of 'b'.
- *
- * Requires:
- *
- *\li 'b' is a valid buffer.
- *
- *\li 'r' points to a region structure.
- */
-
-void
-isc__buffer_availableregion(isc_buffer_t *b, isc_region_t *r);
-/*!<
- * \brief Make 'r' refer to the available region of 'b'.
- *
- * Requires:
- *
- *\li 'b' is a valid buffer.
- *
- *\li 'r' points to a region structure.
- */
-
-void
-isc__buffer_add(isc_buffer_t *b, unsigned int n);
-/*!<
- * \brief Increase the 'used' region of 'b' by 'n' bytes.
- *
- * Requires:
- *
- *\li 'b' is a valid buffer
- *
- *\li used + n <= length
- *
- */
-
-void
-isc__buffer_subtract(isc_buffer_t *b, unsigned int n);
-/*!<
- * \brief Decrease the 'used' region of 'b' by 'n' bytes.
- *
- * Requires:
- *
- *\li 'b' is a valid buffer
- *
- *\li used >= n
- *
- */
-
-void
-isc__buffer_clear(isc_buffer_t *b);
-/*!<
- * \brief Make the used region empty.
- *
- * Requires:
- *
- *\li 'b' is a valid buffer
- *
- * Ensures:
- *
- *\li used = 0
- *
- */
-
-void
-isc__buffer_consumedregion(isc_buffer_t *b, isc_region_t *r);
-/*!<
- * \brief Make 'r' refer to the consumed region of 'b'.
- *
- * Requires:
- *
- *\li 'b' is a valid buffer.
- *
- *\li 'r' points to a region structure.
- */
-
-void
-isc__buffer_remainingregion(isc_buffer_t *b, isc_region_t *r);
-/*!<
- * \brief Make 'r' refer to the remaining region of 'b'.
- *
- * Requires:
- *
- *\li 'b' is a valid buffer.
- *
- *\li 'r' points to a region structure.
- */
-
-void
-isc__buffer_activeregion(isc_buffer_t *b, isc_region_t *r);
-/*!<
- * \brief Make 'r' refer to the active region of 'b'.
- *
- * Requires:
- *
- *\li 'b' is a valid buffer.
- *
- *\li 'r' points to a region structure.
- */
-
-void
-isc__buffer_setactive(isc_buffer_t *b, unsigned int n);
-/*!<
- * \brief Sets the end of the active region 'n' bytes after current.
- *
- * Requires:
- *
- *\li 'b' is a valid buffer.
- *
- *\li current + n <= used
- */
-
-void
-isc__buffer_first(isc_buffer_t *b);
-/*!<
- * \brief Make the consumed region empty.
- *
- * Requires:
- *
- *\li 'b' is a valid buffer
- *
- * Ensures:
- *
- *\li current == 0
- *
- */
-
-void
-isc__buffer_forward(isc_buffer_t *b, unsigned int n);
-/*!<
- * \brief Increase the 'consumed' region of 'b' by 'n' bytes.
- *
- * Requires:
- *
- *\li 'b' is a valid buffer
- *
- *\li current + n <= used
- *
- */
-
-void
-isc__buffer_back(isc_buffer_t *b, unsigned int n);
-/*!<
- * \brief Decrease the 'consumed' region of 'b' by 'n' bytes.
- *
- * Requires:
- *
- *\li 'b' is a valid buffer
- *
- *\li n <= current
- *
- */
-
-void
-isc_buffer_compact(isc_buffer_t *b);
-/*!<
- * \brief Compact the used region by moving the remaining region so it occurs
- * at the start of the buffer. The used region is shrunk by the size of
- * the consumed region, and the consumed region is then made empty.
- *
- * Requires:
- *
- *\li 'b' is a valid buffer
- *
- * Ensures:
- *
- *\li current == 0
- *
- *\li The size of the used region is now equal to the size of the remaining
- * region (as it was before the call). The contents of the used region
- * are those of the remaining region (as it was before the call).
- */
-
-isc_uint8_t
-isc_buffer_getuint8(isc_buffer_t *b);
-/*!<
- * \brief Read an unsigned 8-bit integer from 'b' and return it.
- *
- * Requires:
- *
- *\li 'b' is a valid buffer.
- *
- *\li The length of the available region of 'b' is at least 1.
- *
- * Ensures:
- *
- *\li The current pointer in 'b' is advanced by 1.
- *
- * Returns:
- *
- *\li A 8-bit unsigned integer.
- */
-
-void
-isc__buffer_putuint8(isc_buffer_t *b, isc_uint8_t val);
-/*!<
- * \brief Store an unsigned 8-bit integer from 'val' into 'b'.
- *
- * Requires:
- *\li 'b' is a valid buffer.
- *
- *\li The length of the unused region of 'b' is at least 1.
- *
- * Ensures:
- *\li The used pointer in 'b' is advanced by 1.
- */
-
-isc_uint16_t
-isc_buffer_getuint16(isc_buffer_t *b);
-/*!<
- * \brief Read an unsigned 16-bit integer in network byte order from 'b', convert
- * it to host byte order, and return it.
- *
- * Requires:
- *
- *\li 'b' is a valid buffer.
- *
- *\li The length of the available region of 'b' is at least 2.
- *
- * Ensures:
- *
- *\li The current pointer in 'b' is advanced by 2.
- *
- * Returns:
- *
- *\li A 16-bit unsigned integer.
- */
-
-void
-isc__buffer_putuint16(isc_buffer_t *b, isc_uint16_t val);
-/*!<
- * \brief Store an unsigned 16-bit integer in host byte order from 'val'
- * into 'b' in network byte order.
- *
- * Requires:
- *\li 'b' is a valid buffer.
- *
- *\li The length of the unused region of 'b' is at least 2.
- *
- * Ensures:
- *\li The used pointer in 'b' is advanced by 2.
- */
-
-isc_uint32_t
-isc_buffer_getuint32(isc_buffer_t *b);
-/*!<
- * \brief Read an unsigned 32-bit integer in network byte order from 'b', convert
- * it to host byte order, and return it.
- *
- * Requires:
- *
- *\li 'b' is a valid buffer.
- *
- *\li The length of the available region of 'b' is at least 4.
- *
- * Ensures:
- *
- *\li The current pointer in 'b' is advanced by 4.
- *
- * Returns:
- *
- *\li A 32-bit unsigned integer.
- */
-
-void
-isc__buffer_putuint32(isc_buffer_t *b, isc_uint32_t val);
-/*!<
- * \brief Store an unsigned 32-bit integer in host byte order from 'val'
- * into 'b' in network byte order.
- *
- * Requires:
- *\li 'b' is a valid buffer.
- *
- *\li The length of the unused region of 'b' is at least 4.
- *
- * Ensures:
- *\li The used pointer in 'b' is advanced by 4.
- */
-
-isc_uint64_t
-isc_buffer_getuint48(isc_buffer_t *b);
-/*!<
- * \brief Read an unsigned 48-bit integer in network byte order from 'b',
- * convert it to host byte order, and return it.
- *
- * Requires:
- *
- *\li 'b' is a valid buffer.
- *
- *\li The length of the available region of 'b' is at least 6.
- *
- * Ensures:
- *
- *\li The current pointer in 'b' is advanced by 6.
- *
- * Returns:
- *
- *\li A 48-bit unsigned integer (stored in a 64-bit integer).
- */
-
-void
-isc__buffer_putuint48(isc_buffer_t *b, isc_uint64_t val);
-/*!<
- * \brief Store an unsigned 48-bit integer in host byte order from 'val'
- * into 'b' in network byte order.
- *
- * Requires:
- *\li 'b' is a valid buffer.
- *
- *\li The length of the unused region of 'b' is at least 6.
- *
- * Ensures:
- *\li The used pointer in 'b' is advanced by 6.
- */
-
-void
-isc__buffer_putuint24(isc_buffer_t *b, isc_uint32_t val);
-/*!<
- * Store an unsigned 24-bit integer in host byte order from 'val'
- * into 'b' in network byte order.
- *
- * Requires:
- *\li 'b' is a valid buffer.
- *
- * The length of the unused region of 'b' is at least 3.
- *
- * Ensures:
- *\li The used pointer in 'b' is advanced by 3.
- */
-
-void
-isc__buffer_putmem(isc_buffer_t *b, const unsigned char *base,
- unsigned int length);
-/*!<
- * \brief Copy 'length' bytes of memory at 'base' into 'b'.
- *
- * Requires:
- *\li 'b' is a valid buffer.
- *
- *\li 'base' points to 'length' bytes of valid memory.
- *
- */
-
-void
-isc__buffer_putstr(isc_buffer_t *b, const char *source);
-/*!<
- * \brief Copy 'source' into 'b', not including terminating NUL.
- *
- * Requires:
- *\li 'b' is a valid buffer.
- *
- *\li 'source' to be a valid NULL terminated string.
- *
- *\li strlen(source) <= isc_buffer_available(b)
- */
-
-isc_result_t
-isc_buffer_copyregion(isc_buffer_t *b, const isc_region_t *r);
-/*!<
- * \brief Copy the contents of 'r' into 'b'.
- *
- * Requires:
- *\li 'b' is a valid buffer.
- *
- *\li 'r' is a valid region.
- *
- * Returns:
- *
- *\li ISC_R_SUCCESS
- *\li ISC_R_NOSPACE The available region of 'b' is not
- * big enough.
- */
-
-ISC_LANG_ENDDECLS
-
-/*
- * Inline macro versions of the functions. These should never be called
- * directly by an application, but will be used by the functions within
- * buffer.c. The callers should always use "isc_buffer_*()" names, never
- * ones beginning with "isc__"
- */
-
-/*! \note
- * XXXDCL Something more could be done with initializing buffers that
- * point to const data. For example, a new function, isc_buffer_initconst,
- * could be used, and a new boolean flag in the buffer structure could
- * indicate whether the buffer was initialized with that function.
- * (isc_bufer_init itself would be reprototyped to *not* have its "base"
- * parameter be const.) Then if the boolean were true, the isc_buffer_put*
- * functions could assert a contractual requirement for a non-const buffer.
- * One drawback is that the isc_buffer_* functions (macros) that return
- * pointers would still need to return non-const pointers to avoid compiler
- * warnings, so it would be up to code that uses them to have to deal
- * with the possibility that the buffer was initialized as const --
- * a problem that they *already* have to deal with but have absolutely
- * no ability to. With a new isc_buffer_isconst() function returning
- * true/false, they could at least assert a contractual requirement for
- * non-const buffers when needed.
- */
-#define ISC__BUFFER_INIT(_b, _base, _length) \
- do { \
- union { \
- const void * konst; \
- void * var; \
- } _u; \
- _u.konst = (_base); \
- (_b)->base = _u.var; \
- (_b)->length = (_length); \
- (_b)->used = 0; \
- (_b)->current = 0; \
- (_b)->active = 0; \
- (_b)->mctx = NULL; \
- ISC_LINK_INIT(_b, link); \
- (_b)->magic = ISC_BUFFER_MAGIC; \
- } while (0)
-
-#define ISC__BUFFER_INITNULL(_b) ISC__BUFFER_INIT(_b, NULL, 0)
-
-#define ISC__BUFFER_INVALIDATE(_b) \
- do { \
- (_b)->magic = 0; \
- (_b)->base = NULL; \
- (_b)->length = 0; \
- (_b)->used = 0; \
- (_b)->current = 0; \
- (_b)->active = 0; \
- } while (0)
-
-#define ISC__BUFFER_REGION(_b, _r) \
- do { \
- (_r)->base = (_b)->base; \
- (_r)->length = (_b)->length; \
- } while (0)
-
-#define ISC__BUFFER_USEDREGION(_b, _r) \
- do { \
- (_r)->base = (_b)->base; \
- (_r)->length = (_b)->used; \
- } while (0)
-
-#define ISC__BUFFER_AVAILABLEREGION(_b, _r) \
- do { \
- (_r)->base = isc_buffer_used(_b); \
- (_r)->length = isc_buffer_availablelength(_b); \
- } while (0)
-
-#define ISC__BUFFER_ADD(_b, _n) \
- do { \
- (_b)->used += (_n); \
- } while (0)
-
-#define ISC__BUFFER_SUBTRACT(_b, _n) \
- do { \
- (_b)->used -= (_n); \
- if ((_b)->current > (_b)->used) \
- (_b)->current = (_b)->used; \
- if ((_b)->active > (_b)->used) \
- (_b)->active = (_b)->used; \
- } while (0)
-
-#define ISC__BUFFER_CLEAR(_b) \
- do { \
- (_b)->used = 0; \
- (_b)->current = 0; \
- (_b)->active = 0; \
- } while (0)
-
-#define ISC__BUFFER_CONSUMEDREGION(_b, _r) \
- do { \
- (_r)->base = (_b)->base; \
- (_r)->length = (_b)->current; \
- } while (0)
-
-#define ISC__BUFFER_REMAININGREGION(_b, _r) \
- do { \
- (_r)->base = isc_buffer_current(_b); \
- (_r)->length = isc_buffer_remaininglength(_b); \
- } while (0)
-
-#define ISC__BUFFER_ACTIVEREGION(_b, _r) \
- do { \
- if ((_b)->current < (_b)->active) { \
- (_r)->base = isc_buffer_current(_b); \
- (_r)->length = isc_buffer_activelength(_b); \
- } else { \
- (_r)->base = NULL; \
- (_r)->length = 0; \
- } \
- } while (0)
-
-#define ISC__BUFFER_SETACTIVE(_b, _n) \
- do { \
- (_b)->active = (_b)->current + (_n); \
- } while (0)
-
-#define ISC__BUFFER_FIRST(_b) \
- do { \
- (_b)->current = 0; \
- } while (0)
-
-#define ISC__BUFFER_FORWARD(_b, _n) \
- do { \
- (_b)->current += (_n); \
- } while (0)
-
-#define ISC__BUFFER_BACK(_b, _n) \
- do { \
- (_b)->current -= (_n); \
- } while (0)
-
-#define ISC__BUFFER_PUTMEM(_b, _base, _length) \
- do { \
- memcpy(isc_buffer_used(_b), (_base), (_length)); \
- (_b)->used += (_length); \
- } while (0)
-
-#define ISC__BUFFER_PUTSTR(_b, _source) \
- do { \
- unsigned int _length; \
- unsigned char *_cp; \
- _length = strlen(_source); \
- _cp = isc_buffer_used(_b); \
- memcpy(_cp, (_source), _length); \
- (_b)->used += (_length); \
- } while (0)
-
-#define ISC__BUFFER_PUTUINT8(_b, _val) \
- do { \
- unsigned char *_cp; \
- isc_uint8_t _val2 = (_val); \
- _cp = isc_buffer_used(_b); \
- (_b)->used++; \
- _cp[0] = _val2 & 0x00ff; \
- } while (0)
-
-#define ISC__BUFFER_PUTUINT16(_b, _val) \
- do { \
- unsigned char *_cp; \
- isc_uint16_t _val2 = (_val); \
- _cp = isc_buffer_used(_b); \
- (_b)->used += 2; \
- _cp[0] = (unsigned char)((_val2 & 0xff00U) >> 8); \
- _cp[1] = (unsigned char)(_val2 & 0x00ffU); \
- } while (0)
-
-#define ISC__BUFFER_PUTUINT24(_b, _val) \
- do { \
- unsigned char *_cp; \
- isc_uint32_t _val2 = (_val); \
- _cp = isc_buffer_used(_b); \
- (_b)->used += 3; \
- _cp[0] = (unsigned char)((_val2 & 0xff0000U) >> 16); \
- _cp[1] = (unsigned char)((_val2 & 0xff00U) >> 8); \
- _cp[2] = (unsigned char)(_val2 & 0x00ffU); \
- } while (0)
-
-#define ISC__BUFFER_PUTUINT32(_b, _val) \
- do { \
- unsigned char *_cp; \
- isc_uint32_t _val2 = (_val); \
- _cp = isc_buffer_used(_b); \
- (_b)->used += 4; \
- _cp[0] = (unsigned char)((_val2 & 0xff000000) >> 24); \
- _cp[1] = (unsigned char)((_val2 & 0x00ff0000) >> 16); \
- _cp[2] = (unsigned char)((_val2 & 0x0000ff00) >> 8); \
- _cp[3] = (unsigned char)((_val2 & 0x000000ff)); \
- } while (0)
-
-#if defined(ISC_BUFFER_USEINLINE)
-#define isc_buffer_init ISC__BUFFER_INIT
-#define isc_buffer_initnull ISC__BUFFER_INITNULL
-#define isc_buffer_invalidate ISC__BUFFER_INVALIDATE
-#define isc_buffer_region ISC__BUFFER_REGION
-#define isc_buffer_usedregion ISC__BUFFER_USEDREGION
-#define isc_buffer_availableregion ISC__BUFFER_AVAILABLEREGION
-#define isc_buffer_add ISC__BUFFER_ADD
-#define isc_buffer_subtract ISC__BUFFER_SUBTRACT
-#define isc_buffer_clear ISC__BUFFER_CLEAR
-#define isc_buffer_consumedregion ISC__BUFFER_CONSUMEDREGION
-#define isc_buffer_remainingregion ISC__BUFFER_REMAININGREGION
-#define isc_buffer_activeregion ISC__BUFFER_ACTIVEREGION
-#define isc_buffer_setactive ISC__BUFFER_SETACTIVE
-#define isc_buffer_first ISC__BUFFER_FIRST
-#define isc_buffer_forward ISC__BUFFER_FORWARD
-#define isc_buffer_back ISC__BUFFER_BACK
-#define isc_buffer_putmem ISC__BUFFER_PUTMEM
-#define isc_buffer_putstr ISC__BUFFER_PUTSTR
-#define isc_buffer_putuint8 ISC__BUFFER_PUTUINT8
-#define isc_buffer_putuint16 ISC__BUFFER_PUTUINT16
-#define isc_buffer_putuint24 ISC__BUFFER_PUTUINT24
-#define isc_buffer_putuint32 ISC__BUFFER_PUTUINT32
-#else
-#define isc_buffer_init isc__buffer_init
-#define isc_buffer_initnull isc__buffer_initnull
-#define isc_buffer_invalidate isc__buffer_invalidate
-#define isc_buffer_region isc__buffer_region
-#define isc_buffer_usedregion isc__buffer_usedregion
-#define isc_buffer_availableregion isc__buffer_availableregion
-#define isc_buffer_add isc__buffer_add
-#define isc_buffer_subtract isc__buffer_subtract
-#define isc_buffer_clear isc__buffer_clear
-#define isc_buffer_consumedregion isc__buffer_consumedregion
-#define isc_buffer_remainingregion isc__buffer_remainingregion
-#define isc_buffer_activeregion isc__buffer_activeregion
-#define isc_buffer_setactive isc__buffer_setactive
-#define isc_buffer_first isc__buffer_first
-#define isc_buffer_forward isc__buffer_forward
-#define isc_buffer_back isc__buffer_back
-#define isc_buffer_putmem isc__buffer_putmem
-#define isc_buffer_putstr isc__buffer_putstr
-#define isc_buffer_putuint8 isc__buffer_putuint8
-#define isc_buffer_putuint16 isc__buffer_putuint16
-#define isc_buffer_putuint24 isc__buffer_putuint24
-#define isc_buffer_putuint32 isc__buffer_putuint32
-#endif
-
-/*
- * No inline method for this one (yet).
- */
-#define isc_buffer_putuint48 isc__buffer_putuint48
-
-#endif /* ISC_BUFFER_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: bufferlist.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_BUFFERLIST_H
-#define ISC_BUFFERLIST_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isc/bufferlist.h
- *
- *
- *\brief Buffer lists have no synchronization. Clients must ensure exclusive
- * access.
- *
- * \li Reliability:
- * No anticipated impact.
-
- * \li Security:
- * No anticipated impact.
- *
- * \li Standards:
- * None.
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Functions
- ***/
-
-unsigned int
-isc_bufferlist_usedcount(isc_bufferlist_t *bl);
-/*!<
- * \brief Return the length of the sum of all used regions of all buffers in
- * the buffer list 'bl'
- *
- * Requires:
- *
- *\li 'bl' is not NULL.
- *
- * Returns:
- *\li sum of all used regions' lengths.
- */
-
-unsigned int
-isc_bufferlist_availablecount(isc_bufferlist_t *bl);
-/*!<
- * \brief Return the length of the sum of all available regions of all buffers in
- * the buffer list 'bl'
- *
- * Requires:
- *
- *\li 'bl' is not NULL.
- *
- * Returns:
- *\li sum of all available regions' lengths.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_BUFFERLIST_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: commandline.h,v 1.16 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_COMMANDLINE_H
-#define ISC_COMMANDLINE_H 1
-
-/*! \file isc/commandline.h */
-
-#include <isc/boolean.h>
-#include <isc/lang.h>
-#include <isc/platform.h>
-
-/*% Index into parent argv vector. */
-LIBISC_EXTERNAL_DATA extern int isc_commandline_index;
-/*% Character checked for validity. */
-LIBISC_EXTERNAL_DATA extern int isc_commandline_option;
-/*% Argument associated with option. */
-LIBISC_EXTERNAL_DATA extern char *isc_commandline_argument;
-/*% For printing error messages. */
-LIBISC_EXTERNAL_DATA extern char *isc_commandline_progname;
-/*% Print error message. */
-LIBISC_EXTERNAL_DATA extern isc_boolean_t isc_commandline_errprint;
-/*% Reset getopt. */
-LIBISC_EXTERNAL_DATA extern isc_boolean_t isc_commandline_reset;
-
-ISC_LANG_BEGINDECLS
-
-/*% parse command line */
-int
-isc_commandline_parse(int argc, char * const *argv, const char *options);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_COMMANDLINE_H */
+++ /dev/null
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: condition.h,v 1.26 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_CONDITION_H
-#define ISC_CONDITION_H 1
-
-/*! \file */
-
-#include <isc/lang.h>
-#include <isc/mutex.h>
-#include <isc/result.h>
-#include <isc/types.h>
-
-typedef pthread_cond_t isc_condition_t;
-
-#define isc_condition_init(cp) \
- ((pthread_cond_init((cp), NULL) == 0) ? \
- ISC_R_SUCCESS : ISC_R_UNEXPECTED)
-
-#if ISC_MUTEX_PROFILE
-#define isc_condition_wait(cp, mp) \
- ((pthread_cond_wait((cp), &((mp)->mutex)) == 0) ? \
- ISC_R_SUCCESS : ISC_R_UNEXPECTED)
-#else
-#define isc_condition_wait(cp, mp) \
- ((pthread_cond_wait((cp), (mp)) == 0) ? \
- ISC_R_SUCCESS : ISC_R_UNEXPECTED)
-#endif
-
-#define isc_condition_signal(cp) \
- ((pthread_cond_signal((cp)) == 0) ? \
- ISC_R_SUCCESS : ISC_R_UNEXPECTED)
-
-#define isc_condition_broadcast(cp) \
- ((pthread_cond_broadcast((cp)) == 0) ? \
- ISC_R_SUCCESS : ISC_R_UNEXPECTED)
-
-#define isc_condition_destroy(cp) \
- ((pthread_cond_destroy((cp)) == 0) ? \
- ISC_R_SUCCESS : ISC_R_UNEXPECTED)
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-isc_condition_waituntil(isc_condition_t *, isc_mutex_t *, isc_time_t *);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_CONDITION_H */
+++ /dev/null
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: dir.h,v 1.21 2007/06/19 23:47:19 tbox Exp $ */
-
-/* Principal Authors: DCL */
-
-#ifndef ISC_DIR_H
-#define ISC_DIR_H 1
-
-/*! \file */
-
-#include <sys/types.h> /* Required on some systems. */
-#include <dirent.h>
-
-#include <isc/lang.h>
-#include <isc/result.h>
-
-#define ISC_DIR_NAMEMAX 256
-#define ISC_DIR_PATHMAX 1024
-
-/*% Directory Entry */
-typedef struct isc_direntry {
- /*!
- * Ideally, this should be NAME_MAX, but AIX does not define it by
- * default and dynamically allocating the space based on pathconf()
- * complicates things undesirably, as does adding special conditionals
- * just for AIX. So a comfortably sized buffer is chosen instead.
- */
- char name[ISC_DIR_NAMEMAX];
- unsigned int length;
-} isc_direntry_t;
-
-/*% Directory */
-typedef struct isc_dir {
- unsigned int magic;
- /*!
- * As with isc_direntry_t->name, making this "right" for all systems
- * is slightly problematic because AIX does not define PATH_MAX.
- */
- char dirname[ISC_DIR_PATHMAX];
- isc_direntry_t entry;
- DIR * handle;
-} isc_dir_t;
-
-ISC_LANG_BEGINDECLS
-
-void
-isc_dir_init(isc_dir_t *dir);
-
-isc_result_t
-isc_dir_open(isc_dir_t *dir, const char *dirname);
-
-isc_result_t
-isc_dir_read(isc_dir_t *dir);
-
-isc_result_t
-isc_dir_reset(isc_dir_t *dir);
-
-void
-isc_dir_close(isc_dir_t *dir);
-
-isc_result_t
-isc_dir_chdir(const char *dirname);
-
-isc_result_t
-isc_dir_chroot(const char *dirname);
-
-isc_result_t
-isc_dir_createunique(char *templet);
-/*!<
- * Use a templet (such as from isc_file_mktemplate()) to create a uniquely
- * named, empty directory. The templet string is modified in place.
- * If result == ISC_R_SUCCESS, it is the name of the directory that was
- * created.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_DIR_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: entropy.h,v 1.32.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef ISC_ENTROPY_H
-#define ISC_ENTROPY_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isc/entropy.h
- * \brief The entropy API
- *
- * \li MP:
- * The entropy object is locked internally. All callbacks into
- * application-provided functions (for setup, gathering, and
- * shutdown of sources) are guaranteed to be called with the
- * entropy API lock held. This means these functions are
- * not permitted to call back into the entropy API.
- *
- * \li Reliability:
- * No anticipated impact.
- *
- * \li Resources:
- * A buffer, used as an entropy pool.
- *
- * \li Security:
- * While this code is believed to implement good entropy gathering
- * and distribution, it has not been reviewed by a cryptographic
- * expert.
- * Since the added entropy is only as good as the sources used,
- * this module could hand out bad data and never know it.
- *
- * \li Standards:
- * None.
- */
-
-/***
- *** Imports
- ***/
-
-#include <stdio.h>
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-/*@{*/
-/*% Entropy callback function. */
-typedef isc_result_t (*isc_entropystart_t)(isc_entropysource_t *source,
- void *arg, isc_boolean_t blocking);
-typedef isc_result_t (*isc_entropyget_t)(isc_entropysource_t *source,
- void *arg, isc_boolean_t blocking);
-typedef void (*isc_entropystop_t)(isc_entropysource_t *source, void *arg);
-/*@}*/
-
-/***
- *** Flags.
- ***/
-
-/*!
- * \brief
- * Extract only "good" data; return failure if there is not enough
- * data available and there are no sources which we can poll to get
- * data, or those sources are empty.
- *
- *
- */
-#define ISC_ENTROPY_GOODONLY 0x00000001U
-/*!
- * \brief
- * Extract as much good data as possible, but if there isn't enough
- * at hand, return what is available. This flag only makes sense
- * when used with _GOODONLY.
- */
-#define ISC_ENTROPY_PARTIAL 0x00000002U
-/*!
- * \brief
- * Block the task until data is available. This is contrary to the
- * ISC task system, where tasks should never block. However, if
- * this is a special purpose application where blocking a task is
- * acceptable (say, an offline zone signer) this flag may be set.
- * This flag only makes sense when used with _GOODONLY, and will
- * block regardless of the setting for _PARTIAL.
- */
-#define ISC_ENTROPY_BLOCKING 0x00000004U
-
-/*!
- * \brief
- * Estimate the amount of entropy contained in the sample pool.
- * If this is not set, the source will be gathered and periodically
- * mixed into the entropy pool, but no increment in contained entropy
- * will be assumed. This flag only makes sense on sample sources.
- */
-#define ISC_ENTROPYSOURCE_ESTIMATE 0x00000001U
-
-/*
- * For use with isc_entropy_usebestsource().
- */
-/*!
- * \brief
- * Use the keyboard as the only entropy source.
- */
-#define ISC_ENTROPY_KEYBOARDYES 1
-/*!
- * \brief
- * Never use the keyboard as an entropy source.
- */
-#define ISC_ENTROPY_KEYBOARDNO 2
-/*!
- * \brief
- * Use the keyboard as an entropy source only if opening the
- * random device fails.
- */
-#define ISC_ENTROPY_KEYBOARDMAYBE 3
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Functions
- ***/
-
-isc_result_t
-isc_entropy_create(isc_mem_t *mctx, isc_entropy_t **entp);
-/*!<
- * \brief Create a new entropy object.
- */
-
-void
-isc_entropy_attach(isc_entropy_t *ent, isc_entropy_t **entp);
-/*!<
- * Attaches to an entropy object.
- */
-
-void
-isc_entropy_detach(isc_entropy_t **entp);
-/*!<
- * \brief Detaches from an entropy object.
- */
-
-isc_result_t
-isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname);
-/*!<
- * \brief Create a new entropy source from a file.
- *
- * The file is assumed to contain good randomness, and will be mixed directly
- * into the pool with every byte adding 8 bits of entropy.
- *
- * The file will be put into non-blocking mode, so it may be a device file,
- * such as /dev/random. /dev/urandom should not be used here if it can
- * be avoided, since it will always provide data even if it isn't good.
- * We will make as much pseudorandom data as we need internally if our
- * caller asks for it.
- *
- * If we hit end-of-file, we will stop reading from this source. Callers
- * who require strong random data will get failure when our pool drains.
- * The file will never be opened/read again once EOF is reached.
- */
-
-void
-isc_entropy_destroysource(isc_entropysource_t **sourcep);
-/*!<
- * \brief Removes an entropy source from the entropy system.
- */
-
-isc_result_t
-isc_entropy_createsamplesource(isc_entropy_t *ent,
- isc_entropysource_t **sourcep);
-/*!<
- * \brief Create an entropy source that consists of samples. Each sample is added
- * to the source via isc_entropy_addsamples(), below.
- */
-
-isc_result_t
-isc_entropy_createcallbacksource(isc_entropy_t *ent,
- isc_entropystart_t start,
- isc_entropyget_t get,
- isc_entropystop_t stop,
- void *arg,
- isc_entropysource_t **sourcep);
-/*!<
- * \brief Create an entropy source that is polled via a callback.
- *
- * This would
- * be used when keyboard input is used, or a GUI input method. It can
- * also be used to hook in any external entropy source.
- *
- * Samples are added via isc_entropy_addcallbacksample(), below.
- * _addcallbacksample() is the only function which may be called from
- * within an entropy API callback function.
- */
-
-void
-isc_entropy_stopcallbacksources(isc_entropy_t *ent);
-/*!<
- * \brief Call the stop functions for callback sources that have had their
- * start functions called.
- */
-
-/*@{*/
-isc_result_t
-isc_entropy_addcallbacksample(isc_entropysource_t *source, isc_uint32_t sample,
- isc_uint32_t extra);
-isc_result_t
-isc_entropy_addsample(isc_entropysource_t *source, isc_uint32_t sample,
- isc_uint32_t extra);
-/*!<
- * \brief Add a sample to the sample source.
- *
- * The sample MUST be a timestamp
- * that increases over time, with the exception of wrap-around for
- * extremely high resolution timers which will quickly wrap-around
- * a 32-bit integer.
- *
- * The "extra" parameter is used only to add a bit more unpredictable
- * data. It is not used other than included in the hash of samples.
- *
- * When in an entropy API callback function, _addcallbacksource() must be
- * used. At all other times, _addsample() must be used.
- */
-/*@}*/
-
-isc_result_t
-isc_entropy_getdata(isc_entropy_t *ent, void *data, unsigned int length,
- unsigned int *returned, unsigned int flags);
-/*!<
- * \brief Extract data from the entropy pool. This may load the pool from various
- * sources.
- *
- * Do this by stiring the pool and returning a part of hash as randomness.
- * Note that no secrets are given away here since parts of the hash are
- * xored together before returned.
- *
- * Honor the request from the caller to only return good data, any data,
- * etc.
- */
-
-void
-isc_entropy_putdata(isc_entropy_t *ent, void *data, unsigned int length,
- isc_uint32_t entropy);
-/*!<
- * \brief Add "length" bytes in "data" to the entropy pool, incrementing the pool's
- * entropy count by "entropy."
- *
- * These bytes will prime the pseudorandom portion even no entropy is actually
- * added.
- */
-
-void
-isc_entropy_stats(isc_entropy_t *ent, FILE *out);
-/*!<
- * \brief Dump some (trivial) stats to the stdio stream "out".
- */
-
-unsigned int
-isc_entropy_status(isc_entropy_t *end);
-/*
- * Returns the number of bits the pool currently contains. This is just
- * an estimate.
- */
-
-isc_result_t
-isc_entropy_usebestsource(isc_entropy_t *ectx, isc_entropysource_t **source,
- const char *randomfile, int use_keyboard);
-/*!<
- * \brief Use whatever source of entropy is best.
- *
- * Notes:
- *\li If "randomfile" is not NULL, open it with
- * isc_entropy_createfilesource().
- *
- *\li If "randomfile" is NULL and the system's random device was detected
- * when the program was configured and built, open that device with
- * isc_entropy_createfilesource().
- *
- *\li If "use_keyboard" is #ISC_ENTROPY_KEYBOARDYES, then always open
- * the keyboard as an entropy source (possibly in addition to
- * "randomfile" or the random device).
- *
- *\li If "use_keyboard" is #ISC_ENTROPY_KEYBOARDMAYBE, open the keyboard only
- * if opening the random file/device fails. A message will be
- * printed describing the need for keyboard input.
- *
- *\li If "use_keyboard" is #ISC_ENTROPY_KEYBOARDNO, the keyboard will
- * never be opened.
- *
- * Returns:
- *\li #ISC_R_SUCCESS if at least one source of entropy could be started.
- *
- *\li #ISC_R_NOENTROPY if use_keyboard is #ISC_ENTROPY_KEYBOARDNO and
- * there is no random device pathname compiled into the program.
- *
- *\li A return code from isc_entropy_createfilesource() or
- * isc_entropy_createcallbacksource().
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_ENTROPY_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: error.h,v 1.20 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_ERROR_H
-#define ISC_ERROR_H 1
-
-/*! \file isc/error.h */
-
-#include <stdarg.h>
-
-#include <isc/formatcheck.h>
-#include <isc/lang.h>
-
-ISC_LANG_BEGINDECLS
-
-typedef void (*isc_errorcallback_t)(const char *, int, const char *, va_list);
-
-/*% set unexpected error */
-void
-isc_error_setunexpected(isc_errorcallback_t);
-
-/*% set fatal error */
-void
-isc_error_setfatal(isc_errorcallback_t);
-
-/*% unexpected error */
-void
-isc_error_unexpected(const char *, int, const char *, ...)
- ISC_FORMAT_PRINTF(3, 4);
-
-/*% fatal error */
-void
-isc_error_fatal(const char *, int, const char *, ...)
- ISC_FORMAT_PRINTF(3, 4);
-
-/*% runtimecheck error */
-void
-isc_error_runtimecheck(const char *, int, const char *);
-
-#define ISC_ERROR_RUNTIMECHECK(cond) \
- ((void) ((cond) || \
- ((isc_error_runtimecheck)(__FILE__, __LINE__, #cond), 0)))
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_ERROR_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: event.h,v 1.34 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_EVENT_H
-#define ISC_EVENT_H 1
-
-/*! \file isc/event.h */
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-/*****
- ***** Events.
- *****/
-
-typedef void (*isc_eventdestructor_t)(isc_event_t *);
-
-#define ISC_EVENT_COMMON(ltype) \
- size_t ev_size; \
- unsigned int ev_attributes; \
- void * ev_tag; \
- isc_eventtype_t ev_type; \
- isc_taskaction_t ev_action; \
- void * ev_arg; \
- void * ev_sender; \
- isc_eventdestructor_t ev_destroy; \
- void * ev_destroy_arg; \
- ISC_LINK(ltype) ev_link
-
-/*%
- * Attributes matching a mask of 0x000000ff are reserved for the task library's
- * definition. Attributes of 0xffffff00 may be used by the application
- * or non-ISC libraries.
- */
-#define ISC_EVENTATTR_NOPURGE 0x00000001
-
-/*%
- * The ISC_EVENTATTR_CANCELED attribute is intended to indicate
- * that an event is delivered as a result of a canceled operation
- * rather than successful completion, by mutual agreement
- * between the sender and receiver. It is not set or used by
- * the task system.
- */
-#define ISC_EVENTATTR_CANCELED 0x00000002
-
-#define ISC_EVENT_INIT(event, sz, at, ta, ty, ac, ar, sn, df, da) \
-do { \
- (event)->ev_size = (sz); \
- (event)->ev_attributes = (at); \
- (event)->ev_tag = (ta); \
- (event)->ev_type = (ty); \
- (event)->ev_action = (ac); \
- (event)->ev_arg = (ar); \
- (event)->ev_sender = (sn); \
- (event)->ev_destroy = (df); \
- (event)->ev_destroy_arg = (da); \
- ISC_LINK_INIT((event), ev_link); \
-} while (0)
-
-/*%
- * This structure is public because "subclassing" it may be useful when
- * defining new event types.
- */
-struct isc_event {
- ISC_EVENT_COMMON(struct isc_event);
-};
-
-#define ISC_EVENTTYPE_FIRSTEVENT 0x00000000
-#define ISC_EVENTTYPE_LASTEVENT 0xffffffff
-
-#define ISC_EVENT_PTR(p) ((isc_event_t **)(void *)(p))
-
-ISC_LANG_BEGINDECLS
-
-isc_event_t *
-isc_event_allocate(isc_mem_t *mctx, void *sender, isc_eventtype_t type,
- isc_taskaction_t action, const void *arg, size_t size);
-/*%<
- * Allocate an event structure.
- *
- * Allocate and initialize in a structure with initial elements
- * defined by:
- *
- * \code
- * struct {
- * ISC_EVENT_COMMON(struct isc_event);
- * ...
- * };
- * \endcode
- *
- * Requires:
- *\li 'size' >= sizeof(struct isc_event)
- *\li 'action' to be non NULL
- *
- * Returns:
- *\li a pointer to a initialized structure of the requested size.
- *\li NULL if unable to allocate memory.
- */
-
-void
-isc_event_free(isc_event_t **);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_EVENT_H */
+++ /dev/null
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: eventclass.h,v 1.18 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_EVENTCLASS_H
-#define ISC_EVENTCLASS_H 1
-
-/*! \file isc/eventclass.h
- ***** Registry of Predefined Event Type Classes
- *****/
-
-/*%
- * An event class is an unsigned 16 bit number. Each class may contain up
- * to 65536 events. An event type is formed by adding the event number
- * within the class to the class number.
- *
- */
-
-#define ISC_EVENTCLASS(eclass) ((eclass) << 16)
-
-/*@{*/
-/*!
- * Classes < 1024 are reserved for ISC use.
- * Event classes >= 1024 and <= 65535 are reserved for application use.
- */
-
-#define ISC_EVENTCLASS_TASK ISC_EVENTCLASS(0)
-#define ISC_EVENTCLASS_TIMER ISC_EVENTCLASS(1)
-#define ISC_EVENTCLASS_SOCKET ISC_EVENTCLASS(2)
-#define ISC_EVENTCLASS_FILE ISC_EVENTCLASS(3)
-#define ISC_EVENTCLASS_DNS ISC_EVENTCLASS(4)
-#define ISC_EVENTCLASS_APP ISC_EVENTCLASS(5)
-#define ISC_EVENTCLASS_OMAPI ISC_EVENTCLASS(6)
-#define ISC_EVENTCLASS_RATELIMITER ISC_EVENTCLASS(7)
-#define ISC_EVENTCLASS_ISCCC ISC_EVENTCLASS(8)
-/*@}*/
-
-#endif /* ISC_EVENTCLASS_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: file.h,v 1.33.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef ISC_FILE_H
-#define ISC_FILE_H 1
-
-/*! \file isc/file.h */
-
-#include <stdio.h>
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-isc_file_settime(const char *file, isc_time_t *time);
-
-isc_result_t
-isc_file_getmodtime(const char *file, isc_time_t *time);
-/*!<
- * \brief Get the time of last modification of a file.
- *
- * Notes:
- *\li The time that is set is relative to the (OS-specific) epoch, as are
- * all isc_time_t structures.
- *
- * Requires:
- *\li file != NULL.
- *\li time != NULL.
- *
- * Ensures:
- *\li If the file could not be accessed, 'time' is unchanged.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- * Success.
- *\li #ISC_R_NOTFOUND
- * No such file exists.
- *\li #ISC_R_INVALIDFILE
- * The path specified was not usable by the operating system.
- *\li #ISC_R_NOPERM
- * The file's metainformation could not be retrieved because
- * permission was denied to some part of the file's path.
- *\li #ISC_R_EIO
- * Hardware error interacting with the filesystem.
- *\li #ISC_R_UNEXPECTED
- * Something totally unexpected happened.
- *
- */
-
-isc_result_t
-isc_file_mktemplate(const char *path, char *buf, size_t buflen);
-/*!<
- * \brief Generate a template string suitable for use with isc_file_openunique().
- *
- * Notes:
- *\li This function is intended to make creating temporary files
- * portable between different operating systems.
- *
- *\li The path is prepended to an implementation-defined string and
- * placed into buf. The string has no path characters in it,
- * and its maximum length is 14 characters plus a NUL. Thus
- * buflen should be at least strlen(path) + 15 characters or
- * an error will be returned.
- *
- * Requires:
- *\li buf != NULL.
- *
- * Ensures:
- *\li If result == #ISC_R_SUCCESS:
- * buf contains a string suitable for use as the template argument
- * to isc_file_openunique().
- *
- *\li If result != #ISC_R_SUCCESS:
- * buf is unchanged.
- *
- * Returns:
- *\li #ISC_R_SUCCESS Success.
- *\li #ISC_R_NOSPACE buflen indicates buf is too small for the catenation
- * of the path with the internal template string.
- */
-
-
-isc_result_t
-isc_file_openunique(char *templet, FILE **fp);
-/*!<
- * \brief Create and open a file with a unique name based on 'templet'.
- *
- * Notes:
- *\li 'template' is a reserved work in C++. If you want to complain
- * about the spelling of 'templet', first look it up in the
- * Merriam-Webster English dictionary. (http://www.m-w.com/)
- *
- *\li This function works by using the template to generate file names.
- * The template must be a writable string, as it is modified in place.
- * Trailing X characters in the file name (full file name on Unix,
- * basename on Win32 -- eg, tmp-XXXXXX vs XXXXXX.tmp, respectively)
- * are replaced with ASCII characters until a non-existent filename
- * is found. If the template does not include pathname information,
- * the files in the working directory of the program are searched.
- *
- *\li isc_file_mktemplate is a good, portable way to get a template.
- *
- * Requires:
- *\li 'fp' is non-NULL and '*fp' is NULL.
- *
- *\li 'template' is non-NULL, and of a form suitable for use by
- * the system as described above.
- *
- * Ensures:
- *\li If result is #ISC_R_SUCCESS:
- * *fp points to an stream opening in stdio's "w+" mode.
- *
- *\li If result is not #ISC_R_SUCCESS:
- * *fp is NULL.
- *
- * No file is open. Even if one was created (but unable
- * to be reopened as a stdio FILE pointer) then it has been
- * removed.
- *
- *\li This function does *not* ensure that the template string has not been
- * modified, even if the operation was unsuccessful.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- * Success.
- *\li #ISC_R_EXISTS
- * No file with a unique name could be created based on the
- * template.
- *\li #ISC_R_INVALIDFILE
- * The path specified was not usable by the operating system.
- *\li #ISC_R_NOPERM
- * The file could not be created because permission was denied
- * to some part of the file's path.
- *\li #ISC_R_IOERROR
- * Hardware error interacting with the filesystem.
- *\li #ISC_R_UNEXPECTED
- * Something totally unexpected happened.
- */
-
-isc_result_t
-isc_file_remove(const char *filename);
-/*!<
- * \brief Remove the file named by 'filename'.
- */
-
-isc_result_t
-isc_file_rename(const char *oldname, const char *newname);
-/*!<
- * \brief Rename the file 'oldname' to 'newname'.
- */
-
-isc_boolean_t
-isc_file_exists(const char *pathname);
-/*!<
- * \brief Return #ISC_TRUE if the calling process can tell that the given file exists.
- * Will not return true if the calling process has insufficient privileges
- * to search the entire path.
- */
-
-isc_boolean_t
-isc_file_isabsolute(const char *filename);
-/*!<
- * \brief Return #ISC_TRUE if the given file name is absolute.
- */
-
-isc_boolean_t
-isc_file_iscurrentdir(const char *filename);
-/*!<
- * \brief Return #ISC_TRUE if the given file name is the current directory (".").
- */
-
-isc_boolean_t
-isc_file_ischdiridempotent(const char *filename);
-/*%<
- * Return #ISC_TRUE if calling chdir(filename) multiple times will give
- * the same result as calling it once.
- */
-
-const char *
-isc_file_basename(const char *filename);
-/*%<
- * Return the final component of the path in the file name.
- */
-
-isc_result_t
-isc_file_progname(const char *filename, char *buf, size_t buflen);
-/*!<
- * \brief Given an operating system specific file name "filename"
- * referring to a program, return the canonical program name.
- *
- *
- * Any directory prefix or executable file name extension (if
- * used on the OS in case) is stripped. On systems where program
- * names are case insensitive, the name is canonicalized to all
- * lower case. The name is written to 'buf', an array of 'buflen'
- * chars, and null terminated.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOSPACE The name did not fit in 'buf'.
- */
-
-isc_result_t
-isc_file_template(const char *path, const char *templet, char *buf,
- size_t buflen);
-/*%<
- * Create an OS specific template using 'path' to define the directory
- * 'templet' to describe the filename and store the result in 'buf'
- * such that path can be renamed to buf atomically.
- */
-
-isc_result_t
-isc_file_renameunique(const char *file, char *templet);
-/*%<
- * Rename 'file' using 'templet' as a template for the new file name.
- */
-
-isc_result_t
-isc_file_absolutepath(const char *filename, char *path, size_t pathlen);
-/*%<
- * Given a file name, return the fully qualified path to the file.
- */
-
-/*
- * XXX We should also have a isc_file_writeeopen() function
- * for safely open a file in a publicly writable directory
- * (see write_open() in BIND 8's ns_config.c).
- */
-
-isc_result_t
-isc_file_truncate(const char *filename, isc_offset_t size);
-/*%<
- * Truncate/extend the file specified to 'size' bytes.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_FILE_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: formatcheck.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_FORMATCHECK_H
-#define ISC_FORMATCHECK_H 1
-
-/*! \file isc/formatcheck.h */
-
-/*%
- * ISC_FORMAT_PRINTF().
- *
- * \li fmt is the location of the format string parameter.
- * \li args is the location of the first argument (or 0 for no argument checking).
- *
- * Note:
- * \li The first parameter is 1, not 0.
- */
-#ifdef __GNUC__
-#define ISC_FORMAT_PRINTF(fmt, args) __attribute__((__format__(__printf__, fmt, args)))
-#else
-#define ISC_FORMAT_PRINTF(fmt, args)
-#endif
-
-#endif /* ISC_FORMATCHECK_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: fsaccess.h,v 1.14.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef ISC_FSACCESS_H
-#define ISC_FSACCESS_H 1
-
-/*! \file isc/fsaccess.h
- * \brief The ISC filesystem access module encapsulates the setting of file
- * and directory access permissions into one API that is meant to be
- * portable to multiple operating systems.
- *
- * The two primary operating system flavors that are initially accommodated
- * are POSIX and Windows NT 4.0 and later. The Windows NT access model is
- * considerable more flexible than POSIX's model (as much as I am loathe to
- * admit it), and so the ISC API has a higher degree of complexity than would
- * be needed to simply address POSIX's needs.
- *
- * The full breadth of NT's flexibility is not available either, for the
- * present time. Much of it is to provide compatibility with what Unix
- * programmers are expecting. This is also due to not yet really needing all
- * of the functionality of an NT system (or, for that matter, a POSIX system)
- * in BIND9, and so resolving how to handle the various incompatibilities has
- * been a purely theoretical exercise with no operational experience to
- * indicate how flawed the thinking may be.
- *
- * Some of the more notable dumbing down of NT for this API includes:
- *
- *\li Each of FILE_READ_DATA and FILE_READ_EA are set with #ISC_FSACCESS_READ.
- *
- * \li All of FILE_WRITE_DATA, FILE_WRITE_EA and FILE_APPEND_DATA are
- * set with #ISC_FSACCESS_WRITE. FILE_WRITE_ATTRIBUTES is not set
- * so as to be consistent with Unix, where only the owner of the file
- * or the superuser can change the attributes/mode of a file.
- *
- * \li Both of FILE_ADD_FILE and FILE_ADD_SUBDIRECTORY are set with
- * #ISC_FSACCESS_CREATECHILD. This is similar to setting the WRITE
- * permission on a Unix directory.
- *
- * \li SYNCHRONIZE is always set for files and directories, unless someone
- * can give me a reason why this is a bad idea.
- *
- * \li READ_CONTROL and FILE_READ_ATTRIBUTES are always set; this is
- * consistent with Unix, where any file or directory can be stat()'d
- * unless the directory path disallows complete access somewhere along
- * the way.
- *
- * \li WRITE_DAC is only set for the owner. This too is consistent with
- * Unix, and is tighter security than allowing anyone else to be
- * able to set permissions.
- *
- * \li DELETE is only set for the owner. On Unix the ability to delete
- * a file is controlled by the directory permissions, but it isn't
- * currently clear to me what happens on NT if the directory has
- * FILE_DELETE_CHILD set but a file within it does not have DELETE
- * set. Always setting DELETE on the file/directory for the owner
- * gives maximum flexibility to the owner without exposing the
- * file to deletion by others.
- *
- * \li WRITE_OWNER is never set. This too is consistent with Unix,
- * and is also tighter security than allowing anyone to change the
- * ownership of the file apart from the superu..ahem, Administrator.
- *
- * \li Inheritance is set to NO_INHERITANCE.
- *
- * Unix's dumbing down includes:
- *
- * \li The sticky bit cannot be set.
- *
- * \li setuid and setgid cannot be set.
- *
- * \li Only regular files and directories can be set.
- *
- * The rest of this comment discusses a few of the incompatibilities
- * between the two systems that need more thought if this API is to
- * be extended to accommodate them.
- *
- * The Windows standard access right "DELETE" doesn't have a direct
- * equivalent in the Unix world, so it isn't clear what should be done
- * with it.
- *
- * The Unix sticky bit is not supported. While NT does have a concept
- * of allowing users to create files in a directory but not delete or
- * rename them, it does not have a concept of allowing them to be deleted
- * if they are owned by the user trying to delete/rename. While it is
- * probable that something could be cobbled together in NT 5 with inheritance,
- * it can't really be done in NT 4 as a single property that you could
- * set on a directory. You'd need to coordinate something with file creation
- * so that every file created had DELETE set for the owner but noone else.
- *
- * On Unix systems, setting #ISC_FSACCESS_LISTDIRECTORY sets READ.
- * ... setting either #ISC_FSACCESS_CREATECHILD or #ISC_FSACCESS_DELETECHILD
- * sets WRITE.
- * ... setting #ISC_FSACCESS_ACCESSCHILD sets EXECUTE.
- *
- * On NT systems, setting #ISC_FSACCESS_LISTDIRECTORY sets FILE_LIST_DIRECTORY.
- * ... setting #ISC_FSACCESS_CREATECHILD sets FILE_CREATE_CHILD independently.
- * ... setting #ISC_FSACCESS_DELETECHILD sets FILE_DELETE_CHILD independently.
- * ... setting #ISC_FSACCESS_ACCESSCHILD sets FILE_TRAVERSE.
- *
- * Unresolved: XXXDCL
- * \li What NT access right controls the ability to rename a file?
- * \li How does DELETE work? If a directory has FILE_DELETE_CHILD but a
- * file or directory within it does not have DELETE, is that file
- * or directory deletable?
- * \li To implement isc_fsaccess_get(), mapping an existing Unix permission
- * mode_t back to an isc_fsaccess_t is pretty trivial; however, mapping
- * an NT DACL could be impossible to do in a responsible way.
- * \li Similarly, trying to implement the functionality of being able to
- * say "add group writability to whatever permissions already exist"
- * could be tricky on NT because of the order-of-entry issue combined
- * with possibly having one or more matching ACEs already explicitly
- * granting or denying access. Because this functionality is
- * not yet needed by the ISC, no code has been written to try to
- * solve this problem.
- */
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-/*
- * Trustees.
- */
-#define ISC_FSACCESS_OWNER 0x1 /*%< User account. */
-#define ISC_FSACCESS_GROUP 0x2 /*%< Primary group owner. */
-#define ISC_FSACCESS_OTHER 0x4 /*%< Not the owner or the group owner. */
-#define ISC_FSACCESS_WORLD 0x7 /*%< User, Group, Other. */
-
-/*
- * Types of permission.
- */
-#define ISC_FSACCESS_READ 0x00000001 /*%< File only. */
-#define ISC_FSACCESS_WRITE 0x00000002 /*%< File only. */
-#define ISC_FSACCESS_EXECUTE 0x00000004 /*%< File only. */
-#define ISC_FSACCESS_CREATECHILD 0x00000008 /*%< Dir only. */
-#define ISC_FSACCESS_DELETECHILD 0x00000010 /*%< Dir only. */
-#define ISC_FSACCESS_LISTDIRECTORY 0x00000020 /*%< Dir only. */
-#define ISC_FSACCESS_ACCESSCHILD 0x00000040 /*%< Dir only. */
-
-/*%
- * Adding any permission bits beyond 0x200 would mean typedef'ing
- * isc_fsaccess_t as isc_uint64_t, and redefining this value to
- * reflect the new range of permission types, Probably to 21 for
- * maximum flexibility. The number of bits has to accommodate all of
- * the permission types, and three full sets of them have to fit
- * within an isc_fsaccess_t.
- */
-#define ISC__FSACCESS_PERMISSIONBITS 10
-
-ISC_LANG_BEGINDECLS
-
-void
-isc_fsaccess_add(int trustee, int permission, isc_fsaccess_t *access);
-
-void
-isc_fsaccess_remove(int trustee, int permission, isc_fsaccess_t *access);
-
-isc_result_t
-isc_fsaccess_set(const char *path, isc_fsaccess_t access);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_FSACCESS_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: hash.h,v 1.10.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef ISC_HASH_H
-#define ISC_HASH_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isc/hash.h
- *
- * \brief The hash API
- * provides an unpredictable hash value for variable length data.
- * A hash object contains a random vector (which is hidden from clients
- * of this API) to make the actual hash value unpredictable.
- *
- * The algorithm used in the API guarantees the probability of hash
- * collision; in the current implementation, as long as the values stored
- * in the random vector are unpredictable, the probability of hash
- * collision between arbitrary two different values is at most 1/2^16.
- *
- * Although the API is generic about the hash keys, it mainly expects
- * DNS names (and sometimes IPv4/v6 addresses) as inputs. It has an
- * upper limit of the input length, and may run slow to calculate the
- * hash values for large inputs.
- *
- * This API is designed to be general so that it can provide multiple
- * different hash contexts that have different random vectors. However,
- * it should be typical to have a single context for an entire system.
- * To support such cases, the API also provides a single-context mode.
- *
- * \li MP:
- * The hash object is almost read-only. Once the internal random vector
- * is initialized, no write operation will occur, and there will be no
- * need to lock the object to calculate actual hash values.
- *
- * \li Reliability:
- * In some cases this module uses low-level data copy to initialize the
- * random vector. Errors in this part are likely to crash the server or
- * corrupt memory.
- *
- * \li Resources:
- * A buffer, used as a random vector for calculating hash values.
- *
- * \li Security:
- * This module intends to provide unpredictable hash values in
- * adversarial environments in order to avoid denial of service attacks
- * to hash buckets.
- * Its unpredictability relies on the quality of entropy to build the
- * random vector.
- *
- * \li Standards:
- * None.
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/types.h>
-
-/***
- *** Functions
- ***/
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-isc_hash_ctxcreate(isc_mem_t *mctx, isc_entropy_t *entropy, unsigned int limit,
- isc_hash_t **hctx);
-isc_result_t
-isc_hash_create(isc_mem_t *mctx, isc_entropy_t *entropy, size_t limit);
-/*!<
- * \brief Create a new hash object.
- *
- * isc_hash_ctxcreate() creates a different object.
- *
- * isc_hash_create() creates a module-internal object to support the
- * single-context mode. It should be called only once.
- *
- * 'entropy' must be NULL or a valid entropy object. If 'entropy' is NULL,
- * pseudo random values will be used to build the random vector, which may
- * weaken security.
- *
- * 'limit' specifies the maximum number of hash keys. If it is too large,
- * these functions may fail.
- */
-
-void
-isc_hash_ctxattach(isc_hash_t *hctx, isc_hash_t **hctxp);
-/*!<
- * \brief Attach to a hash object.
- *
- * This function is only necessary for the multiple-context mode.
- */
-
-void
-isc_hash_ctxdetach(isc_hash_t **hctxp);
-/*!<
- * \brief Detach from a hash object.
- *
- * This function is for the multiple-context mode, and takes a valid
- * hash object as an argument.
- */
-
-void
-isc_hash_destroy(void);
-/*!<
- * \brief This function is for the single-context mode, and is expected to be used
- * as a counterpart of isc_hash_create().
- *
- * A valid module-internal hash object must have been created, and this
- * function should be called only once.
- */
-
-/*@{*/
-void
-isc_hash_ctxinit(isc_hash_t *hctx);
-void
-isc_hash_init(void);
-/*!<
- * \brief Initialize a hash object.
- *
- * It fills in the random vector with a proper
- * source of entropy, which is typically from the entropy object specified
- * at the creation. Thus, it is desirable to call these functions after
- * initializing the entropy object with some good entropy sources.
- *
- * These functions should be called before the first hash calculation.
- *
- * isc_hash_ctxinit() is for the multiple-context mode, and takes a valid hash
- * object as an argument.
- *
- * isc_hash_init() is for the single-context mode. A valid module-internal
- * hash object must have been created, and this function should be called only
- * once.
- */
-/*@}*/
-
-/*@{*/
-unsigned int
-isc_hash_ctxcalc(isc_hash_t *hctx, const unsigned char *key,
- unsigned int keylen, isc_boolean_t case_sensitive);
-unsigned int
-isc_hash_calc(const unsigned char *key, unsigned int keylen,
- isc_boolean_t case_sensitive);
-/*!<
- * \brief Calculate a hash value.
- *
- * isc_hash_ctxinit() is for the multiple-context mode, and takes a valid hash
- * object as an argument.
- *
- * isc_hash_init() is for the single-context mode. A valid module-internal
- * hash object must have been created.
- *
- * 'key' is the hash key, which is a variable length buffer.
- *
- * 'keylen' specifies the key length, which must not be larger than the limit
- * specified for the corresponding hash object.
- *
- * 'case_sensitive' specifies whether the hash key should be treated as
- * case_sensitive values. It should typically be ISC_FALSE if the hash key
- * is a DNS name.
- */
-/*@}*/
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_HASH_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1997-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: heap.h,v 1.24.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef ISC_HEAP_H
-#define ISC_HEAP_H 1
-
-/*! \file isc/heap.h */
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/*%
- * The comparison function returns ISC_TRUE if the first argument has
- * higher priority than the second argument, and ISC_FALSE otherwise.
- */
-typedef isc_boolean_t (*isc_heapcompare_t)(void *, void *);
-
-/*%
- * The index function allows the client of the heap to receive a callback
- * when an item's index number changes. This allows it to maintain
- * sync with its external state, but still delete itself, since deletions
- * from the heap require the index be provided.
- */
-typedef void (*isc_heapindex_t)(void *, unsigned int);
-
-/*%
- * The heapaction function is used when iterating over the heap.
- *
- * NOTE: The heap structure CANNOT BE MODIFIED during the call to
- * isc_heap_foreach().
- */
-typedef void (*isc_heapaction_t)(void *, void *);
-
-typedef struct isc_heap isc_heap_t;
-
-isc_result_t
-isc_heap_create(isc_mem_t *mctx, isc_heapcompare_t compare,
- isc_heapindex_t index, unsigned int size_increment,
- isc_heap_t **heapp);
-/*!<
- * \brief Create a new heap. The heap is implemented using a space-efficient
- * storage method. When the heap elements are deleted space is not freed
- * but will be reused when new elements are inserted.
- *
- * Requires:
- *\li "mctx" is valid.
- *\li "compare" is a function which takes two void * arguments and
- * returns ISC_TRUE if the first argument has a higher priority than
- * the second, and ISC_FALSE otherwise.
- *\li "index" is a function which takes a void *, and an unsigned int
- * argument. This function will be called whenever an element's
- * index value changes, so it may continue to delete itself from the
- * heap. This option may be NULL if this functionality is unneeded.
- *\li "size_increment" is a hint about how large the heap should grow
- * when resizing is needed. If this is 0, a default size will be
- * used, which is currently 1024, allowing space for an additional 1024
- * heap elements to be inserted before adding more space.
- *\li "heapp" is not NULL, and "*heap" is NULL.
- *
- * Returns:
- *\li ISC_R_SUCCESS - success
- *\li ISC_R_NOMEMORY - insufficient memory
- */
-
-void
-isc_heap_destroy(isc_heap_t **heapp);
-/*!<
- * \brief Destroys a heap.
- *
- * Requires:
- *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t.
- */
-
-isc_result_t
-isc_heap_insert(isc_heap_t *heap, void *elt);
-/*!<
- * \brief Inserts a new element into a heap.
- *
- * Requires:
- *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t.
- */
-
-void
-isc_heap_delete(isc_heap_t *heap, unsigned int index);
-/*!<
- * \brief Deletes an element from a heap, by element index.
- *
- * Requires:
- *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t.
- *\li "index" is a valid element index, as provided by the "index" callback
- * provided during heap creation.
- */
-
-void
-isc_heap_increased(isc_heap_t *heap, unsigned int index);
-/*!<
- * \brief Indicates to the heap that an element's priority has increased.
- * This function MUST be called whenever an element has increased in priority.
- *
- * Requires:
- *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t.
- *\li "index" is a valid element index, as provided by the "index" callback
- * provided during heap creation.
- */
-
-void
-isc_heap_decreased(isc_heap_t *heap, unsigned int index);
-/*!<
- * \brief Indicates to the heap that an element's priority has decreased.
- * This function MUST be called whenever an element has decreased in priority.
- *
- * Requires:
- *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t.
- *\li "index" is a valid element index, as provided by the "index" callback
- * provided during heap creation.
- */
-
-void *
-isc_heap_element(isc_heap_t *heap, unsigned int index);
-/*!<
- * \brief Returns the element for a specific element index.
- *
- * Requires:
- *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t.
- *\li "index" is a valid element index, as provided by the "index" callback
- * provided during heap creation.
- *
- * Returns:
- *\li A pointer to the element for the element index.
- */
-
-void
-isc_heap_foreach(isc_heap_t *heap, isc_heapaction_t action, void *uap);
-/*!<
- * \brief Iterate over the heap, calling an action for each element. The
- * order of iteration is not sorted.
- *
- * Requires:
- *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t.
- *\li "action" is not NULL, and is a function which takes two arguments.
- * The first is a void *, representing the element, and the second is
- * "uap" as provided to isc_heap_foreach.
- *\li "uap" is a caller-provided argument, and may be NULL.
- *
- * Note:
- *\li The heap structure CANNOT be modified during this iteration. The only
- * safe function to call while iterating the heap is isc_heap_element().
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_HEAP_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: hex.h,v 1.13 2008/09/25 04:02:39 tbox Exp $ */
-
-#ifndef ISC_HEX_H
-#define ISC_HEX_H 1
-
-/*! \file isc/hex.h */
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Functions
- ***/
-
-isc_result_t
-isc_hex_totext(isc_region_t *source, int wordlength,
- const char *wordbreak, isc_buffer_t *target);
-/*!<
- * \brief Convert data into hex encoded text.
- *
- * Notes:
- *\li The hex encoded text in 'target' will be divided into
- * words of at most 'wordlength' characters, separated by
- * the 'wordbreak' string. No parentheses will surround
- * the text.
- *
- * Requires:
- *\li 'source' is a region containing binary data
- *\li 'target' is a text buffer containing available space
- *\li 'wordbreak' points to a null-terminated string of
- * zero or more whitespace characters
- *
- * Ensures:
- *\li target will contain the hex encoded version of the data
- * in source. The 'used' pointer in target will be advanced as
- * necessary.
- */
-
-isc_result_t
-isc_hex_decodestring(const char *cstr, isc_buffer_t *target);
-/*!<
- * \brief Decode a null-terminated hex string.
- *
- * Requires:
- *\li 'cstr' is non-null.
- *\li 'target' is a valid buffer.
- *
- * Returns:
- *\li #ISC_R_SUCCESS -- the entire decoded representation of 'cstring'
- * fit in 'target'.
- *\li #ISC_R_BADHEX -- 'cstr' is not a valid hex encoding.
- *
- * Other error returns are any possible error code from:
- * isc_lex_create(),
- * isc_lex_openbuffer(),
- * isc_hex_tobuffer().
- */
-
-isc_result_t
-isc_hex_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length);
-/*!<
- * \brief Convert hex encoded text from a lexer context into data.
- *
- * Requires:
- *\li 'lex' is a valid lexer context
- *\li 'target' is a buffer containing binary data
- *\li 'length' is an integer
- *
- * Ensures:
- *\li target will contain the data represented by the hex encoded
- * string parsed by the lexer. No more than length bytes will be read,
- * if length is positive. The 'used' pointer in target will be
- * advanced as necessary.
- */
-
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_HEX_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: hmacmd5.h,v 1.12 2007/06/19 23:47:18 tbox Exp $ */
-
-/*! \file isc/hmacmd5.h
- * \brief This is the header file for the HMAC-MD5 keyed hash algorithm
- * described in RFC2104.
- */
-
-#ifndef ISC_HMACMD5_H
-#define ISC_HMACMD5_H 1
-
-#include <isc/lang.h>
-#include <isc/md5.h>
-#include <isc/types.h>
-
-#define ISC_HMACMD5_KEYLENGTH 64
-
-typedef struct {
- isc_md5_t md5ctx;
- unsigned char key[ISC_HMACMD5_KEYLENGTH];
-} isc_hmacmd5_t;
-
-ISC_LANG_BEGINDECLS
-
-void
-isc_hmacmd5_init(isc_hmacmd5_t *ctx, const unsigned char *key,
- unsigned int len);
-
-void
-isc_hmacmd5_invalidate(isc_hmacmd5_t *ctx);
-
-void
-isc_hmacmd5_update(isc_hmacmd5_t *ctx, const unsigned char *buf,
- unsigned int len);
-
-void
-isc_hmacmd5_sign(isc_hmacmd5_t *ctx, unsigned char *digest);
-
-isc_boolean_t
-isc_hmacmd5_verify(isc_hmacmd5_t *ctx, unsigned char *digest);
-
-isc_boolean_t
-isc_hmacmd5_verify2(isc_hmacmd5_t *ctx, unsigned char *digest, size_t len);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_HMACMD5_H */
+++ /dev/null
-/*
- * Copyright (C) 2006-2008 Internet Systems Consortium, Inc. ("ISC")
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: httpd.h,v 1.9 2008/08/08 05:06:49 marka Exp $ */
-
-#ifndef ISC_HTTPD_H
-#define ISC_HTTPD_H 1
-
-/*! \file */
-
-#include <isc/event.h>
-#include <isc/eventclass.h>
-#include <isc/types.h>
-#include <isc/mutex.h>
-#include <isc/task.h>
-
-#define HTTPD_EVENTCLASS ISC_EVENTCLASS(4300)
-#define HTTPD_SHUTDOWN (HTTPD_EVENTCLASS + 0x0001)
-
-#define ISC_HTTPDMGR_FLAGSHUTTINGDOWN 0x00000001
-
-/*
- * Create a new http daemon which will send, once every time period,
- * a http-like header followed by HTTP data.
- */
-isc_result_t
-isc_httpdmgr_create(isc_mem_t *mctx, isc_socket_t *sock, isc_task_t *task,
- isc_httpdclientok_t *client_ok,
- isc_httpdondestroy_t *ondestory, void *cb_arg,
- isc_timermgr_t *tmgr, isc_httpdmgr_t **httpdp);
-
-void
-isc_httpdmgr_shutdown(isc_httpdmgr_t **httpdp);
-
-isc_result_t
-isc_httpdmgr_addurl(isc_httpdmgr_t *httpdmgr, const char *url,
- isc_httpdaction_t *func, void *arg);
-
-isc_result_t
-isc_httpd_response(isc_httpd_t *httpd);
-
-isc_result_t
-isc_httpd_addheader(isc_httpd_t *httpd, const char *name,
- const char *val);
-
-isc_result_t
-isc_httpd_addheaderuint(isc_httpd_t *httpd, const char *name, int val);
-
-isc_result_t isc_httpd_endheaders(isc_httpd_t *httpd);
-
-#endif /* ISC_HTTPD_H */
+++ /dev/null
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: int.h,v 1.16 2007/06/19 23:47:19 tbox Exp $ */
-
-#ifndef ISC_INT_H
-#define ISC_INT_H 1
-
-/*! \file */
-
-typedef char isc_int8_t;
-typedef unsigned char isc_uint8_t;
-typedef short isc_int16_t;
-typedef unsigned short isc_uint16_t;
-typedef int isc_int32_t;
-typedef unsigned int isc_uint32_t;
-typedef long long isc_int64_t;
-typedef unsigned long long isc_uint64_t;
-
-#define ISC_INT8_MIN -128
-#define ISC_INT8_MAX 127
-#define ISC_UINT8_MAX 255
-
-#define ISC_INT16_MIN -32768
-#define ISC_INT16_MAX 32767
-#define ISC_UINT16_MAX 65535
-
-/*%
- * Note that "int" is 32 bits on all currently supported Unix-like operating
- * systems, but "long" can be either 32 bits or 64 bits, thus the 32 bit
- * constants are not qualified with "L".
- */
-#define ISC_INT32_MIN -2147483648
-#define ISC_INT32_MAX 2147483647
-#define ISC_UINT32_MAX 4294967295U
-
-#define ISC_INT64_MIN -9223372036854775808LL
-#define ISC_INT64_MAX 9223372036854775807LL
-#define ISC_UINT64_MAX 18446744073709551615ULL
-
-#endif /* ISC_INT_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: interfaceiter.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_INTERFACEITER_H
-#define ISC_INTERFACEITER_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isc/interfaceiter.h
- * \brief Iterates over the list of network interfaces.
- *
- * Interfaces whose address family is not supported are ignored and never
- * returned by the iterator. Interfaces whose netmask, interface flags,
- * or similar cannot be obtained are also ignored, and the failure is logged.
- *
- * Standards:
- * The API for scanning varies greatly among operating systems.
- * This module attempts to hide the differences.
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-#include <isc/netaddr.h>
-#include <isc/types.h>
-
-/*!
- * \brief Public structure describing a network interface.
- */
-
-struct isc_interface {
- char name[32]; /*%< Interface name, null-terminated. */
- unsigned int af; /*%< Address family. */
- isc_netaddr_t address; /*%< Local address. */
- isc_netaddr_t netmask; /*%< Network mask. */
- isc_netaddr_t dstaddress; /*%< Destination address (point-to-point only). */
- isc_uint32_t flags; /*%< Flags; see INTERFACE flags. */
-};
-
-/*@{*/
-/*! Interface flags. */
-
-#define INTERFACE_F_UP 0x00000001U
-#define INTERFACE_F_POINTTOPOINT 0x00000002U
-#define INTERFACE_F_LOOPBACK 0x00000004U
-/*@}*/
-
-/***
- *** Functions
- ***/
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp);
-/*!<
- * \brief Create an iterator for traversing the operating system's list
- * of network interfaces.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
- *\li Various network-related errors
- */
-
-isc_result_t
-isc_interfaceiter_first(isc_interfaceiter_t *iter);
-/*!<
- * \brief Position the iterator on the first interface.
- *
- * Returns:
- *\li #ISC_R_SUCCESS Success.
- *\li #ISC_R_NOMORE There are no interfaces.
- */
-
-isc_result_t
-isc_interfaceiter_current(isc_interfaceiter_t *iter,
- isc_interface_t *ifdata);
-/*!<
- * \brief Get information about the interface the iterator is currently
- * positioned at and store it at *ifdata.
- *
- * Requires:
- *\li The iterator has been successfully positioned using
- * isc_interface_iter_first() / isc_interface_iter_next().
- *
- * Returns:
- *\li #ISC_R_SUCCESS Success.
- */
-
-isc_result_t
-isc_interfaceiter_next(isc_interfaceiter_t *iter);
-/*!<
- * \brief Position the iterator on the next interface.
- *
- * Requires:
- * \li The iterator has been successfully positioned using
- * isc_interface_iter_first() / isc_interface_iter_next().
- *
- * Returns:
- *\li #ISC_R_SUCCESS Success.
- *\li #ISC_R_NOMORE There are no more interfaces.
- */
-
-void
-isc_interfaceiter_destroy(isc_interfaceiter_t **iterp);
-/*!<
- * \brief Destroy the iterator.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_INTERFACEITER_H */
+++ /dev/null
-/*
- * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC")
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: iterated_hash.h,v 1.3 2008/09/25 04:02:39 tbox Exp $ */
-
-#ifndef ISC_ITERATED_HASH_H
-#define ISC_ITERATED_HASH_H 1
-
-#include <isc/lang.h>
-#include <isc/sha1.h>
-
-/*
- * The maximal hash length that can be encoded it a name
- * using base32hex. floor(255/8)*5
- */
-#define NSEC3_MAX_HASH_LENGTH 155
-
-/*
- * The maximum has that can be encoded in a single label using
- * base32hex. floor(63/8)*5
- */
-#define NSEC3_MAX_LABEL_HASH 35
-
-ISC_LANG_BEGINDECLS
-
-int isc_iterated_hash(unsigned char out[NSEC3_MAX_HASH_LENGTH],
- unsigned int hashalg, int iterations,
- const unsigned char *salt, int saltlength,
- const unsigned char *in, int inlength);
-
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_ITERATED_HASH_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: lang.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_LANG_H
-#define ISC_LANG_H 1
-
-/*! \file isc/lang.h */
-
-#ifdef __cplusplus
-#define ISC_LANG_BEGINDECLS extern "C" {
-#define ISC_LANG_ENDDECLS }
-#else
-#define ISC_LANG_BEGINDECLS
-#define ISC_LANG_ENDDECLS
-#endif
-
-#endif /* ISC_LANG_H */
+++ /dev/null
-/*
- * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: lex.h,v 1.37 2008/05/30 23:47:01 tbox Exp $ */
-
-#ifndef ISC_LEX_H
-#define ISC_LEX_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isc/lex.h
- * \brief The "lex" module provides a lightweight tokenizer. It can operate
- * on files or buffers, and can handle "include". It is designed for
- * parsing of DNS master files and the BIND configuration file, but
- * should be general enough to tokenize other things, e.g. HTTP.
- *
- * \li MP:
- * No synchronization is provided. Clients must ensure exclusive
- * access.
- *
- * \li Reliability:
- * No anticipated impact.
- *
- * \li Resources:
- * TBS
- *
- * \li Security:
- * No anticipated impact.
- *
- * \li Standards:
- * None.
- */
-
-/***
- *** Imports
- ***/
-
-#include <stdio.h>
-
-#include <isc/lang.h>
-#include <isc/region.h>
-#include <isc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Options
- ***/
-
-/*@{*/
-/*!
- * Various options for isc_lex_gettoken().
- */
-
-#define ISC_LEXOPT_EOL 0x01 /*%< Want end-of-line token. */
-#define ISC_LEXOPT_EOF 0x02 /*%< Want end-of-file token. */
-#define ISC_LEXOPT_INITIALWS 0x04 /*%< Want initial whitespace. */
-#define ISC_LEXOPT_NUMBER 0x08 /*%< Recognize numbers. */
-#define ISC_LEXOPT_QSTRING 0x10 /*%< Recognize qstrings. */
-/*@}*/
-
-/*@{*/
-/*!
- * The ISC_LEXOPT_DNSMULTILINE option handles the processing of '(' and ')' in
- * the DNS master file format. If this option is set, then the
- * ISC_LEXOPT_INITIALWS and ISC_LEXOPT_EOL options will be ignored when
- * the paren count is > 0. To use this option, '(' and ')' must be special
- * characters.
- */
-#define ISC_LEXOPT_DNSMULTILINE 0x20 /*%< Handle '(' and ')'. */
-#define ISC_LEXOPT_NOMORE 0x40 /*%< Want "no more" token. */
-
-#define ISC_LEXOPT_CNUMBER 0x80 /*%< Recognize octal and hex. */
-#define ISC_LEXOPT_ESCAPE 0x100 /*%< Recognize escapes. */
-#define ISC_LEXOPT_QSTRINGMULTILINE 0x200 /*%< Allow multiline "" strings */
-#define ISC_LEXOPT_OCTAL 0x400 /*%< Expect a octal number. */
-/*@}*/
-/*@{*/
-/*!
- * Various commenting styles, which may be changed at any time with
- * isc_lex_setcomments().
- */
-
-#define ISC_LEXCOMMENT_C 0x01
-#define ISC_LEXCOMMENT_CPLUSPLUS 0x02
-#define ISC_LEXCOMMENT_SHELL 0x04
-#define ISC_LEXCOMMENT_DNSMASTERFILE 0x08
-/*@}*/
-
-/***
- *** Types
- ***/
-
-/*! Lex */
-
-typedef char isc_lexspecials_t[256];
-
-/* Tokens */
-
-typedef enum {
- isc_tokentype_unknown = 0,
- isc_tokentype_string = 1,
- isc_tokentype_number = 2,
- isc_tokentype_qstring = 3,
- isc_tokentype_eol = 4,
- isc_tokentype_eof = 5,
- isc_tokentype_initialws = 6,
- isc_tokentype_special = 7,
- isc_tokentype_nomore = 8
-} isc_tokentype_t;
-
-typedef union {
- char as_char;
- unsigned long as_ulong;
- isc_region_t as_region;
- isc_textregion_t as_textregion;
- void * as_pointer;
-} isc_tokenvalue_t;
-
-typedef struct isc_token {
- isc_tokentype_t type;
- isc_tokenvalue_t value;
-} isc_token_t;
-
-/***
- *** Functions
- ***/
-
-isc_result_t
-isc_lex_create(isc_mem_t *mctx, size_t max_token, isc_lex_t **lexp);
-/*%<
- * Create a lexer.
- *
- * 'max_token' is a hint of the number of bytes in the largest token.
- *
- * Requires:
- *\li '*lexp' is a valid lexer.
- *
- *\li max_token > 0.
- *
- * Ensures:
- *\li On success, *lexp is attached to the newly created lexer.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- */
-
-void
-isc_lex_destroy(isc_lex_t **lexp);
-/*%<
- * Destroy the lexer.
- *
- * Requires:
- *\li '*lexp' is a valid lexer.
- *
- * Ensures:
- *\li *lexp == NULL
- */
-
-unsigned int
-isc_lex_getcomments(isc_lex_t *lex);
-/*%<
- * Return the current lexer commenting styles.
- *
- * Requires:
- *\li 'lex' is a valid lexer.
- *
- * Returns:
- *\li The commenting sytles which are currently allowed.
- */
-
-void
-isc_lex_setcomments(isc_lex_t *lex, unsigned int comments);
-/*%<
- * Set allowed lexer commenting styles.
- *
- * Requires:
- *\li 'lex' is a valid lexer.
- *
- *\li 'comments' has meaningful values.
- */
-
-void
-isc_lex_getspecials(isc_lex_t *lex, isc_lexspecials_t specials);
-/*%<
- * Put the current list of specials into 'specials'.
- *
- * Requires:
- *\li 'lex' is a valid lexer.
- */
-
-void
-isc_lex_setspecials(isc_lex_t *lex, isc_lexspecials_t specials);
-/*!<
- * The characters in 'specials' are returned as tokens. Along with
- * whitespace, they delimit strings and numbers.
- *
- * Note:
- *\li Comment processing takes precedence over special character
- * recognition.
- *
- * Requires:
- *\li 'lex' is a valid lexer.
- */
-
-isc_result_t
-isc_lex_openfile(isc_lex_t *lex, const char *filename);
-/*%<
- * Open 'filename' and make it the current input source for 'lex'.
- *
- * Requires:
- *\li 'lex' is a valid lexer.
- *
- *\li filename is a valid C string.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY Out of memory
- *\li #ISC_R_NOTFOUND File not found
- *\li #ISC_R_NOPERM No permission to open file
- *\li #ISC_R_FAILURE Couldn't open file, not sure why
- *\li #ISC_R_UNEXPECTED
- */
-
-isc_result_t
-isc_lex_openstream(isc_lex_t *lex, FILE *stream);
-/*%<
- * Make 'stream' the current input source for 'lex'.
- *
- * Requires:
- *\li 'lex' is a valid lexer.
- *
- *\li 'stream' is a valid C stream.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY Out of memory
- */
-
-isc_result_t
-isc_lex_openbuffer(isc_lex_t *lex, isc_buffer_t *buffer);
-/*%<
- * Make 'buffer' the current input source for 'lex'.
- *
- * Requires:
- *\li 'lex' is a valid lexer.
- *
- *\li 'buffer' is a valid buffer.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY Out of memory
- */
-
-isc_result_t
-isc_lex_close(isc_lex_t *lex);
-/*%<
- * Close the most recently opened object (i.e. file or buffer).
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMORE No more input sources
- */
-
-isc_result_t
-isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp);
-/*%<
- * Get the next token.
- *
- * Requires:
- *\li 'lex' is a valid lexer.
- *
- *\li 'lex' has an input source.
- *
- *\li 'options' contains valid options.
- *
- *\li '*tokenp' is a valid pointer.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_UNEXPECTEDEND
- *\li #ISC_R_NOMEMORY
- *
- * These two results are returned only if their corresponding lexer
- * options are not set.
- *
- *\li #ISC_R_EOF End of input source
- *\li #ISC_R_NOMORE No more input sources
- */
-
-isc_result_t
-isc_lex_getmastertoken(isc_lex_t *lex, isc_token_t *token,
- isc_tokentype_t expect, isc_boolean_t eol);
-/*%<
- * Get the next token from a DNS master file type stream. This is a
- * convenience function that sets appropriate options and handles quoted
- * strings and end of line correctly for master files. It also ungets
- * unexpected tokens.
- *
- * Requires:
- *\li 'lex' is a valid lexer.
- *
- *\li 'token' is a valid pointer
- *
- * Returns:
- *
- * \li any return code from isc_lex_gettoken().
- */
-
-isc_result_t
-isc_lex_getoctaltoken(isc_lex_t *lex, isc_token_t *token, isc_boolean_t eol);
-/*%<
- * Get the next token from a DNS master file type stream. This is a
- * convenience function that sets appropriate options and handles end
- * of line correctly for master files. It also ungets unexpected tokens.
- *
- * Requires:
- *\li 'lex' is a valid lexer.
- *
- *\li 'token' is a valid pointer
- *
- * Returns:
- *
- * \li any return code from isc_lex_gettoken().
- */
-
-void
-isc_lex_ungettoken(isc_lex_t *lex, isc_token_t *tokenp);
-/*%<
- * Unget the current token.
- *
- * Requires:
- *\li 'lex' is a valid lexer.
- *
- *\li 'lex' has an input source.
- *
- *\li 'tokenp' points to a valid token.
- *
- *\li There is no ungotten token already.
- */
-
-void
-isc_lex_getlasttokentext(isc_lex_t *lex, isc_token_t *tokenp, isc_region_t *r);
-/*%<
- * Returns a region containing the text of the last token returned.
- *
- * Requires:
- *\li 'lex' is a valid lexer.
- *
- *\li 'lex' has an input source.
- *
- *\li 'tokenp' points to a valid token.
- *
- *\li A token has been gotten and not ungotten.
- */
-
-char *
-isc_lex_getsourcename(isc_lex_t *lex);
-/*%<
- * Return the input source name.
- *
- * Requires:
- *\li 'lex' is a valid lexer.
- *
- * Returns:
- * \li source name or NULL if no current source.
- *\li result valid while current input source exists.
- */
-
-
-unsigned long
-isc_lex_getsourceline(isc_lex_t *lex);
-/*%<
- * Return the input source line number.
- *
- * Requires:
- *\li 'lex' is a valid lexer.
- *
- * Returns:
- *\li Current line number or 0 if no current source.
- */
-
-isc_result_t
-isc_lex_setsourcename(isc_lex_t *lex, const char *name);
-/*%<
- * Assigns a new name to the input source.
- *
- * Requires:
- *
- * \li 'lex' is a valid lexer.
- *
- * Returns:
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
- * \li #ISC_R_NOTFOUND - there are no sources.
- */
-
-isc_boolean_t
-isc_lex_isfile(isc_lex_t *lex);
-/*%<
- * Return whether the current input source is a file.
- *
- * Requires:
- *\li 'lex' is a valid lexer.
- *
- * Returns:
- * \li #ISC_TRUE if the current input is a file,
- *\li #ISC_FALSE otherwise.
- */
-
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_LEX_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: lfsr.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_LFSR_H
-#define ISC_LFSR_H 1
-
-/*! \file isc/lfsr.h */
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-typedef struct isc_lfsr isc_lfsr_t;
-
-/*%
- * This function is called when reseeding is needed. It is allowed to
- * modify any state in the LFSR in any way it sees fit OTHER THAN "bits".
- *
- * It MUST set "count" to a new value or the lfsr will never reseed again.
- *
- * Also, a reseed will never occur in the middle of an extraction. This
- * is purely an optimization, and is probably what one would want.
- */
-typedef void (*isc_lfsrreseed_t)(isc_lfsr_t *, void *);
-
-/*%
- * The members of this structure can be used by the application, but care
- * needs to be taken to not change state once the lfsr is in operation.
- */
-struct isc_lfsr {
- isc_uint32_t state; /*%< previous state */
- unsigned int bits; /*%< length */
- isc_uint32_t tap; /*%< bit taps */
- unsigned int count; /*%< reseed count (in BITS!) */
- isc_lfsrreseed_t reseed; /*%< reseed function */
- void *arg; /*%< reseed function argument */
-};
-
-ISC_LANG_BEGINDECLS
-
-
-void
-isc_lfsr_init(isc_lfsr_t *lfsr, isc_uint32_t state, unsigned int bits,
- isc_uint32_t tap, unsigned int count,
- isc_lfsrreseed_t reseed, void *arg);
-/*%<
- * Initialize an LFSR.
- *
- * Note:
- *
- *\li Putting untrusted values into this function will cause the LFSR to
- * generate (perhaps) non-maximal length sequences.
- *
- * Requires:
- *
- *\li lfsr != NULL
- *
- *\li 8 <= bits <= 32
- *
- *\li tap != 0
- */
-
-void
-isc_lfsr_generate(isc_lfsr_t *lfsr, void *data, unsigned int count);
-/*%<
- * Returns "count" bytes of data from the LFSR.
- *
- * Requires:
- *
- *\li lfsr be valid.
- *
- *\li data != NULL.
- *
- *\li count > 0.
- */
-
-void
-isc_lfsr_skip(isc_lfsr_t *lfsr, unsigned int skip);
-/*%<
- * Skip "skip" states.
- *
- * Requires:
- *
- *\li lfsr be valid.
- */
-
-isc_uint32_t
-isc_lfsr_generate32(isc_lfsr_t *lfsr1, isc_lfsr_t *lfsr2);
-/*%<
- * Given two LFSRs, use the current state from each to skip entries in the
- * other. The next states are then xor'd together and returned.
- *
- * WARNING:
- *
- *\li This function is used only for very, very low security data, such
- * as DNS message IDs where it is desired to have an unpredictable
- * stream of bytes that are harder to predict than a simple flooding
- * attack.
- *
- * Notes:
- *
- *\li Since the current state from each of the LFSRs is used to skip
- * state in the other, it is important that no state be leaked
- * from either LFSR.
- *
- * Requires:
- *
- *\li lfsr1 and lfsr2 be valid.
- *
- *\li 1 <= skipbits <= 31
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_LFSR_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: lib.h,v 1.14 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_LIB_H
-#define ISC_LIB_H 1
-
-/*! \file isc/lib.h */
-
-#include <isc/types.h>
-#include <isc/lang.h>
-
-ISC_LANG_BEGINDECLS
-
-LIBISC_EXTERNAL_DATA extern isc_msgcat_t *isc_msgcat;
-
-void
-isc_lib_initmsgcat(void);
-/*!<
- * \brief Initialize the ISC library's message catalog, isc_msgcat, if it
- * has not already been initialized.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_LIB_H */
+++ /dev/null
-/*
- * Copyright (C) 2004, 2006, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1997-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: list.h,v 1.24 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_LIST_H
-#define ISC_LIST_H 1
-#include <isc/boolean.h>
-#include <isc/assertions.h>
-
-#ifdef ISC_LIST_CHECKINIT
-#define ISC_LINK_INSIST(x) ISC_INSIST(x)
-#else
-#define ISC_LINK_INSIST(x)
-#endif
-
-#define ISC_LIST(type) struct { type *head, *tail; }
-#define ISC_LIST_INIT(list) \
- do { (list).head = NULL; (list).tail = NULL; } while (0)
-
-#define ISC_LINK(type) struct { type *prev, *next; }
-#define ISC_LINK_INIT_TYPE(elt, link, type) \
- do { \
- (elt)->link.prev = (type *)(-1); \
- (elt)->link.next = (type *)(-1); \
- } while (0)
-#define ISC_LINK_INIT(elt, link) \
- ISC_LINK_INIT_TYPE(elt, link, void)
-#define ISC_LINK_LINKED(elt, link) ((void *)((elt)->link.prev) != (void *)(-1))
-
-#define ISC_LIST_HEAD(list) ((list).head)
-#define ISC_LIST_TAIL(list) ((list).tail)
-#define ISC_LIST_EMPTY(list) ISC_TF((list).head == NULL)
-
-#define __ISC_LIST_PREPENDUNSAFE(list, elt, link) \
- do { \
- if ((list).head != NULL) \
- (list).head->link.prev = (elt); \
- else \
- (list).tail = (elt); \
- (elt)->link.prev = NULL; \
- (elt)->link.next = (list).head; \
- (list).head = (elt); \
- } while (0)
-
-#define ISC_LIST_PREPEND(list, elt, link) \
- do { \
- ISC_LINK_INSIST(!ISC_LINK_LINKED(elt, link)); \
- __ISC_LIST_PREPENDUNSAFE(list, elt, link); \
- } while (0)
-
-#define ISC_LIST_INITANDPREPEND(list, elt, link) \
- __ISC_LIST_PREPENDUNSAFE(list, elt, link)
-
-#define __ISC_LIST_APPENDUNSAFE(list, elt, link) \
- do { \
- if ((list).tail != NULL) \
- (list).tail->link.next = (elt); \
- else \
- (list).head = (elt); \
- (elt)->link.prev = (list).tail; \
- (elt)->link.next = NULL; \
- (list).tail = (elt); \
- } while (0)
-
-#define ISC_LIST_APPEND(list, elt, link) \
- do { \
- ISC_LINK_INSIST(!ISC_LINK_LINKED(elt, link)); \
- __ISC_LIST_APPENDUNSAFE(list, elt, link); \
- } while (0)
-
-#define ISC_LIST_INITANDAPPEND(list, elt, link) \
- __ISC_LIST_APPENDUNSAFE(list, elt, link)
-
-#define __ISC_LIST_UNLINKUNSAFE_TYPE(list, elt, link, type) \
- do { \
- if ((elt)->link.next != NULL) \
- (elt)->link.next->link.prev = (elt)->link.prev; \
- else { \
- ISC_INSIST((list).tail == (elt)); \
- (list).tail = (elt)->link.prev; \
- } \
- if ((elt)->link.prev != NULL) \
- (elt)->link.prev->link.next = (elt)->link.next; \
- else { \
- ISC_INSIST((list).head == (elt)); \
- (list).head = (elt)->link.next; \
- } \
- (elt)->link.prev = (type *)(-1); \
- (elt)->link.next = (type *)(-1); \
- } while (0)
-
-#define __ISC_LIST_UNLINKUNSAFE(list, elt, link) \
- __ISC_LIST_UNLINKUNSAFE_TYPE(list, elt, link, void)
-
-#define ISC_LIST_UNLINK_TYPE(list, elt, link, type) \
- do { \
- ISC_LINK_INSIST(ISC_LINK_LINKED(elt, link)); \
- __ISC_LIST_UNLINKUNSAFE_TYPE(list, elt, link, type); \
- } while (0)
-#define ISC_LIST_UNLINK(list, elt, link) \
- ISC_LIST_UNLINK_TYPE(list, elt, link, void)
-
-#define ISC_LIST_PREV(elt, link) ((elt)->link.prev)
-#define ISC_LIST_NEXT(elt, link) ((elt)->link.next)
-
-#define __ISC_LIST_INSERTBEFOREUNSAFE(list, before, elt, link) \
- do { \
- if ((before)->link.prev == NULL) \
- ISC_LIST_PREPEND(list, elt, link); \
- else { \
- (elt)->link.prev = (before)->link.prev; \
- (before)->link.prev = (elt); \
- (elt)->link.prev->link.next = (elt); \
- (elt)->link.next = (before); \
- } \
- } while (0)
-
-#define ISC_LIST_INSERTBEFORE(list, before, elt, link) \
- do { \
- ISC_LINK_INSIST(ISC_LINK_LINKED(before, link)); \
- ISC_LINK_INSIST(!ISC_LINK_LINKED(elt, link)); \
- __ISC_LIST_INSERTBEFOREUNSAFE(list, before, elt, link); \
- } while (0)
-
-#define __ISC_LIST_INSERTAFTERUNSAFE(list, after, elt, link) \
- do { \
- if ((after)->link.next == NULL) \
- ISC_LIST_APPEND(list, elt, link); \
- else { \
- (elt)->link.next = (after)->link.next; \
- (after)->link.next = (elt); \
- (elt)->link.next->link.prev = (elt); \
- (elt)->link.prev = (after); \
- } \
- } while (0)
-
-#define ISC_LIST_INSERTAFTER(list, after, elt, link) \
- do { \
- ISC_LINK_INSIST(ISC_LINK_LINKED(after, link)); \
- ISC_LINK_INSIST(!ISC_LINK_LINKED(elt, link)); \
- __ISC_LIST_INSERTAFTERUNSAFE(list, after, elt, link); \
- } while (0)
-
-#define ISC_LIST_APPENDLIST(list1, list2, link) \
- do { \
- if (ISC_LIST_EMPTY(list1)) \
- (list1) = (list2); \
- else if (!ISC_LIST_EMPTY(list2)) { \
- (list1).tail->link.next = (list2).head; \
- (list2).head->link.prev = (list1).tail; \
- (list1).tail = (list2).tail; \
- } \
- (list2).head = NULL; \
- (list2).tail = NULL; \
- } while (0)
-
-#define ISC_LIST_ENQUEUE(list, elt, link) ISC_LIST_APPEND(list, elt, link)
-#define __ISC_LIST_ENQUEUEUNSAFE(list, elt, link) \
- __ISC_LIST_APPENDUNSAFE(list, elt, link)
-#define ISC_LIST_DEQUEUE(list, elt, link) \
- ISC_LIST_UNLINK_TYPE(list, elt, link, void)
-#define ISC_LIST_DEQUEUE_TYPE(list, elt, link, type) \
- ISC_LIST_UNLINK_TYPE(list, elt, link, type)
-#define __ISC_LIST_DEQUEUEUNSAFE(list, elt, link) \
- __ISC_LIST_UNLINKUNSAFE_TYPE(list, elt, link, void)
-#define __ISC_LIST_DEQUEUEUNSAFE_TYPE(list, elt, link, type) \
- __ISC_LIST_UNLINKUNSAFE_TYPE(list, elt, link, type)
-
-#endif /* ISC_LIST_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: log.h,v 1.54.332.5 2009/02/16 02:04:05 marka Exp $ */
-
-#ifndef ISC_LOG_H
-#define ISC_LOG_H 1
-
-/*! \file isc/log.h */
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <syslog.h> /* XXXDCL NT */
-
-#include <isc/formatcheck.h>
-#include <isc/lang.h>
-#include <isc/platform.h>
-#include <isc/types.h>
-
-/*@{*/
-/*!
- * \brief Severity levels, patterned after Unix's syslog levels.
- *
- */
-#define ISC_LOG_DEBUG(level) (level)
-/*!
- * #ISC_LOG_DYNAMIC can only be used for defining channels with
- * isc_log_createchannel(), not to specify a level in isc_log_write().
- */
-#define ISC_LOG_DYNAMIC 0
-#define ISC_LOG_INFO (-1)
-#define ISC_LOG_NOTICE (-2)
-#define ISC_LOG_WARNING (-3)
-#define ISC_LOG_ERROR (-4)
-#define ISC_LOG_CRITICAL (-5)
-/*@}*/
-
-/*@{*/
-/*!
- * \brief Destinations.
- */
-#define ISC_LOG_TONULL 1
-#define ISC_LOG_TOSYSLOG 2
-#define ISC_LOG_TOFILE 3
-#define ISC_LOG_TOFILEDESC 4
-/*@}*/
-
-/*@{*/
-/*%
- * Channel flags.
- */
-#define ISC_LOG_PRINTTIME 0x0001
-#define ISC_LOG_PRINTLEVEL 0x0002
-#define ISC_LOG_PRINTCATEGORY 0x0004
-#define ISC_LOG_PRINTMODULE 0x0008
-#define ISC_LOG_PRINTTAG 0x0010
-#define ISC_LOG_PRINTALL 0x001F
-#define ISC_LOG_DEBUGONLY 0x1000
-#define ISC_LOG_OPENERR 0x8000 /* internal */
-/*@}*/
-
-/*@{*/
-/*!
- * \brief Other options.
- *
- * XXXDCL INFINITE doesn't yet work. Arguably it isn't needed, but
- * since I am intend to make large number of versions work efficiently,
- * INFINITE is going to be trivial to add to that.
- */
-#define ISC_LOG_ROLLINFINITE (-1)
-#define ISC_LOG_ROLLNEVER (-2)
-/*@}*/
-
-/*!
- * \brief Used to name the categories used by a library.
- *
- * An array of isc_logcategory
- * structures names each category, and the id value is initialized by calling
- * isc_log_registercategories.
- */
-struct isc_logcategory {
- const char *name;
- unsigned int id;
-};
-
-/*%
- * Similar to isc_logcategory, but for all the modules a library defines.
- */
-struct isc_logmodule {
- const char *name;
- unsigned int id;
-};
-
-/*%
- * The isc_logfile structure is initialized as part of an isc_logdestination
- * before calling isc_log_createchannel().
- *
- * When defining an #ISC_LOG_TOFILE
- * channel the name, versions and maximum_size should be set before calling
- * isc_log_createchannel(). To define an #ISC_LOG_TOFILEDESC channel set only
- * the stream before the call.
- *
- * Setting maximum_size to zero implies no maximum.
- */
-typedef struct isc_logfile {
- FILE *stream; /*%< Initialized to NULL for #ISC_LOG_TOFILE. */
- const char *name; /*%< NULL for #ISC_LOG_TOFILEDESC. */
- int versions; /* >= 0, #ISC_LOG_ROLLNEVER, #ISC_LOG_ROLLINFINITE. */
- /*%
- * stdio's ftell is standardized to return a long, which may well not
- * be big enough for the largest file supportable by the operating
- * system (though it is _probably_ big enough for the largest log
- * anyone would want). st_size returned by fstat should be typedef'd
- * to a size large enough for the largest possible file on a system.
- */
- isc_offset_t maximum_size;
- isc_boolean_t maximum_reached; /*%< Private. */
-} isc_logfile_t;
-
-/*%
- * Passed to isc_log_createchannel to define the attributes of either
- * a stdio or a syslog log.
- */
-typedef union isc_logdestination {
- isc_logfile_t file;
- int facility; /* XXXDCL NT */
-} isc_logdestination_t;
-
-/*@{*/
-/*%
- * The built-in categories of libisc.
- *
- * Each library registering categories should provide library_LOGCATEGORY_name
- * definitions with indexes into its isc_logcategory structure corresponding to
- * the order of the names.
- */
-LIBISC_EXTERNAL_DATA extern isc_logcategory_t isc_categories[];
-LIBISC_EXTERNAL_DATA extern isc_log_t *isc_lctx;
-LIBISC_EXTERNAL_DATA extern isc_logmodule_t isc_modules[];
-/*@}*/
-
-/*@{*/
-/*%
- * Do not log directly to DEFAULT. Use another category. When in doubt,
- * use GENERAL.
- */
-#define ISC_LOGCATEGORY_DEFAULT (&isc_categories[0])
-#define ISC_LOGCATEGORY_GENERAL (&isc_categories[1])
-/*@}*/
-
-#define ISC_LOGMODULE_SOCKET (&isc_modules[0])
-#define ISC_LOGMODULE_TIME (&isc_modules[1])
-#define ISC_LOGMODULE_INTERFACE (&isc_modules[2])
-#define ISC_LOGMODULE_TIMER (&isc_modules[3])
-#define ISC_LOGMODULE_FILE (&isc_modules[4])
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-isc_log_create(isc_mem_t *mctx, isc_log_t **lctxp, isc_logconfig_t **lcfgp);
-/*%<
- * Establish a new logging context, with default channels.
- *
- * Notes:
- *\li isc_log_create() calls isc_logconfig_create(), so see its comment
- * below for more information.
- *
- * Requires:
- *\li mctx is a valid memory context.
- *\li lctxp is not null and *lctxp is null.
- *\li lcfgp is null or lcfgp is not null and *lcfgp is null.
- *
- * Ensures:
- *\li *lctxp will point to a valid logging context if all of the necessary
- * memory was allocated, or NULL otherwise.
- *\li *lcfgp will point to a valid logging configuration if all of the
- * necessary memory was allocated, or NULL otherwise.
- *\li On failure, no additional memory is allocated.
- *
- * Returns:
- *\li #ISC_R_SUCCESS Success
- *\li #ISC_R_NOMEMORY Resource limit: Out of memory
- */
-
-isc_result_t
-isc_logconfig_create(isc_log_t *lctx, isc_logconfig_t **lcfgp);
-/*%<
- * Create the data structure that holds all of the configurable information
- * about where messages are actually supposed to be sent -- the information
- * that could changed based on some configuration file, as opposed to the
- * the category/module specification of isc_log_[v]write[1] that is compiled
- * into a program, or the debug_level which is dynamic state information.
- *
- * Notes:
- *\li It is necessary to specify the logging context the configuration
- * will be used with because the number of categories and modules
- * needs to be known in order to set the configuration. However,
- * the configuration is not used by the logging context until the
- * isc_logconfig_use function is called.
- *
- *\li The memory context used for operations that allocate memory for
- * the configuration is that of the logging context, as specified
- * in the isc_log_create call.
- *
- *\li Four default channels are established:
- *\verbatim
- * default_syslog
- * - log to syslog's daemon facility #ISC_LOG_INFO or higher
- * default_stderr
- * - log to stderr #ISC_LOG_INFO or higher
- * default_debug
- * - log to stderr #ISC_LOG_DEBUG dynamically
- * null
- * - log nothing
- *\endverbatim
- *
- * Requires:
- *\li lctx is a valid logging context.
- *\li lcftp is not null and *lcfgp is null.
- *
- * Ensures:
- *\li *lcfgp will point to a valid logging context if all of the necessary
- * memory was allocated, or NULL otherwise.
- *\li On failure, no additional memory is allocated.
- *
- * Returns:
- *\li #ISC_R_SUCCESS Success
- *\li #ISC_R_NOMEMORY Resource limit: Out of memory
- */
-
-isc_logconfig_t *
-isc_logconfig_get(isc_log_t *lctx);
-/*%<
- * Returns a pointer to the configuration currently in use by the log context.
- *
- * Requires:
- *\li lctx is a valid context.
- *
- * Ensures:
- *\li The configuration pointer is non-null.
- *
- * Returns:
- *\li The configuration pointer.
- */
-
-isc_result_t
-isc_logconfig_use(isc_log_t *lctx, isc_logconfig_t *lcfg);
-/*%<
- * Associate a new configuration with a logging context.
- *
- * Notes:
- *\li This is thread safe. The logging context will lock a mutex
- * before attempting to swap in the new configuration, and isc_log_doit
- * (the internal function used by all of isc_log_[v]write[1]) locks
- * the same lock for the duration of its use of the configuration.
- *
- * Requires:
- *\li lctx is a valid logging context.
- *\li lcfg is a valid logging configuration.
- *\li lctx is the same configuration given to isc_logconfig_create
- * when the configuration was created.
- *
- * Ensures:
- *\li Future calls to isc_log_write will use the new configuration.
- *
- * Returns:
- *\li #ISC_R_SUCCESS Success
- *\li #ISC_R_NOMEMORY Resource limit: Out of memory
- */
-
-void
-isc_log_destroy(isc_log_t **lctxp);
-/*%<
- * Deallocate the memory associated with a logging context.
- *
- * Requires:
- *\li *lctx is a valid logging context.
- *
- * Ensures:
- *\li All of the memory associated with the logging context is returned
- * to the free memory pool.
- *
- *\li Any open files are closed.
- *
- *\li The logging context is marked as invalid.
- */
-
-void
-isc_logconfig_destroy(isc_logconfig_t **lcfgp);
-/*%<
- * Destroy a logging configuration.
- *
- * Notes:
- *\li This function cannot be used directly with the return value of
- * isc_logconfig_get, because a logging context must always have
- * a valid configuration associated with it.
- *
- * Requires:
- *\li lcfgp is not null and *lcfgp is a valid logging configuration.
- *\li The logging configuration is not in use by an existing logging context.
- *
- * Ensures:
- *\li All memory allocated for the configuration is freed.
- *
- *\li The configuration is marked as invalid.
- */
-
-void
-isc_log_registercategories(isc_log_t *lctx, isc_logcategory_t categories[]);
-/*%<
- * Identify logging categories a library will use.
- *
- * Notes:
- *\li A category should only be registered once, but no mechanism enforces
- * this rule.
- *
- *\li The end of the categories array is identified by a NULL name.
- *
- *\li Because the name is used by #ISC_LOG_PRINTCATEGORY, it should not
- * be altered or destroyed after isc_log_registercategories().
- *
- *\li Because each element of the categories array is used by
- * isc_log_categorybyname, it should not be altered or destroyed
- * after registration.
- *
- *\li The value of the id integer in each structure is overwritten
- * by this function, and so id need not be initialized to any particular
- * value prior to the function call.
- *
- *\li A subsequent call to isc_log_registercategories with the same
- * logging context (but new categories) will cause the last
- * element of the categories array from the prior call to have
- * its "name" member changed from NULL to point to the new
- * categories array, and its "id" member set to UINT_MAX.
- *
- * Requires:
- *\li lctx is a valid logging context.
- *\li categories != NULL.
- *\li categories[0].name != NULL.
- *
- * Ensures:
- * \li There are references to each category in the logging context,
- * so they can be used with isc_log_usechannel() and isc_log_write().
- */
-
-void
-isc_log_registermodules(isc_log_t *lctx, isc_logmodule_t modules[]);
-/*%<
- * Identify logging categories a library will use.
- *
- * Notes:
- *\li A module should only be registered once, but no mechanism enforces
- * this rule.
- *
- *\li The end of the modules array is identified by a NULL name.
- *
- *\li Because the name is used by #ISC_LOG_PRINTMODULE, it should not
- * be altered or destroyed after isc_log_registermodules().
- *
- *\li Because each element of the modules array is used by
- * isc_log_modulebyname, it should not be altered or destroyed
- * after registration.
- *
- *\li The value of the id integer in each structure is overwritten
- * by this function, and so id need not be initialized to any particular
- * value prior to the function call.
- *
- *\li A subsequent call to isc_log_registermodules with the same
- * logging context (but new modules) will cause the last
- * element of the modules array from the prior call to have
- * its "name" member changed from NULL to point to the new
- * modules array, and its "id" member set to UINT_MAX.
- *
- * Requires:
- *\li lctx is a valid logging context.
- *\li modules != NULL.
- *\li modules[0].name != NULL;
- *
- * Ensures:
- *\li Each module has a reference in the logging context, so they can be
- * used with isc_log_usechannel() and isc_log_write().
- */
-
-isc_result_t
-isc_log_createchannel(isc_logconfig_t *lcfg, const char *name,
- unsigned int type, int level,
- const isc_logdestination_t *destination,
- unsigned int flags);
-/*%<
- * Specify the parameters of a logging channel.
- *
- * Notes:
- *\li The name argument is copied to memory in the logging context, so
- * it can be altered or destroyed after isc_log_createchannel().
- *
- *\li Defining a very large number of channels will have a performance
- * impact on isc_log_usechannel(), since the names are searched
- * linearly until a match is made. This same issue does not affect
- * isc_log_write, however.
- *
- *\li Channel names can be redefined; this is primarily useful for programs
- * that want their own definition of default_syslog, default_debug
- * and default_stderr.
- *
- *\li Any channel that is redefined will not affect logging that was
- * already directed to its original definition, _except_ for the
- * default_stderr channel. This case is handled specially so that
- * the default logging category can be changed by redefining
- * default_stderr. (XXXDCL Though now that I think of it, the default
- * logging category can be changed with only one additional function
- * call by defining a new channel and then calling isc_log_usechannel()
- * for #ISC_LOGCATEGORY_DEFAULT.)
- *
- *\li Specifying #ISC_LOG_PRINTTIME or #ISC_LOG_PRINTTAG for syslog is allowed,
- * but probably not what you wanted to do.
- *
- * #ISC_LOG_DEBUGONLY will mark the channel as usable only when the
- * debug level of the logging context (see isc_log_setdebuglevel)
- * is non-zero.
- *
- * Requires:
- *\li lcfg is a valid logging configuration.
- *
- *\li name is not NULL.
- *
- *\li type is #ISC_LOG_TOSYSLOG, #ISC_LOG_TOFILE, #ISC_LOG_TOFILEDESC or
- * #ISC_LOG_TONULL.
- *
- *\li destination is not NULL unless type is #ISC_LOG_TONULL.
- *
- *\li level is >= #ISC_LOG_CRITICAL (the most negative logging level).
- *
- *\li flags does not include any bits aside from the ISC_LOG_PRINT* bits
- * or #ISC_LOG_DEBUGONLY.
- *
- * Ensures:
- *\li #ISC_R_SUCCESS
- * A channel with the given name is usable with
- * isc_log_usechannel().
- *
- *\li #ISC_R_NOMEMORY or #ISC_R_UNEXPECTED
- * No additional memory is being used by the logging context.
- * Any channel that previously existed with the given name
- * is not redefined.
- *
- * Returns:
- *\li #ISC_R_SUCCESS Success
- *\li #ISC_R_NOMEMORY Resource limit: Out of memory
- *\li #ISC_R_UNEXPECTED type was out of range and REQUIRE()
- * was disabled.
- */
-
-isc_result_t
-isc_log_usechannel(isc_logconfig_t *lcfg, const char *name,
- const isc_logcategory_t *category,
- const isc_logmodule_t *module);
-/*%<
- * Associate a named logging channel with a category and module that
- * will use it.
- *
- * Notes:
- *\li The name is searched for linearly in the set of known channel names
- * until a match is found. (Note the performance impact of a very large
- * number of named channels.) When multiple channels of the same
- * name are defined, the most recent definition is found.
- *
- *\li Specifying a very large number of channels for a category will have
- * a moderate impact on performance in isc_log_write(), as each
- * call looks up the category for the start of a linked list, which
- * it follows all the way to the end to find matching modules. The
- * test for matching modules is integral, though.
- *
- *\li If category is NULL, then the channel is associated with the indicated
- * module for all known categories (including the "default" category).
- *
- *\li If module is NULL, then the channel is associated with every module
- * that uses that category.
- *
- *\li Passing both category and module as NULL would make every log message
- * use the indicated channel.
- *
- * \li Specifying a channel that is #ISC_LOG_TONULL for a category/module pair
- * has no effect on any other channels associated with that pair,
- * regardless of ordering. Thus you cannot use it to "mask out" one
- * category/module pair when you have specified some other channel that
- * is also used by that category/module pair.
- *
- * Requires:
- *\li lcfg is a valid logging configuration.
- *
- *\li category is NULL or has an id that is in the range of known ids.
- *
- * module is NULL or has an id that is in the range of known ids.
- *
- * Ensures:
- *\li #ISC_R_SUCCESS
- * The channel will be used by the indicated category/module
- * arguments.
- *
- *\li #ISC_R_NOMEMORY
- * If assignment for a specific category has been requested,
- * the channel has not been associated with the indicated
- * category/module arguments and no additional memory is
- * used by the logging context.
- * If assignment for all categories has been requested
- * then _some_ may have succeeded (starting with category
- * "default" and progressing through the order of categories
- * passed to isc_log_registercategories()) and additional memory
- * is being used by whatever assignments succeeded.
- *
- * Returns:
- *\li #ISC_R_SUCCESS Success
- *\li #ISC_R_NOMEMORY Resource limit: Out of memory
- */
-
-/* Attention: next four comments PRECEED code */
-/*!
- * \brief
- * Write a message to the log channels.
- *
- * Notes:
- *\li Log messages containing natural language text should be logged with
- * isc_log_iwrite() to allow for localization.
- *
- *\li lctx can be NULL; this is allowed so that programs which use
- * libraries that use the ISC logging system are not required to
- * also use it.
- *
- *\li The format argument is a printf(3) string, with additional arguments
- * as necessary.
- *
- * Requires:
- *\li lctx is a valid logging context.
- *
- *\li The category and module arguments must have ids that are in the
- * range of known ids, as established by isc_log_registercategories()
- * and isc_log_registermodules().
- *
- *\li level != #ISC_LOG_DYNAMIC. ISC_LOG_DYNAMIC is used only to define
- * channels, and explicit debugging level must be identified for
- * isc_log_write() via ISC_LOG_DEBUG(level).
- *
- *\li format != NULL.
- *
- * Ensures:
- *\li The log message is written to every channel associated with the
- * indicated category/module pair.
- *
- * Returns:
- *\li Nothing. Failure to log a message is not construed as a
- * meaningful error.
- */
-void
-isc_log_write(isc_log_t *lctx, isc_logcategory_t *category,
- isc_logmodule_t *module, int level,
- const char *format, ...)
-
-ISC_FORMAT_PRINTF(5, 6);
-
-/*%
- * Write a message to the log channels.
- *
- * Notes:
- *\li lctx can be NULL; this is allowed so that programs which use
- * libraries that use the ISC logging system are not required to
- * also use it.
- *
- *\li The format argument is a printf(3) string, with additional arguments
- * as necessary.
- *
- * Requires:
- *\li lctx is a valid logging context.
- *
- *\li The category and module arguments must have ids that are in the
- * range of known ids, as established by isc_log_registercategories()
- * and isc_log_registermodules().
- *
- *\li level != #ISC_LOG_DYNAMIC. ISC_LOG_DYNAMIC is used only to define
- * channels, and explicit debugging level must be identified for
- * isc_log_write() via ISC_LOG_DEBUG(level).
- *
- *\li format != NULL.
- *
- * Ensures:
- *\li The log message is written to every channel associated with the
- * indicated category/module pair.
- *
- * Returns:
- *\li Nothing. Failure to log a message is not construed as a
- * meaningful error.
- */
-void
-isc_log_vwrite(isc_log_t *lctx, isc_logcategory_t *category,
- isc_logmodule_t *module, int level,
- const char *format, va_list args)
-
-ISC_FORMAT_PRINTF(5, 0);
-
-/*%
- * Write a message to the log channels, pruning duplicates that occur within
- * a configurable amount of seconds (see isc_log_[sg]etduplicateinterval).
- * This function is otherwise identical to isc_log_write().
- */
-void
-isc_log_write1(isc_log_t *lctx, isc_logcategory_t *category,
- isc_logmodule_t *module, int level, const char *format, ...)
-
-ISC_FORMAT_PRINTF(5, 6);
-
-/*%
- * Write a message to the log channels, pruning duplicates that occur within
- * a configurable amount of seconds (see isc_log_[sg]etduplicateinterval).
- * This function is otherwise identical to isc_log_vwrite().
- */
-void
-isc_log_vwrite1(isc_log_t *lctx, isc_logcategory_t *category,
- isc_logmodule_t *module, int level, const char *format,
- va_list args)
-
-ISC_FORMAT_PRINTF(5, 0);
-
-/*%
- * These are four internationalized versions of the isc_log_[v]write[1]
- * functions.
- *
- * The only difference is that they take arguments for a message
- * catalog, message set, and message number, all immediately preceding the
- * format argument. The format argument becomes the default text, a la
- * isc_msgcat_get. If the message catalog is NULL, no lookup is attempted
- * for a message -- which makes the message set and message number irrelevant,
- * and the non-internationalized call should have probably been used instead.
- *
- * Yes, that means there are now *eight* interfaces to logging a message.
- * Sheesh. Make the madness stop!
- */
-/*@{*/
-void
-isc_log_iwrite(isc_log_t *lctx, isc_logcategory_t *category,
- isc_logmodule_t *module, int level,
- isc_msgcat_t *msgcat, int msgset, int message,
- const char *format, ...)
-ISC_FORMAT_PRINTF(8, 9);
-
-void
-isc_log_ivwrite(isc_log_t *lctx, isc_logcategory_t *category,
- isc_logmodule_t *module, int level,
- isc_msgcat_t *msgcat, int msgset, int message,
- const char *format, va_list args)
-ISC_FORMAT_PRINTF(8, 0);
-
-void
-isc_log_iwrite1(isc_log_t *lctx, isc_logcategory_t *category,
- isc_logmodule_t *module, int level,
- isc_msgcat_t *msgcat, int msgset, int message,
- const char *format, ...)
-ISC_FORMAT_PRINTF(8, 9);
-
-void
-isc_log_ivwrite1(isc_log_t *lctx, isc_logcategory_t *category,
- isc_logmodule_t *module, int level,
- isc_msgcat_t *msgcat, int msgset, int message,
- const char *format, va_list args)
-ISC_FORMAT_PRINTF(8, 0);
-/*@}*/
-
-void
-isc_log_setdebuglevel(isc_log_t *lctx, unsigned int level);
-/*%<
- * Set the debugging level used for logging.
- *
- * Notes:
- *\li Setting the debugging level to 0 disables debugging log messages.
- *
- * Requires:
- *\li lctx is a valid logging context.
- *
- * Ensures:
- *\li The debugging level is set to the requested value.
- */
-
-unsigned int
-isc_log_getdebuglevel(isc_log_t *lctx);
-/*%<
- * Get the current debugging level.
- *
- * Notes:
- *\li This is provided so that a program can have a notion of
- * "increment debugging level" or "decrement debugging level"
- * without needing to keep track of what the current level is.
- *
- *\li A return value of 0 indicates that debugging messages are disabled.
- *
- * Requires:
- *\li lctx is a valid logging context.
- *
- * Ensures:
- *\li The current logging debugging level is returned.
- */
-
-isc_boolean_t
-isc_log_wouldlog(isc_log_t *lctx, int level);
-/*%<
- * Determine whether logging something to 'lctx' at 'level' would
- * actually cause something to be logged somewhere.
- *
- * If #ISC_FALSE is returned, it is guaranteed that nothing would
- * be logged, allowing the caller to omit unnecessary
- * isc_log_write() calls and possible message preformatting.
- */
-
-void
-isc_log_setduplicateinterval(isc_logconfig_t *lcfg, unsigned int interval);
-/*%<
- * Set the interval over which duplicate log messages will be ignored
- * by isc_log_[v]write1(), in seconds.
- *
- * Notes:
- *\li Increasing the duplicate interval from X to Y will not necessarily
- * filter out duplicates of messages logged in Y - X seconds since the
- * increase. (Example: Message1 is logged at midnight. Message2
- * is logged at 00:01:00, when the interval is only 30 seconds, causing
- * Message1 to be expired from the log message history. Then the interval
- * is increased to 3000 (five minutes) and at 00:04:00 Message1 is logged
- * again. It will appear the second time even though less than five
- * passed since the first occurrence.
- *
- * Requires:
- *\li lctx is a valid logging context.
- */
-
-unsigned int
-isc_log_getduplicateinterval(isc_logconfig_t *lcfg);
-/*%<
- * Get the current duplicate filtering interval.
- *
- * Requires:
- *\li lctx is a valid logging context.
- *
- * Returns:
- *\li The current duplicate filtering interval.
- */
-
-isc_result_t
-isc_log_settag(isc_logconfig_t *lcfg, const char *tag);
-/*%<
- * Set the program name or other identifier for #ISC_LOG_PRINTTAG.
- *
- * Requires:
- *\li lcfg is a valid logging configuration.
- *
- * Notes:
- *\li If this function has not set the tag to a non-NULL, non-empty value,
- * then the #ISC_LOG_PRINTTAG channel flag will not print anything.
- * Unlike some implementations of syslog on Unix systems, you *must* set
- * the tag in order to get it logged. It is not implicitly derived from
- * the program name (which is pretty impossible to infer portably).
- *
- *\li Setting the tag to NULL or the empty string will also cause the
- * #ISC_LOG_PRINTTAG channel flag to not print anything. If tag equals the
- * empty string, calls to isc_log_gettag will return NULL.
- *
- * Returns:
- *\li #ISC_R_SUCCESS Success
- *\li #ISC_R_NOMEMORY Resource Limit: Out of memory
- *
- * XXXDCL when creating a new isc_logconfig_t, it might be nice if the tag
- * of the currently active isc_logconfig_t was inherited. this does not
- * currently happen.
- */
-
-char *
-isc_log_gettag(isc_logconfig_t *lcfg);
-/*%<
- * Get the current identifier printed with #ISC_LOG_PRINTTAG.
- *
- * Requires:
- *\li lcfg is a valid logging configuration.
- *
- * Notes:
- *\li Since isc_log_settag() will not associate a zero-length string
- * with the logging configuration, attempts to do so will cause
- * this function to return NULL. However, a determined programmer
- * will observe that (currently) a tag of length greater than zero
- * could be set, and then modified to be zero length.
- *
- * Returns:
- *\li A pointer to the current identifier, or NULL if none has been set.
- */
-
-void
-isc_log_opensyslog(const char *tag, int options, int facility);
-/*%<
- * Initialize syslog logging.
- *
- * Notes:
- *\li XXXDCL NT
- * This is currently equivalent to openlog(), but is not going to remain
- * that way. In the meantime, the arguments are all identical to
- * those used by openlog(3), as follows:
- *
- * \code
- * tag: The string to use in the position of the program
- * name in syslog messages. Most (all?) syslogs
- * will use basename(argv[0]) if tag is NULL.
- *
- * options: LOG_CONS, LOG_PID, LOG_NDELAY ... whatever your
- * syslog supports.
- *
- * facility: The default syslog facility. This is irrelevant
- * since isc_log_write will ALWAYS use the channel's
- * declared facility.
- * \endcode
- *
- *\li Zero effort has been made (yet) to accommodate systems with openlog()
- * that only takes two arguments, or to identify valid syslog
- * facilities or options for any given architecture.
- *
- *\li It is necessary to call isc_log_opensyslog() to initialize
- * syslogging on machines which do not support network connections to
- * syslogd because they require a Unix domain socket to be used. Since
- * this is a chore to determine at run-time, it is suggested that it
- * always be called by programs using the ISC logging system.
- *
- * Requires:
- *\li Nothing.
- *
- * Ensures:
- *\li openlog() is called to initialize the syslog system.
- */
-
-void
-isc_log_closefilelogs(isc_log_t *lctx);
-/*%<
- * Close all open files used by #ISC_LOG_TOFILE channels.
- *
- * Notes:
- *\li This function is provided for programs that want to use their own
- * log rolling mechanism rather than the one provided internally.
- * For example, a program that wanted to keep daily logs would define
- * a channel which used #ISC_LOG_ROLLNEVER, then once a day would
- * rename the log file and call isc_log_closefilelogs().
- *
- *\li #ISC_LOG_TOFILEDESC channels are unaffected.
- *
- * Requires:
- *\li lctx is a valid context.
- *
- * Ensures:
- *\li The open files are closed and will be reopened when they are
- * next needed.
- */
-
-isc_logcategory_t *
-isc_log_categorybyname(isc_log_t *lctx, const char *name);
-/*%<
- * Find a category by its name.
- *
- * Notes:
- *\li The string name of a category is not required to be unique.
- *
- * Requires:
- *\li lctx is a valid context.
- *\li name is not NULL.
- *
- * Returns:
- *\li A pointer to the _first_ isc_logcategory_t structure used by "name".
- *
- *\li NULL if no category exists by that name.
- */
-
-isc_logmodule_t *
-isc_log_modulebyname(isc_log_t *lctx, const char *name);
-/*%<
- * Find a module by its name.
- *
- * Notes:
- *\li The string name of a module is not required to be unique.
- *
- * Requires:
- *\li lctx is a valid context.
- *\li name is not NULL.
- *
- * Returns:
- *\li A pointer to the _first_ isc_logmodule_t structure used by "name".
- *
- *\li NULL if no module exists by that name.
- */
-
-void
-isc_log_setcontext(isc_log_t *lctx);
-/*%<
- * Sets the context used by the libisc for logging.
- *
- * Requires:
- *\li lctx be a valid context.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_LOG_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: magic.h,v 1.18 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_MAGIC_H
-#define ISC_MAGIC_H 1
-
-/*! \file isc/magic.h */
-
-typedef struct {
- unsigned int magic;
-} isc__magic_t;
-
-
-/*%
- * To use this macro the magic number MUST be the first thing in the
- * structure, and MUST be of type "unsigned int".
- * The intent of this is to allow magic numbers to be checked even though
- * the object is otherwise opaque.
- */
-#define ISC_MAGIC_VALID(a,b) (((a) != NULL) && \
- (((const isc__magic_t *)(a))->magic == (b)))
-
-#define ISC_MAGIC(a, b, c, d) ((a) << 24 | (b) << 16 | (c) << 8 | (d))
-
-#endif /* ISC_MAGIC_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: md5.h,v 1.16 2007/06/19 23:47:18 tbox Exp $ */
-
-/*! \file isc/md5.h
- * \brief This is the header file for the MD5 message-digest algorithm.
- *
- * The algorithm is due to Ron Rivest. This code was
- * written by Colin Plumb in 1993, no copyright is claimed.
- * This code is in the public domain; do with it what you wish.
- *
- * Equivalent code is available from RSA Data Security, Inc.
- * This code has been tested against that, and is equivalent,
- * except that you don't need to include two pages of legalese
- * with every copy.
- *
- * To compute the message digest of a chunk of bytes, declare an
- * MD5Context structure, pass it to MD5Init, call MD5Update as
- * needed on buffers full of bytes, and then call MD5Final, which
- * will fill a supplied 16-byte array with the digest.
- *
- * Changed so as no longer to depend on Colin Plumb's `usual.h'
- * header definitions; now uses stuff from dpkg's config.h
- * - Ian Jackson <ijackson@nyx.cs.du.edu>.
- * Still in the public domain.
- */
-
-#ifndef ISC_MD5_H
-#define ISC_MD5_H 1
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-#define ISC_MD5_DIGESTLENGTH 16U
-
-typedef struct {
- isc_uint32_t buf[4];
- isc_uint32_t bytes[2];
- isc_uint32_t in[16];
-} isc_md5_t;
-
-ISC_LANG_BEGINDECLS
-
-void
-isc_md5_init(isc_md5_t *ctx);
-
-void
-isc_md5_invalidate(isc_md5_t *ctx);
-
-void
-isc_md5_update(isc_md5_t *ctx, const unsigned char *buf, unsigned int len);
-
-void
-isc_md5_final(isc_md5_t *ctx, unsigned char *digest);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_MD5_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1997-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: mem.h,v 1.78.120.3 2009/02/11 03:07:01 jinmei Exp $ */
-
-#ifndef ISC_MEM_H
-#define ISC_MEM_H 1
-
-/*! \file isc/mem.h */
-
-#include <stdio.h>
-
-#include <isc/lang.h>
-#include <isc/mutex.h>
-#include <isc/platform.h>
-#include <isc/types.h>
-#include <isc/xml.h>
-
-ISC_LANG_BEGINDECLS
-
-#define ISC_MEM_LOWATER 0
-#define ISC_MEM_HIWATER 1
-typedef void (*isc_mem_water_t)(void *, int);
-
-typedef void * (*isc_memalloc_t)(void *, size_t);
-typedef void (*isc_memfree_t)(void *, void *);
-
-/*%
- * Define ISC_MEM_DEBUG=1 to make all functions that free memory
- * set the pointer being freed to NULL after being freed.
- * This is the default; set ISC_MEM_DEBUG=0 to disable it.
- */
-#ifndef ISC_MEM_DEBUG
-#define ISC_MEM_DEBUG 1
-#endif
-
-/*%
- * Define ISC_MEM_TRACKLINES=1 to turn on detailed tracing of memory
- * allocation and freeing by file and line number.
- */
-#ifndef ISC_MEM_TRACKLINES
-#define ISC_MEM_TRACKLINES 1
-#endif
-
-/*%
- * Define ISC_MEM_CHECKOVERRUN=1 to turn on checks for using memory outside
- * the requested space. This will increase the size of each allocation.
- */
-#ifndef ISC_MEM_CHECKOVERRUN
-#define ISC_MEM_CHECKOVERRUN 1
-#endif
-
-/*%
- * Define ISC_MEM_FILL=1 to fill each block of memory returned to the system
- * with the byte string '0xbe'. This helps track down uninitialized pointers
- * and the like. On freeing memory, the space is filled with '0xde' for
- * the same reasons.
- */
-#ifndef ISC_MEM_FILL
-#define ISC_MEM_FILL 1
-#endif
-
-/*%
- * Define ISC_MEMPOOL_NAMES=1 to make memory pools store a symbolic
- * name so that the leaking pool can be more readily identified in
- * case of a memory leak.
- */
-#ifndef ISC_MEMPOOL_NAMES
-#define ISC_MEMPOOL_NAMES 1
-#endif
-
-LIBISC_EXTERNAL_DATA extern unsigned int isc_mem_debugging;
-/*@{*/
-#define ISC_MEM_DEBUGTRACE 0x00000001U
-#define ISC_MEM_DEBUGRECORD 0x00000002U
-#define ISC_MEM_DEBUGUSAGE 0x00000004U
-#define ISC_MEM_DEBUGSIZE 0x00000008U
-#define ISC_MEM_DEBUGCTX 0x00000010U
-#define ISC_MEM_DEBUGALL 0x0000001FU
-/*!<
- * The variable isc_mem_debugging holds a set of flags for
- * turning certain memory debugging options on or off at
- * runtime. It is initialized to the value ISC_MEM_DEGBUGGING,
- * which is 0 by default but may be overridden at compile time.
- * The following flags can be specified:
- *
- * \li #ISC_MEM_DEBUGTRACE
- * Log each allocation and free to isc_lctx.
- *
- * \li #ISC_MEM_DEBUGRECORD
- * Remember each allocation, and match them up on free.
- * Crash if a free doesn't match an allocation.
- *
- * \li #ISC_MEM_DEBUGUSAGE
- * If a hi_water mark is set, print the maximum inuse memory
- * every time it is raised once it exceeds the hi_water mark.
- *
- * \li #ISC_MEM_DEBUGSIZE
- * Check the size argument being passed to isc_mem_put() matches
- * that passed to isc_mem_get().
- *
- * \li #ISC_MEM_DEBUGCTX
- * Check the mctx argument being passed to isc_mem_put() matches
- * that passed to isc_mem_get().
- */
-/*@}*/
-
-#if ISC_MEM_TRACKLINES
-#define _ISC_MEM_FILELINE , __FILE__, __LINE__
-#define _ISC_MEM_FLARG , const char *, int
-#else
-#define _ISC_MEM_FILELINE
-#define _ISC_MEM_FLARG
-#endif
-
-/*!
- * Define ISC_MEM_USE_INTERNAL_MALLOC=1 to use the internal malloc()
- * implementation in preference to the system one. The internal malloc()
- * is very space-efficient, and quite fast on uniprocessor systems. It
- * performs poorly on multiprocessor machines.
- * JT: we can overcome the performance issue on multiprocessor machines
- * by carefully separating memory contexts.
- */
-
-#ifndef ISC_MEM_USE_INTERNAL_MALLOC
-#define ISC_MEM_USE_INTERNAL_MALLOC 1
-#endif
-
-/*
- * Flags for isc_mem_create2()calls.
- */
-#define ISC_MEMFLAG_NOLOCK 0x00000001 /* no lock is necessary */
-#define ISC_MEMFLAG_INTERNAL 0x00000002 /* use internal malloc */
-#if ISC_MEM_USE_INTERNAL_MALLOC
-#define ISC_MEMFLAG_DEFAULT ISC_MEMFLAG_INTERNAL
-#else
-#define ISC_MEMFLAG_DEFAULT 0
-#endif
-
-
-#define isc_mem_get(c, s) isc__mem_get((c), (s) _ISC_MEM_FILELINE)
-#define isc_mem_allocate(c, s) isc__mem_allocate((c), (s) _ISC_MEM_FILELINE)
-#define isc_mem_reallocate(c, p, s) isc__mem_reallocate((c), (p), (s) _ISC_MEM_FILELINE)
-#define isc_mem_strdup(c, p) isc__mem_strdup((c), (p) _ISC_MEM_FILELINE)
-#define isc_mempool_get(c) isc__mempool_get((c) _ISC_MEM_FILELINE)
-
-/*%
- * isc_mem_putanddetach() is a convenience function for use where you
- * have a structure with an attached memory context.
- *
- * Given:
- *
- * \code
- * struct {
- * ...
- * isc_mem_t *mctx;
- * ...
- * } *ptr;
- *
- * isc_mem_t *mctx;
- *
- * isc_mem_putanddetach(&ptr->mctx, ptr, sizeof(*ptr));
- * \endcode
- *
- * is the equivalent of:
- *
- * \code
- * mctx = NULL;
- * isc_mem_attach(ptr->mctx, &mctx);
- * isc_mem_detach(&ptr->mctx);
- * isc_mem_put(mctx, ptr, sizeof(*ptr));
- * isc_mem_detach(&mctx);
- * \endcode
- */
-
-#if ISC_MEM_DEBUG
-#define isc_mem_put(c, p, s) \
- do { \
- isc__mem_put((c), (p), (s) _ISC_MEM_FILELINE); \
- (p) = NULL; \
- } while (0)
-#define isc_mem_putanddetach(c, p, s) \
- do { \
- isc__mem_putanddetach((c), (p), (s) _ISC_MEM_FILELINE); \
- (p) = NULL; \
- } while (0)
-#define isc_mem_free(c, p) \
- do { \
- isc__mem_free((c), (p) _ISC_MEM_FILELINE); \
- (p) = NULL; \
- } while (0)
-#define isc_mempool_put(c, p) \
- do { \
- isc__mempool_put((c), (p) _ISC_MEM_FILELINE); \
- (p) = NULL; \
- } while (0)
-#else
-#define isc_mem_put(c, p, s) isc__mem_put((c), (p), (s) _ISC_MEM_FILELINE)
-#define isc_mem_putanddetach(c, p, s) \
- isc__mem_putanddetach((c), (p), (s) _ISC_MEM_FILELINE)
-#define isc_mem_free(c, p) isc__mem_free((c), (p) _ISC_MEM_FILELINE)
-#define isc_mempool_put(c, p) isc__mempool_put((c), (p) _ISC_MEM_FILELINE)
-#endif
-
-/*@{*/
-isc_result_t
-isc_mem_create(size_t max_size, size_t target_size,
- isc_mem_t **mctxp);
-
-isc_result_t
-isc_mem_create2(size_t max_size, size_t target_size,
- isc_mem_t **mctxp, unsigned int flags);
-
-isc_result_t
-isc_mem_createx(size_t max_size, size_t target_size,
- isc_memalloc_t memalloc, isc_memfree_t memfree,
- void *arg, isc_mem_t **mctxp);
-
-isc_result_t
-isc_mem_createx2(size_t max_size, size_t target_size,
- isc_memalloc_t memalloc, isc_memfree_t memfree,
- void *arg, isc_mem_t **mctxp, unsigned int flags);
-
-/*!<
- * \brief Create a memory context.
- *
- * 'max_size' and 'target_size' are tuning parameters. When
- * ISC_MEMFLAG_INTERNAL is set, allocations smaller than 'max_size'
- * will be satisfied by getting blocks of size 'target_size' from the
- * system allocator and breaking them up into pieces; larger allocations
- * will use the system allocator directly. If 'max_size' and/or
- * 'target_size' are zero, default values will be * used. When
- * ISC_MEMFLAG_INTERNAL is not set, 'target_size' is ignored.
- *
- * 'max_size' is also used to size the statistics arrays and the array
- * used to record active memory when ISC_MEM_DEBUGRECORD is set. Settin
- * 'max_size' too low can have detrimental effects on performance.
- *
- * A memory context created using isc_mem_createx() will obtain
- * memory from the system by calling 'memalloc' and 'memfree',
- * passing them the argument 'arg'. A memory context created
- * using isc_mem_create() will use the standard library malloc()
- * and free().
- *
- * If ISC_MEMFLAG_NOLOCK is set in 'flags', the corresponding memory context
- * will be accessed without locking. The user who creates the context must
- * ensure there be no race. Since this can be a source of bug, it is generally
- * inadvisable to use this flag unless the user is very sure about the race
- * condition and the access to the object is highly performance sensitive.
- *
- * Requires:
- * mctxp != NULL && *mctxp == NULL */
-/*@}*/
-
-/*@{*/
-void
-isc_mem_attach(isc_mem_t *, isc_mem_t **);
-void
-isc_mem_detach(isc_mem_t **);
-/*!<
- * \brief Attach to / detach from a memory context.
- *
- * This is intended for applications that use multiple memory contexts
- * in such a way that it is not obvious when the last allocations from
- * a given context has been freed and destroying the context is safe.
- *
- * Most applications do not need to call these functions as they can
- * simply create a single memory context at the beginning of main()
- * and destroy it at the end of main(), thereby guaranteeing that it
- * is not destroyed while there are outstanding allocations.
- */
-/*@}*/
-
-void
-isc_mem_destroy(isc_mem_t **);
-/*%<
- * Destroy a memory context.
- */
-
-isc_result_t
-isc_mem_ondestroy(isc_mem_t *ctx,
- isc_task_t *task,
- isc_event_t **event);
-/*%<
- * Request to be notified with an event when a memory context has
- * been successfully destroyed.
- */
-
-void
-isc_mem_stats(isc_mem_t *mctx, FILE *out);
-/*%<
- * Print memory usage statistics for 'mctx' on the stream 'out'.
- */
-
-void
-isc_mem_setdestroycheck(isc_mem_t *mctx,
- isc_boolean_t on);
-/*%<
- * If 'on' is ISC_TRUE, 'mctx' will check for memory leaks when
- * destroyed and abort the program if any are present.
- */
-
-/*@{*/
-void
-isc_mem_setquota(isc_mem_t *, size_t);
-size_t
-isc_mem_getquota(isc_mem_t *);
-/*%<
- * Set/get the memory quota of 'mctx'. This is a hard limit
- * on the amount of memory that may be allocated from mctx;
- * if it is exceeded, allocations will fail.
- */
-/*@}*/
-
-size_t
-isc_mem_inuse(isc_mem_t *mctx);
-/*%<
- * Get an estimate of the number of memory in use in 'mctx', in bytes.
- * This includes quantization overhead, but does not include memory
- * allocated from the system but not yet used.
- */
-
-void
-isc_mem_setwater(isc_mem_t *mctx, isc_mem_water_t water, void *water_arg,
- size_t hiwater, size_t lowater);
-/*%<
- * Set high and low water marks for this memory context.
- *
- * When the memory usage of 'mctx' exceeds 'hiwater',
- * '(water)(water_arg, #ISC_MEM_HIWATER)' will be called. 'water' needs to
- * call isc_mem_waterack() with #ISC_MEM_HIWATER to acknowledge the state
- * change. 'water' may be called multiple times.
- *
- * When the usage drops below 'lowater', 'water' will again be called, this
- * time with #ISC_MEM_LOWATER. 'water' need to calls isc_mem_waterack() with
- * #ISC_MEM_LOWATER to acknowledge the change.
- *
- * static void
- * water(void *arg, int mark) {
- * struct foo *foo = arg;
- *
- * LOCK(&foo->marklock);
- * if (foo->mark != mark) {
- * foo->mark = mark;
- * ....
- * isc_mem_waterack(foo->mctx, mark);
- * }
- * UNLOCK(&foo->marklock);
- * }
- *
- * If 'water' is NULL then 'water_arg', 'hi_water' and 'lo_water' are
- * ignored and the state is reset.
- *
- * Requires:
- *
- * 'water' is not NULL.
- * hi_water >= lo_water
- */
-
-void
-isc_mem_waterack(isc_mem_t *ctx, int mark);
-/*%<
- * Called to acknowledge changes in signaled by calls to 'water'.
- */
-
-void
-isc_mem_printactive(isc_mem_t *mctx, FILE *file);
-/*%<
- * Print to 'file' all active memory in 'mctx'.
- *
- * Requires ISC_MEM_DEBUGRECORD to have been set.
- */
-
-void
-isc_mem_printallactive(FILE *file);
-/*%<
- * Print to 'file' all active memory in all contexts.
- *
- * Requires ISC_MEM_DEBUGRECORD to have been set.
- */
-
-void
-isc_mem_checkdestroyed(FILE *file);
-/*%<
- * Check that all memory contexts have been destroyed.
- * Prints out those that have not been.
- * Fatally fails if there are still active contexts.
- */
-
-unsigned int
-isc_mem_references(isc_mem_t *ctx);
-/*%<
- * Return the current reference count.
- */
-
-void
-isc_mem_setname(isc_mem_t *ctx, const char *name, void *tag);
-/*%<
- * Name 'ctx'.
- *
- * Notes:
- *
- *\li Only the first 15 characters of 'name' will be copied.
- *
- *\li 'tag' is for debugging purposes only.
- *
- * Requires:
- *
- *\li 'ctx' is a valid ctx.
- */
-
-const char *
-isc_mem_getname(isc_mem_t *ctx);
-/*%<
- * Get the name of 'ctx', as previously set using isc_mem_setname().
- *
- * Requires:
- *\li 'ctx' is a valid ctx.
- *
- * Returns:
- *\li A non-NULL pointer to a null-terminated string.
- * If the ctx has not been named, the string is
- * empty.
- */
-
-void *
-isc_mem_gettag(isc_mem_t *ctx);
-/*%<
- * Get the tag value for 'task', as previously set using isc_mem_setname().
- *
- * Requires:
- *\li 'ctx' is a valid ctx.
- *
- * Notes:
- *\li This function is for debugging purposes only.
- *
- * Requires:
- *\li 'ctx' is a valid task.
- */
-
-#ifdef HAVE_LIBXML2
-void
-isc_mem_renderxml(xmlTextWriterPtr writer);
-/*%<
- * Render all contexts' statistics and status in XML for writer.
- */
-#endif /* HAVE_LIBXML2 */
-
-/*
- * Memory pools
- */
-
-isc_result_t
-isc_mempool_create(isc_mem_t *mctx, size_t size, isc_mempool_t **mpctxp);
-/*%<
- * Create a memory pool.
- *
- * Requires:
- *\li mctx is a valid memory context.
- *\li size > 0
- *\li mpctxp != NULL and *mpctxp == NULL
- *
- * Defaults:
- *\li maxalloc = UINT_MAX
- *\li freemax = 1
- *\li fillcount = 1
- *
- * Returns:
- *\li #ISC_R_NOMEMORY -- not enough memory to create pool
- *\li #ISC_R_SUCCESS -- all is well.
- */
-
-void
-isc_mempool_destroy(isc_mempool_t **mpctxp);
-/*%<
- * Destroy a memory pool.
- *
- * Requires:
- *\li mpctxp != NULL && *mpctxp is a valid pool.
- *\li The pool has no un"put" allocations outstanding
- */
-
-void
-isc_mempool_setname(isc_mempool_t *mpctx, const char *name);
-/*%<
- * Associate a name with a memory pool. At most 15 characters may be used.
- *
- * Requires:
- *\li mpctx is a valid pool.
- *\li name != NULL;
- */
-
-void
-isc_mempool_associatelock(isc_mempool_t *mpctx, isc_mutex_t *lock);
-/*%<
- * Associate a lock with this memory pool.
- *
- * This lock is used when getting or putting items using this memory pool,
- * and it is also used to set or get internal state via the isc_mempool_get*()
- * and isc_mempool_set*() set of functions.
- *
- * Multiple pools can each share a single lock. For instance, if "manager"
- * type object contained pools for various sizes of events, and each of
- * these pools used a common lock. Note that this lock must NEVER be used
- * by other than mempool routines once it is given to a pool, since that can
- * easily cause double locking.
- *
- * Requires:
- *
- *\li mpctpx is a valid pool.
- *
- *\li lock != NULL.
- *
- *\li No previous lock is assigned to this pool.
- *
- *\li The lock is initialized before calling this function via the normal
- * means of doing that.
- */
-
-/*
- * The following functions get/set various parameters. Note that due to
- * the unlocked nature of pools these are potentially random values unless
- * the imposed externally provided locking protocols are followed.
- *
- * Also note that the quota limits will not always take immediate effect.
- * For instance, setting "maxalloc" to a number smaller than the currently
- * allocated count is permitted. New allocations will be refused until
- * the count drops below this threshold.
- *
- * All functions require (in addition to other requirements):
- * mpctx is a valid memory pool
- */
-
-unsigned int
-isc_mempool_getfreemax(isc_mempool_t *mpctx);
-/*%<
- * Returns the maximum allowed size of the free list.
- */
-
-void
-isc_mempool_setfreemax(isc_mempool_t *mpctx, unsigned int limit);
-/*%<
- * Sets the maximum allowed size of the free list.
- */
-
-unsigned int
-isc_mempool_getfreecount(isc_mempool_t *mpctx);
-/*%<
- * Returns current size of the free list.
- */
-
-unsigned int
-isc_mempool_getmaxalloc(isc_mempool_t *mpctx);
-/*!<
- * Returns the maximum allowed number of allocations.
- */
-
-void
-isc_mempool_setmaxalloc(isc_mempool_t *mpctx, unsigned int limit);
-/*%<
- * Sets the maximum allowed number of allocations.
- *
- * Additional requirements:
- *\li limit > 0
- */
-
-unsigned int
-isc_mempool_getallocated(isc_mempool_t *mpctx);
-/*%<
- * Returns the number of items allocated from this pool.
- */
-
-unsigned int
-isc_mempool_getfillcount(isc_mempool_t *mpctx);
-/*%<
- * Returns the number of items allocated as a block from the parent memory
- * context when the free list is empty.
- */
-
-void
-isc_mempool_setfillcount(isc_mempool_t *mpctx, unsigned int limit);
-/*%<
- * Sets the fillcount.
- *
- * Additional requirements:
- *\li limit > 0
- */
-
-
-/*
- * Pseudo-private functions for use via macros. Do not call directly.
- */
-void *
-isc__mem_get(isc_mem_t *, size_t _ISC_MEM_FLARG);
-void
-isc__mem_putanddetach(isc_mem_t **, void *,
- size_t _ISC_MEM_FLARG);
-void
-isc__mem_put(isc_mem_t *, void *, size_t _ISC_MEM_FLARG);
-void *
-isc__mem_allocate(isc_mem_t *, size_t _ISC_MEM_FLARG);
-void *
-isc__mem_reallocate(isc_mem_t *, void *, size_t _ISC_MEM_FLARG);
-void
-isc__mem_free(isc_mem_t *, void * _ISC_MEM_FLARG);
-char *
-isc__mem_strdup(isc_mem_t *, const char *_ISC_MEM_FLARG);
-void *
-isc__mempool_get(isc_mempool_t * _ISC_MEM_FLARG);
-void
-isc__mempool_put(isc_mempool_t *, void * _ISC_MEM_FLARG);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_MEM_H */
+++ /dev/null
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: msgcat.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_MSGCAT_H
-#define ISC_MSGCAT_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isc/msgcat.h
- * \brief The ISC Message Catalog
- * aids internationalization of applications by allowing
- * messages to be retrieved from locale-specific files instead of
- * hardwiring them into the application. This allows translations of
- * messages appropriate to the locale to be supplied without recompiling
- * the application.
- *
- * Notes:
- *\li It's very important that message catalogs work, even if only the
- * default_text can be used.
- *
- * MP:
- *\li The caller must ensure appropriate synchronization of
- * isc_msgcat_open() and isc_msgcat_close(). isc_msgcat_get()
- * ensures appropriate synchronization.
- *
- * Reliability:
- *\li No anticipated impact.
- *
- * Resources:
- *\li TBS
- *
- * \li Security:
- * No anticipated impact.
- *
- * \li Standards:
- * None.
- */
-
-/*****
- ***** Imports
- *****/
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/*****
- ***** Methods
- *****/
-
-void
-isc_msgcat_open(const char *name, isc_msgcat_t **msgcatp);
-/*%<
- * Open a message catalog.
- *
- * Notes:
- *
- *\li If memory cannot be allocated or other failures occur, *msgcatp
- * will be set to NULL. If a NULL msgcat is given to isc_msgcat_get(),
- * the default_text will be returned, ensuring that some message text
- * will be available, no matter what's going wrong.
- *
- * Requires:
- *
- *\li 'name' is a valid string.
- *
- *\li msgcatp != NULL && *msgcatp == NULL
- */
-
-void
-isc_msgcat_close(isc_msgcat_t **msgcatp);
-/*%<
- * Close a message catalog.
- *
- * Notes:
- *
- *\li Any string pointers returned by prior calls to isc_msgcat_get() are
- * invalid after isc_msgcat_close() has been called and must not be
- * used.
- *
- * Requires:
- *
- *\li *msgcatp is a valid message catalog or is NULL.
- *
- * Ensures:
- *
- *\li All resources associated with the message catalog are released.
- *
- *\li *msgcatp == NULL
- */
-
-const char *
-isc_msgcat_get(isc_msgcat_t *msgcat, int set, int message,
- const char *default_text);
-/*%<
- * Get message 'message' from message set 'set' in 'msgcat'. If it
- * is not available, use 'default_text'.
- *
- * Requires:
- *
- *\li 'msgcat' is a valid message catalog or is NULL.
- *
- *\li set > 0
- *
- *\li message > 0
- *
- *\li 'default_text' is a valid string.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_MSGCAT_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: msgs.h,v 1.17 2008/08/08 06:28:59 tbox Exp $ */
-
-#ifndef ISC_MSGS_H
-#define ISC_MSGS_H 1
-
-/*! \file isc/msgs.h */
-
-#include <isc/lib.h> /* Provide isc_msgcat global variable. */
-#include <isc/msgcat.h> /* Provide isc_msgcat_*() functions. */
-
-/*@{*/
-/*!
- * \brief Message sets, named per source file, excepting "GENERAL".
- *
- * IMPORTANT: The original list is alphabetical, but any new sets must
- * be added to the end.
- */
-#define ISC_MSGSET_GENERAL 1
-/* ISC_RESULT_RESULTSET 2 */ /* XXX */
-/* ISC_RESULT_UNAVAILABLESET 3 */ /* XXX */
-#define ISC_MSGSET_APP 4
-#define ISC_MSGSET_COMMANDLINE 5
-#define ISC_MSGSET_ENTROPY 6
-#define ISC_MSGSET_IFITERIOCTL 7
-#define ISC_MSGSET_IFITERSYSCTL 8
-#define ISC_MSGSET_LEX 9
-#define ISC_MSGSET_LOG 10
-#define ISC_MSGSET_MEM 11
-#define ISC_MSGSET_NETADDR 12
-#define ISC_MSGSET_PRINT 13
-#define ISC_MSGSET_RESULT 14
-#define ISC_MSGSET_RWLOCK 15
-#define ISC_MSGSET_SOCKADDR 16
-#define ISC_MSGSET_SOCKET 17
-#define ISC_MSGSET_TASK 18
-#define ISC_MSGSET_TIMER 19
-#define ISC_MSGSET_UTIL 20
-#define ISC_MSGSET_IFITERGETIFADDRS 21
-/*@}*/
-
-/*@{*/
-/*!
- * Message numbers
- * are only required to be unique per message set,
- * but are unique throughout the entire catalog to not be as confusing when
- * debugging.
- *
- * The initial numbering was done by multiply by 100 the set number the
- * message appears in then adding the incremental message number.
- */
-#define ISC_MSG_FAILED 101 /*%< "failed" */
-#define ISC_MSG_SUCCEEDED 102 /*%< Compatible with "failed" */
-#define ISC_MSG_SUCCESS 103 /*%< More usual way to say "success" */
-#define ISC_MSG_STARTING 104 /*%< As in "daemon: starting" */
-#define ISC_MSG_STOPING 105 /*%< As in "daemon: stopping" */
-#define ISC_MSG_ENTERING 106 /*%< As in "some_subr: entering" */
-#define ISC_MSG_EXITING 107 /*%< As in "some_subr: exiting" */
-#define ISC_MSG_CALLING 108 /*%< As in "calling some_subr()" */
-#define ISC_MSG_RETURNED 109 /*%< As in "some_subr: returned <foo>" */
-#define ISC_MSG_FATALERROR 110 /*%< "fatal error" */
-#define ISC_MSG_SHUTTINGDOWN 111 /*%< "shutting down" */
-#define ISC_MSG_RUNNING 112 /*%< "running" */
-#define ISC_MSG_WAIT 113 /*%< "wait" */
-#define ISC_MSG_WAITUNTIL 114 /*%< "waituntil" */
-
-#define ISC_MSG_SIGNALSETUP 201 /*%< "handle_signal() %d setup: %s" */
-
-#define ISC_MSG_ILLEGALOPT 301 /*%< "illegal option" */
-#define ISC_MSG_OPTNEEDARG 302 /*%< "option requires an argument" */
-
-#define ISC_MSG_ENTROPYSTATS 401 /*%< "Entropy pool %p: refcnt %u ..." */
-
-#define ISC_MSG_MAKESCANSOCKET 501 /*%< "making interface scan socket: %s" */
-#define ISC_MSG_GETIFCONFIG 502 /*%< "get interface configuration: %s" */
-#define ISC_MSG_BUFFERMAX 503 /*%< "... maximum buffer size exceeded" */
-#define ISC_MSG_GETDESTADDR 504 /*%< "%s: getting destination address: %s" */
-#define ISC_MSG_GETNETMASK 505 /*%< "%s: getting netmask: %s" */
-
-#define ISC_MSG_GETIFLISTSIZE 601 /*%< "getting interface list size: ..." */
-#define ISC_MSG_GETIFLIST 602 /*%< "getting interface list: ..." */
-#define ISC_MSG_UNEXPECTEDTYPE 603 /*%< "... unexpected ... message type" */
-
-#define ISC_MSG_UNEXPECTEDSTATE 701 /*%< "Unexpected state %d" */
-
-#define ISC_MSG_BADTIME 801 /*%< "Bad 00 99:99:99.999 " */
-#define ISC_MSG_LEVEL 802 /*%< "level %d: " */
-
-#define ISC_MSG_ADDTRACE 901 /*%< "add %p size %u " */
-#define ISC_MSG_DELTRACE 902 /*%< "del %p size %u " */
-#define ISC_MSG_POOLSTATS 903 /*%< "[Pool statistics]\n" */
-#define ISC_MSG_POOLNAME 904 /*%< "name" */
-#define ISC_MSG_POOLSIZE 905 /*%< "size" */
-#define ISC_MSG_POOLMAXALLOC 906 /*%< "maxalloc" */
-#define ISC_MSG_POOLALLOCATED 907 /*%< "allocated" */
-#define ISC_MSG_POOLFREECOUNT 908 /*%< "freecount" */
-#define ISC_MSG_POOLFREEMAX 909 /*%< "freemax" */
-#define ISC_MSG_POOLFILLCOUNT 910 /*%< "fillcount" */
-#define ISC_MSG_POOLGETS 911 /*%< "gets" */
-#define ISC_MSG_DUMPALLOC 912 /*%< "DUMP OF ALL OUTSTANDING MEMORY ..." */
-#define ISC_MSG_NONE 913 /*%< "\tNone.\n" */
-#define ISC_MSG_PTRFILELINE 914 /*%< "\tptr %p file %s line %u\n" */
-
-#define ISC_MSG_UNKNOWNADDR 1001 /*%< "<unknown address, family %u>" */
-
-#define ISC_MSG_NOLONGDBL 1104 /*%< "long doubles are not supported" */
-
-#define ISC_MSG_PRINTLOCK 1201 /*%< "rwlock %p thread %lu ..." */
-#define ISC_MSG_READ 1202 /*%< "read" */
-#define ISC_MSG_WRITE 1203 /*%< "write" */
-#define ISC_MSG_READING 1204 /*%< "reading" */
-#define ISC_MSG_WRITING 1205 /*%< "writing" */
-#define ISC_MSG_PRELOCK 1206 /*%< "prelock" */
-#define ISC_MSG_POSTLOCK 1207 /*%< "postlock" */
-#define ISC_MSG_PREUNLOCK 1208 /*%< "preunlock" */
-#define ISC_MSG_POSTUNLOCK 1209 /*%< "postunlock" */
-
-#define ISC_MSG_UNKNOWNFAMILY 1301 /*%< "unknown address family: %d" */
-
-#define ISC_MSG_WRITEFAILED 1401 /*%< "write() failed during watcher ..." */
-#define ISC_MSG_READFAILED 1402 /*%< "read() failed during watcher ... " */
-#define ISC_MSG_PROCESSCMSG 1403 /*%< "processing cmsg %p" */
-#define ISC_MSG_IFRECEIVED 1404 /*%< "interface received on ifindex %u" */
-#define ISC_MSG_SENDTODATA 1405 /*%< "sendto pktinfo data, ifindex %u" */
-#define ISC_MSG_DOIORECV 1406 /*%< "doio_recv: recvmsg(%d) %d bytes ..." */
-#define ISC_MSG_PKTRECV 1407 /*%< "packet received correctly" */
-#define ISC_MSG_DESTROYING 1408 /*%< "destroying" */
-#define ISC_MSG_CREATED 1409 /*%< "created" */
-#define ISC_MSG_ACCEPTLOCK 1410 /*%< "internal_accept called, locked ..." */
-#define ISC_MSG_ACCEPTEDCXN 1411 /*%< "accepted connection, new socket %p" */
-#define ISC_MSG_INTERNALRECV 1412 /*%< "internal_recv: task %p got event %p" */
-#define ISC_MSG_INTERNALSEND 1413 /*%< "internal_send: task %p got event %p" */
-#define ISC_MSG_WATCHERMSG 1414 /*%< "watcher got message %d" */
-#define ISC_MSG_SOCKETSREMAIN 1415 /*%< "sockets exist" */
-#define ISC_MSG_PKTINFOPROVIDED 1416 /*%< "pktinfo structure provided, ..." */
-#define ISC_MSG_BOUND 1417 /*%< "bound" */
-#define ISC_MSG_ACCEPTRETURNED 1418 /*%< accept() returned %d/%s */
-#define ISC_MSG_TOOMANYFDS 1419 /*%< %s: too many open file descriptors */
-#define ISC_MSG_ZEROPORT 1420 /*%< dropping source port zero packet */
-#define ISC_MSG_FILTER 1421 /*%< setsockopt(SO_ACCEPTFILTER): %s */
-
-#define ISC_MSG_TOOMANYHANDLES 1422 /*%< %s: too many open WSA event handles: %s */
-
-
-#define ISC_MSG_AWAKE 1502 /*%< "awake" */
-#define ISC_MSG_WORKING 1503 /*%< "working" */
-#define ISC_MSG_EXECUTE 1504 /*%< "execute action" */
-#define ISC_MSG_EMPTY 1505 /*%< "empty" */
-#define ISC_MSG_DONE 1506 /*%< "done" */
-#define ISC_MSG_QUANTUM 1507 /*%< "quantum" */
-
-#define ISC_MSG_SCHEDULE 1601 /*%< "schedule" */
-#define ISC_MSG_SIGNALSCHED 1602 /*%< "signal (schedule)" */
-#define ISC_MSG_SIGNALDESCHED 1603 /*%< "signal (deschedule)" */
-#define ISC_MSG_SIGNALDESTROY 1604 /*%< "signal (destroy)" */
-#define ISC_MSG_IDLERESCHED 1605 /*%< "idle reschedule" */
-#define ISC_MSG_EVENTNOTALLOC 1606 /*%< "couldn't allocate event" */
-#define ISC_MSG_SCHEDFAIL 1607 /*%< "couldn't schedule timer: %u" */
-#define ISC_MSG_POSTING 1608 /*%< "posting" */
-#define ISC_MSG_WAKEUP 1609 /*%< "wakeup" */
-
-#define ISC_MSG_LOCK 1701 /*%< "LOCK" */
-#define ISC_MSG_LOCKING 1702 /*%< "LOCKING" */
-#define ISC_MSG_LOCKED 1703 /*%< "LOCKED" */
-#define ISC_MSG_UNLOCKED 1704 /*%< "UNLOCKED" */
-#define ISC_MSG_RWLOCK 1705 /*%< "RWLOCK" */
-#define ISC_MSG_RWLOCKED 1706 /*%< "RWLOCKED" */
-#define ISC_MSG_RWUNLOCK 1707 /*%< "RWUNLOCK" */
-#define ISC_MSG_BROADCAST 1708 /*%< "BROADCAST" */
-#define ISC_MSG_SIGNAL 1709 /*%< "SIGNAL" */
-#define ISC_MSG_UTILWAIT 1710 /*%< "WAIT" */
-#define ISC_MSG_WAITED 1711 /*%< "WAITED" */
-
-#define ISC_MSG_GETIFADDRS 1801 /*%< "getting interface addresses: ..." */
-
-/*@}*/
-
-#endif /* ISC_MSGS_H */
+++ /dev/null
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: mutex.h,v 1.30 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_MUTEX_H
-#define ISC_MUTEX_H 1
-
-/*! \file */
-
-#include <pthread.h>
-#include <stdio.h>
-
-#include <isc/lang.h>
-#include <isc/result.h> /* for ISC_R_ codes */
-
-ISC_LANG_BEGINDECLS
-
-/*!
- * Supply mutex attributes that enable deadlock detection
- * (helpful when debugging). This is system dependent and
- * currently only supported on NetBSD.
- */
-#if ISC_MUTEX_DEBUG && defined(__NetBSD__) && defined(PTHREAD_MUTEX_ERRORCHECK)
-extern pthread_mutexattr_t isc__mutex_attrs;
-#define ISC__MUTEX_ATTRS &isc__mutex_attrs
-#else
-#define ISC__MUTEX_ATTRS NULL
-#endif
-
-/* XXX We could do fancier error handling... */
-
-/*!
- * Define ISC_MUTEX_PROFILE to turn on profiling of mutexes by line. When
- * enabled, isc_mutex_stats() can be used to print a table showing the
- * number of times each type of mutex was locked and the amount of time
- * waiting to obtain the lock.
- */
-#ifndef ISC_MUTEX_PROFILE
-#define ISC_MUTEX_PROFILE 0
-#endif
-
-#if ISC_MUTEX_PROFILE
-typedef struct isc_mutexstats isc_mutexstats_t;
-
-typedef struct {
- pthread_mutex_t mutex; /*%< The actual mutex. */
- isc_mutexstats_t * stats; /*%< Mutex statistics. */
-} isc_mutex_t;
-#else
-typedef pthread_mutex_t isc_mutex_t;
-#endif
-
-
-#if ISC_MUTEX_PROFILE
-#define isc_mutex_init(mp) \
- isc_mutex_init_profile((mp), __FILE__, __LINE__)
-#else
-#if ISC_MUTEX_DEBUG && defined(PTHREAD_MUTEX_ERRORCHECK)
-#define isc_mutex_init(mp) \
- isc_mutex_init_errcheck((mp))
-#else
-#define isc_mutex_init(mp) \
- isc__mutex_init((mp), __FILE__, __LINE__)
-isc_result_t isc__mutex_init(isc_mutex_t *mp, const char *file, unsigned int line);
-#endif
-#endif
-
-#if ISC_MUTEX_PROFILE
-#define isc_mutex_lock(mp) \
- isc_mutex_lock_profile((mp), __FILE__, __LINE__)
-#else
-#define isc_mutex_lock(mp) \
- ((pthread_mutex_lock((mp)) == 0) ? \
- ISC_R_SUCCESS : ISC_R_UNEXPECTED)
-#endif
-
-#if ISC_MUTEX_PROFILE
-#define isc_mutex_unlock(mp) \
- isc_mutex_unlock_profile((mp), __FILE__, __LINE__)
-#else
-#define isc_mutex_unlock(mp) \
- ((pthread_mutex_unlock((mp)) == 0) ? \
- ISC_R_SUCCESS : ISC_R_UNEXPECTED)
-#endif
-
-#if ISC_MUTEX_PROFILE
-#define isc_mutex_trylock(mp) \
- ((pthread_mutex_trylock((&(mp)->mutex)) == 0) ? \
- ISC_R_SUCCESS : ISC_R_LOCKBUSY)
-#else
-#define isc_mutex_trylock(mp) \
- ((pthread_mutex_trylock((mp)) == 0) ? \
- ISC_R_SUCCESS : ISC_R_LOCKBUSY)
-#endif
-
-#if ISC_MUTEX_PROFILE
-#define isc_mutex_destroy(mp) \
- ((pthread_mutex_destroy((&(mp)->mutex)) == 0) ? \
- ISC_R_SUCCESS : ISC_R_UNEXPECTED)
-#else
-#define isc_mutex_destroy(mp) \
- ((pthread_mutex_destroy((mp)) == 0) ? \
- ISC_R_SUCCESS : ISC_R_UNEXPECTED)
-#endif
-
-#if ISC_MUTEX_PROFILE
-#define isc_mutex_stats(fp) isc_mutex_statsprofile(fp);
-#else
-#define isc_mutex_stats(fp)
-#endif
-
-#if ISC_MUTEX_PROFILE
-
-isc_result_t
-isc_mutex_init_profile(isc_mutex_t *mp, const char * _file, int _line);
-isc_result_t
-isc_mutex_lock_profile(isc_mutex_t *mp, const char * _file, int _line);
-isc_result_t
-isc_mutex_unlock_profile(isc_mutex_t *mp, const char * _file, int _line);
-
-void
-isc_mutex_statsprofile(FILE *fp);
-
-isc_result_t
-isc_mutex_init_errcheck(isc_mutex_t *mp);
-
-#endif /* ISC_MUTEX_PROFILE */
-
-ISC_LANG_ENDDECLS
-#endif /* ISC_MUTEX_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: mutexblock.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_MUTEXBLOCK_H
-#define ISC_MUTEXBLOCK_H 1
-
-/*! \file isc/mutexblock.h */
-
-#include <isc/lang.h>
-#include <isc/mutex.h>
-#include <isc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-isc_mutexblock_init(isc_mutex_t *block, unsigned int count);
-/*%<
- * Initialize a block of locks. If an error occurs all initialized locks
- * will be destroyed, if possible.
- *
- * Requires:
- *
- *\li block != NULL
- *
- *\li count > 0
- *
- * Returns:
- *
- *\li Any code isc_mutex_init() can return is a valid return for this
- * function.
- */
-
-isc_result_t
-isc_mutexblock_destroy(isc_mutex_t *block, unsigned int count);
-/*%<
- * Destroy a block of locks.
- *
- * Requires:
- *
- *\li block != NULL
- *
- *\li count > 0
- *
- *\li Each lock in the block be initialized via isc_mutex_init() or
- * the whole block was initialized via isc_mutex_initblock().
- *
- * Returns:
- *
- *\li Any code isc_mutex_init() can return is a valid return for this
- * function.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_MUTEXBLOCK_H */
+++ /dev/null
-/*
- * Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: net.h,v 1.48.84.2 2009/02/16 23:47:15 tbox Exp $ */
-
-#ifndef ISC_NET_H
-#define ISC_NET_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file
- * \brief
- * Basic Networking Types
- *
- * This module is responsible for defining the following basic networking
- * types:
- *
- *\li struct in_addr
- *\li struct in6_addr
- *\li struct in6_pktinfo
- *\li struct sockaddr
- *\li struct sockaddr_in
- *\li struct sockaddr_in6
- *\li in_port_t
- *
- * It ensures that the AF_ and PF_ macros are defined.
- *
- * It declares ntoh[sl]() and hton[sl]().
- *
- * It declares inet_aton(), inet_ntop(), and inet_pton().
- *
- * It ensures that #INADDR_LOOPBACK, #INADDR_ANY, #IN6ADDR_ANY_INIT,
- * in6addr_any, and in6addr_loopback are available.
- *
- * It ensures that IN_MULTICAST() is available to check for multicast
- * addresses.
- *
- * MP:
- *\li No impact.
- *
- * Reliability:
- *\li No anticipated impact.
- *
- * Resources:
- *\li N/A.
- *
- * Security:
- *\li No anticipated impact.
- *
- * Standards:
- *\li BSD Socket API
- *\li RFC2553
- */
-
-/***
- *** Imports.
- ***/
-#include <isc/platform.h>
-
-#include <sys/types.h>
-#include <sys/socket.h> /* Contractual promise. */
-
-#include <net/if.h>
-
-#include <netinet/in.h> /* Contractual promise. */
-#include <arpa/inet.h> /* Contractual promise. */
-#ifdef ISC_PLATFORM_NEEDNETINETIN6H
-#include <netinet/in6.h> /* Required on UnixWare. */
-#endif
-#ifdef ISC_PLATFORM_NEEDNETINET6IN6H
-#include <netinet6/in6.h> /* Required on BSD/OS for in6_pktinfo. */
-#endif
-
-#ifndef ISC_PLATFORM_HAVEIPV6
-#include <isc/ipv6.h> /* Contractual promise. */
-#endif
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-#ifdef ISC_PLATFORM_HAVEINADDR6
-#define in6_addr in_addr6 /*%< Required for pre RFC2133 implementations. */
-#endif
-
-#ifdef ISC_PLATFORM_HAVEIPV6
-#ifndef IN6ADDR_ANY_INIT
-#ifdef s6_addr
-/*%
- * Required for some pre RFC2133 implementations.
- * IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT were added in
- * draft-ietf-ipngwg-bsd-api-04.txt or draft-ietf-ipngwg-bsd-api-05.txt.
- * If 's6_addr' is defined then assume that there is a union and three
- * levels otherwise assume two levels required.
- */
-#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
-#else
-#define IN6ADDR_ANY_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }
-#endif
-#endif
-
-#ifndef IN6ADDR_LOOPBACK_INIT
-#ifdef s6_addr
-/*% IPv6 address loopback init */
-#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
-#else
-#define IN6ADDR_LOOPBACK_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } }
-#endif
-#endif
-
-#ifndef IN6_IS_ADDR_V4MAPPED
-/*% Is IPv6 address V4 mapped? */
-#define IN6_IS_ADDR_V4MAPPED(x) \
- (memcmp((x)->s6_addr, in6addr_any.s6_addr, 10) == 0 && \
- (x)->s6_addr[10] == 0xff && (x)->s6_addr[11] == 0xff)
-#endif
-
-#ifndef IN6_IS_ADDR_V4COMPAT
-/*% Is IPv6 address V4 compatible? */
-#define IN6_IS_ADDR_V4COMPAT(x) \
- (memcmp((x)->s6_addr, in6addr_any.s6_addr, 12) == 0 && \
- ((x)->s6_addr[12] != 0 || (x)->s6_addr[13] != 0 || \
- (x)->s6_addr[14] != 0 || \
- ((x)->s6_addr[15] != 0 && (x)->s6_addr[15] != 1)))
-#endif
-
-#ifndef IN6_IS_ADDR_MULTICAST
-/*% Is IPv6 address multicast? */
-#define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff)
-#endif
-
-#ifndef IN6_IS_ADDR_LINKLOCAL
-/*% Is IPv6 address linklocal? */
-#define IN6_IS_ADDR_LINKLOCAL(a) \
- (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80))
-#endif
-
-#ifndef IN6_IS_ADDR_SITELOCAL
-/*% is IPv6 address sitelocal? */
-#define IN6_IS_ADDR_SITELOCAL(a) \
- (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0))
-#endif
-
-
-#ifndef IN6_IS_ADDR_LOOPBACK
-/*% is IPv6 address loopback? */
-#define IN6_IS_ADDR_LOOPBACK(x) \
- (memcmp((x)->s6_addr, in6addr_loopback.s6_addr, 16) == 0)
-#endif
-#endif
-
-#ifndef AF_INET6
-/*% IPv6 */
-#define AF_INET6 99
-#endif
-
-#ifndef PF_INET6
-/*% IPv6 */
-#define PF_INET6 AF_INET6
-#endif
-
-#ifndef INADDR_LOOPBACK
-/*% inaddr loopback */
-#define INADDR_LOOPBACK 0x7f000001UL
-#endif
-
-#ifndef ISC_PLATFORM_HAVEIN6PKTINFO
-/*% IPv6 packet info */
-struct in6_pktinfo {
- struct in6_addr ipi6_addr; /*%< src/dst IPv6 address */
- unsigned int ipi6_ifindex; /*%< send/recv interface index */
-};
-#endif
-
-#if defined(ISC_PLATFORM_HAVEIPV6) && defined(ISC_PLATFORM_NEEDIN6ADDRANY)
-extern const struct in6_addr isc_net_in6addrany;
-/*%
- * Cope with a missing in6addr_any and in6addr_loopback.
- */
-#define in6addr_any isc_net_in6addrany
-#endif
-
-#if defined(ISC_PLATFORM_HAVEIPV6) && defined(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK)
-extern const struct in6_addr isc_net_in6addrloop;
-#define in6addr_loopback isc_net_in6addrloop
-#endif
-
-#ifdef ISC_PLATFORM_FIXIN6ISADDR
-#undef IN6_IS_ADDR_GEOGRAPHIC
-/*!
- * \brief
- * Fix UnixWare 7.1.1's broken IN6_IS_ADDR_* definitions.
- */
-#define IN6_IS_ADDR_GEOGRAPHIC(a) (((a)->S6_un.S6_l[0] & 0xE0) == 0x80)
-#undef IN6_IS_ADDR_IPX
-#define IN6_IS_ADDR_IPX(a) (((a)->S6_un.S6_l[0] & 0xFE) == 0x04)
-#undef IN6_IS_ADDR_LINKLOCAL
-#define IN6_IS_ADDR_LINKLOCAL(a) (((a)->S6_un.S6_l[0] & 0xC0FF) == 0x80FE)
-#undef IN6_IS_ADDR_MULTICAST
-#define IN6_IS_ADDR_MULTICAST(a) (((a)->S6_un.S6_l[0] & 0xFF) == 0xFF)
-#undef IN6_IS_ADDR_NSAP
-#define IN6_IS_ADDR_NSAP(a) (((a)->S6_un.S6_l[0] & 0xFE) == 0x02)
-#undef IN6_IS_ADDR_PROVIDER
-#define IN6_IS_ADDR_PROVIDER(a) (((a)->S6_un.S6_l[0] & 0xE0) == 0x40)
-#undef IN6_IS_ADDR_SITELOCAL
-#define IN6_IS_ADDR_SITELOCAL(a) (((a)->S6_un.S6_l[0] & 0xC0FF) == 0xC0FE)
-#endif /* ISC_PLATFORM_FIXIN6ISADDR */
-
-#ifdef ISC_PLATFORM_NEEDPORTT
-/*%
- * Ensure type in_port_t is defined.
- */
-typedef isc_uint16_t in_port_t;
-#endif
-
-#ifndef MSG_TRUNC
-/*%
- * If this system does not have MSG_TRUNC (as returned from recvmsg())
- * ISC_PLATFORM_RECVOVERFLOW will be defined. This will enable the MSG_TRUNC
- * faking code in socket.c.
- */
-#define ISC_PLATFORM_RECVOVERFLOW
-#endif
-
-/*% IP address. */
-#define ISC__IPADDR(x) ((isc_uint32_t)htonl((isc_uint32_t)(x)))
-
-/*% Is IP address multicast? */
-#define ISC_IPADDR_ISMULTICAST(i) \
- (((isc_uint32_t)(i) & ISC__IPADDR(0xf0000000)) \
- == ISC__IPADDR(0xe0000000))
-
-#define ISC_IPADDR_ISEXPERIMENTAL(i) \
- (((isc_uint32_t)(i) & ISC__IPADDR(0xf0000000)) \
- == ISC__IPADDR(0xf0000000))
-
-/***
- *** Functions.
- ***/
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-isc_net_probeipv4(void);
-/*%<
- * Check if the system's kernel supports IPv4.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS IPv4 is supported.
- *\li #ISC_R_NOTFOUND IPv4 is not supported.
- *\li #ISC_R_DISABLED IPv4 is disabled.
- *\li #ISC_R_UNEXPECTED
- */
-
-isc_result_t
-isc_net_probeipv6(void);
-/*%<
- * Check if the system's kernel supports IPv6.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS IPv6 is supported.
- *\li #ISC_R_NOTFOUND IPv6 is not supported.
- *\li #ISC_R_DISABLED IPv6 is disabled.
- *\li #ISC_R_UNEXPECTED
- */
-
-isc_result_t
-isc_net_probe_ipv6only(void);
-/*%<
- * Check if the system's kernel supports the IPV6_V6ONLY socket option.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS the option is supported for both TCP and UDP.
- *\li #ISC_R_NOTFOUND IPv6 itself or the option is not supported.
- *\li #ISC_R_UNEXPECTED
- */
-
-isc_result_t
-isc_net_probe_ipv6pktinfo(void);
-/*
- * Check if the system's kernel supports the IPV6_(RECV)PKTINFO socket option
- * for UDP sockets.
- *
- * Returns:
- *
- * \li #ISC_R_SUCCESS the option is supported.
- * \li #ISC_R_NOTFOUND IPv6 itself or the option is not supported.
- * \li #ISC_R_UNEXPECTED
- */
-
-void
-isc_net_disableipv4(void);
-
-void
-isc_net_disableipv6(void);
-
-void
-isc_net_enableipv4(void);
-
-void
-isc_net_enableipv6(void);
-
-isc_result_t
-isc_net_probeunix(void);
-/*
- * Returns whether UNIX domain sockets are supported.
- */
-
-isc_result_t
-isc_net_getudpportrange(int af, in_port_t *low, in_port_t *high);
-/*%<
- * Returns system's default range of ephemeral UDP ports, if defined.
- * If the range is not available or unknown, ISC_NET_PORTRANGELOW and
- * ISC_NET_PORTRANGEHIGH will be returned.
- *
- * Requires:
- *
- *\li 'low' and 'high' must be non NULL.
- *
- * Returns:
- *
- *\li *low and *high will be the ports specifying the low and high ends of
- * the range.
- */
-
-#ifdef ISC_PLATFORM_NEEDNTOP
-const char *
-isc_net_ntop(int af, const void *src, char *dst, size_t size);
-#define inet_ntop isc_net_ntop
-#endif
-
-#ifdef ISC_PLATFORM_NEEDPTON
-int
-isc_net_pton(int af, const char *src, void *dst);
-#undef inet_pton
-#define inet_pton isc_net_pton
-#endif
-
-int
-isc_net_aton(const char *cp, struct in_addr *addr);
-#undef inet_aton
-#define inet_aton isc_net_aton
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_NET_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: netaddr.h,v 1.35.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef ISC_NETADDR_H
-#define ISC_NETADDR_H 1
-
-/*! \file isc/netaddr.h */
-
-#include <isc/lang.h>
-#include <isc/net.h>
-#include <isc/types.h>
-
-#ifdef ISC_PLATFORM_HAVESYSUNH
-#include <sys/types.h>
-#include <sys/un.h>
-#endif
-
-ISC_LANG_BEGINDECLS
-
-struct isc_netaddr {
- unsigned int family;
- union {
- struct in_addr in;
- struct in6_addr in6;
-#ifdef ISC_PLATFORM_HAVESYSUNH
- char un[sizeof(((struct sockaddr_un *)0)->sun_path)];
-#endif
- } type;
- isc_uint32_t zone;
-};
-
-isc_boolean_t
-isc_netaddr_equal(const isc_netaddr_t *a, const isc_netaddr_t *b);
-
-/*%<
- * Compare network addresses 'a' and 'b'. Return #ISC_TRUE if
- * they are equal, #ISC_FALSE if not.
- */
-
-isc_boolean_t
-isc_netaddr_eqprefix(const isc_netaddr_t *a, const isc_netaddr_t *b,
- unsigned int prefixlen);
-/*%<
- * Compare the 'prefixlen' most significant bits of the network
- * addresses 'a' and 'b'. If 'b''s scope is zero then 'a''s scope is
- * ignored. Return #ISC_TRUE if they are equal, #ISC_FALSE if not.
- */
-
-isc_result_t
-isc_netaddr_masktoprefixlen(const isc_netaddr_t *s, unsigned int *lenp);
-/*%<
- * Convert a netmask in 's' into a prefix length in '*lenp'.
- * The mask should consist of zero or more '1' bits in the most
- * most significant part of the address, followed by '0' bits.
- * If this is not the case, #ISC_R_MASKNONCONTIG is returned.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_MASKNONCONTIG
- */
-
-isc_result_t
-isc_netaddr_totext(const isc_netaddr_t *netaddr, isc_buffer_t *target);
-/*%<
- * Append a text representation of 'sockaddr' to the buffer 'target'.
- * The text is NOT null terminated. Handles IPv4 and IPv6 addresses.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOSPACE The text or the null termination did not fit.
- *\li #ISC_R_FAILURE Unspecified failure
- */
-
-void
-isc_netaddr_format(const isc_netaddr_t *na, char *array, unsigned int size);
-/*%<
- * Format a human-readable representation of the network address '*na'
- * into the character array 'array', which is of size 'size'.
- * The resulting string is guaranteed to be null-terminated.
- */
-
-#define ISC_NETADDR_FORMATSIZE \
- sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:XXX.XXX.XXX.XXX%SSSSSSSSSS")
-/*%<
- * Minimum size of array to pass to isc_netaddr_format().
- */
-
-void
-isc_netaddr_fromsockaddr(isc_netaddr_t *netaddr, const isc_sockaddr_t *source);
-
-void
-isc_netaddr_fromin(isc_netaddr_t *netaddr, const struct in_addr *ina);
-
-void
-isc_netaddr_fromin6(isc_netaddr_t *netaddr, const struct in6_addr *ina6);
-
-isc_result_t
-isc_netaddr_frompath(isc_netaddr_t *netaddr, const char *path);
-
-void
-isc_netaddr_setzone(isc_netaddr_t *netaddr, isc_uint32_t zone);
-
-isc_uint32_t
-isc_netaddr_getzone(const isc_netaddr_t *netaddr);
-
-void
-isc_netaddr_any(isc_netaddr_t *netaddr);
-/*%<
- * Return the IPv4 wildcard address.
- */
-
-void
-isc_netaddr_any6(isc_netaddr_t *netaddr);
-/*%<
- * Return the IPv6 wildcard address.
- */
-
-isc_boolean_t
-isc_netaddr_ismulticast(isc_netaddr_t *na);
-/*%<
- * Returns ISC_TRUE if the address is a multicast address.
- */
-
-isc_boolean_t
-isc_netaddr_isexperimental(isc_netaddr_t *na);
-/*%<
- * Returns ISC_TRUE if the address is a experimental (CLASS E) address.
- */
-
-isc_boolean_t
-isc_netaddr_islinklocal(isc_netaddr_t *na);
-/*%<
- * Returns #ISC_TRUE if the address is a link local address.
- */
-
-isc_boolean_t
-isc_netaddr_issitelocal(isc_netaddr_t *na);
-/*%<
- * Returns #ISC_TRUE if the address is a site local address.
- */
-
-void
-isc_netaddr_fromv4mapped(isc_netaddr_t *t, const isc_netaddr_t *s);
-/*%<
- * Convert an IPv6 v4mapped address into an IPv4 address.
- */
-
-isc_result_t
-isc_netaddr_prefixok(const isc_netaddr_t *na, unsigned int prefixlen);
-/*
- * Test whether the netaddr 'na' and 'prefixlen' are consistant.
- * e.g. prefixlen within range.
- * na does not have bits set which are not covered by the prefixlen.
- *
- * Returns:
- * ISC_R_SUCCESS
- * ISC_R_RANGE prefixlen out of range
- * ISC_R_NOTIMPLEMENTED unsupported family
- * ISC_R_FAILURE extra bits.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_NETADDR_H */
+++ /dev/null
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: netdb.h,v 1.11 2007/06/19 23:47:19 tbox Exp $ */
-
-#ifndef ISC_NETDB_H
-#define ISC_NETDB_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file
- * \brief
- * Portable netdb.h support.
- *
- * This module is responsible for defining the get<x>by<y> APIs.
- *
- * MP:
- *\li No impact.
- *
- * Reliability:
- *\li No anticipated impact.
- *
- * Resources:
- *\li N/A.
- *
- * Security:
- *\li No anticipated impact.
- *
- * Standards:
- *\li BSD API
- */
-
-/***
- *** Imports.
- ***/
-
-#include <isc/net.h>
-
-#include <netdb.h>
-
-#endif /* ISC_NETDB_H */
+++ /dev/null
-/*
- * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: offset.h,v 1.15.332.2 2009/02/16 23:47:15 tbox Exp $ */
-
-#ifndef ISC_OFFSET_H
-#define ISC_OFFSET_H 1
-
-/*! \file
- * \brief
- * File offsets are operating-system dependent.
- */
-#include <limits.h> /* Required for CHAR_BIT. */
-#include <sys/types.h>
-#include <stddef.h> /* For Linux Standard Base. */
-
-typedef off_t isc_offset_t;
-
-/*%
- * POSIX says "Additionally, blkcnt_t and off_t are extended signed integral
- * types", so the maximum value is all 1s except for the high bit.
- * This definition is more complex than it really needs to be because it was
- * crafted to keep both the SunOS 5.6 and the HP/UX 11 compilers quiet about
- * integer overflow. For example, though this is equivalent to just left
- * shifting 1 to the high bit and then inverting the bits, the SunOS compiler
- * is unhappy about shifting a positive "1" to negative in a signed integer.
- */
-#define ISC_OFFSET_MAXIMUM \
- (~(((off_t)-1 >> (sizeof(off_t) * CHAR_BIT - 1)) \
- << (sizeof(off_t) * CHAR_BIT - 1)))
-
-#endif /* ISC_OFFSET_H */
+++ /dev/null
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: once.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_ONCE_H
-#define ISC_ONCE_H 1
-
-/*! \file */
-
-#include <pthread.h>
-
-#include <isc/platform.h>
-#include <isc/result.h>
-
-typedef pthread_once_t isc_once_t;
-
-#ifdef ISC_PLATFORM_BRACEPTHREADONCEINIT
-/*!
- * This accomodates systems that define PTHRAD_ONCE_INIT improperly.
- */
-#define ISC_ONCE_INIT { PTHREAD_ONCE_INIT }
-#else
-/*!
- * This is the usual case.
- */
-#define ISC_ONCE_INIT PTHREAD_ONCE_INIT
-#endif
-
-/* XXX We could do fancier error handling... */
-
-#define isc_once_do(op, f) \
- ((pthread_once((op), (f)) == 0) ? \
- ISC_R_SUCCESS : ISC_R_UNEXPECTED)
-
-#endif /* ISC_ONCE_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: ondestroy.h,v 1.14 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_ONDESTROY_H
-#define ISC_ONDESTROY_H 1
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/*! \file isc/ondestroy.h
- * ondestroy handling.
- *
- * Any class ``X'' of objects that wants to send out notifications
- * on its destruction should declare a field of type isc_ondestroy_t
- * (call it 'ondest').
- *
- * \code
- * typedef struct {
- * ...
- * isc_ondestroy_t ondest;
- * ...
- * } X;
- * \endcode
- *
- * When an object ``A'' of type X is created
- * it must initialize the field ondest with a call to
- *
- * \code
- * isc_ondestroy_init(&A->ondest).
- * \endcode
- *
- * X should also provide a registration function for third-party
- * objects to call to register their interest in being told about
- * the destruction of a particular instance of X.
- *
- * \code
- * isc_result_t
- * X_ondestroy(X *instance, isc_task_t *task,
- * isc_event_t **eventp) {
- * return(isc_ondestroy_register(&instance->ondest, task,eventp));
- * }
- * \endcode
- *
- * Note: locking of the ondestory structure embedded inside of X, is
- * X's responsibility.
- *
- * When an instance of X is destroyed, a call to isc_ondestroy_notify()
- * sends the notifications:
- *
- * \code
- * X *instance;
- * isc_ondestroy_t ondest = instance->ondest;
- *
- * ... completely cleanup 'instance' here...
- *
- * isc_ondestroy_notify(&ondest, instance);
- * \endcode
- *
- *
- * see lib/dns/zone.c for an ifdef'd-out example.
- */
-
-struct isc_ondestroy {
- unsigned int magic;
- isc_eventlist_t events;
-};
-
-void
-isc_ondestroy_init(isc_ondestroy_t *ondest);
-/*%<
- * Initialize the on ondest structure. *must* be called before first call
- * to isc_ondestroy_register().
- */
-
-isc_result_t
-isc_ondestroy_register(isc_ondestroy_t *ondest, isc_task_t *task,
- isc_event_t **eventp);
-
-/*%<
- * Stores task and *eventp away inside *ondest. Ownership of **event is
- * taken from the caller (and *eventp is set to NULL). The task is attached
- * to.
- */
-
-void
-isc_ondestroy_notify(isc_ondestroy_t *ondest, void *sender);
-/*%<
- * Dispatches the event(s) to the task(s) that were given in
- * isc_ondestroy_register call(s) (done via calls to
- * isc_task_sendanddetach()). Before dispatch, the sender value of each
- * event structure is set to the value of the sender paramater. The
- * internal structures of the ondest parameter are cleaned out, so no other
- * cleanup is needed.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_ONDESTROY_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: os.h,v 1.12 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_OS_H
-#define ISC_OS_H 1
-
-/*! \file isc/os.h */
-
-#include <isc/lang.h>
-
-ISC_LANG_BEGINDECLS
-
-unsigned int
-isc_os_ncpus(void);
-/*%<
- * Return the number of CPUs available on the system, or 1 if this cannot
- * be determined.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_OS_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2001, 2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: parseint.h,v 1.9 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_PARSEINT_H
-#define ISC_PARSEINT_H 1
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-/*! \file isc/parseint.h
- * \brief Parse integers, in a saner way than atoi() or strtoul() do.
- */
-
-/***
- *** Functions
- ***/
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-isc_parse_uint32(isc_uint32_t *uip, const char *string, int base);
-
-isc_result_t
-isc_parse_uint16(isc_uint16_t *uip, const char *string, int base);
-
-isc_result_t
-isc_parse_uint8(isc_uint8_t *uip, const char *string, int base);
-/*%<
- * Parse the null-terminated string 'string' containing a base 'base'
- * integer, storing the result in '*uip'.
- * The base is interpreted
- * as in strtoul(). Unlike strtoul(), leading whitespace, minus or
- * plus signs are not accepted, and all errors (including overflow)
- * are reported uniformly through the return value.
- *
- * Requires:
- *\li 'string' points to a null-terminated string
- *\li 0 <= 'base' <= 36
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_BADNUMBER The string is not numeric (in the given base)
- *\li #ISC_R_RANGE The number is not representable as the requested type.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_PARSEINT_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: platform.h.in,v 1.48.84.2 2009/02/16 23:47:15 tbox Exp $ */
-
-#ifndef ISC_PLATFORM_H
-#define ISC_PLATFORM_H 1
-
-/*! \file */
-
-/*****
- ***** Platform-dependent defines.
- *****/
-
-/***
- *** Network.
- ***/
-
-/*! \brief
- * Define if this system needs the <netinet/in6.h> header file included
- * for full IPv6 support (pretty much only UnixWare).
- */
-#undef ISC_PLATFORM_NEEDNETINETIN6H
-
-/*! \brief
- * Define if this system needs the <netinet6/in6.h> header file included
- * to support in6_pkinfo (pretty much only BSD/OS).
- */
-#undef ISC_PLATFORM_NEEDNETINET6IN6H
-
-/*! \brief
- * If sockaddrs on this system have an sa_len field, ISC_PLATFORM_HAVESALEN
- * will be defined.
- */
-#undef ISC_PLATFORM_HAVESALEN
-
-/*! \brief
- * If this system has the IPv6 structure definitions, ISC_PLATFORM_HAVEIPV6
- * will be defined.
- */
-#define ISC_PLATFORM_HAVEIPV6 1
-
-/*! \brief
- * If this system is missing in6addr_any, ISC_PLATFORM_NEEDIN6ADDRANY will
- * be defined.
- */
-#undef ISC_PLATFORM_NEEDIN6ADDRANY
-
-/*! \brief
- * If this system is missing in6addr_loopback, ISC_PLATFORM_NEEDIN6ADDRLOOPBACK
- * will be defined.
- */
-#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK
-
-/*! \brief
- * If this system has in6_pktinfo, ISC_PLATFORM_HAVEIN6PKTINFO will be
- * defined.
- */
-#define ISC_PLATFORM_HAVEIN6PKTINFO 1
-
-/*! \brief
- * If this system has in_addr6, rather than in6_addr, ISC_PLATFORM_HAVEINADDR6
- * will be defined.
- */
-#undef ISC_PLATFORM_HAVEINADDR6
-
-/*! \brief
- * If this system has sin6_scope_id, ISC_PLATFORM_HAVESCOPEID will be defined.
- */
-#define ISC_PLATFORM_HAVESCOPEID 1
-
-/*! \brief
- * If this system needs inet_ntop(), ISC_PLATFORM_NEEDNTOP will be defined.
- */
-#undef ISC_PLATFORM_NEEDNTOP
-
-/*! \brief
- * If this system needs inet_pton(), ISC_PLATFORM_NEEDPTON will be defined.
- */
-#undef ISC_PLATFORM_NEEDPTON
-
-/*! \brief
- * If this system needs in_port_t, ISC_PLATFORM_NEEDPORTT will be defined.
- */
-#undef ISC_PLATFORM_NEEDPORTT
-
-/*! \brief
- * Define if the system has struct lifconf which is a extended struct ifconf
- * for IPv6.
- */
-#undef ISC_PLATFORM_HAVELIFCONF
-
-/*! \brief
- * Define if the system has struct if_laddrconf which is a extended struct
- * ifconf for IPv6.
- */
-#undef ISC_PLATFORM_HAVEIF_LADDRCONF
-
-/*! \brief
- * Define if the system has struct if_laddrreq.
- */
-#undef ISC_PLATFORM_HAVEIF_LADDRREQ
-
-/*! \brief
- * Define either ISC_PLATFORM_BSD44MSGHDR or ISC_PLATFORM_BSD43MSGHDR.
- */
-#define ISC_NET_BSD44MSGHDR 1
-
-/*! \brief
- * Define if the system supports if_nametoindex.
- */
-#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1
-
-/*! \brief
- * Define on some UnixWare systems to fix erroneous definitions of various
- * IN6_IS_ADDR_* macros.
- */
-#undef ISC_PLATFORM_FIXIN6ISADDR
-
-/*! \brief
- * Define if the system supports kqueue multiplexing
- */
-#undef ISC_PLATFORM_HAVEKQUEUE
-
-/*! \brief
- * Define if the system supports epoll multiplexing
- */
-#define ISC_PLATFORM_HAVEEPOLL 1
-
-/*! \brief
- * Define if the system supports /dev/poll multiplexing
- */
-#undef ISC_PLATFORM_HAVEDEVPOLL
-
-/*
- *** Printing.
- ***/
-
-/*! \brief
- * If this system needs vsnprintf() and snprintf(), ISC_PLATFORM_NEEDVSNPRINTF
- * will be defined.
- */
-#undef ISC_PLATFORM_NEEDVSNPRINTF
-
-/*! \brief
- * If this system need a modern sprintf() that returns (int) not (char*).
- */
-#undef ISC_PLATFORM_NEEDSPRINTF
-
-/*! \brief
- * The printf format string modifier to use with isc_uint64_t values.
- */
-#define ISC_PLATFORM_QUADFORMAT "ll"
-
-/***
- *** String functions.
- ***/
-/*
- * If the system needs strsep(), ISC_PLATFORM_NEEDSTRSEP will be defined.
- */
-#undef ISC_PLATFORM_NEEDSTRSEP
-
-/*
- * If the system needs strlcpy(), ISC_PLATFORM_NEEDSTRLCPY will be defined.
- */
-#define ISC_PLATFORM_NEEDSTRLCPY 1
-
-/*
- * If the system needs strlcat(), ISC_PLATFORM_NEEDSTRLCAT will be defined.
- */
-#define ISC_PLATFORM_NEEDSTRLCAT 1
-
-/*
- * Define if this system needs strtoul.
- */
-#undef ISC_PLATFORM_NEEDSTRTOUL
-
-/*
- * Define if this system needs memmove.
- */
-#undef ISC_PLATFORM_NEEDMEMMOVE
-
-/***
- *** Miscellaneous.
- ***/
-
-/*
- * Defined if we are using threads.
- */
-#define ISC_PLATFORM_USETHREADS 1
-
-/*
- * Defined if unistd.h does not cause fd_set to be delared.
- */
-#undef ISC_PLATFORM_NEEDSYSSELECTH
-
-/*
- * Defined to <gssapi.h> or <gssapi/gssapi.h> for how to include
- * the GSSAPI header.
- */
-#define ISC_PLATFORM_GSSAPIHEADER <gssapi/gssapi.h>
-
-/*
- * Type used for resource limits.
- */
-#define ISC_PLATFORM_RLIMITTYPE rlim_t
-
-/*
- * Define if your compiler supports "long long int".
- */
-#define ISC_PLATFORM_HAVELONGLONG 1
-
-/*
- * Define if PTHREAD_ONCE_INIT should be surrounded by braces to
- * prevent compiler warnings (such as with gcc on Solaris 2.8).
- */
-#undef ISC_PLATFORM_BRACEPTHREADONCEINIT
-
-/*
- * Used to control how extern data is linked; needed for Win32 platforms.
- */
-#undef ISC_PLATFORM_USEDECLSPEC
-
-/*
- * Define if the platform has <sys/un.h>.
- */
-#define ISC_PLATFORM_HAVESYSUNH 1
-
-/*
- * If the "xadd" operation is available on this architecture,
- * ISC_PLATFORM_HAVEXADD will be defined.
- */
-#define ISC_PLATFORM_HAVEXADD 1
-
-/*
- * If the "xaddq" operation (64bit xadd) is available on this architecture,
- * ISC_PLATFORM_HAVEXADDQ will be defined.
- */
-#define ISC_PLATFORM_HAVEXADDQ 1
-
-/*
- * If the "atomic swap" operation is available on this architecture,
- * ISC_PLATFORM_HAVEATOMICSTORE" will be defined.
- */
-#define ISC_PLATFORM_HAVEATOMICSTORE 1
-
-/*
- * If the "compare-and-exchange" operation is available on this architecture,
- * ISC_PLATFORM_HAVECMPXCHG will be defined.
- */
-#define ISC_PLATFORM_HAVECMPXCHG 1
-
-/*
- * Define if gcc ASM extension is available
- */
-#define ISC_PLATFORM_USEGCCASM 1
-
-/*
- * Define if Tru64 style ASM syntax must be used.
- */
-#undef ISC_PLATFORM_USEOSFASM
-
-/*
- * Define if the standard __asm function must be used.
- */
-
-
-/*
- * Define if the platform has <strings.h>.
- */
-#define ISC_PLATFORM_HAVESTRINGSH 1
-
-/***
- *** Windows dll support.
- ***/
-
-/*
- * Define if MacOS style of PPC assembly must be used.
- * e.g. "r6", not "6", for register six.
- */
-
-
-#ifndef ISC_PLATFORM_USEDECLSPEC
-#define LIBISC_EXTERNAL_DATA
-#define LIBDNS_EXTERNAL_DATA
-#define LIBISCCC_EXTERNAL_DATA
-#define LIBISCCFG_EXTERNAL_DATA
-#define LIBBIND9_EXTERNAL_DATA
-#else /*! \brief ISC_PLATFORM_USEDECLSPEC */
-#ifdef LIBISC_EXPORTS
-#define LIBISC_EXTERNAL_DATA __declspec(dllexport)
-#else
-#define LIBISC_EXTERNAL_DATA __declspec(dllimport)
-#endif
-#ifdef LIBDNS_EXPORTS
-#define LIBDNS_EXTERNAL_DATA __declspec(dllexport)
-#else
-#define LIBDNS_EXTERNAL_DATA __declspec(dllimport)
-#endif
-#ifdef LIBISCCC_EXPORTS
-#define LIBISCCC_EXTERNAL_DATA __declspec(dllexport)
-#else
-#define LIBISCCC_EXTERNAL_DATA __declspec(dllimport)
-#endif
-#ifdef LIBISCCFG_EXPORTS
-#define LIBISCCFG_EXTERNAL_DATA __declspec(dllexport)
-#else
-#define LIBISCCFG_EXTERNAL_DATA __declspec(dllimport)
-#endif
-#ifdef LIBBIND9_EXPORTS
-#define LIBBIND9_EXTERNAL_DATA __declspec(dllexport)
-#else
-#define LIBBIND9_EXTERNAL_DATA __declspec(dllimport)
-#endif
-#endif /*! \brief ISC_PLATFORM_USEDECLSPEC */
-
-/*
- * Tell emacs to use C mode for this file.
- *
- * Local Variables:
- * mode: c
- * End:
- */
-
-#endif /* ISC_PLATFORM_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001, 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: print.h,v 1.26 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_PRINT_H
-#define ISC_PRINT_H 1
-
-/*! \file isc/print.h */
-
-/***
- *** Imports
- ***/
-
-#include <isc/formatcheck.h> /* Required for ISC_FORMAT_PRINTF() macro. */
-#include <isc/lang.h>
-#include <isc/platform.h>
-
-/*!
- * This block allows lib/isc/print.c to be cleanly compiled even if
- * the platform does not need it. The standard Makefile will still
- * not compile print.c or archive print.o, so this is just to make test
- * compilation ("make print.o") easier.
- */
-#if !defined(ISC_PLATFORM_NEEDVSNPRINTF) && defined(ISC__PRINT_SOURCE)
-#define ISC_PLATFORM_NEEDVSNPRINTF
-#endif
-
-#if !defined(ISC_PLATFORM_NEEDSPRINTF) && defined(ISC__PRINT_SOURCE)
-#define ISC_PLATFORM_NEEDSPRINTF
-#endif
-
-/***
- *** Macros
- ***/
-#define ISC_PRINT_QUADFORMAT ISC_PLATFORM_QUADFORMAT
-
-/***
- *** Functions
- ***/
-
-#ifdef ISC_PLATFORM_NEEDVSNPRINTF
-#include <stdarg.h>
-#include <stddef.h>
-#endif
-#ifdef ISC_PLATFORM_NEEDSPRINTF
-#include <stdio.h>
-#endif
-
-
-ISC_LANG_BEGINDECLS
-
-#ifdef ISC_PLATFORM_NEEDVSNPRINTF
-int
-isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap)
- ISC_FORMAT_PRINTF(3, 0);
-#define vsnprintf isc_print_vsnprintf
-
-int
-isc_print_snprintf(char *str, size_t size, const char *format, ...)
- ISC_FORMAT_PRINTF(3, 4);
-#define snprintf isc_print_snprintf
-#endif /* ISC_PLATFORM_NEEDVSNPRINTF */
-
-#ifdef ISC_PLATFORM_NEEDSPRINTF
-int
-isc_print_sprintf(char *str, const char *format, ...) ISC_FORMAT_PRINTF(2, 3);
-#define sprintf isc_print_sprintf
-#endif
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_PRINT_H */
+++ /dev/null
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: quota.h,v 1.16 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_QUOTA_H
-#define ISC_QUOTA_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isc/quota.h
- *
- * \brief The isc_quota_t object is a simple helper object for implementing
- * quotas on things like the number of simultaneous connections to
- * a server. It keeps track of the amount of quota in use, and
- * encapsulates the locking necessary to allow multiple tasks to
- * share a quota.
- */
-
-/***
- *** Imports.
- ***/
-
-#include <isc/lang.h>
-#include <isc/mutex.h>
-#include <isc/types.h>
-
-/*****
- ***** Types.
- *****/
-
-ISC_LANG_BEGINDECLS
-
-/*% isc_quota structure */
-struct isc_quota {
- isc_mutex_t lock; /*%< Locked by lock. */
- int max;
- int used;
- int soft;
-};
-
-isc_result_t
-isc_quota_init(isc_quota_t *quota, int max);
-/*%<
- * Initialize a quota object.
- *
- * Returns:
- * ISC_R_SUCCESS
- * Other error Lock creation failed.
- */
-
-void
-isc_quota_destroy(isc_quota_t *quota);
-/*%<
- * Destroy a quota object.
- */
-
-void
-isc_quota_soft(isc_quota_t *quota, int soft);
-/*%<
- * Set a soft quota.
- */
-
-void
-isc_quota_max(isc_quota_t *quota, int max);
-/*%<
- * Re-set a maximum quota.
- */
-
-isc_result_t
-isc_quota_reserve(isc_quota_t *quota);
-/*%<
- * Attempt to reserve one unit of 'quota'.
- *
- * Returns:
- * \li #ISC_R_SUCCESS Success
- * \li #ISC_R_SOFTQUOTA Success soft quota reached
- * \li #ISC_R_QUOTA Quota is full
- */
-
-void
-isc_quota_release(isc_quota_t *quota);
-/*%<
- * Release one unit of quota.
- */
-
-isc_result_t
-isc_quota_attach(isc_quota_t *quota, isc_quota_t **p);
-/*%<
- * Like isc_quota_reserve, and also attaches '*p' to the
- * quota if successful (ISC_R_SUCCESS or ISC_R_SOFTQUOTA).
- */
-
-void
-isc_quota_detach(isc_quota_t **p);
-/*%<
- * Like isc_quota_release, and also detaches '*p' from the
- * quota.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_QUOTA_H */
+++ /dev/null
-/*
- * Copyright (C) 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: radix.h,v 1.11.44.2 2008/12/24 23:47:02 tbox Exp $ */
-
-/*
- * This source was adapted from MRT's RCS Ids:
- * Id: radix.h,v 1.6 1999/08/03 03:32:53 masaki Exp
- * Id: mrt.h,v 1.57.2.6 1999/12/28 23:41:27 labovit Exp
- * Id: defs.h,v 1.5.2.2 2000/01/15 14:19:16 masaki Exp
- */
-
-#include <isc/magic.h>
-#include <isc/types.h>
-#include <isc/mutex.h>
-#include <isc/net.h>
-#include <isc/refcount.h>
-
-#include <string.h>
-
-#ifndef _RADIX_H
-#define _RADIX_H
-
-#define NETADDR_TO_PREFIX_T(na,pt,bits) \
- do { \
- memset(&(pt), 0, sizeof(pt)); \
- if((na) != NULL) { \
- (pt).family = (na)->family; \
- (pt).bitlen = (bits); \
- if ((pt).family == AF_INET6) { \
- memcpy(&(pt).add.sin6, &(na)->type.in6, \
- ((bits)+7)/8); \
- } else \
- memcpy(&(pt).add.sin, &(na)->type.in, \
- ((bits)+7)/8); \
- } else { \
- (pt).family = AF_UNSPEC; \
- (pt).bitlen = 0; \
- } \
- isc_refcount_init(&(pt).refcount, 0); \
- } while(0)
-
-typedef struct isc_prefix {
- unsigned int family; /* AF_INET | AF_INET6, or AF_UNSPEC for "any" */
- unsigned int bitlen; /* 0 for "any" */
- isc_refcount_t refcount;
- union {
- struct in_addr sin;
- struct in6_addr sin6;
- } add;
-} isc_prefix_t;
-
-typedef void (*isc_radix_destroyfunc_t)(void *);
-typedef void (*isc_radix_processfunc_t)(isc_prefix_t *, void **);
-
-#define isc_prefix_tochar(prefix) ((char *)&(prefix)->add.sin)
-#define isc_prefix_touchar(prefix) ((u_char *)&(prefix)->add.sin)
-
-#define BIT_TEST(f, b) ((f) & (b))
-
-/*
- * We need "first match" when we search the radix tree to preserve
- * compatibility with the existing ACL implementation. Radix trees
- * naturally lend themselves to "best match". In order to get "first match"
- * behavior, we keep track of the order in which entries are added to the
- * tree--and when a search is made, we find all matching entries, and
- * return the one that was added first.
- *
- * An IPv4 prefix and an IPv6 prefix may share a radix tree node if they
- * have the same length and bit pattern (e.g., 127/8 and 7f::/8). To
- * disambiguate between them, node_num and data are two-element arrays;
- * node_num[0] and data[0] are used for IPv4 addresses, node_num[1]
- * and data[1] for IPv6 addresses. The only exception is a prefix of
- * 0/0 (aka "any" or "none"), which is always stored as IPv4 but matches
- * IPv6 addresses too.
- */
-
-#define ISC_IS6(family) ((family) == AF_INET6 ? 1 : 0)
-typedef struct isc_radix_node {
- isc_uint32_t bit; /* bit length of the prefix */
- isc_prefix_t *prefix; /* who we are in radix tree */
- struct isc_radix_node *l, *r; /* left and right children */
- struct isc_radix_node *parent; /* may be used */
- void *data[2]; /* pointers to IPv4 and IPV6 data */
- int node_num[2]; /* which node this was in the tree,
- or -1 for glue nodes */
-} isc_radix_node_t;
-
-#define RADIX_TREE_MAGIC ISC_MAGIC('R','d','x','T');
-#define RADIX_TREE_VALID(a) ISC_MAGIC_VALID(a, RADIX_TREE_MAGIC);
-
-typedef struct isc_radix_tree {
- unsigned int magic;
- isc_mem_t *mctx;
- isc_radix_node_t *head;
- isc_uint32_t maxbits; /* for IP, 32 bit addresses */
- int num_active_node; /* for debugging purposes */
- int num_added_node; /* total number of nodes */
-} isc_radix_tree_t;
-
-isc_result_t
-isc_radix_search(isc_radix_tree_t *radix, isc_radix_node_t **target,
- isc_prefix_t *prefix);
-/*%<
- * Search 'radix' for the best match to 'prefix'.
- * Return the node found in '*target'.
- *
- * Requires:
- * \li 'radix' to be valid.
- * \li 'target' is not NULL and "*target" is NULL.
- * \li 'prefix' to be valid.
- *
- * Returns:
- * \li ISC_R_NOTFOUND
- * \li ISC_R_SUCCESS
- */
-
-isc_result_t
-isc_radix_insert(isc_radix_tree_t *radix, isc_radix_node_t **target,
- isc_radix_node_t *source, isc_prefix_t *prefix);
-/*%<
- * Insert 'source' or 'prefix' into the radix tree 'radix'.
- * Return the node added in 'target'.
- *
- * Requires:
- * \li 'radix' to be valid.
- * \li 'target' is not NULL and "*target" is NULL.
- * \li 'prefix' to be valid or 'source' to be non NULL and contain
- * a valid prefix.
- *
- * Returns:
- * \li ISC_R_NOMEMORY
- * \li ISC_R_SUCCESS
- */
-
-void
-isc_radix_remove(isc_radix_tree_t *radix, isc_radix_node_t *node);
-/*%<
- * Remove the node 'node' from the radix tree 'radix'.
- *
- * Requires:
- * \li 'radix' to be valid.
- * \li 'node' to be valid.
- */
-
-isc_result_t
-isc_radix_create(isc_mem_t *mctx, isc_radix_tree_t **target, int maxbits);
-/*%<
- * Create a radix tree with a maximum depth of 'maxbits';
- *
- * Requires:
- * \li 'mctx' to be valid.
- * \li 'target' to be non NULL and '*target' to be NULL.
- * \li 'maxbits' to be less than or equal to RADIX_MAXBITS.
- *
- * Returns:
- * \li ISC_R_NOMEMORY
- * \li ISC_R_SUCCESS
- */
-
-void
-isc_radix_destroy(isc_radix_tree_t *radix, isc_radix_destroyfunc_t func);
-/*%<
- * Destroy a radix tree optionally calling 'func' to clean up node data.
- *
- * Requires:
- * \li 'radix' to be valid.
- */
-
-void
-isc_radix_process(isc_radix_tree_t *radix, isc_radix_processfunc_t func);
-/*%<
- * Walk a radix tree calling 'func' to process node data.
- *
- * Requires:
- * \li 'radix' to be valid.
- * \li 'func' to point to a function.
- */
-
-#define RADIX_MAXBITS 128
-#define RADIX_NBIT(x) (0x80 >> ((x) & 0x7f))
-#define RADIX_NBYTE(x) ((x) >> 3)
-
-#define RADIX_DATA_GET(node, type) (type *)((node)->data)
-#define RADIX_DATA_SET(node, value) ((node)->data = (void *)(value))
-
-#define RADIX_WALK(Xhead, Xnode) \
- do { \
- isc_radix_node_t *Xstack[RADIX_MAXBITS+1]; \
- isc_radix_node_t **Xsp = Xstack; \
- isc_radix_node_t *Xrn = (Xhead); \
- while ((Xnode = Xrn)) { \
- if (Xnode->prefix)
-
-#define RADIX_WALK_ALL(Xhead, Xnode) \
-do { \
- isc_radix_node_t *Xstack[RADIX_MAXBITS+1]; \
- isc_radix_node_t **Xsp = Xstack; \
- isc_radix_node_t *Xrn = (Xhead); \
- while ((Xnode = Xrn)) { \
- if (1)
-
-#define RADIX_WALK_BREAK { \
- if (Xsp != Xstack) { \
- Xrn = *(--Xsp); \
- } else { \
- Xrn = (radix_node_t *) 0; \
- } \
- continue; }
-
-#define RADIX_WALK_END \
- if (Xrn->l) { \
- if (Xrn->r) { \
- *Xsp++ = Xrn->r; \
- } \
- Xrn = Xrn->l; \
- } else if (Xrn->r) { \
- Xrn = Xrn->r; \
- } else if (Xsp != Xstack) { \
- Xrn = *(--Xsp); \
- } else { \
- Xrn = (isc_radix_node_t *) 0; \
- } \
- } \
- } while (0)
-
-#endif /* _RADIX_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: random.h,v 1.18.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef ISC_RANDOM_H
-#define ISC_RANDOM_H 1
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-/*! \file isc/random.h
- * \brief Implements a random state pool which will let the caller return a
- * series of possibly non-reproducible random values.
- *
- * Note that the
- * strength of these numbers is not all that high, and should not be
- * used in cryptography functions. It is useful for jittering values
- * a bit here and there, such as timeouts, etc.
- */
-
-ISC_LANG_BEGINDECLS
-
-void
-isc_random_seed(isc_uint32_t seed);
-/*%<
- * Set the initial seed of the random state.
- */
-
-void
-isc_random_get(isc_uint32_t *val);
-/*%<
- * Get a random value.
- *
- * Requires:
- * val != NULL.
- */
-
-isc_uint32_t
-isc_random_jitter(isc_uint32_t max, isc_uint32_t jitter);
-/*%<
- * Get a random value between (max - jitter) and (max).
- * This is useful for jittering timer values.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_RANDOM_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: ratelimiter.h,v 1.21.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef ISC_RATELIMITER_H
-#define ISC_RATELIMITER_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isc/ratelimiter.h
- * \brief A rate limiter is a mechanism for dispatching events at a limited
- * rate. This is intended to be used when sending zone maintenance
- * SOA queries, NOTIFY messages, etc.
- */
-
-/***
- *** Imports.
- ***/
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/*****
- ***** Functions.
- *****/
-
-isc_result_t
-isc_ratelimiter_create(isc_mem_t *mctx, isc_timermgr_t *timermgr,
- isc_task_t *task, isc_ratelimiter_t **ratelimiterp);
-/*%<
- * Create a rate limiter. The execution interval is initially undefined.
- */
-
-isc_result_t
-isc_ratelimiter_setinterval(isc_ratelimiter_t *rl, isc_interval_t *interval);
-/*!<
- * Set the minimum interval between event executions.
- * The interval value is copied, so the caller need not preserve it.
- *
- * Requires:
- * '*interval' is a nonzero interval.
- */
-
-void
-isc_ratelimiter_setpertic(isc_ratelimiter_t *rl, isc_uint32_t perint);
-/*%<
- * Set the number of events processed per interval timer tick.
- * If 'perint' is zero it is treated as 1.
- */
-
-isc_result_t
-isc_ratelimiter_enqueue(isc_ratelimiter_t *rl, isc_task_t *task,
- isc_event_t **eventp);
-/*%<
- * Queue an event for rate-limited execution.
- *
- * This is similar
- * to doing an isc_task_send() to the 'task', except that the
- * execution may be delayed to achieve the desired rate of
- * execution.
- *
- * '(*eventp)->ev_sender' is used to hold the task. The caller
- * must ensure that the task exists until the event is delivered.
- *
- * Requires:
- *\li An interval has been set by calling
- * isc_ratelimiter_setinterval().
- *
- *\li 'task' to be non NULL.
- *\li '(*eventp)->ev_sender' to be NULL.
- */
-
-void
-isc_ratelimiter_shutdown(isc_ratelimiter_t *ratelimiter);
-/*%<
- * Shut down a rate limiter.
- *
- * Ensures:
- *\li All events that have not yet been
- * dispatched to the task are dispatched immediately with
- * the #ISC_EVENTATTR_CANCELED bit set in ev_attributes.
- *
- *\li Further attempts to enqueue events will fail with
- * #ISC_R_SHUTTINGDOWN.
- *
- *\li The rate limiter is no longer attached to its task.
- */
-
-void
-isc_ratelimiter_attach(isc_ratelimiter_t *source, isc_ratelimiter_t **target);
-/*%<
- * Attach to a rate limiter.
- */
-
-void
-isc_ratelimiter_detach(isc_ratelimiter_t **ratelimiterp);
-/*%<
- * Detach from a rate limiter.
- */
-
-isc_result_t
-isc_ratelimiter_stall(isc_ratelimiter_t *rl);
-/*%<
- * Stall event processing.
- */
-
-isc_result_t
-isc_ratelimiter_release(isc_ratelimiter_t *rl);
-/*%<
- * Release a stalled rate limiter.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_RATELIMITER_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2001, 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: refcount.h,v 1.15 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_REFCOUNT_H
-#define ISC_REFCOUNT_H 1
-
-#include <isc/atomic.h>
-#include <isc/lang.h>
-#include <isc/mutex.h>
-#include <isc/platform.h>
-#include <isc/types.h>
-#include <isc/util.h>
-
-/*! \file isc/refcount.h
- * \brief Implements a locked reference counter.
- *
- * These functions may actually be
- * implemented using macros, and implementations of these macros are below.
- * The isc_refcount_t type should not be accessed directly, as its contents
- * depend on the implementation.
- */
-
-ISC_LANG_BEGINDECLS
-
-/*
- * Function prototypes
- */
-
-/*
- * isc_result_t
- * isc_refcount_init(isc_refcount_t *ref, unsigned int n);
- *
- * Initialize the reference counter. There will be 'n' initial references.
- *
- * Requires:
- * ref != NULL
- */
-
-/*
- * void
- * isc_refcount_destroy(isc_refcount_t *ref);
- *
- * Destroys a reference counter.
- *
- * Requires:
- * ref != NULL
- * The number of references is 0.
- */
-
-/*
- * void
- * isc_refcount_increment(isc_refcount_t *ref, unsigned int *targetp);
- * isc_refcount_increment0(isc_refcount_t *ref, unsigned int *targetp);
- *
- * Increments the reference count, returning the new value in targetp if it's
- * not NULL. The reference counter typically begins with the initial counter
- * of 1, and will be destroyed once the counter reaches 0. Thus,
- * isc_refcount_increment() additionally requires the previous counter be
- * larger than 0 so that an error which violates the usage can be easily
- * caught. isc_refcount_increment0() does not have this restriction.
- *
- * Requires:
- * ref != NULL.
- */
-
-/*
- * void
- * isc_refcount_decrement(isc_refcount_t *ref, unsigned int *targetp);
- *
- * Decrements the reference count, returning the new value in targetp if it's
- * not NULL.
- *
- * Requires:
- * ref != NULL.
- */
-
-
-/*
- * Sample implementations
- */
-#ifdef ISC_PLATFORM_USETHREADS
-#ifdef ISC_PLATFORM_HAVEXADD
-
-#define ISC_REFCOUNT_HAVEATOMIC 1
-
-typedef struct isc_refcount {
- isc_int32_t refs;
-} isc_refcount_t;
-
-#define isc_refcount_destroy(rp) (REQUIRE((rp)->refs == 0))
-#define isc_refcount_current(rp) ((unsigned int)((rp)->refs))
-
-#define isc_refcount_increment0(rp, tp) \
- do { \
- unsigned int *_tmp = (unsigned int *)(tp); \
- isc_int32_t prev; \
- prev = isc_atomic_xadd(&(rp)->refs, 1); \
- if (_tmp != NULL) \
- *_tmp = prev + 1; \
- } while (0)
-
-#define isc_refcount_increment(rp, tp) \
- do { \
- unsigned int *_tmp = (unsigned int *)(tp); \
- isc_int32_t prev; \
- prev = isc_atomic_xadd(&(rp)->refs, 1); \
- REQUIRE(prev > 0); \
- if (_tmp != NULL) \
- *_tmp = prev + 1; \
- } while (0)
-
-#define isc_refcount_decrement(rp, tp) \
- do { \
- unsigned int *_tmp = (unsigned int *)(tp); \
- isc_int32_t prev; \
- prev = isc_atomic_xadd(&(rp)->refs, -1); \
- REQUIRE(prev > 0); \
- if (_tmp != NULL) \
- *_tmp = prev - 1; \
- } while (0)
-
-#else /* ISC_PLATFORM_HAVEXADD */
-
-typedef struct isc_refcount {
- int refs;
- isc_mutex_t lock;
-} isc_refcount_t;
-
-/*% Destroys a reference counter. */
-#define isc_refcount_destroy(rp) \
- do { \
- REQUIRE((rp)->refs == 0); \
- DESTROYLOCK(&(rp)->lock); \
- } while (0)
-
-#define isc_refcount_current(rp) ((unsigned int)((rp)->refs))
-
-/*% Increments the reference count, returning the new value in targetp if it's not NULL. */
-#define isc_refcount_increment0(rp, tp) \
- do { \
- unsigned int *_tmp = (unsigned int *)(tp); \
- LOCK(&(rp)->lock); \
- ++((rp)->refs); \
- if (_tmp != NULL) \
- *_tmp = ((rp)->refs); \
- UNLOCK(&(rp)->lock); \
- } while (0)
-
-#define isc_refcount_increment(rp, tp) \
- do { \
- unsigned int *_tmp = (unsigned int *)(tp); \
- LOCK(&(rp)->lock); \
- REQUIRE((rp)->refs > 0); \
- ++((rp)->refs); \
- if (_tmp != NULL) \
- *_tmp = ((rp)->refs); \
- UNLOCK(&(rp)->lock); \
- } while (0)
-
-/*% Decrements the reference count, returning the new value in targetp if it's not NULL. */
-#define isc_refcount_decrement(rp, tp) \
- do { \
- unsigned int *_tmp = (unsigned int *)(tp); \
- LOCK(&(rp)->lock); \
- REQUIRE((rp)->refs > 0); \
- --((rp)->refs); \
- if (_tmp != NULL) \
- *_tmp = ((rp)->refs); \
- UNLOCK(&(rp)->lock); \
- } while (0)
-
-#endif /* ISC_PLATFORM_HAVEXADD */
-#else /* ISC_PLATFORM_USETHREADS */
-
-typedef struct isc_refcount {
- int refs;
-} isc_refcount_t;
-
-#define isc_refcount_destroy(rp) (REQUIRE((rp)->refs == 0))
-#define isc_refcount_current(rp) ((unsigned int)((rp)->refs))
-
-#define isc_refcount_increment0(rp, tp) \
- do { \
- unsigned int *_tmp = (unsigned int *)(tp); \
- int _n = ++(rp)->refs; \
- if (_tmp != NULL) \
- *_tmp = _n; \
- } while (0)
-
-#define isc_refcount_increment(rp, tp) \
- do { \
- unsigned int *_tmp = (unsigned int *)(tp); \
- int _n; \
- REQUIRE((rp)->refs > 0); \
- _n = ++(rp)->refs; \
- if (_tmp != NULL) \
- *_tmp = _n; \
- } while (0)
-
-#define isc_refcount_decrement(rp, tp) \
- do { \
- unsigned int *_tmp = (unsigned int *)(tp); \
- int _n; \
- REQUIRE((rp)->refs > 0); \
- _n = --(rp)->refs; \
- if (_tmp != NULL) \
- *_tmp = _n; \
- } while (0)
-
-#endif /* ISC_PLATFORM_USETHREADS */
-
-isc_result_t
-isc_refcount_init(isc_refcount_t *ref, unsigned int n);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_REFCOUNT_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: region.h,v 1.25 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_REGION_H
-#define ISC_REGION_H 1
-
-/*! \file isc/region.h */
-
-#include <isc/types.h>
-
-struct isc_region {
- unsigned char * base;
- unsigned int length;
-};
-
-struct isc_textregion {
- char * base;
- unsigned int length;
-};
-
-/* XXXDCL questionable ... bears discussion. we have been putting off
- * discussing the region api.
- */
-struct isc_constregion {
- const void * base;
- unsigned int length;
-};
-
-struct isc_consttextregion {
- const char * base;
- unsigned int length;
-};
-
-/*@{*/
-/*!
- * The region structure is not opaque, and is usually directly manipulated.
- * Some macros are defined below for convenience.
- */
-
-#define isc_region_consume(r,l) \
- do { \
- isc_region_t *_r = (r); \
- unsigned int _l = (l); \
- INSIST(_r->length >= _l); \
- _r->base += _l; \
- _r->length -= _l; \
- } while (0)
-
-#define isc_textregion_consume(r,l) \
- do { \
- isc_textregion_t *_r = (r); \
- unsigned int _l = (l); \
- INSIST(_r->length >= _l); \
- _r->base += _l; \
- _r->length -= _l; \
- } while (0)
-
-#define isc_constregion_consume(r,l) \
- do { \
- isc_constregion_t *_r = (r); \
- unsigned int _l = (l); \
- INSIST(_r->length >= _l); \
- _r->base += _l; \
- _r->length -= _l; \
- } while (0)
-/*@}*/
-
-int
-isc_region_compare(isc_region_t *r1, isc_region_t *r2);
-/*%<
- * Compares the contents of two regions
- *
- * Requires:
- *\li 'r1' is a valid region
- *\li 'r2' is a valid region
- *
- * Returns:
- *\li < 0 if r1 is lexicographically less than r2
- *\li = 0 if r1 is lexicographically identical to r2
- *\li > 0 if r1 is lexicographically greater than r2
- */
-
-#endif /* ISC_REGION_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: resource.h,v 1.13 2008/07/11 23:47:09 tbox Exp $ */
-
-#ifndef ISC_RESOURCE_H
-#define ISC_RESOURCE_H 1
-
-/*! \file isc/resource.h */
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-#define ISC_RESOURCE_UNLIMITED ((isc_resourcevalue_t)ISC_UINT64_MAX)
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-isc_resource_setlimit(isc_resource_t resource, isc_resourcevalue_t value);
-/*%<
- * Set the maximum limit for a system resource.
- *
- * Notes:
- *\li If 'value' exceeds the maximum possible on the operating system,
- * it is silently limited to that maximum -- or to "infinity", if
- * the operating system has that concept. #ISC_RESOURCE_UNLIMITED
- * can be used to explicitly ask for the maximum.
- *
- * Requires:
- *\li 'resource' is a valid member of the isc_resource_t enumeration.
- *
- * Returns:
- *\li #ISC_R_SUCCESS Success.
- *\li #ISC_R_NOTIMPLEMENTED 'resource' is not a type known by the OS.
- *\li #ISC_R_NOPERM The calling process did not have adequate permission
- * to change the resource limit.
- */
-
-isc_result_t
-isc_resource_getlimit(isc_resource_t resource, isc_resourcevalue_t *value);
-/*%<
- * Get the maximum limit for a system resource.
- *
- * Notes:
- *\li 'value' is set to the maximum limit.
- *
- *\li #ISC_RESOURCE_UNLIMITED is the maximum value of isc_resourcevalue_t.
- *
- *\li On many (all?) Unix systems, RLIM_INFINITY is a valid value that is
- * significantly less than #ISC_RESOURCE_UNLIMITED, but which in practice
- * behaves the same.
- *
- *\li The current ISC libdns configuration file parser assigns a value
- * of ISC_UINT32_MAX for a size_spec of "unlimited" and ISC_UNIT32_MAX - 1
- * for "default", the latter of which is supposed to represent "the
- * limit that was in force when the server started". Since these are
- * valid values in the middle of the range of isc_resourcevalue_t,
- * there is the possibility for confusion over what exactly those
- * particular values are supposed to represent in a particular context --
- * discrete integral values or generalized concepts.
- *
- * Requires:
- *\li 'resource' is a valid member of the isc_resource_t enumeration.
- *
- * Returns:
- *\li #ISC_R_SUCCESS Success.
- *\li #ISC_R_NOTIMPLEMENTED 'resource' is not a type known by the OS.
- */
-
-isc_result_t
-isc_resource_getcurlimit(isc_resource_t resource, isc_resourcevalue_t *value);
-/*%<
- * Same as isc_resource_getlimit(), but returns the current (soft) limit.
- *
- * Returns:
- *\li #ISC_R_SUCCESS Success.
- *\li #ISC_R_NOTIMPLEMENTED 'resource' is not a type known by the OS.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_RESOURCE_H */
-
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001, 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: result.h,v 1.71 2008/09/25 04:02:39 tbox Exp $ */
-
-#ifndef ISC_RESULT_H
-#define ISC_RESULT_H 1
-
-/*! \file isc/result.h */
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-#define ISC_R_SUCCESS 0 /*%< success */
-#define ISC_R_NOMEMORY 1 /*%< out of memory */
-#define ISC_R_TIMEDOUT 2 /*%< timed out */
-#define ISC_R_NOTHREADS 3 /*%< no available threads */
-#define ISC_R_ADDRNOTAVAIL 4 /*%< address not available */
-#define ISC_R_ADDRINUSE 5 /*%< address in use */
-#define ISC_R_NOPERM 6 /*%< permission denied */
-#define ISC_R_NOCONN 7 /*%< no pending connections */
-#define ISC_R_NETUNREACH 8 /*%< network unreachable */
-#define ISC_R_HOSTUNREACH 9 /*%< host unreachable */
-#define ISC_R_NETDOWN 10 /*%< network down */
-#define ISC_R_HOSTDOWN 11 /*%< host down */
-#define ISC_R_CONNREFUSED 12 /*%< connection refused */
-#define ISC_R_NORESOURCES 13 /*%< not enough free resources */
-#define ISC_R_EOF 14 /*%< end of file */
-#define ISC_R_BOUND 15 /*%< socket already bound */
-#define ISC_R_RELOAD 16 /*%< reload */
-#define ISC_R_LOCKBUSY 17 /*%< lock busy */
-#define ISC_R_EXISTS 18 /*%< already exists */
-#define ISC_R_NOSPACE 19 /*%< ran out of space */
-#define ISC_R_CANCELED 20 /*%< operation canceled */
-#define ISC_R_NOTBOUND 21 /*%< socket is not bound */
-#define ISC_R_SHUTTINGDOWN 22 /*%< shutting down */
-#define ISC_R_NOTFOUND 23 /*%< not found */
-#define ISC_R_UNEXPECTEDEND 24 /*%< unexpected end of input */
-#define ISC_R_FAILURE 25 /*%< generic failure */
-#define ISC_R_IOERROR 26 /*%< I/O error */
-#define ISC_R_NOTIMPLEMENTED 27 /*%< not implemented */
-#define ISC_R_UNBALANCED 28 /*%< unbalanced parentheses */
-#define ISC_R_NOMORE 29 /*%< no more */
-#define ISC_R_INVALIDFILE 30 /*%< invalid file */
-#define ISC_R_BADBASE64 31 /*%< bad base64 encoding */
-#define ISC_R_UNEXPECTEDTOKEN 32 /*%< unexpected token */
-#define ISC_R_QUOTA 33 /*%< quota reached */
-#define ISC_R_UNEXPECTED 34 /*%< unexpected error */
-#define ISC_R_ALREADYRUNNING 35 /*%< already running */
-#define ISC_R_IGNORE 36 /*%< ignore */
-#define ISC_R_MASKNONCONTIG 37 /*%< addr mask not contiguous */
-#define ISC_R_FILENOTFOUND 38 /*%< file not found */
-#define ISC_R_FILEEXISTS 39 /*%< file already exists */
-#define ISC_R_NOTCONNECTED 40 /*%< socket is not connected */
-#define ISC_R_RANGE 41 /*%< out of range */
-#define ISC_R_NOENTROPY 42 /*%< out of entropy */
-#define ISC_R_MULTICAST 43 /*%< invalid use of multicast */
-#define ISC_R_NOTFILE 44 /*%< not a file */
-#define ISC_R_NOTDIRECTORY 45 /*%< not a directory */
-#define ISC_R_QUEUEFULL 46 /*%< queue is full */
-#define ISC_R_FAMILYMISMATCH 47 /*%< address family mismatch */
-#define ISC_R_FAMILYNOSUPPORT 48 /*%< AF not supported */
-#define ISC_R_BADHEX 49 /*%< bad hex encoding */
-#define ISC_R_TOOMANYOPENFILES 50 /*%< too many open files */
-#define ISC_R_NOTBLOCKING 51 /*%< not blocking */
-#define ISC_R_UNBALANCEDQUOTES 52 /*%< unbalanced quotes */
-#define ISC_R_INPROGRESS 53 /*%< operation in progress */
-#define ISC_R_CONNECTIONRESET 54 /*%< connection reset */
-#define ISC_R_SOFTQUOTA 55 /*%< soft quota reached */
-#define ISC_R_BADNUMBER 56 /*%< not a valid number */
-#define ISC_R_DISABLED 57 /*%< disabled */
-#define ISC_R_MAXSIZE 58 /*%< max size */
-#define ISC_R_BADADDRESSFORM 59 /*%< invalid address format */
-#define ISC_R_BADBASE32 60 /*%< bad base32 encoding */
-
-/*% Not a result code: the number of results. */
-#define ISC_R_NRESULTS 61
-
-ISC_LANG_BEGINDECLS
-
-const char *
-isc_result_totext(isc_result_t);
-/*%<
- * Convert an isc_result_t into a string message describing the result.
- */
-
-isc_result_t
-isc_result_register(unsigned int base, unsigned int nresults,
- const char **text, isc_msgcat_t *msgcat, int set);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_RESULT_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: resultclass.h,v 1.18 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_RESULTCLASS_H
-#define ISC_RESULTCLASS_H 1
-
-
-/*! \file isc/resultclass.h
- * \brief Registry of Predefined Result Type Classes
- *
- * A result class number is an unsigned 16 bit number. Each class may
- * contain up to 65536 results. A result code is formed by adding the
- * result number within the class to the class number multiplied by 65536.
- *
- * Classes < 1024 are reserved for ISC use.
- * Result classes >= 1024 and <= 65535 are reserved for application use.
- */
-
-#define ISC_RESULTCLASS_FROMNUM(num) ((num) << 16)
-#define ISC_RESULTCLASS_TONUM(rclass) ((rclass) >> 16)
-#define ISC_RESULTCLASS_SIZE 65536
-#define ISC_RESULTCLASS_INCLASS(rclass, result) \
- ((rclass) == ((result) & 0xFFFF0000))
-
-
-#define ISC_RESULTCLASS_ISC ISC_RESULTCLASS_FROMNUM(0)
-#define ISC_RESULTCLASS_DNS ISC_RESULTCLASS_FROMNUM(1)
-#define ISC_RESULTCLASS_DST ISC_RESULTCLASS_FROMNUM(2)
-#define ISC_RESULTCLASS_DNSRCODE ISC_RESULTCLASS_FROMNUM(3)
-#define ISC_RESULTCLASS_OMAPI ISC_RESULTCLASS_FROMNUM(4)
-#define ISC_RESULTCLASS_ISCCC ISC_RESULTCLASS_FROMNUM(5)
-
-
-#endif /* ISC_RESULTCLASS_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001, 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: rwlock.h,v 1.28 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_RWLOCK_H
-#define ISC_RWLOCK_H 1
-
-/*! \file isc/rwlock.h */
-
-#include <isc/condition.h>
-#include <isc/lang.h>
-#include <isc/platform.h>
-#include <isc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-typedef enum {
- isc_rwlocktype_none = 0,
- isc_rwlocktype_read,
- isc_rwlocktype_write
-} isc_rwlocktype_t;
-
-#ifdef ISC_PLATFORM_USETHREADS
-#if defined(ISC_PLATFORM_HAVEXADD) && defined(ISC_PLATFORM_HAVECMPXCHG)
-#define ISC_RWLOCK_USEATOMIC 1
-#endif
-
-struct isc_rwlock {
- /* Unlocked. */
- unsigned int magic;
- isc_mutex_t lock;
-
-#if defined(ISC_PLATFORM_HAVEXADD) && defined(ISC_PLATFORM_HAVECMPXCHG)
- /*
- * When some atomic instructions with hardware assistance are
- * available, rwlock will use those so that concurrent readers do not
- * interfere with each other through mutex as long as no writers
- * appear, massively reducing the lock overhead in the typical case.
- *
- * The basic algorithm of this approach is the "simple
- * writer-preference lock" shown in the following URL:
- * http://www.cs.rochester.edu/u/scott/synchronization/pseudocode/rw.html
- * but our implementation does not rely on the spin lock unlike the
- * original algorithm to be more portable as a user space application.
- */
-
- /* Read or modified atomically. */
- isc_int32_t write_requests;
- isc_int32_t write_completions;
- isc_int32_t cnt_and_flag;
-
- /* Locked by lock. */
- isc_condition_t readable;
- isc_condition_t writeable;
- unsigned int readers_waiting;
-
- /* Locked by rwlock itself. */
- unsigned int write_granted;
-
- /* Unlocked. */
- unsigned int write_quota;
-
-#else /* ISC_PLATFORM_HAVEXADD && ISC_PLATFORM_HAVECMPXCHG */
-
- /*%< Locked by lock. */
- isc_condition_t readable;
- isc_condition_t writeable;
- isc_rwlocktype_t type;
-
- /*% The number of threads that have the lock. */
- unsigned int active;
-
- /*%
- * The number of lock grants made since the lock was last switched
- * from reading to writing or vice versa; used in determining
- * when the quota is reached and it is time to switch.
- */
- unsigned int granted;
-
- unsigned int readers_waiting;
- unsigned int writers_waiting;
- unsigned int read_quota;
- unsigned int write_quota;
- isc_rwlocktype_t original;
-#endif /* ISC_PLATFORM_HAVEXADD && ISC_PLATFORM_HAVECMPXCHG */
-};
-#else /* ISC_PLATFORM_USETHREADS */
-struct isc_rwlock {
- unsigned int magic;
- isc_rwlocktype_t type;
- unsigned int active;
-};
-#endif /* ISC_PLATFORM_USETHREADS */
-
-
-isc_result_t
-isc_rwlock_init(isc_rwlock_t *rwl, unsigned int read_quota,
- unsigned int write_quota);
-
-isc_result_t
-isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type);
-
-isc_result_t
-isc_rwlock_trylock(isc_rwlock_t *rwl, isc_rwlocktype_t type);
-
-isc_result_t
-isc_rwlock_unlock(isc_rwlock_t *rwl, isc_rwlocktype_t type);
-
-isc_result_t
-isc_rwlock_tryupgrade(isc_rwlock_t *rwl);
-
-void
-isc_rwlock_downgrade(isc_rwlock_t *rwl);
-
-void
-isc_rwlock_destroy(isc_rwlock_t *rwl);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_RWLOCK_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: serial.h,v 1.16.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef ISC_SERIAL_H
-#define ISC_SERIAL_H 1
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-/*! \file isc/serial.h
- * \brief Implement 32 bit serial space arithmetic comparison functions.
- * Note: Undefined results are returned as ISC_FALSE.
- */
-
-/***
- *** Functions
- ***/
-
-ISC_LANG_BEGINDECLS
-
-isc_boolean_t
-isc_serial_lt(isc_uint32_t a, isc_uint32_t b);
-/*%<
- * Return true if 'a' < 'b' otherwise false.
- */
-
-isc_boolean_t
-isc_serial_gt(isc_uint32_t a, isc_uint32_t b);
-/*%<
- * Return true if 'a' > 'b' otherwise false.
- */
-
-isc_boolean_t
-isc_serial_le(isc_uint32_t a, isc_uint32_t b);
-/*%<
- * Return true if 'a' <= 'b' otherwise false.
- */
-
-isc_boolean_t
-isc_serial_ge(isc_uint32_t a, isc_uint32_t b);
-/*%<
- * Return true if 'a' >= 'b' otherwise false.
- */
-
-isc_boolean_t
-isc_serial_eq(isc_uint32_t a, isc_uint32_t b);
-/*%<
- * Return true if 'a' == 'b' otherwise false.
- */
-
-isc_boolean_t
-isc_serial_ne(isc_uint32_t a, isc_uint32_t b);
-/*%<
- * Return true if 'a' != 'b' otherwise false.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_SERIAL_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef ISC_SHA1_H
-#define ISC_SHA1_H 1
-
-/* $Id: sha1.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */
-
-/* $NetBSD: sha1.h,v 1.2 1998/05/29 22:55:44 thorpej Exp $ */
-
-/*! \file isc/sha1.h
- * \brief SHA-1 in C
- * \author By Steve Reid <steve@edmweb.com>
- * \note 100% Public Domain
- */
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-#define ISC_SHA1_DIGESTLENGTH 20U
-#define ISC_SHA1_BLOCK_LENGTH 64U
-
-typedef struct {
- isc_uint32_t state[5];
- isc_uint32_t count[2];
- unsigned char buffer[ISC_SHA1_BLOCK_LENGTH];
-} isc_sha1_t;
-
-ISC_LANG_BEGINDECLS
-
-void
-isc_sha1_init(isc_sha1_t *ctx);
-
-void
-isc_sha1_invalidate(isc_sha1_t *ctx);
-
-void
-isc_sha1_update(isc_sha1_t *ctx, const unsigned char *data, unsigned int len);
-
-void
-isc_sha1_final(isc_sha1_t *ctx, unsigned char *digest);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_SHA1_H */
+++ /dev/null
-/*
- * Copyright (C) 2005-2007 Internet Systems Consortium, Inc. ("ISC")
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: sha2.h,v 1.9 2007/06/19 23:47:18 tbox Exp $ */
-
-/* $FreeBSD: src/sys/crypto/sha2/sha2.h,v 1.1.2.1 2001/07/03 11:01:36 ume Exp $ */
-/* $KAME: sha2.h,v 1.3 2001/03/12 08:27:48 itojun Exp $ */
-
-/*
- * sha2.h
- *
- * Version 1.0.0beta1
- *
- * Written by Aaron D. Gifford <me@aarongifford.com>
- *
- * Copyright 2000 Aaron D. Gifford. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holder nor the names of contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTOR(S) ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTOR(S) BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-#ifndef ISC_SHA2_H
-#define ISC_SHA2_H
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-/*** SHA-224/256/384/512 Various Length Definitions ***********************/
-
-#define ISC_SHA224_BLOCK_LENGTH 64U
-#define ISC_SHA224_DIGESTLENGTH 28U
-#define ISC_SHA224_DIGESTSTRINGLENGTH (ISC_SHA224_DIGESTLENGTH * 2 + 1)
-#define ISC_SHA256_BLOCK_LENGTH 64U
-#define ISC_SHA256_DIGESTLENGTH 32U
-#define ISC_SHA256_DIGESTSTRINGLENGTH (ISC_SHA256_DIGESTLENGTH * 2 + 1)
-#define ISC_SHA384_BLOCK_LENGTH 128
-#define ISC_SHA384_DIGESTLENGTH 48U
-#define ISC_SHA384_DIGESTSTRINGLENGTH (ISC_SHA384_DIGESTLENGTH * 2 + 1)
-#define ISC_SHA512_BLOCK_LENGTH 128U
-#define ISC_SHA512_DIGESTLENGTH 64U
-#define ISC_SHA512_DIGESTSTRINGLENGTH (ISC_SHA512_DIGESTLENGTH * 2 + 1)
-
-
-ISC_LANG_BEGINDECLS
-
-/*** SHA-256/384/512 Context Structures *******************************/
-
-/*
- * Keep buffer immediately after bitcount to preserve alignment.
- */
-typedef struct {
- isc_uint32_t state[8];
- isc_uint64_t bitcount;
- isc_uint8_t buffer[ISC_SHA256_BLOCK_LENGTH];
-} isc_sha256_t;
-
-/*
- * Keep buffer immediately after bitcount to preserve alignment.
- */
-typedef struct {
- isc_uint64_t state[8];
- isc_uint64_t bitcount[2];
- isc_uint8_t buffer[ISC_SHA512_BLOCK_LENGTH];
-} isc_sha512_t;
-
-typedef isc_sha256_t isc_sha224_t;
-typedef isc_sha512_t isc_sha384_t;
-
-/*** SHA-224/256/384/512 Function Prototypes ******************************/
-
-void isc_sha224_init (isc_sha224_t *);
-void isc_sha224_update (isc_sha224_t *, const isc_uint8_t *, size_t);
-void isc_sha224_final (isc_uint8_t[ISC_SHA224_DIGESTLENGTH], isc_sha224_t *);
-char *isc_sha224_end (isc_sha224_t *, char[ISC_SHA224_DIGESTSTRINGLENGTH]);
-char *isc_sha224_data (const isc_uint8_t *, size_t, char[ISC_SHA224_DIGESTSTRINGLENGTH]);
-
-void isc_sha256_init (isc_sha256_t *);
-void isc_sha256_update (isc_sha256_t *, const isc_uint8_t *, size_t);
-void isc_sha256_final (isc_uint8_t[ISC_SHA256_DIGESTLENGTH], isc_sha256_t *);
-char *isc_sha256_end (isc_sha256_t *, char[ISC_SHA256_DIGESTSTRINGLENGTH]);
-char *isc_sha256_data (const isc_uint8_t *, size_t, char[ISC_SHA256_DIGESTSTRINGLENGTH]);
-
-void isc_sha384_init (isc_sha384_t *);
-void isc_sha384_update (isc_sha384_t *, const isc_uint8_t *, size_t);
-void isc_sha384_final (isc_uint8_t[ISC_SHA384_DIGESTLENGTH], isc_sha384_t *);
-char *isc_sha384_end (isc_sha384_t *, char[ISC_SHA384_DIGESTSTRINGLENGTH]);
-char *isc_sha384_data (const isc_uint8_t *, size_t, char[ISC_SHA384_DIGESTSTRINGLENGTH]);
-
-void isc_sha512_init (isc_sha512_t *);
-void isc_sha512_update (isc_sha512_t *, const isc_uint8_t *, size_t);
-void isc_sha512_final (isc_uint8_t[ISC_SHA512_DIGESTLENGTH], isc_sha512_t *);
-char *isc_sha512_end (isc_sha512_t *, char[ISC_SHA512_DIGESTSTRINGLENGTH]);
-char *isc_sha512_data (const isc_uint8_t *, size_t, char[ISC_SHA512_DIGESTSTRINGLENGTH]);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_SHA2_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: sockaddr.h,v 1.55.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef ISC_SOCKADDR_H
-#define ISC_SOCKADDR_H 1
-
-/*! \file isc/sockaddr.h */
-
-#include <isc/lang.h>
-#include <isc/net.h>
-#include <isc/types.h>
-#ifdef ISC_PLATFORM_HAVESYSUNH
-#include <sys/un.h>
-#endif
-
-struct isc_sockaddr {
- union {
- struct sockaddr sa;
- struct sockaddr_in sin;
- struct sockaddr_in6 sin6;
-#ifdef ISC_PLATFORM_HAVESYSUNH
- struct sockaddr_un sunix;
-#endif
- } type;
- unsigned int length; /* XXXRTH beginning? */
- ISC_LINK(struct isc_sockaddr) link;
-};
-
-typedef ISC_LIST(struct isc_sockaddr) isc_sockaddrlist_t;
-
-#define ISC_SOCKADDR_CMPADDR 0x0001 /*%< compare the address
- * sin_addr/sin6_addr */
-#define ISC_SOCKADDR_CMPPORT 0x0002 /*%< compare the port
- * sin_port/sin6_port */
-#define ISC_SOCKADDR_CMPSCOPE 0x0004 /*%< compare the scope
- * sin6_scope */
-#define ISC_SOCKADDR_CMPSCOPEZERO 0x0008 /*%< when comparing scopes
- * zero scopes always match */
-
-ISC_LANG_BEGINDECLS
-
-isc_boolean_t
-isc_sockaddr_compare(const isc_sockaddr_t *a, const isc_sockaddr_t *b,
- unsigned int flags);
-/*%<
- * Compare the elements of the two address ('a' and 'b') as specified
- * by 'flags' and report if they are equal or not.
- *
- * 'flags' is set from ISC_SOCKADDR_CMP*.
- */
-
-isc_boolean_t
-isc_sockaddr_equal(const isc_sockaddr_t *a, const isc_sockaddr_t *b);
-/*%<
- * Return ISC_TRUE iff the socket addresses 'a' and 'b' are equal.
- */
-
-isc_boolean_t
-isc_sockaddr_eqaddr(const isc_sockaddr_t *a, const isc_sockaddr_t *b);
-/*%<
- * Return ISC_TRUE iff the address parts of the socket addresses
- * 'a' and 'b' are equal, ignoring the ports.
- */
-
-isc_boolean_t
-isc_sockaddr_eqaddrprefix(const isc_sockaddr_t *a, const isc_sockaddr_t *b,
- unsigned int prefixlen);
-/*%<
- * Return ISC_TRUE iff the most significant 'prefixlen' bits of the
- * socket addresses 'a' and 'b' are equal, ignoring the ports.
- * If 'b''s scope is zero then 'a''s scope will be ignored.
- */
-
-unsigned int
-isc_sockaddr_hash(const isc_sockaddr_t *sockaddr, isc_boolean_t address_only);
-/*%<
- * Return a hash value for the socket address 'sockaddr'. If 'address_only'
- * is ISC_TRUE, the hash value will not depend on the port.
- *
- * IPv6 addresses containing mapped IPv4 addresses generate the same hash
- * value as the equivalent IPv4 address.
- */
-
-void
-isc_sockaddr_any(isc_sockaddr_t *sockaddr);
-/*%<
- * Return the IPv4 wildcard address.
- */
-
-void
-isc_sockaddr_any6(isc_sockaddr_t *sockaddr);
-/*%<
- * Return the IPv6 wildcard address.
- */
-
-void
-isc_sockaddr_anyofpf(isc_sockaddr_t *sockaddr, int family);
-/*%<
- * Set '*sockaddr' to the wildcard address of protocol family
- * 'family'.
- *
- * Requires:
- * \li 'family' is AF_INET or AF_INET6.
- */
-
-void
-isc_sockaddr_fromin(isc_sockaddr_t *sockaddr, const struct in_addr *ina,
- in_port_t port);
-/*%<
- * Construct an isc_sockaddr_t from an IPv4 address and port.
- */
-
-void
-isc_sockaddr_fromin6(isc_sockaddr_t *sockaddr, const struct in6_addr *ina6,
- in_port_t port);
-/*%<
- * Construct an isc_sockaddr_t from an IPv6 address and port.
- */
-
-void
-isc_sockaddr_v6fromin(isc_sockaddr_t *sockaddr, const struct in_addr *ina,
- in_port_t port);
-/*%<
- * Construct an IPv6 isc_sockaddr_t representing a mapped IPv4 address.
- */
-
-void
-isc_sockaddr_fromnetaddr(isc_sockaddr_t *sockaddr, const isc_netaddr_t *na,
- in_port_t port);
-/*%<
- * Construct an isc_sockaddr_t from an isc_netaddr_t and port.
- */
-
-int
-isc_sockaddr_pf(const isc_sockaddr_t *sockaddr);
-/*%<
- * Get the protocol family of 'sockaddr'.
- *
- * Requires:
- *
- *\li 'sockaddr' is a valid sockaddr with an address family of AF_INET
- * or AF_INET6.
- *
- * Returns:
- *
- *\li The protocol family of 'sockaddr', e.g. PF_INET or PF_INET6.
- */
-
-void
-isc_sockaddr_setport(isc_sockaddr_t *sockaddr, in_port_t port);
-/*%<
- * Set the port of 'sockaddr' to 'port'.
- */
-
-in_port_t
-isc_sockaddr_getport(const isc_sockaddr_t *sockaddr);
-/*%<
- * Get the port stored in 'sockaddr'.
- */
-
-isc_result_t
-isc_sockaddr_totext(const isc_sockaddr_t *sockaddr, isc_buffer_t *target);
-/*%<
- * Append a text representation of 'sockaddr' to the buffer 'target'.
- * The text will include both the IP address (v4 or v6) and the port.
- * The text is null terminated, but the terminating null is not
- * part of the buffer's used region.
- *
- * Returns:
- * \li ISC_R_SUCCESS
- * \li ISC_R_NOSPACE The text or the null termination did not fit.
- */
-
-void
-isc_sockaddr_format(const isc_sockaddr_t *sa, char *array, unsigned int size);
-/*%<
- * Format a human-readable representation of the socket address '*sa'
- * into the character array 'array', which is of size 'size'.
- * The resulting string is guaranteed to be null-terminated.
- */
-
-isc_boolean_t
-isc_sockaddr_ismulticast(const isc_sockaddr_t *sa);
-/*%<
- * Returns #ISC_TRUE if the address is a multicast address.
- */
-
-isc_boolean_t
-isc_sockaddr_isexperimental(const isc_sockaddr_t *sa);
-/*
- * Returns ISC_TRUE if the address is a experimental (CLASS E) address.
- */
-
-isc_boolean_t
-isc_sockaddr_islinklocal(const isc_sockaddr_t *sa);
-/*%<
- * Returns ISC_TRUE if the address is a link local address.
- */
-
-isc_boolean_t
-isc_sockaddr_issitelocal(const isc_sockaddr_t *sa);
-/*%<
- * Returns ISC_TRUE if the address is a sitelocal address.
- */
-
-isc_result_t
-isc_sockaddr_frompath(isc_sockaddr_t *sockaddr, const char *path);
-/*
- * Create a UNIX domain sockaddr that refers to path.
- *
- * Returns:
- * \li ISC_R_NOSPACE
- * \li ISC_R_NOTIMPLEMENTED
- * \li ISC_R_SUCCESS
- */
-
-#define ISC_SOCKADDR_FORMATSIZE \
- sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:XXX.XXX.XXX.XXX%SSSSSSSSSS#YYYYY")
-/*%<
- * Minimum size of array to pass to isc_sockaddr_format().
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_SOCKADDR_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: socket.h,v 1.85.58.3 2009/01/29 22:40:35 jinmei Exp $ */
-
-#ifndef ISC_SOCKET_H
-#define ISC_SOCKET_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isc/socket.h
- * \brief Provides TCP and UDP sockets for network I/O. The sockets are event
- * sources in the task system.
- *
- * When I/O completes, a completion event for the socket is posted to the
- * event queue of the task which requested the I/O.
- *
- * \li MP:
- * The module ensures appropriate synchronization of data structures it
- * creates and manipulates.
- * Clients of this module must not be holding a socket's task's lock when
- * making a call that affects that socket. Failure to follow this rule
- * can result in deadlock.
- * The caller must ensure that isc_socketmgr_destroy() is called only
- * once for a given manager.
- *
- * \li Reliability:
- * No anticipated impact.
- *
- * \li Resources:
- * TBS
- *
- * \li Security:
- * No anticipated impact.
- *
- * \li Standards:
- * None.
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-#include <isc/types.h>
-#include <isc/event.h>
-#include <isc/eventclass.h>
-#include <isc/time.h>
-#include <isc/region.h>
-#include <isc/sockaddr.h>
-#include <isc/xml.h>
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Constants
- ***/
-
-/*%
- * Maximum number of buffers in a scatter/gather read/write. The operating
- * system in use must support at least this number (plus one on some.)
- */
-#define ISC_SOCKET_MAXSCATTERGATHER 8
-
-/*%
- * In isc_socket_bind() set socket option SO_REUSEADDR prior to calling
- * bind() if a non zero port is specified (AF_INET and AF_INET6).
- */
-#define ISC_SOCKET_REUSEADDRESS 0x01U
-
-/*%
- * Statistics counters. Used as isc_statscounter_t values.
- */
-enum {
- isc_sockstatscounter_udp4open = 0,
- isc_sockstatscounter_udp6open = 1,
- isc_sockstatscounter_tcp4open = 2,
- isc_sockstatscounter_tcp6open = 3,
- isc_sockstatscounter_unixopen = 4,
-
- isc_sockstatscounter_udp4openfail = 5,
- isc_sockstatscounter_udp6openfail = 6,
- isc_sockstatscounter_tcp4openfail = 7,
- isc_sockstatscounter_tcp6openfail = 8,
- isc_sockstatscounter_unixopenfail = 9,
-
- isc_sockstatscounter_udp4close = 10,
- isc_sockstatscounter_udp6close = 11,
- isc_sockstatscounter_tcp4close = 12,
- isc_sockstatscounter_tcp6close = 13,
- isc_sockstatscounter_unixclose = 14,
- isc_sockstatscounter_fdwatchclose = 15,
-
- isc_sockstatscounter_udp4bindfail = 16,
- isc_sockstatscounter_udp6bindfail = 17,
- isc_sockstatscounter_tcp4bindfail = 18,
- isc_sockstatscounter_tcp6bindfail = 19,
- isc_sockstatscounter_unixbindfail = 20,
- isc_sockstatscounter_fdwatchbindfail = 21,
-
- isc_sockstatscounter_udp4connect = 22,
- isc_sockstatscounter_udp6connect = 23,
- isc_sockstatscounter_tcp4connect = 24,
- isc_sockstatscounter_tcp6connect = 25,
- isc_sockstatscounter_unixconnect = 26,
- isc_sockstatscounter_fdwatchconnect = 27,
-
- isc_sockstatscounter_udp4connectfail = 28,
- isc_sockstatscounter_udp6connectfail = 29,
- isc_sockstatscounter_tcp4connectfail = 30,
- isc_sockstatscounter_tcp6connectfail = 31,
- isc_sockstatscounter_unixconnectfail = 32,
- isc_sockstatscounter_fdwatchconnectfail = 33,
-
- isc_sockstatscounter_tcp4accept = 34,
- isc_sockstatscounter_tcp6accept = 35,
- isc_sockstatscounter_unixaccept = 36,
-
- isc_sockstatscounter_tcp4acceptfail = 37,
- isc_sockstatscounter_tcp6acceptfail = 38,
- isc_sockstatscounter_unixacceptfail = 39,
-
- isc_sockstatscounter_udp4sendfail = 40,
- isc_sockstatscounter_udp6sendfail = 41,
- isc_sockstatscounter_tcp4sendfail = 42,
- isc_sockstatscounter_tcp6sendfail = 43,
- isc_sockstatscounter_unixsendfail = 44,
- isc_sockstatscounter_fdwatchsendfail = 45,
-
- isc_sockstatscounter_udp4recvfail = 46,
- isc_sockstatscounter_udp6recvfail = 47,
- isc_sockstatscounter_tcp4recvfail = 48,
- isc_sockstatscounter_tcp6recvfail = 49,
- isc_sockstatscounter_unixrecvfail = 50,
- isc_sockstatscounter_fdwatchrecvfail = 51,
-
- isc_sockstatscounter_max = 52
-};
-
-/***
- *** Types
- ***/
-
-struct isc_socketevent {
- ISC_EVENT_COMMON(isc_socketevent_t);
- isc_result_t result; /*%< OK, EOF, whatever else */
- unsigned int minimum; /*%< minimum i/o for event */
- unsigned int n; /*%< bytes read or written */
- unsigned int offset; /*%< offset into buffer list */
- isc_region_t region; /*%< for single-buffer i/o */
- isc_bufferlist_t bufferlist; /*%< list of buffers */
- isc_sockaddr_t address; /*%< source address */
- isc_time_t timestamp; /*%< timestamp of packet recv */
- struct in6_pktinfo pktinfo; /*%< ipv6 pktinfo */
- isc_uint32_t attributes; /*%< see below */
- isc_eventdestructor_t destroy; /*%< original destructor */
-};
-
-typedef struct isc_socket_newconnev isc_socket_newconnev_t;
-struct isc_socket_newconnev {
- ISC_EVENT_COMMON(isc_socket_newconnev_t);
- isc_socket_t * newsocket;
- isc_result_t result; /*%< OK, EOF, whatever else */
- isc_sockaddr_t address; /*%< source address */
-};
-
-typedef struct isc_socket_connev isc_socket_connev_t;
-struct isc_socket_connev {
- ISC_EVENT_COMMON(isc_socket_connev_t);
- isc_result_t result; /*%< OK, EOF, whatever else */
-};
-
-/*@{*/
-/*!
- * _ATTACHED: Internal use only.
- * _TRUNC: Packet was truncated on receive.
- * _CTRUNC: Packet control information was truncated. This can
- * indicate that the packet is not complete, even though
- * all the data is valid.
- * _TIMESTAMP: The timestamp member is valid.
- * _PKTINFO: The pktinfo member is valid.
- * _MULTICAST: The UDP packet was received via a multicast transmission.
- */
-#define ISC_SOCKEVENTATTR_ATTACHED 0x80000000U /* internal */
-#define ISC_SOCKEVENTATTR_TRUNC 0x00800000U /* public */
-#define ISC_SOCKEVENTATTR_CTRUNC 0x00400000U /* public */
-#define ISC_SOCKEVENTATTR_TIMESTAMP 0x00200000U /* public */
-#define ISC_SOCKEVENTATTR_PKTINFO 0x00100000U /* public */
-#define ISC_SOCKEVENTATTR_MULTICAST 0x00080000U /* public */
-/*@}*/
-
-#define ISC_SOCKEVENT_ANYEVENT (0)
-#define ISC_SOCKEVENT_RECVDONE (ISC_EVENTCLASS_SOCKET + 1)
-#define ISC_SOCKEVENT_SENDDONE (ISC_EVENTCLASS_SOCKET + 2)
-#define ISC_SOCKEVENT_NEWCONN (ISC_EVENTCLASS_SOCKET + 3)
-#define ISC_SOCKEVENT_CONNECT (ISC_EVENTCLASS_SOCKET + 4)
-
-/*
- * Internal events.
- */
-#define ISC_SOCKEVENT_INTR (ISC_EVENTCLASS_SOCKET + 256)
-#define ISC_SOCKEVENT_INTW (ISC_EVENTCLASS_SOCKET + 257)
-
-typedef enum {
- isc_sockettype_udp = 1,
- isc_sockettype_tcp = 2,
- isc_sockettype_unix = 3,
- isc_sockettype_fdwatch = 4
-} isc_sockettype_t;
-
-/*@{*/
-/*!
- * How a socket should be shutdown in isc_socket_shutdown() calls.
- */
-#define ISC_SOCKSHUT_RECV 0x00000001 /*%< close read side */
-#define ISC_SOCKSHUT_SEND 0x00000002 /*%< close write side */
-#define ISC_SOCKSHUT_ALL 0x00000003 /*%< close them all */
-/*@}*/
-
-/*@{*/
-/*!
- * What I/O events to cancel in isc_socket_cancel() calls.
- */
-#define ISC_SOCKCANCEL_RECV 0x00000001 /*%< cancel recv */
-#define ISC_SOCKCANCEL_SEND 0x00000002 /*%< cancel send */
-#define ISC_SOCKCANCEL_ACCEPT 0x00000004 /*%< cancel accept */
-#define ISC_SOCKCANCEL_CONNECT 0x00000008 /*%< cancel connect */
-#define ISC_SOCKCANCEL_ALL 0x0000000f /*%< cancel everything */
-/*@}*/
-
-/*@{*/
-/*!
- * Flags for isc_socket_send() and isc_socket_recv() calls.
- */
-#define ISC_SOCKFLAG_IMMEDIATE 0x00000001 /*%< send event only if needed */
-#define ISC_SOCKFLAG_NORETRY 0x00000002 /*%< drop failed UDP sends */
-/*@}*/
-
-/*@{*/
-/*!
- * Flags for fdwatchcreate.
- */
-#define ISC_SOCKFDWATCH_READ 0x00000001 /*%< watch for readable */
-#define ISC_SOCKFDWATCH_WRITE 0x00000002 /*%< watch for writable */
-/*@}*/
-
-/***
- *** Socket and Socket Manager Functions
- ***
- *** Note: all Ensures conditions apply only if the result is success for
- *** those functions which return an isc_result.
- ***/
-
-isc_result_t
-isc_socket_fdwatchcreate(isc_socketmgr_t *manager,
- int fd,
- int flags,
- isc_sockfdwatch_t callback,
- void *cbarg,
- isc_task_t *task,
- isc_socket_t **socketp);
-/*%<
- * Create a new file descriptor watch socket managed by 'manager'.
- *
- * Note:
- *
- *\li 'fd' is the already-opened file descriptor.
- *\li This function is not available on Windows.
- *\li The callback function is called "in-line" - this means the function
- * needs to return as fast as possible, as all other I/O will be suspended
- * until the callback completes.
- *
- * Requires:
- *
- *\li 'manager' is a valid manager
- *
- *\li 'socketp' is a valid pointer, and *socketp == NULL
- *
- *\li 'fd' be opened.
- *
- * Ensures:
- *
- * '*socketp' is attached to the newly created fdwatch socket
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_NORESOURCES
- *\li #ISC_R_UNEXPECTED
- */
-
-isc_result_t
-isc_socket_create(isc_socketmgr_t *manager,
- int pf,
- isc_sockettype_t type,
- isc_socket_t **socketp);
-/*%<
- * Create a new 'type' socket managed by 'manager'.
- *
- * For isc_sockettype_fdwatch sockets you should use isc_socket_fdwatchcreate()
- * rather than isc_socket_create().
- *
- * Note:
- *
- *\li 'pf' is the desired protocol family, e.g. PF_INET or PF_INET6.
- *
- * Requires:
- *
- *\li 'manager' is a valid manager
- *
- *\li 'socketp' is a valid pointer, and *socketp == NULL
- *
- *\li 'type' is not isc_sockettype_fdwatch
- *
- * Ensures:
- *
- * '*socketp' is attached to the newly created socket
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_NORESOURCES
- *\li #ISC_R_UNEXPECTED
- */
-
-void
-isc_socket_cancel(isc_socket_t *sock, isc_task_t *task,
- unsigned int how);
-/*%<
- * Cancel pending I/O of the type specified by "how".
- *
- * Note: if "task" is NULL, then the cancel applies to all tasks using the
- * socket.
- *
- * Requires:
- *
- * \li "socket" is a valid socket
- *
- * \li "task" is NULL or a valid task
- *
- * "how" is a bitmask describing the type of cancelation to perform.
- * The type ISC_SOCKCANCEL_ALL will cancel all pending I/O on this
- * socket.
- *
- * \li ISC_SOCKCANCEL_RECV:
- * Cancel pending isc_socket_recv() calls.
- *
- * \li ISC_SOCKCANCEL_SEND:
- * Cancel pending isc_socket_send() and isc_socket_sendto() calls.
- *
- * \li ISC_SOCKCANCEL_ACCEPT:
- * Cancel pending isc_socket_accept() calls.
- *
- * \li ISC_SOCKCANCEL_CONNECT:
- * Cancel pending isc_socket_connect() call.
- */
-
-void
-isc_socket_shutdown(isc_socket_t *sock, unsigned int how);
-/*%<
- * Shutdown 'socket' according to 'how'.
- *
- * Requires:
- *
- * \li 'socket' is a valid socket.
- *
- * \li 'task' is NULL or is a valid task.
- *
- * \li If 'how' is 'ISC_SOCKSHUT_RECV' or 'ISC_SOCKSHUT_ALL' then
- *
- * The read queue must be empty.
- *
- * No further read requests may be made.
- *
- * \li If 'how' is 'ISC_SOCKSHUT_SEND' or 'ISC_SOCKSHUT_ALL' then
- *
- * The write queue must be empty.
- *
- * No further write requests may be made.
- */
-
-void
-isc_socket_attach(isc_socket_t *sock, isc_socket_t **socketp);
-/*%<
- * Attach *socketp to socket.
- *
- * Requires:
- *
- * \li 'socket' is a valid socket.
- *
- * \li 'socketp' points to a NULL socket.
- *
- * Ensures:
- *
- * \li *socketp is attached to socket.
- */
-
-void
-isc_socket_detach(isc_socket_t **socketp);
-/*%<
- * Detach *socketp from its socket.
- *
- * Requires:
- *
- * \li 'socketp' points to a valid socket.
- *
- * \li If '*socketp' is the last reference to the socket,
- * then:
- *
- * There must be no pending I/O requests.
- *
- * Ensures:
- *
- * \li *socketp is NULL.
- *
- * \li If '*socketp' is the last reference to the socket,
- * then:
- *
- * The socket will be shutdown (both reading and writing)
- * for all tasks.
- *
- * All resources used by the socket have been freed
- */
-
-isc_result_t
-isc_socket_open(isc_socket_t *sock);
-/*%<
- * Open a new socket file descriptor of the given socket structure. It simply
- * opens a new descriptor; all of the other parameters including the socket
- * type are inherited from the existing socket. This function is provided to
- * avoid overhead of destroying and creating sockets when many short-lived
- * sockets are frequently opened and closed. When the efficiency is not an
- * issue, it should be safer to detach the unused socket and re-create a new
- * one. This optimization may not be available for some systems, in which
- * case this function will return ISC_R_NOTIMPLEMENTED and must not be used.
- *
- * isc_socket_open() should not be called on sockets created by
- * isc_socket_fdwatchcreate().
- *
- * Requires:
- *
- * \li there must be no other reference to this socket.
- *
- * \li 'socket' is a valid and previously closed by isc_socket_close()
- *
- * \li 'sock->type' is not isc_sockettype_fdwatch
- *
- * Returns:
- * Same as isc_socket_create().
- * \li ISC_R_NOTIMPLEMENTED
- */
-
-isc_result_t
-isc_socket_close(isc_socket_t *sock);
-/*%<
- * Close a socket file descriptor of the given socket structure. This function
- * is provided as an alternative to destroying an unused socket when overhead
- * destroying/re-creating sockets can be significant, and is expected to be
- * used with isc_socket_open(). This optimization may not be available for some
- * systems, in which case this function will return ISC_R_NOTIMPLEMENTED and
- * must not be used.
- *
- * isc_socket_close() should not be called on sockets created by
- * isc_socket_fdwatchcreate().
- *
- * Requires:
- *
- * \li The socket must have a valid descriptor.
- *
- * \li There must be no other reference to this socket.
- *
- * \li There must be no pending I/O requests.
- *
- * \li 'sock->type' is not isc_sockettype_fdwatch
- *
- * Returns:
- * \li #ISC_R_NOTIMPLEMENTED
- */
-
-isc_result_t
-isc_socket_bind(isc_socket_t *sock, isc_sockaddr_t *addressp,
- unsigned int options);
-/*%<
- * Bind 'socket' to '*addressp'.
- *
- * Requires:
- *
- * \li 'socket' is a valid socket
- *
- * \li 'addressp' points to a valid isc_sockaddr.
- *
- * Returns:
- *
- * \li ISC_R_SUCCESS
- * \li ISC_R_NOPERM
- * \li ISC_R_ADDRNOTAVAIL
- * \li ISC_R_ADDRINUSE
- * \li ISC_R_BOUND
- * \li ISC_R_UNEXPECTED
- */
-
-isc_result_t
-isc_socket_filter(isc_socket_t *sock, const char *filter);
-/*%<
- * Inform the kernel that it should perform accept filtering.
- * If filter is NULL the current filter will be removed.:w
- */
-
-isc_result_t
-isc_socket_listen(isc_socket_t *sock, unsigned int backlog);
-/*%<
- * Set listen mode on the socket. After this call, the only function that
- * can be used (other than attach and detach) is isc_socket_accept().
- *
- * Notes:
- *
- * \li 'backlog' is as in the UNIX system call listen() and may be
- * ignored by non-UNIX implementations.
- *
- * \li If 'backlog' is zero, a reasonable system default is used, usually
- * SOMAXCONN.
- *
- * Requires:
- *
- * \li 'socket' is a valid, bound TCP socket or a valid, bound UNIX socket.
- *
- * Returns:
- *
- * \li ISC_R_SUCCESS
- * \li ISC_R_UNEXPECTED
- */
-
-isc_result_t
-isc_socket_accept(isc_socket_t *sock,
- isc_task_t *task, isc_taskaction_t action, const void *arg);
-/*%<
- * Queue accept event. When a new connection is received, the task will
- * get an ISC_SOCKEVENT_NEWCONN event with the sender set to the listen
- * socket. The new socket structure is sent inside the isc_socket_newconnev_t
- * event type, and is attached to the task 'task'.
- *
- * REQUIRES:
- * \li 'socket' is a valid TCP socket that isc_socket_listen() was called
- * on.
- *
- * \li 'task' is a valid task
- *
- * \li 'action' is a valid action
- *
- * RETURNS:
- * \li ISC_R_SUCCESS
- * \li ISC_R_NOMEMORY
- * \li ISC_R_UNEXPECTED
- */
-
-isc_result_t
-isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addressp,
- isc_task_t *task, isc_taskaction_t action,
- const void *arg);
-/*%<
- * Connect 'socket' to peer with address *saddr. When the connection
- * succeeds, or when an error occurs, a CONNECT event with action 'action'
- * and arg 'arg' will be posted to the event queue for 'task'.
- *
- * Requires:
- *
- * \li 'socket' is a valid TCP socket
- *
- * \li 'addressp' points to a valid isc_sockaddr
- *
- * \li 'task' is a valid task
- *
- * \li 'action' is a valid action
- *
- * Returns:
- *
- * \li ISC_R_SUCCESS
- * \li ISC_R_NOMEMORY
- * \li ISC_R_UNEXPECTED
- *
- * Posted event's result code:
- *
- * \li ISC_R_SUCCESS
- * \li ISC_R_TIMEDOUT
- * \li ISC_R_CONNREFUSED
- * \li ISC_R_NETUNREACH
- * \li ISC_R_UNEXPECTED
- */
-
-isc_result_t
-isc_socket_getpeername(isc_socket_t *sock, isc_sockaddr_t *addressp);
-/*%<
- * Get the name of the peer connected to 'socket'.
- *
- * Requires:
- *
- * \li 'socket' is a valid TCP socket.
- *
- * Returns:
- *
- * \li ISC_R_SUCCESS
- * \li ISC_R_TOOSMALL
- * \li ISC_R_UNEXPECTED
- */
-
-isc_result_t
-isc_socket_getsockname(isc_socket_t *sock, isc_sockaddr_t *addressp);
-/*%<
- * Get the name of 'socket'.
- *
- * Requires:
- *
- * \li 'socket' is a valid socket.
- *
- * Returns:
- *
- * \li ISC_R_SUCCESS
- * \li ISC_R_TOOSMALL
- * \li ISC_R_UNEXPECTED
- */
-
-/*@{*/
-isc_result_t
-isc_socket_recv(isc_socket_t *sock, isc_region_t *region,
- unsigned int minimum,
- isc_task_t *task, isc_taskaction_t action, const void *arg);
-isc_result_t
-isc_socket_recvv(isc_socket_t *sock, isc_bufferlist_t *buflist,
- unsigned int minimum,
- isc_task_t *task, isc_taskaction_t action, const void *arg);
-
-isc_result_t
-isc_socket_recv2(isc_socket_t *sock, isc_region_t *region,
- unsigned int minimum, isc_task_t *task,
- isc_socketevent_t *event, unsigned int flags);
-
-/*!
- * Receive from 'socket', storing the results in region.
- *
- * Notes:
- *
- *\li Let 'length' refer to the length of 'region' or to the sum of all
- * available regions in the list of buffers '*buflist'.
- *
- *\li If 'minimum' is non-zero and at least that many bytes are read,
- * the completion event will be posted to the task 'task.' If minimum
- * is zero, the exact number of bytes requested in the region must
- * be read for an event to be posted. This only makes sense for TCP
- * connections, and is always set to 1 byte for UDP.
- *
- *\li The read will complete when the desired number of bytes have been
- * read, if end-of-input occurs, or if an error occurs. A read done
- * event with the given 'action' and 'arg' will be posted to the
- * event queue of 'task'.
- *
- *\li The caller may not modify 'region', the buffers which are passed
- * into this function, or any data they refer to until the completion
- * event is received.
- *
- *\li For isc_socket_recvv():
- * On successful completion, '*buflist' will be empty, and the list of
- * all buffers will be returned in the done event's 'bufferlist'
- * member. On error return, '*buflist' will be unchanged.
- *
- *\li For isc_socket_recv2():
- * 'event' is not NULL, and the non-socket specific fields are
- * expected to be initialized.
- *
- *\li For isc_socket_recv2():
- * The only defined value for 'flags' is ISC_SOCKFLAG_IMMEDIATE. If
- * set and the operation completes, the return value will be
- * ISC_R_SUCCESS and the event will be filled in and not sent. If the
- * operation does not complete, the return value will be
- * ISC_R_INPROGRESS and the event will be sent when the operation
- * completes.
- *
- * Requires:
- *
- *\li 'socket' is a valid, bound socket.
- *
- *\li For isc_socket_recv():
- * 'region' is a valid region
- *
- *\li For isc_socket_recvv():
- * 'buflist' is non-NULL, and '*buflist' contain at least one buffer.
- *
- *\li 'task' is a valid task
- *
- *\li For isc_socket_recv() and isc_socket_recvv():
- * action != NULL and is a valid action
- *
- *\li For isc_socket_recv2():
- * event != NULL
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_INPROGRESS
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_UNEXPECTED
- *
- * Event results:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_UNEXPECTED
- *\li XXX needs other net-type errors
- */
-/*@}*/
-
-/*@{*/
-isc_result_t
-isc_socket_send(isc_socket_t *sock, isc_region_t *region,
- isc_task_t *task, isc_taskaction_t action, const void *arg);
-isc_result_t
-isc_socket_sendto(isc_socket_t *sock, isc_region_t *region,
- isc_task_t *task, isc_taskaction_t action, const void *arg,
- isc_sockaddr_t *address, struct in6_pktinfo *pktinfo);
-isc_result_t
-isc_socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist,
- isc_task_t *task, isc_taskaction_t action, const void *arg);
-isc_result_t
-isc_socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist,
- isc_task_t *task, isc_taskaction_t action, const void *arg,
- isc_sockaddr_t *address, struct in6_pktinfo *pktinfo);
-isc_result_t
-isc_socket_sendto2(isc_socket_t *sock, isc_region_t *region,
- isc_task_t *task,
- isc_sockaddr_t *address, struct in6_pktinfo *pktinfo,
- isc_socketevent_t *event, unsigned int flags);
-
-/*!
- * Send the contents of 'region' to the socket's peer.
- *
- * Notes:
- *
- *\li Shutting down the requestor's task *may* result in any
- * still pending writes being dropped or completed, depending on the
- * underlying OS implementation.
- *
- *\li If 'action' is NULL, then no completion event will be posted.
- *
- *\li The caller may not modify 'region', the buffers which are passed
- * into this function, or any data they refer to until the completion
- * event is received.
- *
- *\li For isc_socket_sendv() and isc_socket_sendtov():
- * On successful completion, '*buflist' will be empty, and the list of
- * all buffers will be returned in the done event's 'bufferlist'
- * member. On error return, '*buflist' will be unchanged.
- *
- *\li For isc_socket_sendto2():
- * 'event' is not NULL, and the non-socket specific fields are
- * expected to be initialized.
- *
- *\li For isc_socket_sendto2():
- * The only defined values for 'flags' are ISC_SOCKFLAG_IMMEDIATE
- * and ISC_SOCKFLAG_NORETRY.
- *
- *\li If ISC_SOCKFLAG_IMMEDIATE is set and the operation completes, the
- * return value will be ISC_R_SUCCESS and the event will be filled
- * in and not sent. If the operation does not complete, the return
- * value will be ISC_R_INPROGRESS and the event will be sent when
- * the operation completes.
- *
- *\li ISC_SOCKFLAG_NORETRY can only be set for UDP sockets. If set
- * and the send operation fails due to a transient error, the send
- * will not be retried and the error will be indicated in the event.
- * Using this option along with ISC_SOCKFLAG_IMMEDIATE allows the caller
- * to specify a region that is allocated on the stack.
- *
- * Requires:
- *
- *\li 'socket' is a valid, bound socket.
- *
- *\li For isc_socket_send():
- * 'region' is a valid region
- *
- *\li For isc_socket_sendv() and isc_socket_sendtov():
- * 'buflist' is non-NULL, and '*buflist' contain at least one buffer.
- *
- *\li 'task' is a valid task
- *
- *\li For isc_socket_sendv(), isc_socket_sendtov(), isc_socket_send(), and
- * isc_socket_sendto():
- * action == NULL or is a valid action
- *
- *\li For isc_socket_sendto2():
- * event != NULL
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_INPROGRESS
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_UNEXPECTED
- *
- * Event results:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_UNEXPECTED
- *\li XXX needs other net-type errors
- */
-/*@}*/
-
-isc_result_t
-isc_socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp);
-
-isc_result_t
-isc_socketmgr_create2(isc_mem_t *mctx, isc_socketmgr_t **managerp,
- unsigned int maxsocks);
-/*%<
- * Create a socket manager. If "maxsocks" is non-zero, it specifies the
- * maximum number of sockets that the created manager should handle.
- * isc_socketmgr_create() is equivalent of isc_socketmgr_create2() with
- * "maxsocks" being zero.
- *
- * Notes:
- *
- *\li All memory will be allocated in memory context 'mctx'.
- *
- * Requires:
- *
- *\li 'mctx' is a valid memory context.
- *
- *\li 'managerp' points to a NULL isc_socketmgr_t.
- *
- * Ensures:
- *
- *\li '*managerp' is a valid isc_socketmgr_t.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_UNEXPECTED
- *\li #ISC_R_NOTIMPLEMENTED
- */
-
-isc_result_t
-isc_socketmgr_getmaxsockets(isc_socketmgr_t *manager, unsigned int *nsockp);
-/*%<
- * Returns in "*nsockp" the maximum number of sockets this manager may open.
- *
- * Requires:
- *
- *\li '*manager' is a valid isc_socketmgr_t.
- *\li 'nsockp' is not NULL.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOTIMPLEMENTED
- */
-
-void
-isc_socketmgr_setstats(isc_socketmgr_t *manager, isc_stats_t *stats);
-/*%<
- * Set a general socket statistics counter set 'stats' for 'manager'.
- *
- * Requires:
- * \li 'manager' is valid, hasn't opened any socket, and doesn't have
- * stats already set.
- *
- *\li stats is a valid statistics supporting socket statistics counters
- * (see above).
- */
-
-void
-isc_socketmgr_destroy(isc_socketmgr_t **managerp);
-/*%<
- * Destroy a socket manager.
- *
- * Notes:
- *
- *\li This routine blocks until there are no sockets left in the manager,
- * so if the caller holds any socket references using the manager, it
- * must detach them before calling isc_socketmgr_destroy() or it will
- * block forever.
- *
- * Requires:
- *
- *\li '*managerp' is a valid isc_socketmgr_t.
- *
- *\li All sockets managed by this manager are fully detached.
- *
- * Ensures:
- *
- *\li *managerp == NULL
- *
- *\li All resources used by the manager have been freed.
- */
-
-isc_sockettype_t
-isc_socket_gettype(isc_socket_t *sock);
-/*%<
- * Returns the socket type for "sock."
- *
- * Requires:
- *
- *\li "sock" is a valid socket.
- */
-
-/*@{*/
-isc_boolean_t
-isc_socket_isbound(isc_socket_t *sock);
-
-void
-isc_socket_ipv6only(isc_socket_t *sock, isc_boolean_t yes);
-/*%<
- * If the socket is an IPv6 socket set/clear the IPV6_IPV6ONLY socket
- * option if the host OS supports this option.
- *
- * Requires:
- *\li 'sock' is a valid socket.
- */
-/*@}*/
-
-void
-isc_socket_cleanunix(isc_sockaddr_t *addr, isc_boolean_t active);
-
-/*%<
- * Cleanup UNIX domain sockets in the file-system. If 'active' is true
- * then just unlink the socket. If 'active' is false try to determine
- * if there is a listener of the socket or not. If no listener is found
- * then unlink socket.
- *
- * Prior to unlinking the path is tested to see if it a socket.
- *
- * Note: there are a number of race conditions which cannot be avoided
- * both in the filesystem and any application using UNIX domain
- * sockets (e.g. socket is tested between bind() and listen(),
- * the socket is deleted and replaced in the file-system between
- * stat() and unlink()).
- */
-
-isc_result_t
-isc_socket_permunix(isc_sockaddr_t *sockaddr, isc_uint32_t perm,
- isc_uint32_t owner, isc_uint32_t group);
-/*%<
- * Set ownership and file permissions on the UNIX domain socket.
- *
- * Note: On Solaris and SunOS this secures the directory containing
- * the socket as Solaris and SunOS do not honour the filesystem
- * permissions on the socket.
- *
- * Requires:
- * \li 'sockaddr' to be a valid UNIX domain sockaddr.
- *
- * Returns:
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_FAILURE
- */
-
-void isc_socket_setname(isc_socket_t *socket, const char *name, void *tag);
-/*%<
- * Set the name and optional tag for a socket. This allows tracking of the
- * owner or purpose for this socket, and is useful for tracing and statistics
- * reporting.
- */
-
-const char *isc_socket_getname(isc_socket_t *socket);
-/*%<
- * Get the name associated with a socket, if any.
- */
-
-void *isc_socket_gettag(isc_socket_t *socket);
-/*%<
- * Get the tag associated with a socket, if any.
- */
-
-void
-isc__socketmgr_setreserved(isc_socketmgr_t *mgr, isc_uint32_t);
-/*%<
- * Temporary. For use by named only.
- */
-
-#ifdef HAVE_LIBXML2
-
-void
-isc_socketmgr_renderxml(isc_socketmgr_t *mgr, xmlTextWriterPtr writer);
-/*%<
- * Render internal statistics and other state into the XML document.
- */
-
-#endif /* HAVE_LIBXML2 */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_SOCKET_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: stdio.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_STDIO_H
-#define ISC_STDIO_H 1
-
-/*! \file isc/stdio.h */
-
-/*%
- * These functions are wrappers around the corresponding stdio functions.
- *
- * They return a detailed error code in the form of an an isc_result_t. ANSI C
- * does not guarantee that stdio functions set errno, hence these functions
- * must use platform dependent methods (e.g., the POSIX errno) to construct the
- * error code.
- */
-
-#include <stdio.h>
-
-#include <isc/lang.h>
-#include <isc/result.h>
-
-ISC_LANG_BEGINDECLS
-
-/*% Open */
-isc_result_t
-isc_stdio_open(const char *filename, const char *mode, FILE **fp);
-
-/*% Close */
-isc_result_t
-isc_stdio_close(FILE *f);
-
-/*% Seek */
-isc_result_t
-isc_stdio_seek(FILE *f, long offset, int whence);
-
-/*% Read */
-isc_result_t
-isc_stdio_read(void *ptr, size_t size, size_t nmemb, FILE *f,
- size_t *nret);
-
-/*% Write */
-isc_result_t
-isc_stdio_write(const void *ptr, size_t size, size_t nmemb, FILE *f,
- size_t *nret);
-
-/*% Flush */
-isc_result_t
-isc_stdio_flush(FILE *f);
-
-isc_result_t
-isc_stdio_sync(FILE *f);
-/*%<
- * Invoke fsync() on the file descriptor underlying an stdio stream, or an
- * equivalent system-dependent operation. Note that this function has no
- * direct counterpart in the stdio library.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_STDIO_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: stdlib.h,v 1.8 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_STDLIB_H
-#define ISC_STDLIB_H 1
-
-/*! \file isc/stdlib.h */
-
-#include <stdlib.h>
-
-#include <isc/lang.h>
-#include <isc/platform.h>
-
-#ifdef ISC_PLATFORM_NEEDSTRTOUL
-#define strtoul isc_strtoul
-#endif
-
-ISC_LANG_BEGINDECLS
-
-unsigned long isc_strtoul(const char *, char **, int);
-
-ISC_LANG_ENDDECLS
-
-#endif
+++ /dev/null
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: stdtime.h,v 1.14 2007/06/19 23:47:19 tbox Exp $ */
-
-#ifndef ISC_STDTIME_H
-#define ISC_STDTIME_H 1
-
-/*! \file */
-
-#include <isc/lang.h>
-#include <isc/int.h>
-
-/*%
- * It's public information that 'isc_stdtime_t' is an unsigned integral type.
- * Applications that want maximum portability should not assume anything
- * about its size.
- */
-typedef isc_uint32_t isc_stdtime_t;
-/*
- * isc_stdtime32_t is a 32-bit version of isc_stdtime_t. A variable of this
- * type should only be used as an opaque integer (e.g.,) to compare two
- * time values.
- */
-typedef isc_uint32_t isc_stdtime32_t;
-
-ISC_LANG_BEGINDECLS
-/* */
-void
-isc_stdtime_get(isc_stdtime_t *t);
-/*%<
- * Set 't' to the number of seconds since 00:00:00 UTC, January 1, 1970.
- *
- * Requires:
- *
- *\li 't' is a valid pointer.
- */
-
-#define isc_stdtime_convert32(t, t32p) (*(t32p) = t)
-/*
- * Convert the standard time to its 32-bit version.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_STDTIME_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001, 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: string.h,v 1.23 2007/09/13 04:48:16 each Exp $ */
-
-#ifndef ISC_STRING_H
-#define ISC_STRING_H 1
-
-/*! \file isc/string.h */
-
-#include <isc/formatcheck.h>
-#include <isc/int.h>
-#include <isc/lang.h>
-#include <isc/platform.h>
-#include <isc/types.h>
-
-#include <string.h>
-
-#ifdef ISC_PLATFORM_HAVESTRINGSH
-#include <strings.h>
-#endif
-
-#define ISC_STRING_MAGIC 0x5e
-
-ISC_LANG_BEGINDECLS
-
-isc_uint64_t
-isc_string_touint64(char *source, char **endp, int base);
-/*%<
- * Convert the string pointed to by 'source' to isc_uint64_t.
- *
- * On successful conversion 'endp' points to the first character
- * after conversion is complete.
- *
- * 'base': 0 or 2..36
- *
- * If base is 0 the base is computed from the string type.
- *
- * On error 'endp' points to 'source'.
- */
-
-isc_result_t
-isc_string_copy(char *target, size_t size, const char *source);
-/*
- * Copy the string pointed to by 'source' to 'target' which is a
- * pointer to a string of at least 'size' bytes.
- *
- * Requires:
- * 'target' is a pointer to a char[] of at least 'size' bytes.
- * 'size' an integer > 0.
- * 'source' == NULL or points to a NUL terminated string.
- *
- * Ensures:
- * If result == ISC_R_SUCCESS
- * 'target' will be a NUL terminated string of no more
- * than 'size' bytes (including NUL).
- *
- * If result == ISC_R_NOSPACE
- * 'target' is undefined.
- *
- * Returns:
- * ISC_R_SUCCESS -- 'source' was successfully copied to 'target'.
- * ISC_R_NOSPACE -- 'source' could not be copied since 'target'
- * is too small.
- */
-
-void
-isc_string_copy_truncate(char *target, size_t size, const char *source);
-/*
- * Copy the string pointed to by 'source' to 'target' which is a
- * pointer to a string of at least 'size' bytes.
- *
- * Requires:
- * 'target' is a pointer to a char[] of at least 'size' bytes.
- * 'size' an integer > 0.
- * 'source' == NULL or points to a NUL terminated string.
- *
- * Ensures:
- * 'target' will be a NUL terminated string of no more
- * than 'size' bytes (including NUL).
- */
-
-isc_result_t
-isc_string_append(char *target, size_t size, const char *source);
-/*
- * Append the string pointed to by 'source' to 'target' which is a
- * pointer to a NUL terminated string of at least 'size' bytes.
- *
- * Requires:
- * 'target' is a pointer to a NUL terminated char[] of at
- * least 'size' bytes.
- * 'size' an integer > 0.
- * 'source' == NULL or points to a NUL terminated string.
- *
- * Ensures:
- * If result == ISC_R_SUCCESS
- * 'target' will be a NUL terminated string of no more
- * than 'size' bytes (including NUL).
- *
- * If result == ISC_R_NOSPACE
- * 'target' is undefined.
- *
- * Returns:
- * ISC_R_SUCCESS -- 'source' was successfully appended to 'target'.
- * ISC_R_NOSPACE -- 'source' could not be appended since 'target'
- * is too small.
- */
-
-void
-isc_string_append_truncate(char *target, size_t size, const char *source);
-/*
- * Append the string pointed to by 'source' to 'target' which is a
- * pointer to a NUL terminated string of at least 'size' bytes.
- *
- * Requires:
- * 'target' is a pointer to a NUL terminated char[] of at
- * least 'size' bytes.
- * 'size' an integer > 0.
- * 'source' == NULL or points to a NUL terminated string.
- *
- * Ensures:
- * 'target' will be a NUL terminated string of no more
- * than 'size' bytes (including NUL).
- */
-
-isc_result_t
-isc_string_printf(char *target, size_t size, const char *format, ...)
- ISC_FORMAT_PRINTF(3, 4);
-/*
- * Print 'format' to 'target' which is a pointer to a string of at least
- * 'size' bytes.
- *
- * Requires:
- * 'target' is a pointer to a char[] of at least 'size' bytes.
- * 'size' an integer > 0.
- * 'format' == NULL or points to a NUL terminated string.
- *
- * Ensures:
- * If result == ISC_R_SUCCESS
- * 'target' will be a NUL terminated string of no more
- * than 'size' bytes (including NUL).
- *
- * If result == ISC_R_NOSPACE
- * 'target' is undefined.
- *
- * Returns:
- * ISC_R_SUCCESS -- 'format' was successfully printed to 'target'.
- * ISC_R_NOSPACE -- 'format' could not be printed to 'target' since it
- * is too small.
- */
-
-void
-isc_string_printf_truncate(char *target, size_t size, const char *format, ...)
- ISC_FORMAT_PRINTF(3, 4);
-/*
- * Print 'format' to 'target' which is a pointer to a string of at least
- * 'size' bytes.
- *
- * Requires:
- * 'target' is a pointer to a char[] of at least 'size' bytes.
- * 'size' an integer > 0.
- * 'format' == NULL or points to a NUL terminated string.
- *
- * Ensures:
- * 'target' will be a NUL terminated string of no more
- * than 'size' bytes (including NUL).
- */
-
-
-char *
-isc_string_regiondup(isc_mem_t *mctx, const isc_region_t *source);
-/*
- * Copy the region pointed to by r to a NUL terminated string
- * allocated from the memory context pointed to by mctx.
- *
- * The result should be deallocated using isc_mem_free()
- *
- * Requires:
- * 'mctx' is a point to a valid memory context.
- * 'source' is a pointer to a valid region.
- *
- * Returns:
- * a pointer to a NUL terminated string or
- * NULL if memory for the copy could not be allocated
- *
- */
-
-char *
-isc_string_separate(char **stringp, const char *delim);
-
-#ifdef ISC_PLATFORM_NEEDSTRSEP
-#define strsep isc_string_separate
-#endif
-
-#ifdef ISC_PLATFORM_NEEDMEMMOVE
-#define memmove(a,b,c) bcopy(b,a,c)
-#endif
-
-size_t
-isc_string_strlcpy(char *dst, const char *src, size_t size);
-
-
-#ifdef ISC_PLATFORM_NEEDSTRLCPY
-#define strlcpy isc_string_strlcpy
-#endif
-
-
-size_t
-isc_string_strlcat(char *dst, const char *src, size_t size);
-
-#ifdef ISC_PLATFORM_NEEDSTRLCAT
-#define strlcat isc_string_strlcat
-#endif
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_STRING_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1996-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: symtab.h,v 1.24.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef ISC_SYMTAB_H
-#define ISC_SYMTAB_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isc/symtab.h
- * \brief Provides a simple memory-based symbol table.
- *
- * Keys are C strings, and key comparisons are case-insensitive. A type may
- * be specified when looking up, defining, or undefining. A type value of
- * 0 means "match any type"; any other value will only match the given
- * type.
- *
- * It's possible that a client will attempt to define a <key, type, value>
- * tuple when a tuple with the given key and type already exists in the table.
- * What to do in this case is specified by the client. Possible policies are:
- *
- *\li #isc_symexists_reject Disallow the define, returning #ISC_R_EXISTS
- *\li #isc_symexists_replace Replace the old value with the new. The
- * undefine action (if provided) will be called
- * with the old <key, type, value> tuple.
- *\li #isc_symexists_add Add the new tuple, leaving the old tuple in
- * the table. Subsequent lookups will retrieve
- * the most-recently-defined tuple.
- *
- * A lookup of a key using type 0 will return the most-recently defined
- * symbol with that key. An undefine of a key using type 0 will undefine the
- * most-recently defined symbol with that key. Trying to define a key with
- * type 0 is illegal.
- *
- * The symbol table library does not make a copy the key field, so the
- * caller must ensure that any key it passes to isc_symtab_define() will not
- * change until it calls isc_symtab_undefine() or isc_symtab_destroy().
- *
- * A user-specified action will be called (if provided) when a symbol is
- * undefined. It can be used to free memory associated with keys and/or
- * values.
- *
- * \li MP:
- * The callers of this module must ensure any required synchronization.
- *
- * \li Reliability:
- * No anticipated impact.
- *
- * \li Resources:
- * TBS
- *
- * \li Security:
- * No anticipated impact.
- *
- * \li Standards:
- * None.
- */
-
-/***
- *** Imports.
- ***/
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-/*
- *** Symbol Tables.
- ***/
-/*% Symbol table value. */
-typedef union isc_symvalue {
- void * as_pointer;
- const void * as_cpointer;
- int as_integer;
- unsigned int as_uinteger;
-} isc_symvalue_t;
-
-typedef void (*isc_symtabaction_t)(char *key, unsigned int type,
- isc_symvalue_t value, void *userarg);
-/*% Symbol table exists. */
-typedef enum {
- isc_symexists_reject = 0, /*%< Disallow the define */
- isc_symexists_replace = 1, /*%< Replace the old value with the new */
- isc_symexists_add = 2 /*%< Add the new tuple */
-} isc_symexists_t;
-
-ISC_LANG_BEGINDECLS
-
-/*% Create a symbol table. */
-isc_result_t
-isc_symtab_create(isc_mem_t *mctx, unsigned int size,
- isc_symtabaction_t undefine_action, void *undefine_arg,
- isc_boolean_t case_sensitive, isc_symtab_t **symtabp);
-
-/*% Destroy a symbol table. */
-void
-isc_symtab_destroy(isc_symtab_t **symtabp);
-
-/*% Lookup a symbol table. */
-isc_result_t
-isc_symtab_lookup(isc_symtab_t *symtab, const char *key, unsigned int type,
- isc_symvalue_t *value);
-
-/*% Define a symbol table. */
-isc_result_t
-isc_symtab_define(isc_symtab_t *symtab, const char *key, unsigned int type,
- isc_symvalue_t value, isc_symexists_t exists_policy);
-
-/*% Undefine a symbol table. */
-isc_result_t
-isc_symtab_undefine(isc_symtab_t *symtab, const char *key, unsigned int type);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_SYMTAB_H */
+++ /dev/null
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: syslog.h,v 1.7 2007/06/19 23:47:19 tbox Exp $ */
-
-#ifndef ISC_SYSLOG_H
-#define ISC_SYSLOG_H 1
-
-/*! \file */
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-isc_syslog_facilityfromstring(const char *str, int *facilityp);
-/*%<
- * Convert 'str' to the appropriate syslog facility constant.
- *
- * Requires:
- *
- *\li 'str' is not NULL
- *\li 'facilityp' is not NULL
- *
- * Returns:
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_NOTFOUND
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_SYSLOG_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001, 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: task.h,v 1.61.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef ISC_TASK_H
-#define ISC_TASK_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isc/task.h
- * \brief The task system provides a lightweight execution context, which is
- * basically an event queue.
-
- * When a task's event queue is non-empty, the
- * task is runnable. A small work crew of threads, typically one per CPU,
- * execute runnable tasks by dispatching the events on the tasks' event
- * queues. Context switching between tasks is fast.
- *
- * \li MP:
- * The module ensures appropriate synchronization of data structures it
- * creates and manipulates.
- * The caller must ensure that isc_taskmgr_destroy() is called only
- * once for a given manager.
- *
- * \li Reliability:
- * No anticipated impact.
- *
- * \li Resources:
- * TBS
- *
- * \li Security:
- * No anticipated impact.
- *
- * \li Standards:
- * None.
- *
- * \section purge Purging and Unsending
- *
- * Events which have been queued for a task but not delivered may be removed
- * from the task's event queue by purging or unsending.
- *
- * With both types, the caller specifies a matching pattern that selects
- * events based upon their sender, type, and tag.
- *
- * Purging calls isc_event_free() on the matching events.
- *
- * Unsending returns a list of events that matched the pattern.
- * The caller is then responsible for them.
- *
- * Consumers of events should purge, not unsend.
- *
- * Producers of events often want to remove events when the caller indicates
- * it is no longer interested in the object, e.g. by canceling a timer.
- * Sometimes this can be done by purging, but for some event types, the
- * calls to isc_event_free() cause deadlock because the event free routine
- * wants to acquire a lock the caller is already holding. Unsending instead
- * of purging solves this problem. As a general rule, producers should only
- * unsend events which they have sent.
- */
-
-
-/***
- *** Imports.
- ***/
-
-#include <isc/eventclass.h>
-#include <isc/lang.h>
-#include <isc/stdtime.h>
-#include <isc/types.h>
-#include <isc/xml.h>
-
-#define ISC_TASKEVENT_FIRSTEVENT (ISC_EVENTCLASS_TASK + 0)
-#define ISC_TASKEVENT_SHUTDOWN (ISC_EVENTCLASS_TASK + 1)
-#define ISC_TASKEVENT_LASTEVENT (ISC_EVENTCLASS_TASK + 65535)
-
-/*****
- ***** Tasks.
- *****/
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-isc_task_create(isc_taskmgr_t *manager, unsigned int quantum,
- isc_task_t **taskp);
-/*%<
- * Create a task.
- *
- * Notes:
- *
- *\li If 'quantum' is non-zero, then only that many events can be dispatched
- * before the task must yield to other tasks waiting to execute. If
- * quantum is zero, then the default quantum of the task manager will
- * be used.
- *
- *\li The 'quantum' option may be removed from isc_task_create() in the
- * future. If this happens, isc_task_getquantum() and
- * isc_task_setquantum() will be provided.
- *
- * Requires:
- *
- *\li 'manager' is a valid task manager.
- *
- *\li taskp != NULL && *taskp == NULL
- *
- * Ensures:
- *
- *\li On success, '*taskp' is bound to the new task.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_UNEXPECTED
- *\li #ISC_R_SHUTTINGDOWN
- */
-
-void
-isc_task_attach(isc_task_t *source, isc_task_t **targetp);
-/*%<
- * Attach *targetp to source.
- *
- * Requires:
- *
- *\li 'source' is a valid task.
- *
- *\li 'targetp' points to a NULL isc_task_t *.
- *
- * Ensures:
- *
- *\li *targetp is attached to source.
- */
-
-void
-isc_task_detach(isc_task_t **taskp);
-/*%<
- * Detach *taskp from its task.
- *
- * Requires:
- *
- *\li '*taskp' is a valid task.
- *
- * Ensures:
- *
- *\li *taskp is NULL.
- *
- *\li If '*taskp' is the last reference to the task, the task is idle (has
- * an empty event queue), and has not been shutdown, the task will be
- * shutdown.
- *
- *\li If '*taskp' is the last reference to the task and
- * the task has been shutdown,
- * all resources used by the task will be freed.
- */
-
-void
-isc_task_send(isc_task_t *task, isc_event_t **eventp);
-/*%<
- * Send '*event' to 'task'.
- *
- * Requires:
- *
- *\li 'task' is a valid task.
- *\li eventp != NULL && *eventp != NULL.
- *
- * Ensures:
- *
- *\li *eventp == NULL.
- */
-
-void
-isc_task_sendanddetach(isc_task_t **taskp, isc_event_t **eventp);
-/*%<
- * Send '*event' to '*taskp' and then detach '*taskp' from its
- * task.
- *
- * Requires:
- *
- *\li '*taskp' is a valid task.
- *\li eventp != NULL && *eventp != NULL.
- *
- * Ensures:
- *
- *\li *eventp == NULL.
- *
- *\li *taskp == NULL.
- *
- *\li If '*taskp' is the last reference to the task, the task is
- * idle (has an empty event queue), and has not been shutdown,
- * the task will be shutdown.
- *
- *\li If '*taskp' is the last reference to the task and
- * the task has been shutdown,
- * all resources used by the task will be freed.
- */
-
-
-unsigned int
-isc_task_purgerange(isc_task_t *task, void *sender, isc_eventtype_t first,
- isc_eventtype_t last, void *tag);
-/*%<
- * Purge events from a task's event queue.
- *
- * Requires:
- *
- *\li 'task' is a valid task.
- *
- *\li last >= first
- *
- * Ensures:
- *
- *\li Events in the event queue of 'task' whose sender is 'sender', whose
- * type is >= first and <= last, and whose tag is 'tag' will be purged,
- * unless they are marked as unpurgable.
- *
- *\li A sender of NULL will match any sender. A NULL tag matches any
- * tag.
- *
- * Returns:
- *
- *\li The number of events purged.
- */
-
-unsigned int
-isc_task_purge(isc_task_t *task, void *sender, isc_eventtype_t type,
- void *tag);
-/*%<
- * Purge events from a task's event queue.
- *
- * Notes:
- *
- *\li This function is equivalent to
- *
- *\code
- * isc_task_purgerange(task, sender, type, type, tag);
- *\endcode
- *
- * Requires:
- *
- *\li 'task' is a valid task.
- *
- * Ensures:
- *
- *\li Events in the event queue of 'task' whose sender is 'sender', whose
- * type is 'type', and whose tag is 'tag' will be purged, unless they
- * are marked as unpurgable.
- *
- *\li A sender of NULL will match any sender. A NULL tag matches any
- * tag.
- *
- * Returns:
- *
- *\li The number of events purged.
- */
-
-isc_boolean_t
-isc_task_purgeevent(isc_task_t *task, isc_event_t *event);
-/*%<
- * Purge 'event' from a task's event queue.
- *
- * XXXRTH: WARNING: This method may be removed before beta.
- *
- * Notes:
- *
- *\li If 'event' is on the task's event queue, it will be purged,
- * unless it is marked as unpurgeable. 'event' does not have to be
- * on the task's event queue; in fact, it can even be an invalid
- * pointer. Purging only occurs if the event is actually on the task's
- * event queue.
- *
- * \li Purging never changes the state of the task.
- *
- * Requires:
- *
- *\li 'task' is a valid task.
- *
- * Ensures:
- *
- *\li 'event' is not in the event queue for 'task'.
- *
- * Returns:
- *
- *\li #ISC_TRUE The event was purged.
- *\li #ISC_FALSE The event was not in the event queue,
- * or was marked unpurgeable.
- */
-
-unsigned int
-isc_task_unsendrange(isc_task_t *task, void *sender, isc_eventtype_t first,
- isc_eventtype_t last, void *tag, isc_eventlist_t *events);
-/*%<
- * Remove events from a task's event queue.
- *
- * Requires:
- *
- *\li 'task' is a valid task.
- *
- *\li last >= first.
- *
- *\li *events is a valid list.
- *
- * Ensures:
- *
- *\li Events in the event queue of 'task' whose sender is 'sender', whose
- * type is >= first and <= last, and whose tag is 'tag' will be dequeued
- * and appended to *events.
- *
- *\li A sender of NULL will match any sender. A NULL tag matches any
- * tag.
- *
- * Returns:
- *
- *\li The number of events unsent.
- */
-
-unsigned int
-isc_task_unsend(isc_task_t *task, void *sender, isc_eventtype_t type,
- void *tag, isc_eventlist_t *events);
-/*%<
- * Remove events from a task's event queue.
- *
- * Notes:
- *
- *\li This function is equivalent to
- *
- *\code
- * isc_task_unsendrange(task, sender, type, type, tag, events);
- *\endcode
- *
- * Requires:
- *
- *\li 'task' is a valid task.
- *
- *\li *events is a valid list.
- *
- * Ensures:
- *
- *\li Events in the event queue of 'task' whose sender is 'sender', whose
- * type is 'type', and whose tag is 'tag' will be dequeued and appended
- * to *events.
- *
- * Returns:
- *
- *\li The number of events unsent.
- */
-
-isc_result_t
-isc_task_onshutdown(isc_task_t *task, isc_taskaction_t action,
- const void *arg);
-/*%<
- * Send a shutdown event with action 'action' and argument 'arg' when
- * 'task' is shutdown.
- *
- * Notes:
- *
- *\li Shutdown events are posted in LIFO order.
- *
- * Requires:
- *
- *\li 'task' is a valid task.
- *
- *\li 'action' is a valid task action.
- *
- * Ensures:
- *
- *\li When the task is shutdown, shutdown events requested with
- * isc_task_onshutdown() will be appended to the task's event queue.
- *
-
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_TASKSHUTTINGDOWN Task is shutting down.
- */
-
-void
-isc_task_shutdown(isc_task_t *task);
-/*%<
- * Shutdown 'task'.
- *
- * Notes:
- *
- *\li Shutting down a task causes any shutdown events requested with
- * isc_task_onshutdown() to be posted (in LIFO order). The task
- * moves into a "shutting down" mode which prevents further calls
- * to isc_task_onshutdown().
- *
- *\li Trying to shutdown a task that has already been shutdown has no
- * effect.
- *
- * Requires:
- *
- *\li 'task' is a valid task.
- *
- * Ensures:
- *
- *\li Any shutdown events requested with isc_task_onshutdown() have been
- * posted (in LIFO order).
- */
-
-void
-isc_task_destroy(isc_task_t **taskp);
-/*%<
- * Destroy '*taskp'.
- *
- * Notes:
- *
- *\li This call is equivalent to:
- *
- *\code
- * isc_task_shutdown(*taskp);
- * isc_task_detach(taskp);
- *\endcode
- *
- * Requires:
- *
- * '*taskp' is a valid task.
- *
- * Ensures:
- *
- *\li Any shutdown events requested with isc_task_onshutdown() have been
- * posted (in LIFO order).
- *
- *\li *taskp == NULL
- *
- *\li If '*taskp' is the last reference to the task,
- * all resources used by the task will be freed.
- */
-
-void
-isc_task_setname(isc_task_t *task, const char *name, void *tag);
-/*%<
- * Name 'task'.
- *
- * Notes:
- *
- *\li Only the first 15 characters of 'name' will be copied.
- *
- *\li Naming a task is currently only useful for debugging purposes.
- *
- * Requires:
- *
- *\li 'task' is a valid task.
- */
-
-const char *
-isc_task_getname(isc_task_t *task);
-/*%<
- * Get the name of 'task', as previously set using isc_task_setname().
- *
- * Notes:
- *\li This function is for debugging purposes only.
- *
- * Requires:
- *\li 'task' is a valid task.
- *
- * Returns:
- *\li A non-NULL pointer to a null-terminated string.
- * If the task has not been named, the string is
- * empty.
- *
- */
-
-void *
-isc_task_gettag(isc_task_t *task);
-/*%<
- * Get the tag value for 'task', as previously set using isc_task_settag().
- *
- * Notes:
- *\li This function is for debugging purposes only.
- *
- * Requires:
- *\li 'task' is a valid task.
- */
-
-isc_result_t
-isc_task_beginexclusive(isc_task_t *task);
-/*%<
- * Request exclusive access for 'task', which must be the calling
- * task. Waits for any other concurrently executing tasks to finish their
- * current event, and prevents any new events from executing in any of the
- * tasks sharing a task manager with 'task'.
- *
- * The exclusive access must be relinquished by calling
- * isc_task_endexclusive() before returning from the current event handler.
- *
- * Requires:
- *\li 'task' is the calling task.
- *
- * Returns:
- *\li #ISC_R_SUCCESS The current task now has exclusive access.
- *\li #ISC_R_LOCKBUSY Another task has already requested exclusive
- * access.
- */
-
-void
-isc_task_endexclusive(isc_task_t *task);
-/*%<
- * Relinquish the exclusive access obtained by isc_task_beginexclusive(),
- * allowing other tasks to execute.
- *
- * Requires:
- *\li 'task' is the calling task, and has obtained
- * exclusive access by calling isc_task_spl().
- */
-
-void
-isc_task_getcurrenttime(isc_task_t *task, isc_stdtime_t *t);
-/*%<
- * Provide the most recent timestamp on the task. The timestamp is considered
- * as the "current time" in the second-order granularity.
- *
- * Requires:
- *\li 'task' is a valid task.
- *\li 't' is a valid non NULL pointer.
- *
- * Ensures:
- *\li '*t' has the "current time".
- */
-
-/*****
- ***** Task Manager.
- *****/
-
-isc_result_t
-isc_taskmgr_create(isc_mem_t *mctx, unsigned int workers,
- unsigned int default_quantum, isc_taskmgr_t **managerp);
-/*%<
- * Create a new task manager.
- *
- * Notes:
- *
- *\li 'workers' in the number of worker threads to create. In general,
- * the value should be close to the number of processors in the system.
- * The 'workers' value is advisory only. An attempt will be made to
- * create 'workers' threads, but if at least one thread creation
- * succeeds, isc_taskmgr_create() may return ISC_R_SUCCESS.
- *
- *\li If 'default_quantum' is non-zero, then it will be used as the default
- * quantum value when tasks are created. If zero, then an implementation
- * defined default quantum will be used.
- *
- * Requires:
- *
- *\li 'mctx' is a valid memory context.
- *
- *\li workers > 0
- *
- *\li managerp != NULL && *managerp == NULL
- *
- * Ensures:
- *
- *\li On success, '*managerp' will be attached to the newly created task
- * manager.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_NOTHREADS No threads could be created.
- *\li #ISC_R_UNEXPECTED An unexpected error occurred.
- */
-
-void
-isc_taskmgr_destroy(isc_taskmgr_t **managerp);
-/*%<
- * Destroy '*managerp'.
- *
- * Notes:
- *
- *\li Calling isc_taskmgr_destroy() will shutdown all tasks managed by
- * *managerp that haven't already been shutdown. The call will block
- * until all tasks have entered the done state.
- *
- *\li isc_taskmgr_destroy() must not be called by a task event action,
- * because it would block forever waiting for the event action to
- * complete. An event action that wants to cause task manager shutdown
- * should request some non-event action thread of execution to do the
- * shutdown, e.g. by signaling a condition variable or using
- * isc_app_shutdown().
- *
- *\li Task manager references are not reference counted, so the caller
- * must ensure that no attempt will be made to use the manager after
- * isc_taskmgr_destroy() returns.
- *
- * Requires:
- *
- *\li '*managerp' is a valid task manager.
- *
- *\li isc_taskmgr_destroy() has not be called previously on '*managerp'.
- *
- * Ensures:
- *
- *\li All resources used by the task manager, and any tasks it managed,
- * have been freed.
- */
-
-#ifdef HAVE_LIBXML2
-
-void
-isc_taskmgr_renderxml(isc_taskmgr_t *mgr, xmlTextWriterPtr writer);
-
-#endif
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_TASK_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: taskpool.h,v 1.15 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_TASKPOOL_H
-#define ISC_TASKPOOL_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isc/taskpool.h
- * \brief A task pool is a mechanism for sharing a small number of tasks
- * among a large number of objects such that each object is
- * assigned a unique task, but each task may be shared by several
- * objects.
- *
- * Task pools are used to let objects that can exist in large
- * numbers (e.g., zones) use tasks for synchronization without
- * the memory overhead and unfair scheduling competition that
- * could result from creating a separate task for each object.
- */
-
-
-/***
- *** Imports.
- ***/
-
-#include <isc/lang.h>
-#include <isc/task.h>
-
-ISC_LANG_BEGINDECLS
-
-/*****
- ***** Types.
- *****/
-
-typedef struct isc_taskpool isc_taskpool_t;
-
-/*****
- ***** Functions.
- *****/
-
-isc_result_t
-isc_taskpool_create(isc_taskmgr_t *tmgr, isc_mem_t *mctx,
- unsigned int ntasks, unsigned int quantum,
- isc_taskpool_t **poolp);
-/*%<
- * Create a task pool of "ntasks" tasks, each with quantum
- * "quantum".
- *
- * Requires:
- *
- *\li 'tmgr' is a valid task manager.
- *
- *\li 'mctx' is a valid memory context.
- *
- *\li poolp != NULL && *poolp == NULL
- *
- * Ensures:
- *
- *\li On success, '*taskp' points to the new task pool.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_UNEXPECTED
- */
-
-void
-isc_taskpool_gettask(isc_taskpool_t *pool, unsigned int hash,
- isc_task_t **targetp);
-/*%<
- * Attach to the task corresponding to the hash value "hash".
- */
-
-void
-isc_taskpool_destroy(isc_taskpool_t **poolp);
-/*%<
- * Destroy a task pool. The tasks in the pool are detached but not
- * shut down.
- *
- * Requires:
- * \li '*poolp' is a valid task pool.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_TASKPOOL_H */
+++ /dev/null
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: thread.h,v 1.26 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_THREAD_H
-#define ISC_THREAD_H 1
-
-/*! \file */
-
-#include <pthread.h>
-
-#include <isc/lang.h>
-#include <isc/result.h>
-
-ISC_LANG_BEGINDECLS
-
-typedef pthread_t isc_thread_t;
-typedef void * isc_threadresult_t;
-typedef void * isc_threadarg_t;
-typedef isc_threadresult_t (*isc_threadfunc_t)(isc_threadarg_t);
-typedef pthread_key_t isc_thread_key_t;
-
-isc_result_t
-isc_thread_create(isc_threadfunc_t, isc_threadarg_t, isc_thread_t *);
-
-void
-isc_thread_setconcurrency(unsigned int level);
-
-/* XXX We could do fancier error handling... */
-
-#define isc_thread_join(t, rp) \
- ((pthread_join((t), (rp)) == 0) ? \
- ISC_R_SUCCESS : ISC_R_UNEXPECTED)
-
-#define isc_thread_self \
- (unsigned long)pthread_self
-
-#define isc_thread_key_create pthread_key_create
-#define isc_thread_key_getspecific pthread_getspecific
-#define isc_thread_key_setspecific pthread_setspecific
-#define isc_thread_key_delete pthread_key_delete
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_THREAD_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: time.h,v 1.38.56.2 2009/01/05 23:47:23 tbox Exp $ */
-
-#ifndef ISC_TIME_H
-#define ISC_TIME_H 1
-
-/*! \file */
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-/***
- *** Intervals
- ***/
-
-/*!
- * \brief
- * The contents of this structure are private, and MUST NOT be accessed
- * directly by callers.
- *
- * The contents are exposed only to allow callers to avoid dynamic allocation.
- */
-struct isc_interval {
- unsigned int seconds;
- unsigned int nanoseconds;
-};
-
-extern isc_interval_t *isc_interval_zero;
-
-ISC_LANG_BEGINDECLS
-
-void
-isc_interval_set(isc_interval_t *i,
- unsigned int seconds, unsigned int nanoseconds);
-/*%<
- * Set 'i' to a value representing an interval of 'seconds' seconds and
- * 'nanoseconds' nanoseconds, suitable for use in isc_time_add() and
- * isc_time_subtract().
- *
- * Requires:
- *
- *\li 't' is a valid pointer.
- *\li nanoseconds < 1000000000.
- */
-
-isc_boolean_t
-isc_interval_iszero(const isc_interval_t *i);
-/*%<
- * Returns ISC_TRUE iff. 'i' is the zero interval.
- *
- * Requires:
- *
- *\li 'i' is a valid pointer.
- */
-
-/***
- *** Absolute Times
- ***/
-
-/*%
- * The contents of this structure are private, and MUST NOT be accessed
- * directly by callers.
- *
- * The contents are exposed only to allow callers to avoid dynamic allocation.
- */
-
-struct isc_time {
- unsigned int seconds;
- unsigned int nanoseconds;
-};
-
-extern isc_time_t *isc_time_epoch;
-
-void
-isc_time_set(isc_time_t *t, unsigned int seconds, unsigned int nanoseconds);
-/*%<
- * Set 't' to a value which represents the given number of seconds and
- * nanoseconds since 00:00:00 January 1, 1970, UTC.
- *
- * Notes:
- *\li The Unix version of this call is equivalent to:
- *\code
- * isc_time_settoepoch(t);
- * isc_interval_set(i, seconds, nanoseconds);
- * isc_time_add(t, i, t);
- *\endcode
- *
- * Requires:
- *\li 't' is a valid pointer.
- *\li nanoseconds < 1000000000.
- */
-
-void
-isc_time_settoepoch(isc_time_t *t);
-/*%<
- * Set 't' to the time of the epoch.
- *
- * Notes:
- *\li The date of the epoch is platform-dependent.
- *
- * Requires:
- *
- *\li 't' is a valid pointer.
- */
-
-isc_boolean_t
-isc_time_isepoch(const isc_time_t *t);
-/*%<
- * Returns ISC_TRUE iff. 't' is the epoch ("time zero").
- *
- * Requires:
- *
- *\li 't' is a valid pointer.
- */
-
-isc_result_t
-isc_time_now(isc_time_t *t);
-/*%<
- * Set 't' to the current absolute time.
- *
- * Requires:
- *
- *\li 't' is a valid pointer.
- *
- * Returns:
- *
- *\li Success
- *\li Unexpected error
- * Getting the time from the system failed.
- *\li Out of range
- * The time from the system is too large to be represented
- * in the current definition of isc_time_t.
- */
-
-isc_result_t
-isc_time_nowplusinterval(isc_time_t *t, const isc_interval_t *i);
-/*%<
- * Set *t to the current absolute time + i.
- *
- * Note:
- *\li This call is equivalent to:
- *
- *\code
- * isc_time_now(t);
- * isc_time_add(t, i, t);
- *\endcode
- *
- * Requires:
- *
- *\li 't' and 'i' are valid pointers.
- *
- * Returns:
- *
- *\li Success
- *\li Unexpected error
- * Getting the time from the system failed.
- *\li Out of range
- * The interval added to the time from the system is too large to
- * be represented in the current definition of isc_time_t.
- */
-
-int
-isc_time_compare(const isc_time_t *t1, const isc_time_t *t2);
-/*%<
- * Compare the times referenced by 't1' and 't2'
- *
- * Requires:
- *
- *\li 't1' and 't2' are valid pointers.
- *
- * Returns:
- *
- *\li -1 t1 < t2 (comparing times, not pointers)
- *\li 0 t1 = t2
- *\li 1 t1 > t2
- */
-
-isc_result_t
-isc_time_add(const isc_time_t *t, const isc_interval_t *i, isc_time_t *result);
-/*%<
- * Add 'i' to 't', storing the result in 'result'.
- *
- * Requires:
- *
- *\li 't', 'i', and 'result' are valid pointers.
- *
- * Returns:
- *\li Success
- *\li Out of range
- * The interval added to the time is too large to
- * be represented in the current definition of isc_time_t.
- */
-
-isc_result_t
-isc_time_subtract(const isc_time_t *t, const isc_interval_t *i,
- isc_time_t *result);
-/*%<
- * Subtract 'i' from 't', storing the result in 'result'.
- *
- * Requires:
- *
- *\li 't', 'i', and 'result' are valid pointers.
- *
- * Returns:
- *\li Success
- *\li Out of range
- * The interval is larger than the time since the epoch.
- */
-
-isc_uint64_t
-isc_time_microdiff(const isc_time_t *t1, const isc_time_t *t2);
-/*%<
- * Find the difference in microseconds between time t1 and time t2.
- * t2 is the subtrahend of t1; ie, difference = t1 - t2.
- *
- * Requires:
- *
- *\li 't1' and 't2' are valid pointers.
- *
- * Returns:
- *\li The difference of t1 - t2, or 0 if t1 <= t2.
- */
-
-isc_uint32_t
-isc_time_seconds(const isc_time_t *t);
-/*%<
- * Return the number of seconds since the epoch stored in a time structure.
- *
- * Requires:
- *
- *\li 't' is a valid pointer.
- */
-
-isc_result_t
-isc_time_secondsastimet(const isc_time_t *t, time_t *secondsp);
-/*%<
- * Ensure the number of seconds in an isc_time_t is representable by a time_t.
- *
- * Notes:
- *\li The number of seconds stored in an isc_time_t might be larger
- * than the number of seconds a time_t is able to handle. Since
- * time_t is mostly opaque according to the ANSI/ISO standard
- * (essentially, all you can be sure of is that it is an arithmetic type,
- * not even necessarily integral), it can be tricky to ensure that
- * the isc_time_t is in the range a time_t can handle. Use this
- * function in place of isc_time_seconds() any time you need to set a
- * time_t from an isc_time_t.
- *
- * Requires:
- *\li 't' is a valid pointer.
- *
- * Returns:
- *\li Success
- *\li Out of range
- */
-
-isc_uint32_t
-isc_time_nanoseconds(const isc_time_t *t);
-/*%<
- * Return the number of nanoseconds stored in a time structure.
- *
- * Notes:
- *\li This is the number of nanoseconds in excess of the number
- * of seconds since the epoch; it will always be less than one
- * full second.
- *
- * Requires:
- *\li 't' is a valid pointer.
- *
- * Ensures:
- *\li The returned value is less than 1*10^9.
- */
-
-void
-isc_time_formattimestamp(const isc_time_t *t, char *buf, unsigned int len);
-/*%<
- * Format the time 't' into the buffer 'buf' of length 'len',
- * using a format like "30-Aug-2000 04:06:47.997" and the local time zone.
- * If the text does not fit in the buffer, the result is indeterminate,
- * but is always guaranteed to be null terminated.
- *
- * Requires:
- *\li 'len' > 0
- *\li 'buf' points to an array of at least len chars
- *
- */
-
-void
-isc_time_formathttptimestamp(const isc_time_t *t, char *buf, unsigned int len);
-/*%<
- * Format the time 't' into the buffer 'buf' of length 'len',
- * using a format like "Mon, 30 Aug 2000 04:06:47 GMT"
- * If the text does not fit in the buffer, the result is indeterminate,
- * but is always guaranteed to be null terminated.
- *
- * Requires:
- *\li 'len' > 0
- *\li 'buf' points to an array of at least len chars
- *
- */
-
-void
-isc_time_formatISO8601(const isc_time_t *t, char *buf, unsigned int len);
-/*%<
- * Format the time 't' into the buffer 'buf' of length 'len',
- * using the ISO8601 format: "yyyy-mm-ddThh:mm:ssZ"
- * If the text does not fit in the buffer, the result is indeterminate,
- * but is always guaranteed to be null terminated.
- *
- * Requires:
- *\li 'len' > 0
- *\li 'buf' points to an array of at least len chars
- *
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_TIME_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: timer.h,v 1.40 2008/06/23 23:47:11 tbox Exp $ */
-
-#ifndef ISC_TIMER_H
-#define ISC_TIMER_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isc/timer.h
- * \brief Provides timers which are event sources in the task system.
- *
- * Three types of timers are supported:
- *
- *\li 'ticker' timers generate a periodic tick event.
- *
- *\li 'once' timers generate an idle timeout event if they are idle for too
- * long, and generate a life timeout event if their lifetime expires.
- * They are used to implement both (possibly expiring) idle timers and
- * 'one-shot' timers.
- *
- *\li 'limited' timers generate a periodic tick event until they reach
- * their lifetime when they generate a life timeout event.
- *
- *\li 'inactive' timers generate no events.
- *
- * Timers can change type. It is typical to create a timer as
- * an 'inactive' timer and then change it into a 'ticker' or
- * 'once' timer.
- *
- *\li MP:
- * The module ensures appropriate synchronization of data structures it
- * creates and manipulates.
- * Clients of this module must not be holding a timer's task's lock when
- * making a call that affects that timer. Failure to follow this rule
- * can result in deadlock.
- * The caller must ensure that isc_timermgr_destroy() is called only
- * once for a given manager.
- *
- * \li Reliability:
- * No anticipated impact.
- *
- * \li Resources:
- * TBS
- *
- * \li Security:
- * No anticipated impact.
- *
- * \li Standards:
- * None.
- */
-
-
-/***
- *** Imports
- ***/
-
-#include <isc/types.h>
-#include <isc/event.h>
-#include <isc/eventclass.h>
-#include <isc/lang.h>
-#include <isc/time.h>
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Types
- ***/
-
-/*% Timer Type */
-typedef enum {
- isc_timertype_ticker = 0, /*%< Ticker */
- isc_timertype_once = 1, /*%< Once */
- isc_timertype_limited = 2, /*%< Limited */
- isc_timertype_inactive = 3 /*%< Inactive */
-} isc_timertype_t;
-
-typedef struct isc_timerevent {
- struct isc_event common;
- isc_time_t due;
-} isc_timerevent_t;
-
-#define ISC_TIMEREVENT_FIRSTEVENT (ISC_EVENTCLASS_TIMER + 0)
-#define ISC_TIMEREVENT_TICK (ISC_EVENTCLASS_TIMER + 1)
-#define ISC_TIMEREVENT_IDLE (ISC_EVENTCLASS_TIMER + 2)
-#define ISC_TIMEREVENT_LIFE (ISC_EVENTCLASS_TIMER + 3)
-#define ISC_TIMEREVENT_LASTEVENT (ISC_EVENTCLASS_TIMER + 65535)
-
-/***
- *** Timer and Timer Manager Functions
- ***
- *** Note: all Ensures conditions apply only if the result is success for
- *** those functions which return an isc_result_t.
- ***/
-
-isc_result_t
-isc_timer_create(isc_timermgr_t *manager,
- isc_timertype_t type,
- isc_time_t *expires,
- isc_interval_t *interval,
- isc_task_t *task,
- isc_taskaction_t action,
- const void *arg,
- isc_timer_t **timerp);
-/*%<
- * Create a new 'type' timer managed by 'manager'. The timers parameters
- * are specified by 'expires' and 'interval'. Events will be posted to
- * 'task' and when dispatched 'action' will be called with 'arg' as the
- * arg value. The new timer is returned in 'timerp'.
- *
- * Notes:
- *
- *\li For ticker timers, the timer will generate a 'tick' event every
- * 'interval' seconds. The value of 'expires' is ignored.
- *
- *\li For once timers, 'expires' specifies the time when a life timeout
- * event should be generated. If 'expires' is 0 (the epoch), then no life
- * timeout will be generated. 'interval' specifies how long the timer
- * can be idle before it generates an idle timeout. If 0, then no
- * idle timeout will be generated.
- *
- *\li If 'expires' is NULL, the epoch will be used.
- *
- * If 'interval' is NULL, the zero interval will be used.
- *
- * Requires:
- *
- *\li 'manager' is a valid manager
- *
- *\li 'task' is a valid task
- *
- *\li 'action' is a valid action
- *
- *\li 'expires' points to a valid time, or is NULL.
- *
- *\li 'interval' points to a valid interval, or is NULL.
- *
- *\li type == isc_timertype_inactive ||
- * ('expires' and 'interval' are not both 0)
- *
- *\li 'timerp' is a valid pointer, and *timerp == NULL
- *
- * Ensures:
- *
- *\li '*timerp' is attached to the newly created timer
- *
- *\li The timer is attached to the task
- *
- *\li An idle timeout will not be generated until at least Now + the
- * timer's interval if 'timer' is a once timer with a non-zero
- * interval.
- *
- * Returns:
- *
- *\li Success
- *\li No memory
- *\li Unexpected error
- */
-
-isc_result_t
-isc_timer_reset(isc_timer_t *timer,
- isc_timertype_t type,
- isc_time_t *expires,
- isc_interval_t *interval,
- isc_boolean_t purge);
-/*%<
- * Change the timer's type, expires, and interval values to the given
- * values. If 'purge' is TRUE, any pending events from this timer
- * are purged from its task's event queue.
- *
- * Notes:
- *
- *\li If 'expires' is NULL, the epoch will be used.
- *
- *\li If 'interval' is NULL, the zero interval will be used.
- *
- * Requires:
- *
- *\li 'timer' is a valid timer
- *
- *\li The same requirements that isc_timer_create() imposes on 'type',
- * 'expires' and 'interval' apply.
- *
- * Ensures:
- *
- *\li An idle timeout will not be generated until at least Now + the
- * timer's interval if 'timer' is a once timer with a non-zero
- * interval.
- *
- * Returns:
- *
- *\li Success
- *\li No memory
- *\li Unexpected error
- */
-
-isc_result_t
-isc_timer_touch(isc_timer_t *timer);
-/*%<
- * Set the last-touched time of 'timer' to the current time.
- *
- * Requires:
- *
- *\li 'timer' is a valid once timer.
- *
- * Ensures:
- *
- *\li An idle timeout will not be generated until at least Now + the
- * timer's interval if 'timer' is a once timer with a non-zero
- * interval.
- *
- * Returns:
- *
- *\li Success
- *\li Unexpected error
- */
-
-void
-isc_timer_attach(isc_timer_t *timer, isc_timer_t **timerp);
-/*%<
- * Attach *timerp to timer.
- *
- * Requires:
- *
- *\li 'timer' is a valid timer.
- *
- *\li 'timerp' points to a NULL timer.
- *
- * Ensures:
- *
- *\li *timerp is attached to timer.
- */
-
-void
-isc_timer_detach(isc_timer_t **timerp);
-/*%<
- * Detach *timerp from its timer.
- *
- * Requires:
- *
- *\li 'timerp' points to a valid timer.
- *
- * Ensures:
- *
- *\li *timerp is NULL.
- *
- *\li If '*timerp' is the last reference to the timer,
- * then:
- *
- *\code
- * The timer will be shutdown
- *
- * The timer will detach from its task
- *
- * All resources used by the timer have been freed
- *
- * Any events already posted by the timer will be purged.
- * Therefore, if isc_timer_detach() is called in the context
- * of the timer's task, it is guaranteed that no more
- * timer event callbacks will run after the call.
- *\endcode
- */
-
-isc_timertype_t
-isc_timer_gettype(isc_timer_t *timer);
-/*%<
- * Return the timer type.
- *
- * Requires:
- *
- *\li 'timer' to be a valid timer.
- */
-
-isc_result_t
-isc_timermgr_create(isc_mem_t *mctx, isc_timermgr_t **managerp);
-/*%<
- * Create a timer manager.
- *
- * Notes:
- *
- *\li All memory will be allocated in memory context 'mctx'.
- *
- * Requires:
- *
- *\li 'mctx' is a valid memory context.
- *
- *\li 'managerp' points to a NULL isc_timermgr_t.
- *
- * Ensures:
- *
- *\li '*managerp' is a valid isc_timermgr_t.
- *
- * Returns:
- *
- *\li Success
- *\li No memory
- *\li Unexpected error
- */
-
-void
-isc_timermgr_destroy(isc_timermgr_t **managerp);
-/*%<
- * Destroy a timer manager.
- *
- * Notes:
- *
- *\li This routine blocks until there are no timers left in the manager,
- * so if the caller holds any timer references using the manager, it
- * must detach them before calling isc_timermgr_destroy() or it will
- * block forever.
- *
- * Requires:
- *
- *\li '*managerp' is a valid isc_timermgr_t.
- *
- * Ensures:
- *
- *\li *managerp == NULL
- *
- *\li All resources used by the manager have been freed.
- */
-
-void isc_timermgr_poke(isc_timermgr_t *m);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_TIMER_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: types.h,v 1.46.84.2 2009/01/29 23:47:44 tbox Exp $ */
-
-#ifndef ISC_TYPES_H
-#define ISC_TYPES_H 1
-
-/*! \file isc/types.h
- * \brief
- * OS-specific types, from the OS-specific include directories.
- */
-#include <isc/int.h>
-#include <isc/offset.h>
-
-/*
- * XXXDCL should isc_boolean_t be moved here, requiring an explicit include
- * of <isc/boolean.h> when ISC_TRUE/ISC_FALSE/ISC_TF() are desired?
- */
-#include <isc/boolean.h>
-/*
- * XXXDCL This is just for ISC_LIST and ISC_LINK, but gets all of the other
- * list macros too.
- */
-#include <isc/list.h>
-
-/* Core Types. Alphabetized by defined type. */
-
-typedef struct isc_bitstring isc_bitstring_t; /*%< Bitstring */
-typedef struct isc_buffer isc_buffer_t; /*%< Buffer */
-typedef ISC_LIST(isc_buffer_t) isc_bufferlist_t; /*%< Buffer List */
-typedef struct isc_constregion isc_constregion_t; /*%< Const region */
-typedef struct isc_consttextregion isc_consttextregion_t; /*%< Const Text Region */
-typedef struct isc_entropy isc_entropy_t; /*%< Entropy */
-typedef struct isc_entropysource isc_entropysource_t; /*%< Entropy Source */
-typedef struct isc_event isc_event_t; /*%< Event */
-typedef ISC_LIST(isc_event_t) isc_eventlist_t; /*%< Event List */
-typedef unsigned int isc_eventtype_t; /*%< Event Type */
-typedef isc_uint32_t isc_fsaccess_t; /*%< FS Access */
-typedef struct isc_hash isc_hash_t; /*%< Hash */
-typedef struct isc_httpd isc_httpd_t; /*%< HTTP client */
-typedef void (isc_httpdfree_t)(isc_buffer_t *, void *); /*%< HTTP free function */
-typedef struct isc_httpdmgr isc_httpdmgr_t; /*%< HTTP manager */
-typedef struct isc_httpdurl isc_httpdurl_t; /*%< HTTP URL */
-typedef void (isc_httpdondestroy_t)(void *); /*%< Callback on destroying httpd */
-typedef struct isc_interface isc_interface_t; /*%< Interface */
-typedef struct isc_interfaceiter isc_interfaceiter_t; /*%< Interface Iterator */
-typedef struct isc_interval isc_interval_t; /*%< Interval */
-typedef struct isc_lex isc_lex_t; /*%< Lex */
-typedef struct isc_log isc_log_t; /*%< Log */
-typedef struct isc_logcategory isc_logcategory_t; /*%< Log Category */
-typedef struct isc_logconfig isc_logconfig_t; /*%< Log Configuration */
-typedef struct isc_logmodule isc_logmodule_t; /*%< Log Module */
-typedef struct isc_mem isc_mem_t; /*%< Memory */
-typedef struct isc_mempool isc_mempool_t; /*%< Memory Pool */
-typedef struct isc_msgcat isc_msgcat_t; /*%< Message Catalog */
-typedef struct isc_ondestroy isc_ondestroy_t; /*%< On Destroy */
-typedef struct isc_netaddr isc_netaddr_t; /*%< Net Address */
-typedef struct isc_portset isc_portset_t; /*%< Port Set */
-typedef struct isc_quota isc_quota_t; /*%< Quota */
-typedef struct isc_random isc_random_t; /*%< Random */
-typedef struct isc_ratelimiter isc_ratelimiter_t; /*%< Rate Limiter */
-typedef struct isc_region isc_region_t; /*%< Region */
-typedef isc_uint64_t isc_resourcevalue_t; /*%< Resource Value */
-typedef unsigned int isc_result_t; /*%< Result */
-typedef struct isc_rwlock isc_rwlock_t; /*%< Read Write Lock */
-typedef struct isc_sockaddr isc_sockaddr_t; /*%< Socket Address */
-typedef struct isc_socket isc_socket_t; /*%< Socket */
-typedef struct isc_socketevent isc_socketevent_t; /*%< Socket Event */
-typedef struct isc_socketmgr isc_socketmgr_t; /*%< Socket Manager */
-typedef struct isc_stats isc_stats_t; /*%< Statistics */
-typedef int isc_statscounter_t; /*%< Statistics Counter */
-typedef struct isc_symtab isc_symtab_t; /*%< Symbol Table */
-typedef struct isc_task isc_task_t; /*%< Task */
-typedef ISC_LIST(isc_task_t) isc_tasklist_t; /*%< Task List */
-typedef struct isc_taskmgr isc_taskmgr_t; /*%< Task Manager */
-typedef struct isc_textregion isc_textregion_t; /*%< Text Region */
-typedef struct isc_time isc_time_t; /*%< Time */
-typedef struct isc_timer isc_timer_t; /*%< Timer */
-typedef struct isc_timermgr isc_timermgr_t; /*%< Timer Manager */
-
-typedef void (*isc_taskaction_t)(isc_task_t *, isc_event_t *);
-typedef int (*isc_sockfdwatch_t)(isc_task_t *, isc_socket_t *, void *);
-
-/* The following cannot be listed alphabetically due to forward reference */
-typedef isc_result_t (isc_httpdaction_t)(const char *url,
- const char *querystring,
- void *arg,
- unsigned int *retcode,
- const char **retmsg,
- const char **mimetype,
- isc_buffer_t *body,
- isc_httpdfree_t **freecb,
- void **freecb_args);
-typedef isc_boolean_t (isc_httpdclientok_t)(const isc_sockaddr_t *, void *);
-
-/*% Resource */
-typedef enum {
- isc_resource_coresize = 1,
- isc_resource_cputime,
- isc_resource_datasize,
- isc_resource_filesize,
- isc_resource_lockedmemory,
- isc_resource_openfiles,
- isc_resource_processes,
- isc_resource_residentsize,
- isc_resource_stacksize
-} isc_resource_t;
-
-#endif /* ISC_TYPES_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: util.h,v 1.30 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_UTIL_H
-#define ISC_UTIL_H 1
-
-/*! \file isc/util.h
- * NOTE:
- *
- * This file is not to be included from any <isc/???.h> (or other) library
- * files.
- *
- * \brief
- * Including this file puts several macros in your name space that are
- * not protected (as all the other ISC functions/macros do) by prepending
- * ISC_ or isc_ to the name.
- */
-
-/***
- *** General Macros.
- ***/
-
-/*%
- * Use this to hide unused function arguments.
- * \code
- * int
- * foo(char *bar)
- * {
- * UNUSED(bar);
- * }
- * \endcode
- */
-#define UNUSED(x) (void)(x)
-
-#define ISC_MAX(a, b) ((a) > (b) ? (a) : (b))
-#define ISC_MIN(a, b) ((a) < (b) ? (a) : (b))
-
-/*%
- * Use this to remove the const qualifier of a variable to assign it to
- * a non-const variable or pass it as a non-const function argument ...
- * but only when you are sure it won't then be changed!
- * This is necessary to sometimes shut up some compilers
- * (as with gcc -Wcast-qual) when there is just no other good way to avoid the
- * situation.
- */
-#define DE_CONST(konst, var) \
- do { \
- union { const void *k; void *v; } _u; \
- _u.k = konst; \
- var = _u.v; \
- } while (0)
-
-/*%
- * Use this in translation units that would otherwise be empty, to
- * suppress compiler warnings.
- */
-#define EMPTY_TRANSLATION_UNIT static void isc__empty(void) { isc__empty(); }
-
-/*%
- * We use macros instead of calling the routines directly because
- * the capital letters make the locking stand out.
- * We RUNTIME_CHECK for success since in general there's no way
- * for us to continue if they fail.
- */
-
-#ifdef ISC_UTIL_TRACEON
-#define ISC_UTIL_TRACE(a) a
-#include <stdio.h> /* Required for fprintf/stderr when tracing. */
-#include <isc/msgs.h> /* Required for isc_msgcat when tracing. */
-#else
-#define ISC_UTIL_TRACE(a)
-#endif
-
-#include <isc/result.h> /* Contractual promise. */
-
-#define LOCK(lp) do { \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_LOCKING, "LOCKING"), \
- (lp), __FILE__, __LINE__)); \
- RUNTIME_CHECK(isc_mutex_lock((lp)) == ISC_R_SUCCESS); \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_LOCKED, "LOCKED"), \
- (lp), __FILE__, __LINE__)); \
- } while (0)
-#define UNLOCK(lp) do { \
- RUNTIME_CHECK(isc_mutex_unlock((lp)) == ISC_R_SUCCESS); \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_UNLOCKED, "UNLOCKED"), \
- (lp), __FILE__, __LINE__)); \
- } while (0)
-#define ISLOCKED(lp) (1)
-#define DESTROYLOCK(lp) \
- RUNTIME_CHECK(isc_mutex_destroy((lp)) == ISC_R_SUCCESS)
-
-
-#define BROADCAST(cvp) do { \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_BROADCAST, "BROADCAST"),\
- (cvp), __FILE__, __LINE__)); \
- RUNTIME_CHECK(isc_condition_broadcast((cvp)) == ISC_R_SUCCESS); \
- } while (0)
-#define SIGNAL(cvp) do { \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_SIGNAL, "SIGNAL"), \
- (cvp), __FILE__, __LINE__)); \
- RUNTIME_CHECK(isc_condition_signal((cvp)) == ISC_R_SUCCESS); \
- } while (0)
-#define WAIT(cvp, lp) do { \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_UTILWAIT, "WAIT"), \
- (cvp), \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_LOCK, "LOCK"), \
- (lp), __FILE__, __LINE__)); \
- RUNTIME_CHECK(isc_condition_wait((cvp), (lp)) == ISC_R_SUCCESS); \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_WAITED, "WAITED"), \
- (cvp), \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_LOCKED, "LOCKED"), \
- (lp), __FILE__, __LINE__)); \
- } while (0)
-
-/*
- * isc_condition_waituntil can return ISC_R_TIMEDOUT, so we
- * don't RUNTIME_CHECK the result.
- *
- * XXX Also, can't really debug this then...
- */
-
-#define WAITUNTIL(cvp, lp, tp) \
- isc_condition_waituntil((cvp), (lp), (tp))
-
-#define RWLOCK(lp, t) do { \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p, %d %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_RWLOCK, "RWLOCK"), \
- (lp), (t), __FILE__, __LINE__)); \
- RUNTIME_CHECK(isc_rwlock_lock((lp), (t)) == ISC_R_SUCCESS); \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p, %d %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_RWLOCKED, "RWLOCKED"), \
- (lp), (t), __FILE__, __LINE__)); \
- } while (0)
-#define RWUNLOCK(lp, t) do { \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p, %d %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_RWUNLOCK, "RWUNLOCK"), \
- (lp), (t), __FILE__, __LINE__)); \
- RUNTIME_CHECK(isc_rwlock_unlock((lp), (t)) == ISC_R_SUCCESS); \
- } while (0)
-
-#define DESTROYMUTEXBLOCK(bp, n) \
- RUNTIME_CHECK(isc_mutexblock_destroy((bp), (n)) == ISC_R_SUCCESS)
-
-/*
- * List Macros.
- */
-#include <isc/list.h> /* Contractual promise. */
-
-#define LIST(type) ISC_LIST(type)
-#define INIT_LIST(type) ISC_LIST_INIT(type)
-#define LINK(type) ISC_LINK(type)
-#define INIT_LINK(elt, link) ISC_LINK_INIT(elt, link)
-#define HEAD(list) ISC_LIST_HEAD(list)
-#define TAIL(list) ISC_LIST_TAIL(list)
-#define EMPTY(list) ISC_LIST_EMPTY(list)
-#define PREV(elt, link) ISC_LIST_PREV(elt, link)
-#define NEXT(elt, link) ISC_LIST_NEXT(elt, link)
-#define APPEND(list, elt, link) ISC_LIST_APPEND(list, elt, link)
-#define PREPEND(list, elt, link) ISC_LIST_PREPEND(list, elt, link)
-#define UNLINK(list, elt, link) ISC_LIST_UNLINK(list, elt, link)
-#define ENQUEUE(list, elt, link) ISC_LIST_APPEND(list, elt, link)
-#define DEQUEUE(list, elt, link) ISC_LIST_UNLINK(list, elt, link)
-#define INSERTBEFORE(li, b, e, ln) ISC_LIST_INSERTBEFORE(li, b, e, ln)
-#define INSERTAFTER(li, a, e, ln) ISC_LIST_INSERTAFTER(li, a, e, ln)
-#define APPENDLIST(list1, list2, link) ISC_LIST_APPENDLIST(list1, list2, link)
-
-/*
- * Assertions
- */
-#include <isc/assertions.h> /* Contractual promise. */
-
-/*% Require Assertion */
-#define REQUIRE(e) ISC_REQUIRE(e)
-/*% Ensure Assertion */
-#define ENSURE(e) ISC_ENSURE(e)
-/*% Insist Assertion */
-#define INSIST(e) ISC_INSIST(e)
-/*% Invariant Assertion */
-#define INVARIANT(e) ISC_INVARIANT(e)
-
-/*
- * Errors
- */
-#include <isc/error.h> /* Contractual promise. */
-
-/*% Unexpected Error */
-#define UNEXPECTED_ERROR isc_error_unexpected
-/*% Fatal Error */
-#define FATAL_ERROR isc_error_fatal
-/*% Runtime Check */
-#define RUNTIME_CHECK(cond) ISC_ERROR_RUNTIMECHECK(cond)
-
-/*%
- * Time
- */
-#define TIME_NOW(tp) RUNTIME_CHECK(isc_time_now((tp)) == ISC_R_SUCCESS)
-
-#endif /* ISC_UTIL_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: version.h,v 1.9 2007/06/19 23:47:18 tbox Exp $ */
-
-/*! \file isc/version.h */
-
-#include <isc/platform.h>
-
-LIBISC_EXTERNAL_DATA extern const char isc_version[];
-
-LIBISC_EXTERNAL_DATA extern const unsigned int isc_libinterface;
-LIBISC_EXTERNAL_DATA extern const unsigned int isc_librevision;
-LIBISC_EXTERNAL_DATA extern const unsigned int isc_libage;
+++ /dev/null
-/*
- * Copyright (C) 2006, 2007 Internet Systems Consortium, Inc. ("ISC")
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: xml.h,v 1.4 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_XML_H
-#define ISC_XML_H 1
-
-/*
- * This file is here mostly to make it easy to add additional libxml header
- * files as needed across all the users of this file. Rather than place
- * these libxml includes in each file, one include makes it easy to handle
- * the ifdef as well as adding the ability to add additional functions
- * which may be useful.
- */
-
-#ifdef HAVE_LIBXML2
-#include <libxml/encoding.h>
-#include <libxml/xmlwriter.h>
-#endif
-
-#define ISC_XMLCHAR (const xmlChar *)
-
-#define ISC_XML_RENDERCONFIG 0x00000001 /* render config data */
-#define ISC_XML_RENDERSTATS 0x00000002 /* render stats */
-#define ISC_XML_RENDERALL 0x000000ff /* render everything */
-
-#endif /* ISC_XML_H */
+++ /dev/null
-/*
- * Portions Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Portions Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- *
- * Portions Copyright (C) 2001 Nominum, Inc.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: alist.h,v 1.10 2007/08/28 07:20:43 tbox Exp $ */
-
-#ifndef ISCCC_ALIST_H
-#define ISCCC_ALIST_H 1
-
-/*! \file isccc/alist.h */
-
-#include <stdio.h>
-
-#include <isc/lang.h>
-#include <isccc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-isccc_sexpr_t *
-isccc_alist_create(void);
-
-isc_boolean_t
-isccc_alist_alistp(isccc_sexpr_t *alist);
-
-isc_boolean_t
-isccc_alist_emptyp(isccc_sexpr_t *alist);
-
-isccc_sexpr_t *
-isccc_alist_first(isccc_sexpr_t *alist);
-
-isccc_sexpr_t *
-isccc_alist_assq(isccc_sexpr_t *alist, const char *key);
-
-void
-isccc_alist_delete(isccc_sexpr_t *alist, const char *key);
-
-isccc_sexpr_t *
-isccc_alist_define(isccc_sexpr_t *alist, const char *key, isccc_sexpr_t *value);
-
-isccc_sexpr_t *
-isccc_alist_definestring(isccc_sexpr_t *alist, const char *key, const char *str);
-
-isccc_sexpr_t *
-isccc_alist_definebinary(isccc_sexpr_t *alist, const char *key, isccc_region_t *r);
-
-isccc_sexpr_t *
-isccc_alist_lookup(isccc_sexpr_t *alist, const char *key);
-
-isc_result_t
-isccc_alist_lookupstring(isccc_sexpr_t *alist, const char *key, char **strp);
-
-isc_result_t
-isccc_alist_lookupbinary(isccc_sexpr_t *alist, const char *key, isccc_region_t **r);
-
-void
-isccc_alist_prettyprint(isccc_sexpr_t *sexpr, unsigned int indent, FILE *stream);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISCCC_ALIST_H */
+++ /dev/null
-/*
- * Portions Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Portions Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- *
- * Portions Copyright (C) 2001 Nominum, Inc.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: base64.h,v 1.10 2007/08/28 07:20:43 tbox Exp $ */
-
-#ifndef ISCCC_BASE64_H
-#define ISCCC_BASE64_H 1
-
-/*! \file isccc/base64.h */
-
-#include <isc/lang.h>
-#include <isccc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Functions
- ***/
-
-isc_result_t
-isccc_base64_encode(isccc_region_t *source, int wordlength,
- const char *wordbreak, isccc_region_t *target);
-/*%<
- * Convert data into base64 encoded text.
- *
- * Notes:
- *\li The base64 encoded text in 'target' will be divided into
- * words of at most 'wordlength' characters, separated by
- * the 'wordbreak' string. No parentheses will surround
- * the text.
- *
- * Requires:
- *\li 'source' is a region containing binary data.
- *\li 'target' is a text region containing available space.
- *\li 'wordbreak' points to a null-terminated string of
- * zero or more whitespace characters.
- */
-
-isc_result_t
-isccc_base64_decode(const char *cstr, isccc_region_t *target);
-/*%<
- * Decode a null-terminated base64 string.
- *
- * Requires:
- *\li 'cstr' is non-null.
- *\li 'target' is a valid region.
- *
- * Returns:
- *\li #ISC_R_SUCCESS -- the entire decoded representation of 'cstring'
- * fit in 'target'.
- *\li #ISC_R_BADBASE64 -- 'cstr' is not a valid base64 encoding.
- *\li #ISC_R_NOSPACE -- 'target' is not big enough.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISCCC_BASE64_H */
+++ /dev/null
-/*
- * Portions Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Portions Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- *
- * Portions Copyright (C) 2001 Nominum, Inc.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: cc.h,v 1.11 2007/08/28 07:20:43 tbox Exp $ */
-
-#ifndef ISCCC_CC_H
-#define ISCCC_CC_H 1
-
-/*! \file isccc/cc.h */
-
-#include <isc/lang.h>
-#include <isccc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/*% Maximum Datagram Package */
-#define ISCCC_CC_MAXDGRAMPACKET 4096
-
-/*% Message Type String */
-#define ISCCC_CCMSGTYPE_STRING 0x00
-/*% Message Type Binary Data */
-#define ISCCC_CCMSGTYPE_BINARYDATA 0x01
-/*% Message Type Table */
-#define ISCCC_CCMSGTYPE_TABLE 0x02
-/*% Message Type List */
-#define ISCCC_CCMSGTYPE_LIST 0x03
-
-/*% Send to Wire */
-isc_result_t
-isccc_cc_towire(isccc_sexpr_t *alist, isccc_region_t *target,
- isccc_region_t *secret);
-
-/*% Get From Wire */
-isc_result_t
-isccc_cc_fromwire(isccc_region_t *source, isccc_sexpr_t **alistp,
- isccc_region_t *secret);
-
-/*% Create Message */
-isc_result_t
-isccc_cc_createmessage(isc_uint32_t version, const char *from, const char *to,
- isc_uint32_t serial, isccc_time_t now,
- isccc_time_t expires, isccc_sexpr_t **alistp);
-
-/*% Create Acknowledgment */
-isc_result_t
-isccc_cc_createack(isccc_sexpr_t *message, isc_boolean_t ok,
- isccc_sexpr_t **ackp);
-
-/*% Is Ack? */
-isc_boolean_t
-isccc_cc_isack(isccc_sexpr_t *message);
-
-/*% Is Reply? */
-isc_boolean_t
-isccc_cc_isreply(isccc_sexpr_t *message);
-
-/*% Create Response */
-isc_result_t
-isccc_cc_createresponse(isccc_sexpr_t *message, isccc_time_t now,
- isccc_time_t expires, isccc_sexpr_t **alistp);
-
-/*% Define String */
-isccc_sexpr_t *
-isccc_cc_definestring(isccc_sexpr_t *alist, const char *key, const char *str);
-
-/*% Define uint 32 */
-isccc_sexpr_t *
-isccc_cc_defineuint32(isccc_sexpr_t *alist, const char *key, isc_uint32_t i);
-
-/*% Lookup String */
-isc_result_t
-isccc_cc_lookupstring(isccc_sexpr_t *alist, const char *key, char **strp);
-
-/*% Lookup uint 32 */
-isc_result_t
-isccc_cc_lookupuint32(isccc_sexpr_t *alist, const char *key,
- isc_uint32_t *uintp);
-
-/*% Create Symbol Table */
-isc_result_t
-isccc_cc_createsymtab(isccc_symtab_t **symtabp);
-
-/*% Clean up Symbol Table */
-void
-isccc_cc_cleansymtab(isccc_symtab_t *symtab, isccc_time_t now);
-
-/*% Check for Duplicates */
-isc_result_t
-isccc_cc_checkdup(isccc_symtab_t *symtab, isccc_sexpr_t *message,
- isccc_time_t now);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISCCC_CC_H */
+++ /dev/null
-/*
- * Portions Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Portions Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- *
- * Portions Copyright (C) 2001 Nominum, Inc.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: ccmsg.h,v 1.11 2007/08/28 07:20:43 tbox Exp $ */
-
-#ifndef ISCCC_CCMSG_H
-#define ISCCC_CCMSG_H 1
-
-/*! \file isccc/ccmsg.h */
-
-#include <isc/buffer.h>
-#include <isc/lang.h>
-#include <isc/socket.h>
-
-/*% ISCCC Message Structure */
-typedef struct isccc_ccmsg {
- /* private (don't touch!) */
- unsigned int magic;
- isc_uint32_t size;
- isc_buffer_t buffer;
- unsigned int maxsize;
- isc_mem_t *mctx;
- isc_socket_t *sock;
- isc_task_t *task;
- isc_taskaction_t action;
- void *arg;
- isc_event_t event;
- /* public (read-only) */
- isc_result_t result;
- isc_sockaddr_t address;
-} isccc_ccmsg_t;
-
-ISC_LANG_BEGINDECLS
-
-void
-isccc_ccmsg_init(isc_mem_t *mctx, isc_socket_t *sock, isccc_ccmsg_t *ccmsg);
-/*%
- * Associate a cc message state with a given memory context and
- * TCP socket.
- *
- * Requires:
- *
- *\li "mctx" and "sock" be non-NULL and valid types.
- *
- *\li "sock" be a read/write TCP socket.
- *
- *\li "ccmsg" be non-NULL and an uninitialized or invalidated structure.
- *
- * Ensures:
- *
- *\li "ccmsg" is a valid structure.
- */
-
-void
-isccc_ccmsg_setmaxsize(isccc_ccmsg_t *ccmsg, unsigned int maxsize);
-/*%
- * Set the maximum packet size to "maxsize"
- *
- * Requires:
- *
- *\li "ccmsg" be valid.
- *
- *\li 512 <= "maxsize" <= 4294967296
- */
-
-isc_result_t
-isccc_ccmsg_readmessage(isccc_ccmsg_t *ccmsg,
- isc_task_t *task, isc_taskaction_t action, void *arg);
-/*%
- * Schedule an event to be delivered when a command channel message is
- * readable, or when an error occurs on the socket.
- *
- * Requires:
- *
- *\li "ccmsg" be valid.
- *
- *\li "task", "taskaction", and "arg" be valid.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS -- no error
- *\li Anything that the isc_socket_recv() call can return. XXXMLG
- *
- * Notes:
- *
- *\li The event delivered is a fully generic event. It will contain no
- * actual data. The sender will be a pointer to the isccc_ccmsg_t.
- * The result code inside that structure should be checked to see
- * what the final result was.
- */
-
-void
-isccc_ccmsg_cancelread(isccc_ccmsg_t *ccmsg);
-/*%
- * Cancel a readmessage() call. The event will still be posted with a
- * CANCELED result code.
- *
- * Requires:
- *
- *\li "ccmsg" be valid.
- */
-
-void
-isccc_ccmsg_invalidate(isccc_ccmsg_t *ccmsg);
-/*%
- * Clean up all allocated state, and invalidate the structure.
- *
- * Requires:
- *
- *\li "ccmsg" be valid.
- *
- * Ensures:
- *
- *\li "ccmsg" is invalidated and disassociated with all memory contexts,
- * sockets, etc.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISCCC_CCMSG_H */
+++ /dev/null
-/*
- * Portions Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Portions Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- *
- * Portions Copyright (C) 2001 Nominum, Inc.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: events.h,v 1.10 2007/08/28 07:20:43 tbox Exp $ */
-
-#ifndef ISCCC_EVENTS_H
-#define ISCCC_EVENTS_H 1
-
-/*! \file isccc/events.h */
-
-#include <isc/eventclass.h>
-
-/*%
- * Registry of ISCCC event numbers.
- */
-
-#define ISCCC_EVENT_CCMSG (ISC_EVENTCLASS_ISCCC + 0)
-
-#define ISCCC_EVENT_FIRSTEVENT (ISC_EVENTCLASS_ISCCC + 0)
-#define ISCCC_EVENT_LASTEVENT (ISC_EVENTCLASS_ISCCC + 65535)
-
-#endif /* ISCCC_EVENTS_H */
+++ /dev/null
-/*
- * Portions Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Portions Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- *
- * Portions Copyright (C) 2001 Nominum, Inc.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: lib.h,v 1.11 2007/08/28 07:20:43 tbox Exp $ */
-
-#ifndef ISCCC_LIB_H
-#define ISCCC_LIB_H 1
-
-/*! \file isccc/lib.h */
-
-#include <isc/types.h>
-#include <isc/lang.h>
-
-ISC_LANG_BEGINDECLS
-
-LIBISCCC_EXTERNAL_DATA extern isc_msgcat_t *isccc_msgcat;
-
-void
-isccc_lib_initmsgcat(void);
-/*%
- * Initialize the ISCCC library's message catalog, isccc_msgcat, if it
- * has not already been initialized.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISCCC_LIB_H */
+++ /dev/null
-/*
- * Portions Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Portions Copyright (C) 2001, 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- *
- * Portions Copyright (C) 2001 Nominum, Inc.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: result.h,v 1.12 2007/08/28 07:20:43 tbox Exp $ */
-
-#ifndef ISCCC_RESULT_H
-#define ISCCC_RESULT_H 1
-
-/*! \file isccc/result.h */
-
-#include <isc/lang.h>
-#include <isc/resultclass.h>
-#include <isc/result.h>
-
-#include <isccc/types.h>
-
-/*% Unknown Version */
-#define ISCCC_R_UNKNOWNVERSION (ISC_RESULTCLASS_ISCCC + 0)
-/*% Syntax Error */
-#define ISCCC_R_SYNTAX (ISC_RESULTCLASS_ISCCC + 1)
-/*% Bad Authorization */
-#define ISCCC_R_BADAUTH (ISC_RESULTCLASS_ISCCC + 2)
-/*% Expired */
-#define ISCCC_R_EXPIRED (ISC_RESULTCLASS_ISCCC + 3)
-/*% Clock Skew */
-#define ISCCC_R_CLOCKSKEW (ISC_RESULTCLASS_ISCCC + 4)
-/*% Duplicate */
-#define ISCCC_R_DUPLICATE (ISC_RESULTCLASS_ISCCC + 5)
-
-#define ISCCC_R_NRESULTS 6 /*%< Number of results */
-
-ISC_LANG_BEGINDECLS
-
-const char *
-isccc_result_totext(isc_result_t result);
-/*%
- * Convert a isccc_result_t into a string message describing the result.
- */
-
-void
-isccc_result_register(void);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISCCC_RESULT_H */
+++ /dev/null
-/*
- * Portions Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Portions Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- *
- * Portions Copyright (C) 2001 Nominum, Inc.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: sexpr.h,v 1.11 2007/08/28 07:20:43 tbox Exp $ */
-
-#ifndef ISCCC_SEXPR_H
-#define ISCCC_SEXPR_H 1
-
-/*! \file isccc/sexpr.h */
-
-#include <stdio.h>
-
-#include <isc/lang.h>
-#include <isccc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/*% dotted pair structure */
-struct isccc_dottedpair {
- isccc_sexpr_t *car;
- isccc_sexpr_t *cdr;
-};
-
-/*% iscc_sexpr structure */
-struct isccc_sexpr {
- unsigned int type;
- union {
- char * as_string;
- isccc_dottedpair_t as_dottedpair;
- isccc_region_t as_region;
- } value;
-};
-
-#define ISCCC_SEXPRTYPE_NONE 0x00 /*%< Illegal. */
-#define ISCCC_SEXPRTYPE_T 0x01
-#define ISCCC_SEXPRTYPE_STRING 0x02
-#define ISCCC_SEXPRTYPE_DOTTEDPAIR 0x03
-#define ISCCC_SEXPRTYPE_BINARY 0x04
-
-#define ISCCC_SEXPR_CAR(s) (s)->value.as_dottedpair.car
-#define ISCCC_SEXPR_CDR(s) (s)->value.as_dottedpair.cdr
-
-isccc_sexpr_t *
-isccc_sexpr_cons(isccc_sexpr_t *car, isccc_sexpr_t *cdr);
-
-isccc_sexpr_t *
-isccc_sexpr_tconst(void);
-
-isccc_sexpr_t *
-isccc_sexpr_fromstring(const char *str);
-
-isccc_sexpr_t *
-isccc_sexpr_frombinary(const isccc_region_t *region);
-
-void
-isccc_sexpr_free(isccc_sexpr_t **sexprp);
-
-void
-isccc_sexpr_print(isccc_sexpr_t *sexpr, FILE *stream);
-
-isccc_sexpr_t *
-isccc_sexpr_car(isccc_sexpr_t *list);
-
-isccc_sexpr_t *
-isccc_sexpr_cdr(isccc_sexpr_t *list);
-
-void
-isccc_sexpr_setcar(isccc_sexpr_t *pair, isccc_sexpr_t *car);
-
-void
-isccc_sexpr_setcdr(isccc_sexpr_t *pair, isccc_sexpr_t *cdr);
-
-isccc_sexpr_t *
-isccc_sexpr_addtolist(isccc_sexpr_t **l1p, isccc_sexpr_t *l2);
-
-isc_boolean_t
-isccc_sexpr_listp(isccc_sexpr_t *sexpr);
-
-isc_boolean_t
-isccc_sexpr_emptyp(isccc_sexpr_t *sexpr);
-
-isc_boolean_t
-isccc_sexpr_stringp(isccc_sexpr_t *sexpr);
-
-isc_boolean_t
-isccc_sexpr_binaryp(isccc_sexpr_t *sexpr);
-
-char *
-isccc_sexpr_tostring(isccc_sexpr_t *sexpr);
-
-isccc_region_t *
-isccc_sexpr_tobinary(isccc_sexpr_t *sexpr);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISCCC_SEXPR_H */
+++ /dev/null
-/*
- * Portions Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Portions Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- *
- * Portions Copyright (C) 2001 Nominum, Inc.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: symtab.h,v 1.10 2007/08/28 07:20:43 tbox Exp $ */
-
-#ifndef ISCCC_SYMTAB_H
-#define ISCCC_SYMTAB_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isccc/symtab.h
- * \brief
- * Provides a simple memory-based symbol table.
- *
- * Keys are C strings. A type may be specified when looking up,
- * defining, or undefining. A type value of 0 means "match any type";
- * any other value will only match the given type.
- *
- * It's possible that a client will attempt to define a <key, type,
- * value> tuple when a tuple with the given key and type already
- * exists in the table. What to do in this case is specified by the
- * client. Possible policies are:
- *
- *\li isccc_symexists_reject Disallow the define, returning #ISC_R_EXISTS
- *\li isccc_symexists_replace Replace the old value with the new. The
- * undefine action (if provided) will be called
- * with the old <key, type, value> tuple.
- *\li isccc_symexists_add Add the new tuple, leaving the old tuple in
- * the table. Subsequent lookups will retrieve
- * the most-recently-defined tuple.
- *
- * A lookup of a key using type 0 will return the most-recently
- * defined symbol with that key. An undefine of a key using type 0
- * will undefine the most-recently defined symbol with that key.
- * Trying to define a key with type 0 is illegal.
- *
- * The symbol table library does not make a copy the key field, so the
- * caller must ensure that any key it passes to isccc_symtab_define()
- * will not change until it calls isccc_symtab_undefine() or
- * isccc_symtab_destroy().
- *
- * A user-specified action will be called (if provided) when a symbol
- * is undefined. It can be used to free memory associated with keys
- * and/or values.
- */
-
-/***
- *** Imports.
- ***/
-
-#include <isc/lang.h>
-#include <isccc/types.h>
-
-/***
- *** Symbol Tables.
- ***/
-
-typedef union isccc_symvalue {
- void * as_pointer;
- int as_integer;
- unsigned int as_uinteger;
-} isccc_symvalue_t;
-
-typedef void (*isccc_symtabundefaction_t)(char *key, unsigned int type,
- isccc_symvalue_t value, void *userarg);
-
-typedef isc_boolean_t (*isccc_symtabforeachaction_t)(char *key,
- unsigned int type,
- isccc_symvalue_t value,
- void *userarg);
-
-typedef enum {
- isccc_symexists_reject = 0,
- isccc_symexists_replace = 1,
- isccc_symexists_add = 2
-} isccc_symexists_t;
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-isccc_symtab_create(unsigned int size,
- isccc_symtabundefaction_t undefine_action, void *undefine_arg,
- isc_boolean_t case_sensitive, isccc_symtab_t **symtabp);
-
-void
-isccc_symtab_destroy(isccc_symtab_t **symtabp);
-
-isc_result_t
-isccc_symtab_lookup(isccc_symtab_t *symtab, const char *key, unsigned int type,
- isccc_symvalue_t *value);
-
-isc_result_t
-isccc_symtab_define(isccc_symtab_t *symtab, char *key, unsigned int type,
- isccc_symvalue_t value, isccc_symexists_t exists_policy);
-
-isc_result_t
-isccc_symtab_undefine(isccc_symtab_t *symtab, const char *key, unsigned int type);
-
-void
-isccc_symtab_foreach(isccc_symtab_t *symtab, isccc_symtabforeachaction_t action,
- void *arg);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISCCC_SYMTAB_H */
+++ /dev/null
-/*
- * Portions Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Portions Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- *
- * Portions Copyright (C) 2001 Nominum, Inc.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: symtype.h,v 1.10 2007/08/28 07:20:43 tbox Exp $ */
-
-#ifndef ISCCC_SYMTYPE_H
-#define ISCCC_SYMTYPE_H 1
-
-/*! \file isccc/symtype.h */
-
-#define ISCCC_SYMTYPE_ZONESTATS 0x0001
-#define ISCCC_SYMTYPE_CCDUP 0x0002
-#define ISCCC_SYMTYPE_TELLSERVICE 0x0003
-#define ISCCC_SYMTYPE_TELLRESPONSE 0x0004
-
-#endif /* ISCCC_SYMTYPE_H */
+++ /dev/null
-/*
- * Portions Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Portions Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- *
- * Portions Copyright (C) 2001 Nominum, Inc.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: types.h,v 1.10 2007/08/28 07:20:43 tbox Exp $ */
-
-#ifndef ISCCC_TYPES_H
-#define ISCCC_TYPES_H 1
-
-/*! \file isccc/types.h */
-
-#include <isc/boolean.h>
-#include <isc/int.h>
-#include <isc/result.h>
-
-/*% isccc_time_t typedef */
-typedef isc_uint32_t isccc_time_t;
-
-/*% isccc_sexpr_t typedef */
-typedef struct isccc_sexpr isccc_sexpr_t;
-/*% isccc_dottedpair_t typedef */
-typedef struct isccc_dottedpair isccc_dottedpair_t;
-/*% isccc_symtab_t typedef */
-typedef struct isccc_symtab isccc_symtab_t;
-
-/*% iscc region structure */
-typedef struct isccc_region {
- unsigned char * rstart;
- unsigned char * rend;
-} isccc_region_t;
-
-#endif /* ISCCC_TYPES_H */
+++ /dev/null
-/*
- * Portions Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Portions Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- *
- * Portions Copyright (C) 2001 Nominum, Inc.
- *
- * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: util.h,v 1.11 2007/08/28 07:20:43 tbox Exp $ */
-
-#ifndef ISCCC_UTIL_H
-#define ISCCC_UTIL_H 1
-
-#include <isc/util.h>
-
-/*! \file isccc/util.h
- * \brief
- * Macros for dealing with unaligned numbers.
- *
- * \note no side effects are allowed when invoking these macros!
- */
-
-#define GET8(v, w) \
- do { \
- v = *w; \
- w++; \
- } while (0)
-
-#define GET16(v, w) \
- do { \
- v = (unsigned int)w[0] << 8; \
- v |= (unsigned int)w[1]; \
- w += 2; \
- } while (0)
-
-#define GET24(v, w) \
- do { \
- v = (unsigned int)w[0] << 16; \
- v |= (unsigned int)w[1] << 8; \
- v |= (unsigned int)w[2]; \
- w += 3; \
- } while (0)
-
-#define GET32(v, w) \
- do { \
- v = (unsigned int)w[0] << 24; \
- v |= (unsigned int)w[1] << 16; \
- v |= (unsigned int)w[2] << 8; \
- v |= (unsigned int)w[3]; \
- w += 4; \
- } while (0)
-
-#define GET64(v, w) \
- do { \
- v = (isc_uint64_t)w[0] << 56; \
- v |= (isc_uint64_t)w[1] << 48; \
- v |= (isc_uint64_t)w[2] << 40; \
- v |= (isc_uint64_t)w[3] << 32; \
- v |= (isc_uint64_t)w[4] << 24; \
- v |= (isc_uint64_t)w[5] << 16; \
- v |= (isc_uint64_t)w[6] << 8; \
- v |= (isc_uint64_t)w[7]; \
- w += 8; \
- } while (0)
-
-#define GETC16(v, w, d) \
- do { \
- GET8(v, w); \
- if (v == 0) \
- d = ISCCC_TRUE; \
- else { \
- d = ISCCC_FALSE; \
- if (v == 255) \
- GET16(v, w); \
- } \
- } while (0)
-
-#define GETC32(v, w) \
- do { \
- GET24(v, w); \
- if (v == 0xffffffu) \
- GET32(v, w); \
- } while (0)
-
-#define GET_OFFSET(v, w) GET32(v, w)
-
-#define GET_MEM(v, c, w) \
- do { \
- memcpy(v, w, c); \
- w += c; \
- } while (0)
-
-#define GET_TYPE(v, w) \
- do { \
- GET8(v, w); \
- if (v > 127) { \
- if (v < 255) \
- v = ((v & 0x7f) << 16) | ISCCC_RDATATYPE_SIG; \
- else \
- GET32(v, w); \
- } \
- } while (0)
-
-#define PUT8(v, w) \
- do { \
- *w = (v & 0x000000ffU); \
- w++; \
- } while (0)
-
-#define PUT16(v, w) \
- do { \
- w[0] = (v & 0x0000ff00U) >> 8; \
- w[1] = (v & 0x000000ffU); \
- w += 2; \
- } while (0)
-
-#define PUT24(v, w) \
- do { \
- w[0] = (v & 0x00ff0000U) >> 16; \
- w[1] = (v & 0x0000ff00U) >> 8; \
- w[2] = (v & 0x000000ffU); \
- w += 3; \
- } while (0)
-
-#define PUT32(v, w) \
- do { \
- w[0] = (v & 0xff000000U) >> 24; \
- w[1] = (v & 0x00ff0000U) >> 16; \
- w[2] = (v & 0x0000ff00U) >> 8; \
- w[3] = (v & 0x000000ffU); \
- w += 4; \
- } while (0)
-
-#define PUT64(v, w) \
- do { \
- w[0] = (v & 0xff00000000000000ULL) >> 56; \
- w[1] = (v & 0x00ff000000000000ULL) >> 48; \
- w[2] = (v & 0x0000ff0000000000ULL) >> 40; \
- w[3] = (v & 0x000000ff00000000ULL) >> 32; \
- w[4] = (v & 0x00000000ff000000ULL) >> 24; \
- w[5] = (v & 0x0000000000ff0000ULL) >> 16; \
- w[6] = (v & 0x000000000000ff00ULL) >> 8; \
- w[7] = (v & 0x00000000000000ffULL); \
- w += 8; \
- } while (0)
-
-#define PUTC16(v, w) \
- do { \
- if (v > 0 && v < 255) \
- PUT8(v, w); \
- else { \
- PUT8(255, w); \
- PUT16(v, w); \
- } \
- } while (0)
-
-#define PUTC32(v, w) \
- do { \
- if (v < 0xffffffU) \
- PUT24(v, w); \
- else { \
- PUT24(0xffffffU, w); \
- PUT32(v, w); \
- } \
- } while (0)
-
-#define PUT_OFFSET(v, w) PUT32(v, w)
-
-#include <string.h>
-
-#define PUT_MEM(s, c, w) \
- do { \
- memcpy(w, s, c); \
- w += c; \
- } while (0)
-
-/*
- * Regions.
- */
-#define REGION_SIZE(r) ((unsigned int)((r).rend - (r).rstart))
-#define REGION_EMPTY(r) ((r).rstart == (r).rend)
-#define REGION_FROMSTRING(r, s) do { \
- (r).rstart = (unsigned char *)s; \
- (r).rend = (r).rstart + strlen(s); \
-} while (0)
-
-/*%
- * Use this to remove the const qualifier of a variable to assign it to
- * a non-const variable or pass it as a non-const function argument ...
- * but only when you are sure it won't then be changed!
- * This is necessary to sometimes shut up some compilers
- * (as with gcc -Wcast-qual) when there is just no other good way to avoid the
- * situation.
- */
-#define DE_CONST(konst, var) \
- do { \
- union { const void *k; void *v; } _u; \
- _u.k = konst; \
- var = _u.v; \
- } while (0)
-
-#endif /* ISCCC_UTIL_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: version.h,v 1.9 2007/06/19 23:47:22 tbox Exp $ */
-
-/*! \file isccc/version.h */
-
-#include <isc/platform.h>
-
-LIBISCCC_EXTERNAL_DATA extern const char isccc_version[];
-
-LIBISCCC_EXTERNAL_DATA extern const unsigned int isccc_libinterface;
-LIBISCCC_EXTERNAL_DATA extern const unsigned int isccc_librevision;
-LIBISCCC_EXTERNAL_DATA extern const unsigned int isccc_libage;
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: aclconf.h,v 1.10 2007/10/12 04:17:18 each Exp $ */
-
-#ifndef ISCCFG_ACLCONF_H
-#define ISCCFG_ACLCONF_H 1
-
-#include <isc/lang.h>
-
-#include <isccfg/cfg.h>
-
-#include <dns/types.h>
-
-typedef struct cfg_aclconfctx {
- ISC_LIST(dns_acl_t) named_acl_cache;
- ISC_LIST(dns_iptable_t) named_iptable_cache;
-} cfg_aclconfctx_t;
-
-/***
- *** Functions
- ***/
-
-ISC_LANG_BEGINDECLS
-
-void
-cfg_aclconfctx_init(cfg_aclconfctx_t *ctx);
-/*
- * Initialize an ACL configuration context.
- */
-
-void
-cfg_aclconfctx_destroy(cfg_aclconfctx_t *ctx);
-/*
- * Destroy an ACL configuration context.
- */
-
-isc_result_t
-cfg_acl_fromconfig(const cfg_obj_t *caml,
- const cfg_obj_t *cctx,
- isc_log_t *lctx,
- cfg_aclconfctx_t *ctx,
- isc_mem_t *mctx,
- unsigned int nest_level,
- dns_acl_t **target);
-/*
- * Construct a new dns_acl_t from configuration data in 'caml' and
- * 'cctx'. Memory is allocated through 'mctx'.
- *
- * Any named ACLs referred to within 'caml' will be be converted
- * into nested dns_acl_t objects. Multiple references to the same
- * named ACLs will be converted into shared references to a single
- * nested dns_acl_t object when the referring objects were created
- * passing the same ACL configuration context 'ctx'.
- *
- * On success, attach '*target' to the new dns_acl_t object.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISCCFG_ACLCONF_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: cfg.h,v 1.44 2007/10/12 04:17:18 each Exp $ */
-
-#ifndef ISCCFG_CFG_H
-#define ISCCFG_CFG_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isccfg/cfg.h
- * \brief
- * This is the new, table-driven, YACC-free configuration file parser.
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/formatcheck.h>
-#include <isc/lang.h>
-#include <isc/types.h>
-#include <isc/list.h>
-
-
-/***
- *** Types
- ***/
-
-/*%
- * A configuration parser.
- */
-typedef struct cfg_parser cfg_parser_t;
-
-/*%
- * A configuration type definition object. There is a single
- * static cfg_type_t object for each data type supported by
- * the configuration parser.
- */
-typedef struct cfg_type cfg_type_t;
-
-/*%
- * A configuration object. This is the basic building block of the
- * configuration parse tree. It contains a value (which may be
- * of one of several types) and information identifying the file
- * and line number the value came from, for printing error
- * messages.
- */
-typedef struct cfg_obj cfg_obj_t;
-
-/*%
- * A configuration object list element.
- */
-typedef struct cfg_listelt cfg_listelt_t;
-
-/*%
- * A callback function to be called when parsing an option
- * that needs to be interpreted at parsing time, like
- * "directory".
- */
-typedef isc_result_t
-(*cfg_parsecallback_t)(const char *clausename, const cfg_obj_t *obj, void *arg);
-
-/***
- *** Functions
- ***/
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-cfg_parser_create(isc_mem_t *mctx, isc_log_t *lctx, cfg_parser_t **ret);
-/*%<
- * Create a configuration file parser. Any warning and error
- * messages will be logged to 'lctx'.
- *
- * The parser object returned can be used for a single call
- * to cfg_parse_file() or cfg_parse_buffer(). It must not
- * be reused for parsing multiple files or buffers.
- */
-
-void
-cfg_parser_setcallback(cfg_parser_t *pctx,
- cfg_parsecallback_t callback,
- void *arg);
-/*%<
- * Make the parser call 'callback' whenever it encounters
- * a configuration clause with the callback attribute,
- * passing it the clause name, the clause value,
- * and 'arg' as arguments.
- *
- * To restore the default of not invoking callbacks, pass
- * callback==NULL and arg==NULL.
- */
-
-isc_result_t
-cfg_parse_file(cfg_parser_t *pctx, const char *filename,
- const cfg_type_t *type, cfg_obj_t **ret);
-isc_result_t
-cfg_parse_buffer(cfg_parser_t *pctx, isc_buffer_t *buffer,
- const cfg_type_t *type, cfg_obj_t **ret);
-/*%<
- * Read a configuration containing data of type 'type'
- * and make '*ret' point to its parse tree.
- *
- * The configuration is read from the file 'filename'
- * (isc_parse_file()) or the buffer 'buffer'
- * (isc_parse_buffer()).
- *
- * Returns an error if the file does not parse correctly.
- *
- * Requires:
- *\li "filename" is valid.
- *\li "mem" is valid.
- *\li "type" is valid.
- *\li "cfg" is non-NULL and "*cfg" is NULL.
- *
- * Returns:
- * \li #ISC_R_SUCCESS - success
- *\li #ISC_R_NOMEMORY - no memory available
- *\li #ISC_R_INVALIDFILE - file doesn't exist or is unreadable
- *\li others - file contains errors
- */
-
-void
-cfg_parser_destroy(cfg_parser_t **pctxp);
-/*%<
- * Destroy a configuration parser.
- */
-
-isc_boolean_t
-cfg_obj_isvoid(const cfg_obj_t *obj);
-/*%<
- * Return true iff 'obj' is of void type (e.g., an optional
- * value not specified).
- */
-
-isc_boolean_t
-cfg_obj_ismap(const cfg_obj_t *obj);
-/*%<
- * Return true iff 'obj' is of a map type.
- */
-
-isc_result_t
-cfg_map_get(const cfg_obj_t *mapobj, const char* name, const cfg_obj_t **obj);
-/*%<
- * Extract an element from a configuration object, which
- * must be of a map type.
- *
- * Requires:
- * \li 'mapobj' points to a valid configuration object of a map type.
- * \li 'name' points to a null-terminated string.
- * \li 'obj' is non-NULL and '*obj' is NULL.
- *
- * Returns:
- * \li #ISC_R_SUCCESS - success
- * \li #ISC_R_NOTFOUND - name not found in map
- */
-
-const cfg_obj_t *
-cfg_map_getname(const cfg_obj_t *mapobj);
-/*%<
- * Get the name of a named map object, like a server "key" clause.
- *
- * Requires:
- * \li 'mapobj' points to a valid configuration object of a map type.
- *
- * Returns:
- * \li A pointer to a configuration object naming the map object,
- * or NULL if the map object does not have a name.
- */
-
-isc_boolean_t
-cfg_obj_istuple(const cfg_obj_t *obj);
-/*%<
- * Return true iff 'obj' is of a map type.
- */
-
-const cfg_obj_t *
-cfg_tuple_get(const cfg_obj_t *tupleobj, const char *name);
-/*%<
- * Extract an element from a configuration object, which
- * must be of a tuple type.
- *
- * Requires:
- * \li 'tupleobj' points to a valid configuration object of a tuple type.
- * \li 'name' points to a null-terminated string naming one of the
- *\li fields of said tuple type.
- */
-
-isc_boolean_t
-cfg_obj_isuint32(const cfg_obj_t *obj);
-/*%<
- * Return true iff 'obj' is of integer type.
- */
-
-isc_uint32_t
-cfg_obj_asuint32(const cfg_obj_t *obj);
-/*%<
- * Returns the value of a configuration object of 32-bit integer type.
- *
- * Requires:
- * \li 'obj' points to a valid configuration object of 32-bit integer type.
- *
- * Returns:
- * \li A 32-bit unsigned integer.
- */
-
-isc_boolean_t
-cfg_obj_isuint64(const cfg_obj_t *obj);
-/*%<
- * Return true iff 'obj' is of integer type.
- */
-
-isc_uint64_t
-cfg_obj_asuint64(const cfg_obj_t *obj);
-/*%<
- * Returns the value of a configuration object of 64-bit integer type.
- *
- * Requires:
- * \li 'obj' points to a valid configuration object of 64-bit integer type.
- *
- * Returns:
- * \li A 64-bit unsigned integer.
- */
-
-isc_boolean_t
-cfg_obj_isstring(const cfg_obj_t *obj);
-/*%<
- * Return true iff 'obj' is of string type.
- */
-
-const char *
-cfg_obj_asstring(const cfg_obj_t *obj);
-/*%<
- * Returns the value of a configuration object of a string type
- * as a null-terminated string.
- *
- * Requires:
- * \li 'obj' points to a valid configuration object of a string type.
- *
- * Returns:
- * \li A pointer to a null terminated string.
- */
-
-isc_boolean_t
-cfg_obj_isboolean(const cfg_obj_t *obj);
-/*%<
- * Return true iff 'obj' is of a boolean type.
- */
-
-isc_boolean_t
-cfg_obj_asboolean(const cfg_obj_t *obj);
-/*%<
- * Returns the value of a configuration object of a boolean type.
- *
- * Requires:
- * \li 'obj' points to a valid configuration object of a boolean type.
- *
- * Returns:
- * \li A boolean value.
- */
-
-isc_boolean_t
-cfg_obj_issockaddr(const cfg_obj_t *obj);
-/*%<
- * Return true iff 'obj' is a socket address.
- */
-
-const isc_sockaddr_t *
-cfg_obj_assockaddr(const cfg_obj_t *obj);
-/*%<
- * Returns the value of a configuration object representing a socket address.
- *
- * Requires:
- * \li 'obj' points to a valid configuration object of a socket address type.
- *
- * Returns:
- * \li A pointer to a sockaddr. The sockaddr must be copied by the caller
- * if necessary.
- */
-
-isc_boolean_t
-cfg_obj_isnetprefix(const cfg_obj_t *obj);
-/*%<
- * Return true iff 'obj' is a network prefix.
- */
-
-void
-cfg_obj_asnetprefix(const cfg_obj_t *obj, isc_netaddr_t *netaddr,
- unsigned int *prefixlen);
-/*%<
- * Gets the value of a configuration object representing a network
- * prefix. The network address is returned through 'netaddr' and the
- * prefix length in bits through 'prefixlen'.
- *
- * Requires:
- * \li 'obj' points to a valid configuration object of network prefix type.
- *\li 'netaddr' and 'prefixlen' are non-NULL.
- */
-
-isc_boolean_t
-cfg_obj_islist(const cfg_obj_t *obj);
-/*%<
- * Return true iff 'obj' is of list type.
- */
-
-const cfg_listelt_t *
-cfg_list_first(const cfg_obj_t *obj);
-/*%<
- * Returns the first list element in a configuration object of a list type.
- *
- * Requires:
- * \li 'obj' points to a valid configuration object of a list type or NULL.
- *
- * Returns:
- * \li A pointer to a cfg_listelt_t representing the first list element,
- * or NULL if the list is empty or nonexistent.
- */
-
-const cfg_listelt_t *
-cfg_list_next(const cfg_listelt_t *elt);
-/*%<
- * Returns the next element of a list of configuration objects.
- *
- * Requires:
- * \li 'elt' points to cfg_listelt_t obtained from cfg_list_first() or
- * a previous call to cfg_list_next().
- *
- * Returns:
- * \li A pointer to a cfg_listelt_t representing the next element,
- * or NULL if there are no more elements.
- */
-
-unsigned int
-cfg_list_length(const cfg_obj_t *obj, isc_boolean_t recurse);
-/*%<
- * Returns the length of a list of configure objects. If obj is
- * not a list, returns 0. If recurse is true, add in the length of
- * all contained lists.
- */
-
-const cfg_obj_t *
-cfg_listelt_value(const cfg_listelt_t *elt);
-/*%<
- * Returns the configuration object associated with cfg_listelt_t.
- *
- * Requires:
- * \li 'elt' points to cfg_listelt_t obtained from cfg_list_first() or
- * cfg_list_next().
- *
- * Returns:
- * \li A non-NULL pointer to a configuration object.
- */
-
-void
-cfg_print(const cfg_obj_t *obj,
- void (*f)(void *closure, const char *text, int textlen),
- void *closure);
-/*%<
- * Print the configuration object 'obj' by repeatedly calling the
- * function 'f', passing 'closure' and a region of text starting
- * at 'text' and comprising 'textlen' characters.
- */
-
-void
-cfg_print_grammar(const cfg_type_t *type,
- void (*f)(void *closure, const char *text, int textlen),
- void *closure);
-/*%<
- * Print a summary of the grammar of the configuration type 'type'.
- */
-
-isc_boolean_t
-cfg_obj_istype(const cfg_obj_t *obj, const cfg_type_t *type);
-/*%<
- * Return true iff 'obj' is of type 'type'.
- */
-
-void cfg_obj_destroy(cfg_parser_t *pctx, cfg_obj_t **obj);
-/*%<
- * Destroy a configuration object.
- */
-
-void
-cfg_obj_log(const cfg_obj_t *obj, isc_log_t *lctx, int level,
- const char *fmt, ...)
- ISC_FORMAT_PRINTF(4, 5);
-/*%<
- * Log a message concerning configuration object 'obj' to the logging
- * channel of 'pctx', at log level 'level'. The message will be prefixed
- * with the file name(s) and line number where 'obj' was defined.
- */
-
-const char *
-cfg_obj_file(const cfg_obj_t *obj);
-/*%<
- * Return the file that defined this object.
- */
-
-unsigned int
-cfg_obj_line(const cfg_obj_t *obj);
-/*%<
- * Return the line in file where this object was defined.
- */
-
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISCCFG_CFG_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2002, 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: grammar.h,v 1.17 2008/09/25 04:02:39 tbox Exp $ */
-
-#ifndef ISCCFG_GRAMMAR_H
-#define ISCCFG_GRAMMAR_H 1
-
-/*! \file isccfg/grammar.h */
-
-#include <isc/lex.h>
-#include <isc/netaddr.h>
-#include <isc/sockaddr.h>
-#include <isc/region.h>
-#include <isc/types.h>
-
-#include <isccfg/cfg.h>
-
-/*
- * Definitions shared between the configuration parser
- * and the grammars; not visible to users of the parser.
- */
-
-/*% Clause may occur multiple times (e.g., "zone") */
-#define CFG_CLAUSEFLAG_MULTI 0x00000001
-/*% Clause is obsolete */
-#define CFG_CLAUSEFLAG_OBSOLETE 0x00000002
-/*% Clause is not implemented, and may never be */
-#define CFG_CLAUSEFLAG_NOTIMP 0x00000004
-/*% Clause is not implemented yet */
-#define CFG_CLAUSEFLAG_NYI 0x00000008
-/*% Default value has changed since earlier release */
-#define CFG_CLAUSEFLAG_NEWDEFAULT 0x00000010
-/*%
- * Clause needs to be interpreted during parsing
- * by calling a callback function, like the
- * "directory" option.
- */
-#define CFG_CLAUSEFLAG_CALLBACK 0x00000020
-/*% A option that is only used in testing. */
-#define CFG_CLAUSEFLAG_TESTONLY 0x00000040
-
-typedef struct cfg_clausedef cfg_clausedef_t;
-typedef struct cfg_tuplefielddef cfg_tuplefielddef_t;
-typedef struct cfg_printer cfg_printer_t;
-typedef ISC_LIST(cfg_listelt_t) cfg_list_t;
-typedef struct cfg_map cfg_map_t;
-typedef struct cfg_rep cfg_rep_t;
-
-/*
- * Function types for configuration object methods
- */
-
-typedef isc_result_t (*cfg_parsefunc_t)(cfg_parser_t *, const cfg_type_t *type,
- cfg_obj_t **);
-typedef void (*cfg_printfunc_t)(cfg_printer_t *, const cfg_obj_t *);
-typedef void (*cfg_docfunc_t)(cfg_printer_t *, const cfg_type_t *);
-typedef void (*cfg_freefunc_t)(cfg_parser_t *, cfg_obj_t *);
-
-/*
- * Structure definitions
- */
-
-/*%
- * A configuration printer object. This is an abstract
- * interface to a destination to which text can be printed
- * by calling the function 'f'.
- */
-struct cfg_printer {
- void (*f)(void *closure, const char *text, int textlen);
- void *closure;
- int indent;
-};
-
-/*% A clause definition. */
-struct cfg_clausedef {
- const char *name;
- cfg_type_t *type;
- unsigned int flags;
-};
-
-/*% A tuple field definition. */
-struct cfg_tuplefielddef {
- const char *name;
- cfg_type_t *type;
- unsigned int flags;
-};
-
-/*% A configuration object type definition. */
-struct cfg_type {
- const char *name; /*%< For debugging purposes only */
- cfg_parsefunc_t parse;
- cfg_printfunc_t print;
- cfg_docfunc_t doc; /*%< Print grammar description */
- cfg_rep_t * rep; /*%< Data representation */
- const void * of; /*%< Additional data for meta-types */
-};
-
-/*% A keyword-type definition, for things like "port <integer>". */
-typedef struct {
- const char *name;
- const cfg_type_t *type;
-} keyword_type_t;
-
-struct cfg_map {
- cfg_obj_t *id; /*%< Used for 'named maps' like keys, zones, &c */
- const cfg_clausedef_t * const *clausesets; /*%< The clauses that
- can occur in this map;
- used for printing */
- isc_symtab_t *symtab;
-};
-
-typedef struct cfg_netprefix cfg_netprefix_t;
-
-struct cfg_netprefix {
- isc_netaddr_t address; /* IP4/IP6 */
- unsigned int prefixlen;
-};
-
-/*%
- * A configuration data representation.
- */
-struct cfg_rep {
- const char * name; /*%< For debugging only */
- cfg_freefunc_t free; /*%< How to free this kind of data. */
-};
-
-/*%
- * A configuration object. This is the main building block
- * of the configuration parse tree.
- */
-
-struct cfg_obj {
- const cfg_type_t *type;
- union {
- isc_uint32_t uint32;
- isc_uint64_t uint64;
- isc_textregion_t string; /*%< null terminated, too */
- isc_boolean_t boolean;
- cfg_map_t map;
- cfg_list_t list;
- cfg_obj_t ** tuple;
- isc_sockaddr_t sockaddr;
- cfg_netprefix_t netprefix;
- } value;
- const char * file;
- unsigned int line;
-};
-
-
-/*% A list element. */
-struct cfg_listelt {
- cfg_obj_t *obj;
- ISC_LINK(cfg_listelt_t) link;
-};
-
-/*% The parser object. */
-struct cfg_parser {
- isc_mem_t * mctx;
- isc_log_t * lctx;
- isc_lex_t * lexer;
- unsigned int errors;
- unsigned int warnings;
- isc_token_t token;
-
- /*% We are at the end of all input. */
- isc_boolean_t seen_eof;
-
- /*% The current token has been pushed back. */
- isc_boolean_t ungotten;
-
- /*%
- * The stack of currently active files, represented
- * as a configuration list of configuration strings.
- * The head is the top-level file, subsequent elements
- * (if any) are the nested include files, and the
- * last element is the file currently being parsed.
- */
- cfg_obj_t * open_files;
-
- /*%
- * Names of files that we have parsed and closed
- * and were previously on the open_file list.
- * We keep these objects around after closing
- * the files because the file names may still be
- * referenced from other configuration objects
- * for use in reporting semantic errors after
- * parsing is complete.
- */
- cfg_obj_t * closed_files;
-
- /*%
- * Current line number. We maintain our own
- * copy of this so that it is available even
- * when a file has just been closed.
- */
- unsigned int line;
-
- cfg_parsecallback_t callback;
- void *callbackarg;
-};
-
-
-/*@{*/
-/*%
- * Flags defining whether to accept certain types of network addresses.
- */
-#define CFG_ADDR_V4OK 0x00000001
-#define CFG_ADDR_V4PREFIXOK 0x00000002
-#define CFG_ADDR_V6OK 0x00000004
-#define CFG_ADDR_WILDOK 0x00000008
-#define CFG_ADDR_MASK (CFG_ADDR_V6OK|CFG_ADDR_V4OK)
-/*@}*/
-
-/*@{*/
-/*%
- * Predefined data representation types.
- */
-LIBISCCFG_EXTERNAL_DATA extern cfg_rep_t cfg_rep_uint32;
-LIBISCCFG_EXTERNAL_DATA extern cfg_rep_t cfg_rep_uint64;
-LIBISCCFG_EXTERNAL_DATA extern cfg_rep_t cfg_rep_string;
-LIBISCCFG_EXTERNAL_DATA extern cfg_rep_t cfg_rep_boolean;
-LIBISCCFG_EXTERNAL_DATA extern cfg_rep_t cfg_rep_map;
-LIBISCCFG_EXTERNAL_DATA extern cfg_rep_t cfg_rep_list;
-LIBISCCFG_EXTERNAL_DATA extern cfg_rep_t cfg_rep_tuple;
-LIBISCCFG_EXTERNAL_DATA extern cfg_rep_t cfg_rep_sockaddr;
-LIBISCCFG_EXTERNAL_DATA extern cfg_rep_t cfg_rep_netprefix;
-LIBISCCFG_EXTERNAL_DATA extern cfg_rep_t cfg_rep_void;
-/*@}*/
-
-/*@{*/
-/*%
- * Predefined configuration object types.
- */
-LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_boolean;
-LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_uint32;
-LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_uint64;
-LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_qstring;
-LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_astring;
-LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_ustring;
-LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_sockaddr;
-LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_netaddr;
-LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_netaddr4;
-LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_netaddr4wild;
-LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_netaddr6;
-LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_netaddr6wild;
-LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_netprefix;
-LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_void;
-LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_token;
-LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_unsupported;
-/*@}*/
-
-isc_result_t
-cfg_gettoken(cfg_parser_t *pctx, int options);
-
-isc_result_t
-cfg_peektoken(cfg_parser_t *pctx, int options);
-
-void
-cfg_ungettoken(cfg_parser_t *pctx);
-
-#define CFG_LEXOPT_QSTRING (ISC_LEXOPT_QSTRING | ISC_LEXOPT_QSTRINGMULTILINE)
-
-isc_result_t
-cfg_create_obj(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **objp);
-
-void
-cfg_print_rawuint(cfg_printer_t *pctx, unsigned int u);
-
-isc_result_t
-cfg_parse_uint32(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
-
-void
-cfg_print_uint32(cfg_printer_t *pctx, const cfg_obj_t *obj);
-
-void
-cfg_print_uint64(cfg_printer_t *pctx, const cfg_obj_t *obj);
-
-isc_result_t
-cfg_parse_qstring(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
-
-void
-cfg_print_ustring(cfg_printer_t *pctx, const cfg_obj_t *obj);
-
-isc_result_t
-cfg_parse_astring(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
-
-isc_result_t
-cfg_parse_rawaddr(cfg_parser_t *pctx, unsigned int flags, isc_netaddr_t *na);
-
-void
-cfg_print_rawaddr(cfg_printer_t *pctx, const isc_netaddr_t *na);
-
-isc_boolean_t
-cfg_lookingat_netaddr(cfg_parser_t *pctx, unsigned int flags);
-
-isc_result_t
-cfg_parse_rawport(cfg_parser_t *pctx, unsigned int flags, in_port_t *port);
-
-isc_result_t
-cfg_parse_sockaddr(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
-
-void
-cfg_print_sockaddr(cfg_printer_t *pctx, const cfg_obj_t *obj);
-
-void
-cfg_doc_sockaddr(cfg_printer_t *pctx, const cfg_type_t *type);
-
-isc_result_t
-cfg_parse_netprefix(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
-
-isc_result_t
-cfg_parse_special(cfg_parser_t *pctx, int special);
-/*%< Parse a required special character 'special'. */
-
-isc_result_t
-cfg_create_tuple(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **objp);
-
-isc_result_t
-cfg_parse_tuple(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
-
-void
-cfg_print_tuple(cfg_printer_t *pctx, const cfg_obj_t *obj);
-
-void
-cfg_doc_tuple(cfg_printer_t *pctx, const cfg_type_t *type);
-
-isc_result_t
-cfg_create_list(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **objp);
-
-isc_result_t
-cfg_parse_listelt(cfg_parser_t *pctx, const cfg_type_t *elttype,
- cfg_listelt_t **ret);
-
-isc_result_t
-cfg_parse_bracketed_list(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
-
-void
-cfg_print_bracketed_list(cfg_printer_t *pctx, const cfg_obj_t *obj);
-
-void
-cfg_doc_bracketed_list(cfg_printer_t *pctx, const cfg_type_t *type);
-
-isc_result_t
-cfg_parse_spacelist(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
-
-void
-cfg_print_spacelist(cfg_printer_t *pctx, const cfg_obj_t *obj);
-
-isc_result_t
-cfg_parse_enum(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
-
-void
-cfg_doc_enum(cfg_printer_t *pctx, const cfg_type_t *type);
-
-void
-cfg_print_chars(cfg_printer_t *pctx, const char *text, int len);
-/*%< Print 'len' characters at 'text' */
-
-void
-cfg_print_cstr(cfg_printer_t *pctx, const char *s);
-/*%< Print the null-terminated string 's' */
-
-isc_result_t
-cfg_parse_map(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
-
-isc_result_t
-cfg_parse_named_map(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
-
-isc_result_t
-cfg_parse_addressed_map(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
-
-isc_result_t
-cfg_parse_netprefix_map(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **
-ret);
-
-void
-cfg_print_map(cfg_printer_t *pctx, const cfg_obj_t *obj);
-
-void
-cfg_doc_map(cfg_printer_t *pctx, const cfg_type_t *type);
-
-isc_result_t
-cfg_parse_mapbody(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
-
-void
-cfg_print_mapbody(cfg_printer_t *pctx, const cfg_obj_t *obj);
-
-void
-cfg_doc_mapbody(cfg_printer_t *pctx, const cfg_type_t *type);
-
-isc_result_t
-cfg_parse_void(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
-
-void
-cfg_print_void(cfg_printer_t *pctx, const cfg_obj_t *obj);
-
-void
-cfg_doc_void(cfg_printer_t *pctx, const cfg_type_t *type);
-
-isc_result_t
-cfg_parse_obj(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
-
-void
-cfg_print_obj(cfg_printer_t *pctx, const cfg_obj_t *obj);
-
-void
-cfg_doc_obj(cfg_printer_t *pctx, const cfg_type_t *type);
-/*%<
- * Print a description of the grammar of an arbitrary configuration
- * type 'type'
- */
-
-void
-cfg_doc_terminal(cfg_printer_t *pctx, const cfg_type_t *type);
-/*%<
- * Document the type 'type' as a terminal by printing its
- * name in angle brackets, e.g., <uint32>.
- */
-
-void
-cfg_parser_error(cfg_parser_t *pctx, unsigned int flags,
- const char *fmt, ...) ISC_FORMAT_PRINTF(3, 4);
-/*!
- * Pass one of these flags to cfg_parser_error() to include the
- * token text in log message.
- */
-#define CFG_LOG_NEAR 0x00000001 /*%< Say "near <token>" */
-#define CFG_LOG_BEFORE 0x00000002 /*%< Say "before <token>" */
-#define CFG_LOG_NOPREP 0x00000004 /*%< Say just "<token>" */
-
-void
-cfg_parser_warning(cfg_parser_t *pctx, unsigned int flags,
- const char *fmt, ...) ISC_FORMAT_PRINTF(3, 4);
-
-isc_boolean_t
-cfg_is_enum(const char *s, const char *const *enums);
-/*%< Return true iff the string 's' is one of the strings in 'enums' */
-
-#endif /* ISCCFG_GRAMMAR_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: log.h,v 1.12.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-#ifndef ISCCFG_LOG_H
-#define ISCCFG_LOG_H 1
-
-/*! \file isccfg/log.h */
-
-#include <isc/lang.h>
-#include <isc/log.h>
-
-LIBISCCFG_EXTERNAL_DATA extern isc_logcategory_t cfg_categories[];
-LIBISCCFG_EXTERNAL_DATA extern isc_logmodule_t cfg_modules[];
-
-#define CFG_LOGCATEGORY_CONFIG (&cfg_categories[0])
-
-#define CFG_LOGMODULE_PARSER (&cfg_modules[0])
-
-ISC_LANG_BEGINDECLS
-
-void
-cfg_log_init(isc_log_t *lctx);
-/*%<
- * Make the libisccfg categories and modules available for use with the
- * ISC logging library.
- *
- * Requires:
- *\li lctx is a valid logging context.
- *
- *\li cfg_log_init() is called only once.
- *
- * Ensures:
- * \li The categories and modules defined above are available for
- * use by isc_log_usechannnel() and isc_log_write().
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISCCFG_LOG_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: namedconf.h,v 1.9 2007/06/19 23:47:22 tbox Exp $ */
-
-#ifndef ISCCFG_NAMEDCONF_H
-#define ISCCFG_NAMEDCONF_H 1
-
-/*! \file isccfg/namedconf.h
- * \brief
- * This module defines the named.conf, rndc.conf, and rndc.key grammars.
- */
-
-#include <isccfg/cfg.h>
-
-/*
- * Configuration object types.
- */
-LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_namedconf;
-/*%< A complete named.conf file. */
-
-LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_rndcconf;
-/*%< A complete rndc.conf file. */
-
-LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_rndckey;
-/*%< A complete rndc.key file. */
-
-LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_keyref;
-/*%< A key reference, used as an ACL element */
-
-#endif /* ISCCFG_CFG_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: version.h,v 1.9 2007/06/19 23:47:22 tbox Exp $ */
-
-/*! \file isccfg/version.h */
-
-#include <isc/platform.h>
-
-LIBISCCFG_EXTERNAL_DATA extern const char cfg_version[];
-
-LIBISCCFG_EXTERNAL_DATA extern const unsigned int cfg_libinterface;
-LIBISCCFG_EXTERNAL_DATA extern const unsigned int cfg_librevision;
-LIBISCCFG_EXTERNAL_DATA extern const unsigned int cfg_libage;
+++ /dev/null
-/*
- * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: context.h,v 1.21.332.2 2008/12/30 23:46:49 tbox Exp $ */
-
-#ifndef LWRES_CONTEXT_H
-#define LWRES_CONTEXT_H 1
-
-/*! \file lwres/context.h */
-
-#include <stddef.h>
-
-#include <lwres/lang.h>
-#include <lwres/int.h>
-#include <lwres/result.h>
-
-/*!
- * Used to set various options such as timeout, authentication, etc
- */
-typedef struct lwres_context lwres_context_t;
-
-LWRES_LANG_BEGINDECLS
-
-typedef void *(*lwres_malloc_t)(void *arg, size_t length);
-typedef void (*lwres_free_t)(void *arg, void *mem, size_t length);
-
-/*
- * XXXMLG
- *
- * Make the server reload /etc/resolv.conf periodically.
- *
- * Make the server do sortlist/searchlist.
- *
- * Client side can disable the search/sortlist processing.
- *
- * Use an array of addresses/masks and searchlist for client-side, and
- * if added to the client disable the processing on the server.
- *
- * Share /etc/resolv.conf data between contexts.
- */
-
-/*!
- * _SERVERMODE
- * Don't allocate and connect a socket to the server, since the
- * caller _is_ a server.
- *
- * _USEIPV4, _USEIPV6
- * Use IPv4 and IPv6 transactions with remote servers, respectively.
- * For backward compatibility, regard both flags as being set when both
- * are cleared.
- */
-#define LWRES_CONTEXT_SERVERMODE 0x00000001U
-#define LWRES_CONTEXT_USEIPV4 0x00000002U
-#define LWRES_CONTEXT_USEIPV6 0x00000004U
-
-lwres_result_t
-lwres_context_create(lwres_context_t **contextp, void *arg,
- lwres_malloc_t malloc_function,
- lwres_free_t free_function,
- unsigned int flags);
-/**<
- * Allocate a lwres context. This is used in all lwres calls.
- *
- * Memory management can be replaced here by passing in two functions.
- * If one is non-NULL, they must both be non-NULL. "arg" is passed to
- * these functions.
- *
- * Contexts are not thread safe. Document at the top of the file.
- * XXXMLG
- *
- * If they are NULL, the standard malloc() and free() will be used.
- *
- *\pre contextp != NULL && contextp == NULL.
- *
- *\return Returns 0 on success, non-zero on failure.
- */
-
-void
-lwres_context_destroy(lwres_context_t **contextp);
-/**<
- * Frees all memory associated with a lwres context.
- *
- *\pre contextp != NULL && contextp == NULL.
- */
-
-lwres_uint32_t
-lwres_context_nextserial(lwres_context_t *ctx);
-/**<
- * XXXMLG Document
- */
-
-void
-lwres_context_initserial(lwres_context_t *ctx, lwres_uint32_t serial);
-
-void
-lwres_context_freemem(lwres_context_t *ctx, void *mem, size_t len);
-
-void *
-lwres_context_allocmem(lwres_context_t *ctx, size_t len);
-
-int
-lwres_context_getsocket(lwres_context_t *ctx);
-
-lwres_result_t
-lwres_context_send(lwres_context_t *ctx,
- void *sendbase, int sendlen);
-
-lwres_result_t
-lwres_context_recv(lwres_context_t *ctx,
- void *recvbase, int recvlen,
- int *recvd_len);
-
-lwres_result_t
-lwres_context_sendrecv(lwres_context_t *ctx,
- void *sendbase, int sendlen,
- void *recvbase, int recvlen,
- int *recvd_len);
-
-LWRES_LANG_ENDDECLS
-
-#endif /* LWRES_CONTEXT_H */
-
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: int.h,v 1.14 2007/06/19 23:47:23 tbox Exp $ */
-
-#ifndef LWRES_INT_H
-#define LWRES_INT_H 1
-
-/*! \file lwres/int.h */
-
-typedef char lwres_int8_t;
-typedef unsigned char lwres_uint8_t;
-typedef short lwres_int16_t;
-typedef unsigned short lwres_uint16_t;
-typedef int lwres_int32_t;
-typedef unsigned int lwres_uint32_t;
-typedef long long lwres_int64_t;
-typedef unsigned long long lwres_uint64_t;
-
-#endif /* LWRES_INT_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: ipv6.h,v 1.16 2007/06/19 23:47:23 tbox Exp $ */
-
-#ifndef LWRES_IPV6_H
-#define LWRES_IPV6_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file lwres/ipv6.h
- * IPv6 definitions for systems which do not support IPv6.
- */
-
-/***
- *** Imports.
- ***/
-
-#include <lwres/int.h>
-#include <lwres/platform.h>
-
-/***
- *** Types.
- ***/
-
-/*% in6_addr structure */
-struct in6_addr {
- union {
- lwres_uint8_t _S6_u8[16];
- lwres_uint16_t _S6_u16[8];
- lwres_uint32_t _S6_u32[4];
- } _S6_un;
-};
-/*@{*/
-/*% IP v6 types */
-#define s6_addr _S6_un._S6_u8
-#define s6_addr8 _S6_un._S6_u8
-#define s6_addr16 _S6_un._S6_u16
-#define s6_addr32 _S6_un._S6_u32
-/*@}*/
-
-#define IN6ADDR_ANY_INIT {{{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }}}
-#define IN6ADDR_LOOPBACK_INIT {{{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }}}
-
-LIBLWRES_EXTERNAL_DATA extern const struct in6_addr in6addr_any;
-LIBLWRES_EXTERNAL_DATA extern const struct in6_addr in6addr_loopback;
-
-/*% used in getaddrinfo.c and getnameinfo.c */
-struct sockaddr_in6 {
-#ifdef LWRES_PLATFORM_HAVESALEN
- lwres_uint8_t sin6_len;
- lwres_uint8_t sin6_family;
-#else
- lwres_uint16_t sin6_family;
-#endif
- lwres_uint16_t sin6_port;
- lwres_uint32_t sin6_flowinfo;
- struct in6_addr sin6_addr;
- lwres_uint32_t sin6_scope_id;
-};
-
-#ifdef LWRES_PLATFORM_HAVESALEN
-#define SIN6_LEN 1
-#endif
-
-/*% in6_pktinfo structure */
-struct in6_pktinfo {
- struct in6_addr ipi6_addr; /*%< src/dst IPv6 address */
- unsigned int ipi6_ifindex; /*%< send/recv interface index */
-};
-
-/*!
- * Unspecified IPv6 address
- */
-#define IN6_IS_ADDR_UNSPECIFIED(a) \
- (((a)->s6_addr32[0] == 0) && \
- ((a)->s6_addr32[1] == 0) && \
- ((a)->s6_addr32[2] == 0) && \
- ((a)->s6_addr32[3] == 0))
-
-/*
- * Loopback
- */
-#define IN6_IS_ADDR_LOOPBACK(a) \
- (((a)->s6_addr32[0] == 0) && \
- ((a)->s6_addr32[1] == 0) && \
- ((a)->s6_addr32[2] == 0) && \
- ((a)->s6_addr32[3] == htonl(1)))
-
-/*
- * IPv4 compatible
- */
-#define IN6_IS_ADDR_V4COMPAT(a) \
- (((a)->s6_addr32[0] == 0) && \
- ((a)->s6_addr32[1] == 0) && \
- ((a)->s6_addr32[2] == 0) && \
- ((a)->s6_addr32[3] != 0) && \
- ((a)->s6_addr32[3] != htonl(1)))
-
-/*
- * Mapped
- */
-#define IN6_IS_ADDR_V4MAPPED(a) \
- (((a)->s6_addr32[0] == 0) && \
- ((a)->s6_addr32[1] == 0) && \
- ((a)->s6_addr32[2] == htonl(0x0000ffff)))
-
-#endif /* LWRES_IPV6_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: lang.h,v 1.13 2007/06/19 23:47:23 tbox Exp $ */
-
-#ifndef LWRES_LANG_H
-#define LWRES_LANG_H 1
-
-/*! \file lwres/lang.h */
-
-#ifdef __cplusplus
-#define LWRES_LANG_BEGINDECLS extern "C" {
-#define LWRES_LANG_ENDDECLS }
-#else
-#define LWRES_LANG_BEGINDECLS
-#define LWRES_LANG_ENDDECLS
-#endif
-
-#endif /* LWRES_LANG_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1997-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: list.h,v 1.14 2007/06/19 23:47:23 tbox Exp $ */
-
-#ifndef LWRES_LIST_H
-#define LWRES_LIST_H 1
-
-/*! \file lwres/list.h */
-
-#define LWRES_LIST(type) struct { type *head, *tail; }
-#define LWRES_LIST_INIT(list) \
- do { (list).head = NULL; (list).tail = NULL; } while (0)
-
-#define LWRES_LINK(type) struct { type *prev, *next; }
-#define LWRES_LINK_INIT(elt, link) \
- do { \
- (elt)->link.prev = (void *)(-1); \
- (elt)->link.next = (void *)(-1); \
- } while (0)
-#define LWRES_LINK_LINKED(elt, link) \
- ((void *)((elt)->link.prev) != (void *)(-1))
-
-#define LWRES_LIST_HEAD(list) ((list).head)
-#define LWRES_LIST_TAIL(list) ((list).tail)
-#define LWRES_LIST_EMPTY(list) LWRES_TF((list).head == NULL)
-
-#define LWRES_LIST_PREPEND(list, elt, link) \
- do { \
- if ((list).head != NULL) \
- (list).head->link.prev = (elt); \
- else \
- (list).tail = (elt); \
- (elt)->link.prev = NULL; \
- (elt)->link.next = (list).head; \
- (list).head = (elt); \
- } while (0)
-
-#define LWRES_LIST_APPEND(list, elt, link) \
- do { \
- if ((list).tail != NULL) \
- (list).tail->link.next = (elt); \
- else \
- (list).head = (elt); \
- (elt)->link.prev = (list).tail; \
- (elt)->link.next = NULL; \
- (list).tail = (elt); \
- } while (0)
-
-#define LWRES_LIST_UNLINK(list, elt, link) \
- do { \
- if ((elt)->link.next != NULL) \
- (elt)->link.next->link.prev = (elt)->link.prev; \
- else \
- (list).tail = (elt)->link.prev; \
- if ((elt)->link.prev != NULL) \
- (elt)->link.prev->link.next = (elt)->link.next; \
- else \
- (list).head = (elt)->link.next; \
- (elt)->link.prev = (void *)(-1); \
- (elt)->link.next = (void *)(-1); \
- } while (0)
-
-#define LWRES_LIST_PREV(elt, link) ((elt)->link.prev)
-#define LWRES_LIST_NEXT(elt, link) ((elt)->link.next)
-
-#define LWRES_LIST_INSERTBEFORE(list, before, elt, link) \
- do { \
- if ((before)->link.prev == NULL) \
- LWRES_LIST_PREPEND(list, elt, link); \
- else { \
- (elt)->link.prev = (before)->link.prev; \
- (before)->link.prev = (elt); \
- (elt)->link.prev->link.next = (elt); \
- (elt)->link.next = (before); \
- } \
- } while (0)
-
-#define LWRES_LIST_INSERTAFTER(list, after, elt, link) \
- do { \
- if ((after)->link.next == NULL) \
- LWRES_LIST_APPEND(list, elt, link); \
- else { \
- (elt)->link.next = (after)->link.next; \
- (after)->link.next = (elt); \
- (elt)->link.next->link.prev = (elt); \
- (elt)->link.prev = (after); \
- } \
- } while (0)
-
-#define LWRES_LIST_APPENDLIST(list1, list2, link) \
- do { \
- if (LWRES_LIST_EMPTY(list1)) \
- (list1) = (list2); \
- else if (!LWRES_LIST_EMPTY(list2)) { \
- (list1).tail->link.next = (list2).head; \
- (list2).head->link.prev = (list1).tail; \
- (list1).tail = (list2).tail; \
- } \
- (list2).head = NULL; \
- (list2).tail = NULL; \
- } while (0)
-
-#define LWRES_LIST_ENQUEUE(list, elt, link) LWRES_LIST_APPEND(list, elt, link)
-#define LWRES_LIST_DEQUEUE(list, elt, link) LWRES_LIST_UNLINK(list, elt, link)
-
-#endif /* LWRES_LIST_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: lwbuffer.h,v 1.22 2007/06/19 23:47:23 tbox Exp $ */
-
-
-/*! \file lwres/lwbuffer.h
- *
- * A buffer is a region of memory, together with a set of related subregions.
- * Buffers are used for parsing and I/O operations.
- *
- * The 'used region' and the 'available' region are disjoint, and their
- * union is the buffer's region. The used region extends from the beginning
- * of the buffer region to the last used byte. The available region
- * extends from one byte greater than the last used byte to the end of the
- * buffer's region. The size of the used region can be changed using various
- * buffer commands. Initially, the used region is empty.
- *
- * The used region is further subdivided into two disjoint regions: the
- * 'consumed region' and the 'remaining region'. The union of these two
- * regions is the used region. The consumed region extends from the beginning
- * of the used region to the byte before the 'current' offset (if any). The
- * 'remaining' region the current pointer to the end of the used
- * region. The size of the consumed region can be changed using various
- * buffer commands. Initially, the consumed region is empty.
- *
- * The 'active region' is an (optional) subregion of the remaining region.
- * It extends from the current offset to an offset in the remaining region
- * that is selected with lwres_buffer_setactive(). Initially, the active
- * region is empty. If the current offset advances beyond the chosen offset,
- * the active region will also be empty.
- *
- * \verbatim
- * /----- used region -----\/-- available --\
- * +----------------------------------------+
- * | consumed | remaining | |
- * +----------------------------------------+
- * a b c d e
- *
- * a == base of buffer.
- * b == current pointer. Can be anywhere between a and d.
- * c == active pointer. Meaningful between b and d.
- * d == used pointer.
- * e == length of buffer.
- *
- * a-e == entire (length) of buffer.
- * a-d == used region.
- * a-b == consumed region.
- * b-d == remaining region.
- * b-c == optional active region.
- * \endverbatim
- *
- * The following invariants are maintained by all routines:
- *
- *\verbatim
- * length > 0
- *
- * base is a valid pointer to length bytes of memory
- *
- * 0 <= used <= length
- *
- * 0 <= current <= used
- *
- * 0 <= active <= used
- * (although active < current implies empty active region)
- *\endverbatim
- *
- * \li MP:
- * Buffers have no synchronization. Clients must ensure exclusive
- * access.
- *
- * \li Reliability:
- * No anticipated impact.
- *
- * \li Resources:
- * Memory: 1 pointer + 6 unsigned integers per buffer.
- *
- * \li Security:
- * No anticipated impact.
- *
- * \li Standards:
- * None.
- */
-
-#ifndef LWRES_LWBUFFER_H
-#define LWRES_LWBUFFER_H 1
-
-/***
- *** Imports
- ***/
-
-#include <lwres/lang.h>
-#include <lwres/int.h>
-
-LWRES_LANG_BEGINDECLS
-
-/***
- *** Magic numbers
- ***/
-#define LWRES_BUFFER_MAGIC 0x4275663fU /* Buf?. */
-
-#define LWRES_BUFFER_VALID(b) ((b) != NULL && \
- (b)->magic == LWRES_BUFFER_MAGIC)
-
-/*!
- * The following macros MUST be used only on valid buffers. It is the
- * caller's responsibility to ensure this by using the LWRES_BUFFER_VALID
- * check above, or by calling another lwres_buffer_*() function (rather than
- * another macro.)
- */
-
-/*!
- * Get the length of the used region of buffer "b"
- */
-#define LWRES_BUFFER_USEDCOUNT(b) ((b)->used)
-
-/*!
- * Get the length of the available region of buffer "b"
- */
-#define LWRES_BUFFER_AVAILABLECOUNT(b) ((b)->length - (b)->used)
-
-#define LWRES_BUFFER_REMAINING(b) ((b)->used - (b)->current)
-
-/*!
- * Note that the buffer structure is public. This is principally so buffer
- * operations can be implemented using macros. Applications are strongly
- * discouraged from directly manipulating the structure.
- */
-
-typedef struct lwres_buffer lwres_buffer_t;
-/*!
- * Buffer data structure
- */
-struct lwres_buffer {
- unsigned int magic;
- unsigned char *base;
- /* The following integers are byte offsets from 'base'. */
- unsigned int length;
- unsigned int used;
- unsigned int current;
- unsigned int active;
-};
-
-/***
- *** Functions
- ***/
-
-void
-lwres_buffer_init(lwres_buffer_t *b, void *base, unsigned int length);
-/**<
- * Make 'b' refer to the 'length'-byte region starting at base.
- *
- * Requires:
- *
- * 'length' > 0
- *
- * 'base' is a pointer to a sequence of 'length' bytes.
- *
- */
-
-void
-lwres_buffer_invalidate(lwres_buffer_t *b);
-/**<
- * Make 'b' an invalid buffer.
- *
- * Requires:
- * 'b' is a valid buffer.
- *
- * Ensures:
- * If assertion checking is enabled, future attempts to use 'b' without
- * calling lwres_buffer_init() on it will cause an assertion failure.
- */
-
-void
-lwres_buffer_add(lwres_buffer_t *b, unsigned int n);
-/**<
- * Increase the 'used' region of 'b' by 'n' bytes.
- *
- * Requires:
- *
- * 'b' is a valid buffer
- *
- * used + n <= length
- *
- */
-
-void
-lwres_buffer_subtract(lwres_buffer_t *b, unsigned int n);
-/**<
- * Decrease the 'used' region of 'b' by 'n' bytes.
- *
- * Requires:
- *
- * 'b' is a valid buffer
- *
- * used >= n
- *
- */
-
-void
-lwres_buffer_clear(lwres_buffer_t *b);
-/**<
- * Make the used region empty.
- *
- * Requires:
- *
- * 'b' is a valid buffer
- *
- * Ensures:
- *
- * used = 0
- *
- */
-
-
-void
-lwres_buffer_first(lwres_buffer_t *b);
-/**<
- * Make the consumed region empty.
- *
- * Requires:
- *
- * 'b' is a valid buffer
- *
- * Ensures:
- *
- * current == 0
- *
- */
-
-void
-lwres_buffer_forward(lwres_buffer_t *b, unsigned int n);
-/**<
- * Increase the 'consumed' region of 'b' by 'n' bytes.
- *
- * Requires:
- *
- * 'b' is a valid buffer
- *
- * current + n <= used
- *
- */
-
-void
-lwres_buffer_back(lwres_buffer_t *b, unsigned int n);
-/**<
- * Decrease the 'consumed' region of 'b' by 'n' bytes.
- *
- * Requires:
- *
- * 'b' is a valid buffer
- *
- * n <= current
- *
- */
-
-lwres_uint8_t
-lwres_buffer_getuint8(lwres_buffer_t *b);
-/**<
- * Read an unsigned 8-bit integer from 'b' and return it.
- *
- * Requires:
- *
- * 'b' is a valid buffer.
- *
- * The length of the available region of 'b' is at least 1.
- *
- * Ensures:
- *
- * The current pointer in 'b' is advanced by 1.
- *
- * Returns:
- *
- * A 8-bit unsigned integer.
- */
-
-void
-lwres_buffer_putuint8(lwres_buffer_t *b, lwres_uint8_t val);
-/**<
- * Store an unsigned 8-bit integer from 'val' into 'b'.
- *
- * Requires:
- * 'b' is a valid buffer.
- *
- * The length of the unused region of 'b' is at least 1.
- *
- * Ensures:
- * The used pointer in 'b' is advanced by 1.
- */
-
-lwres_uint16_t
-lwres_buffer_getuint16(lwres_buffer_t *b);
-/**<
- * Read an unsigned 16-bit integer in network byte order from 'b', convert
- * it to host byte order, and return it.
- *
- * Requires:
- *
- * 'b' is a valid buffer.
- *
- * The length of the available region of 'b' is at least 2.
- *
- * Ensures:
- *
- * The current pointer in 'b' is advanced by 2.
- *
- * Returns:
- *
- * A 16-bit unsigned integer.
- */
-
-void
-lwres_buffer_putuint16(lwres_buffer_t *b, lwres_uint16_t val);
-/**<
- * Store an unsigned 16-bit integer in host byte order from 'val'
- * into 'b' in network byte order.
- *
- * Requires:
- * 'b' is a valid buffer.
- *
- * The length of the unused region of 'b' is at least 2.
- *
- * Ensures:
- * The used pointer in 'b' is advanced by 2.
- */
-
-lwres_uint32_t
-lwres_buffer_getuint32(lwres_buffer_t *b);
-/**<
- * Read an unsigned 32-bit integer in network byte order from 'b', convert
- * it to host byte order, and return it.
- *
- * Requires:
- *
- * 'b' is a valid buffer.
- *
- * The length of the available region of 'b' is at least 2.
- *
- * Ensures:
- *
- * The current pointer in 'b' is advanced by 2.
- *
- * Returns:
- *
- * A 32-bit unsigned integer.
- */
-
-void
-lwres_buffer_putuint32(lwres_buffer_t *b, lwres_uint32_t val);
-/**<
- * Store an unsigned 32-bit integer in host byte order from 'val'
- * into 'b' in network byte order.
- *
- * Requires:
- * 'b' is a valid buffer.
- *
- * The length of the unused region of 'b' is at least 4.
- *
- * Ensures:
- * The used pointer in 'b' is advanced by 4.
- */
-
-void
-lwres_buffer_putmem(lwres_buffer_t *b, const unsigned char *base,
- unsigned int length);
-/**<
- * Copy 'length' bytes of memory at 'base' into 'b'.
- *
- * Requires:
- * 'b' is a valid buffer.
- *
- * 'base' points to 'length' bytes of valid memory.
- *
- */
-
-void
-lwres_buffer_getmem(lwres_buffer_t *b, unsigned char *base,
- unsigned int length);
-/**<
- * Copy 'length' bytes of memory from 'b' into 'base'.
- *
- * Requires:
- * 'b' is a valid buffer.
- *
- * 'base' points to at least 'length' bytes of valid memory.
- *
- * 'b' have at least 'length' bytes remaining.
- */
-
-LWRES_LANG_ENDDECLS
-
-#endif /* LWRES_LWBUFFER_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: lwpacket.h,v 1.24 2007/06/19 23:47:23 tbox Exp $ */
-
-#ifndef LWRES_LWPACKET_H
-#define LWRES_LWPACKET_H 1
-
-#include <lwres/lang.h>
-#include <lwres/lwbuffer.h>
-#include <lwres/result.h>
-
-/*% lwres_lwpacket_t */
-typedef struct lwres_lwpacket lwres_lwpacket_t;
-
-/*% lwres_lwpacket structure */
-struct lwres_lwpacket {
- /*! The overall packet length, including the
- * entire packet header.
- * This field is filled in by the
- * \link lwres_gabn.c lwres_gabn_*()\endlink
- * and \link lwres_gnba.c lwres_gnba_*()\endlink calls.
- */
- lwres_uint32_t length;
- /*! Specifies the header format. Currently,
- * there is only one format, #LWRES_LWPACKETVERSION_0.
- * This field is filled in by the
- * \link lwres_gabn.c lwres_gabn_*()\endlink
- * and \link lwres_gnba.c lwres_gnba_*()\endlink calls.
- */
- lwres_uint16_t version;
- /*! Specifies library-defined flags for this packet, such as
- * whether the packet is a request or a reply. None of
- * these are definable by the caller, but library-defined values
- * can be set by the caller. For example, one bit in this field
- * indicates if the packet is a request or a response.
- * This field is filled in by
- * the application wits the exception of the
- * #LWRES_LWPACKETFLAG_RESPONSE bit, which is set by the library
- * in the
- * \link lwres_gabn.c lwres_gabn_*()\endlink
- * and \link lwres_gnba.c lwres_gnba_*()\endlink calls.
- */
- lwres_uint16_t pktflags;
- /*! Set by the requestor and is returned in all replies.
- * If two packets from the same source have the same serial
- * number and are from the same source, they are assumed to
- * be duplicates and the latter ones may be dropped.
- * (The library does not do this by default on replies, but
- * does so on requests.)
- */
- lwres_uint32_t serial;
- /*! Opcodes between 0x04000000 and 0xffffffff
- * are application defined. Opcodes between
- * 0x00000000 and 0x03ffffff are
- * reserved for library use.
- * This field is filled in by the
- * \link lwres_gabn.c lwres_gabn_*()\endlink
- * and \link lwres_gnba.c lwres_gnba_*()\endlink calls.
- */
- lwres_uint32_t opcode;
- /*! Only valid for results.
- * Results between 0x04000000 and 0xffffffff are application
- * defined.
- * Results between 0x00000000 and 0x03ffffff are reserved for
- * library use.
- * (This is the same reserved range defined in <isc/resultclass.h>,
- * so it
- * would be trivial to map ISC_R_* result codes into packet result
- * codes when appropriate.)
- * This field is filled in by the
- * \link lwres_gabn.c lwres_gabn_*()\endlink
- * and \link lwres_gnba.c lwres_gnba_*()\endlink calls.
- */
- lwres_uint32_t result;
- /*! Set to the maximum buffer size that the receiver can
- * handle on requests, and the size of the buffer needed to
- * satisfy a request
- * when the buffer is too large for replies.
- * This field is supplied by the application.
- */
- lwres_uint32_t recvlength;
- /*! The packet level auth type used.
- * Authtypes between 0x1000 and 0xffff are application defined.
- * Authtypes
- * between 0x0000 and 0x0fff are reserved for library use.
- * This is currently
- * unused and MUST be set to zero.
- */
- lwres_uint16_t authtype;
- /*! The length of the authentication data.
- * See the specific
- * authtypes for more information on what is contained
- * in this field. This is currently unused, and
- * MUST be set to zero.
- */
- lwres_uint16_t authlength;
-};
-
-#define LWRES_LWPACKET_LENGTH (4 * 5 + 2 * 4) /*%< Overall length. */
-
-#define LWRES_LWPACKETFLAG_RESPONSE 0x0001U /*%< If set, pkt is a response. */
-
-
-#define LWRES_LWPACKETVERSION_0 0 /*%< Header format. */
-
-/*! \file lwres/lwpacket.h
- *
- *
- * The remainder of the packet consists of two regions, one described by
- * "authlen" and one of "length - authlen - sizeof(lwres_lwpacket_t)".
- *
- * That is:
- *
- * \code
- * pkt header
- * authlen bytes of auth information
- * data bytes
- * \endcode
- *
- * Currently defined opcodes:
- *
- *\li #LWRES_OPCODE_NOOP. Success is always returned, with the packet contents echoed.
- *
- *\li #LWRES_OPCODE_GETADDRSBYNAME. Return all known addresses for a given name.
- * This may return NIS or /etc/hosts info as well as DNS
- * information. Flags will be provided to indicate ip4/ip6
- * addresses are desired.
- *
- *\li #LWRES_OPCODE_GETNAMEBYADDR. Return the hostname for the given address. Once
- * again, it will return data from multiple sources.
- */
-
-LWRES_LANG_BEGINDECLS
-
-/* XXXMLG document */
-lwres_result_t
-lwres_lwpacket_renderheader(lwres_buffer_t *b, lwres_lwpacket_t *pkt);
-
-lwres_result_t
-lwres_lwpacket_parseheader(lwres_buffer_t *b, lwres_lwpacket_t *pkt);
-
-LWRES_LANG_ENDDECLS
-
-#endif /* LWRES_LWPACKET_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: lwres.h,v 1.57 2007/06/19 23:47:23 tbox Exp $ */
-
-#ifndef LWRES_LWRES_H
-#define LWRES_LWRES_H 1
-
-#include <stdio.h>
-
-#include <lwres/context.h>
-#include <lwres/lang.h>
-#include <lwres/list.h>
-#include <lwres/lwpacket.h>
-#include <lwres/platform.h>
-
-/*! \file lwres/lwres.h */
-
-/*!
- * Design notes:
- *
- * Each opcode has two structures and three functions which operate on each
- * structure. For example, using the "no operation/ping" opcode as an
- * example:
- *
- * <ul><li>lwres_nooprequest_t:
- *
- * lwres_nooprequest_render() takes a lwres_nooprequest_t and
- * and renders it into wire format, storing the allocated
- * buffer information in a passed-in buffer. When this buffer
- * is no longer needed, it must be freed by
- * lwres_context_freemem(). All other memory used by the
- * caller must be freed manually, including the
- * lwres_nooprequest_t passed in.<br /><br />
- *
- * lwres_nooprequest_parse() takes a wire format message and
- * breaks it out into a lwres_nooprequest_t. The structure
- * must be freed via lwres_nooprequest_free() when it is no longer
- * needed.<br /><br />
- *
- * lwres_nooprequest_free() releases into the lwres_context_t
- * any space allocated during parsing.</li>
- *
- * <li>lwres_noopresponse_t:
- *
- * The functions used are similar to the three used for
- * requests, just with different names.</li></ul>
- *
- * Typically, the client will use request_render, response_parse, and
- * response_free, while the daemon will use request_parse, response_render,
- * and request_free.
- *
- * The basic flow of a typical client is:
- *
- * \li fill in a request_t, and call the render function.
- *
- * \li Transmit the buffer returned to the daemon.
- *
- * \li Wait for a response.
- *
- * \li When a response is received, parse it into a response_t.
- *
- * \li free the request buffer using lwres_context_freemem().
- *
- * \li free the response structure and its associated buffer using
- * response_free().
- */
-
-#define LWRES_UDP_PORT 921 /*%< UDP Port Number */
-#define LWRES_RECVLENGTH 16384 /*%< Maximum Packet Length */
-#define LWRES_ADDR_MAXLEN 16 /*%< changing this breaks ABI */
-#define LWRES_RESOLV_CONF "/etc/resolv.conf" /*%< Location of resolv.conf */
-
-/*% DNSSEC is not required (input). Only relevant to rrset queries. */
-#define LWRES_FLAG_TRUSTNOTREQUIRED 0x00000001U
-/*% The data was crypto-verified with DNSSEC (output). */
-#define LWRES_FLAG_SECUREDATA 0x00000002U
-
-/*% no-op */
-#define LWRES_OPCODE_NOOP 0x00000000U
-
-/*% lwres_nooprequest_t */
-typedef struct {
- /* public */
- lwres_uint16_t datalength;
- unsigned char *data;
-} lwres_nooprequest_t;
-
-/*% lwres_noopresponse_t */
-typedef struct {
- /* public */
- lwres_uint16_t datalength;
- unsigned char *data;
-} lwres_noopresponse_t;
-
-/*% get addresses by name */
-#define LWRES_OPCODE_GETADDRSBYNAME 0x00010001U
-
-/*% lwres_addr_t */
-typedef struct lwres_addr lwres_addr_t;
-
-/*% LWRES_LIST */
-typedef LWRES_LIST(lwres_addr_t) lwres_addrlist_t;
-
-/*% lwres_addr */
-struct lwres_addr {
- lwres_uint32_t family;
- lwres_uint16_t length;
- unsigned char address[LWRES_ADDR_MAXLEN];
- LWRES_LINK(lwres_addr_t) link;
-};
-
-/*% lwres_gabnrequest_t */
-typedef struct {
- /* public */
- lwres_uint32_t flags;
- lwres_uint32_t addrtypes;
- lwres_uint16_t namelen;
- char *name;
-} lwres_gabnrequest_t;
-
-/*% lwres_gabnresponse_t */
-typedef struct {
- /* public */
- lwres_uint32_t flags;
- lwres_uint16_t naliases;
- lwres_uint16_t naddrs;
- char *realname;
- char **aliases;
- lwres_uint16_t realnamelen;
- lwres_uint16_t *aliaslen;
- lwres_addrlist_t addrs;
- /*! if base != NULL, it will be freed when this structure is freed. */
- void *base;
- size_t baselen;
-} lwres_gabnresponse_t;
-
-/*% get name by address */
-#define LWRES_OPCODE_GETNAMEBYADDR 0x00010002U
-
-/*% lwres_gnbarequest_t */
-typedef struct {
- /* public */
- lwres_uint32_t flags;
- lwres_addr_t addr;
-} lwres_gnbarequest_t;
-
-/*% lwres_gnbaresponse_t */
-typedef struct {
- /* public */
- lwres_uint32_t flags;
- lwres_uint16_t naliases;
- char *realname;
- char **aliases;
- lwres_uint16_t realnamelen;
- lwres_uint16_t *aliaslen;
- /*! if base != NULL, it will be freed when this structure is freed. */
- void *base;
- size_t baselen;
-} lwres_gnbaresponse_t;
-
-/*% get rdata by name */
-#define LWRES_OPCODE_GETRDATABYNAME 0x00010003U
-
-/*% lwres_grbnrequest_t */
-typedef struct {
- /* public */
- lwres_uint32_t flags;
- lwres_uint16_t rdclass;
- lwres_uint16_t rdtype;
- lwres_uint16_t namelen;
- char *name;
-} lwres_grbnrequest_t;
-
-/*% lwres_grbnresponse_t */
-typedef struct {
- /* public */
- lwres_uint32_t flags;
- lwres_uint16_t rdclass;
- lwres_uint16_t rdtype;
- lwres_uint32_t ttl;
- lwres_uint16_t nrdatas;
- lwres_uint16_t nsigs;
- char *realname;
- lwres_uint16_t realnamelen;
- unsigned char **rdatas;
- lwres_uint16_t *rdatalen;
- unsigned char **sigs;
- lwres_uint16_t *siglen;
- /*% if base != NULL, it will be freed when this structure is freed. */
- void *base;
- size_t baselen;
-} lwres_grbnresponse_t;
-
-/*% Used by lwres_getrrsetbyname() */
-#define LWRDATA_VALIDATED 0x00000001
-
-/*!
- * resolv.conf data
- */
-
-#define LWRES_CONFMAXNAMESERVERS 3 /*%< max 3 "nameserver" entries */
-#define LWRES_CONFMAXLWSERVERS 1 /*%< max 1 "lwserver" entry */
-#define LWRES_CONFMAXSEARCH 8 /*%< max 8 domains in "search" entry */
-#define LWRES_CONFMAXLINELEN 256 /*%< max size of a line */
-#define LWRES_CONFMAXSORTLIST 10 /*%< max 10 */
-
-/*% lwres_conf_t */
-typedef struct {
- lwres_context_t *lwctx;
- lwres_addr_t nameservers[LWRES_CONFMAXNAMESERVERS];
- lwres_uint8_t nsnext; /*%< index for next free slot */
-
- lwres_addr_t lwservers[LWRES_CONFMAXLWSERVERS];
- lwres_uint8_t lwnext; /*%< index for next free slot */
-
- char *domainname;
-
- char *search[LWRES_CONFMAXSEARCH];
- lwres_uint8_t searchnxt; /*%< index for next free slot */
-
- struct {
- lwres_addr_t addr;
- /*% mask has a non-zero 'family' and 'length' if set */
- lwres_addr_t mask;
- } sortlist[LWRES_CONFMAXSORTLIST];
- lwres_uint8_t sortlistnxt;
-
- lwres_uint8_t resdebug; /*%< non-zero if 'options debug' set */
- lwres_uint8_t ndots; /*%< set to n in 'options ndots:n' */
- lwres_uint8_t no_tld_query; /*%< non-zero if 'options no_tld_query' */
-} lwres_conf_t;
-
-#define LWRES_ADDRTYPE_V4 0x00000001U /*%< ipv4 */
-#define LWRES_ADDRTYPE_V6 0x00000002U /*%< ipv6 */
-
-#define LWRES_MAX_ALIASES 16 /*%< max # of aliases */
-#define LWRES_MAX_ADDRS 64 /*%< max # of addrs */
-
-LWRES_LANG_BEGINDECLS
-
-/*% This is in host byte order. */
-LIBLWRES_EXTERNAL_DATA extern lwres_uint16_t lwres_udp_port;
-
-LIBLWRES_EXTERNAL_DATA extern const char *lwres_resolv_conf;
-
-lwres_result_t
-lwres_gabnrequest_render(lwres_context_t *ctx, lwres_gabnrequest_t *req,
- lwres_lwpacket_t *pkt, lwres_buffer_t *b);
-
-lwres_result_t
-lwres_gabnresponse_render(lwres_context_t *ctx, lwres_gabnresponse_t *req,
- lwres_lwpacket_t *pkt, lwres_buffer_t *b);
-
-lwres_result_t
-lwres_gabnrequest_parse(lwres_context_t *ctx, lwres_buffer_t *b,
- lwres_lwpacket_t *pkt, lwres_gabnrequest_t **structp);
-
-lwres_result_t
-lwres_gabnresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b,
- lwres_lwpacket_t *pkt,
- lwres_gabnresponse_t **structp);
-
-void
-lwres_gabnrequest_free(lwres_context_t *ctx, lwres_gabnrequest_t **structp);
-/**<
- * Frees any dynamically allocated memory for this structure.
- *
- * Requires:
- *
- * ctx != NULL, and be a context returned via lwres_context_create().
- *
- * structp != NULL && *structp != NULL.
- *
- * Ensures:
- *
- * *structp == NULL.
- *
- * All memory allocated by this structure will be returned to the
- * system via the context's free function.
- */
-
-void
-lwres_gabnresponse_free(lwres_context_t *ctx, lwres_gabnresponse_t **structp);
-/**<
- * Frees any dynamically allocated memory for this structure.
- *
- * Requires:
- *
- * ctx != NULL, and be a context returned via lwres_context_create().
- *
- * structp != NULL && *structp != NULL.
- *
- * Ensures:
- *
- * *structp == NULL.
- *
- * All memory allocated by this structure will be returned to the
- * system via the context's free function.
- */
-
-
-lwres_result_t
-lwres_gnbarequest_render(lwres_context_t *ctx, lwres_gnbarequest_t *req,
- lwres_lwpacket_t *pkt, lwres_buffer_t *b);
-
-lwres_result_t
-lwres_gnbaresponse_render(lwres_context_t *ctx, lwres_gnbaresponse_t *req,
- lwres_lwpacket_t *pkt, lwres_buffer_t *b);
-
-lwres_result_t
-lwres_gnbarequest_parse(lwres_context_t *ctx, lwres_buffer_t *b,
- lwres_lwpacket_t *pkt, lwres_gnbarequest_t **structp);
-
-lwres_result_t
-lwres_gnbaresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b,
- lwres_lwpacket_t *pkt,
- lwres_gnbaresponse_t **structp);
-
-void
-lwres_gnbarequest_free(lwres_context_t *ctx, lwres_gnbarequest_t **structp);
-/**<
- * Frees any dynamically allocated memory for this structure.
- *
- * Requires:
- *
- * ctx != NULL, and be a context returned via lwres_context_create().
- *
- * structp != NULL && *structp != NULL.
- *
- * Ensures:
- *
- * *structp == NULL.
- *
- * All memory allocated by this structure will be returned to the
- * system via the context's free function.
- */
-
-void
-lwres_gnbaresponse_free(lwres_context_t *ctx, lwres_gnbaresponse_t **structp);
-/**<
- * Frees any dynamically allocated memory for this structure.
- *
- * Requires:
- *
- * ctx != NULL, and be a context returned via lwres_context_create().
- *
- * structp != NULL && *structp != NULL.
- *
- * Ensures:
- *
- * *structp == NULL.
- *
- * All memory allocated by this structure will be returned to the
- * system via the context's free function.
- */
-
-lwres_result_t
-lwres_grbnrequest_render(lwres_context_t *ctx, lwres_grbnrequest_t *req,
- lwres_lwpacket_t *pkt, lwres_buffer_t *b);
-
-lwres_result_t
-lwres_grbnresponse_render(lwres_context_t *ctx, lwres_grbnresponse_t *req,
- lwres_lwpacket_t *pkt, lwres_buffer_t *b);
-
-lwres_result_t
-lwres_grbnrequest_parse(lwres_context_t *ctx, lwres_buffer_t *b,
- lwres_lwpacket_t *pkt, lwres_grbnrequest_t **structp);
-
-lwres_result_t
-lwres_grbnresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b,
- lwres_lwpacket_t *pkt,
- lwres_grbnresponse_t **structp);
-
-void
-lwres_grbnrequest_free(lwres_context_t *ctx, lwres_grbnrequest_t **structp);
-/**<
- * Frees any dynamically allocated memory for this structure.
- *
- * Requires:
- *
- * ctx != NULL, and be a context returned via lwres_context_create().
- *
- * structp != NULL && *structp != NULL.
- *
- * Ensures:
- *
- * *structp == NULL.
- *
- * All memory allocated by this structure will be returned to the
- * system via the context's free function.
- */
-
-void
-lwres_grbnresponse_free(lwres_context_t *ctx, lwres_grbnresponse_t **structp);
-/**<
- * Frees any dynamically allocated memory for this structure.
- *
- * Requires:
- *
- * ctx != NULL, and be a context returned via lwres_context_create().
- *
- * structp != NULL && *structp != NULL.
- *
- * Ensures:
- *
- * *structp == NULL.
- *
- * All memory allocated by this structure will be returned to the
- * system via the context's free function.
- */
-
-lwres_result_t
-lwres_nooprequest_render(lwres_context_t *ctx, lwres_nooprequest_t *req,
- lwres_lwpacket_t *pkt, lwres_buffer_t *b);
-/**<
- * Allocate space and render into wire format a noop request packet.
- *
- * Requires:
- *
- * ctx != NULL, and be a context returned via lwres_context_create().
- *
- * b != NULL, and points to a lwres_buffer_t. The contents of the
- * buffer structure will be initialized to contain the wire-format
- * noop request packet.
- *
- * Caller needs to fill in parts of "pkt" before calling:
- * serial, maxrecv, result.
- *
- * Returns:
- *
- * Returns 0 on success, non-zero on failure.
- *
- * On successful return, *b will contain data about the wire-format
- * packet. It can be transmitted in any way, including lwres_sendblock().
- */
-
-lwres_result_t
-lwres_noopresponse_render(lwres_context_t *ctx, lwres_noopresponse_t *req,
- lwres_lwpacket_t *pkt, lwres_buffer_t *b);
-
-lwres_result_t
-lwres_nooprequest_parse(lwres_context_t *ctx, lwres_buffer_t *b,
- lwres_lwpacket_t *pkt, lwres_nooprequest_t **structp);
-/**<
- * Parse a noop request. Note that to get here, the lwpacket must have
- * already been parsed and removed by the caller, otherwise it would be
- * pretty hard for it to know this is the right function to call.
- *
- * The function verifies bits of the header, but does not modify it.
- */
-
-lwres_result_t
-lwres_noopresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b,
- lwres_lwpacket_t *pkt,
- lwres_noopresponse_t **structp);
-
-void
-lwres_nooprequest_free(lwres_context_t *ctx, lwres_nooprequest_t **structp);
-
-void
-lwres_noopresponse_free(lwres_context_t *ctx, lwres_noopresponse_t **structp);
-
-/**<
- * Frees any dynamically allocated memory for this structure.
- *
- * Requires:
- *
- * ctx != NULL, and be a context returned via lwres_context_create().
- *
- * structp != NULL && *structp != NULL.
- *
- * Ensures:
- *
- * *structp == NULL.
- *
- * All memory allocated by this structure will be returned to the
- * system via the context's free function.
- */
-
-lwres_result_t
-lwres_conf_parse(lwres_context_t *ctx, const char *filename);
-/**<
- * parses a resolv.conf-format file and stores the results in the structure
- * pointed to by *ctx.
- *
- * Requires:
- * ctx != NULL
- * filename != NULL && strlen(filename) > 0
- *
- * Returns:
- * LWRES_R_SUCCESS on a successful parse.
- * Anything else on error, although the structure may be partially filled
- * in.
- */
-
-lwres_result_t
-lwres_conf_print(lwres_context_t *ctx, FILE *fp);
-/**<
- * Prints a resolv.conf-format of confdata output to fp.
- *
- * Requires:
- * ctx != NULL
- */
-
-void
-lwres_conf_init(lwres_context_t *ctx);
-/**<
- * sets all internal fields to a default state. Used to initialize a new
- * lwres_conf_t structure (not reset a used on).
- *
- * Requires:
- * ctx != NULL
- */
-
-void
-lwres_conf_clear(lwres_context_t *ctx);
-/**<
- * frees all internally allocated memory in confdata. Uses the memory
- * routines supplied by ctx.
- *
- * Requires:
- * ctx != NULL
- */
-
-lwres_conf_t *
-lwres_conf_get(lwres_context_t *ctx);
-/**<
- * Be extremely cautions in modifying the contents of this structure; it
- * needs an API to return the various bits of data, walk lists, etc.
- *
- * Requires:
- * ctx != NULL
- */
-
-/*
- * Helper functions
- */
-
-lwres_result_t
-lwres_data_parse(lwres_buffer_t *b, unsigned char **p, lwres_uint16_t *len);
-
-lwres_result_t
-lwres_string_parse(lwres_buffer_t *b, char **c, lwres_uint16_t *len);
-
-lwres_result_t
-lwres_addr_parse(lwres_buffer_t *b, lwres_addr_t *addr);
-
-lwres_result_t
-lwres_getaddrsbyname(lwres_context_t *ctx, const char *name,
- lwres_uint32_t addrtypes, lwres_gabnresponse_t **structp);
-
-lwres_result_t
-lwres_getnamebyaddr(lwres_context_t *ctx, lwres_uint32_t addrtype,
- lwres_uint16_t addrlen, const unsigned char *addr,
- lwres_gnbaresponse_t **structp);
-
-lwres_result_t
-lwres_getrdatabyname(lwres_context_t *ctx, const char *name,
- lwres_uint16_t rdclass, lwres_uint16_t rdtype,
- lwres_uint32_t flags, lwres_grbnresponse_t **structp);
-
-LWRES_LANG_ENDDECLS
-
-#endif /* LWRES_LWRES_H */
+++ /dev/null
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: net.h,v 1.9 2007/06/19 23:47:23 tbox Exp $ */
-
-#ifndef LWRES_NET_H
-#define LWRES_NET_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file net.h
- * This module is responsible for defining the following basic networking
- * types:
- *
- *\li struct in_addr
- *\li struct in6_addr
- *\li struct sockaddr
- *\li struct sockaddr_in
- *\li struct sockaddr_in6
- *
- * It ensures that the AF_ and PF_ macros are defined.
- *
- * It declares ntoh[sl]() and hton[sl]().
- *
- * It declares lwres_net_aton(), lwres_net_ntop(), and lwres_net_pton().
- *
- * It ensures that #INADDR_LOOPBACK, #INADDR_ANY and #IN6ADDR_ANY_INIT
- * are defined.
- */
-
-/***
- *** Imports.
- ***/
-
-#include <lwres/platform.h> /* Required for LWRES_PLATFORM_*. */
-
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/socket.h> /* Contractual promise. */
-#include <sys/ioctl.h>
-#include <sys/time.h>
-#include <sys/un.h>
-
-#include <netinet/in.h> /* Contractual promise. */
-#include <arpa/inet.h> /* Contractual promise. */
-#ifdef LWRES_PLATFORM_NEEDNETINETIN6H
-#include <netinet/in6.h> /* Required on UnixWare. */
-#endif
-#ifdef LWRES_PLATFORM_NEEDNETINET6IN6H
-#include <netinet6/in6.h> /* Required on BSD/OS for in6_pktinfo. */
-#endif
-#include <net/if.h>
-
-#include <lwres/lang.h>
-
-#ifndef LWRES_PLATFORM_HAVEIPV6
-#include <lwres/ipv6.h> /* Contractual promise. */
-#endif
-
-#ifdef LWRES_PLATFORM_HAVEINADDR6
-#define in6_addr in_addr6 /* Required for pre RFC2133 implementations. */
-#endif
-
-/*!
- * Required for some pre RFC2133 implementations.
- * IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT were added in
- * draft-ietf-ipngwg-bsd-api-04.txt or draft-ietf-ipngwg-bsd-api-05.txt.
- * If 's6_addr' is defined then assume that there is a union and three
- * levels otherwise assume two levels required.
- */
-#ifndef IN6ADDR_ANY_INIT
-#ifdef s6_addr
-#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
-#else
-#define IN6ADDR_ANY_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }
-#endif
-#endif
-
-/*!
- * Initialize address loopback. See IN6ADDR_ANY_INIT
- */
-#ifndef IN6ADDR_LOOPBACK_INIT
-#ifdef s6_addr
-#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
-#else
-#define IN6ADDR_LOOPBACK_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } }
-#endif
-#endif
-
-/*% Used by AI_ALL */
-#ifndef AF_INET6
-#define AF_INET6 99
-#endif
-
-
-/*% Used to return IPV6 address types. */
-#ifndef PF_INET6
-#define PF_INET6 AF_INET6
-#endif
-
-/*% inaddr Loopback */
-#ifndef INADDR_LOOPBACK
-#define INADDR_LOOPBACK 0x7f000001UL
-#endif
-
-LWRES_LANG_BEGINDECLS
-
-const char *
-lwres_net_ntop(int af, const void *src, char *dst, size_t size);
-
-int
-lwres_net_pton(int af, const char *src, void *dst);
-
-int
-lwres_net_aton(const char *cp, struct in_addr *addr);
-
-LWRES_LANG_ENDDECLS
-
-#endif /* LWRES_NET_H */
+++ /dev/null
-/*
- * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: netdb.h.in,v 1.39.332.2 2009/01/18 23:47:41 tbox Exp $ */
-
-/*! \file */
-
-#ifndef LWRES_NETDB_H
-#define LWRES_NETDB_H 1
-
-#include <stddef.h> /* Required on FreeBSD (and others?) for size_t. */
-#include <netdb.h> /* Contractual provision. */
-
-#include <lwres/lang.h>
-
-/*
- * Define if <netdb.h> does not declare struct addrinfo.
- */
-#undef ISC_LWRES_NEEDADDRINFO
-
-#ifdef ISC_LWRES_NEEDADDRINFO
-struct addrinfo {
- int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
- int ai_family; /* PF_xxx */
- int ai_socktype; /* SOCK_xxx */
- int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
- size_t ai_addrlen; /* Length of ai_addr */
- char *ai_canonname; /* Canonical name for hostname */
- struct sockaddr *ai_addr; /* Binary address */
- struct addrinfo *ai_next; /* Next structure in linked list */
-};
-#endif
-
-/*
- * Undefine all #defines we are interested in as <netdb.h> may or may not have
- * defined them.
- */
-
-/*
- * Error return codes from gethostbyname() and gethostbyaddr()
- * (left in extern int h_errno).
- */
-
-#undef NETDB_INTERNAL
-#undef NETDB_SUCCESS
-#undef HOST_NOT_FOUND
-#undef TRY_AGAIN
-#undef NO_RECOVERY
-#undef NO_DATA
-#undef NO_ADDRESS
-
-#define NETDB_INTERNAL -1 /* see errno */
-#define NETDB_SUCCESS 0 /* no problem */
-#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */
-#define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL */
-#define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
-#define NO_DATA 4 /* Valid name, no data record of requested type */
-#define NO_ADDRESS NO_DATA /* no address, look for MX record */
-
-/*
- * Error return codes from getaddrinfo()
- */
-
-#undef EAI_ADDRFAMILY
-#undef EAI_AGAIN
-#undef EAI_BADFLAGS
-#undef EAI_FAIL
-#undef EAI_FAMILY
-#undef EAI_MEMORY
-#undef EAI_NODATA
-#undef EAI_NONAME
-#undef EAI_SERVICE
-#undef EAI_SOCKTYPE
-#undef EAI_SYSTEM
-#undef EAI_BADHINTS
-#undef EAI_PROTOCOL
-#undef EAI_MAX
-
-#define EAI_ADDRFAMILY 1 /* address family for hostname not supported */
-#define EAI_AGAIN 2 /* temporary failure in name resolution */
-#define EAI_BADFLAGS 3 /* invalid value for ai_flags */
-#define EAI_FAIL 4 /* non-recoverable failure in name resolution */
-#define EAI_FAMILY 5 /* ai_family not supported */
-#define EAI_MEMORY 6 /* memory allocation failure */
-#define EAI_NODATA 7 /* no address associated with hostname */
-#define EAI_NONAME 8 /* hostname nor servname provided, or not known */
-#define EAI_SERVICE 9 /* servname not supported for ai_socktype */
-#define EAI_SOCKTYPE 10 /* ai_socktype not supported */
-#define EAI_SYSTEM 11 /* system error returned in errno */
-#define EAI_BADHINTS 12
-#define EAI_PROTOCOL 13
-#define EAI_MAX 14
-
-/*
- * Flag values for getaddrinfo()
- */
-#undef AI_PASSIVE
-#undef AI_CANONNAME
-#undef AI_NUMERICHOST
-
-#define AI_PASSIVE 0x00000001
-#define AI_CANONNAME 0x00000002
-#define AI_NUMERICHOST 0x00000004
-
-/*
- * Flag values for getipnodebyname()
- */
-#undef AI_V4MAPPED
-#undef AI_ALL
-#undef AI_ADDRCONFIG
-#undef AI_DEFAULT
-
-#define AI_V4MAPPED 0x00000008
-#define AI_ALL 0x00000010
-#define AI_ADDRCONFIG 0x00000020
-#define AI_DEFAULT (AI_V4MAPPED|AI_ADDRCONFIG)
-
-/*
- * Constants for lwres_getnameinfo()
- */
-#undef NI_MAXHOST
-#undef NI_MAXSERV
-
-#define NI_MAXHOST 1025
-#define NI_MAXSERV 32
-
-/*
- * Flag values for lwres_getnameinfo()
- */
-#undef NI_NOFQDN
-#undef NI_NUMERICHOST
-#undef NI_NAMEREQD
-#undef NI_NUMERICSERV
-#undef NI_DGRAM
-#undef NI_NUMERICSCOPE
-
-#define NI_NOFQDN 0x00000001
-#define NI_NUMERICHOST 0x00000002
-#define NI_NAMEREQD 0x00000004
-#define NI_NUMERICSERV 0x00000008
-#define NI_DGRAM 0x00000010
-#define NI_NUMERICSCOPE 0x00000020 /*2553bis-00*/
-
-/*
- * Define if <netdb.h> does not declare struct rrsetinfo.
- */
-#define ISC_LWRES_NEEDRRSETINFO 1
-
-#ifdef ISC_LWRES_NEEDRRSETINFO
-/*
- * Structures for getrrsetbyname()
- */
-struct rdatainfo {
- unsigned int rdi_length;
- unsigned char *rdi_data;
-};
-
-struct rrsetinfo {
- unsigned int rri_flags;
- int rri_rdclass;
- int rri_rdtype;
- unsigned int rri_ttl;
- unsigned int rri_nrdatas;
- unsigned int rri_nsigs;
- char *rri_name;
- struct rdatainfo *rri_rdatas;
- struct rdatainfo *rri_sigs;
-};
-
-/*
- * Flags for getrrsetbyname()
- */
-#define RRSET_VALIDATED 0x00000001
- /* Set was dnssec validated */
-
-/*
- * Return codes for getrrsetbyname()
- */
-#define ERRSET_SUCCESS 0
-#define ERRSET_NOMEMORY 1
-#define ERRSET_FAIL 2
-#define ERRSET_INVAL 3
-#define ERRSET_NONAME 4
-#define ERRSET_NODATA 5
-#endif
-
-/*
- * Define to map into lwres_ namespace.
- */
-
-#define LWRES_NAMESPACE
-
-#ifdef LWRES_NAMESPACE
-
-/*
- * Use our versions not the ones from the C library.
- */
-
-#ifdef getnameinfo
-#undef getnameinfo
-#endif
-#define getnameinfo lwres_getnameinfo
-
-#ifdef getaddrinfo
-#undef getaddrinfo
-#endif
-#define getaddrinfo lwres_getaddrinfo
-
-#ifdef freeaddrinfo
-#undef freeaddrinfo
-#endif
-#define freeaddrinfo lwres_freeaddrinfo
-
-#ifdef gai_strerror
-#undef gai_strerror
-#endif
-#define gai_strerror lwres_gai_strerror
-
-#ifdef herror
-#undef herror
-#endif
-#define herror lwres_herror
-
-#ifdef hstrerror
-#undef hstrerror
-#endif
-#define hstrerror lwres_hstrerror
-
-#ifdef getipnodebyname
-#undef getipnodebyname
-#endif
-#define getipnodebyname lwres_getipnodebyname
-
-#ifdef getipnodebyaddr
-#undef getipnodebyaddr
-#endif
-#define getipnodebyaddr lwres_getipnodebyaddr
-
-#ifdef freehostent
-#undef freehostent
-#endif
-#define freehostent lwres_freehostent
-
-#ifdef gethostbyname
-#undef gethostbyname
-#endif
-#define gethostbyname lwres_gethostbyname
-
-#ifdef gethostbyname2
-#undef gethostbyname2
-#endif
-#define gethostbyname2 lwres_gethostbyname2
-
-#ifdef gethostbyaddr
-#undef gethostbyaddr
-#endif
-#define gethostbyaddr lwres_gethostbyaddr
-
-#ifdef gethostent
-#undef gethostent
-#endif
-#define gethostent lwres_gethostent
-
-#ifdef sethostent
-#undef sethostent
-#endif
-#define sethostent lwres_sethostent
-
-#ifdef endhostent
-#undef endhostent
-#endif
-#define endhostent lwres_endhostent
-
-/* #define sethostfile lwres_sethostfile */
-
-#ifdef gethostbyname_r
-#undef gethostbyname_r
-#endif
-#define gethostbyname_r lwres_gethostbyname_r
-
-#ifdef gethostbyaddr_r
-#undef gethostbyaddr_r
-#endif
-#define gethostbyaddr_r lwres_gethostbyaddr_r
-
-#ifdef gethostent_r
-#undef gethostent_r
-#endif
-#define gethostent_r lwres_gethostent_r
-
-#ifdef sethostent_r
-#undef sethostent_r
-#endif
-#define sethostent_r lwres_sethostent_r
-
-#ifdef endhostent_r
-#undef endhostent_r
-#endif
-#define endhostent_r lwres_endhostent_r
-
-#ifdef getrrsetbyname
-#undef getrrsetbyname
-#endif
-#define getrrsetbyname lwres_getrrsetbyname
-
-#ifdef freerrset
-#undef freerrset
-#endif
-#define freerrset lwres_freerrset
-
-#ifdef notyet
-#define getservbyname lwres_getservbyname
-#define getservbyport lwres_getservbyport
-#define getservent lwres_getservent
-#define setservent lwres_setservent
-#define endservent lwres_endservent
-
-#define getservbyname_r lwres_getservbyname_r
-#define getservbyport_r lwres_getservbyport_r
-#define getservent_r lwres_getservent_r
-#define setservent_r lwres_setservent_r
-#define endservent_r lwres_endservent_r
-
-#define getprotobyname lwres_getprotobyname
-#define getprotobynumber lwres_getprotobynumber
-#define getprotoent lwres_getprotoent
-#define setprotoent lwres_setprotoent
-#define endprotoent lwres_endprotoent
-
-#define getprotobyname_r lwres_getprotobyname_r
-#define getprotobynumber_r lwres_getprotobynumber_r
-#define getprotoent_r lwres_getprotoent_r
-#define setprotoent_r lwres_setprotoent_r
-#define endprotoent_r lwres_endprotoent_r
-
-#ifdef getnetbyname
-#undef getnetbyname
-#endif
-#define getnetbyname lwres_getnetbyname
-
-#ifdef getnetbyaddr
-#undef getnetbyaddr
-#endif
-#define getnetbyaddr lwres_getnetbyaddr
-
-#ifdef getnetent
-#undef getnetent
-#endif
-#define getnetent lwres_getnetent
-
-#ifdef setnetent
-#undef setnetent
-#endif
-#define setnetent lwres_setnetent
-
-#ifdef endnetent
-#undef endnetent
-#endif
-#define endnetent lwres_endnetent
-
-
-#ifdef getnetbyname_r
-#undef getnetbyname_r
-#endif
-#define getnetbyname_r lwres_getnetbyname_r
-
-#ifdef getnetbyaddr_r
-#undef getnetbyaddr_r
-#endif
-#define getnetbyaddr_r lwres_getnetbyaddr_r
-
-#ifdef getnetent_r
-#undef getnetent_r
-#endif
-#define getnetent_r lwres_getnetent_r
-
-#ifdef setnetent_r
-#undef setnetent_r
-#endif
-#define setnetent_r lwres_setnetent_r
-
-#ifdef endnetent_r
-#undef endnetent_r
-#endif
-#define endnetent_r lwres_endnetent_r
-#endif /* notyet */
-
-#ifdef h_errno
-#undef h_errno
-#endif
-#define h_errno lwres_h_errno
-
-#endif /* LWRES_NAMESPACE */
-
-LWRES_LANG_BEGINDECLS
-
-extern int lwres_h_errno;
-
-int lwres_getaddrinfo(const char *, const char *,
- const struct addrinfo *, struct addrinfo **);
-int lwres_getnameinfo(const struct sockaddr *, size_t, char *,
- size_t, char *, size_t, int);
-void lwres_freeaddrinfo(struct addrinfo *);
-char *lwres_gai_strerror(int);
-
-struct hostent *lwres_gethostbyaddr(const char *, int, int);
-struct hostent *lwres_gethostbyname(const char *);
-struct hostent *lwres_gethostbyname2(const char *, int);
-struct hostent *lwres_gethostent(void);
-struct hostent *lwres_getipnodebyname(const char *, int, int, int *);
-struct hostent *lwres_getipnodebyaddr(const void *, size_t, int, int *);
-void lwres_endhostent(void);
-void lwres_sethostent(int);
-/* void lwres_sethostfile(const char *); */
-void lwres_freehostent(struct hostent *);
-
-int lwres_getrrsetbyname(const char *, unsigned int, unsigned int,
- unsigned int, struct rrsetinfo **);
-void lwres_freerrset(struct rrsetinfo *);
-
-#ifdef notyet
-struct netent *lwres_getnetbyaddr(unsigned long, int);
-struct netent *lwres_getnetbyname(const char *);
-struct netent *lwres_getnetent(void);
-void lwres_endnetent(void);
-void lwres_setnetent(int);
-
-struct protoent *lwres_getprotobyname(const char *);
-struct protoent *lwres_getprotobynumber(int);
-struct protoent *lwres_getprotoent(void);
-void lwres_endprotoent(void);
-void lwres_setprotoent(int);
-
-struct servent *lwres_getservbyname(const char *, const char *);
-struct servent *lwres_getservbyport(int, const char *);
-struct servent *lwres_getservent(void);
-void lwres_endservent(void);
-void lwres_setservent(int);
-#endif /* notyet */
-
-void lwres_herror(const char *);
-const char *lwres_hstrerror(int);
-
-
-struct hostent *lwres_gethostbyaddr_r(const char *, int, int, struct hostent *,
- char *, int, int *);
-struct hostent *lwres_gethostbyname_r(const char *, struct hostent *,
- char *, int, int *);
-struct hostent *lwres_gethostent_r(struct hostent *, char *, int, int *);
-void lwres_sethostent_r(int);
-void lwres_endhostent_r(void);
-
-#ifdef notyet
-struct netent *lwres_getnetbyname_r(const char *, struct netent *,
- char *, int);
-struct netent *lwres_getnetbyaddr_r(long, int, struct netent *,
- char *, int);
-struct netent *lwres_getnetent_r(struct netent *, char *, int);
-void lwres_setnetent_r(int);
-void lwres_endnetent_r(void);
-
-struct protoent *lwres_getprotobyname_r(const char *,
- struct protoent *, char *, int);
-struct protoent *lwres_getprotobynumber_r(int,
- struct protoent *, char *, int);
-struct protoent *lwres_getprotoent_r(struct protoent *, char *, int);
-void lwres_setprotoent_r(int);
-void lwres_endprotoent_r(void);
-
-struct servent *lwres_getservbyname_r(const char *name, const char *,
- struct servent *, char *, int);
-struct servent *lwres_getservbyport_r(int port, const char *,
- struct servent *, char *, int);
-struct servent *lwres_getservent_r(struct servent *, char *, int);
-void lwres_setservent_r(int);
-void lwres_endservent_r(void);
-#endif /* notyet */
-
-LWRES_LANG_ENDDECLS
-
-#ifdef notyet
-/* This is nec'y to make this include file properly replace the sun version. */
-#ifdef sun
-#ifdef __GNU_LIBRARY__
-#include <rpc/netdb.h> /* Required. */
-#else /* !__GNU_LIBRARY__ */
-struct rpcent {
- char *r_name; /* name of server for this rpc program */
- char **r_aliases; /* alias list */
- int r_number; /* rpc program number */
-};
-struct rpcent *lwres_getrpcbyname();
-struct rpcent *lwres_getrpcbynumber(),
-struct rpcent *lwres_getrpcent();
-#endif /* __GNU_LIBRARY__ */
-#endif /* sun */
-#endif /* notyet */
-
-/*
- * Tell Emacs to use C mode on this file.
- * Local variables:
- * mode: c
- * End:
- */
-
-#endif /* LWRES_NETDB_H */
+++ /dev/null
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: platform.h.in,v 1.21 2007/06/19 23:47:23 tbox Exp $ */
-
-/*! \file */
-
-#ifndef LWRES_PLATFORM_H
-#define LWRES_PLATFORM_H 1
-
-/*****
- ***** Platform-dependent defines.
- *****/
-
-/***
- *** Network.
- ***/
-
-/*
- * Define if this system needs the <netinet/in6.h> header file for IPv6.
- */
-#undef LWRES_PLATFORM_NEEDNETINETIN6H
-
-/*
- * Define if this system needs the <netinet6/in6.h> header file for IPv6.
- */
-#undef LWRES_PLATFORM_NEEDNETINET6IN6H
-
-/*
- * If sockaddrs on this system have an sa_len field, LWRES_PLATFORM_HAVESALEN
- * will be defined.
- */
-#undef LWRES_PLATFORM_HAVESALEN
-
-/*
- * If this system has the IPv6 structure definitions, LWRES_PLATFORM_HAVEIPV6
- * will be defined.
- */
-#define LWRES_PLATFORM_HAVEIPV6 1
-
-/*
- * If this system is missing in6addr_any, LWRES_PLATFORM_NEEDIN6ADDRANY will
- * be defined.
- */
-#undef LWRES_PLATFORM_NEEDIN6ADDRANY
-
-/*
- * If this system is missing in6addr_loopback,
- * LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK will be defined.
- */
-#undef LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK
-
-/*
- * If this system has in_addr6, rather than in6_addr,
- * LWRES_PLATFORM_HAVEINADDR6 will be defined.
- */
-#undef LWRES_PLATFORM_HAVEINADDR6
-
-/*
- * Defined if unistd.h does not cause fd_set to be delared.
- */
-#undef LWRES_PLATFORM_NEEDSYSSELECTH
-
-/*
- * Used to control how extern data is linked; needed for Win32 platforms.
- */
-#undef LWRES_PLATFORM_USEDECLSPEC
-
-/*
- * Defined this system needs vsnprintf() and snprintf().
- */
-#undef LWRES_PLATFORM_NEEDVSNPRINTF
-
-/*
- * If this system need a modern sprintf() that returns (int) not (char*).
- */
-#undef LWRES_PLATFORM_NEEDSPRINTF
-
-/*
- * The printf format string modifier to use with lwres_uint64_t values.
- */
-#define LWRES_PLATFORM_QUADFORMAT "ll"
-
-/*! \brief
- * Define if this system needs strtoul.
- */
-#undef LWRES_PLATFORM_NEEDSTRTOUL
-
-#ifndef LWRES_PLATFORM_USEDECLSPEC
-#define LIBLWRES_EXTERNAL_DATA
-#else
-#ifdef LIBLWRES_EXPORTS
-#define LIBLWRES_EXTERNAL_DATA __declspec(dllexport)
-#else
-#define LIBLWRES_EXTERNAL_DATA __declspec(dllimport)
-#endif
-#endif
-
-/*
- * Tell Emacs to use C mode on this file.
- * Local Variables:
- * mode: c
- * End:
- */
-
-#endif /* LWRES_PLATFORM_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: result.h,v 1.21 2007/06/19 23:47:23 tbox Exp $ */
-
-#ifndef LWRES_RESULT_H
-#define LWRES_RESULT_H 1
-
-/*! \file lwres/result.h */
-
-typedef unsigned int lwres_result_t;
-
-#define LWRES_R_SUCCESS 0
-#define LWRES_R_NOMEMORY 1
-#define LWRES_R_TIMEOUT 2
-#define LWRES_R_NOTFOUND 3
-#define LWRES_R_UNEXPECTEDEND 4 /* unexpected end of input */
-#define LWRES_R_FAILURE 5 /* generic failure */
-#define LWRES_R_IOERROR 6
-#define LWRES_R_NOTIMPLEMENTED 7
-#define LWRES_R_UNEXPECTED 8
-#define LWRES_R_TRAILINGDATA 9
-#define LWRES_R_INCOMPLETE 10
-#define LWRES_R_RETRY 11
-#define LWRES_R_TYPENOTFOUND 12
-#define LWRES_R_TOOLARGE 13
-
-#endif /* LWRES_RESULT_H */
+++ /dev/null
-/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: version.h,v 1.9 2007/06/19 23:47:23 tbox Exp $ */
-
-/*! \file lwres/version.h */
-
-#include <lwres/platform.h>
-
-LIBLWRES_EXTERNAL_DATA extern const char lwres_version[];
-
-LIBLWRES_EXTERNAL_DATA extern const unsigned int lwres_libinterface;
-LIBLWRES_EXTERNAL_DATA extern const unsigned int lwres_librevision;
-LIBLWRES_EXTERNAL_DATA extern const unsigned int lwres_libage;
+++ /dev/null
-# libbind9.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.26 Debian 1.5.26-1ubuntu1 (1.1220.2.493 2008/02/01 16:58:18)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libbind9.so.50'
-
-# Names of this library.
-library_names='libbind9.so.50.0.3 libbind9.so.50 libbind9.so'
-
-# The name of the static archive.
-old_library='libbind9.a'
-
-# Libraries that this one depends upon.
-dependency_libs=' -L/usr/lib -L/home/tridge/project/bind9/lib/isc /home/tridge/project/bind9/prefix/lib/libisccfg.la -L/home/tridge/project/bind9/lib/dns -L/home/tridge/project/bind9/lib/isccc /home/tridge/project/bind9/prefix/lib/libdns.la -lgssapi_krb5 -lcrypto -lGeoIP /home/tridge/project/bind9/prefix/lib/libisccc.la /home/tridge/project/bind9/prefix/lib/libisc.la -lcap -lpthread /usr/lib/libxml2.la'
-
-# Version information for libbind9.
-current=50
-age=0
-revision=3
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/tridge/project/bind9/prefix/lib'
+++ /dev/null
-libbind9.so.50.0.3
\ No newline at end of file
+++ /dev/null
-libbind9.so.50.0.3
\ No newline at end of file
+++ /dev/null
-# libdns.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.26 Debian 1.5.26-1ubuntu1 (1.1220.2.493 2008/02/01 16:58:18)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libdns.so.53'
-
-# Names of this library.
-library_names='libdns.so.53.0.0 libdns.so.53 libdns.so'
-
-# The name of the static archive.
-old_library='libdns.a'
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/tridge/project/bind9/prefix/lib/libisc.la -L/usr/lib -lgssapi_krb5 -lcap -lpthread /usr/lib/libxml2.la -L/home/tridge/project/bind9/lib/isc -lcrypto -lGeoIP'
-
-# Version information for libdns.
-current=53
-age=0
-revision=0
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/tridge/project/bind9/prefix/lib'
+++ /dev/null
-libdns.so.53.0.0
\ No newline at end of file
+++ /dev/null
-libdns.so.53.0.0
\ No newline at end of file
+++ /dev/null
-# libisc.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.26 Debian 1.5.26-1ubuntu1 (1.1220.2.493 2008/02/01 16:58:18)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libisc.so.50'
-
-# Names of this library.
-library_names='libisc.so.50.1.1 libisc.so.50 libisc.so'
-
-# The name of the static archive.
-old_library='libisc.a'
-
-# Libraries that this one depends upon.
-dependency_libs=' -lcap -lpthread /usr/lib/libxml2.la'
-
-# Version information for libisc.
-current=51
-age=1
-revision=1
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/tridge/project/bind9/prefix/lib'
+++ /dev/null
-libisc.so.50.1.1
\ No newline at end of file
+++ /dev/null
-libisc.so.50.1.1
\ No newline at end of file
+++ /dev/null
-# libisccc.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.26 Debian 1.5.26-1ubuntu1 (1.1220.2.493 2008/02/01 16:58:18)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libisccc.so.50'
-
-# Names of this library.
-library_names='libisccc.so.50.0.0 libisccc.so.50 libisccc.so'
-
-# The name of the static archive.
-old_library='libisccc.a'
-
-# Libraries that this one depends upon.
-dependency_libs=' -L/home/tridge/project/bind9/lib/isc /home/tridge/project/bind9/prefix/lib/libisc.la -lcap -lpthread /usr/lib/libxml2.la'
-
-# Version information for libisccc.
-current=50
-age=0
-revision=0
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/tridge/project/bind9/prefix/lib'
+++ /dev/null
-libisccc.so.50.0.0
\ No newline at end of file
+++ /dev/null
-libisccc.so.50.0.0
\ No newline at end of file
+++ /dev/null
-# libisccfg.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.26 Debian 1.5.26-1ubuntu1 (1.1220.2.493 2008/02/01 16:58:18)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libisccfg.so.50'
-
-# Names of this library.
-library_names='libisccfg.so.50.0.0 libisccfg.so.50 libisccfg.so'
-
-# The name of the static archive.
-old_library='libisccfg.a'
-
-# Libraries that this one depends upon.
-dependency_libs=' -L/home/tridge/project/bind9/lib/dns -L/home/tridge/project/bind9/lib/isc -L/home/tridge/project/bind9/lib/isccc /home/tridge/project/bind9/prefix/lib/libdns.la -L/usr/lib -lgssapi_krb5 -lcrypto -lGeoIP /home/tridge/project/bind9/prefix/lib/libisccc.la /home/tridge/project/bind9/prefix/lib/libisc.la -lcap -lpthread /usr/lib/libxml2.la'
-
-# Version information for libisccfg.
-current=50
-age=0
-revision=0
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/tridge/project/bind9/prefix/lib'
+++ /dev/null
-libisccfg.so.50.0.0
\ No newline at end of file
+++ /dev/null
-libisccfg.so.50.0.0
\ No newline at end of file
+++ /dev/null
-# liblwres.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.26 Debian 1.5.26-1ubuntu1 (1.1220.2.493 2008/02/01 16:58:18)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='liblwres.so.50'
-
-# Names of this library.
-library_names='liblwres.so.50.0.2 liblwres.so.50 liblwres.so'
-
-# The name of the static archive.
-old_library='liblwres.a'
-
-# Libraries that this one depends upon.
-dependency_libs=' -lcap -lpthread /usr/lib/libxml2.la'
-
-# Version information for liblwres.
-current=50
-age=0
-revision=2
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/tridge/project/bind9/prefix/lib'
+++ /dev/null
-liblwres.so.50.0.2
\ No newline at end of file
+++ /dev/null
-liblwres.so.50.0.2
\ No newline at end of file
+++ /dev/null
-named-checkzone
\ No newline at end of file