2 * Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (C) 1999-2003 Internet Software Consortium.
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 * PERFORMANCE OF THIS SOFTWARE.
23 /*! \file dns/zone.h */
31 #include <isc/formatcheck.h>
33 #include <isc/rwlock.h>
35 #include <dns/master.h>
36 #include <dns/masterdump.h>
37 #include <dns/rdatastruct.h>
39 #include <dns/types.h>
54 dns_zonestat_none = 0,
57 } dns_zonestat_level_t;
59 #define DNS_ZONEOPT_SERVERS 0x00000001U /*%< perform server checks */
60 #define DNS_ZONEOPT_PARENTS 0x00000002U /*%< perform parent checks */
61 #define DNS_ZONEOPT_CHILDREN 0x00000004U /*%< perform child checks */
62 #define DNS_ZONEOPT_NOTIFY 0x00000008U /*%< perform NOTIFY */
63 #define DNS_ZONEOPT_MANYERRORS 0x00000010U /*%< return many errors on load */
64 #define DNS_ZONEOPT_IXFRFROMDIFFS 0x00000020U /*%< calculate differences */
65 #define DNS_ZONEOPT_NOMERGE 0x00000040U /*%< don't merge journal */
66 #define DNS_ZONEOPT_CHECKNS 0x00000080U /*%< check if NS's are addresses */
67 #define DNS_ZONEOPT_FATALNS 0x00000100U /*%< DNS_ZONEOPT_CHECKNS is fatal */
68 #define DNS_ZONEOPT_MULTIMASTER 0x00000200U /*%< this zone has multiple masters */
69 #define DNS_ZONEOPT_USEALTXFRSRC 0x00000400U /*%< use alternate transfer sources */
70 #define DNS_ZONEOPT_CHECKNAMES 0x00000800U /*%< check-names */
71 #define DNS_ZONEOPT_CHECKNAMESFAIL 0x00001000U /*%< fatal check-name failures */
72 #define DNS_ZONEOPT_CHECKWILDCARD 0x00002000U /*%< check for internal wildcards */
73 #define DNS_ZONEOPT_CHECKMX 0x00004000U /*%< check-mx */
74 #define DNS_ZONEOPT_CHECKMXFAIL 0x00008000U /*%< fatal check-mx failures */
75 #define DNS_ZONEOPT_CHECKINTEGRITY 0x00010000U /*%< perform integrity checks */
76 #define DNS_ZONEOPT_CHECKSIBLING 0x00020000U /*%< perform sibling glue checks */
77 #define DNS_ZONEOPT_NOCHECKNS 0x00040000U /*%< disable IN NS address checks */
78 #define DNS_ZONEOPT_WARNMXCNAME 0x00080000U /*%< warn on MX CNAME check */
79 #define DNS_ZONEOPT_IGNOREMXCNAME 0x00100000U /*%< ignore MX CNAME check */
80 #define DNS_ZONEOPT_WARNSRVCNAME 0x00200000U /*%< warn on SRV CNAME check */
81 #define DNS_ZONEOPT_IGNORESRVCNAME 0x00400000U /*%< ignore SRV CNAME check */
82 #define DNS_ZONEOPT_UPDATECHECKKSK 0x00800000U /*%< check dnskey KSK flag */
83 #define DNS_ZONEOPT_TRYTCPREFRESH 0x01000000U /*%< try tcp refresh on udp failure */
84 #define DNS_ZONEOPT_NOTIFYTOSOA 0x02000000U /*%< Notify the SOA MNAME */
85 #define DNS_ZONEOPT_NSEC3TESTZONE 0x04000000U /*%< nsec3-test-zone */
86 #define DNS_ZONEOPT_SECURETOINSECURE 0x08000000U /*%< dnssec-secure-to-insecure */
87 #define DNS_ZONEOPT_DNSKEYKSKONLY 0x10000000U /*%< dnssec-dnskey-kskonly */
88 #define DNS_ZONEOPT_CHECKDUPRR 0x20000000U /*%< check-dup-records */
89 #define DNS_ZONEOPT_CHECKDUPRRFAIL 0x40000000U /*%< fatal check-dup-records failures */
90 #define DNS_ZONEOPT_CHECKSPF 0x80000000U /*%< check SPF records */
92 #ifndef NOMINUM_PUBLIC
94 * Nominum specific options build down.
96 #define DNS_ZONEOPT_NOTIFYFORWARD 0x80000000U /* forward notify to master */
97 #endif /* NOMINUM_PUBLIC */
100 * Zone key maintenance options
102 #define DNS_ZONEKEY_ALLOW 0x00000001U /*%< fetch keys on command */
103 #define DNS_ZONEKEY_MAINTAIN 0x00000002U /*%< publish/sign on schedule */
104 #define DNS_ZONEKEY_CREATE 0x00000004U /*%< make keys when needed */
105 #define DNS_ZONEKEY_FULLSIGN 0x00000008U /*%< roll to new keys immediately */
106 #define DNS_ZONEKEY_NORESIGN 0x00000010U /*%< no automatic resigning */
108 #ifndef DNS_ZONE_MINREFRESH
109 #define DNS_ZONE_MINREFRESH 300 /*%< 5 minutes */
111 #ifndef DNS_ZONE_MAXREFRESH
112 #define DNS_ZONE_MAXREFRESH 2419200 /*%< 4 weeks */
114 #ifndef DNS_ZONE_DEFAULTREFRESH
115 #define DNS_ZONE_DEFAULTREFRESH 3600 /*%< 1 hour */
117 #ifndef DNS_ZONE_MINRETRY
118 #define DNS_ZONE_MINRETRY 300 /*%< 5 minutes */
120 #ifndef DNS_ZONE_MAXRETRY
121 #define DNS_ZONE_MAXRETRY 1209600 /*%< 2 weeks */
123 #ifndef DNS_ZONE_DEFAULTRETRY
124 #define DNS_ZONE_DEFAULTRETRY 60 /*%< 1 minute, subject to
125 exponential backoff */
128 #define DNS_ZONESTATE_XFERRUNNING 1
129 #define DNS_ZONESTATE_XFERDEFERRED 2
130 #define DNS_ZONESTATE_SOAQUERY 3
131 #define DNS_ZONESTATE_ANY 4
140 dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx);
142 * Creates a new empty zone and attach '*zonep' to it.
145 *\li 'zonep' to point to a NULL pointer.
146 *\li 'mctx' to be a valid memory context.
149 *\li '*zonep' refers to a valid zone.
154 *\li #ISC_R_UNEXPECTED
158 dns_zone_setclass(dns_zone_t *zone, dns_rdataclass_t rdclass);
160 * Sets the class of a zone. This operation can only be performed
164 *\li 'zone' to be a valid zone.
165 *\li dns_zone_setclass() not to have been called since the zone was
167 *\li 'rdclass' != dns_rdataclass_none.
171 dns_zone_getclass(dns_zone_t *zone);
173 * Returns the current zone class.
176 *\li 'zone' to be a valid zone.
180 dns_zone_getserial2(dns_zone_t *zone, isc_uint32_t *serialp);
183 dns_zone_getserial(dns_zone_t *zone);
185 * Returns the current serial number of the zone. On success, the SOA
186 * serial of the zone will be copied into '*serialp'.
187 * dns_zone_getserial() cannot catch failure cases and is deprecated by
188 * dns_zone_getserial2().
191 *\li 'zone' to be a valid zone.
192 *\li 'serialp' to be non NULL
196 *\li #DNS_R_NOTLOADED zone DB is not loaded
200 dns_zone_settype(dns_zone_t *zone, dns_zonetype_t type);
202 * Sets the zone type. This operation can only be performed once on
206 *\li 'zone' to be a valid zone.
207 *\li dns_zone_settype() not to have been called since the zone was
209 *\li 'type' != dns_zone_none
213 dns_zone_setview(dns_zone_t *zone, dns_view_t *view);
215 * Associate the zone with a view.
218 *\li 'zone' to be a valid zone.
222 dns_zone_getview(dns_zone_t *zone);
224 * Returns the zone's associated view.
227 *\li 'zone' to be a valid zone.
231 dns_zone_setorigin(dns_zone_t *zone, const dns_name_t *origin);
233 * Sets the zones origin to 'origin'.
236 *\li 'zone' to be a valid zone.
237 *\li 'origin' to be non NULL.
245 dns_zone_getorigin(dns_zone_t *zone);
247 * Returns the value of the origin.
250 *\li 'zone' to be a valid zone.
254 dns_zone_setfile(dns_zone_t *zone, const char *file);
257 dns_zone_setfile2(dns_zone_t *zone, const char *file,
258 dns_masterformat_t format);
260 * Sets the name of the master file in the format of 'format' from which
261 * the zone loads its database to 'file'.
263 * For zones that have no associated master file, 'file' will be NULL.
265 * For zones with persistent databases, the file name
266 * setting is ignored.
268 * dns_zone_setfile() is a backward-compatible form of
269 * dns_zone_setfile2(), which always specifies the
270 * dns_masterformat_text (RFC1035) format.
273 *\li 'zone' to be a valid zone.
281 dns_zone_getfile(dns_zone_t *zone);
283 * Gets the name of the zone's master file, if any.
286 *\li 'zone' to be valid initialised zone.
289 *\li Pointer to null-terminated file name, or NULL.
293 dns_zone_load(dns_zone_t *zone);
296 dns_zone_loadnew(dns_zone_t *zone);
299 dns_zone_loadandthaw(dns_zone_t *zone);
302 * Cause the database to be loaded from its backing store.
303 * Confirm that the minimum requirements for the zone type are
304 * met, otherwise DNS_R_BADZONE is returned.
306 * dns_zone_loadnew() only loads zones that are not yet loaded.
307 * dns_zone_load() also loads zones that are already loaded and
308 * and whose master file has changed since the last load.
309 * dns_zone_loadandthaw() is similar to dns_zone_load() but will
310 * also re-enable DNS UPDATEs when the load completes.
313 *\li 'zone' to be a valid zone.
316 *\li #ISC_R_UNEXPECTED
318 *\li DNS_R_CONTINUE Incremental load has been queued.
319 *\li DNS_R_UPTODATE The zone has already been loaded based on
320 * file system timestamps.
322 *\li Any result value from dns_db_load().
326 dns_zone_asyncload(dns_zone_t *zone, dns_zt_zoneloaded_t done, void *arg);
328 * Cause the database to be loaded from its backing store asynchronously.
329 * Other zone maintenance functions are suspended until this is complete.
330 * When finished, 'done' is called to inform the caller, with 'arg' as
331 * its first argument and 'zone' as its second. (Normally, 'arg' is
332 * expected to point to the zone table but is left undefined for testing
337 dns__zone_loadpending(dns_zone_t *zone);
339 * Indicates whether the zone is waiting to be loaded asynchronously.
340 * (Not currently intended for use outside of this module and associated
345 dns_zone_attach(dns_zone_t *source, dns_zone_t **target);
347 * Attach '*target' to 'source' incrementing its external
351 *\li 'zone' to be a valid zone.
352 *\li 'target' to be non NULL and '*target' to be NULL.
356 dns_zone_detach(dns_zone_t **zonep);
358 * Detach from a zone decrementing its external reference count.
359 * If this was the last external reference to the zone it will be
360 * shut down and eventually freed.
363 *\li 'zonep' to point to a valid zone.
367 dns_zone_iattach(dns_zone_t *source, dns_zone_t **target);
369 * Attach '*target' to 'source' incrementing its internal
370 * reference count. This is intended for use by operations
371 * such as zone transfers that need to prevent the zone
372 * object from being freed but not from shutting down.
375 *\li The caller is running in the context of the zone's task.
376 *\li 'zone' to be a valid zone.
377 *\li 'target' to be non NULL and '*target' to be NULL.
381 dns_zone_idetach(dns_zone_t **zonep);
383 * Detach from a zone decrementing its internal reference count.
384 * If there are no more internal or external references to the
385 * zone, it will be freed.
388 *\li The caller is running in the context of the zone's task.
389 *\li 'zonep' to point to a valid zone.
393 dns_zone_setflag(dns_zone_t *zone, unsigned int flags, isc_boolean_t value);
395 * Sets ('value' == 'ISC_TRUE') / clears ('value' == 'IS_FALSE')
396 * zone flags. Valid flag bits are DNS_ZONE_F_*.
399 *\li 'zone' to be a valid zone.
403 dns_zone_getdb(dns_zone_t *zone, dns_db_t **dbp);
405 * Attach '*dbp' to the database to if it exists otherwise
406 * return DNS_R_NOTLOADED.
409 *\li 'zone' to be a valid zone.
410 *\li 'dbp' to be != NULL && '*dbp' == NULL.
418 dns_zone_setdb(dns_zone_t *zone, dns_db_t *db);
420 * Sets the zone database to 'db'.
422 * This function is expected to be used to configure a zone with a
423 * database which is not loaded from a file or zone transfer.
424 * It can be used for a general purpose zone, but right now its use
425 * is limited to static-stub zones to avoid possible undiscovered
426 * problems in the general cases.
429 *\li 'zone' to be a valid zone of static-stub.
430 *\li zone doesn't have a database.
434 dns_zone_setdbtype(dns_zone_t *zone,
435 unsigned int dbargc, const char * const *dbargv);
437 * Sets the database type to dbargv[0] and database arguments
438 * to subsequent dbargv elements.
439 * 'db_type' is not checked to see if it is a valid database type.
442 *\li 'zone' to be a valid zone.
443 *\li 'database' to be non NULL.
444 *\li 'dbargc' to be >= 1
445 *\li 'dbargv' to point to dbargc NULL-terminated strings
453 dns_zone_getdbtype(dns_zone_t *zone, char ***argv, isc_mem_t *mctx);
455 * Returns the current dbtype. isc_mem_free() should be used
456 * to free 'argv' after use.
459 *\li 'zone' to be a valid zone.
460 *\li 'argv' to be non NULL and *argv to be NULL.
461 *\li 'mctx' to be valid.
469 dns_zone_markdirty(dns_zone_t *zone);
471 * Mark a zone as 'dirty'.
474 *\li 'zone' to be a valid zone.
478 dns_zone_expire(dns_zone_t *zone);
480 * Mark the zone as expired. If the zone requires dumping cause it to
481 * be initiated. Set the refresh and retry intervals to there default
482 * values and unload the zone.
485 *\li 'zone' to be a valid zone.
489 dns_zone_refresh(dns_zone_t *zone);
491 * Initiate zone up to date checks. The zone must already be being
495 *\li 'zone' to be a valid zone.
499 dns_zone_flush(dns_zone_t *zone);
501 * Write the zone to database if there are uncommitted changes.
504 *\li 'zone' to be a valid zone.
508 dns_zone_dump(dns_zone_t *zone);
510 * Write the zone to database.
513 *\li 'zone' to be a valid zone.
517 dns_zone_dumptostream(dns_zone_t *zone, FILE *fd);
520 dns_zone_dumptostream2(dns_zone_t *zone, FILE *fd, dns_masterformat_t format,
521 const dns_master_style_t *style);
523 dns_zone_dumptostream3(dns_zone_t *zone, FILE *fd, dns_masterformat_t format,
524 const dns_master_style_t *style,
525 const isc_uint32_t rawversion);
527 * Write the zone to stream 'fd' in the specified 'format'.
528 * If the 'format' is dns_masterformat_text (RFC1035), 'style' also
529 * specifies the file style (e.g., &dns_master_style_default).
531 * dns_zone_dumptostream() is a backward-compatible form of
532 * dns_zone_dumptostream2(), which always uses the dns_masterformat_text
533 * format and the dns_master_style_default style.
535 * dns_zone_dumptostream2() is a backward-compatible form of
536 * dns_zone_dumptostream3(), which always uses the current
537 * default raw file format version.
539 * Note that dns_zone_dumptostream3() is the most flexible form. It
540 * can also provide the functionality of dns_zone_fulldumptostream().
543 *\li 'zone' to be a valid zone.
544 *\li 'fd' to be a stream open for writing.
548 dns_zone_fulldumptostream(dns_zone_t *zone, FILE *fd);
550 * The same as dns_zone_dumptostream, but dumps the zone with
551 * different dump settings (dns_master_style_full).
554 *\li 'zone' to be a valid zone.
555 *\li 'fd' to be a stream open for writing.
559 dns_zone_maintenance(dns_zone_t *zone);
561 * Perform regular maintenance on the zone. This is called as a
562 * result of a zone being managed.
565 *\li 'zone' to be a valid zone.
569 dns_zone_setmasters(dns_zone_t *zone, const isc_sockaddr_t *masters,
572 dns_zone_setmasterswithkeys(dns_zone_t *zone,
573 const isc_sockaddr_t *masters,
574 dns_name_t **keynames,
577 * Set the list of master servers for the zone.
580 *\li 'zone' to be a valid zone.
581 *\li 'masters' array of isc_sockaddr_t with port set or NULL.
582 *\li 'count' the number of masters.
583 *\li 'keynames' array of dns_name_t's for tsig keys or NULL.
585 * \li dns_zone_setmasters() is just a wrapper to setmasterswithkeys(),
586 * passing NULL in the keynames field.
588 * \li If 'masters' is NULL then 'count' must be zero.
593 *\li Any result dns_name_dup() can return, if keynames!=NULL
597 dns_zone_setalsonotify(dns_zone_t *zone, const isc_sockaddr_t *notify,
600 dns_zone_setalsonotifywithkeys(dns_zone_t *zone, const isc_sockaddr_t *notify,
601 dns_name_t **keynames, isc_uint32_t count);
603 * Set the list of additional servers to be notified when
604 * a zone changes. To clear the list use 'count = 0'.
606 * dns_zone_alsonotifywithkeys() allows each notify address to
607 * be associated with a TSIG key.
610 *\li 'zone' to be a valid zone.
611 *\li 'notify' to be non-NULL if count != 0.
612 *\li 'count' to be the number of notifiees.
620 dns_zone_unload(dns_zone_t *zone);
622 * detach the database from the zone structure.
625 *\li 'zone' to be a valid zone.
629 dns_zone_setoption(dns_zone_t *zone, unsigned int option, isc_boolean_t value);
631 * Set given options on ('value' == ISC_TRUE) or off ('value' ==
635 *\li 'zone' to be a valid zone.
639 dns_zone_getoptions(dns_zone_t *zone);
641 * Returns the current zone options.
644 *\li 'zone' to be a valid zone.
648 dns_zone_setkeyopt(dns_zone_t *zone, unsigned int option, isc_boolean_t value);
650 * Set key options on ('value' == ISC_TRUE) or off ('value' ==
654 *\li 'zone' to be a valid zone.
658 dns_zone_getkeyopts(dns_zone_t *zone);
660 * Returns the current zone key options.
663 *\li 'zone' to be a valid zone.
667 dns_zone_setminrefreshtime(dns_zone_t *zone, isc_uint32_t val);
669 * Set the minimum refresh time.
672 *\li 'zone' is valid.
677 dns_zone_setmaxrefreshtime(dns_zone_t *zone, isc_uint32_t val);
679 * Set the maximum refresh time.
682 *\li 'zone' is valid.
687 dns_zone_setminretrytime(dns_zone_t *zone, isc_uint32_t val);
689 * Set the minimum retry time.
692 *\li 'zone' is valid.
697 dns_zone_setmaxretrytime(dns_zone_t *zone, isc_uint32_t val);
699 * Set the maximum retry time.
702 *\li 'zone' is valid.
707 dns_zone_setxfrsource4(dns_zone_t *zone, const isc_sockaddr_t *xfrsource);
709 dns_zone_setaltxfrsource4(dns_zone_t *zone,
710 const isc_sockaddr_t *xfrsource);
712 * Set the source address to be used in IPv4 zone transfers.
715 *\li 'zone' to be a valid zone.
716 *\li 'xfrsource' to contain the address.
723 dns_zone_getxfrsource4(dns_zone_t *zone);
725 dns_zone_getaltxfrsource4(dns_zone_t *zone);
727 * Returns the source address set by a previous dns_zone_setxfrsource4
728 * call, or the default of inaddr_any, port 0.
731 *\li 'zone' to be a valid zone.
735 dns_zone_setxfrsource6(dns_zone_t *zone, const isc_sockaddr_t *xfrsource);
737 dns_zone_setaltxfrsource6(dns_zone_t *zone,
738 const isc_sockaddr_t *xfrsource);
740 * Set the source address to be used in IPv6 zone transfers.
743 *\li 'zone' to be a valid zone.
744 *\li 'xfrsource' to contain the address.
751 dns_zone_getxfrsource6(dns_zone_t *zone);
753 dns_zone_getaltxfrsource6(dns_zone_t *zone);
755 * Returns the source address set by a previous dns_zone_setxfrsource6
756 * call, or the default of in6addr_any, port 0.
759 *\li 'zone' to be a valid zone.
763 dns_zone_setnotifysrc4(dns_zone_t *zone, const isc_sockaddr_t *notifysrc);
765 * Set the source address to be used with IPv4 NOTIFY messages.
768 *\li 'zone' to be a valid zone.
769 *\li 'notifysrc' to contain the address.
776 dns_zone_getnotifysrc4(dns_zone_t *zone);
778 * Returns the source address set by a previous dns_zone_setnotifysrc4
779 * call, or the default of inaddr_any, port 0.
782 *\li 'zone' to be a valid zone.
786 dns_zone_setnotifysrc6(dns_zone_t *zone, const isc_sockaddr_t *notifysrc);
788 * Set the source address to be used with IPv6 NOTIFY messages.
791 *\li 'zone' to be a valid zone.
792 *\li 'notifysrc' to contain the address.
799 dns_zone_getnotifysrc6(dns_zone_t *zone);
801 * Returns the source address set by a previous dns_zone_setnotifysrc6
802 * call, or the default of in6addr_any, port 0.
805 *\li 'zone' to be a valid zone.
809 dns_zone_setnotifyacl(dns_zone_t *zone, dns_acl_t *acl);
811 * Sets the notify acl list for the zone.
814 *\li 'zone' to be a valid zone.
815 *\li 'acl' to be a valid acl.
819 dns_zone_setqueryacl(dns_zone_t *zone, dns_acl_t *acl);
821 * Sets the query acl list for the zone.
824 *\li 'zone' to be a valid zone.
825 *\li 'acl' to be a valid acl.
829 dns_zone_setqueryonacl(dns_zone_t *zone, dns_acl_t *acl);
831 * Sets the query-on acl list for the zone.
834 *\li 'zone' to be a valid zone.
835 *\li 'acl' to be a valid acl.
839 dns_zone_setupdateacl(dns_zone_t *zone, dns_acl_t *acl);
841 * Sets the update acl list for the zone.
844 *\li 'zone' to be a valid zone.
845 *\li 'acl' to be valid acl.
849 dns_zone_setforwardacl(dns_zone_t *zone, dns_acl_t *acl);
851 * Sets the forward unsigned updates acl list for the zone.
854 *\li 'zone' to be a valid zone.
855 *\li 'acl' to be valid acl.
859 dns_zone_setxfracl(dns_zone_t *zone, dns_acl_t *acl);
861 * Sets the transfer acl list for the zone.
864 *\li 'zone' to be a valid zone.
865 *\li 'acl' to be valid acl.
869 dns_zone_getnotifyacl(dns_zone_t *zone);
871 * Returns the current notify acl or NULL.
874 *\li 'zone' to be a valid zone.
877 *\li acl a pointer to the acl.
882 dns_zone_getqueryacl(dns_zone_t *zone);
884 * Returns the current query acl or NULL.
887 *\li 'zone' to be a valid zone.
890 *\li acl a pointer to the acl.
895 dns_zone_getqueryonacl(dns_zone_t *zone);
897 * Returns the current query-on acl or NULL.
900 *\li 'zone' to be a valid zone.
903 *\li acl a pointer to the acl.
908 dns_zone_getupdateacl(dns_zone_t *zone);
910 * Returns the current update acl or NULL.
913 *\li 'zone' to be a valid zone.
916 *\li acl a pointer to the acl.
921 dns_zone_getforwardacl(dns_zone_t *zone);
923 * Returns the current forward unsigned updates acl or NULL.
926 *\li 'zone' to be a valid zone.
929 *\li acl a pointer to the acl.
934 dns_zone_getxfracl(dns_zone_t *zone);
936 * Returns the current transfer acl or NULL.
939 *\li 'zone' to be a valid zone.
942 *\li acl a pointer to the acl.
947 dns_zone_clearupdateacl(dns_zone_t *zone);
949 * Clear the current update acl.
952 *\li 'zone' to be a valid zone.
956 dns_zone_clearforwardacl(dns_zone_t *zone);
958 * Clear the current forward unsigned updates acl.
961 *\li 'zone' to be a valid zone.
965 dns_zone_clearnotifyacl(dns_zone_t *zone);
967 * Clear the current notify acl.
970 *\li 'zone' to be a valid zone.
974 dns_zone_clearqueryacl(dns_zone_t *zone);
976 * Clear the current query acl.
979 *\li 'zone' to be a valid zone.
983 dns_zone_clearqueryonacl(dns_zone_t *zone);
985 * Clear the current query-on acl.
988 *\li 'zone' to be a valid zone.
992 dns_zone_clearxfracl(dns_zone_t *zone);
994 * Clear the current transfer acl.
997 *\li 'zone' to be a valid zone.
1001 dns_zone_getupdatedisabled(dns_zone_t *zone);
1003 * Return update disabled.
1004 * Transient unless called when running in isc_task_exclusive() mode.
1008 dns_zone_setupdatedisabled(dns_zone_t *zone, isc_boolean_t state);
1010 * Set update disabled.
1011 * Should only be called only when running in isc_task_exclusive() mode.
1012 * Failure to do so may result in updates being committed after the
1013 * call has been made.
1017 dns_zone_getzeronosoattl(dns_zone_t *zone);
1019 * Return zero-no-soa-ttl status.
1023 dns_zone_setzeronosoattl(dns_zone_t *zone, isc_boolean_t state);
1025 * Set zero-no-soa-ttl status.
1029 dns_zone_setchecknames(dns_zone_t *zone, dns_severity_t severity);
1031 * Set the severity of name checking when loading a zone.
1034 * \li 'zone' to be a valid zone.
1038 dns_zone_getchecknames(dns_zone_t *zone);
1040 * Return the current severity of name checking.
1043 *\li 'zone' to be a valid zone.
1047 dns_zone_setjournalsize(dns_zone_t *zone, isc_int32_t size);
1049 * Sets the journal size for the zone.
1052 *\li 'zone' to be a valid zone.
1056 dns_zone_getjournalsize(dns_zone_t *zone);
1058 * Return the journal size as set with a previous call to
1059 * dns_zone_setjournalsize().
1062 *\li 'zone' to be a valid zone.
1066 dns_zone_notifyreceive(dns_zone_t *zone, isc_sockaddr_t *from,
1067 dns_message_t *msg);
1069 * Tell the zone that it has received a NOTIFY message from another
1070 * server. This may cause some zone maintenance activity to occur.
1073 *\li 'zone' to be a valid zone.
1074 *\li '*from' to contain the address of the server from which 'msg'
1076 *\li 'msg' a message with opcode NOTIFY and qr clear.
1086 dns_zone_setmaxxfrin(dns_zone_t *zone, isc_uint32_t maxxfrin);
1088 * Set the maximum time (in seconds) that a zone transfer in (AXFR/IXFR)
1089 * of this zone will use before being aborted.
1092 * \li 'zone' to be valid initialised zone.
1096 dns_zone_getmaxxfrin(dns_zone_t *zone);
1098 * Returns the maximum transfer time for this zone. This will be
1099 * either the value set by the last call to dns_zone_setmaxxfrin() or
1100 * the default value of 1 hour.
1103 *\li 'zone' to be valid initialised zone.
1107 dns_zone_setmaxxfrout(dns_zone_t *zone, isc_uint32_t maxxfrout);
1109 * Set the maximum time (in seconds) that a zone transfer out (AXFR/IXFR)
1110 * of this zone will use before being aborted.
1113 * \li 'zone' to be valid initialised zone.
1117 dns_zone_getmaxxfrout(dns_zone_t *zone);
1119 * Returns the maximum transfer time for this zone. This will be
1120 * either the value set by the last call to dns_zone_setmaxxfrout() or
1121 * the default value of 1 hour.
1124 *\li 'zone' to be valid initialised zone.
1128 dns_zone_setjournal(dns_zone_t *zone, const char *journal);
1130 * Sets the filename used for journaling updates / IXFR transfers.
1131 * The default journal name is set by dns_zone_setfile() to be
1132 * "file.jnl". If 'journal' is NULL, the zone will have no
1136 *\li 'zone' to be a valid zone.
1140 *\li #ISC_R_NOMEMORY
1144 dns_zone_getjournal(dns_zone_t *zone);
1146 * Returns the journal name associated with this zone.
1147 * If no journal has been set this will be NULL.
1150 *\li 'zone' to be valid initialised zone.
1154 dns_zone_gettype(dns_zone_t *zone);
1156 * Returns the type of the zone (master/slave/etc.)
1159 *\li 'zone' to be valid initialised zone.
1163 dns_zone_settask(dns_zone_t *zone, isc_task_t *task);
1165 * Give a zone a task to work with. Any current task will be detached.
1168 *\li 'zone' to be valid.
1169 *\li 'task' to be valid.
1173 dns_zone_gettask(dns_zone_t *zone, isc_task_t **target);
1175 * Attach '*target' to the zone's task.
1178 *\li 'zone' to be valid initialised zone.
1179 *\li 'zone' to have a task.
1180 *\li 'target' to be != NULL && '*target' == NULL.
1184 dns_zone_notify(dns_zone_t *zone);
1186 * Generate notify events for this zone.
1189 *\li 'zone' to be a valid zone.
1193 dns_zone_replacedb(dns_zone_t *zone, dns_db_t *db, isc_boolean_t dump);
1195 * Replace the database of "zone" with a new database "db".
1197 * If "dump" is ISC_TRUE, then the new zone contents are dumped
1198 * into to the zone's master file for persistence. When replacing
1199 * a zone database by one just loaded from a master file, set
1200 * "dump" to ISC_FALSE to avoid a redundant redump of the data just
1201 * loaded. Otherwise, it should be set to ISC_TRUE.
1203 * If the "diff-on-reload" option is enabled in the configuration file,
1204 * the differences between the old and the new database are added to the
1205 * journal file, and the master file dump is postponed.
1208 * \li 'zone' to be a valid zone.
1212 * \li DNS_R_BADZONE zone failed basic consistency checks:
1213 * * a single SOA must exist
1214 * * some NS records must exist.
1219 dns_zone_getidlein(dns_zone_t *zone);
1222 * \li 'zone' to be a valid zone.
1225 * \li number of seconds of idle time before we abort the transfer in.
1229 dns_zone_setidlein(dns_zone_t *zone, isc_uint32_t idlein);
1231 * \li Set the idle timeout for transfer the.
1232 * \li Zero set the default value, 1 hour.
1235 * \li 'zone' to be a valid zone.
1239 dns_zone_getidleout(dns_zone_t *zone);
1243 * \li 'zone' to be a valid zone.
1246 * \li number of seconds of idle time before we abort a transfer out.
1250 dns_zone_setidleout(dns_zone_t *zone, isc_uint32_t idleout);
1252 * \li Set the idle timeout for transfers out.
1253 * \li Zero set the default value, 1 hour.
1256 * \li 'zone' to be a valid zone.
1260 dns_zone_getssutable(dns_zone_t *zone, dns_ssutable_t **table);
1262 * Get the simple-secure-update policy table.
1265 * \li 'zone' to be a valid zone.
1269 dns_zone_setssutable(dns_zone_t *zone, dns_ssutable_t *table);
1271 * Set / clear the simple-secure-update policy table.
1274 * \li 'zone' to be a valid zone.
1278 dns_zone_getmctx(dns_zone_t *zone);
1280 * Get the memory context of a zone.
1283 * \li 'zone' to be a valid zone.
1287 dns_zone_getmgr(dns_zone_t *zone);
1289 * If 'zone' is managed return the zone manager otherwise NULL.
1292 * \li 'zone' to be a valid zone.
1296 dns_zone_setsigvalidityinterval(dns_zone_t *zone, isc_uint32_t interval);
1298 * Set the zone's RRSIG validity interval. This is the length of time
1299 * for which DNSSEC signatures created as a result of dynamic updates
1300 * to secure zones will remain valid, in seconds.
1303 * \li 'zone' to be a valid zone.
1307 dns_zone_getsigvalidityinterval(dns_zone_t *zone);
1309 * Get the zone's RRSIG validity interval.
1312 * \li 'zone' to be a valid zone.
1316 dns_zone_setsigresigninginterval(dns_zone_t *zone, isc_uint32_t interval);
1318 * Set the zone's RRSIG re-signing interval. A dynamic zone's RRSIG's
1319 * will be re-signed 'interval' amount of time before they expire.
1322 * \li 'zone' to be a valid zone.
1326 dns_zone_getsigresigninginterval(dns_zone_t *zone);
1328 * Get the zone's RRSIG re-signing interval.
1331 * \li 'zone' to be a valid zone.
1335 dns_zone_setnotifytype(dns_zone_t *zone, dns_notifytype_t notifytype);
1337 * Sets zone notify method to "notifytype"
1341 dns_zone_forwardupdate(dns_zone_t *zone, dns_message_t *msg,
1342 dns_updatecallback_t callback, void *callback_arg);
1344 * Forward 'msg' to each master in turn until we get an answer or we
1345 * have exhausted the list of masters. 'callback' will be called with
1346 * ISC_R_SUCCESS if we get an answer and the returned message will be
1347 * passed as 'answer_message', otherwise a non ISC_R_SUCCESS result code
1348 * will be passed and answer_message will be NULL. The callback function
1349 * is responsible for destroying 'answer_message'.
1350 * (callback)(callback_arg, result, answer_message);
1353 *\li 'zone' to be valid
1354 *\li 'msg' to be valid.
1355 *\li 'callback' to be non NULL.
1357 *\li #ISC_R_SUCCESS if the message has been forwarded,
1358 *\li #ISC_R_NOMEMORY
1363 dns_zone_next(dns_zone_t *zone, dns_zone_t **next);
1365 * Find the next zone in the list of managed zones.
1368 *\li 'zone' to be valid
1369 *\li The zone manager for the indicated zone MUST be locked
1370 * by the caller. This is not checked.
1371 *\li 'next' be non-NULL, and '*next' be NULL.
1374 *\li 'next' points to a valid zone (result ISC_R_SUCCESS) or to NULL
1375 * (result ISC_R_NOMORE).
1381 dns_zone_first(dns_zonemgr_t *zmgr, dns_zone_t **first);
1383 * Find the first zone in the list of managed zones.
1386 *\li 'zonemgr' to be valid
1387 *\li The zone manager for the indicated zone MUST be locked
1388 * by the caller. This is not checked.
1389 *\li 'first' be non-NULL, and '*first' be NULL
1392 *\li 'first' points to a valid zone (result ISC_R_SUCCESS) or to NULL
1393 * (result ISC_R_NOMORE).
1397 dns_zone_setkeydirectory(dns_zone_t *zone, const char *directory);
1399 * Sets the name of the directory where private keys used for
1400 * online signing of dynamic zones are found.
1403 *\li 'zone' to be a valid zone.
1406 *\li #ISC_R_NOMEMORY
1411 dns_zone_getkeydirectory(dns_zone_t *zone);
1413 * Gets the name of the directory where private keys used for
1414 * online signing of dynamic zones are found.
1417 *\li 'zone' to be valid initialised zone.
1420 * Pointer to null-terminated file name, or NULL.
1425 dns_zonemgr_create(isc_mem_t *mctx, isc_taskmgr_t *taskmgr,
1426 isc_timermgr_t *timermgr, isc_socketmgr_t *socketmgr,
1427 dns_zonemgr_t **zmgrp);
1429 * Create a zone manager. Note: the zone manager will not be able to
1430 * manage any zones until dns_zonemgr_setsize() has been run.
1433 *\li 'mctx' to be a valid memory context.
1434 *\li 'taskmgr' to be a valid task manager.
1435 *\li 'timermgr' to be a valid timer manager.
1436 *\li 'zmgrp' to point to a NULL pointer.
1440 dns_zonemgr_setsize(dns_zonemgr_t *zmgr, int num_zones);
1442 * Set the size of the zone manager task pool. This must be run
1443 * before zmgr can be used for managing zones. Currently, it can only
1444 * be run once; the task pool cannot be resized.
1447 *\li zmgr is a valid zone manager.
1448 *\li zmgr->zonetasks has been initialized.
1452 dns_zonemgr_createzone(dns_zonemgr_t *zmgr, dns_zone_t **zonep);
1454 * Allocate a new zone using a memory context from the
1455 * zone manager's memory context pool.
1458 *\li 'zmgr' to be a valid zone manager.
1459 *\li 'zonep' != NULL and '*zonep' == NULL.
1464 dns_zonemgr_managezone(dns_zonemgr_t *zmgr, dns_zone_t *zone);
1466 * Bring the zone under control of a zone manager.
1469 *\li 'zmgr' to be a valid zone manager.
1470 *\li 'zone' to be a valid zone.
1474 dns_zonemgr_forcemaint(dns_zonemgr_t *zmgr);
1476 * Force zone maintenance of all zones managed by 'zmgr' at its
1477 * earliest convenience.
1481 dns__zonemgr_run(isc_task_t *task, isc_event_t *event);
1483 * Event handler to call dns_zonemgr_forcemaint(); used to start
1484 * zone operations from a unit test. Not intended for use outside
1485 * libdns or related tests.
1489 dns_zonemgr_resumexfrs(dns_zonemgr_t *zmgr);
1491 * Attempt to start any stalled zone transfers.
1495 dns_zonemgr_shutdown(dns_zonemgr_t *zmgr);
1497 * Shut down the zone manager.
1500 *\li 'zmgr' to be a valid zone manager.
1504 dns_zonemgr_attach(dns_zonemgr_t *source, dns_zonemgr_t **target);
1506 * Attach '*target' to 'source' incrementing its external
1510 *\li 'zone' to be a valid zone.
1511 *\li 'target' to be non NULL and '*target' to be NULL.
1515 dns_zonemgr_detach(dns_zonemgr_t **zmgrp);
1517 * Detach from a zone manager.
1520 *\li '*zmgrp' is a valid, non-NULL zone manager pointer.
1523 *\li '*zmgrp' is NULL.
1527 dns_zonemgr_releasezone(dns_zonemgr_t *zmgr, dns_zone_t *zone);
1529 * Release 'zone' from the managed by 'zmgr'. 'zmgr' is implicitly
1530 * detached from 'zone'.
1533 *\li 'zmgr' to be a valid zone manager.
1534 *\li 'zone' to be a valid zone.
1535 *\li 'zmgr' == 'zone->zmgr'
1538 *\li 'zone->zmgr' == NULL;
1542 dns_zonemgr_settransfersin(dns_zonemgr_t *zmgr, isc_uint32_t value);
1544 * Set the maximum number of simultaneous transfers in allowed by
1548 *\li 'zmgr' to be a valid zone manager.
1552 dns_zonemgr_getttransfersin(dns_zonemgr_t *zmgr);
1554 * Return the maximum number of simultaneous transfers in allowed.
1557 *\li 'zmgr' to be a valid zone manager.
1561 dns_zonemgr_settransfersperns(dns_zonemgr_t *zmgr, isc_uint32_t value);
1563 * Set the number of zone transfers allowed per nameserver.
1566 *\li 'zmgr' to be a valid zone manager
1570 dns_zonemgr_getttransfersperns(dns_zonemgr_t *zmgr);
1572 * Return the number of transfers allowed per nameserver.
1575 *\li 'zmgr' to be a valid zone manager.
1579 dns_zonemgr_setiolimit(dns_zonemgr_t *zmgr, isc_uint32_t iolimit);
1581 * Set the number of simultaneous file descriptors available for
1582 * reading and writing masterfiles.
1585 *\li 'zmgr' to be a valid zone manager.
1586 *\li 'iolimit' to be positive.
1590 dns_zonemgr_getiolimit(dns_zonemgr_t *zmgr);
1592 * Get the number of simultaneous file descriptors available for
1593 * reading and writing masterfiles.
1596 *\li 'zmgr' to be a valid zone manager.
1600 dns_zonemgr_setserialqueryrate(dns_zonemgr_t *zmgr, unsigned int value);
1602 * Set the number of SOA queries sent per second.
1605 *\li 'zmgr' to be a valid zone manager
1609 dns_zonemgr_getserialqueryrate(dns_zonemgr_t *zmgr);
1611 * Return the number of SOA queries sent per second.
1614 *\li 'zmgr' to be a valid zone manager.
1618 dns_zonemgr_getcount(dns_zonemgr_t *zmgr, int state);
1620 * Returns the number of zones in the specified state.
1623 *\li 'zmgr' to be a valid zone manager.
1624 *\li 'state' to be a valid DNS_ZONESTATE_ constant.
1628 dns_zonemgr_unreachableadd(dns_zonemgr_t *zmgr, isc_sockaddr_t *remote,
1629 isc_sockaddr_t *local, isc_time_t *now);
1631 * Add the pair of addresses to the unreachable cache.
1634 *\li 'zmgr' to be a valid zone manager.
1635 *\li 'remote' to be a valid sockaddr.
1636 *\li 'local' to be a valid sockaddr.
1640 dns_zonemgr_unreachable(dns_zonemgr_t *zmgr, isc_sockaddr_t *remote,
1641 isc_sockaddr_t *local, isc_time_t *now);
1643 * Returns ISC_TRUE if the given local/remote address pair
1644 * is found in the zone maanger's unreachable cache.
1647 *\li 'zmgr' to be a valid zone manager.
1648 *\li 'remote' to be a valid sockaddr.
1649 *\li 'local' to be a valid sockaddr.
1654 dns_zonemgr_unreachabledel(dns_zonemgr_t *zmgr, isc_sockaddr_t *remote,
1655 isc_sockaddr_t *local);
1657 * Remove the pair of addresses from the unreachable cache.
1660 *\li 'zmgr' to be a valid zone manager.
1661 *\li 'remote' to be a valid sockaddr.
1662 *\li 'local' to be a valid sockaddr.
1666 dns_zone_forcereload(dns_zone_t *zone);
1668 * Force a reload of specified zone.
1671 *\li 'zone' to be a valid zone.
1675 dns_zone_isforced(dns_zone_t *zone);
1677 * Check if the zone is waiting a forced reload.
1680 * \li 'zone' to be a valid zone.
1684 dns_zone_setstatistics(dns_zone_t *zone, isc_boolean_t on);
1686 * This function is obsoleted by dns_zone_setrequeststats().
1690 dns_zone_getstatscounters(dns_zone_t *zone);
1692 * This function is obsoleted by dns_zone_getrequeststats().
1696 dns_zone_setstats(dns_zone_t *zone, isc_stats_t *stats);
1698 * Set a general zone-maintenance statistics set 'stats' for 'zone'. This
1699 * function is expected to be called only on zone creation (when necessary).
1700 * Once installed, it cannot be removed or replaced. Also, there is no
1701 * interface to get the installed stats from the zone; the caller must keep the
1702 * stats to reference (e.g. dump) it later.
1705 * \li 'zone' to be a valid zone and does not have a statistics set already
1708 *\li stats is a valid statistics supporting zone statistics counters
1709 * (see dns/stats.h).
1713 dns_zone_setrequeststats(dns_zone_t *zone, isc_stats_t *stats);
1716 dns_zone_setrcvquerystats(dns_zone_t *zone, dns_stats_t *stats);
1718 * Set additional statistics sets to zone. These are attached to the zone
1719 * but are not counted in the zone module; only the caller updates the
1723 * \li 'zone' to be a valid zone.
1725 *\li stats is a valid statistics.
1730 dns_zone_setrcvquerystats(dns_zone_t *zone, dns_stats_t *stats);
1734 dns_zone_getrequeststats(dns_zone_t *zone);
1738 dns_zone_getrcvquerystats(dns_zone_t *zone);
1742 * Get the additional statistics for zone, if one is installed.
1745 * \li 'zone' to be a valid zone.
1748 * \li when available, a pointer to the statistics set installed in zone;
1753 dns_zone_dialup(dns_zone_t *zone);
1755 * Perform dialup-time maintenance on 'zone'.
1759 dns_zone_setdialup(dns_zone_t *zone, dns_dialuptype_t dialup);
1761 * Set the dialup type of 'zone' to 'dialup'.
1764 * \li 'zone' to be valid initialised zone.
1765 *\li 'dialup' to be a valid dialup type.
1769 dns_zone_log(dns_zone_t *zone, int level, const char *msg, ...)
1770 ISC_FORMAT_PRINTF(3, 4);
1772 * Log the message 'msg...' at 'level', including text that identifies
1773 * the message as applying to 'zone'.
1777 dns_zone_logc(dns_zone_t *zone, isc_logcategory_t *category, int level,
1778 const char *msg, ...) ISC_FORMAT_PRINTF(4, 5);
1780 * Log the message 'msg...' at 'level', including text that identifies
1781 * the message as applying to 'zone'.
1785 dns_zone_name(dns_zone_t *zone, char *buf, size_t len);
1787 * Return the name of the zone with class and view.
1790 *\li 'zone' to be valid.
1791 *\li 'buf' to be non NULL.
1795 dns_zone_checknames(dns_zone_t *zone, dns_name_t *name, dns_rdata_t *rdata);
1797 * Check if this record meets the check-names policy.
1800 * 'zone' to be valid.
1801 * 'name' to be valid.
1802 * 'rdata' to be valid.
1805 * DNS_R_SUCCESS passed checks.
1806 * DNS_R_BADOWNERNAME failed ownername checks.
1807 * DNS_R_BADNAME failed rdata checks.
1811 dns_zone_setacache(dns_zone_t *zone, dns_acache_t *acache);
1813 * Associate the zone with an additional cache.
1816 * 'zone' to be a valid zone.
1817 * 'acache' to be a non NULL pointer.
1820 * 'zone' will have a reference to 'acache'
1824 dns_zone_setcheckmx(dns_zone_t *zone, dns_checkmxfunc_t checkmx);
1826 * Set the post load integrity callback function 'checkmx'.
1827 * 'checkmx' will be called if the MX TARGET is not within the zone.
1830 * 'zone' to be a valid zone.
1834 dns_zone_setchecksrv(dns_zone_t *zone, dns_checkmxfunc_t checksrv);
1836 * Set the post load integrity callback function 'checksrv'.
1837 * 'checksrv' will be called if the SRV TARGET is not within the zone.
1840 * 'zone' to be a valid zone.
1844 dns_zone_setcheckns(dns_zone_t *zone, dns_checknsfunc_t checkns);
1846 * Set the post load integrity callback function 'checkns'.
1847 * 'checkns' will be called if the NS TARGET is not within the zone.
1850 * 'zone' to be a valid zone.
1854 dns_zone_setnotifydelay(dns_zone_t *zone, isc_uint32_t delay);
1856 * Set the minimum delay between sets of notify messages.
1859 * 'zone' to be valid.
1863 dns_zone_getnotifydelay(dns_zone_t *zone);
1865 * Get the minimum delay between sets of notify messages.
1868 * 'zone' to be valid.
1872 dns_zone_setisself(dns_zone_t *zone, dns_isselffunc_t isself, void *arg);
1874 * Set the isself callback function and argument.
1877 * isself(dns_view_t *myview, dns_tsigkey_t *mykey, isc_netaddr_t *srcaddr,
1878 * isc_netaddr_t *destaddr, dns_rdataclass_t rdclass, void *arg);
1880 * 'isself' returns ISC_TRUE if a non-recursive query from 'srcaddr' to
1881 * 'destaddr' with optional key 'mykey' for class 'rdclass' would be
1882 * delivered to 'myview'.
1886 dns_zone_setnodes(dns_zone_t *zone, isc_uint32_t nodes);
1888 * Set the number of nodes that will be checked per quantum.
1892 dns_zone_setsignatures(dns_zone_t *zone, isc_uint32_t signatures);
1894 * Set the number of signatures that will be generated per quantum.
1898 dns_zone_signwithkey(dns_zone_t *zone, dns_secalg_t algorithm,
1899 isc_uint16_t keyid, isc_boolean_t deleteit);
1901 * Initiate/resume signing of the entire zone with the zone DNSKEY(s)
1902 * that match the given algorithm and keyid.
1906 dns_zone_addnsec3chain(dns_zone_t *zone, dns_rdata_nsec3param_t *nsec3param);
1908 * Incrementally add a NSEC3 chain that corresponds to 'nsec3param'.
1912 dns_zone_setprivatetype(dns_zone_t *zone, dns_rdatatype_t type);
1914 dns_zone_getprivatetype(dns_zone_t *zone);
1916 * Get/Set the private record type. It is expected that these interfaces
1917 * will not be permanent.
1921 dns_zone_rekey(dns_zone_t *zone, isc_boolean_t fullsign);
1923 * Update the zone's DNSKEY set from the key repository.
1925 * If 'fullsign' is true, trigger an immediate full signing of
1926 * the zone with the new key. Otherwise, if there are no keys or
1927 * if the new keys are for algorithms that have already signed the
1928 * zone, then the zone can be re-signed incrementally.
1932 dns_zone_nscheck(dns_zone_t *zone, dns_db_t *db, dns_dbversion_t *version,
1933 unsigned int *errors);
1935 * Check if the name servers for the zone are sane (have address, don't
1936 * refer to CNAMEs/DNAMEs. The number of constiancy errors detected in
1937 * returned in '*errors'
1940 * \li 'zone' to be valid.
1941 * \li 'db' to be valid.
1942 * \li 'version' to be valid or NULL.
1943 * \li 'errors' to be non NULL.
1946 * ISC_R_SUCCESS if there were no errors examining the zone contents.
1950 dns_zone_setadded(dns_zone_t *zone, isc_boolean_t added);
1952 * Sets the value of zone->added, which should be ISC_TRUE for
1953 * zones that were originally added by "rndc addzone".
1956 * \li 'zone' to be valid.
1960 dns_zone_getadded(dns_zone_t *zone);
1962 * Returns ISC_TRUE if the zone was originally added at runtime
1963 * using "rndc addzone".
1966 * \li 'zone' to be valid.
1970 dns_zone_dlzpostload(dns_zone_t *zone, dns_db_t *db);
1972 * Load the origin names for a writeable DLZ database.
1976 dns_zone_isdynamic(dns_zone_t *zone, isc_boolean_t ignore_freeze);
1978 * Return true iff the zone is "dynamic", in the sense that the zone's
1979 * master file (if any) is written by the server, rather than being
1980 * updated manually and read by the server.
1982 * This is true for slave zones, stub zones, key zones, and zones that
1983 * allow dynamic updates either by having an update policy ("ssutable")
1984 * or an "allow-update" ACL with a value other than exactly "{ none; }".
1986 * If 'ignore_freeze' is true, then the zone which has had updates disabled
1987 * will still report itself to be dynamic.
1990 * \li 'zone' to be valid.
1994 dns_zone_setrefreshkeyinterval(dns_zone_t *zone, isc_uint32_t interval);
1996 * Sets the frequency, in minutes, with which the key repository will be
1997 * checked to see if the keys for this zone have been updated. Any value
1998 * higher than 1440 minutes (24 hours) will be silently reduced. A
1999 * value of zero will return an out-of-range error.
2002 * \li 'zone' to be valid.
2006 dns_zone_getrequestixfr(dns_zone_t *zone);
2008 * Returns the true/false value of the request-ixfr option in the zone.
2011 * \li 'zone' to be valid.
2015 dns_zone_setrequestixfr(dns_zone_t *zone, isc_boolean_t flag);
2017 * Sets the request-ixfr option for the zone. Either true or false. The
2018 * default value is determined by the setting of this option in the view.
2021 * \li 'zone' to be valid.
2025 dns_zone_setserialupdatemethod(dns_zone_t *zone, dns_updatemethod_t method);
2027 * Sets the update method to use when incrementing the zone serial number
2028 * due to a DDNS update. Valid options are dns_updatemethod_increment
2029 * and dns_updatemethod_unixtime.
2032 * \li 'zone' to be valid.
2036 dns_zone_getserialupdatemethod(dns_zone_t *zone);
2038 * Returns the update method to be used when incrementing the zone serial
2039 * number due to a DDNS update.
2042 * \li 'zone' to be valid.
2046 dns_zone_link(dns_zone_t *zone, dns_zone_t *raw);
2049 dns_zone_getraw(dns_zone_t *zone, dns_zone_t **raw);
2052 dns_zone_keydone(dns_zone_t *zone, const char *data);
2055 dns_zone_setnsec3param(dns_zone_t *zone, isc_uint8_t hash, isc_uint8_t flags,
2056 isc_uint16_t iter, isc_uint8_t saltlen,
2057 unsigned char *salt, isc_boolean_t replace);
2059 * Set the NSEC3 parameters for the zone.
2061 * If 'replace' is ISC_TRUE, then the existing NSEC3 chain, if any, will
2062 * be replaced with the new one. If 'hash' is zero, then the replacement
2063 * chain will be NSEC rather than NSEC3.
2066 * \li 'zone' to be valid.
2070 dns_zone_setrawdata(dns_zone_t *zone, dns_masterrawheader_t *header);
2072 * Set the data to be included in the header when the zone is dumped in
2077 dns_zone_synckeyzone(dns_zone_t *zone);
2079 * Force the managed key zone to synchronize, and start the key
2080 * maintenance timer.
2084 dns_zone_rpz_enable(dns_zone_t *zone);
2086 * Set the response policy associated with a zone.
2090 dns_zone_rpz_enable_db(dns_zone_t *zone, dns_db_t *db);
2092 * If a zone is a response policy zone, mark its new database.
2096 dns_zone_get_rpz(dns_zone_t *zone);
2099 dns_zone_setstatlevel(dns_zone_t *zone, dns_zonestat_level_t level);
2101 dns_zonestat_level_t
2102 dns_zone_getstatlevel(dns_zone_t *zone);
2104 * Set and get the statistics reporting level for the zone;
2105 * full, terse, or none.
2110 #endif /* DNS_ZONE_H */