]> CyberLeo.Net >> Repos - FreeBSD/releng/9.3.git/blob - contrib/bind9/lib/dns/include/dns/zone.h
Fix BIND remote denial of service vulnerability. [SA-15:27]
[FreeBSD/releng/9.3.git] / contrib / bind9 / lib / dns / include / dns / zone.h
1 /*
2  * Copyright (C) 2004-2013  Internet Systems Consortium, Inc. ("ISC")
3  * Copyright (C) 1999-2003  Internet Software Consortium.
4  *
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.
8  *
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.
16  */
17
18 /* $Id$ */
19
20 #ifndef DNS_ZONE_H
21 #define DNS_ZONE_H 1
22
23 /*! \file dns/zone.h */
24
25 /***
26  ***    Imports
27  ***/
28
29 #include <stdio.h>
30
31 #include <isc/formatcheck.h>
32 #include <isc/lang.h>
33 #include <isc/rwlock.h>
34
35 #include <dns/master.h>
36 #include <dns/masterdump.h>
37 #include <dns/rdatastruct.h>
38 #include <dns/rpz.h>
39 #include <dns/types.h>
40 #include <dns/zt.h>
41
42 typedef enum {
43         dns_zone_none,
44         dns_zone_master,
45         dns_zone_slave,
46         dns_zone_stub,
47         dns_zone_staticstub,
48         dns_zone_key,
49         dns_zone_dlz,
50         dns_zone_redirect
51 } dns_zonetype_t;
52
53 typedef enum {
54         dns_zonestat_none = 0,
55         dns_zonestat_terse,
56         dns_zonestat_full
57 } dns_zonestat_level_t;
58
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 */
91
92 #ifndef NOMINUM_PUBLIC
93 /*
94  * Nominum specific options build down.
95  */
96 #define DNS_ZONEOPT_NOTIFYFORWARD 0x80000000U   /* forward notify to master */
97 #endif /* NOMINUM_PUBLIC */
98
99 /*
100  * Zone key maintenance options
101  */
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 */
107
108 #ifndef DNS_ZONE_MINREFRESH
109 #define DNS_ZONE_MINREFRESH                 300 /*%< 5 minutes */
110 #endif
111 #ifndef DNS_ZONE_MAXREFRESH
112 #define DNS_ZONE_MAXREFRESH             2419200 /*%< 4 weeks */
113 #endif
114 #ifndef DNS_ZONE_DEFAULTREFRESH
115 #define DNS_ZONE_DEFAULTREFRESH            3600 /*%< 1 hour */
116 #endif
117 #ifndef DNS_ZONE_MINRETRY
118 #define DNS_ZONE_MINRETRY                   300 /*%< 5 minutes */
119 #endif
120 #ifndef DNS_ZONE_MAXRETRY
121 #define DNS_ZONE_MAXRETRY               1209600 /*%< 2 weeks */
122 #endif
123 #ifndef DNS_ZONE_DEFAULTRETRY
124 #define DNS_ZONE_DEFAULTRETRY                60 /*%< 1 minute, subject to
125                                                    exponential backoff */
126 #endif
127
128 #define DNS_ZONESTATE_XFERRUNNING       1
129 #define DNS_ZONESTATE_XFERDEFERRED      2
130 #define DNS_ZONESTATE_SOAQUERY          3
131 #define DNS_ZONESTATE_ANY               4
132
133 ISC_LANG_BEGINDECLS
134
135 /***
136  ***    Functions
137  ***/
138
139 isc_result_t
140 dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx);
141 /*%<
142  *      Creates a new empty zone and attach '*zonep' to it.
143  *
144  * Requires:
145  *\li   'zonep' to point to a NULL pointer.
146  *\li   'mctx' to be a valid memory context.
147  *
148  * Ensures:
149  *\li   '*zonep' refers to a valid zone.
150  *
151  * Returns:
152  *\li   #ISC_R_SUCCESS
153  *\li   #ISC_R_NOMEMORY
154  *\li   #ISC_R_UNEXPECTED
155  */
156
157 void
158 dns_zone_setclass(dns_zone_t *zone, dns_rdataclass_t rdclass);
159 /*%<
160  *      Sets the class of a zone.  This operation can only be performed
161  *      once on a zone.
162  *
163  * Require:
164  *\li   'zone' to be a valid zone.
165  *\li   dns_zone_setclass() not to have been called since the zone was
166  *      created.
167  *\li   'rdclass' != dns_rdataclass_none.
168  */
169
170 dns_rdataclass_t
171 dns_zone_getclass(dns_zone_t *zone);
172 /*%<
173  *      Returns the current zone class.
174  *
175  * Requires:
176  *\li   'zone' to be a valid zone.
177  */
178
179 isc_result_t
180 dns_zone_getserial2(dns_zone_t *zone, isc_uint32_t *serialp);
181
182 isc_uint32_t
183 dns_zone_getserial(dns_zone_t *zone);
184 /*%<
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().
189  *
190  * Requires:
191  *\li   'zone' to be a valid zone.
192  *\li   'serialp' to be non NULL
193  *
194  * Returns:
195  *\li   #ISC_R_SUCCESS
196  *\li   #DNS_R_NOTLOADED        zone DB is not loaded
197  */
198
199 void
200 dns_zone_settype(dns_zone_t *zone, dns_zonetype_t type);
201 /*%<
202  *      Sets the zone type. This operation can only be performed once on
203  *      a zone.
204  *
205  * Requires:
206  *\li   'zone' to be a valid zone.
207  *\li   dns_zone_settype() not to have been called since the zone was
208  *      created.
209  *\li   'type' != dns_zone_none
210  */
211
212 void
213 dns_zone_setview(dns_zone_t *zone, dns_view_t *view);
214 /*%<
215  *      Associate the zone with a view.
216  *
217  * Require:
218  *\li   'zone' to be a valid zone.
219  */
220
221 dns_view_t *
222 dns_zone_getview(dns_zone_t *zone);
223 /*%<
224  *      Returns the zone's associated view.
225  *
226  * Requires:
227  *\li   'zone' to be a valid zone.
228  */
229
230 isc_result_t
231 dns_zone_setorigin(dns_zone_t *zone, const dns_name_t *origin);
232 /*%<
233  *      Sets the zones origin to 'origin'.
234  *
235  * Require:
236  *\li   'zone' to be a valid zone.
237  *\li   'origin' to be non NULL.
238  *
239  * Returns:
240  *\li   #ISC_R_SUCCESS
241  *\li   #ISC_R_NOMEMORY
242  */
243
244 dns_name_t *
245 dns_zone_getorigin(dns_zone_t *zone);
246 /*%<
247  *      Returns the value of the origin.
248  *
249  * Require:
250  *\li   'zone' to be a valid zone.
251  */
252
253 isc_result_t
254 dns_zone_setfile(dns_zone_t *zone, const char *file);
255
256 isc_result_t
257 dns_zone_setfile2(dns_zone_t *zone, const char *file,
258                   dns_masterformat_t format);
259 /*%<
260  *    Sets the name of the master file in the format of 'format' from which
261  *    the zone loads its database to 'file'.
262  *
263  *    For zones that have no associated master file, 'file' will be NULL.
264  *
265  *      For zones with persistent databases, the file name
266  *      setting is ignored.
267  *
268  *    dns_zone_setfile() is a backward-compatible form of
269  *    dns_zone_setfile2(), which always specifies the
270  *    dns_masterformat_text (RFC1035) format.
271  *
272  * Require:
273  *\li   'zone' to be a valid zone.
274  *
275  * Returns:
276  *\li   #ISC_R_NOMEMORY
277  *\li   #ISC_R_SUCCESS
278  */
279
280 const char *
281 dns_zone_getfile(dns_zone_t *zone);
282 /*%<
283  *      Gets the name of the zone's master file, if any.
284  *
285  * Requires:
286  *\li   'zone' to be valid initialised zone.
287  *
288  * Returns:
289  *\li   Pointer to null-terminated file name, or NULL.
290  */
291
292 isc_result_t
293 dns_zone_load(dns_zone_t *zone);
294
295 isc_result_t
296 dns_zone_loadnew(dns_zone_t *zone);
297
298 isc_result_t
299 dns_zone_loadandthaw(dns_zone_t *zone);
300
301 /*%<
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.
305  *
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.
311  *
312  * Require:
313  *\li   'zone' to be a valid zone.
314  *
315  * Returns:
316  *\li   #ISC_R_UNEXPECTED
317  *\li   #ISC_R_SUCCESS
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.
321  *\li   DNS_R_BADZONE
322  *\li   Any result value from dns_db_load().
323  */
324
325 isc_result_t
326 dns_zone_asyncload(dns_zone_t *zone, dns_zt_zoneloaded_t done, void *arg);
327 /*%<
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
333  * purposes.)
334  */
335
336 isc_boolean_t
337 dns__zone_loadpending(dns_zone_t *zone);
338 /*%<
339  * Indicates whether the zone is waiting to be loaded asynchronously.
340  * (Not currently intended for use outside of this module and associated
341  * tests.)
342  */
343
344 void
345 dns_zone_attach(dns_zone_t *source, dns_zone_t **target);
346 /*%<
347  *      Attach '*target' to 'source' incrementing its external
348  *      reference count.
349  *
350  * Require:
351  *\li   'zone' to be a valid zone.
352  *\li   'target' to be non NULL and '*target' to be NULL.
353  */
354
355 void
356 dns_zone_detach(dns_zone_t **zonep);
357 /*%<
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.
361  *
362  * Require:
363  *\li   'zonep' to point to a valid zone.
364  */
365
366 void
367 dns_zone_iattach(dns_zone_t *source, dns_zone_t **target);
368 /*%<
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.
373  *
374  * Require:
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.
378  */
379
380 void
381 dns_zone_idetach(dns_zone_t **zonep);
382 /*%<
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.
386  *
387  * Require:
388  *\li   The caller is running in the context of the zone's task.
389  *\li   'zonep' to point to a valid zone.
390  */
391
392 void
393 dns_zone_setflag(dns_zone_t *zone, unsigned int flags, isc_boolean_t value);
394 /*%<
395  *      Sets ('value' == 'ISC_TRUE') / clears ('value' == 'IS_FALSE')
396  *      zone flags.  Valid flag bits are DNS_ZONE_F_*.
397  *
398  * Requires
399  *\li   'zone' to be a valid zone.
400  */
401
402 isc_result_t
403 dns_zone_getdb(dns_zone_t *zone, dns_db_t **dbp);
404 /*%<
405  *      Attach '*dbp' to the database to if it exists otherwise
406  *      return DNS_R_NOTLOADED.
407  *
408  * Require:
409  *\li   'zone' to be a valid zone.
410  *\li   'dbp' to be != NULL && '*dbp' == NULL.
411  *
412  * Returns:
413  *\li   #ISC_R_SUCCESS
414  *\li   DNS_R_NOTLOADED
415  */
416
417 void
418 dns_zone_setdb(dns_zone_t *zone, dns_db_t *db);
419 /*%<
420  *      Sets the zone database to 'db'.
421  *
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.
427  *
428  * Require:
429  *\li   'zone' to be a valid zone of static-stub.
430  *\li   zone doesn't have a database.
431  */
432
433 isc_result_t
434 dns_zone_setdbtype(dns_zone_t *zone,
435                    unsigned int dbargc, const char * const *dbargv);
436 /*%<
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.
440  *
441  * Require:
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
446  *
447  * Returns:
448  *\li   #ISC_R_NOMEMORY
449  *\li   #ISC_R_SUCCESS
450  */
451
452 isc_result_t
453 dns_zone_getdbtype(dns_zone_t *zone, char ***argv, isc_mem_t *mctx);
454 /*%<
455  *      Returns the current dbtype.  isc_mem_free() should be used
456  *      to free 'argv' after use.
457  *
458  * Require:
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.
462  *
463  * Returns:
464  *\li   #ISC_R_NOMEMORY
465  *\li   #ISC_R_SUCCESS
466  */
467
468 void
469 dns_zone_markdirty(dns_zone_t *zone);
470 /*%<
471  *      Mark a zone as 'dirty'.
472  *
473  * Require:
474  *\li   'zone' to be a valid zone.
475  */
476
477 void
478 dns_zone_expire(dns_zone_t *zone);
479 /*%<
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.
483  *
484  * Require
485  *\li   'zone' to be a valid zone.
486  */
487
488 void
489 dns_zone_refresh(dns_zone_t *zone);
490 /*%<
491  *      Initiate zone up to date checks.  The zone must already be being
492  *      managed.
493  *
494  * Require
495  *\li   'zone' to be a valid zone.
496  */
497
498 isc_result_t
499 dns_zone_flush(dns_zone_t *zone);
500 /*%<
501  *      Write the zone to database if there are uncommitted changes.
502  *
503  * Require:
504  *\li   'zone' to be a valid zone.
505  */
506
507 isc_result_t
508 dns_zone_dump(dns_zone_t *zone);
509 /*%<
510  *      Write the zone to database.
511  *
512  * Require:
513  *\li   'zone' to be a valid zone.
514  */
515
516 isc_result_t
517 dns_zone_dumptostream(dns_zone_t *zone, FILE *fd);
518
519 isc_result_t
520 dns_zone_dumptostream2(dns_zone_t *zone, FILE *fd, dns_masterformat_t format,
521                        const dns_master_style_t *style);
522 isc_result_t
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);
526 /*%<
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).
530  *
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.
534  *
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.
538  *
539  *    Note that dns_zone_dumptostream3() is the most flexible form.  It
540  *    can also provide the functionality of dns_zone_fulldumptostream().
541  *
542  * Require:
543  *\li   'zone' to be a valid zone.
544  *\li   'fd' to be a stream open for writing.
545  */
546
547 isc_result_t
548 dns_zone_fulldumptostream(dns_zone_t *zone, FILE *fd);
549 /*%<
550  *      The same as dns_zone_dumptostream, but dumps the zone with
551  *      different dump settings (dns_master_style_full).
552  *
553  * Require:
554  *\li   'zone' to be a valid zone.
555  *\li   'fd' to be a stream open for writing.
556  */
557
558 void
559 dns_zone_maintenance(dns_zone_t *zone);
560 /*%<
561  *      Perform regular maintenance on the zone.  This is called as a
562  *      result of a zone being managed.
563  *
564  * Require
565  *\li   'zone' to be a valid zone.
566  */
567
568 isc_result_t
569 dns_zone_setmasters(dns_zone_t *zone, const isc_sockaddr_t *masters,
570                     isc_uint32_t count);
571 isc_result_t
572 dns_zone_setmasterswithkeys(dns_zone_t *zone,
573                             const isc_sockaddr_t *masters,
574                             dns_name_t **keynames,
575                             isc_uint32_t count);
576 /*%<
577  *      Set the list of master servers for the zone.
578  *
579  * Require:
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.
584  *
585  *  \li    dns_zone_setmasters() is just a wrapper to setmasterswithkeys(),
586  *      passing NULL in the keynames field.
587  *
588  * \li  If 'masters' is NULL then 'count' must be zero.
589  *
590  * Returns:
591  *\li   #ISC_R_SUCCESS
592  *\li   #ISC_R_NOMEMORY
593  *\li      Any result dns_name_dup() can return, if keynames!=NULL
594  */
595
596 isc_result_t
597 dns_zone_setalsonotify(dns_zone_t *zone, const isc_sockaddr_t *notify,
598                        isc_uint32_t count);
599 isc_result_t
600 dns_zone_setalsonotifywithkeys(dns_zone_t *zone, const isc_sockaddr_t *notify,
601                                                            dns_name_t **keynames, isc_uint32_t count);
602 /*%<
603  *      Set the list of additional servers to be notified when
604  *      a zone changes.  To clear the list use 'count = 0'.
605  *
606  *      dns_zone_alsonotifywithkeys() allows each notify address to
607  *      be associated with a TSIG key.
608  *
609  * Require:
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.
613  *
614  * Returns:
615  *\li   #ISC_R_SUCCESS
616  *\li   #ISC_R_NOMEMORY
617  */
618
619 void
620 dns_zone_unload(dns_zone_t *zone);
621 /*%<
622  *      detach the database from the zone structure.
623  *
624  * Require:
625  *\li   'zone' to be a valid zone.
626  */
627
628 void
629 dns_zone_setoption(dns_zone_t *zone, unsigned int option, isc_boolean_t value);
630 /*%<
631  *      Set given options on ('value' == ISC_TRUE) or off ('value' ==
632  *      #ISC_FALSE).
633  *
634  * Require:
635  *\li   'zone' to be a valid zone.
636  */
637
638 unsigned int
639 dns_zone_getoptions(dns_zone_t *zone);
640 /*%<
641  *      Returns the current zone options.
642  *
643  * Require:
644  *\li   'zone' to be a valid zone.
645  */
646
647 void
648 dns_zone_setkeyopt(dns_zone_t *zone, unsigned int option, isc_boolean_t value);
649 /*%<
650  *      Set key options on ('value' == ISC_TRUE) or off ('value' ==
651  *      #ISC_FALSE).
652  *
653  * Require:
654  *\li   'zone' to be a valid zone.
655  */
656
657 unsigned int
658 dns_zone_getkeyopts(dns_zone_t *zone);
659 /*%<
660  *      Returns the current zone key options.
661  *
662  * Require:
663  *\li   'zone' to be a valid zone.
664  */
665
666 void
667 dns_zone_setminrefreshtime(dns_zone_t *zone, isc_uint32_t val);
668 /*%<
669  *      Set the minimum refresh time.
670  *
671  * Requires:
672  *\li   'zone' is valid.
673  *\li   val > 0.
674  */
675
676 void
677 dns_zone_setmaxrefreshtime(dns_zone_t *zone, isc_uint32_t val);
678 /*%<
679  *      Set the maximum refresh time.
680  *
681  * Requires:
682  *\li   'zone' is valid.
683  *\li   val > 0.
684  */
685
686 void
687 dns_zone_setminretrytime(dns_zone_t *zone, isc_uint32_t val);
688 /*%<
689  *      Set the minimum retry time.
690  *
691  * Requires:
692  *\li   'zone' is valid.
693  *\li   val > 0.
694  */
695
696 void
697 dns_zone_setmaxretrytime(dns_zone_t *zone, isc_uint32_t val);
698 /*%<
699  *      Set the maximum retry time.
700  *
701  * Requires:
702  *\li   'zone' is valid.
703  *      val > 0.
704  */
705
706 isc_result_t
707 dns_zone_setxfrsource4(dns_zone_t *zone, const isc_sockaddr_t *xfrsource);
708 isc_result_t
709 dns_zone_setaltxfrsource4(dns_zone_t *zone,
710                           const isc_sockaddr_t *xfrsource);
711 /*%<
712  *      Set the source address to be used in IPv4 zone transfers.
713  *
714  * Require:
715  *\li   'zone' to be a valid zone.
716  *\li   'xfrsource' to contain the address.
717  *
718  * Returns:
719  *\li   #ISC_R_SUCCESS
720  */
721
722 isc_sockaddr_t *
723 dns_zone_getxfrsource4(dns_zone_t *zone);
724 isc_sockaddr_t *
725 dns_zone_getaltxfrsource4(dns_zone_t *zone);
726 /*%<
727  *      Returns the source address set by a previous dns_zone_setxfrsource4
728  *      call, or the default of inaddr_any, port 0.
729  *
730  * Require:
731  *\li   'zone' to be a valid zone.
732  */
733
734 isc_result_t
735 dns_zone_setxfrsource6(dns_zone_t *zone, const isc_sockaddr_t *xfrsource);
736 isc_result_t
737 dns_zone_setaltxfrsource6(dns_zone_t *zone,
738                           const isc_sockaddr_t *xfrsource);
739 /*%<
740  *      Set the source address to be used in IPv6 zone transfers.
741  *
742  * Require:
743  *\li   'zone' to be a valid zone.
744  *\li   'xfrsource' to contain the address.
745  *
746  * Returns:
747  *\li   #ISC_R_SUCCESS
748  */
749
750 isc_sockaddr_t *
751 dns_zone_getxfrsource6(dns_zone_t *zone);
752 isc_sockaddr_t *
753 dns_zone_getaltxfrsource6(dns_zone_t *zone);
754 /*%<
755  *      Returns the source address set by a previous dns_zone_setxfrsource6
756  *      call, or the default of in6addr_any, port 0.
757  *
758  * Require:
759  *\li   'zone' to be a valid zone.
760  */
761
762 isc_result_t
763 dns_zone_setnotifysrc4(dns_zone_t *zone, const isc_sockaddr_t *notifysrc);
764 /*%<
765  *      Set the source address to be used with IPv4 NOTIFY messages.
766  *
767  * Require:
768  *\li   'zone' to be a valid zone.
769  *\li   'notifysrc' to contain the address.
770  *
771  * Returns:
772  *\li   #ISC_R_SUCCESS
773  */
774
775 isc_sockaddr_t *
776 dns_zone_getnotifysrc4(dns_zone_t *zone);
777 /*%<
778  *      Returns the source address set by a previous dns_zone_setnotifysrc4
779  *      call, or the default of inaddr_any, port 0.
780  *
781  * Require:
782  *\li   'zone' to be a valid zone.
783  */
784
785 isc_result_t
786 dns_zone_setnotifysrc6(dns_zone_t *zone, const isc_sockaddr_t *notifysrc);
787 /*%<
788  *      Set the source address to be used with IPv6 NOTIFY messages.
789  *
790  * Require:
791  *\li   'zone' to be a valid zone.
792  *\li   'notifysrc' to contain the address.
793  *
794  * Returns:
795  *\li   #ISC_R_SUCCESS
796  */
797
798 isc_sockaddr_t *
799 dns_zone_getnotifysrc6(dns_zone_t *zone);
800 /*%<
801  *      Returns the source address set by a previous dns_zone_setnotifysrc6
802  *      call, or the default of in6addr_any, port 0.
803  *
804  * Require:
805  *\li   'zone' to be a valid zone.
806  */
807
808 void
809 dns_zone_setnotifyacl(dns_zone_t *zone, dns_acl_t *acl);
810 /*%<
811  *      Sets the notify acl list for the zone.
812  *
813  * Require:
814  *\li   'zone' to be a valid zone.
815  *\li   'acl' to be a valid acl.
816  */
817
818 void
819 dns_zone_setqueryacl(dns_zone_t *zone, dns_acl_t *acl);
820 /*%<
821  *      Sets the query acl list for the zone.
822  *
823  * Require:
824  *\li   'zone' to be a valid zone.
825  *\li   'acl' to be a valid acl.
826  */
827
828 void
829 dns_zone_setqueryonacl(dns_zone_t *zone, dns_acl_t *acl);
830 /*%<
831  *      Sets the query-on acl list for the zone.
832  *
833  * Require:
834  *\li   'zone' to be a valid zone.
835  *\li   'acl' to be a valid acl.
836  */
837
838 void
839 dns_zone_setupdateacl(dns_zone_t *zone, dns_acl_t *acl);
840 /*%<
841  *      Sets the update acl list for the zone.
842  *
843  * Require:
844  *\li   'zone' to be a valid zone.
845  *\li   'acl' to be valid acl.
846  */
847
848 void
849 dns_zone_setforwardacl(dns_zone_t *zone, dns_acl_t *acl);
850 /*%<
851  *      Sets the forward unsigned updates acl list for the zone.
852  *
853  * Require:
854  *\li   'zone' to be a valid zone.
855  *\li   'acl' to be valid acl.
856  */
857
858 void
859 dns_zone_setxfracl(dns_zone_t *zone, dns_acl_t *acl);
860 /*%<
861  *      Sets the transfer acl list for the zone.
862  *
863  * Require:
864  *\li   'zone' to be a valid zone.
865  *\li   'acl' to be valid acl.
866  */
867
868 dns_acl_t *
869 dns_zone_getnotifyacl(dns_zone_t *zone);
870 /*%<
871  *      Returns the current notify acl or NULL.
872  *
873  * Require:
874  *\li   'zone' to be a valid zone.
875  *
876  * Returns:
877  *\li   acl a pointer to the acl.
878  *\li   NULL
879  */
880
881 dns_acl_t *
882 dns_zone_getqueryacl(dns_zone_t *zone);
883 /*%<
884  *      Returns the current query acl or NULL.
885  *
886  * Require:
887  *\li   'zone' to be a valid zone.
888  *
889  * Returns:
890  *\li   acl a pointer to the acl.
891  *\li   NULL
892  */
893
894 dns_acl_t *
895 dns_zone_getqueryonacl(dns_zone_t *zone);
896 /*%<
897  *      Returns the current query-on acl or NULL.
898  *
899  * Require:
900  *\li   'zone' to be a valid zone.
901  *
902  * Returns:
903  *\li   acl a pointer to the acl.
904  *\li   NULL
905  */
906
907 dns_acl_t *
908 dns_zone_getupdateacl(dns_zone_t *zone);
909 /*%<
910  *      Returns the current update acl or NULL.
911  *
912  * Require:
913  *\li   'zone' to be a valid zone.
914  *
915  * Returns:
916  *\li   acl a pointer to the acl.
917  *\li   NULL
918  */
919
920 dns_acl_t *
921 dns_zone_getforwardacl(dns_zone_t *zone);
922 /*%<
923  *      Returns the current forward unsigned updates acl or NULL.
924  *
925  * Require:
926  *\li   'zone' to be a valid zone.
927  *
928  * Returns:
929  *\li   acl a pointer to the acl.
930  *\li   NULL
931  */
932
933 dns_acl_t *
934 dns_zone_getxfracl(dns_zone_t *zone);
935 /*%<
936  *      Returns the current transfer acl or NULL.
937  *
938  * Require:
939  *\li   'zone' to be a valid zone.
940  *
941  * Returns:
942  *\li   acl a pointer to the acl.
943  *\li   NULL
944  */
945
946 void
947 dns_zone_clearupdateacl(dns_zone_t *zone);
948 /*%<
949  *      Clear the current update acl.
950  *
951  * Require:
952  *\li   'zone' to be a valid zone.
953  */
954
955 void
956 dns_zone_clearforwardacl(dns_zone_t *zone);
957 /*%<
958  *      Clear the current forward unsigned updates acl.
959  *
960  * Require:
961  *\li   'zone' to be a valid zone.
962  */
963
964 void
965 dns_zone_clearnotifyacl(dns_zone_t *zone);
966 /*%<
967  *      Clear the current notify acl.
968  *
969  * Require:
970  *\li   'zone' to be a valid zone.
971  */
972
973 void
974 dns_zone_clearqueryacl(dns_zone_t *zone);
975 /*%<
976  *      Clear the current query acl.
977  *
978  * Require:
979  *\li   'zone' to be a valid zone.
980  */
981
982 void
983 dns_zone_clearqueryonacl(dns_zone_t *zone);
984 /*%<
985  *      Clear the current query-on acl.
986  *
987  * Require:
988  *\li   'zone' to be a valid zone.
989  */
990
991 void
992 dns_zone_clearxfracl(dns_zone_t *zone);
993 /*%<
994  *      Clear the current transfer acl.
995  *
996  * Require:
997  *\li   'zone' to be a valid zone.
998  */
999
1000 isc_boolean_t
1001 dns_zone_getupdatedisabled(dns_zone_t *zone);
1002 /*%<
1003  * Return update disabled.
1004  * Transient unless called when running in isc_task_exclusive() mode.
1005  */
1006
1007 void
1008 dns_zone_setupdatedisabled(dns_zone_t *zone, isc_boolean_t state);
1009 /*%<
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.
1014  */
1015
1016 isc_boolean_t
1017 dns_zone_getzeronosoattl(dns_zone_t *zone);
1018 /*%<
1019  * Return zero-no-soa-ttl status.
1020  */
1021
1022 void
1023 dns_zone_setzeronosoattl(dns_zone_t *zone, isc_boolean_t state);
1024 /*%<
1025  * Set zero-no-soa-ttl status.
1026  */
1027
1028 void
1029 dns_zone_setchecknames(dns_zone_t *zone, dns_severity_t severity);
1030 /*%<
1031  *      Set the severity of name checking when loading a zone.
1032  *
1033  * Require:
1034  * \li     'zone' to be a valid zone.
1035  */
1036
1037 dns_severity_t
1038 dns_zone_getchecknames(dns_zone_t *zone);
1039 /*%<
1040  *      Return the current severity of name checking.
1041  *
1042  * Require:
1043  *\li   'zone' to be a valid zone.
1044  */
1045
1046 void
1047 dns_zone_setjournalsize(dns_zone_t *zone, isc_int32_t size);
1048 /*%<
1049  *      Sets the journal size for the zone.
1050  *
1051  * Requires:
1052  *\li   'zone' to be a valid zone.
1053  */
1054
1055 isc_int32_t
1056 dns_zone_getjournalsize(dns_zone_t *zone);
1057 /*%<
1058  *      Return the journal size as set with a previous call to
1059  *      dns_zone_setjournalsize().
1060  *
1061  * Requires:
1062  *\li   'zone' to be a valid zone.
1063  */
1064
1065 isc_result_t
1066 dns_zone_notifyreceive(dns_zone_t *zone, isc_sockaddr_t *from,
1067                        dns_message_t *msg);
1068 /*%<
1069  *      Tell the zone that it has received a NOTIFY message from another
1070  *      server.  This may cause some zone maintenance activity to occur.
1071  *
1072  * Requires:
1073  *\li   'zone' to be a valid zone.
1074  *\li   '*from' to contain the address of the server from which 'msg'
1075  *              was received.
1076  *\li   'msg' a message with opcode NOTIFY and qr clear.
1077  *
1078  * Returns:
1079  *\li   DNS_R_REFUSED
1080  *\li   DNS_R_NOTIMP
1081  *\li   DNS_R_FORMERR
1082  *\li   DNS_R_SUCCESS
1083  */
1084
1085 void
1086 dns_zone_setmaxxfrin(dns_zone_t *zone, isc_uint32_t maxxfrin);
1087 /*%<
1088  * Set the maximum time (in seconds) that a zone transfer in (AXFR/IXFR)
1089  * of this zone will use before being aborted.
1090  *
1091  * Requires:
1092  * \li  'zone' to be valid initialised zone.
1093  */
1094
1095 isc_uint32_t
1096 dns_zone_getmaxxfrin(dns_zone_t *zone);
1097 /*%<
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.
1101  *
1102  * Requires:
1103  *\li   'zone' to be valid initialised zone.
1104  */
1105
1106 void
1107 dns_zone_setmaxxfrout(dns_zone_t *zone, isc_uint32_t maxxfrout);
1108 /*%<
1109  * Set the maximum time (in seconds) that a zone transfer out (AXFR/IXFR)
1110  * of this zone will use before being aborted.
1111  *
1112  * Requires:
1113  * \li  'zone' to be valid initialised zone.
1114  */
1115
1116 isc_uint32_t
1117 dns_zone_getmaxxfrout(dns_zone_t *zone);
1118 /*%<
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.
1122  *
1123  * Requires:
1124  *\li   'zone' to be valid initialised zone.
1125  */
1126
1127 isc_result_t
1128 dns_zone_setjournal(dns_zone_t *zone, const char *journal);
1129 /*%<
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
1133  * journal name.
1134  *
1135  * Requires:
1136  *\li   'zone' to be a valid zone.
1137  *
1138  * Returns:
1139  *\li   #ISC_R_SUCCESS
1140  *\li   #ISC_R_NOMEMORY
1141  */
1142
1143 char *
1144 dns_zone_getjournal(dns_zone_t *zone);
1145 /*%<
1146  * Returns the journal name associated with this zone.
1147  * If no journal has been set this will be NULL.
1148  *
1149  * Requires:
1150  *\li   'zone' to be valid initialised zone.
1151  */
1152
1153 dns_zonetype_t
1154 dns_zone_gettype(dns_zone_t *zone);
1155 /*%<
1156  * Returns the type of the zone (master/slave/etc.)
1157  *
1158  * Requires:
1159  *\li   'zone' to be valid initialised zone.
1160  */
1161
1162 void
1163 dns_zone_settask(dns_zone_t *zone, isc_task_t *task);
1164 /*%<
1165  * Give a zone a task to work with.  Any current task will be detached.
1166  *
1167  * Requires:
1168  *\li   'zone' to be valid.
1169  *\li   'task' to be valid.
1170  */
1171
1172 void
1173 dns_zone_gettask(dns_zone_t *zone, isc_task_t **target);
1174 /*%<
1175  * Attach '*target' to the zone's task.
1176  *
1177  * Requires:
1178  *\li   'zone' to be valid initialised zone.
1179  *\li   'zone' to have a task.
1180  *\li   'target' to be != NULL && '*target' == NULL.
1181  */
1182
1183 void
1184 dns_zone_notify(dns_zone_t *zone);
1185 /*%<
1186  * Generate notify events for this zone.
1187  *
1188  * Requires:
1189  *\li   'zone' to be a valid zone.
1190  */
1191
1192 isc_result_t
1193 dns_zone_replacedb(dns_zone_t *zone, dns_db_t *db, isc_boolean_t dump);
1194 /*%<
1195  * Replace the database of "zone" with a new database "db".
1196  *
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.
1202  *
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.
1206  *
1207  * Requires:
1208  * \li  'zone' to be a valid zone.
1209  *
1210  * Returns:
1211  * \li  DNS_R_SUCCESS
1212  * \li  DNS_R_BADZONE   zone failed basic consistency checks:
1213  *                      * a single SOA must exist
1214  *                      * some NS records must exist.
1215  *      Others
1216  */
1217
1218 isc_uint32_t
1219 dns_zone_getidlein(dns_zone_t *zone);
1220 /*%<
1221  * Requires:
1222  * \li  'zone' to be a valid zone.
1223  *
1224  * Returns:
1225  * \li  number of seconds of idle time before we abort the transfer in.
1226  */
1227
1228 void
1229 dns_zone_setidlein(dns_zone_t *zone, isc_uint32_t idlein);
1230 /*%<
1231  * \li  Set the idle timeout for transfer the.
1232  * \li  Zero set the default value, 1 hour.
1233  *
1234  * Requires:
1235  * \li  'zone' to be a valid zone.
1236  */
1237
1238 isc_uint32_t
1239 dns_zone_getidleout(dns_zone_t *zone);
1240 /*%<
1241  *
1242  * Requires:
1243  * \li  'zone' to be a valid zone.
1244  *
1245  * Returns:
1246  * \li  number of seconds of idle time before we abort a transfer out.
1247  */
1248
1249 void
1250 dns_zone_setidleout(dns_zone_t *zone, isc_uint32_t idleout);
1251 /*%<
1252  * \li  Set the idle timeout for transfers out.
1253  * \li  Zero set the default value, 1 hour.
1254  *
1255  * Requires:
1256  * \li  'zone' to be a valid zone.
1257  */
1258
1259 void
1260 dns_zone_getssutable(dns_zone_t *zone, dns_ssutable_t **table);
1261 /*%<
1262  * Get the simple-secure-update policy table.
1263  *
1264  * Requires:
1265  * \li  'zone' to be a valid zone.
1266  */
1267
1268 void
1269 dns_zone_setssutable(dns_zone_t *zone, dns_ssutable_t *table);
1270 /*%<
1271  * Set / clear the simple-secure-update policy table.
1272  *
1273  * Requires:
1274  * \li  'zone' to be a valid zone.
1275  */
1276
1277 isc_mem_t *
1278 dns_zone_getmctx(dns_zone_t *zone);
1279 /*%<
1280  * Get the memory context of a zone.
1281  *
1282  * Requires:
1283  * \li  'zone' to be a valid zone.
1284  */
1285
1286 dns_zonemgr_t *
1287 dns_zone_getmgr(dns_zone_t *zone);
1288 /*%<
1289  *      If 'zone' is managed return the zone manager otherwise NULL.
1290  *
1291  * Requires:
1292  * \li  'zone' to be a valid zone.
1293  */
1294
1295 void
1296 dns_zone_setsigvalidityinterval(dns_zone_t *zone, isc_uint32_t interval);
1297 /*%<
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.
1301  *
1302  * Requires:
1303  * \li  'zone' to be a valid zone.
1304  */
1305
1306 isc_uint32_t
1307 dns_zone_getsigvalidityinterval(dns_zone_t *zone);
1308 /*%<
1309  * Get the zone's RRSIG validity interval.
1310  *
1311  * Requires:
1312  * \li  'zone' to be a valid zone.
1313  */
1314
1315 void
1316 dns_zone_setsigresigninginterval(dns_zone_t *zone, isc_uint32_t interval);
1317 /*%<
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.
1320  *
1321  * Requires:
1322  * \li  'zone' to be a valid zone.
1323  */
1324
1325 isc_uint32_t
1326 dns_zone_getsigresigninginterval(dns_zone_t *zone);
1327 /*%<
1328  * Get the zone's RRSIG re-signing interval.
1329  *
1330  * Requires:
1331  * \li  'zone' to be a valid zone.
1332  */
1333
1334 void
1335 dns_zone_setnotifytype(dns_zone_t *zone, dns_notifytype_t notifytype);
1336 /*%<
1337  * Sets zone notify method to "notifytype"
1338  */
1339
1340 isc_result_t
1341 dns_zone_forwardupdate(dns_zone_t *zone, dns_message_t *msg,
1342                        dns_updatecallback_t callback, void *callback_arg);
1343 /*%<
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);
1351  *
1352  * Require:
1353  *\li   'zone' to be valid
1354  *\li   'msg' to be valid.
1355  *\li   'callback' to be non NULL.
1356  * Returns:
1357  *\li   #ISC_R_SUCCESS if the message has been forwarded,
1358  *\li   #ISC_R_NOMEMORY
1359  *\li   Others
1360  */
1361
1362 isc_result_t
1363 dns_zone_next(dns_zone_t *zone, dns_zone_t **next);
1364 /*%<
1365  * Find the next zone in the list of managed zones.
1366  *
1367  * Requires:
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.
1372  *
1373  * Ensures:
1374  *\li   'next' points to a valid zone (result ISC_R_SUCCESS) or to NULL
1375  *      (result ISC_R_NOMORE).
1376  */
1377
1378
1379
1380 isc_result_t
1381 dns_zone_first(dns_zonemgr_t *zmgr, dns_zone_t **first);
1382 /*%<
1383  * Find the first zone in the list of managed zones.
1384  *
1385  * Requires:
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
1390  *
1391  * Ensures:
1392  *\li   'first' points to a valid zone (result ISC_R_SUCCESS) or to NULL
1393  *      (result ISC_R_NOMORE).
1394  */
1395
1396 isc_result_t
1397 dns_zone_setkeydirectory(dns_zone_t *zone, const char *directory);
1398 /*%<
1399  *      Sets the name of the directory where private keys used for
1400  *      online signing of dynamic zones are found.
1401  *
1402  * Require:
1403  *\li   'zone' to be a valid zone.
1404  *
1405  * Returns:
1406  *\li   #ISC_R_NOMEMORY
1407  *\li   #ISC_R_SUCCESS
1408  */
1409
1410 const char *
1411 dns_zone_getkeydirectory(dns_zone_t *zone);
1412 /*%<
1413  *      Gets the name of the directory where private keys used for
1414  *      online signing of dynamic zones are found.
1415  *
1416  * Requires:
1417  *\li   'zone' to be valid initialised zone.
1418  *
1419  * Returns:
1420  *      Pointer to null-terminated file name, or NULL.
1421  */
1422
1423
1424 isc_result_t
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);
1428 /*%<
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.
1431  *
1432  * Requires:
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.
1437  */
1438
1439 isc_result_t
1440 dns_zonemgr_setsize(dns_zonemgr_t *zmgr, int num_zones);
1441 /*%<
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.
1445  *
1446  * Requires:
1447  *\li   zmgr is a valid zone manager.
1448  *\li   zmgr->zonetasks has been initialized.
1449  */
1450
1451 isc_result_t
1452 dns_zonemgr_createzone(dns_zonemgr_t *zmgr, dns_zone_t **zonep);
1453 /*%<
1454  *      Allocate a new zone using a memory context from the
1455  *      zone manager's memory context pool.
1456  *
1457  * Require:
1458  *\li   'zmgr' to be a valid zone manager.
1459  *\li   'zonep' != NULL and '*zonep' == NULL.
1460  */
1461
1462
1463 isc_result_t
1464 dns_zonemgr_managezone(dns_zonemgr_t *zmgr, dns_zone_t *zone);
1465 /*%<
1466  *      Bring the zone under control of a zone manager.
1467  *
1468  * Require:
1469  *\li   'zmgr' to be a valid zone manager.
1470  *\li   'zone' to be a valid zone.
1471  */
1472
1473 isc_result_t
1474 dns_zonemgr_forcemaint(dns_zonemgr_t *zmgr);
1475 /*%<
1476  * Force zone maintenance of all zones managed by 'zmgr' at its
1477  * earliest convenience.
1478  */
1479
1480 void
1481 dns__zonemgr_run(isc_task_t *task, isc_event_t *event);
1482 /*%<
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.
1486  */
1487
1488 void
1489 dns_zonemgr_resumexfrs(dns_zonemgr_t *zmgr);
1490 /*%<
1491  * Attempt to start any stalled zone transfers.
1492  */
1493
1494 void
1495 dns_zonemgr_shutdown(dns_zonemgr_t *zmgr);
1496 /*%<
1497  *      Shut down the zone manager.
1498  *
1499  * Requires:
1500  *\li   'zmgr' to be a valid zone manager.
1501  */
1502
1503 void
1504 dns_zonemgr_attach(dns_zonemgr_t *source, dns_zonemgr_t **target);
1505 /*%<
1506  *      Attach '*target' to 'source' incrementing its external
1507  *      reference count.
1508  *
1509  * Require:
1510  *\li   'zone' to be a valid zone.
1511  *\li   'target' to be non NULL and '*target' to be NULL.
1512  */
1513
1514 void
1515 dns_zonemgr_detach(dns_zonemgr_t **zmgrp);
1516 /*%<
1517  *       Detach from a zone manager.
1518  *
1519  * Requires:
1520  *\li   '*zmgrp' is a valid, non-NULL zone manager pointer.
1521  *
1522  * Ensures:
1523  *\li   '*zmgrp' is NULL.
1524  */
1525
1526 void
1527 dns_zonemgr_releasezone(dns_zonemgr_t *zmgr, dns_zone_t *zone);
1528 /*%<
1529  *      Release 'zone' from the managed by 'zmgr'.  'zmgr' is implicitly
1530  *      detached from 'zone'.
1531  *
1532  * Requires:
1533  *\li   'zmgr' to be a valid zone manager.
1534  *\li   'zone' to be a valid zone.
1535  *\li   'zmgr' == 'zone->zmgr'
1536  *
1537  * Ensures:
1538  *\li   'zone->zmgr' == NULL;
1539  */
1540
1541 void
1542 dns_zonemgr_settransfersin(dns_zonemgr_t *zmgr, isc_uint32_t value);
1543 /*%<
1544  *      Set the maximum number of simultaneous transfers in allowed by
1545  *      the zone manager.
1546  *
1547  * Requires:
1548  *\li   'zmgr' to be a valid zone manager.
1549  */
1550
1551 isc_uint32_t
1552 dns_zonemgr_getttransfersin(dns_zonemgr_t *zmgr);
1553 /*%<
1554  *      Return the maximum number of simultaneous transfers in allowed.
1555  *
1556  * Requires:
1557  *\li   'zmgr' to be a valid zone manager.
1558  */
1559
1560 void
1561 dns_zonemgr_settransfersperns(dns_zonemgr_t *zmgr, isc_uint32_t value);
1562 /*%<
1563  *      Set the number of zone transfers allowed per nameserver.
1564  *
1565  * Requires:
1566  *\li   'zmgr' to be a valid zone manager
1567  */
1568
1569 isc_uint32_t
1570 dns_zonemgr_getttransfersperns(dns_zonemgr_t *zmgr);
1571 /*%<
1572  *      Return the number of transfers allowed per nameserver.
1573  *
1574  * Requires:
1575  *\li   'zmgr' to be a valid zone manager.
1576  */
1577
1578 void
1579 dns_zonemgr_setiolimit(dns_zonemgr_t *zmgr, isc_uint32_t iolimit);
1580 /*%<
1581  *      Set the number of simultaneous file descriptors available for
1582  *      reading and writing masterfiles.
1583  *
1584  * Requires:
1585  *\li   'zmgr' to be a valid zone manager.
1586  *\li   'iolimit' to be positive.
1587  */
1588
1589 isc_uint32_t
1590 dns_zonemgr_getiolimit(dns_zonemgr_t *zmgr);
1591 /*%<
1592  *      Get the number of simultaneous file descriptors available for
1593  *      reading and writing masterfiles.
1594  *
1595  * Requires:
1596  *\li   'zmgr' to be a valid zone manager.
1597  */
1598
1599 void
1600 dns_zonemgr_setserialqueryrate(dns_zonemgr_t *zmgr, unsigned int value);
1601 /*%<
1602  *      Set the number of SOA queries sent per second.
1603  *
1604  * Requires:
1605  *\li   'zmgr' to be a valid zone manager
1606  */
1607
1608 unsigned int
1609 dns_zonemgr_getserialqueryrate(dns_zonemgr_t *zmgr);
1610 /*%<
1611  *      Return the number of SOA queries sent per second.
1612  *
1613  * Requires:
1614  *\li   'zmgr' to be a valid zone manager.
1615  */
1616
1617 unsigned int
1618 dns_zonemgr_getcount(dns_zonemgr_t *zmgr, int state);
1619 /*%<
1620  *      Returns the number of zones in the specified state.
1621  *
1622  * Requires:
1623  *\li   'zmgr' to be a valid zone manager.
1624  *\li   'state' to be a valid DNS_ZONESTATE_ constant.
1625  */
1626
1627 void
1628 dns_zonemgr_unreachableadd(dns_zonemgr_t *zmgr, isc_sockaddr_t *remote,
1629                            isc_sockaddr_t *local, isc_time_t *now);
1630 /*%<
1631  *      Add the pair of addresses to the unreachable cache.
1632  *
1633  * Requires:
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.
1637  */
1638
1639 isc_boolean_t
1640 dns_zonemgr_unreachable(dns_zonemgr_t *zmgr, isc_sockaddr_t *remote,
1641                         isc_sockaddr_t *local, isc_time_t *now);
1642 /*%<
1643  *      Returns ISC_TRUE if the given local/remote address pair
1644  *      is found in the zone maanger's unreachable cache.
1645  *
1646  * Requires:
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.
1650  *\li   'now' != NULL
1651  */
1652
1653 void
1654 dns_zonemgr_unreachabledel(dns_zonemgr_t *zmgr, isc_sockaddr_t *remote,
1655                            isc_sockaddr_t *local);
1656 /*%<
1657  *      Remove the pair of addresses from the unreachable cache.
1658  *
1659  * Requires:
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.
1663  */
1664
1665 void
1666 dns_zone_forcereload(dns_zone_t *zone);
1667 /*%<
1668  *      Force a reload of specified zone.
1669  *
1670  * Requires:
1671  *\li      'zone' to be a valid zone.
1672  */
1673
1674 isc_boolean_t
1675 dns_zone_isforced(dns_zone_t *zone);
1676 /*%<
1677  *      Check if the zone is waiting a forced reload.
1678  *
1679  * Requires:
1680  * \li     'zone' to be a valid zone.
1681  */
1682
1683 isc_result_t
1684 dns_zone_setstatistics(dns_zone_t *zone, isc_boolean_t on);
1685 /*%<
1686  * This function is obsoleted by dns_zone_setrequeststats().
1687  */
1688
1689 isc_uint64_t *
1690 dns_zone_getstatscounters(dns_zone_t *zone);
1691 /*%<
1692  * This function is obsoleted by dns_zone_getrequeststats().
1693  */
1694
1695 void
1696 dns_zone_setstats(dns_zone_t *zone, isc_stats_t *stats);
1697 /*%<
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.
1703  *
1704  * Requires:
1705  * \li  'zone' to be a valid zone and does not have a statistics set already
1706  *      installed.
1707  *
1708  *\li   stats is a valid statistics supporting zone statistics counters
1709  *      (see dns/stats.h).
1710  */
1711
1712 void
1713 dns_zone_setrequeststats(dns_zone_t *zone, isc_stats_t *stats);
1714
1715 void
1716 dns_zone_setrcvquerystats(dns_zone_t *zone, dns_stats_t *stats);
1717 /*%<
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
1720  * counters.
1721  *
1722  * Requires:
1723  * \li  'zone' to be a valid zone.
1724  *
1725  *\li   stats is a valid statistics.
1726  */
1727
1728 #ifdef NEWSTATS
1729 void
1730 dns_zone_setrcvquerystats(dns_zone_t *zone, dns_stats_t *stats);
1731 #endif
1732
1733 isc_stats_t *
1734 dns_zone_getrequeststats(dns_zone_t *zone);
1735
1736 #ifdef NEWSTATS
1737 dns_stats_t *
1738 dns_zone_getrcvquerystats(dns_zone_t *zone);
1739 #endif
1740
1741 /*%<
1742  * Get the additional statistics for zone, if one is installed.
1743  *
1744  * Requires:
1745  * \li  'zone' to be a valid zone.
1746  *
1747  * Returns:
1748  * \li  when available, a pointer to the statistics set installed in zone;
1749  *      otherwise NULL.
1750  */
1751
1752 void
1753 dns_zone_dialup(dns_zone_t *zone);
1754 /*%<
1755  * Perform dialup-time maintenance on 'zone'.
1756  */
1757
1758 void
1759 dns_zone_setdialup(dns_zone_t *zone, dns_dialuptype_t dialup);
1760 /*%<
1761  * Set the dialup type of 'zone' to 'dialup'.
1762  *
1763  * Requires:
1764  * \li  'zone' to be valid initialised zone.
1765  *\li   'dialup' to be a valid dialup type.
1766  */
1767
1768 void
1769 dns_zone_log(dns_zone_t *zone, int level, const char *msg, ...)
1770         ISC_FORMAT_PRINTF(3, 4);
1771 /*%<
1772  * Log the message 'msg...' at 'level', including text that identifies
1773  * the message as applying to 'zone'.
1774  */
1775
1776 void
1777 dns_zone_logc(dns_zone_t *zone, isc_logcategory_t *category, int level,
1778               const char *msg, ...) ISC_FORMAT_PRINTF(4, 5);
1779 /*%<
1780  * Log the message 'msg...' at 'level', including text that identifies
1781  * the message as applying to 'zone'.
1782  */
1783
1784 void
1785 dns_zone_name(dns_zone_t *zone, char *buf, size_t len);
1786 /*%<
1787  * Return the name of the zone with class and view.
1788  *
1789  * Requires:
1790  *\li   'zone' to be valid.
1791  *\li   'buf' to be non NULL.
1792  */
1793
1794 isc_result_t
1795 dns_zone_checknames(dns_zone_t *zone, dns_name_t *name, dns_rdata_t *rdata);
1796 /*%<
1797  * Check if this record meets the check-names policy.
1798  *
1799  * Requires:
1800  *      'zone' to be valid.
1801  *      'name' to be valid.
1802  *      'rdata' to be valid.
1803  *
1804  * Returns:
1805  *      DNS_R_SUCCESS           passed checks.
1806  *      DNS_R_BADOWNERNAME      failed ownername checks.
1807  *      DNS_R_BADNAME           failed rdata checks.
1808  */
1809
1810 void
1811 dns_zone_setacache(dns_zone_t *zone, dns_acache_t *acache);
1812 /*%<
1813  *      Associate the zone with an additional cache.
1814  *
1815  * Require:
1816  *      'zone' to be a valid zone.
1817  *      'acache' to be a non NULL pointer.
1818  *
1819  * Ensures:
1820  *      'zone' will have a reference to 'acache'
1821  */
1822
1823 void
1824 dns_zone_setcheckmx(dns_zone_t *zone, dns_checkmxfunc_t checkmx);
1825 /*%<
1826  *      Set the post load integrity callback function 'checkmx'.
1827  *      'checkmx' will be called if the MX TARGET is not within the zone.
1828  *
1829  * Require:
1830  *      'zone' to be a valid zone.
1831  */
1832
1833 void
1834 dns_zone_setchecksrv(dns_zone_t *zone, dns_checkmxfunc_t checksrv);
1835 /*%<
1836  *      Set the post load integrity callback function 'checksrv'.
1837  *      'checksrv' will be called if the SRV TARGET is not within the zone.
1838  *
1839  * Require:
1840  *      'zone' to be a valid zone.
1841  */
1842
1843 void
1844 dns_zone_setcheckns(dns_zone_t *zone, dns_checknsfunc_t checkns);
1845 /*%<
1846  *      Set the post load integrity callback function 'checkns'.
1847  *      'checkns' will be called if the NS TARGET is not within the zone.
1848  *
1849  * Require:
1850  *      'zone' to be a valid zone.
1851  */
1852
1853 void
1854 dns_zone_setnotifydelay(dns_zone_t *zone, isc_uint32_t delay);
1855 /*%<
1856  * Set the minimum delay between sets of notify messages.
1857  *
1858  * Requires:
1859  *      'zone' to be valid.
1860  */
1861
1862 isc_uint32_t
1863 dns_zone_getnotifydelay(dns_zone_t *zone);
1864 /*%<
1865  * Get the minimum delay between sets of notify messages.
1866  *
1867  * Requires:
1868  *      'zone' to be valid.
1869  */
1870
1871 void
1872 dns_zone_setisself(dns_zone_t *zone, dns_isselffunc_t isself, void *arg);
1873 /*%<
1874  * Set the isself callback function and argument.
1875  *
1876  * isc_boolean_t
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);
1879  *
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'.
1883  */
1884
1885 void
1886 dns_zone_setnodes(dns_zone_t *zone, isc_uint32_t nodes);
1887 /*%<
1888  * Set the number of nodes that will be checked per quantum.
1889  */
1890
1891 void
1892 dns_zone_setsignatures(dns_zone_t *zone, isc_uint32_t signatures);
1893 /*%<
1894  * Set the number of signatures that will be generated per quantum.
1895  */
1896
1897 isc_result_t
1898 dns_zone_signwithkey(dns_zone_t *zone, dns_secalg_t algorithm,
1899                      isc_uint16_t keyid, isc_boolean_t deleteit);
1900 /*%<
1901  * Initiate/resume signing of the entire zone with the zone DNSKEY(s)
1902  * that match the given algorithm and keyid.
1903  */
1904
1905 isc_result_t
1906 dns_zone_addnsec3chain(dns_zone_t *zone, dns_rdata_nsec3param_t *nsec3param);
1907 /*%<
1908  * Incrementally add a NSEC3 chain that corresponds to 'nsec3param'.
1909  */
1910
1911 void
1912 dns_zone_setprivatetype(dns_zone_t *zone, dns_rdatatype_t type);
1913 dns_rdatatype_t
1914 dns_zone_getprivatetype(dns_zone_t *zone);
1915 /*
1916  * Get/Set the private record type.  It is expected that these interfaces
1917  * will not be permanent.
1918  */
1919
1920 void
1921 dns_zone_rekey(dns_zone_t *zone, isc_boolean_t fullsign);
1922 /*%<
1923  * Update the zone's DNSKEY set from the key repository.
1924  *
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.
1929  */
1930
1931 isc_result_t
1932 dns_zone_nscheck(dns_zone_t *zone, dns_db_t *db, dns_dbversion_t *version,
1933                  unsigned int *errors);
1934 /*%
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'
1938  *
1939  * Requires:
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.
1944  *
1945  * Returns:
1946  *      ISC_R_SUCCESS if there were no errors examining the zone contents.
1947  */
1948
1949 void
1950 dns_zone_setadded(dns_zone_t *zone, isc_boolean_t added);
1951 /*%
1952  * Sets the value of zone->added, which should be ISC_TRUE for
1953  * zones that were originally added by "rndc addzone".
1954  *
1955  * Requires:
1956  * \li  'zone' to be valid.
1957  */
1958
1959 isc_boolean_t
1960 dns_zone_getadded(dns_zone_t *zone);
1961 /*%
1962  * Returns ISC_TRUE if the zone was originally added at runtime
1963  * using "rndc addzone".
1964  *
1965  * Requires:
1966  * \li  'zone' to be valid.
1967  */
1968
1969 isc_result_t
1970 dns_zone_dlzpostload(dns_zone_t *zone, dns_db_t *db);
1971 /*%
1972  * Load the origin names for a writeable DLZ database.
1973  */
1974
1975 isc_boolean_t
1976 dns_zone_isdynamic(dns_zone_t *zone, isc_boolean_t ignore_freeze);
1977 /*%
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.
1981  *
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; }".
1985  *
1986  * If 'ignore_freeze' is true, then the zone which has had updates disabled
1987  * will still report itself to be dynamic.
1988  *
1989  * Requires:
1990  * \li  'zone' to be valid.
1991  */
1992
1993 isc_result_t
1994 dns_zone_setrefreshkeyinterval(dns_zone_t *zone, isc_uint32_t interval);
1995 /*%
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.
2000  *
2001  * Requires:
2002  * \li  'zone' to be valid.
2003  */
2004
2005 isc_boolean_t
2006 dns_zone_getrequestixfr(dns_zone_t *zone);
2007 /*%
2008  * Returns the true/false value of the request-ixfr option in the zone.
2009  *
2010  * Requires:
2011  * \li  'zone' to be valid.
2012  */
2013
2014 void
2015 dns_zone_setrequestixfr(dns_zone_t *zone, isc_boolean_t flag);
2016 /*%
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.
2019  *
2020  * Requires:
2021  * \li  'zone' to be valid.
2022  */
2023
2024 void
2025 dns_zone_setserialupdatemethod(dns_zone_t *zone, dns_updatemethod_t method);
2026 /*%
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.
2030  *
2031  * Requires:
2032  * \li  'zone' to be valid.
2033  */
2034
2035 dns_updatemethod_t
2036 dns_zone_getserialupdatemethod(dns_zone_t *zone);
2037 /*%
2038  * Returns the update method to be used when incrementing the zone serial
2039  * number due to a DDNS update.
2040  *
2041  * Requires:
2042  * \li  'zone' to be valid.
2043  */
2044
2045 isc_result_t
2046 dns_zone_link(dns_zone_t *zone, dns_zone_t *raw);
2047
2048 void
2049 dns_zone_getraw(dns_zone_t *zone, dns_zone_t **raw);
2050
2051 isc_result_t
2052 dns_zone_keydone(dns_zone_t *zone, const char *data);
2053
2054 isc_result_t
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);
2058 /*%
2059  * Set the NSEC3 parameters for the zone.
2060  *
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.
2064  *
2065  * Requires:
2066  * \li  'zone' to be valid.
2067  */
2068
2069 void
2070 dns_zone_setrawdata(dns_zone_t *zone, dns_masterrawheader_t *header);
2071 /*%
2072  * Set the data to be included in the header when the zone is dumped in
2073  * binary format.
2074  */
2075
2076 isc_result_t
2077 dns_zone_synckeyzone(dns_zone_t *zone);
2078 /*%
2079  * Force the managed key zone to synchronize, and start the key
2080  * maintenance timer.
2081  */
2082
2083 isc_result_t
2084 dns_zone_rpz_enable(dns_zone_t *zone);
2085 /*%
2086  * Set the response policy associated with a zone.
2087  */
2088
2089 isc_result_t
2090 dns_zone_rpz_enable_db(dns_zone_t *zone, dns_db_t *db);
2091 /*%
2092  * If a zone is a response policy zone, mark its new database.
2093  */
2094
2095 isc_boolean_t
2096 dns_zone_get_rpz(dns_zone_t *zone);
2097
2098 void
2099 dns_zone_setstatlevel(dns_zone_t *zone, dns_zonestat_level_t level);
2100
2101 dns_zonestat_level_t
2102 dns_zone_getstatlevel(dns_zone_t *zone);
2103 /*%
2104  * Set and get the statistics reporting level for the zone;
2105  * full, terse, or none.
2106  */
2107
2108 ISC_LANG_ENDDECLS
2109
2110 #endif /* DNS_ZONE_H */