summaryrefslogtreecommitdiffstats
path: root/lib/dns/include
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dns/include')
-rw-r--r--lib/dns/include/dns/Makefile.in6
-rw-r--r--lib/dns/include/dns/acache.h2
-rw-r--r--lib/dns/include/dns/acl.h4
-rw-r--r--lib/dns/include/dns/adb.h6
-rw-r--r--lib/dns/include/dns/cache.h34
-rw-r--r--lib/dns/include/dns/callbacks.h12
-rw-r--r--lib/dns/include/dns/clientinfo.h85
-rw-r--r--lib/dns/include/dns/db.h44
-rw-r--r--lib/dns/include/dns/dispatch.h66
-rw-r--r--lib/dns/include/dns/dlz_dlopen.h15
-rw-r--r--lib/dns/include/dns/dnssec.h17
-rw-r--r--lib/dns/include/dns/events.h9
-rw-r--r--lib/dns/include/dns/journal.h42
-rw-r--r--lib/dns/include/dns/log.h2
-rw-r--r--lib/dns/include/dns/master.h29
-rw-r--r--lib/dns/include/dns/masterdump.h47
-rw-r--r--lib/dns/include/dns/nsec.h29
-rw-r--r--lib/dns/include/dns/nsec3.h7
-rw-r--r--lib/dns/include/dns/private.h21
-rw-r--r--lib/dns/include/dns/rdata.h14
-rw-r--r--lib/dns/include/dns/rdataset.h2
-rw-r--r--lib/dns/include/dns/resolver.h11
-rw-r--r--lib/dns/include/dns/result.h2
-rw-r--r--lib/dns/include/dns/rpz.h1
-rw-r--r--lib/dns/include/dns/rriterator.h4
-rw-r--r--lib/dns/include/dns/sdb.h13
-rw-r--r--lib/dns/include/dns/sdlz.h18
-rw-r--r--lib/dns/include/dns/time.h2
-rw-r--r--lib/dns/include/dns/types.h21
-rw-r--r--lib/dns/include/dns/update.h64
-rw-r--r--lib/dns/include/dns/view.h43
-rw-r--r--lib/dns/include/dns/zone.h198
-rw-r--r--lib/dns/include/dns/zt.h36
-rw-r--r--lib/dns/include/dst/dst.h38
34 files changed, 842 insertions, 102 deletions
diff --git a/lib/dns/include/dns/Makefile.in b/lib/dns/include/dns/Makefile.in
index ad8bc38..1a69f2c 100644
--- a/lib/dns/include/dns/Makefile.in
+++ b/lib/dns/include/dns/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id$
+# $Id: Makefile.in,v 1.60 2011/11/14 18:32:34 each Exp $
srcdir = @srcdir@
VPATH = @srcdir@
@@ -22,8 +22,8 @@ top_srcdir = @top_srcdir@
@BIND9_VERSION@
HEADERS = acl.h adb.h byaddr.h cache.h callbacks.h cert.h compress.h \
- db.h dbiterator.h dbtable.h diff.h dispatch.h dlz.h \
- dnssec.h ds.h events.h fixedname.h iptable.h journal.h \
+ clientinfo.h db.h dbiterator.h dbtable.h diff.h dispatch.h \
+ dlz.h dnssec.h ds.h events.h fixedname.h iptable.h journal.h \
keyflags.h keytable.h keyvalues.h lib.h log.h \
master.h masterdump.h message.h name.h ncache.h nsec.h \
peer.h portlist.h private.h rbt.h rcode.h \
diff --git a/lib/dns/include/dns/acache.h b/lib/dns/include/dns/acache.h
index c372ed9..304cba7 100644
--- a/lib/dns/include/dns/acache.h
+++ b/lib/dns/include/dns/acache.h
@@ -238,7 +238,7 @@ dns_acache_setcleaninginterval(dns_acache_t *acache, unsigned int t);
*/
void
-dns_acache_setcachesize(dns_acache_t *acache, isc_uint32_t size);
+dns_acache_setcachesize(dns_acache_t *acache, size_t size);
/*
* Set the maximum additional cache size. 0 means unlimited.
*/
diff --git a/lib/dns/include/dns/acl.h b/lib/dns/include/dns/acl.h
index 41b9522..f4fc4a3 100644
--- a/lib/dns/include/dns/acl.h
+++ b/lib/dns/include/dns/acl.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2007, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2007, 2009, 2011 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: acl.h,v 1.35 2011/06/17 23:47:49 tbox Exp $ */
#ifndef DNS_ACL_H
#define DNS_ACL_H 1
diff --git a/lib/dns/include/dns/adb.h b/lib/dns/include/dns/adb.h
index b8c41dc..a5a3124 100644
--- a/lib/dns/include/dns/adb.h
+++ b/lib/dns/include/dns/adb.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2008, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2008, 2011, 2013 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: adb.h,v 1.88 2011/12/05 17:10:51 each Exp $ */
#ifndef DNS_ADB_H
#define DNS_ADB_H 1
@@ -607,7 +607,7 @@ dns_adb_flush(dns_adb_t *adb);
*/
void
-dns_adb_setadbsize(dns_adb_t *adb, isc_uint32_t size);
+dns_adb_setadbsize(dns_adb_t *adb, size_t size);
/*%<
* Set a target memory size. If memory usage exceeds the target
* size entries will be removed before they would have expired on
diff --git a/lib/dns/include/dns/cache.h b/lib/dns/include/dns/cache.h
index f0825be..f7140aa 100644
--- a/lib/dns/include/dns/cache.h
+++ b/lib/dns/include/dns/cache.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2007, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2007, 2009, 2011, 2013 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: cache.h,v 1.32 2011/08/02 23:47:52 tbox Exp $ */
#ifndef DNS_CACHE_H
#define DNS_CACHE_H 1
@@ -245,12 +245,6 @@ dns_cache_getcleaninginterval(dns_cache_t *cache);
* Get the periodic cache cleaning interval to 'interval' seconds.
*/
-isc_uint32_t
-dns_cache_getcachesize(dns_cache_t *cache);
-/*%<
- * Get the maximum cache size.
- */
-
const char *
dns_cache_getname(dns_cache_t *cache);
/*%<
@@ -258,12 +252,12 @@ dns_cache_getname(dns_cache_t *cache);
*/
void
-dns_cache_setcachesize(dns_cache_t *cache, isc_uint32_t size);
+dns_cache_setcachesize(dns_cache_t *cache, size_t size);
/*%<
* Set the maximum cache size. 0 means unlimited.
*/
-isc_uint32_t
+size_t
dns_cache_getcachesize(dns_cache_t *cache);
/*%<
* Get the maximum cache size.
@@ -280,9 +274,27 @@ dns_cache_flush(dns_cache_t *cache);
*/
isc_result_t
+dns_cache_flushnode(dns_cache_t *cache, dns_name_t *name,
+ isc_boolean_t tree);
+/*
+ * Flush a given name from the cache. If 'tree' is true, then
+ * also flush all names under 'name'.
+ *
+ * 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_result_t
dns_cache_flushname(dns_cache_t *cache, dns_name_t *name);
/*
- * Flushes a given name from the cache.
+ * Flush a given name from the cache. Equivalent to
+ * dns_cache_flushpartial(cache, name, ISC_FALSE).
*
* Requires:
*\li 'cache' to be valid.
diff --git a/lib/dns/include/dns/callbacks.h b/lib/dns/include/dns/callbacks.h
index b686647..5e9cb71 100644
--- a/lib/dns/include/dns/callbacks.h
+++ b/lib/dns/include/dns/callbacks.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2007, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2007, 2011 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: callbacks.h,v 1.26 2011/12/09 23:47:05 tbox Exp $ */
#ifndef DNS_CALLBACKS_H
#define DNS_CALLBACKS_H 1
@@ -41,6 +41,14 @@ struct dns_rdatacallbacks {
* dns_load_master calls this when it has rdatasets to commit.
*/
dns_addrdatasetfunc_t add;
+
+ /*%
+ * dns_master_load*() call this when loading a raw zonefile,
+ * to pass back information obtained from the file header
+ */
+ dns_rawdatafunc_t rawdata;
+ dns_zone_t *zone;
+
/*%
* dns_load_master / dns_rdata_fromtext call this to issue a error.
*/
diff --git a/lib/dns/include/dns/clientinfo.h b/lib/dns/include/dns/clientinfo.h
new file mode 100644
index 0000000..4f2b89c
--- /dev/null
+++ b/lib/dns/include/dns/clientinfo.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2011 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: clientinfo.h,v 1.3 2011/10/11 23:46:45 tbox Exp $ */
+
+#ifndef DNS_CLIENTINFO_H
+#define DNS_CLIENTINFO_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file dns/clientinfo.h
+ * \brief
+ * The DNS clientinfo interface allows libdns to retrieve information
+ * about the client from the caller.
+ *
+ * The clientinfo interface is used by the DNS DB and DLZ interfaces;
+ * it allows databases to modify their answers on the basis of information
+ * about the client, such as source IP address.
+ *
+ * dns_clientinfo_t contains a pointer to an opaque structure containing
+ * client information in some form. dns_clientinfomethods_t contains a
+ * list of methods which operate on that opaque structure to return
+ * potentially useful data. Both structures also contain versioning
+ * information.
+ */
+
+/*****
+ ***** Imports
+ *****/
+
+#include <isc/sockaddr.h>
+#include <isc/types.h>
+
+ISC_LANG_BEGINDECLS
+
+/*****
+ ***** Types
+ *****/
+
+#define DNS_CLIENTINFO_VERSION 1
+typedef struct dns_clientinfo {
+ isc_uint16_t version;
+ void *data;
+} dns_clientinfo_t;
+
+typedef isc_result_t (*dns_clientinfo_sourceip_t)(dns_clientinfo_t *client,
+ isc_sockaddr_t **addrp);
+
+#define DNS_CLIENTINFOMETHODS_VERSION 1
+#define DNS_CLIENTINFOMETHODS_AGE 0
+
+typedef struct dns_clientinfomethods {
+ isc_uint16_t version;
+ isc_uint16_t age;
+ dns_clientinfo_sourceip_t sourceip;
+} dns_clientinfomethods_t;
+
+/*****
+ ***** Methods
+ *****/
+void
+dns_clientinfomethods_init(dns_clientinfomethods_t *methods,
+ dns_clientinfo_sourceip_t sourceip);
+
+void
+dns_clientinfo_init(dns_clientinfo_t *ci, void *data);
+
+ISC_LANG_ENDDECLS
+
+#endif /* DNS_CLIENTINFO_H */
diff --git a/lib/dns/include/dns/db.h b/lib/dns/include/dns/db.h
index ef090a2..66bc3e3 100644
--- a/lib/dns/include/dns/db.h
+++ b/lib/dns/include/dns/db.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: db.h,v 1.107.4.1 2011/10/23 20:12:08 vjs Exp $ */
#ifndef DNS_DB_H
#define DNS_DB_H 1
@@ -59,6 +59,7 @@
#include <isc/ondestroy.h>
#include <isc/stdtime.h>
+#include <dns/clientinfo.h>
#include <dns/fixedname.h>
#include <dns/name.h>
#include <dns/rdata.h>
@@ -179,6 +180,20 @@ typedef struct dns_dbmethods {
dns_rdataset_t *ardataset,
dns_rpz_st_t *st,
dns_name_t *query_qname);
+ isc_result_t (*findnodeext)(dns_db_t *db, dns_name_t *name,
+ isc_boolean_t create,
+ dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo,
+ dns_dbnode_t **nodep);
+ isc_result_t (*findext)(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_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo,
+ dns_rdataset_t *rdataset,
+ dns_rdataset_t *sigrdataset);
} dns_dbmethods_t;
typedef isc_result_t
@@ -660,9 +675,19 @@ dns_db_closeversion(dns_db_t *db, dns_dbversion_t **versionp,
isc_result_t
dns_db_findnode(dns_db_t *db, dns_name_t *name, isc_boolean_t create,
dns_dbnode_t **nodep);
+
+isc_result_t
+dns_db_findnodeext(dns_db_t *db, dns_name_t *name, isc_boolean_t create,
+ dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo, dns_dbnode_t **nodep);
/*%<
* Find the node with name 'name'.
*
+ * dns_db_findnodeext() (findnode extended) also accepts parameters
+ * 'methods' and 'clientinfo', which, when provided, enable the database to
+ * retreive information about the client from the caller, and modify its
+ * response on the basis of that information.
+ *
* Notes:
* \li If 'create' is ISC_TRUE and no node with name 'name' exists, then
* such a node will be created.
@@ -699,9 +724,21 @@ 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);
+
+isc_result_t
+dns_db_findext(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_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo,
+ dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
/*%<
* Find the best match for 'name' and 'type' in version 'version' of 'db'.
*
+ * dns_db_findext() (find extended) also accepts parameters 'methods'
+ * and 'clientinfo', which when provided enable the database to retreive
+ * information about the client from the caller, and modify its response
+ * on the basis of this information.
+ *
* Notes:
*
* \li If type == dns_rdataset_any, then rdataset will not be bound.
@@ -733,6 +770,10 @@ dns_db_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
* that it is correct. This only affects answers returned from the
* cache.
*
+ * \li In the #DNS_DBFIND_FORCENSEC3 option is set, then we are looking
+ * in the NSEC3 tree and not the main tree. Without this option being
+ * set NSEC3 records will not be found.
+ *
* \li To respond to a query for SIG records, the caller should create a
* rdataset iterator and extract the signatures from each rdataset.
*
@@ -1048,6 +1089,7 @@ 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.
diff --git a/lib/dns/include/dns/dispatch.h b/lib/dns/include/dns/dispatch.h
index 3f881df..1235f7c 100644
--- a/lib/dns/include/dns/dispatch.h
+++ b/lib/dns/include/dns/dispatch.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2009, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: dispatch.h,v 1.64 2011/07/28 23:47:58 tbox Exp $ */
#ifndef DNS_DISPATCH_H
#define DNS_DISPATCH_H 1
@@ -54,6 +54,7 @@
#include <isc/buffer.h>
#include <isc/lang.h>
+#include <isc/mutex.h>
#include <isc/socket.h>
#include <isc/types.h>
@@ -88,6 +89,18 @@ struct dns_dispatchevent {
isc_uint32_t attributes; /*%< mirrored from socket.h */
};
+/*%
+ * This is a set of one or more dispatches which can be retrieved
+ * round-robin fashion.
+ */
+struct dns_dispatchset {
+ isc_mem_t *mctx;
+ dns_dispatch_t **dispatches;
+ int ndisp;
+ int cur;
+ isc_mutex_t lock;
+};
+
/*@{*/
/*%
* Attributes for added dispatchers.
@@ -245,6 +258,15 @@ dns_dispatch_getudp(dns_dispatchmgr_t *mgr, isc_socketmgr_t *sockmgr,
unsigned int buckets, unsigned int increment,
unsigned int attributes, unsigned int mask,
dns_dispatch_t **dispp);
+
+isc_result_t
+dns_dispatch_getudp_dup(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, dns_dispatch_t *dup);
/*%<
* Attach to existing dns_dispatch_t if one is found with dns_dispatchmgr_find,
* otherwise create a new UDP dispatch.
@@ -496,6 +518,46 @@ dns_dispatch_importrecv(dns_dispatch_t *disp, isc_event_t *event);
* event != NULL
*/
+dns_dispatch_t *
+dns_dispatchset_get(dns_dispatchset_t *dset);
+/*%<
+ * Retrieve the next dispatch from dispatch set 'dset', and increment
+ * the round-robin counter.
+ *
+ * Requires:
+ *\li dset != NULL
+ */
+
+isc_result_t
+dns_dispatchset_create(isc_mem_t *mctx, isc_socketmgr_t *sockmgr,
+ isc_taskmgr_t *taskmgr, dns_dispatch_t *source,
+ dns_dispatchset_t **dsetp, int n);
+/*%<
+ * Given a valid dispatch 'source', create a dispatch set containing
+ * 'n' UDP dispatches, with the remainder filled out by clones of the
+ * source.
+ *
+ * Requires:
+ *\li source is a valid UDP dispatcher
+ *\li dsetp != NULL, *dsetp == NULL
+ */
+
+void
+dns_dispatchset_cancelall(dns_dispatchset_t *dset, isc_task_t *task);
+/*%<
+ * Cancel socket operations for the dispatches in 'dset'.
+ */
+
+void
+dns_dispatchset_destroy(dns_dispatchset_t **dsetp);
+/*%<
+ * Dereference all the dispatches in '*dsetp', free the dispatchset
+ * memory, and set *dsetp to NULL.
+ *
+ * Requires:
+ *\li dset is valid
+ */
+
ISC_LANG_ENDDECLS
#endif /* DNS_DISPATCH_H */
diff --git a/lib/dns/include/dns/dlz_dlopen.h b/lib/dns/include/dns/dlz_dlopen.h
index 6ad7e7a..f87722c 100644
--- a/lib/dns/include/dns/dlz_dlopen.h
+++ b/lib/dns/include/dns/dlz_dlopen.h
@@ -30,7 +30,7 @@ ISC_LANG_BEGINDECLS
* for the entry points of an external DLZ module for bind9.
*/
-#define DLZ_DLOPEN_VERSION 1
+#define DLZ_DLOPEN_VERSION 2
/*
* dlz_dlopen_version() is required for all DLZ external drivers. It
@@ -65,7 +65,9 @@ typedef isc_result_t dlz_dlopen_findzonedb_t (void *dbdata,
typedef isc_result_t dlz_dlopen_lookup_t (const char *zone,
const char *name,
void *dbdata,
- dns_sdlzlookup_t *lookup);
+ dns_sdlzlookup_t *lookup,
+ dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo);
/*
* dlz_dlopen_authority is optional() if dlz_dlopen_lookup()
@@ -116,6 +118,15 @@ typedef isc_result_t dlz_dlopen_configure_t (dns_view_t *view,
void *dbdata);
/*
+ * dlz_dlopen_setclientcallback() is optional, but must be supplied if you
+ * want to retrieve information about the client (e.g., source address)
+ * before sending a replay.
+ */
+typedef isc_result_t dlz_dlopen_setclientcallback_t (dns_view_t *view,
+ void *dbdata);
+
+
+/*
* dlz_dlopen_ssumatch() is optional, but must be supplied if you want
* to support dynamic updates
*/
diff --git a/lib/dns/include/dns/dnssec.h b/lib/dns/include/dns/dnssec.h
index e986d40..e443f91 100644
--- a/lib/dns/include/dns/dnssec.h
+++ b/lib/dns/include/dns/dnssec.h
@@ -132,12 +132,19 @@ 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);
+
+isc_result_t
+dns_dnssec_verify3(dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
+ isc_boolean_t ignoretime, unsigned int maxbits,
+ isc_mem_t *mctx, dns_rdata_t *sigrdata, dns_name_t *wild);
/*%<
* Verifies the RRSIG 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.
*
+ * 'maxbits' specifies the maximum number of rsa exponent bits accepted.
+ *
* Requires:
*\li 'name' (the owner name of the record) is a valid name
*\li 'set' is a valid rdataset
@@ -309,7 +316,7 @@ dns_dnssec_keylistfromrdataset(dns_name_t *origin,
isc_result_t
dns_dnssec_updatekeys(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *newkeys,
dns_dnsseckeylist_t *removed, dns_name_t *origin,
- dns_ttl_t ttl, dns_diff_t *diff, isc_boolean_t allzsk,
+ dns_ttl_t hint_ttl, dns_diff_t *diff, isc_boolean_t allzsk,
isc_mem_t *mctx, void (*report)(const char *, ...));
/*%<
* Update the list of keys in 'keys' with new key information in 'newkeys'.
@@ -328,9 +335,11 @@ dns_dnssec_updatekeys(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *newkeys,
* If 'allzsk' is true, we are allowing KSK-flagged keys to be used as
* ZSKs.
*
- * 'ttl' is the TTL of the DNSKEY RRset; if it is longer than the
- * time until a new key will be activated, then we have to delay the
- * key's activation.
+ * 'hint_ttl' is the TTL to use for the DNSKEY RRset if there is no
+ * existing RRset, and if none of the keys to be added has a default TTL
+ * (in which case we would use the shortest one). If the TTL is longer
+ * than the time until a new key will be activated, then we have to delay
+ * the key's activation.
*
* 'report' points to a function for reporting status.
*
diff --git a/lib/dns/include/dns/events.h b/lib/dns/include/dns/events.h
index 3a28ab2..fd2144f 100644
--- a/lib/dns/include/dns/events.h
+++ b/lib/dns/include/dns/events.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2007, 2009, 2010, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2007, 2009-2011 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: events.h,v 1.61 2011/10/28 06:20:06 each Exp $ */
#ifndef DNS_EVENTS_H
#define DNS_EVENTS_H 1
@@ -74,6 +74,11 @@
#define DNS_EVENT_CLIENTREQDONE (ISC_EVENTCLASS_DNS + 44)
#define DNS_EVENT_ADBGROWENTRIES (ISC_EVENTCLASS_DNS + 45)
#define DNS_EVENT_ADBGROWNAMES (ISC_EVENTCLASS_DNS + 46)
+#define DNS_EVENT_ZONESECURESERIAL (ISC_EVENTCLASS_DNS + 47)
+#define DNS_EVENT_ZONESECUREDB (ISC_EVENTCLASS_DNS + 48)
+#define DNS_EVENT_ZONELOAD (ISC_EVENTCLASS_DNS + 49)
+#define DNS_EVENT_KEYDONE (ISC_EVENTCLASS_DNS + 50)
+#define DNS_EVENT_SETNSEC3PARAM (ISC_EVENTCLASS_DNS + 51)
#define DNS_EVENT_FIRSTEVENT (ISC_EVENTCLASS_DNS + 0)
#define DNS_EVENT_LASTEVENT (ISC_EVENTCLASS_DNS + 65535)
diff --git a/lib/dns/include/dns/journal.h b/lib/dns/include/dns/journal.h
index d750fbe..68ba8b3 100644
--- a/lib/dns/include/dns/journal.h
+++ b/lib/dns/include/dns/journal.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2009, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2009, 2011 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: journal.h,v 1.43 2011/12/22 07:32:41 each Exp $ */
#ifndef DNS_JOURNAL_H
#define DNS_JOURNAL_H 1
@@ -46,6 +46,10 @@
***/
#define DNS_JOURNALOPT_RESIGN 0x00000001
+#define DNS_JOURNAL_READ 0x00000000 /* ISC_FALSE */
+#define DNS_JOURNAL_CREATE 0x00000001 /* ISC_TRUE */
+#define DNS_JOURNAL_WRITE 0x00000002
+
/***
*** Types
***/
@@ -72,7 +76,7 @@ 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);
+ dns_diffop_t op, dns_difftuple_t **tp);
/*!< brief
* Create a diff tuple for the current database SOA.
* XXX this probably belongs somewhere else.
@@ -95,16 +99,15 @@ dns_db_createsoatuple(dns_db_t *db, dns_dbversion_t *ver, isc_mem_t *mctx,
*/
isc_result_t
-dns_journal_open(isc_mem_t *mctx, const char *filename, isc_boolean_t write,
+dns_journal_open(isc_mem_t *mctx, const char *filename, unsigned int mode,
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.
+ * DNS_JOURNAL_CREATE open the journal for reading and writing and create
+ * the journal if it does not exist.
+ * DNS_JOURNAL_WRITE open the journal for reading and writing.
+ * DNS_JOURNAL_READ open the journal for reading only.
*/
void
@@ -267,12 +270,18 @@ 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);
+
+isc_result_t
+dns_db_diffx(dns_diff_t *diff, 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
+ * Compare the databases 'dba' and 'dbb' and generate a diff/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'.
+ * entry to the journal file specified by 'journal_filename' if
+ * non-NULL.
*/
isc_result_t
@@ -284,6 +293,17 @@ dns_journal_compact(isc_mem_t *mctx, char *filename, isc_uint32_t serial,
* exists and is non-empty 'serial' must exist in the journal.
*/
+isc_boolean_t
+dns_journal_get_sourceserial(dns_journal_t *j, isc_uint32_t *sourceserial);
+void
+dns_journal_set_sourceserial(dns_journal_t *j, isc_uint32_t sourceserial);
+/*%<
+ * Get and set source serial.
+ *
+ * Returns:
+ * ISC_TRUE if sourceserial has previously been set.
+ */
+
ISC_LANG_ENDDECLS
#endif /* DNS_JOURNAL_H */
diff --git a/lib/dns/include/dns/log.h b/lib/dns/include/dns/log.h
index 689b148..3c4df8a 100644
--- a/lib/dns/include/dns/log.h
+++ b/lib/dns/include/dns/log.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: log.h,v 1.47 2011/10/13 22:48:24 tbox Exp $ */
/*! \file dns/log.h
* \author Principal Authors: DCL */
diff --git a/lib/dns/include/dns/master.h b/lib/dns/include/dns/master.h
index a852ae4..896c6e9 100644
--- a/lib/dns/include/dns/master.h
+++ b/lib/dns/include/dns/master.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2009, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -66,18 +66,29 @@ ISC_LANG_BEGINDECLS
* 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
+#define DNS_RAWFORMAT_VERSION 1
+
+/*
+ * Flags to indicate the status of the data in the raw file header
+ */
+#define DNS_MASTERRAW_COMPAT 0x01
+#define DNS_MASTERRAW_SOURCESERIALSET 0x02
+#define DNS_MASTERRAW_LASTXFRINSET 0x04
/* Common header */
-typedef struct {
+struct dns_masterrawheader {
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;
+ * (currently unused) */
+ isc_uint32_t flags; /* Flags */
+ isc_uint32_t sourceserial; /* Source serial number (used
+ * by inline-signing zones) */
+ isc_uint32_t lastxfrin; /* timestamp of last transfer
+ * (used by slave zones) */
+};
/* The structure for each RRset */
typedef struct {
@@ -302,6 +313,12 @@ dns_loadctx_cancel(dns_loadctx_t *ctx);
*\li 'ctx' to be valid
*/
+void
+dns_master_initrawheader(dns_masterrawheader_t *header);
+/*%<
+ * Initializes the header for a raw master file, setting all
+ * values to zero.
+ */
ISC_LANG_ENDDECLS
#endif /* DNS_MASTER_H */
diff --git a/lib/dns/include/dns/masterdump.h b/lib/dns/include/dns/masterdump.h
index f7e30f1..8631248 100644
--- a/lib/dns/include/dns/masterdump.h
+++ b/lib/dns/include/dns/masterdump.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2008, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2008, 2011 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: masterdump.h,v 1.47 2011/12/08 23:46:49 tbox Exp $ */
#ifndef DNS_MASTERDUMP_H
#define DNS_MASTERDUMP_H 1
@@ -220,13 +220,25 @@ 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);
+
+isc_result_t
+dns_master_dumptostream3(isc_mem_t *mctx, dns_db_t *db,
+ dns_dbversion_t *version,
+ const dns_master_style_t *style,
+ dns_masterformat_t format,
+ dns_masterrawheader_t *header, 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(),
+ * dns_master_dumptostream() is an old form of dns_master_dumptostream3(),
* which always specifies the dns_masterformat_text format.
+ * dns_master_dumptostream2() is an old form which always specifies
+ * a NULL header.
+ *
+ * If 'format' is dns_masterformat_raw, then 'header' can contain
+ * information to be written to the file header.
*
* Temporary dynamic memory may be allocated from 'mctx'.
*
@@ -257,6 +269,13 @@ dns_master_dumpinc2(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
isc_task_t *task, dns_dumpdonefunc_t done, void *done_arg, dns_dumpctx_t **dctxp, dns_masterformat_t format);
isc_result_t
+dns_master_dumpinc3(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, dns_masterrawheader_t *header);
+
+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);
@@ -267,14 +286,24 @@ dns_master_dump2(isc_mem_t *mctx, dns_db_t *db,
const dns_master_style_t *style, const char *filename,
dns_masterformat_t format);
+isc_result_t
+dns_master_dump3(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, dns_masterrawheader_t *header);
+
/*%<
* 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.
+ * dns_master_dumpinc() and dns_master_dump() are old forms of _dumpinc3()
+ * and _dump3(), respectively, which always specify the dns_masterformat_text
+ * format. dns_master_dumpinc2() and dns_master_dump2() are old forms which
+ * always specify a NULL header.
+ *
+ * If 'format' is dns_masterformat_raw, then 'header' can contain
+ * information to be written to the file header.
*
* Temporary dynamic memory may be allocated from 'mctx'.
*
@@ -329,6 +358,12 @@ dns_master_stylecreate(dns_master_style_t **style, unsigned int flags,
unsigned int line_length, unsigned int tab_width,
isc_mem_t *mctx);
+isc_result_t
+dns_master_stylecreate2(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,
+ unsigned int split_width, isc_mem_t *mctx);
void
dns_master_styledestroy(dns_master_style_t **style, isc_mem_t *mctx);
diff --git a/lib/dns/include/dns/nsec.h b/lib/dns/include/dns/nsec.h
index 510d96b..440ee4e 100644
--- a/lib/dns/include/dns/nsec.h
+++ b/lib/dns/include/dns/nsec.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2008, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2008, 2011, 2012 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
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: nsec.h,v 1.14 2011/06/10 23:47:32 tbox Exp $ */
#ifndef DNS_NSEC_H
#define DNS_NSEC_H 1
@@ -69,12 +69,35 @@ 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.
+ * algorithms are assumed to support NSEC3. If DNSKEY is not found,
+ * *answer is set to ISC_FALSE, and ISC_R_NOTFOUND is returned.
*
* Requires:
* 'answer' to be non NULL.
*/
+unsigned int
+dns_nsec_compressbitmap(unsigned char *map, const unsigned char *raw,
+ unsigned int max_type);
+/*%<
+ * Convert a raw bitmap into a compressed windowed bit map. 'map' and 'raw'
+ * may overlap.
+ *
+ * Returns the length of the compressed windowed bit map.
+ */
+
+void
+dns_nsec_setbit(unsigned char *array, unsigned int type, unsigned int bit);
+/*%<
+ * Set type bit in raw 'array' to 'bit'.
+ */
+
+isc_boolean_t
+dns_nsec_isset(const unsigned char *array, unsigned int type);
+/*%<
+ * Test if the corresponding 'type' bit is set in 'array'.
+ */
+
isc_result_t
dns_nsec_noexistnodata(dns_rdatatype_t type, dns_name_t *name,
dns_name_t *nsecname, dns_rdataset_t *nsecset,
diff --git a/lib/dns/include/dns/nsec3.h b/lib/dns/include/dns/nsec3.h
index 588dd05..e4a2286 100644
--- a/lib/dns/include/dns/nsec3.h
+++ b/lib/dns/include/dns/nsec3.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2010, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2008-2012 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
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: nsec3.h,v 1.14 2011/10/28 12:20:31 tbox Exp $ */
#ifndef DNS_NSEC3_H
#define DNS_NSEC3_H 1
@@ -241,7 +241,8 @@ dns_nsec3param_toprivate(dns_rdata_t *src, dns_rdata_t *target,
isc_result_t
dns_nsec3param_deletechains(dns_db_t *db, dns_dbversion_t *ver,
- dns_zone_t *zone, dns_diff_t *diff);
+ dns_zone_t *zone, isc_boolean_t nonsec,
+ dns_diff_t *diff);
/*%<
* Mark NSEC3PARAM for deletion.
diff --git a/lib/dns/include/dns/private.h b/lib/dns/include/dns/private.h
index 7bc59b2..c4a2ae6 100644
--- a/lib/dns/include/dns/private.h
+++ b/lib/dns/include/dns/private.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2009, 2011, 2012 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
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: private.h,v 1.5 2011/10/28 12:20:31 tbox Exp $ */
#include <isc/lang.h>
#include <isc/types.h>
@@ -50,6 +50,23 @@ dns_private_chains(dns_db_t *db, dns_dbversion_t *ver,
* \li other on error
*/
+isc_result_t
+dns_private_totext(dns_rdata_t *privaterdata, isc_buffer_t *buffer);
+/*%<
+ * Convert a private-type RR 'privaterdata' to human-readable form,
+ * and place the result in 'buffer'. The text should indicate
+ * which action the private-type record specifies and whether the
+ * action has been completed.
+ *
+ * Requires:
+ * \li 'privaterdata' is a valid rdata containing at least five bytes
+ * \li 'buffer' is a valid buffer
+ *
+ * Returns:
+ * \li ISC_R_SUCCESS
+ * \li other on error
+ */
+
ISC_LANG_ENDDECLS
#endif
diff --git a/lib/dns/include/dns/rdata.h b/lib/dns/include/dns/rdata.h
index 2a67dc9..89ecaf8 100644
--- a/lib/dns/include/dns/rdata.h
+++ b/lib/dns/include/dns/rdata.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2009, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: rdata.h,v 1.80 2011/03/20 02:31:53 marka Exp $ */
#ifndef DNS_RDATA_H
#define DNS_RDATA_H 1
@@ -169,6 +169,7 @@ struct dns_rdata {
/*% Output explanatory comments. */
#define DNS_STYLEFLAG_COMMENT 0x00000002U
+#define DNS_STYLEFLAG_RRCOMMENT 0x00000004U
#define DNS_RDATA_DOWNCASE DNS_NAME_DOWNCASE
#define DNS_RDATA_CHECKNAMES DNS_NAME_CHECKNAMES
@@ -435,8 +436,8 @@ dns_rdata_totext(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target);
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);
+ unsigned int width, unsigned int split_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();
@@ -458,6 +459,11 @@ dns_rdata_tofmttext(dns_rdata_t *rdata, dns_name_t *origin, unsigned int flags,
* comments next to things like the SOA timer fields. Some
* comments (e.g., the SOA ones) are only printed when multiline
* output is selected.
+ *
+ * base64 rdata text (e.g., DNSKEY records) will be split into chunks
+ * of 'split_width' characters. If split_width == 0, the text will
+ * not be split at all. If split_width == UINT_MAX (0xffffffff), then
+ * it is undefined and falls back to the default value of 'width'
*/
isc_result_t
diff --git a/lib/dns/include/dns/rdataset.h b/lib/dns/include/dns/rdataset.h
index b2b8370..31bcd15 100644
--- a/lib/dns/include/dns/rdataset.h
+++ b/lib/dns/include/dns/rdataset.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: rdataset.h,v 1.72 2011/06/08 22:13:51 each Exp $ */
#ifndef DNS_RDATASET_H
#define DNS_RDATASET_H 1
diff --git a/lib/dns/include/dns/resolver.h b/lib/dns/include/dns/resolver.h
index 7f7d093..095269e 100644
--- a/lib/dns/include/dns/resolver.h
+++ b/lib/dns/include/dns/resolver.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: resolver.h,v 1.72 2011/12/05 17:10:51 each Exp $ */
#ifndef DNS_RESOLVER_H
#define DNS_RESOLVER_H 1
@@ -126,7 +126,8 @@ typedef struct dns_fetchevent {
isc_result_t
dns_resolver_create(dns_view_t *view,
- isc_taskmgr_t *taskmgr, unsigned int ntasks,
+ isc_taskmgr_t *taskmgr,
+ unsigned int ntasks, unsigned int ndisp,
isc_socketmgr_t *socketmgr,
isc_timermgr_t *timermgr,
unsigned int options,
@@ -155,9 +156,11 @@ dns_resolver_create(dns_view_t *view,
*
*\li 'timermgr' is a valid timer manager.
*
- *\li 'dispatchv4' is a valid dispatcher with an IPv4 UDP socket, or is NULL.
+ *\li 'dispatchv4' is a dispatch with an IPv4 UDP socket, or is NULL.
+ * If not NULL, 'ndisp' clones of it will be created by the resolver.
*
- *\li 'dispatchv6' is a valid dispatcher with an IPv6 UDP socket, or is NULL.
+ *\li 'dispatchv6' is a dispatch with an IPv6 UDP socket, or is NULL.
+ * If not NULL, 'ndisp' clones of it will be created by the resolver.
*
*\li resp != NULL && *resp == NULL.
*
diff --git a/lib/dns/include/dns/result.h b/lib/dns/include/dns/result.h
index 9a7d2c2..12aacf9 100644
--- a/lib/dns/include/dns/result.h
+++ b/lib/dns/include/dns/result.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: result.h,v 1.123 2011/03/21 07:22:14 each Exp $ */
#ifndef DNS_RESULT_H
#define DNS_RESULT_H 1
diff --git a/lib/dns/include/dns/rpz.h b/lib/dns/include/dns/rpz.h
index ceea26d..e1d50a5 100644
--- a/lib/dns/include/dns/rpz.h
+++ b/lib/dns/include/dns/rpz.h
@@ -16,6 +16,7 @@
/* $Id$ */
+
#ifndef DNS_RPZ_H
#define DNS_RPZ_H 1
diff --git a/lib/dns/include/dns/rriterator.h b/lib/dns/include/dns/rriterator.h
index a3e8e47..c979f22 100644
--- a/lib/dns/include/dns/rriterator.h
+++ b/lib/dns/include/dns/rriterator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2009, 2011 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
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: rriterator.h,v 1.4 2011/11/01 23:47:00 tbox Exp $ */
#ifndef DNS_RRITERATOR_H
#define DNS_RRITERATOR_H 1
diff --git a/lib/dns/include/dns/sdb.h b/lib/dns/include/dns/sdb.h
index c57c4a1..2751903 100644
--- a/lib/dns/include/dns/sdb.h
+++ b/lib/dns/include/dns/sdb.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2007, 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2007, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: sdb.h,v 1.25 2011/10/11 23:46:45 tbox Exp $ */
#ifndef DNS_SDB_H
#define DNS_SDB_H 1
@@ -35,6 +35,7 @@
#include <isc/lang.h>
+#include <dns/clientinfo.h>
#include <dns/types.h>
/***
@@ -58,10 +59,14 @@ 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 *);
+ dns_sdblookup_t *lookup,
+ dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo);
typedef isc_result_t
(*dns_sdblookup2func_t)(const dns_name_t *zone, const dns_name_t *name,
- void *dbdata, dns_sdblookup_t *lookup);
+ void *dbdata, dns_sdblookup_t *lookup,
+ dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo);
typedef isc_result_t
(*dns_sdbauthorityfunc_t)(const char *zone, void *dbdata, dns_sdblookup_t *);
diff --git a/lib/dns/include/dns/sdlz.h b/lib/dns/include/dns/sdlz.h
index 375a99a..fbc6b95 100644
--- a/lib/dns/include/dns/sdlz.h
+++ b/lib/dns/include/dns/sdlz.h
@@ -57,6 +57,7 @@
#ifndef SDLZ_H
#define SDLZ_H 1
+#include <dns/clientinfo.h>
#include <dns/dlz.h>
ISC_LANG_BEGINDECLS
@@ -182,18 +183,23 @@ typedef isc_result_t
typedef isc_result_t
(*dns_sdlzlookupfunc_t)(const char *zone, const char *name, void *driverarg,
- void *dbdata, dns_sdlzlookup_t *lookup);
+ void *dbdata, dns_sdlzlookup_t *lookup,
+ dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo);
/*%<
* 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
+ * 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 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.
+ * authority function is required.
+ *
+ * The 'methods' and 'clientinfo' args allow an SDLZ driver to retrieve
+ * information about the querying client (such as source IP address)
+ * from the caller.
*/
typedef isc_result_t (*dns_sdlznewversion_t)(const char *zone,
diff --git a/lib/dns/include/dns/time.h b/lib/dns/include/dns/time.h
index b646ba8..6a59c8a 100644
--- a/lib/dns/include/dns/time.h
+++ b/lib/dns/include/dns/time.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: time.h,v 1.19 2012/01/27 23:46:58 tbox Exp $ */
#ifndef DNS_TIME_H
#define DNS_TIME_H 1
diff --git a/lib/dns/include/dns/types.h b/lib/dns/include/dns/types.h
index a031825..76167c2 100644
--- a/lib/dns/include/dns/types.h
+++ b/lib/dns/include/dns/types.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2010, 2012, 2013 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -65,6 +65,7 @@ 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_dispatchset dns_dispatchset_t;
typedef struct dns_dispatchmgr dns_dispatchmgr_t;
typedef struct dns_dispentry dns_dispentry_t;
typedef struct dns_dns64 dns_dns64_t;
@@ -86,6 +87,7 @@ 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_masterrawheader dns_masterrawheader_t;
typedef struct dns_message dns_message_t;
typedef isc_uint16_t dns_messageid_t;
typedef isc_region_t dns_label_t;
@@ -333,6 +335,20 @@ typedef enum {
dns_severity_fail
} dns_severity_t;
+/*%
+ * DNS Serial Number Update Method.
+ *
+ * \li _increment: Add one to the current serial, skipping 0.
+ * \li _unixtime: Set to the seconds since 00:00 Jan 1, 1970,
+ * if possible.
+ * \li _yyyymmvv: Set to Year, Month, Version, if possible.
+ * (Not yet implemented)
+ */
+typedef enum {
+ dns_updatemethod_increment = 0,
+ dns_updatemethod_unixtime
+} dns_updatemethod_t;
+
/*
* Functions.
*/
@@ -342,6 +358,9 @@ typedef void
typedef void
(*dns_loaddonefunc_t)(void *, isc_result_t);
+typedef void
+(*dns_rawdatafunc_t)(dns_zone_t *, dns_masterrawheader_t *);
+
typedef isc_result_t
(*dns_addrdatasetfunc_t)(void *, dns_name_t *, dns_rdataset_t *);
diff --git a/lib/dns/include/dns/update.h b/lib/dns/include/dns/update.h
new file mode 100644
index 0000000..2d2c491
--- /dev/null
+++ b/lib/dns/include/dns/update.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2011 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: update.h,v 1.5 2011/08/30 23:46:53 tbox Exp $ */
+
+#ifndef DNS_UPDATE_H
+#define DNS_UPDATE_H 1
+
+/*! \file dns/update.h */
+
+/***
+ *** Imports
+ ***/
+
+#include <isc/lang.h>
+
+#include <dns/types.h>
+#include <dns/diff.h>
+
+typedef struct {
+ void (*func)(void *arg, dns_zone_t *zone, int level,
+ const char *message);
+ void *arg;
+} dns_update_log_t;
+
+ISC_LANG_BEGINDECLS
+
+/***
+ *** Functions
+ ***/
+
+isc_uint32_t
+dns_update_soaserial(isc_uint32_t serial, dns_updatemethod_t method);
+/*%<
+ * Return the next serial number after 'serial', depending on the
+ * update method 'method':
+ *
+ *\li * dns_updatemethod_increment increments the serial number by one
+ *\li * dns_updatemethod_unixtime sets the serial number to the current
+ * time (seconds since UNIX epoch) if possible, or increments by one
+ * if not.
+ */
+
+isc_result_t
+dns_update_signatures(dns_update_log_t *log, dns_zone_t *zone, dns_db_t *db,
+ dns_dbversion_t *oldver, dns_dbversion_t *newver,
+ dns_diff_t *diff, isc_uint32_t sigvalidityinterval);
+
+ISC_LANG_ENDDECLS
+
+#endif /* DNS_UPDATE_H */
diff --git a/lib/dns/include/dns/view.h b/lib/dns/include/dns/view.h
index d999fa1..d0c1931 100644
--- a/lib/dns/include/dns/view.h
+++ b/lib/dns/include/dns/view.h
@@ -76,6 +76,7 @@
#include <dns/rdatastruct.h>
#include <dns/rpz.h>
#include <dns/types.h>
+#include <dns/zt.h>
ISC_LANG_BEGINDECLS
@@ -141,7 +142,6 @@ struct dns_view {
dns_rbt_t * answeracl_exclude;
dns_rbt_t * denyanswernames;
dns_rbt_t * answernames_exclude;
- isc_boolean_t requestixfr;
isc_boolean_t provideixfr;
isc_boolean_t requestnsid;
dns_ttl_t maxcachettl;
@@ -157,6 +157,7 @@ struct dns_view {
dns_name_t * dlv;
dns_fixedname_t dlv_fixed;
isc_uint16_t maxudp;
+ unsigned int maxbits;
dns_v4_aaaa_t v4_aaaa;
dns_acl_t * v4_aaaa_acl;
dns_dns64list_t dns64;
@@ -185,6 +186,7 @@ struct dns_view {
dns_viewlist_t * viewlist;
dns_zone_t * managed_keys;
+ dns_zone_t * redirect;
#ifdef BIND9
/* File in which to store configuration for newly added zones */
@@ -312,7 +314,8 @@ dns_view_weakdetach(dns_view_t **targetp);
isc_result_t
dns_view_createresolver(dns_view_t *view,
- isc_taskmgr_t *taskmgr, unsigned int ntasks,
+ isc_taskmgr_t *taskmgr,
+ unsigned int ntasks, unsigned int ndisp,
isc_socketmgr_t *socketmgr,
isc_timermgr_t *timermgr,
unsigned int options,
@@ -730,14 +733,21 @@ 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);
+
+isc_result_t
+dns_view_asyncload(dns_view_t *view, dns_zt_allloaded_t callback, void *arg);
/*%<
* 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.
*
+ * dns_view_asyncload() loads zones asynchronously. When all zones
+ * in the view have finished loading, 'callback' is called with argument
+ * 'arg' to inform the caller.
+ *
* If 'stop' is ISC_TRUE, stop on the first error and return it.
- * If 'stop' is ISC_FALSE, ignore errors.
+ * If 'stop' is ISC_FALSE (or we are loading asynchronously), ignore errors.
*
* Requires:
*
@@ -841,9 +851,31 @@ dns_view_flushcache2(dns_view_t *view, isc_boolean_t fixuponly);
*/
isc_result_t
-dns_view_flushname(dns_view_t *view, dns_name_t *);
+dns_view_flushnode(dns_view_t *view, dns_name_t *name, isc_boolean_t tree);
/*%<
- * Flush the given name from the view's cache (and ADB).
+ * Flush the given name from the view's cache (and optionally ADB/badcache).
+ *
+ * If 'tree' is true, flush 'name' and all names below it
+ * from the cache, but do not flush ADB.
+ *
+ * If 'tree' is false, flush 'name' frmo both the cache and ADB,
+ * but do not touch any other nodes.
+ *
+ * Requires:
+ *\li 'view' is valid.
+ *\li 'name' is valid.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS
+ * other returns are failures.
+ */
+
+isc_result_t
+dns_view_flushname(dns_view_t *view, dns_name_t *name);
+/*%<
+ * Flush the given name from the view's cache, ADB and badcache.
+ * Equivalent to dns_view_flushnode(view, name, ISC_FALSE).
+ *
*
* Requires:
*\li 'view' is valid.
@@ -859,7 +891,6 @@ 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.
diff --git a/lib/dns/include/dns/zone.h b/lib/dns/include/dns/zone.h
index 6b9911d..f91801f 100644
--- a/lib/dns/include/dns/zone.h
+++ b/lib/dns/include/dns/zone.h
@@ -32,10 +32,12 @@
#include <isc/lang.h>
#include <isc/rwlock.h>
+#include <dns/master.h>
#include <dns/masterdump.h>
#include <dns/rdatastruct.h>
#include <dns/rpz.h>
#include <dns/types.h>
+#include <dns/zt.h>
typedef enum {
dns_zone_none,
@@ -44,9 +46,16 @@ typedef enum {
dns_zone_stub,
dns_zone_staticstub,
dns_zone_key,
- dns_zone_dlz
+ dns_zone_dlz,
+ dns_zone_redirect
} dns_zonetype_t;
+typedef enum {
+ dns_zonestat_none = 0,
+ dns_zonestat_terse,
+ dns_zonestat_full
+} dns_zonestat_level_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 */
@@ -94,6 +103,7 @@ typedef enum {
#define DNS_ZONEKEY_MAINTAIN 0x00000002U /*%< publish/sign on schedule */
#define DNS_ZONEKEY_CREATE 0x00000004U /*%< make keys when needed */
#define DNS_ZONEKEY_FULLSIGN 0x00000008U /*%< roll to new keys immediately */
+#define DNS_ZONEKEY_NORESIGN 0x00000010U /*%< no automatic resigning */
#ifndef DNS_ZONE_MINREFRESH
#define DNS_ZONE_MINREFRESH 300 /*%< 5 minutes */
@@ -287,6 +297,7 @@ dns_zone_loadnew(dns_zone_t *zone);
isc_result_t
dns_zone_loadandthaw(dns_zone_t *zone);
+
/*%<
* Cause the database to be loaded from its backing store.
* Confirm that the minimum requirements for the zone type are
@@ -311,6 +322,25 @@ dns_zone_loadandthaw(dns_zone_t *zone);
*\li Any result value from dns_db_load().
*/
+isc_result_t
+dns_zone_asyncload(dns_zone_t *zone, dns_zt_zoneloaded_t done, void *arg);
+/*%<
+ * Cause the database to be loaded from its backing store asynchronously.
+ * Other zone maintenance functions are suspended until this is complete.
+ * When finished, 'done' is called to inform the caller, with 'arg' as
+ * its first argument and 'zone' as its second. (Normally, 'arg' is
+ * expected to point to the zone table but is left undefined for testing
+ * purposes.)
+ */
+
+isc_boolean_t
+dns__zone_loadpending(dns_zone_t *zone);
+/*%<
+ * Indicates whether the zone is waiting to be loaded asynchronously.
+ * (Not currently intended for use outside of this module and associated
+ * tests.)
+ */
+
void
dns_zone_attach(dns_zone_t *source, dns_zone_t **target);
/*%<
@@ -489,6 +519,10 @@ 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);
+isc_result_t
+dns_zone_dumptostream3(dns_zone_t *zone, FILE *fd, dns_masterformat_t format,
+ const dns_master_style_t *style,
+ const isc_uint32_t rawversion);
/*%<
* Write the zone to stream 'fd' in the specified 'format'.
* If the 'format' is dns_masterformat_text (RFC1035), 'style' also
@@ -498,7 +532,11 @@ dns_zone_dumptostream2(dns_zone_t *zone, FILE *fd, dns_masterformat_t format,
* 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
+ * dns_zone_dumptostream2() is a backward-compatible form of
+ * dns_zone_dumptostream3(), which always uses the current
+ * default raw file format version.
+ *
+ * Note that dns_zone_dumptostream3() is the most flexible form. It
* can also provide the functionality of dns_zone_fulldumptostream().
*
* Require:
@@ -558,10 +596,16 @@ dns_zone_setmasterswithkeys(dns_zone_t *zone,
isc_result_t
dns_zone_setalsonotify(dns_zone_t *zone, const isc_sockaddr_t *notify,
isc_uint32_t count);
+isc_result_t
+dns_zone_setalsonotifywithkeys(dns_zone_t *zone, const isc_sockaddr_t *notify,
+ dns_name_t **keynames, isc_uint32_t count);
/*%<
* Set the list of additional servers to be notified when
* a zone changes. To clear the list use 'count = 0'.
*
+ * dns_zone_alsonotifywithkeys() allows each notify address to
+ * be associated with a TSIG key.
+ *
* Require:
*\li 'zone' to be a valid zone.
*\li 'notify' to be non-NULL if count != 0.
@@ -1405,6 +1449,18 @@ dns_zonemgr_setsize(dns_zonemgr_t *zmgr, int num_zones);
*/
isc_result_t
+dns_zonemgr_createzone(dns_zonemgr_t *zmgr, dns_zone_t **zonep);
+/*%<
+ * Allocate a new zone using a memory context from the
+ * zone manager's memory context pool.
+ *
+ * Require:
+ *\li 'zmgr' to be a valid zone manager.
+ *\li 'zonep' != NULL and '*zonep' == NULL.
+ */
+
+
+isc_result_t
dns_zonemgr_managezone(dns_zonemgr_t *zmgr, dns_zone_t *zone);
/*%<
* Bring the zone under control of a zone manager.
@@ -1422,6 +1478,14 @@ dns_zonemgr_forcemaint(dns_zonemgr_t *zmgr);
*/
void
+dns__zonemgr_run(isc_task_t *task, isc_event_t *event);
+/*%<
+ * Event handler to call dns_zonemgr_forcemaint(); used to start
+ * zone operations from a unit test. Not intended for use outside
+ * libdns or related tests.
+ */
+
+void
dns_zonemgr_resumexfrs(dns_zonemgr_t *zmgr);
/*%<
* Attempt to start any stalled zone transfers.
@@ -1647,9 +1711,13 @@ dns_zone_setstats(dns_zone_t *zone, isc_stats_t *stats);
void
dns_zone_setrequeststats(dns_zone_t *zone, isc_stats_t *stats);
+
+void
+dns_zone_setrcvquerystats(dns_zone_t *zone, dns_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.
+ * Set additional statistics sets to zone. These are attached to the zone
+ * but are not counted in the zone module; only the caller updates the
+ * counters.
*
* Requires:
* \li 'zone' to be a valid zone.
@@ -1657,8 +1725,19 @@ dns_zone_setrequeststats(dns_zone_t *zone, isc_stats_t *stats);
*\li stats is a valid statistics.
*/
+#ifdef NEWSTATS
+void
+dns_zone_setrcvquerystats(dns_zone_t *zone, dns_stats_t *stats);
+#endif
+
isc_stats_t *
dns_zone_getrequeststats(dns_zone_t *zone);
+
+#ifdef NEWSTATS
+dns_stats_t *
+dns_zone_getrcvquerystats(dns_zone_t *zone);
+#endif
+
/*%<
* Get the additional statistics for zone, if one is installed.
*
@@ -1893,6 +1972,107 @@ dns_zone_dlzpostload(dns_zone_t *zone, dns_db_t *db);
* Load the origin names for a writeable DLZ database.
*/
+isc_boolean_t
+dns_zone_isdynamic(dns_zone_t *zone, isc_boolean_t ignore_freeze);
+/*%
+ * Return true iff the zone is "dynamic", in the sense that the zone's
+ * master file (if any) is written by the server, rather than being
+ * updated manually and read by the server.
+ *
+ * This is true for slave zones, stub zones, key zones, and zones that
+ * allow dynamic updates either by having an update policy ("ssutable")
+ * or an "allow-update" ACL with a value other than exactly "{ none; }".
+ *
+ * If 'ignore_freeze' is true, then the zone which has had updates disabled
+ * will still report itself to be dynamic.
+ *
+ * Requires:
+ * \li 'zone' to be valid.
+ */
+
+isc_result_t
+dns_zone_setrefreshkeyinterval(dns_zone_t *zone, isc_uint32_t interval);
+/*%
+ * Sets the frequency, in minutes, with which the key repository will be
+ * checked to see if the keys for this zone have been updated. Any value
+ * higher than 1440 minutes (24 hours) will be silently reduced. A
+ * value of zero will return an out-of-range error.
+ *
+ * Requires:
+ * \li 'zone' to be valid.
+ */
+
+isc_boolean_t
+dns_zone_getrequestixfr(dns_zone_t *zone);
+/*%
+ * Returns the true/false value of the request-ixfr option in the zone.
+ *
+ * Requires:
+ * \li 'zone' to be valid.
+ */
+
+void
+dns_zone_setrequestixfr(dns_zone_t *zone, isc_boolean_t flag);
+/*%
+ * Sets the request-ixfr option for the zone. Either true or false. The
+ * default value is determined by the setting of this option in the view.
+ *
+ * Requires:
+ * \li 'zone' to be valid.
+ */
+
+void
+dns_zone_setserialupdatemethod(dns_zone_t *zone, dns_updatemethod_t method);
+/*%
+ * Sets the update method to use when incrementing the zone serial number
+ * due to a DDNS update. Valid options are dns_updatemethod_increment
+ * and dns_updatemethod_unixtime.
+ *
+ * Requires:
+ * \li 'zone' to be valid.
+ */
+
+dns_updatemethod_t
+dns_zone_getserialupdatemethod(dns_zone_t *zone);
+/*%
+ * Returns the update method to be used when incrementing the zone serial
+ * number due to a DDNS update.
+ *
+ * Requires:
+ * \li 'zone' to be valid.
+ */
+
+isc_result_t
+dns_zone_link(dns_zone_t *zone, dns_zone_t *raw);
+
+void
+dns_zone_getraw(dns_zone_t *zone, dns_zone_t **raw);
+
+isc_result_t
+dns_zone_keydone(dns_zone_t *zone, const char *data);
+
+isc_result_t
+dns_zone_setnsec3param(dns_zone_t *zone, isc_uint8_t hash, isc_uint8_t flags,
+ isc_uint16_t iter, isc_uint8_t saltlen,
+ unsigned char *salt, isc_boolean_t replace);
+/*%
+ * Set the NSEC3 parameters for the zone.
+ *
+ * If 'replace' is ISC_TRUE, then the existing NSEC3 chain, if any, will
+ * be replaced with the new one. If 'hash' is zero, then the replacement
+ * chain will be NSEC rather than NSEC3.
+ *
+ * Requires:
+ * \li 'zone' to be valid.
+ */
+
+void
+dns_zone_setrawdata(dns_zone_t *zone, dns_masterrawheader_t *header);
+/*%
+ * Set the data to be included in the header when the zone is dumped in
+ * binary format.
+ */
+
isc_result_t
dns_zone_synckeyzone(dns_zone_t *zone);
/*%
@@ -1909,6 +2089,16 @@ dns_zone_rpz_enable(dns_zone_t *zone);
isc_boolean_t
dns_zone_get_rpz(dns_zone_t *zone);
+void
+dns_zone_setstatlevel(dns_zone_t *zone, dns_zonestat_level_t level);
+
+dns_zonestat_level_t
+dns_zone_getstatlevel(dns_zone_t *zone);
+/*%
+ * Set and get the statistics reporting level for the zone;
+ * full, terse, or none.
+ */
+
ISC_LANG_ENDDECLS
#endif /* DNS_ZONE_H */
diff --git a/lib/dns/include/dns/zt.h b/lib/dns/include/dns/zt.h
index 7d1e8bf..f91d7e8 100644
--- a/lib/dns/include/dns/zt.h
+++ b/lib/dns/include/dns/zt.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2007, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2007, 2011 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: zt.h,v 1.40 2011/09/02 23:46:32 tbox Exp $ */
#ifndef DNS_ZT_H
#define DNS_ZT_H 1
@@ -30,6 +30,21 @@
ISC_LANG_BEGINDECLS
+typedef isc_result_t
+(*dns_zt_allloaded_t)(void *arg);
+/*%<
+ * Method prototype: when all pending zone loads are complete,
+ * the zone table can inform the caller via a callback function with
+ * this signature.
+ */
+
+typedef isc_result_t
+(*dns_zt_zoneloaded_t)(dns_zt_t *zt, dns_zone_t *zone, isc_task_t *task);
+/*%<
+ * Method prototype: when a zone finishes loading, the zt object
+ * can be informed via a callback function with this signature.
+ */
+
isc_result_t
dns_zt_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, dns_zt_t **zt);
/*%<
@@ -134,6 +149,9 @@ 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);
+
+isc_result_t
+dns_zt_asyncload(dns_zt_t *zt, dns_zt_allloaded_t alldone, void *arg);
/*%<
* Load all zones in the table. If 'stop' is ISC_TRUE,
* stop on the first error and return it. If 'stop'
@@ -142,6 +160,10 @@ dns_zt_loadnew(dns_zt_t *zt, isc_boolean_t stop);
* 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.
+ * dns_zt_asyncload() loads zones asynchronously; when all
+ * zones in the zone table have finished loaded (or failed due
+ * to errors), the caller is informed by calling 'alldone'
+ * with an argument of 'arg'.
*
* Requires:
* \li 'zt' to be valid
@@ -178,6 +200,16 @@ dns_zt_apply2(dns_zt_t *zt, isc_boolean_t stop, isc_result_t *sub,
* any error code from 'action'.
*/
+isc_boolean_t
+dns_zt_loadspending(dns_zt_t *zt);
+/*%<
+ * Returns ISC_TRUE if and only if there are zones still waiting to
+ * be loaded in zone table 'zt'.
+ *
+ * Requires:
+ * \li 'zt' to be valid.
+ */
+
ISC_LANG_ENDDECLS
#endif /* DNS_ZT_H */
diff --git a/lib/dns/include/dst/dst.h b/lib/dns/include/dst/dst.h
index 87d844b..4724fc6 100644
--- a/lib/dns/include/dst/dst.h
+++ b/lib/dns/include/dst/dst.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
+/* $Id: dst.h,v 1.34 2011/10/20 21:20:02 marka Exp $ */
#ifndef DST_DST_H
#define DST_DST_H 1
@@ -239,9 +239,16 @@ dst_context_sign(dst_context_t *dctx, isc_buffer_t *sig);
isc_result_t
dst_context_verify(dst_context_t *dctx, isc_region_t *sig);
+
+isc_result_t
+dst_context_verify2(dst_context_t *dctx, unsigned int maxbits,
+ isc_region_t *sig);
/*%<
* Verifies the signature using the data and key stored in the context.
*
+ * 'maxbits' specifies the maximum number of bits permitted in the RSA
+ * exponent.
+ *
* Requires:
* \li "dctx" is a valid context.
* \li "sig" is a valid region.
@@ -498,6 +505,14 @@ dst_key_fromgssapi(dns_name_t *name, gss_ctx_id_t gssctx, isc_mem_t *mctx,
* the context id.
*/
+#ifdef DST_KEY_INTERNAL
+isc_result_t
+dst_key_buildinternal(dns_name_t *name, unsigned int alg,
+ unsigned int bits, unsigned int flags,
+ unsigned int protocol, dns_rdataclass_t rdclass,
+ void *data, isc_mem_t *mctx, dst_key_t **keyp);
+#endif
+
isc_result_t
dst_key_fromlabel(dns_name_t *name, int alg, unsigned int flags,
unsigned int protocol, dns_rdataclass_t rdclass,
@@ -518,6 +533,7 @@ dst_key_generate2(dns_name_t *name, unsigned int alg,
dns_rdataclass_t rdclass,
isc_mem_t *mctx, dst_key_t **keyp,
void (*callback)(int));
+
/*%<
* Generate a DST key (or keypair) with the supplied parameters. The
* interpretation of the "param" field depends on the algorithm:
@@ -748,6 +764,26 @@ dst_key_setbits(dst_key_t *key, isc_uint16_t bits);
* "key" is a valid key.
*/
+void
+dst_key_setttl(dst_key_t *key, dns_ttl_t ttl);
+/*%<
+ * Set the default TTL to use when converting the key
+ * to a KEY or DNSKEY RR.
+ *
+ * Requires:
+ * "key" is a valid key.
+ */
+
+dns_ttl_t
+dst_key_getttl(const dst_key_t *key);
+/*%<
+ * Get the default TTL to use when converting the key
+ * to a KEY or DNSKEY RR.
+ *
+ * Requires:
+ * "key" is a valid key.
+ */
+
isc_result_t
dst_key_setflags(dst_key_t *key, isc_uint32_t flags);
/*
OpenPOWER on IntegriCloud