Merge from vendor branch LESS:
[dragonfly.git] / contrib / bind-9.3 / lib / dns / include / dns / view.h
1 /*
2  * Copyright (C) 2004  Internet Systems Consortium, Inc. ("ISC")
3  * Copyright (C) 1999-2003  Internet Software Consortium.
4  *
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.
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: view.h,v 1.73.2.4.2.12 2004/03/10 02:55:58 marka Exp $ */
19
20 #ifndef DNS_VIEW_H
21 #define DNS_VIEW_H 1
22
23 /*****
24  ***** Module Info
25  *****/
26
27 /*
28  * DNS View
29  *
30  * A "view" is a DNS namespace, together with an optional resolver and a
31  * forwarding policy.  A "DNS namespace" is a (possibly empty) set of
32  * authoritative zones together with an optional cache and optional
33  * "hints" information.
34  *
35  * Views start out "unfrozen".  In this state, core attributes like
36  * the cache, set of zones, and forwarding policy may be set.  While
37  * "unfrozen", the caller (e.g. nameserver configuration loading
38  * code), must ensure exclusive access to the view.  When the view is
39  * "frozen", the core attributes become immutable, and the view module
40  * will ensure synchronization.  Freezing allows the view's core attributes
41  * to be accessed without locking.
42  *
43  * MP:
44  *      Before the view is frozen, the caller must ensure synchronization.
45  *
46  *      After the view is frozen, the module guarantees appropriate
47  *      synchronization of any data structures it creates and manipulates.
48  *
49  * Reliability:
50  *      No anticipated impact.
51  *
52  * Resources:
53  *      <TBS>
54  *
55  * Security:
56  *      No anticipated impact.
57  *
58  * Standards:
59  *      None.
60  */
61
62 #include <stdio.h>
63
64 #include <isc/lang.h>
65 #include <isc/magic.h>
66 #include <isc/event.h>
67 #include <isc/mutex.h>
68 #include <isc/net.h>
69 #include <isc/refcount.h>
70 #include <isc/rwlock.h>
71 #include <isc/stdtime.h>
72
73 #include <dns/acl.h>
74 #include <dns/fixedname.h>
75 #include <dns/types.h>
76
77 ISC_LANG_BEGINDECLS
78
79 struct dns_view {
80         /* Unlocked. */
81         unsigned int                    magic;
82         isc_mem_t *                     mctx;
83         dns_rdataclass_t                rdclass;
84         char *                          name;
85         dns_zt_t *                      zonetable;
86         dns_resolver_t *                resolver;
87         dns_adb_t *                     adb;
88         dns_requestmgr_t *              requestmgr;
89         dns_cache_t *                   cache;
90         dns_db_t *                      cachedb;
91         dns_db_t *                      hints;
92         dns_keytable_t *                secroots;
93         dns_keytable_t *                trustedkeys;
94         isc_mutex_t                     lock;
95         isc_boolean_t                   frozen;
96         isc_task_t *                    task;
97         isc_event_t                     resevent;
98         isc_event_t                     adbevent;
99         isc_event_t                     reqevent;
100         /* Configurable data. */
101         dns_tsig_keyring_t *            statickeys;
102         dns_tsig_keyring_t *            dynamickeys;
103         dns_peerlist_t *                peers;
104         dns_order_t *                   order;
105         dns_fwdtable_t *                fwdtable;
106         isc_boolean_t                   recursion;
107         isc_boolean_t                   auth_nxdomain;
108         isc_boolean_t                   additionalfromcache;
109         isc_boolean_t                   additionalfromauth;
110         isc_boolean_t                   minimalresponses;
111         isc_boolean_t                   enablednssec;
112         dns_transfer_format_t           transfer_format;
113         dns_acl_t *                     queryacl;
114         dns_acl_t *                     recursionacl;
115         dns_acl_t *                     sortlist;
116         isc_boolean_t                   requestixfr;
117         isc_boolean_t                   provideixfr;
118         dns_ttl_t                       maxcachettl;
119         dns_ttl_t                       maxncachettl;
120         in_port_t                       dstport;
121         dns_aclenv_t                    aclenv;
122         dns_rdatatype_t                 preferred_glue;
123         isc_boolean_t                   flush;
124         dns_namelist_t *                delonly;
125         isc_boolean_t                   rootdelonly;
126         dns_namelist_t *                rootexclude;
127         isc_boolean_t                   checknames;
128         dns_name_t *                    dlv;
129         dns_fixedname_t                 dlv_fixed;
130
131         /*
132          * Configurable data for server use only,
133          * locked by server configuration lock.
134          */
135         dns_acl_t *                     matchclients;
136         dns_acl_t *                     matchdestinations;
137         isc_boolean_t                   matchrecursiveonly;
138
139         /* Locked by themselves. */
140         isc_refcount_t                  references;
141
142         /* Locked by lock. */
143         unsigned int                    weakrefs;
144         unsigned int                    attributes;
145         /* Under owner's locking control. */
146         ISC_LINK(struct dns_view)       link;
147 };
148
149 #define DNS_VIEW_MAGIC                  ISC_MAGIC('V','i','e','w')
150 #define DNS_VIEW_VALID(view)            ISC_MAGIC_VALID(view, DNS_VIEW_MAGIC)
151
152 #define DNS_VIEWATTR_RESSHUTDOWN        0x01
153 #define DNS_VIEWATTR_ADBSHUTDOWN        0x02
154 #define DNS_VIEWATTR_REQSHUTDOWN        0x04
155
156 isc_result_t
157 dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
158                 const char *name, dns_view_t **viewp);
159 /*
160  * Create a view.
161  *
162  * Notes:
163  *
164  *      The newly created view has no cache, no resolver, and an empty
165  *      zone table.  The view is not frozen.
166  *
167  * Requires:
168  *
169  *      'mctx' is a valid memory context.
170  *
171  *      'rdclass' is a valid class.
172  *
173  *      'name' is a valid C string.
174  *
175  *      viewp != NULL && *viewp == NULL
176  *
177  * Returns:
178  *
179  *      ISC_R_SUCCESS
180  *      ISC_R_NOMEMORY
181  *
182  *      Other errors are possible.
183  */
184
185 void
186 dns_view_attach(dns_view_t *source, dns_view_t **targetp);
187 /*
188  * Attach '*targetp' to 'source'.
189  *
190  * Requires:
191  *
192  *      'source' is a valid, frozen view.
193  *
194  *      'targetp' points to a NULL dns_view_t *.
195  *
196  * Ensures:
197  *
198  *      *targetp is attached to source.
199  *
200  *      While *targetp is attached, the view will not shut down.
201  */
202
203 void
204 dns_view_detach(dns_view_t **viewp);
205 /*
206  * Detach '*viewp' from its view.
207  *
208  * Requires:
209  *
210  *      'viewp' points to a valid dns_view_t *
211  *
212  * Ensures:
213  *
214  *      *viewp is NULL.
215  */
216
217 void
218 dns_view_flushanddetach(dns_view_t **viewp);
219 /*
220  * Detach '*viewp' from its view.  If this was the last reference
221  * uncommited changed in zones will be flushed to disk.
222  *
223  * Requires:
224  *
225  *      'viewp' points to a valid dns_view_t *
226  *
227  * Ensures:
228  *
229  *      *viewp is NULL.
230  */
231
232 void
233 dns_view_weakattach(dns_view_t *source, dns_view_t **targetp);
234 /*
235  * Weakly attach '*targetp' to 'source'.
236  *
237  * Requires:
238  *
239  *      'source' is a valid, frozen view.
240  *
241  *      'targetp' points to a NULL dns_view_t *.
242  *
243  * Ensures:
244  *
245  *      *targetp is attached to source.
246  *
247  *      While *targetp is attached, the view will not be freed.
248  */
249
250 void
251 dns_view_weakdetach(dns_view_t **targetp);
252 /*
253  * Detach '*viewp' from its view.
254  *
255  * Requires:
256  *
257  *      'viewp' points to a valid dns_view_t *.
258  *
259  * Ensures:
260  *
261  *      *viewp is NULL.
262  */
263
264 isc_result_t
265 dns_view_createresolver(dns_view_t *view,
266                         isc_taskmgr_t *taskmgr, unsigned int ntasks,
267                         isc_socketmgr_t *socketmgr,
268                         isc_timermgr_t *timermgr,
269                         unsigned int options,
270                         dns_dispatchmgr_t *dispatchmgr,
271                         dns_dispatch_t *dispatchv4,
272                         dns_dispatch_t *dispatchv6);
273 /*
274  * Create a resolver and address database for the view.
275  *
276  * Requires:
277  *
278  *      'view' is a valid, unfrozen view.
279  *
280  *      'view' does not have a resolver already.
281  *
282  *      The requirements of dns_resolver_create() apply to 'taskmgr',
283  *      'ntasks', 'socketmgr', 'timermgr', 'options', 'dispatchv4', and
284  *      'dispatchv6'.
285  *
286  * Returns:
287  *
288  *      ISC_R_SUCCESS
289  *
290  *      Any error that dns_resolver_create() can return.
291  */
292
293 void
294 dns_view_setcache(dns_view_t *view, dns_cache_t *cache);
295 /*
296  * Set the view's cache database.
297  *
298  * Requires:
299  *
300  *      'view' is a valid, unfrozen view.
301  *
302  *      'cache' is a valid cache.
303  *
304  * Ensures:
305  *
306  *      The cache of 'view' is 'cached.
307  *
308  *      If this is not the first call to dns_view_setcache() for this
309  *      view, then previously set cache is detached.
310  */
311
312 void
313 dns_view_sethints(dns_view_t *view, dns_db_t *hints);
314 /*
315  * Set the view's hints database.
316  *
317  * Requires:
318  *
319  *      'view' is a valid, unfrozen view, whose hints database has not been
320  *      set.
321  *
322  *      'hints' is a valid zone database.
323  *
324  * Ensures:
325  *
326  *      The hints database of 'view' is 'hints'.
327  */
328
329 void
330 dns_view_setkeyring(dns_view_t *view, dns_tsig_keyring_t *ring);
331 /*
332  * Set the view's static TSIG keys
333  *
334  * Requires:
335  *
336  *      'view' is a valid, unfrozen view, whose static TSIG keyring has not
337  *      been set.
338  *
339  *      'ring' is a valid TSIG keyring
340  *
341  * Ensures:
342  *
343  *      The static TSIG keyring of 'view' is 'ring'.
344  */
345
346 void
347 dns_view_setdstport(dns_view_t *view, in_port_t dstport);
348 /*
349  * Set the view's destination port.  This is the port to
350  * which outgoing queries are sent.  The default is 53,
351  * the standard DNS port.
352  *
353  * Requires:
354  *
355  *      'view' is a valid view.
356  *
357  *      'dstport' is a valid TCP/UDP port number.
358  *
359  * Ensures:
360  *      External name servers will be assumed to be listning
361  *      on 'dstport'.  For servers whose address has already
362  *      obtained obtained at the time of the call, the view may
363  *      continue to use the previously set port until the address
364  *      times out from the view's address database.
365  */
366
367
368 isc_result_t
369 dns_view_addzone(dns_view_t *view, dns_zone_t *zone);
370 /*
371  * Add zone 'zone' to 'view'.
372  *
373  * Requires:
374  *
375  *      'view' is a valid, unfrozen view.
376  *
377  *      'zone' is a valid zone.
378  */
379
380 void
381 dns_view_freeze(dns_view_t *view);
382 /*
383  * Freeze view.
384  *
385  * Requires:
386  *
387  *      'view' is a valid, unfrozen view.
388  *
389  * Ensures:
390  *
391  *      'view' is frozen.
392  */
393
394 isc_result_t
395 dns_view_find(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
396               isc_stdtime_t now, unsigned int options, isc_boolean_t use_hints,
397               dns_db_t **dbp, dns_dbnode_t **nodep, dns_name_t *foundname,
398               dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
399 /*
400  * Find an rdataset whose owner name is 'name', and whose type is
401  * 'type'.
402  *
403  * Notes:
404  *
405  *      See the description of dns_db_find() for information about 'options'.
406  *      If the caller sets DNS_DBFIND_GLUEOK, it must ensure that 'name'
407  *      and 'type' are appropriate for glue retrieval.
408  *
409  *      If 'now' is zero, then the current time will be used.
410  *
411  *      If 'use_hints' is ISC_TRUE, and the view has a hints database, then
412  *      it will be searched last.  If the answer is found in the hints
413  *      database, the result code will be DNS_R_HINT.  If the name is found
414  *      in the hints database but not the type, the result code will be
415  *      DNS_R_HINTNXRRSET.
416  *
417  *      'foundname' must meet the requirements of dns_db_find().
418  *
419  *      If 'sigrdataset' is not NULL, and there is a SIG rdataset which
420  *      covers 'type', then 'sigrdataset' will be bound to it.
421  *
422  * Requires:
423  *
424  *      'view' is a valid, frozen view.
425  *
426  *      'name' is valid name.
427  *
428  *      'type' is a valid dns_rdatatype_t, and is not a meta query type
429  *      except dns_rdatatype_any.
430  *
431  *      dbp == NULL || *dbp == NULL
432  *
433  *      nodep == NULL || *nodep == NULL.  If nodep != NULL, dbp != NULL.
434  *
435  *      'foundname' is a valid name with a dedicated buffer or NULL.
436  *
437  *      'rdataset' is a valid, disassociated rdataset.
438  *
439  *      'sigrdataset' is NULL, or is a valid, disassociated rdataset.
440  *
441  * Ensures:
442  *
443  *      In successful cases, 'rdataset', and possibly 'sigrdataset', are
444  *      bound to the found data.
445  *
446  *      If dbp != NULL, it points to the database containing the data.
447  *
448  *      If nodep != NULL, it points to the database node containing the data.
449  *
450  *      If foundname != NULL, it contains the full name of the found data.
451  *
452  * Returns:
453  *
454  *      Any result that dns_db_find() can return, with the exception of
455  *      DNS_R_DELEGATION.
456  */
457
458 isc_result_t
459 dns_view_simplefind(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
460                     isc_stdtime_t now, unsigned int options,
461                     isc_boolean_t use_hints,
462                     dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
463 /*
464  * Find an rdataset whose owner name is 'name', and whose type is
465  * 'type'.
466  *
467  * Notes:
468  *
469  *      This routine is appropriate for simple, exact-match queries of the
470  *      view.  'name' must be a canonical name; there is no DNAME or CNAME
471  *      processing.
472  *
473  *      See the description of dns_db_find() for information about 'options'.
474  *      If the caller sets DNS_DBFIND_GLUEOK, it must ensure that 'name'
475  *      and 'type' are appropriate for glue retrieval.
476  *
477  *      If 'now' is zero, then the current time will be used.
478  *
479  *      If 'use_hints' is ISC_TRUE, and the view has a hints database, then
480  *      it will be searched last.  If the answer is found in the hints
481  *      database, the result code will be DNS_R_HINT.  If the name is found
482  *      in the hints database but not the type, the result code will be
483  *      DNS_R_HINTNXRRSET.
484  *
485  *      If 'sigrdataset' is not NULL, and there is a SIG rdataset which
486  *      covers 'type', then 'sigrdataset' will be bound to it.
487  *
488  * Requires:
489  *
490  *      'view' is a valid, frozen view.
491  *
492  *      'name' is valid name.
493  *
494  *      'type' is a valid dns_rdatatype_t, and is not a meta query type
495  *      (e.g. dns_rdatatype_any), or dns_rdatatype_rrsig.
496  *
497  *      'rdataset' is a valid, disassociated rdataset.
498  *
499  *      'sigrdataset' is NULL, or is a valid, disassociated rdataset.
500  *
501  * Ensures:
502  *
503  *      In successful cases, 'rdataset', and possibly 'sigrdataset', are
504  *      bound to the found data.
505  *
506  * Returns:
507  *
508  *      ISC_R_SUCCESS                   Success; result is desired type.
509  *      DNS_R_GLUE                      Success; result is glue.
510  *      DNS_R_HINT                      Success; result is a hint.
511  *      DNS_R_NCACHENXDOMAIN            Success; result is a ncache entry.
512  *      DNS_R_NCACHENXRRSET             Success; result is a ncache entry.
513  *      DNS_R_NXDOMAIN                  The name does not exist.
514  *      DNS_R_NXRRSET                   The rrset does not exist.
515  *      ISC_R_NOTFOUND                  No matching data found,
516  *                                      or an error occurred.
517  */
518
519 isc_result_t
520 dns_view_findzonecut(dns_view_t *view, dns_name_t *name, dns_name_t *fname,
521                      isc_stdtime_t now, unsigned int options,
522                      isc_boolean_t use_hints,
523                      dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
524
525 isc_result_t
526 dns_view_findzonecut2(dns_view_t *view, dns_name_t *name, dns_name_t *fname,
527                       isc_stdtime_t now, unsigned int options,
528                       isc_boolean_t use_hints, isc_boolean_t use_cache,
529                       dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
530 /*
531  * Find the best known zonecut containing 'name'.
532  *
533  * This uses local authority, cache, and optionally hints data.
534  * No external queries are performed.
535  *
536  * Notes:
537  *
538  *      If 'now' is zero, then the current time will be used.
539  *
540  *      If 'use_hints' is ISC_TRUE, and the view has a hints database, then
541  *      it will be searched last.
542  *
543  *      If 'use_cache' is ISC_TRUE, and the view has a cache, then it will be
544  *      searched.
545  *
546  *      If 'sigrdataset' is not NULL, and there is a SIG rdataset which
547  *      covers 'type', then 'sigrdataset' will be bound to it.
548  *
549  *      If the DNS_DBFIND_NOEXACT option is set, then the zonecut returned
550  *      (if any) will be the deepest known ancestor of 'name'.
551  *
552  * Requires:
553  *
554  *      'view' is a valid, frozen view.
555  *
556  *      'name' is valid name.
557  *
558  *      'rdataset' is a valid, disassociated rdataset.
559  *
560  *      'sigrdataset' is NULL, or is a valid, disassociated rdataset.
561  *
562  * Returns:
563  *
564  *      ISC_R_SUCCESS                           Success.
565  *
566  *      Many other results are possible.
567  */
568
569 isc_result_t
570 dns_viewlist_find(dns_viewlist_t *list, const char *name,
571                   dns_rdataclass_t rdclass, dns_view_t **viewp);
572 /*
573  * Search for a view with name 'name' and class 'rdclass' in 'list'.
574  * If found, '*viewp' is (strongly) attached to it.
575  *
576  * Requires:
577  *
578  *      'viewp' points to a NULL dns_view_t *.
579  *
580  * Returns:
581  *
582  *      ISC_R_SUCCESS           A matching view was found.
583  *      ISC_R_NOTFOUND          No matching view was found.
584  */
585
586 isc_result_t
587 dns_view_findzone(dns_view_t *view, dns_name_t *name, dns_zone_t **zonep);
588 /*
589  * Search for the zone 'name' in the zone table of 'view'.
590  * If found, 'zonep' is (strongly) attached to it.  There
591  * are no partial matches.
592  *
593  * Requires:
594  *
595  *      'zonep' points to a NULL dns_zone_t *.
596  *
597  * Returns:
598  *      ISC_R_SUCCESS           A matching zone was found.
599  *      ISC_R_NOTFOUND          No matching zone was found.
600  *      others                  An error occurred.
601  */
602
603 isc_result_t
604 dns_view_load(dns_view_t *view, isc_boolean_t stop);
605
606 isc_result_t
607 dns_view_loadnew(dns_view_t *view, isc_boolean_t stop);
608 /*
609  * Load zones attached to this view.  dns_view_load() loads
610  * all zones whose master file has changed since the last
611  * load; dns_view_loadnew() loads only zones that have never 
612  * been loaded.
613  *
614  * If 'stop' is ISC_TRUE, stop on the first error and return it.
615  * If 'stop' is ISC_FALSE, ignore errors.
616  *
617  * Requires:
618  *
619  *      'view' is valid.
620  */
621
622 isc_result_t
623 dns_view_gettsig(dns_view_t *view, dns_name_t *keyname,
624                  dns_tsigkey_t **keyp);
625 /*
626  * Find the TSIG key configured in 'view' with name 'keyname',
627  * if any.
628  *
629  * Reqires:
630  *      keyp points to a NULL dns_tsigkey_t *.
631  *
632  * Returns:
633  *      ISC_R_SUCCESS   A key was found and '*keyp' now points to it.
634  *      ISC_R_NOTFOUND  No key was found.
635  *      others          An error occurred.
636  */
637
638 isc_result_t
639 dns_view_getpeertsig(dns_view_t *view, isc_netaddr_t *peeraddr,
640                      dns_tsigkey_t **keyp);
641 /*
642  * Find the TSIG key configured in 'view' for the server whose
643  * address is 'peeraddr', if any.
644  *
645  * Reqires:
646  *      keyp points to a NULL dns_tsigkey_t *.
647  *
648  * Returns:
649  *      ISC_R_SUCCESS   A key was found and '*keyp' now points to it.
650  *      ISC_R_NOTFOUND  No key was found.
651  *      others          An error occurred.
652  */
653
654 isc_result_t
655 dns_view_checksig(dns_view_t *view, isc_buffer_t *source, dns_message_t *msg);
656 /*
657  * Verifies the signature of a message.
658  *
659  * Requires:
660  *
661  *      'view' is a valid view.
662  *      'source' is a valid buffer containing the message
663  *      'msg' is a valid message
664  *
665  * Returns:
666  *      see dns_tsig_verify()
667  */
668
669 void
670 dns_view_dialup(dns_view_t *view);
671 /*
672  * Perform dialup-time maintenance on the zones of 'view'.
673  */
674
675 isc_result_t
676 dns_view_dumpdbtostream(dns_view_t *view, FILE *fp);
677 /*
678  * Dump the current state of the view 'view' to the stream 'fp'
679  * for purposes of analysis or debugging.
680  *
681  * Currently the dumped state includes the view's cache; in the future
682  * it may also include other state such as the address database.
683  * It will not not include authoritative data since it is voluminous and
684  * easily obtainable by other means.
685  *
686  * Requires:
687  *      
688  *      'view' is valid.
689  *
690  *      'fp' refers to a file open for writing.
691  *
692  * Returns:
693  *      ISC_R_SUCCESS   The cache was successfully dumped.
694  *      others          An error occurred (see dns_master_dump)
695  */
696
697 isc_result_t
698 dns_view_flushcache(dns_view_t *view);
699 /*
700  * Flush the view's cache (and ADB).
701  *
702  * Requires:
703  *      'view' is valid.
704  *
705  *      No other tasks are executing.
706  *
707  * Returns:
708  *      ISC_R_SUCCESS
709  *      ISC_R_NOMEMORY
710  */
711
712 isc_result_t
713 dns_view_flushname(dns_view_t *view, dns_name_t *);
714 /*
715  * Flush the given name from the view's cache (and ADB).
716  *
717  * Requires:
718  *      'view' is valid.
719  *      'name' is valid.
720  *
721  * Returns:
722  *      ISC_R_SUCCESS
723  *      other returns are failures.
724  */
725
726 isc_result_t
727 dns_view_adddelegationonly(dns_view_t *view, dns_name_t *name);
728 /*
729  * Add the given name to the delegation only table.
730  * 
731  *
732  * Requires:
733  *      'view' is valid.
734  *      'name' is valid.
735  *
736  * Returns:
737  *      ISC_R_SUCCESS
738  *      ISC_R_NOMEMORY
739  */
740
741 isc_result_t
742 dns_view_excludedelegationonly(dns_view_t *view, dns_name_t *name);
743 /*
744  * Add the given name to be excluded from the root-delegation-only.
745  * 
746  *
747  * Requires:
748  *      'view' is valid.
749  *      'name' is valid.
750  *
751  * Returns:
752  *      ISC_R_SUCCESS
753  *      ISC_R_NOMEMORY
754  */
755
756 isc_boolean_t
757 dns_view_isdelegationonly(dns_view_t *view, dns_name_t *name);
758 /*
759  * Check if 'name' is in the delegation only table or if
760  * rootdelonly is set that name is not being excluded.
761  *
762  * Requires:
763  *      'view' is valid.
764  *      'name' is valid.
765  *
766  * Returns:
767  *      ISC_TRUE if the name is is the table.
768  *      ISC_FALSE othewise.
769  */
770
771 void
772 dns_view_setrootdelonly(dns_view_t *view, isc_boolean_t value);
773 /*
774  * Set the root delegation only flag.
775  *
776  * Requires:
777  *      'view' is valid.
778  */
779
780 isc_boolean_t
781 dns_view_getrootdelonly(dns_view_t *view);
782 /*
783  * Get the root delegation only flag.
784  *
785  * Requires:
786  *      'view' is valid.
787  */
788
789 #endif /* DNS_VIEW_H */