"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.11.23/lib/dns/include/dns/view.h" (7 Sep 2020, 35133 Bytes) of package /linux/misc/dns/bind9/9.11.23/bind-9.11.23.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "view.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 9.17.3_vs_9.17.4.

    1 /*
    2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
    3  *
    4  * This Source Code Form is subject to the terms of the Mozilla Public
    5  * License, v. 2.0. If a copy of the MPL was not distributed with this
    6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    7  *
    8  * See the COPYRIGHT file distributed with this work for additional
    9  * information regarding copyright ownership.
   10  */
   11 
   12 #ifndef DNS_VIEW_H
   13 #define DNS_VIEW_H 1
   14 
   15 /*****
   16  ***** Module Info
   17  *****/
   18 
   19 /*! \file dns/view.h
   20  * \brief
   21  * DNS View
   22  *
   23  * A "view" is a DNS namespace, together with an optional resolver and a
   24  * forwarding policy.  A "DNS namespace" is a (possibly empty) set of
   25  * authoritative zones together with an optional cache and optional
   26  * "hints" information.
   27  *
   28  * Views start out "unfrozen".  In this state, core attributes like
   29  * the cache, set of zones, and forwarding policy may be set.  While
   30  * "unfrozen", the caller (e.g. nameserver configuration loading
   31  * code), must ensure exclusive access to the view.  When the view is
   32  * "frozen", the core attributes become immutable, and the view module
   33  * will ensure synchronization.  Freezing allows the view's core attributes
   34  * to be accessed without locking.
   35  *
   36  * MP:
   37  *\li   Before the view is frozen, the caller must ensure synchronization.
   38  *
   39  *\li   After the view is frozen, the module guarantees appropriate
   40  *  synchronization of any data structures it creates and manipulates.
   41  *
   42  * Reliability:
   43  *\li   No anticipated impact.
   44  *
   45  * Resources:
   46  *\li   TBS
   47  *
   48  * Security:
   49  *\li   No anticipated impact.
   50  *
   51  * Standards:
   52  *\li   None.
   53  */
   54 
   55 #include <stdio.h>
   56 #include <inttypes.h>
   57 #include <stdbool.h>
   58 
   59 #include <isc/lang.h>
   60 #include <isc/magic.h>
   61 #include <isc/event.h>
   62 #include <isc/mutex.h>
   63 #include <isc/net.h>
   64 #include <isc/refcount.h>
   65 #include <isc/rwlock.h>
   66 #include <isc/stdtime.h>
   67 
   68 #include <dns/acl.h>
   69 #include <dns/catz.h>
   70 #include <dns/clientinfo.h>
   71 #include <dns/dnstap.h>
   72 #include <dns/fixedname.h>
   73 #include <dns/rrl.h>
   74 #include <dns/rdatastruct.h>
   75 #include <dns/rpz.h>
   76 #include <dns/types.h>
   77 #include <dns/zt.h>
   78 
   79 ISC_LANG_BEGINDECLS
   80 
   81 struct dns_view {
   82     /* Unlocked. */
   83     unsigned int            magic;
   84     isc_mem_t *         mctx;
   85     dns_rdataclass_t        rdclass;
   86     char *              name;
   87     dns_zt_t *          zonetable;
   88     dns_resolver_t *        resolver;
   89     dns_adb_t *         adb;
   90     dns_requestmgr_t *      requestmgr;
   91     dns_acache_t *          acache;
   92     dns_cache_t *           cache;
   93     dns_db_t *          cachedb;
   94     dns_db_t *          hints;
   95 
   96     /*
   97      * security roots and negative trust anchors.
   98      * internal use only; access via * dns_view_getsecroots()
   99      */
  100     dns_keytable_t *        secroots_priv;
  101     dns_ntatable_t *        ntatable_priv;
  102 
  103     isc_mutex_t         lock;
  104     bool            frozen;
  105     isc_task_t *            task;
  106     isc_event_t         resevent;
  107     isc_event_t         adbevent;
  108     isc_event_t         reqevent;
  109     isc_stats_t *           adbstats;
  110     isc_stats_t *           resstats;
  111     dns_stats_t *           resquerystats;
  112     bool            cacheshared;
  113 
  114     /* Configurable data. */
  115     dns_tsig_keyring_t *        statickeys;
  116     dns_tsig_keyring_t *        dynamickeys;
  117     dns_peerlist_t *        peers;
  118     dns_order_t *           order;
  119     dns_fwdtable_t *        fwdtable;
  120     bool            recursion;
  121     bool            auth_nxdomain;
  122     bool            additionalfromcache;
  123     bool            additionalfromauth;
  124     bool            minimal_any;
  125     dns_minimaltype_t       minimalresponses;
  126     bool            enablednssec;
  127     bool            enablevalidation;
  128     bool            acceptexpired;
  129     bool            requireservercookie;
  130     bool            trust_anchor_telemetry;
  131     bool            root_key_sentinel;
  132     dns_transfer_format_t       transfer_format;
  133     dns_acl_t *         cacheacl;
  134     dns_acl_t *         cacheonacl;
  135     dns_acl_t *         queryacl;
  136     dns_acl_t *         queryonacl;
  137     dns_acl_t *         recursionacl;
  138     dns_acl_t *         recursiononacl;
  139     dns_acl_t *         sortlist;
  140     dns_acl_t *         notifyacl;
  141     dns_acl_t *         transferacl;
  142     dns_acl_t *         updateacl;
  143     dns_acl_t *         upfwdacl;
  144     dns_acl_t *         denyansweracl;
  145     dns_acl_t *         nocasecompress;
  146     bool            msgcompression;
  147     dns_rbt_t *         answeracl_exclude;
  148     dns_rbt_t *         denyanswernames;
  149     dns_rbt_t *         answernames_exclude;
  150     dns_rrl_t *         rrl;
  151     bool            provideixfr;
  152     bool            requestnsid;
  153     bool            sendcookie;
  154     dns_ttl_t           maxcachettl;
  155     dns_ttl_t           maxncachettl;
  156     uint32_t            nta_lifetime;
  157     uint32_t            nta_recheck;
  158     char                *nta_file;
  159     dns_ttl_t           prefetch_trigger;
  160     dns_ttl_t           prefetch_eligible;
  161     in_port_t           dstport;
  162     dns_aclenv_t            aclenv;
  163     dns_rdatatype_t         preferred_glue;
  164     bool            flush;
  165     dns_namelist_t *        delonly;
  166     bool            rootdelonly;
  167     dns_namelist_t *        rootexclude;
  168     bool            checknames;
  169     dns_name_t *            dlv;
  170     dns_fixedname_t         dlv_fixed;
  171     uint16_t            maxudp;
  172     uint16_t            nocookieudp;
  173     unsigned int            maxbits;
  174     dns_aaaa_t          v4_aaaa;
  175     dns_aaaa_t          v6_aaaa;
  176     dns_acl_t *         aaaa_acl;
  177     dns_dns64list_t         dns64;
  178     unsigned int            dns64cnt;
  179     dns_rpz_zones_t         *rpzs;
  180     dns_catz_zones_t        *catzs;
  181     dns_dlzdblist_t         dlz_searched;
  182     dns_dlzdblist_t         dlz_unsearched;
  183     uint32_t            fail_ttl;
  184     dns_badcache_t          *failcache;
  185 
  186     /*
  187      * Configurable data for server use only,
  188      * locked by server configuration lock.
  189      */
  190     dns_acl_t *         matchclients;
  191     dns_acl_t *         matchdestinations;
  192     bool            matchrecursiveonly;
  193 
  194     /* Locked by themselves. */
  195     isc_refcount_t          references;
  196     isc_refcount_t          weakrefs;
  197 
  198     /* Locked by lock. */
  199     unsigned int            attributes;
  200     /* Under owner's locking control. */
  201     ISC_LINK(struct dns_view)   link;
  202     dns_viewlist_t *        viewlist;
  203 
  204     dns_zone_t *            managed_keys;
  205     dns_zone_t *            redirect;
  206     dns_name_t *            redirectzone;   /* points to
  207                              * redirectfixed
  208                              * when valid */
  209     dns_fixedname_t         redirectfixed;
  210 
  211     /*
  212      * File and configuration data for zones added at runtime
  213      * (only used in BIND9).
  214      *
  215      * XXX: This should be a pointer to an opaque type that
  216      * named implements.
  217      */
  218     char *              new_zone_file;
  219     char *                  new_zone_db;
  220     void *              new_zone_dbenv;
  221     uint64_t            new_zone_mapsize;
  222     void *              new_zone_config;
  223     void                (*cfg_destroy)(void **);
  224     isc_mutex_t         new_zone_lock;
  225 
  226     unsigned char           secret[32]; /* Client secret */
  227     unsigned int            v6bias;
  228 
  229     dns_dtenv_t         *dtenv;     /* Dnstap environment */
  230     dns_dtmsgtype_t         dttypes;    /* Dnstap message types
  231                                to log */
  232 };
  233 
  234 #define DNS_VIEW_MAGIC          ISC_MAGIC('V','i','e','w')
  235 #define DNS_VIEW_VALID(view)        ISC_MAGIC_VALID(view, DNS_VIEW_MAGIC)
  236 
  237 #define DNS_VIEWATTR_RESSHUTDOWN    0x01
  238 #define DNS_VIEWATTR_ADBSHUTDOWN    0x02
  239 #define DNS_VIEWATTR_REQSHUTDOWN    0x04
  240 
  241 #ifdef HAVE_LMDB
  242 #include <lmdb.h>
  243 #define DNS_LMDB_COMMON_FLAGS       (MDB_CREATE | MDB_NOSUBDIR | MDB_NOLOCK)
  244 #ifndef __OpenBSD__
  245 #define DNS_LMDB_FLAGS          (DNS_LMDB_COMMON_FLAGS)
  246 #else /* __OpenBSD__ */
  247 /*
  248  * OpenBSD does not have a unified buffer cache, which requires both reads and
  249  * writes to be performed using mmap().
  250  */
  251 #define DNS_LMDB_FLAGS          (DNS_LMDB_COMMON_FLAGS | MDB_WRITEMAP)
  252 #endif /* __OpenBSD__ */
  253 #endif /* HAVE_LMDB */
  254 
  255 isc_result_t
  256 dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
  257         const char *name, dns_view_t **viewp);
  258 /*%<
  259  * Create a view.
  260  *
  261  * Notes:
  262  *
  263  *\li   The newly created view has no cache, no resolver, and an empty
  264  *  zone table.  The view is not frozen.
  265  *
  266  * Requires:
  267  *
  268  *\li   'mctx' is a valid memory context.
  269  *
  270  *\li   'rdclass' is a valid class.
  271  *
  272  *\li   'name' is a valid C string.
  273  *
  274  *\li   viewp != NULL && *viewp == NULL
  275  *
  276  * Returns:
  277  *
  278  *\li   #ISC_R_SUCCESS
  279  *\li   #ISC_R_NOMEMORY
  280  *
  281  *\li   Other errors are possible.
  282  */
  283 
  284 void
  285 dns_view_attach(dns_view_t *source, dns_view_t **targetp);
  286 /*%<
  287  * Attach '*targetp' to 'source'.
  288  *
  289  * Requires:
  290  *
  291  *\li   'source' is a valid, frozen view.
  292  *
  293  *\li   'targetp' points to a NULL dns_view_t *.
  294  *
  295  * Ensures:
  296  *
  297  *\li   *targetp is attached to source.
  298  *
  299  *\li   While *targetp is attached, the view will not shut down.
  300  */
  301 
  302 void
  303 dns_view_detach(dns_view_t **viewp);
  304 /*%<
  305  * Detach '*viewp' from its view.
  306  *
  307  * Requires:
  308  *
  309  *\li   'viewp' points to a valid dns_view_t *
  310  *
  311  * Ensures:
  312  *
  313  *\li   *viewp is NULL.
  314  */
  315 
  316 void
  317 dns_view_flushanddetach(dns_view_t **viewp);
  318 /*%<
  319  * Detach '*viewp' from its view.  If this was the last reference
  320  * uncommitted changed in zones will be flushed to disk.
  321  *
  322  * Requires:
  323  *
  324  *\li   'viewp' points to a valid dns_view_t *
  325  *
  326  * Ensures:
  327  *
  328  *\li   *viewp is NULL.
  329  */
  330 
  331 void
  332 dns_view_weakattach(dns_view_t *source, dns_view_t **targetp);
  333 /*%<
  334  * Weakly attach '*targetp' to 'source'.
  335  *
  336  * Requires:
  337  *
  338  *\li   'source' is a valid, frozen view.
  339  *
  340  *\li   'targetp' points to a NULL dns_view_t *.
  341  *
  342  * Ensures:
  343  *
  344  *\li   *targetp is attached to source.
  345  *
  346  * \li  While *targetp is attached, the view will not be freed.
  347  */
  348 
  349 void
  350 dns_view_weakdetach(dns_view_t **targetp);
  351 /*%<
  352  * Detach '*viewp' from its view.
  353  *
  354  * Requires:
  355  *
  356  *\li   'viewp' points to a valid dns_view_t *.
  357  *
  358  * Ensures:
  359  *
  360  *\li   *viewp is NULL.
  361  */
  362 
  363 isc_result_t
  364 dns_view_createzonetable(dns_view_t *view);
  365 /*%<
  366  * Create a zonetable for the view.
  367  *
  368  * Requires:
  369  *
  370  *\li   'view' is a valid, unfrozen view.
  371  *
  372  *\li   'view' does not have a zonetable already.
  373  *
  374  * Returns:
  375  *
  376  *\li       #ISC_R_SUCCESS
  377  *
  378  *\li   Any error that dns_zt_create() can return.
  379  */
  380 
  381 isc_result_t
  382 dns_view_createresolver(dns_view_t *view,
  383             isc_taskmgr_t *taskmgr,
  384             unsigned int ntasks, unsigned int ndisp,
  385             isc_socketmgr_t *socketmgr,
  386             isc_timermgr_t *timermgr,
  387             unsigned int options,
  388             dns_dispatchmgr_t *dispatchmgr,
  389             dns_dispatch_t *dispatchv4,
  390             dns_dispatch_t *dispatchv6);
  391 /*%<
  392  * Create a resolver and address database for the view.
  393  *
  394  * Requires:
  395  *
  396  *\li   'view' is a valid, unfrozen view.
  397  *
  398  *\li   'view' does not have a resolver already.
  399  *
  400  *\li   The requirements of dns_resolver_create() apply to 'taskmgr',
  401  *  'ntasks', 'socketmgr', 'timermgr', 'options', 'dispatchv4', and
  402  *  'dispatchv6'.
  403  *
  404  * Returns:
  405  *
  406  *\li       #ISC_R_SUCCESS
  407  *
  408  *\li   Any error that dns_resolver_create() can return.
  409  */
  410 
  411 void
  412 dns_view_setcache(dns_view_t *view, dns_cache_t *cache);
  413 void
  414 dns_view_setcache2(dns_view_t *view, dns_cache_t *cache, bool shared);
  415 /*%<
  416  * Set the view's cache database.  If 'shared' is true, this means the cache
  417  * is created by another view and is shared with that view.  dns_view_setcache()
  418  * is a backward compatible version equivalent to setcache2(..., false).
  419  *
  420  * Requires:
  421  *
  422  *\li   'view' is a valid, unfrozen view.
  423  *
  424  *\li   'cache' is a valid cache.
  425  *
  426  * Ensures:
  427  *
  428  * \li      The cache of 'view' is 'cached.
  429  *
  430  *\li   If this is not the first call to dns_view_setcache() for this
  431  *  view, then previously set cache is detached.
  432  */
  433 
  434 void
  435 dns_view_sethints(dns_view_t *view, dns_db_t *hints);
  436 /*%<
  437  * Set the view's hints database.
  438  *
  439  * Requires:
  440  *
  441  *\li   'view' is a valid, unfrozen view, whose hints database has not been
  442  *  set.
  443  *
  444  *\li   'hints' is a valid zone database.
  445  *
  446  * Ensures:
  447  *
  448  * \li      The hints database of 'view' is 'hints'.
  449  */
  450 
  451 void
  452 dns_view_setkeyring(dns_view_t *view, dns_tsig_keyring_t *ring);
  453 void
  454 dns_view_setdynamickeyring(dns_view_t *view, dns_tsig_keyring_t *ring);
  455 /*%<
  456  * Set the view's static TSIG keys
  457  *
  458  * Requires:
  459  *
  460  *   \li   'view' is a valid, unfrozen view, whose static TSIG keyring has not
  461  *  been set.
  462  *
  463  *\li      'ring' is a valid TSIG keyring
  464  *
  465  * Ensures:
  466  *
  467  *\li      The static TSIG keyring of 'view' is 'ring'.
  468  */
  469 
  470 void
  471 dns_view_getdynamickeyring(dns_view_t *view, dns_tsig_keyring_t **ringp);
  472 /*%<
  473  * Return the views dynamic keys.
  474  *
  475  *   \li  'view' is a valid, unfrozen view.
  476  *   \li  'ringp' != NULL && ringp == NULL.
  477  */
  478 
  479 void
  480 dns_view_setdstport(dns_view_t *view, in_port_t dstport);
  481 /*%<
  482  * Set the view's destination port.  This is the port to
  483  * which outgoing queries are sent.  The default is 53,
  484  * the standard DNS port.
  485  *
  486  * Requires:
  487  *
  488  *\li      'view' is a valid view.
  489  *
  490  *\li      'dstport' is a valid TCP/UDP port number.
  491  *
  492  * Ensures:
  493  *\li   External name servers will be assumed to be listening
  494  *  on 'dstport'.  For servers whose address has already
  495  *  obtained obtained at the time of the call, the view may
  496  *  continue to use the previously set port until the address
  497  *  times out from the view's address database.
  498  */
  499 
  500 
  501 isc_result_t
  502 dns_view_addzone(dns_view_t *view, dns_zone_t *zone);
  503 /*%<
  504  * Add zone 'zone' to 'view'.
  505  *
  506  * Requires:
  507  *
  508  *\li   'view' is a valid, unfrozen view.
  509  *
  510  *\li   'zone' is a valid zone.
  511  */
  512 
  513 void
  514 dns_view_freeze(dns_view_t *view);
  515 /*%<
  516  * Freeze view.  No changes can be made to view configuration while frozen.
  517  *
  518  * Requires:
  519  *
  520  *\li   'view' is a valid, unfrozen view.
  521  *
  522  * Ensures:
  523  *
  524  *\li   'view' is frozen.
  525  */
  526 
  527 void
  528 dns_view_thaw(dns_view_t *view);
  529 /*%<
  530  * Thaw view.  This allows zones to be added or removed at runtime.  This is
  531  * NOT thread-safe; the caller MUST have run isc_task_exclusive() prior to
  532  * thawing the view.
  533  *
  534  * Requires:
  535  *
  536  *\li   'view' is a valid, frozen view.
  537  *
  538  * Ensures:
  539  *
  540  *\li   'view' is no longer frozen.
  541  */
  542 isc_result_t
  543 dns_view_find(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
  544           isc_stdtime_t now, unsigned int options, bool use_hints,
  545           dns_db_t **dbp, dns_dbnode_t **nodep, dns_name_t *foundname,
  546           dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
  547 isc_result_t
  548 dns_view_find2(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
  549            isc_stdtime_t now, unsigned int options,
  550            bool use_hints, bool use_static_stub,
  551            dns_db_t **dbp, dns_dbnode_t **nodep, dns_name_t *foundname,
  552            dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
  553 /*%<
  554  * Find an rdataset whose owner name is 'name', and whose type is
  555  * 'type'.
  556  * In general, this function first searches view's zone and cache DBs for the
  557  * best match data against 'name'.  If nothing found there, and if 'use_hints'
  558  * is true, the view's hint DB (if configured) is searched.
  559  * If the view is configured with a static-stub zone which gives the longest
  560  * match for 'name' among the zones, however, the cache DB is not consulted
  561  * unless 'use_static_stub' is false (see below about this argument).
  562  *
  563  * dns_view_find() is a backward compatible version equivalent to
  564  * dns_view_find2() with use_static_stub argument being false.
  565  *
  566  * Notes:
  567  *
  568  *\li   See the description of dns_db_find() for information about 'options'.
  569  *  If the caller sets #DNS_DBFIND_GLUEOK, it must ensure that 'name'
  570  *  and 'type' are appropriate for glue retrieval.
  571  *
  572  *\li   If 'now' is zero, then the current time will be used.
  573  *
  574  *\li   If 'use_hints' is true, and the view has a hints database, then
  575  *  it will be searched last.  If the answer is found in the hints
  576  *  database, the result code will be DNS_R_HINT.  If the name is found
  577  *  in the hints database but not the type, the result code will be
  578  *  #DNS_R_HINTNXRRSET.
  579  *
  580  *\li   If 'use_static_stub' is false and the longest match zone for 'name'
  581  *  is a static-stub zone, it's ignored and the cache and/or hints will be
  582  *  searched.  In the majority of the cases this argument should be
  583  *  false.  The only known usage of this argument being true is
  584  *  if this search is for a "bailiwick" glue A or AAAA RRset that may
  585  *  best match a static-stub zone.  Consider the following example:
  586  *  this view is configured with a static-stub zone "example.com",
  587  *  and an attempt of recursive resolution needs to send a query for the
  588  *  zone.  In this case it's quite likely that the resolver is trying to
  589  *  find A/AAAA RRs for the apex name "example.com".  And, to honor the
  590  *  static-stub configuration it needs to return the glue RRs in the
  591  *  static-stub zone even if that exact RRs coming from the authoritative
  592  *  zone has been cached.
  593  *  In other general cases, the requested data is better to be
  594  *  authoritative, either locally configured or retrieved from an external
  595  *  server, and the data in the static-stub zone should better be ignored.
  596  *
  597  *\li   'foundname' must meet the requirements of dns_db_find().
  598  *
  599  *\li   If 'sigrdataset' is not NULL, and there is a SIG rdataset which
  600  *  covers 'type', then 'sigrdataset' will be bound to it.
  601  *
  602  * Requires:
  603  *
  604  *\li   'view' is a valid, frozen view.
  605  *
  606  *\li   'name' is valid name.
  607  *
  608  *\li   'type' is a valid dns_rdatatype_t, and is not a meta query type
  609  *  except dns_rdatatype_any.
  610  *
  611  *\li   dbp == NULL || *dbp == NULL
  612  *
  613  *\li   nodep == NULL || *nodep == NULL.  If nodep != NULL, dbp != NULL.
  614  *
  615  *\li   'foundname' is a valid name with a dedicated buffer or NULL.
  616  *
  617  *\li   'rdataset' is a valid, disassociated rdataset.
  618  *
  619  *\li   'sigrdataset' is NULL, or is a valid, disassociated rdataset.
  620  *
  621  * Ensures:
  622  *
  623  *\li   In successful cases, 'rdataset', and possibly 'sigrdataset', are
  624  *  bound to the found data.
  625  *
  626  *\li   If dbp != NULL, it points to the database containing the data.
  627  *
  628  *\li   If nodep != NULL, it points to the database node containing the data.
  629  *
  630  *\li   If foundname != NULL, it contains the full name of the found data.
  631  *
  632  * Returns:
  633  *
  634  *\li   Any result that dns_db_find() can return, with the exception of
  635  *  #DNS_R_DELEGATION.
  636  */
  637 
  638 isc_result_t
  639 dns_view_simplefind(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
  640             isc_stdtime_t now, unsigned int options,
  641             bool use_hints,
  642             dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
  643 /*%<
  644  * Find an rdataset whose owner name is 'name', and whose type is
  645  * 'type'.
  646  *
  647  * Notes:
  648  *
  649  *\li   This routine is appropriate for simple, exact-match queries of the
  650  *  view.  'name' must be a canonical name; there is no DNAME or CNAME
  651  *  processing.
  652  *
  653  *\li   See the description of dns_db_find() for information about 'options'.
  654  *  If the caller sets DNS_DBFIND_GLUEOK, it must ensure that 'name'
  655  *  and 'type' are appropriate for glue retrieval.
  656  *
  657  *\li   If 'now' is zero, then the current time will be used.
  658  *
  659  *\li   If 'use_hints' is true, and the view has a hints database, then
  660  *  it will be searched last.  If the answer is found in the hints
  661  *  database, the result code will be DNS_R_HINT.  If the name is found
  662  *  in the hints database but not the type, the result code will be
  663  *  DNS_R_HINTNXRRSET.
  664  *
  665  *\li   If 'sigrdataset' is not NULL, and there is a SIG rdataset which
  666  *  covers 'type', then 'sigrdataset' will be bound to it.
  667  *
  668  * Requires:
  669  *
  670  *\li   'view' is a valid, frozen view.
  671  *
  672  *\li   'name' is valid name.
  673  *
  674  *\li   'type' is a valid dns_rdatatype_t, and is not a meta query type
  675  *  (e.g. dns_rdatatype_any), or dns_rdatatype_rrsig.
  676  *
  677  *\li   'rdataset' is a valid, disassociated rdataset.
  678  *
  679  *\li   'sigrdataset' is NULL, or is a valid, disassociated rdataset.
  680  *
  681  * Ensures:
  682  *
  683  *\li   In successful cases, 'rdataset', and possibly 'sigrdataset', are
  684  *  bound to the found data.
  685  *
  686  * Returns:
  687  *
  688  *\li   #ISC_R_SUCCESS          Success; result is desired type.
  689  *\li   DNS_R_GLUE          Success; result is glue.
  690  *\li   DNS_R_HINT          Success; result is a hint.
  691  *\li   DNS_R_NCACHENXDOMAIN        Success; result is a ncache entry.
  692  *\li   DNS_R_NCACHENXRRSET     Success; result is a ncache entry.
  693  *\li   DNS_R_NXDOMAIN          The name does not exist.
  694  *\li   DNS_R_NXRRSET           The rrset does not exist.
  695  *\li   #ISC_R_NOTFOUND         No matching data found,
  696  *                  or an error occurred.
  697  */
  698 
  699 /*% See dns_view_findzonecut2() */
  700 isc_result_t
  701 dns_view_findzonecut(dns_view_t *view, dns_name_t *name, dns_name_t *fname,
  702              isc_stdtime_t now, unsigned int options,
  703              bool use_hints,
  704              dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
  705 
  706 isc_result_t
  707 dns_view_findzonecut2(dns_view_t *view, dns_name_t *name, dns_name_t *fname,
  708               isc_stdtime_t now, unsigned int options,
  709               bool use_hints, bool use_cache,
  710               dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
  711 /*%<
  712  * Find the best known zonecut containing 'name'.
  713  *
  714  * This uses local authority, cache, and optionally hints data.
  715  * No external queries are performed.
  716  *
  717  * Notes:
  718  *
  719  *\li   If 'now' is zero, then the current time will be used.
  720  *
  721  *\li   If 'use_hints' is true, and the view has a hints database, then
  722  *  it will be searched last.
  723  *
  724  *\li   If 'use_cache' is true, and the view has a cache, then it will be
  725  *  searched.
  726  *
  727  *\li   If 'sigrdataset' is not NULL, and there is a SIG rdataset which
  728  *  covers 'type', then 'sigrdataset' will be bound to it.
  729  *
  730  *\li   If the DNS_DBFIND_NOEXACT option is set, then the zonecut returned
  731  *  (if any) will be the deepest known ancestor of 'name'.
  732  *
  733  * Requires:
  734  *
  735  *\li   'view' is a valid, frozen view.
  736  *
  737  *\li   'name' is valid name.
  738  *
  739  *\li   'rdataset' is a valid, disassociated rdataset.
  740  *
  741  *\li   'sigrdataset' is NULL, or is a valid, disassociated rdataset.
  742  *
  743  * Returns:
  744  *
  745  *\li   #ISC_R_SUCCESS              Success.
  746  *
  747  *\li   Many other results are possible.
  748  */
  749 
  750 isc_result_t
  751 dns_viewlist_find(dns_viewlist_t *list, const char *name,
  752           dns_rdataclass_t rdclass, dns_view_t **viewp);
  753 /*%<
  754  * Search for a view with name 'name' and class 'rdclass' in 'list'.
  755  * If found, '*viewp' is (strongly) attached to it.
  756  *
  757  * Requires:
  758  *
  759  *\li   'viewp' points to a NULL dns_view_t *.
  760  *
  761  * Returns:
  762  *
  763  *\li   #ISC_R_SUCCESS      A matching view was found.
  764  *\li   #ISC_R_NOTFOUND     No matching view was found.
  765  */
  766 
  767 isc_result_t
  768 dns_viewlist_findzone(dns_viewlist_t *list, dns_name_t *name, bool allclasses,
  769               dns_rdataclass_t rdclass, dns_zone_t **zonep);
  770 
  771 /*%<
  772  * Search zone with 'name' in view with 'rdclass' in viewlist 'list'
  773  * If found, zone is returned in *zonep. If allclasses is set rdclass is ignored
  774  *
  775  * Returns:
  776  *\li   #ISC_R_SUCCESS          A matching zone was found.
  777  *\li   #ISC_R_NOTFOUND         No matching zone was found.
  778  *\li   #ISC_R_MULTIPLE         Multiple zones with the same name were found.
  779  */
  780 
  781 isc_result_t
  782 dns_view_findzone(dns_view_t *view, dns_name_t *name, dns_zone_t **zonep);
  783 /*%<
  784  * Search for the zone 'name' in the zone table of 'view'.
  785  * If found, 'zonep' is (strongly) attached to it.  There
  786  * are no partial matches.
  787  *
  788  * Requires:
  789  *
  790  *\li   'zonep' points to a NULL dns_zone_t *.
  791  *
  792  * Returns:
  793  *\li   #ISC_R_SUCCESS      A matching zone was found.
  794  *\li   #ISC_R_NOTFOUND     No matching zone was found.
  795  *\li   others          An error occurred.
  796  */
  797 
  798 isc_result_t
  799 dns_view_load(dns_view_t *view, bool stop);
  800 
  801 isc_result_t
  802 dns_view_loadnew(dns_view_t *view, bool stop);
  803 
  804 isc_result_t
  805 dns_view_asyncload(dns_view_t *view, dns_zt_allloaded_t callback, void *arg);
  806 
  807 isc_result_t
  808 dns_view_asyncload2(dns_view_t *view, dns_zt_allloaded_t callback, void *arg,
  809             bool newonly);
  810 /*%<
  811  * Load zones attached to this view.  dns_view_load() loads
  812  * all zones whose master file has changed since the last
  813  * load; dns_view_loadnew() loads only zones that have never
  814  * been loaded.
  815  *
  816  * dns_view_asyncload() loads zones asynchronously.  When all zones
  817  * in the view have finished loading, 'callback' is called with argument
  818  * 'arg' to inform the caller.
  819  *
  820  * If 'stop' is true, stop on the first error and return it.
  821  * If 'stop' is false (or we are loading asynchronously), ignore errors.
  822  *
  823  * Requires:
  824  *
  825  *\li   'view' is valid.
  826  */
  827 
  828 isc_result_t
  829 dns_view_gettsig(dns_view_t *view, dns_name_t *keyname,
  830          dns_tsigkey_t **keyp);
  831 /*%<
  832  * Find the TSIG key configured in 'view' with name 'keyname',
  833  * if any.
  834  *
  835  * Requires:
  836  *\li   keyp points to a NULL dns_tsigkey_t *.
  837  *
  838  * Returns:
  839  *\li   #ISC_R_SUCCESS  A key was found and '*keyp' now points to it.
  840  *\li   #ISC_R_NOTFOUND No key was found.
  841  *\li   others      An error occurred.
  842  */
  843 
  844 isc_result_t
  845 dns_view_getpeertsig(dns_view_t *view, isc_netaddr_t *peeraddr,
  846              dns_tsigkey_t **keyp);
  847 /*%<
  848  * Find the TSIG key configured in 'view' for the server whose
  849  * address is 'peeraddr', if any.
  850  *
  851  * Requires:
  852  *  keyp points to a NULL dns_tsigkey_t *.
  853  *
  854  * Returns:
  855  *\li   #ISC_R_SUCCESS  A key was found and '*keyp' now points to it.
  856  *\li   #ISC_R_NOTFOUND No key was found.
  857  *\li   others      An error occurred.
  858  */
  859 
  860 isc_result_t
  861 dns_view_checksig(dns_view_t *view, isc_buffer_t *source, dns_message_t *msg);
  862 /*%<
  863  * Verifies the signature of a message.
  864  *
  865  * Requires:
  866  *
  867  *\li   'view' is a valid view.
  868  *\li   'source' is a valid buffer containing the message
  869  *\li   'msg' is a valid message
  870  *
  871  * Returns:
  872  *\li   see dns_tsig_verify()
  873  */
  874 
  875 void
  876 dns_view_dialup(dns_view_t *view);
  877 /*%<
  878  * Perform dialup-time maintenance on the zones of 'view'.
  879  */
  880 
  881 isc_result_t
  882 dns_view_dumpdbtostream(dns_view_t *view, FILE *fp);
  883 /*%<
  884  * Dump the current state of the view 'view' to the stream 'fp'
  885  * for purposes of analysis or debugging.
  886  *
  887  * Currently the dumped state includes the view's cache; in the future
  888  * it may also include other state such as the address database.
  889  * It will not not include authoritative data since it is voluminous and
  890  * easily obtainable by other means.
  891  *
  892  * Requires:
  893  *
  894  *\li   'view' is valid.
  895  *
  896  *\li   'fp' refers to a file open for writing.
  897  *
  898  * Returns:
  899  * \li  ISC_R_SUCCESS   The cache was successfully dumped.
  900  * \li  others      An error occurred (see dns_master_dump)
  901  */
  902 
  903 isc_result_t
  904 dns_view_flushcache(dns_view_t *view);
  905 isc_result_t
  906 dns_view_flushcache2(dns_view_t *view, bool fixuponly);
  907 /*%<
  908  * Flush the view's cache (and ADB).  If 'fixuponly' is true, it only updates
  909  * the internal reference to the cache DB with omitting actual flush operation.
  910  * 'fixuponly' is intended to be used for a view that shares a cache with
  911  * a different view.  dns_view_flushcache() is a backward compatible version
  912  * that always sets fixuponly to false.
  913  *
  914  * Requires:
  915  *  'view' is valid.
  916  *
  917  *  No other tasks are executing.
  918  *
  919  * Returns:
  920  *\li   #ISC_R_SUCCESS
  921  *\li   #ISC_R_NOMEMORY
  922  */
  923 
  924 isc_result_t
  925 dns_view_flushnode(dns_view_t *view, dns_name_t *name, bool tree);
  926 /*%<
  927  * Flush the given name from the view's cache (and optionally ADB/badcache).
  928  *
  929  * Flush the given name from the cache, ADB, and bad cache.  If 'tree'
  930  * is true, also flush all subdomains of 'name'.
  931  *
  932  * Requires:
  933  *\li   'view' is valid.
  934  *\li   'name' is valid.
  935  *
  936  * Returns:
  937  *\li   #ISC_R_SUCCESS
  938  *  other returns are failures.
  939  */
  940 
  941 isc_result_t
  942 dns_view_flushname(dns_view_t *view, dns_name_t *name);
  943 /*%<
  944  * Flush the given name from the view's cache, ADB and badcache.
  945  * Equivalent to dns_view_flushnode(view, name, false).
  946  *
  947  *
  948  * Requires:
  949  *\li   'view' is valid.
  950  *\li   'name' is valid.
  951  *
  952  * Returns:
  953  *\li   #ISC_R_SUCCESS
  954  *  other returns are failures.
  955  */
  956 
  957 isc_result_t
  958 dns_view_adddelegationonly(dns_view_t *view, dns_name_t *name);
  959 /*%<
  960  * Add the given name to the delegation only table.
  961  *
  962  * Requires:
  963  *\li   'view' is valid.
  964  *\li   'name' is valid.
  965  *
  966  * Returns:
  967  *\li   #ISC_R_SUCCESS
  968  *\li   #ISC_R_NOMEMORY
  969  */
  970 
  971 isc_result_t
  972 dns_view_excludedelegationonly(dns_view_t *view, dns_name_t *name);
  973 /*%<
  974  * Add the given name to be excluded from the root-delegation-only.
  975  *
  976  *
  977  * Requires:
  978  *\li   'view' is valid.
  979  *\li   'name' is valid.
  980  *
  981  * Returns:
  982  *\li   #ISC_R_SUCCESS
  983  *\li   #ISC_R_NOMEMORY
  984  */
  985 
  986 bool
  987 dns_view_isdelegationonly(dns_view_t *view, dns_name_t *name);
  988 /*%<
  989  * Check if 'name' is in the delegation only table or if
  990  * rootdelonly is set that name is not being excluded.
  991  *
  992  * Requires:
  993  *\li   'view' is valid.
  994  *\li   'name' is valid.
  995  *
  996  * Returns:
  997  *\li   #true if the name is the table.
  998  *\li   #false otherwise.
  999  */
 1000 
 1001 void
 1002 dns_view_setrootdelonly(dns_view_t *view, bool value);
 1003 /*%<
 1004  * Set the root delegation only flag.
 1005  *
 1006  * Requires:
 1007  *\li   'view' is valid.
 1008  */
 1009 
 1010 bool
 1011 dns_view_getrootdelonly(dns_view_t *view);
 1012 /*%<
 1013  * Get the root delegation only flag.
 1014  *
 1015  * Requires:
 1016  *\li   'view' is valid.
 1017  */
 1018 
 1019 isc_result_t
 1020 dns_view_freezezones(dns_view_t *view, bool freeze);
 1021 /*%<
 1022  * Freeze/thaw updates to master zones.
 1023  *
 1024  * Requires:
 1025  * \li  'view' is valid.
 1026  */
 1027 
 1028 void
 1029 dns_view_setadbstats(dns_view_t *view, isc_stats_t *stats);
 1030 /*%<
 1031  * Set a adb statistics set 'stats' for 'view'.
 1032  *
 1033  * Requires:
 1034  * \li  'view' is valid and is not frozen.
 1035  *
 1036  *\li   stats is a valid statistics supporting adb statistics
 1037  *  (see dns/stats.h).
 1038  */
 1039 
 1040 void
 1041 dns_view_getadbstats(dns_view_t *view, isc_stats_t **statsp);
 1042 /*%<
 1043  * Get the adb statistics counter set for 'view'.  If a statistics set is
 1044  * set '*statsp' will be attached to the set; otherwise, '*statsp' will be
 1045  * untouched.
 1046  *
 1047  * Requires:
 1048  * \li  'view' is valid and is not frozen.
 1049  *
 1050  *\li   'statsp' != NULL && '*statsp' != NULL
 1051  */
 1052 
 1053 void
 1054 dns_view_setresstats(dns_view_t *view, isc_stats_t *stats);
 1055 /*%<
 1056  * Set a general resolver statistics counter set 'stats' for 'view'.
 1057  *
 1058  * Requires:
 1059  * \li  'view' is valid and is not frozen.
 1060  *
 1061  *\li   stats is a valid statistics supporting resolver statistics counters
 1062  *  (see dns/stats.h).
 1063  */
 1064 
 1065 void
 1066 dns_view_getresstats(dns_view_t *view, isc_stats_t **statsp);
 1067 /*%<
 1068  * Get the general statistics counter set for 'view'.  If a statistics set is
 1069  * set '*statsp' will be attached to the set; otherwise, '*statsp' will be
 1070  * untouched.
 1071  *
 1072  * Requires:
 1073  * \li  'view' is valid and is not frozen.
 1074  *
 1075  *\li   'statsp' != NULL && '*statsp' != NULL
 1076  */
 1077 
 1078 void
 1079 dns_view_setresquerystats(dns_view_t *view, dns_stats_t *stats);
 1080 /*%<
 1081  * Set a statistics counter set of rdata type, 'stats', for 'view'.  Once the
 1082  * statistic set is installed, view's resolver will count outgoing queries
 1083  * per rdata type.
 1084  *
 1085  * Requires:
 1086  * \li  'view' is valid and is not frozen.
 1087  *
 1088  *\li   stats is a valid statistics created by dns_rdatatypestats_create().
 1089  */
 1090 
 1091 void
 1092 dns_view_getresquerystats(dns_view_t *view, dns_stats_t **statsp);
 1093 /*%<
 1094  * Get the rdatatype statistics counter set for 'view'.  If a statistics set is
 1095  * set '*statsp' will be attached to the set; otherwise, '*statsp' will be
 1096  * untouched.
 1097  *
 1098  * Requires:
 1099  * \li  'view' is valid and is not frozen.
 1100  *
 1101  *\li   'statsp' != NULL && '*statsp' != NULL
 1102  */
 1103 
 1104 bool
 1105 dns_view_iscacheshared(dns_view_t *view);
 1106 /*%<
 1107  * Check if the view shares the cache created by another view.
 1108  *
 1109  * Requires:
 1110  * \li  'view' is valid.
 1111  *
 1112  * Returns:
 1113  *\li   #true if the cache is shared.
 1114  *\li   #false otherwise.
 1115  */
 1116 
 1117 isc_result_t
 1118 dns_view_initntatable(dns_view_t *view,
 1119               isc_taskmgr_t *taskmgr, isc_timermgr_t *timermgr);
 1120 /*%<
 1121  * Initialize the negative trust anchor table for the view.
 1122  *
 1123  * Requires:
 1124  * \li  'view' is valid.
 1125  *
 1126  * Returns:
 1127  *\li   ISC_R_SUCCESS
 1128  *\li   Any other result indicates failure
 1129  */
 1130 
 1131 isc_result_t
 1132 dns_view_getntatable(dns_view_t *view, dns_ntatable_t **ntp);
 1133 /*%<
 1134  * Get the negative trust anchor table for this view.  Returns
 1135  * ISC_R_NOTFOUND if the table not been initialized for the view.
 1136  *
 1137  * '*ntp' is attached on success; the caller is responsible for
 1138  * detaching it with dns_ntatable_detach().
 1139  *
 1140  * Requires:
 1141  * \li  'view' is valid.
 1142  * \li  'nta' is not NULL and '*nta' is NULL.
 1143  *
 1144  * Returns:
 1145  *\li   ISC_R_SUCCESS
 1146  *\li   ISC_R_NOTFOUND
 1147  */
 1148 
 1149 isc_result_t
 1150 dns_view_initsecroots(dns_view_t *view, isc_mem_t *mctx);
 1151 /*%<
 1152  * Initialize security roots for the view, detaching any previously
 1153  * existing security roots first.  (Note that secroots_priv is
 1154  * NULL until this function is called, so any function using
 1155  * security roots must check that they have been initialized first.
 1156  * One way to do this is use dns_view_getsecroots() and check its
 1157  * return value.)
 1158  *
 1159  * Requires:
 1160  * \li  'view' is valid.
 1161  *
 1162  * Returns:
 1163  *\li   ISC_R_SUCCESS
 1164  *\li   Any other result indicates failure
 1165  */
 1166 
 1167 isc_result_t
 1168 dns_view_getsecroots(dns_view_t *view, dns_keytable_t **ktp);
 1169 /*%<
 1170  * Get the security roots for this view.  Returns ISC_R_NOTFOUND if
 1171  * the security roots keytable has not been initialized for the view.
 1172  *
 1173  * '*ktp' is attached on success; the caller is responsible for
 1174  * detaching it with dns_keytable_detach().
 1175  *
 1176  * Requires:
 1177  * \li  'view' is valid.
 1178  * \li  'ktp' is not NULL and '*ktp' is NULL.
 1179  *
 1180  * Returns:
 1181  *\li   ISC_R_SUCCESS
 1182  *\li   ISC_R_NOTFOUND
 1183  */
 1184 
 1185 isc_result_t
 1186 dns_view_issecuredomain(dns_view_t *view, dns_name_t *name,
 1187             isc_stdtime_t now, bool checknta, bool *ntap,
 1188             bool *secure_domain);
 1189 /*%<
 1190  * Is 'name' at or beneath a trusted key, and not covered by a valid
 1191  * negative trust anchor?  Put answer in '*secure_domain'.
 1192  *
 1193  * If 'checknta' is false, ignore the NTA table in determining
 1194  * whether this is a secure domain. If 'checknta' is not false, and if
 1195  * 'ntap' is non-NULL, then '*ntap' will be updated with true if the
 1196  * name is covered by an NTA.
 1197  *
 1198  * Requires:
 1199  * \li  'view' is valid.
 1200  *
 1201  * Returns:
 1202  *\li   ISC_R_SUCCESS
 1203  *\li   Any other value indicates failure
 1204  */
 1205 
 1206 bool
 1207 dns_view_ntacovers(dns_view_t *view, isc_stdtime_t now,
 1208            dns_name_t *name, dns_name_t *anchor);
 1209 /*%<
 1210  * Is there a current negative trust anchor above 'name' and below 'anchor'?
 1211  *
 1212  * Requires:
 1213  * \li  'view' is valid.
 1214  *
 1215  * Returns:
 1216  *\li   ISC_R_TRUE
 1217  *\li   ISC_R_FALSE
 1218  */
 1219 
 1220 void
 1221 dns_view_untrust(dns_view_t *view, dns_name_t *keyname,
 1222          dns_rdata_dnskey_t *dnskey, isc_mem_t *mctx);
 1223 /*%<
 1224  * Remove keys that match 'keyname' and 'dnskey' from the views trust
 1225  * anchors.
 1226  *
 1227  * (NOTE: If the configuration specifies that there should be a
 1228  * trust anchor at 'keyname', but no keys are left after this
 1229  * operation, that is an error.  We fail closed, inserting a NULL
 1230  * key so as to prevent validation until a legimitate key has been
 1231  * provided.)
 1232  *
 1233  * Requires:
 1234  * \li  'view' is valid.
 1235  * \li  'keyname' is valid.
 1236  * \li  'mctx' is valid.
 1237  * \li  'dnskey' is valid.
 1238  */
 1239 
 1240 isc_result_t
 1241 dns_view_setnewzones(dns_view_t *view, bool allow, void *cfgctx,
 1242              void (*cfg_destroy)(void **), uint64_t mapsize);
 1243 /*%<
 1244  * Set whether or not to allow zones to be created or deleted at runtime.
 1245  *
 1246  * If 'allow' is true, determines the filename into which new zone
 1247  * configuration will be written.  Preserves the configuration context
 1248  * (a pointer to which is passed in 'cfgctx') for use when parsing new
 1249  * zone configuration.  'cfg_destroy' points to a callback routine to
 1250  * destroy the configuration context when the view is destroyed.  (This
 1251  * roundabout method is used in order to avoid libdns having a dependency
 1252  * on libisccfg and libbind9.)
 1253  *
 1254  * If 'allow' is false, removes any existing references to
 1255  * configuration context and frees any memory.
 1256  *
 1257  * Requires:
 1258  * \li 'view' is valid.
 1259  *
 1260  * Returns:
 1261  * \li ISC_R_SUCCESS
 1262  * \li ISC_R_NOSPACE
 1263  */
 1264 
 1265 void
 1266 dns_view_restorekeyring(dns_view_t *view);
 1267 
 1268 isc_result_t
 1269 dns_view_searchdlz(dns_view_t *view, dns_name_t *name,
 1270            unsigned int minlabels,
 1271            dns_clientinfomethods_t *methods,
 1272            dns_clientinfo_t *clientinfo,
 1273            dns_db_t **dbp);
 1274 
 1275 /*%<
 1276  * Search through the DLZ database(s) in view->dlz_searched to find
 1277  * one that can answer a query for 'name', using the DLZ driver's
 1278  * findzone method.  If successful, '*dbp' is set to point to the
 1279  * DLZ database.
 1280  *
 1281  * Returns:
 1282  * \li ISC_R_SUCCESS
 1283  * \li ISC_R_NOTFOUND
 1284  *
 1285  * Requires:
 1286  * \li 'view' is valid.
 1287  * \li 'name' is not NULL.
 1288  * \li 'dbp' is not NULL and *dbp is NULL.
 1289  */
 1290 
 1291 uint32_t
 1292 dns_view_getfailttl(dns_view_t *view);
 1293 /*%<
 1294  * Get the view's servfail-ttl.  zero => no servfail caching.
 1295  *
 1296  * Requires:
 1297  *\li   'view' to be valid.
 1298  */
 1299 
 1300 void
 1301 dns_view_setfailttl(dns_view_t *view, uint32_t failttl);
 1302 /*%<
 1303  * Set the view's servfail-ttl.  zero => no servfail caching.
 1304  *
 1305  * Requires:
 1306  *\li   'view' to be valid.
 1307  */
 1308 
 1309 isc_result_t
 1310 dns_view_saventa(dns_view_t *view);
 1311 /*%<
 1312  * Save NTA for names in this view to a file.
 1313  *
 1314  * Requires:
 1315  *\li   'view' to be valid.
 1316  */
 1317 
 1318 isc_result_t
 1319 dns_view_loadnta(dns_view_t *view);
 1320 /*%<
 1321  * Loads NTA for names in this view from a file.
 1322  *
 1323  * Requires:
 1324  *\li   'view' to be valid.
 1325  */
 1326 
 1327 void
 1328 dns_view_setviewcommit(dns_view_t *view);
 1329 /*%<
 1330  * Commit dns_zone_setview() calls previously made for all zones in this
 1331  * view.
 1332  *
 1333  * Requires:
 1334  *\li   'view' to be valid.
 1335  */
 1336 
 1337 void
 1338 dns_view_setviewrevert(dns_view_t *view);
 1339 /*%<
 1340  * Revert dns_zone_setview() calls previously made for all zones in this
 1341  * view.
 1342  *
 1343  * Requires:
 1344  *\li   'view' to be valid.
 1345  */
 1346 
 1347 
 1348 ISC_LANG_ENDDECLS
 1349 
 1350 #endif /* DNS_VIEW_H */