2 * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (C) 1999-2003 Internet Software Consortium.
5 * Permission to use, copy, modify, and 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.
18 /* $Id: zone.h,v 1.106.2.8 2004/03/09 06:11:24 marka Exp $ */
29 #include <isc/formatcheck.h>
31 #include <isc/rwlock.h>
33 #include <dns/types.h>
42 #define DNS_ZONEOPT_SERVERS 0x00000001U /* perform server checks */
43 #define DNS_ZONEOPT_PARENTS 0x00000002U /* perform parent checks */
44 #define DNS_ZONEOPT_CHILDREN 0x00000004U /* perform child checks */
45 #define DNS_ZONEOPT_NOTIFY 0x00000008U /* perform NOTIFY */
46 #define DNS_ZONEOPT_MANYERRORS 0x00000010U /* return many errors on load */
47 #define DNS_ZONEOPT_NOMERGE 0x00000040U /* don't merge journal */
49 #ifndef NOMINUM_PUBLIC
51 * Nominum specific options build down.
53 #define DNS_ZONEOPT_NOTIFYFORWARD 0x80000000U /* forward notify to master */
54 #endif /* NOMINUM_PUBLIC */
56 #ifndef DNS_ZONE_MINREFRESH
57 #define DNS_ZONE_MINREFRESH 300 /* 5 minutes */
59 #ifndef DNS_ZONE_MAXREFRESH
60 #define DNS_ZONE_MAXREFRESH 2419200 /* 4 weeks */
62 #ifndef DNS_ZONE_DEFAULTREFRESH
63 #define DNS_ZONE_DEFAULTREFRESH 3600 /* 1 hour */
65 #ifndef DNS_ZONE_MINRETRY
66 #define DNS_ZONE_MINRETRY 300 /* 5 minutes */
68 #ifndef DNS_ZONE_MAXRETRY
69 #define DNS_ZONE_MAXRETRY 1209600 /* 2 weeks */
71 #ifndef DNS_ZONE_DEFAULTRETRY
72 #define DNS_ZONE_DEFAULTRETRY 60 /* 1 minute, subject to
73 exponential backoff */
76 #define DNS_ZONESTATE_XFERRUNNING 1
77 #define DNS_ZONESTATE_XFERDEFERRED 2
78 #define DNS_ZONESTATE_SOAQUERY 3
79 #define DNS_ZONESTATE_ANY 4
88 dns_zone_create(dns_zone_t
**zonep
, isc_mem_t
*mctx
);
90 * Creates a new empty zone and attach '*zonep' to it.
93 * 'zonep' to point to a NULL pointer.
94 * 'mctx' to be a valid memory context.
97 * '*zonep' refers to a valid zone.
106 dns_zone_setclass(dns_zone_t
*zone
, dns_rdataclass_t rdclass
);
108 * Sets the class of a zone. This operation can only be performed
112 * 'zone' to be a valid zone.
113 * dns_zone_setclass() not to have been called since the zone was
115 * 'rdclass' != dns_rdataclass_none.
119 dns_zone_getclass(dns_zone_t
*zone
);
121 * Returns the current zone class.
124 * 'zone' to be a valid zone.
128 dns_zone_settype(dns_zone_t
*zone
, dns_zonetype_t type
);
130 * Sets the zone type. This operation can only be performed once on
134 * 'zone' to be a valid zone.
135 * dns_zone_settype() not to have been called since the zone was
137 * 'type' != dns_zone_none
141 dns_zone_setview(dns_zone_t
*zone
, dns_view_t
*view
);
143 * Associate the zone with a view.
146 * 'zone' to be a valid zone.
150 dns_zone_getview(dns_zone_t
*zone
);
152 * Returns the zone's associated view.
155 * 'zone' to be a valid zone.
159 dns_zone_setorigin(dns_zone_t
*zone
, dns_name_t
*origin
);
161 * Sets the zones origin to 'origin'.
164 * 'zone' to be a valid zone.
165 * 'origin' to be non NULL.
173 dns_zone_getorigin(dns_zone_t
*zone
);
175 * Returns the value of the origin.
178 * 'zone' to be a valid zone.
182 dns_zone_setfile(dns_zone_t
*zone
, const char *file
);
184 * Sets the name of the master file from which the zone
185 * loads its database to 'file'. For zones that have
186 * no associated master file, 'file' will be NULL.
188 * For zones with persistent databases, the file name
189 * setting is ignored.
192 * 'zone' to be a valid zone.
200 dns_zone_getfile(dns_zone_t
*zone
);
202 * Gets the name of the zone's master file, if any.
205 * 'zone' to be valid initialised zone.
208 * Pointer to null-terminated file name, or NULL.
212 dns_zone_load(dns_zone_t
*zone
);
215 dns_zone_loadnew(dns_zone_t
*zone
);
217 * Cause the database to be loaded from its backing store.
218 * Confirm that the minimum requirements for the zone type are
219 * met, otherwise DNS_R_BADZONE is returned.
221 * dns_zone_loadnew() only loads zones that are not yet loaded.
222 * dns_zone_load() also loads zones that are already loaded and
223 * and whose master file has changed since the last load.
226 * 'zone' to be a valid zone.
232 * Any result value from dns_db_load().
236 dns_zone_attach(dns_zone_t
*source
, dns_zone_t
**target
);
238 * Attach '*target' to 'source' incrementing its external
242 * 'zone' to be a valid zone.
243 * 'target' to be non NULL and '*target' to be NULL.
247 dns_zone_detach(dns_zone_t
**zonep
);
249 * Detach from a zone decrementing its external reference count.
250 * If this was the last external reference to the zone it will be
251 * shut down and eventually freed.
254 * 'zonep' to point to a valid zone.
258 dns_zone_iattach(dns_zone_t
*source
, dns_zone_t
**target
);
260 * Attach '*target' to 'source' incrementing its internal
261 * reference count. This is intended for use by operations
262 * such as zone transfers that need to prevent the zone
263 * object from being freed but not from shutting down.
266 * The caller is running in the context of the zone's task.
267 * 'zone' to be a valid zone.
268 * 'target' to be non NULL and '*target' to be NULL.
272 dns_zone_idetach(dns_zone_t
**zonep
);
274 * Detach from a zone decrementing its internal reference count.
275 * If there are no more internal or external references to the
276 * zone, it will be freed.
279 * The caller is running in the context of the zone's task.
280 * 'zonep' to point to a valid zone.
284 dns_zone_setflag(dns_zone_t
*zone
, unsigned int flags
, isc_boolean_t value
);
286 * Sets ('value' == 'ISC_TRUE') / clears ('value' == 'IS_FALSE')
287 * zone flags. Valid flag bits are DNS_ZONE_F_*.
290 * 'zone' to be a valid zone.
294 dns_zone_getdb(dns_zone_t
*zone
, dns_db_t
**dbp
);
296 * Attach '*dbp' to the database to if it exists otherwise
297 * return DNS_R_NOTLOADED.
300 * 'zone' to be a valid zone.
301 * 'dbp' to be != NULL && '*dbp' == NULL.
309 dns_zone_setdbtype(dns_zone_t
*zone
,
310 unsigned int dbargc
, const char * const *dbargv
);
312 * Sets the database type to dbargv[0] and database arguments
313 * to subsequent dbargv elements.
314 * 'db_type' is not checked to see if it is a valid database type.
317 * 'zone' to be a valid zone.
318 * 'database' to be non NULL.
319 * 'dbargc' to be >= 1
320 * 'dbargv' to point to dbargc NULL-terminated strings
328 dns_zone_markdirty(dns_zone_t
*zone
);
330 * Mark a zone as 'dirty'.
333 * 'zone' to be a valid zone.
337 dns_zone_expire(dns_zone_t
*zone
);
339 * Mark the zone as expired. If the zone requires dumping cause it to
340 * be initiated. Set the refresh and retry intervals to there default
341 * values and unload the zone.
344 * 'zone' to be a valid zone.
348 dns_zone_refresh(dns_zone_t
*zone
);
350 * Initiate zone up to date checks. The zone must already be being
354 * 'zone' to be a valid zone.
358 dns_zone_flush(dns_zone_t
*zone
);
360 * Write the zone to database if there are uncommited changes.
363 * 'zone' to be a valid zone.
367 dns_zone_dump(dns_zone_t
*zone
);
369 * Write the zone to database.
372 * 'zone' to be a valid zone.
376 dns_zone_dumptostream(dns_zone_t
*zone
, FILE *fd
);
378 * Write the zone to stream 'fd'.
381 * 'zone' to be a valid zone.
382 * 'fd' to be a stream open for writing.
386 dns_zone_maintenance(dns_zone_t
*zone
);
388 * Perform regular maintenace on the zone. This is called as a
389 * result of a zone being managed.
392 * 'zone' to be a valid zone.
396 dns_zone_setmasters(dns_zone_t
*zone
, isc_sockaddr_t
*masters
,
399 dns_zone_setmasterswithkeys(dns_zone_t
*zone
, isc_sockaddr_t
*masters
,
400 dns_name_t
**keynames
, isc_uint32_t count
);
402 * Set the list of master servers for the zone.
405 * 'zone' to be a valid zone.
406 * 'masters' array of isc_sockaddr_t with port set or NULL.
407 * 'count' the number of masters.
408 * 'keynames' array of dns_name_t's for tsig keys or NULL.
410 * dns_zone_setmasters() is just a wrapper to setmasterswithkeys(),
411 * passing NULL in the keynames field.
413 * If 'masters' is NULL then 'count' must be zero.
418 * Any result dns_name_dup() can return, if keynames!=NULL
422 dns_zone_setalsonotify(dns_zone_t
*zone
, isc_sockaddr_t
*notify
,
425 * Set the list of additional servers to be notified when
426 * a zone changes. To clear the list use 'count = 0'.
429 * 'zone' to be a valid zone.
430 * 'notify' to be non-NULL if count != 0.
431 * 'count' to be the number of notifyees
439 dns_zone_unload(dns_zone_t
*zone
);
441 * detach the database from the zone structure.
444 * 'zone' to be a valid zone.
448 dns_zone_setoption(dns_zone_t
*zone
, unsigned int option
, isc_boolean_t value
);
450 * Set given options on ('value' == ISC_TRUE) or off ('value' ==
454 * 'zone' to be a valid zone.
458 dns_zone_getoptions(dns_zone_t
*zone
);
460 * Returns the current zone options.
463 * 'zone' to be a valid zone.
467 dns_zone_setminrefreshtime(dns_zone_t
*zone
, isc_uint32_t val
);
469 * Set the minimum refresh time.
477 dns_zone_setmaxrefreshtime(dns_zone_t
*zone
, isc_uint32_t val
);
479 * Set the maximum refresh time.
487 dns_zone_setminretrytime(dns_zone_t
*zone
, isc_uint32_t val
);
489 * Set the minimum retry time.
497 dns_zone_setmaxretrytime(dns_zone_t
*zone
, isc_uint32_t val
);
499 * Set the maximum retry time.
507 dns_zone_setxfrsource4(dns_zone_t
*zone
, isc_sockaddr_t
*xfrsource
);
509 * Set the source address to be used in IPv4 zone transfers.
512 * 'zone' to be a valid zone.
513 * 'xfrsource' to contain the address.
520 dns_zone_getxfrsource4(dns_zone_t
*zone
);
522 * Returns the source address set by a previous dns_zone_setxfrsource4
523 * call, or the default of inaddr_any, port 0.
526 * 'zone' to be a valid zone.
530 dns_zone_setxfrsource6(dns_zone_t
*zone
, isc_sockaddr_t
*xfrsource
);
532 * Set the source address to be used in IPv6 zone transfers.
535 * 'zone' to be a valid zone.
536 * 'xfrsource' to contain the address.
543 dns_zone_getxfrsource6(dns_zone_t
*zone
);
545 * Returns the source address set by a previous dns_zone_setxfrsource6
546 * call, or the default of in6addr_any, port 0.
549 * 'zone' to be a valid zone.
553 dns_zone_setnotifysrc4(dns_zone_t
*zone
, isc_sockaddr_t
*notifysrc
);
555 * Set the source address to be used with IPv4 NOTIFY messages.
558 * 'zone' to be a valid zone.
559 * 'notifysrc' to contain the address.
566 dns_zone_getnotifysrc4(dns_zone_t
*zone
);
568 * Returns the source address set by a previous dns_zone_setnotifysrc4
569 * call, or the default of inaddr_any, port 0.
572 * 'zone' to be a valid zone.
576 dns_zone_setnotifysrc6(dns_zone_t
*zone
, isc_sockaddr_t
*notifysrc
);
578 * Set the source address to be used with IPv6 NOTIFY messages.
581 * 'zone' to be a valid zone.
582 * 'notifysrc' to contain the address.
589 dns_zone_getnotifysrc6(dns_zone_t
*zone
);
591 * Returns the source address set by a previous dns_zone_setnotifysrc6
592 * call, or the default of in6addr_any, port 0.
595 * 'zone' to be a valid zone.
599 dns_zone_setnotifyacl(dns_zone_t
*zone
, dns_acl_t
*acl
);
601 * Sets the notify acl list for the zone.
604 * 'zone' to be a valid zone.
605 * 'acl' to be a valid acl.
609 dns_zone_setqueryacl(dns_zone_t
*zone
, dns_acl_t
*acl
);
611 * Sets the query acl list for the zone.
614 * 'zone' to be a valid zone.
615 * 'acl' to be a valid acl.
619 dns_zone_setupdateacl(dns_zone_t
*zone
, dns_acl_t
*acl
);
621 * Sets the update acl list for the zone.
624 * 'zone' to be a valid zone.
625 * 'acl' to be valid acl.
629 dns_zone_setforwardacl(dns_zone_t
*zone
, dns_acl_t
*acl
);
631 * Sets the forward unsigned updates acl list for the zone.
634 * 'zone' to be a valid zone.
635 * 'acl' to be valid acl.
639 dns_zone_setxfracl(dns_zone_t
*zone
, dns_acl_t
*acl
);
641 * Sets the transfer acl list for the zone.
644 * 'zone' to be a valid zone.
645 * 'acl' to be valid acl.
649 dns_zone_getnotifyacl(dns_zone_t
*zone
);
651 * Returns the current notify acl or NULL.
654 * 'zone' to be a valid zone.
657 * acl a pointer to the acl.
662 dns_zone_getqueryacl(dns_zone_t
*zone
);
664 * Returns the current query acl or NULL.
667 * 'zone' to be a valid zone.
670 * acl a pointer to the acl.
675 dns_zone_getupdateacl(dns_zone_t
*zone
);
677 * Returns the current update acl or NULL.
680 * 'zone' to be a valid zone.
683 * acl a pointer to the acl.
688 dns_zone_getforwardacl(dns_zone_t
*zone
);
690 * Returns the current forward unsigned updates acl or NULL.
693 * 'zone' to be a valid zone.
696 * acl a pointer to the acl.
701 dns_zone_getxfracl(dns_zone_t
*zone
);
703 * Returns the current transfer acl or NULL.
706 * 'zone' to be a valid zone.
709 * acl a pointer to the acl.
714 dns_zone_clearupdateacl(dns_zone_t
*zone
);
716 * Clear the current update acl.
719 * 'zone' to be a valid zone.
723 dns_zone_clearforwardacl(dns_zone_t
*zone
);
725 * Clear the current forward unsigned updates acl.
728 * 'zone' to be a valid zone.
732 dns_zone_clearnotifyacl(dns_zone_t
*zone
);
734 * Clear the current notify acl.
737 * 'zone' to be a valid zone.
741 dns_zone_clearqueryacl(dns_zone_t
*zone
);
743 * Clear the current query acl.
746 * 'zone' to be a valid zone.
750 dns_zone_clearxfracl(dns_zone_t
*zone
);
752 * Clear the current transfer acl.
755 * 'zone' to be a valid zone.
759 dns_zone_setchecknames(dns_zone_t
*zone
, dns_severity_t severity
);
761 * Set the severity of name checking when loading a zone.
764 * 'zone' to be a valid zone.
768 dns_zone_getchecknames(dns_zone_t
*zone
);
770 * Return the current severity of name checking.
773 * 'zone' to be a valid zone.
777 dns_zone_setjournalsize(dns_zone_t
*zone
, isc_int32_t size
);
779 * Sets the journal size for the zone.
782 * 'zone' to be a valid zone.
786 dns_zone_getjournalsize(dns_zone_t
*zone
);
788 * Return the journal size as set with a previous call to
789 * dns_zone_setjournalsize().
792 * 'zone' to be a valid zone.
796 dns_zone_notifyreceive(dns_zone_t
*zone
, isc_sockaddr_t
*from
,
799 * Tell the zone that it has recieved a NOTIFY message from another
800 * server. This may cause some zone maintainence activity to occur.
803 * 'zone' to be a valid zone.
804 * '*from' to contain the address of the server from which 'msg'
806 * 'msg' a message with opcode NOTIFY and qr clear.
816 dns_zone_setmaxxfrin(dns_zone_t
*zone
, isc_uint32_t maxxfrin
);
818 * Set the maximum time (in seconds) that a zone transfer in (AXFR/IXFR)
819 * of this zone will use before being aborted.
822 * 'zone' to be valid initialised zone.
826 dns_zone_getmaxxfrin(dns_zone_t
*zone
);
828 * Returns the maximum transfer time for this zone. This will be
829 * either the value set by the last call to dns_zone_setmaxxfrin() or
830 * the default value of 1 hour.
833 * 'zone' to be valid initialised zone.
837 dns_zone_setmaxxfrout(dns_zone_t
*zone
, isc_uint32_t maxxfrout
);
839 * Set the maximum time (in seconds) that a zone transfer out (AXFR/IXFR)
840 * of this zone will use before being aborted.
843 * 'zone' to be valid initialised zone.
847 dns_zone_getmaxxfrout(dns_zone_t
*zone
);
849 * Returns the maximum transfer time for this zone. This will be
850 * either the value set by the last call to dns_zone_setmaxxfrout() or
851 * the default value of 1 hour.
854 * 'zone' to be valid initialised zone.
858 dns_zone_setjournal(dns_zone_t
*zone
, const char *journal
);
860 * Sets the filename used for journaling updates / IXFR transfers.
861 * The default journal name is set by dns_zone_setfile() to be
862 * "file.jnl". If 'journal' is NULL, the zone will have no
866 * 'zone' to be a valid zone.
874 dns_zone_getjournal(dns_zone_t
*zone
);
876 * Returns the journal name associated with this zone.
877 * If no journal has been set this will be NULL.
880 * 'zone' to be valid initialised zone.
884 dns_zone_gettype(dns_zone_t
*zone
);
886 * Returns the type of the zone (master/slave/etc.)
889 * 'zone' to be valid initialised zone.
893 dns_zone_settask(dns_zone_t
*zone
, isc_task_t
*task
);
895 * Give a zone a task to work with. Any current task will be detached.
898 * 'zone' to be valid.
899 * 'task' to be valid.
903 dns_zone_gettask(dns_zone_t
*zone
, isc_task_t
**target
);
905 * Attach '*target' to the zone's task.
908 * 'zone' to be valid initialised zone.
909 * 'zone' to have a task.
910 * 'target' to be != NULL && '*target' == NULL.
914 dns_zone_notify(dns_zone_t
*zone
);
916 * Generate notify events for this zone.
919 * 'zone' to be a valid zone.
923 dns_zone_replacedb(dns_zone_t
*zone
, dns_db_t
*db
, isc_boolean_t dump
);
925 * Replace the database of "zone" with a new database "db".
927 * If "dump" is ISC_TRUE, then the new zone contents are dumped
928 * into to the zone's master file for persistence. When replacing
929 * a zone database by one just loaded from a master file, set
930 * "dump" to ISC_FALSE to avoid a redunant redump of the data just
931 * loaded. Otherwise, it should be set to ISC_TRUE.
933 * If the "diff-on-reload" option is enabled in the configuration file,
934 * the differences between the old and the new database are added to the
935 * journal file, and the master file dump is postponed.
938 * 'zone' to be a valid zone.
942 dns_zone_getidlein(dns_zone_t
*zone
);
945 * 'zone' to be a valid zone.
948 * number of seconds of idle time before we abort the transfer in.
952 dns_zone_setidlein(dns_zone_t
*zone
, isc_uint32_t idlein
);
954 * Set the idle timeout for transfer the.
955 * Zero set the default value, 1 hour.
958 * 'zone' to be a valid zone.
962 dns_zone_getidleout(dns_zone_t
*zone
);
966 * 'zone' to be a valid zone.
969 * number of seconds of idle time before we abort a transfer out.
973 dns_zone_setidleout(dns_zone_t
*zone
, isc_uint32_t idleout
);
975 * Set the idle timeout for transfers out.
976 * Zero set the default value, 1 hour.
979 * 'zone' to be a valid zone.
983 dns_zone_getssutable(dns_zone_t
*zone
, dns_ssutable_t
**table
);
985 * Get the simple-secure-update policy table.
988 * 'zone' to be a valid zone.
992 dns_zone_setssutable(dns_zone_t
*zone
, dns_ssutable_t
*table
);
994 * Set / clear the simple-secure-update policy table.
997 * 'zone' to be a valid zone.
1001 dns_zone_getmctx(dns_zone_t
*zone
);
1003 * Get the memory context of a zone.
1006 * 'zone' to be a valid zone.
1010 dns_zone_getmgr(dns_zone_t
*zone
);
1012 * If 'zone' is managed return the zone manager otherwise NULL.
1015 * 'zone' to be a valid zone.
1019 dns_zone_setsigvalidityinterval(dns_zone_t
*zone
, isc_uint32_t interval
);
1021 * Set the zone's SIG validity interval. This is the length of time
1022 * for which DNSSEC signatures created as a result of dynamic updates
1023 * to secure zones will remain valid, in seconds.
1026 * 'zone' to be a valid zone.
1030 dns_zone_getsigvalidityinterval(dns_zone_t
*zone
);
1032 * Get the zone's SIG validity interval.
1035 * 'zone' to be a valid zone.
1039 dns_zone_setnotifytype(dns_zone_t
*zone
, dns_notifytype_t notifytype
);
1041 * Sets zone notify method to "notifytype"
1045 dns_zone_forwardupdate(dns_zone_t
*zone
, dns_message_t
*msg
,
1046 dns_updatecallback_t callback
, void *callback_arg
);
1048 * Forward 'msg' to each master in turn until we get an answer or we
1049 * have exausted the list of masters. 'callback' will be called with
1050 * ISC_R_SUCCESS if we get an answer and the returned message will be
1051 * passed as 'answer_message', otherwise a non ISC_R_SUCCESS result code
1052 * will be passed and answer_message will be NULL. The callback function
1053 * is responsible for destroying 'answer_message'.
1054 * (callback)(callback_arg, result, answer_message);
1057 * 'zone' to be valid
1058 * 'msg' to be valid.
1059 * 'callback' to be non NULL.
1061 * ISC_R_SUCCESS if the message has been forwarded,
1067 dns_zone_next(dns_zone_t
*zone
, dns_zone_t
**next
);
1069 * Find the next zone in the list of managed zones.
1072 * 'zone' to be valid
1073 * The zone manager for the indicated zone MUST be locked
1074 * by the caller. This is not checked.
1075 * 'next' be non-NULL, and '*next' be NULL.
1078 * 'next' points to a valid zone (result ISC_R_SUCCESS) or to NULL
1079 * (result ISC_R_NOMORE).
1083 dns_zone_first(dns_zonemgr_t
*zmgr
, dns_zone_t
**first
);
1085 * Find the first zone in the list of managed zones.
1088 * 'zonemgr' to be valid
1089 * The zone manager for the indicated zone MUST be locked
1090 * by the caller. This is not checked.
1091 * 'first' be non-NULL, and '*first' be NULL
1094 * 'first' points to a valid zone (result ISC_R_SUCCESS) or to NULL
1095 * (result ISC_R_NOMORE).
1099 dns_zonemgr_create(isc_mem_t
*mctx
, isc_taskmgr_t
*taskmgr
,
1100 isc_timermgr_t
*timermgr
, isc_socketmgr_t
*socketmgr
,
1101 dns_zonemgr_t
**zmgrp
);
1103 * Create a zone manager.
1106 * 'mctx' to be a valid memory context.
1107 * 'taskmgr' to be a valid task manager.
1108 * 'timermgr' to be a valid timer manager.
1109 * 'zmgrp' to point to a NULL pointer.
1113 dns_zonemgr_managezone(dns_zonemgr_t
*zmgr
, dns_zone_t
*zone
);
1115 * Bring the zone under control of a zone manager.
1118 * 'zmgr' to be a valid zone manager.
1119 * 'zone' to be a valid zone.
1123 dns_zonemgr_forcemaint(dns_zonemgr_t
*zmgr
);
1125 * Force zone maintenance of all zones managed by 'zmgr' at its
1126 * earliest conveniene.
1130 dns_zonemgr_shutdown(dns_zonemgr_t
*zmgr
);
1132 * Shut down the zone manager.
1135 * 'zmgr' to be a valid zone manager.
1139 dns_zonemgr_attach(dns_zonemgr_t
*source
, dns_zonemgr_t
**target
);
1141 * Attach '*target' to 'source' incrementing its external
1145 * 'zone' to be a valid zone.
1146 * 'target' to be non NULL and '*target' to be NULL.
1150 dns_zonemgr_detach(dns_zonemgr_t
**zmgrp
);
1152 * Detach from a zone manager.
1155 * '*zmgrp' is a valid, non-NULL zone manager pointer.
1162 dns_zonemgr_releasezone(dns_zonemgr_t
*zmgr
, dns_zone_t
*zone
);
1164 * Release 'zone' from the managed by 'zmgr'. 'zmgr' is implicitly
1165 * detached from 'zone'.
1168 * 'zmgr' to be a valid zone manager.
1169 * 'zone' to be a valid zone.
1170 * 'zmgr' == 'zone->zmgr'
1173 * 'zone->zmgr' == NULL;
1177 dns_zonemgr_settransfersin(dns_zonemgr_t
*zmgr
, isc_uint32_t value
);
1179 * Set the maximum number of simultanious transfers in allowed by
1183 * 'zmgr' to be a valid zone manager.
1187 dns_zonemgr_getttransfersin(dns_zonemgr_t
*zmgr
);
1189 * Return the the maximum number of simultanious transfers in allowed.
1192 * 'zmgr' to be a valid zone manager.
1196 dns_zonemgr_settransfersperns(dns_zonemgr_t
*zmgr
, isc_uint32_t value
);
1198 * Set the number of zone transfers allowed per nameserver.
1201 * 'zmgr' to be a valid zone manager
1205 dns_zonemgr_getttransfersperns(dns_zonemgr_t
*zmgr
);
1207 * Return the number of transfers allowed per nameserver.
1210 * 'zmgr' to be a valid zone manager.
1214 dns_zonemgr_setiolimit(dns_zonemgr_t
*zmgr
, isc_uint32_t iolimit
);
1216 * Set the number of simultaneous file descriptors available for
1217 * reading and writing masterfiles.
1220 * 'zmgr' to be a valid zone manager.
1221 * 'iolimit' to be positive.
1225 dns_zonemgr_getiolimit(dns_zonemgr_t
*zmgr
);
1227 * Get the number of simultaneous file descriptors available for
1228 * reading and writing masterfiles.
1231 * 'zmgr' to be a valid zone manager.
1235 dns_zonemgr_setserialqueryrate(dns_zonemgr_t
*zmgr
, unsigned int value
);
1237 * Set the number of SOA queries sent per second.
1240 * 'zmgr' to be a valid zone manager
1244 dns_zonemgr_getserialqueryrate(dns_zonemgr_t
*zmgr
);
1246 * Return the number of SOA queries sent per second.
1249 * 'zmgr' to be a valid zone manager.
1253 dns_zonemgr_getcount(dns_zonemgr_t
*zmgr
, int state
);
1255 * Returns the number of zones in the specified state.
1258 * 'zmgr' to be a valid zone manager.
1259 * 'state' to be a valid DNS_ZONESTATE_ constant.
1263 dns_zone_forcereload(dns_zone_t
*zone
);
1265 * Force a reload of specified zone.
1268 * 'zone' to be a valid zone.
1272 dns_zone_isforced(dns_zone_t
*zone
);
1274 * Check if the zone is waiting a forced reload.
1277 * 'zone' to be a valid zone.
1281 dns_zone_setstatistics(dns_zone_t
*zone
, isc_boolean_t on
);
1283 * Make the zone keep or not keep an array of statistics
1287 * zone be a valid zone.
1291 dns_zone_getstatscounters(dns_zone_t
*zone
);
1294 * zone be a valid zone.
1297 * A pointer to the zone's array of statistics counters,
1298 * or NULL if it has none.
1302 dns_zone_dialup(dns_zone_t
*zone
);
1304 * Perform dialup-time maintenance on 'zone'.
1308 dns_zone_setdialup(dns_zone_t
*zone
, dns_dialuptype_t dialup
);
1310 * Set the dialup type of 'zone' to 'dialup'.
1313 * 'zone' to be valid initialised zone.
1314 * 'dialup' to be a valid dialup type.
1318 dns_zone_log(dns_zone_t
*zone
, int level
, const char *msg
, ...)
1319 ISC_FORMAT_PRINTF(3, 4);
1321 * Log the message 'msg...' at 'level', including text that identifies
1322 * the message as applying to 'zone'.
1327 #endif /* DNS_ZONE_H */