view.h File Reference

DNS View. More...

#include <stdio.h>
#include <isc/lang.h>
#include <isc/magic.h>
#include <isc/event.h>
#include <isc/mutex.h>
#include <isc/net.h>
#include <isc/refcount.h>
#include <isc/rwlock.h>
#include <isc/stdtime.h>
#include <dns/acl.h>
#include <dns/clientinfo.h>
#include <dns/fixedname.h>
#include <dns/rrl.h>
#include <dns/rdatastruct.h>
#include <dns/rpz.h>
#include <dns/types.h>
#include <dns/zt.h>

Go to the source code of this file.

Data Structures

struct  dns_view

Defines

#define DNS_VIEW_H   1
#define DNS_VIEW_MAGIC   ISC_MAGIC('V','i','e','w')
#define DNS_VIEW_VALID(view)   ISC_MAGIC_VALID(view, DNS_VIEW_MAGIC)
#define DNS_VIEWATTR_RESSHUTDOWN   0x01
#define DNS_VIEWATTR_ADBSHUTDOWN   0x02
#define DNS_VIEWATTR_REQSHUTDOWN   0x04

Functions

isc_result_t dns_view_create (isc_mem_t *mctx, dns_rdataclass_t rdclass, const char *name, dns_view_t **viewp)
 Create a view.
void dns_view_attach (dns_view_t *source, dns_view_t **targetp)
 Attach '*targetp' to 'source'.
void dns_view_detach (dns_view_t **viewp)
 Detach '*viewp' from its view.
void dns_view_flushanddetach (dns_view_t **viewp)
 Detach '*viewp' from its view. If this was the last reference uncommitted changed in zones will be flushed to disk.
void dns_view_weakattach (dns_view_t *source, dns_view_t **targetp)
 Weakly attach '*targetp' to 'source'.
void dns_view_weakdetach (dns_view_t **targetp)
 Detach '*viewp' from its view.
isc_result_t dns_view_createzonetable (dns_view_t *view)
 Create a zonetable for the view.
isc_result_t dns_view_createresolver (dns_view_t *view, isc_taskmgr_t *taskmgr, unsigned int ntasks, unsigned int ndisp, isc_socketmgr_t *socketmgr, isc_timermgr_t *timermgr, unsigned int options, dns_dispatchmgr_t *dispatchmgr, dns_dispatch_t *dispatchv4, dns_dispatch_t *dispatchv6)
 Create a resolver and address database for the view.
void dns_view_setcache (dns_view_t *view, dns_cache_t *cache)
void dns_view_setcache2 (dns_view_t *view, dns_cache_t *cache, isc_boolean_t shared)
 Set the view's cache database. If 'shared' is true, this means the cache is created by another view and is shared with that view. dns_view_setcache() is a backward compatible version equivalent to setcache2(..., ISC_FALSE).
void dns_view_sethints (dns_view_t *view, dns_db_t *hints)
 Set the view's hints database.
void dns_view_setkeyring (dns_view_t *view, dns_tsig_keyring_t *ring)
void dns_view_setdynamickeyring (dns_view_t *view, dns_tsig_keyring_t *ring)
 Set the view's static TSIG keys.
void dns_view_getdynamickeyring (dns_view_t *view, dns_tsig_keyring_t **ringp)
 Return the views dynamic keys.
void dns_view_setdstport (dns_view_t *view, in_port_t dstport)
 Set the view's destination port. This is the port to which outgoing queries are sent. The default is 53, the standard DNS port.
isc_result_t dns_view_addzone (dns_view_t *view, dns_zone_t *zone)
 Add zone 'zone' to 'view'.
void dns_view_freeze (dns_view_t *view)
 Freeze view. No changes can be made to view configuration while frozen.
void dns_view_thaw (dns_view_t *view)
 Thaw view. This allows zones to be added or removed at runtime. This is NOT thread-safe; the caller MUST have run isc_task_exclusive() prior to thawing the view.
isc_result_t dns_view_find (dns_view_t *view, dns_name_t *name, dns_rdatatype_t type, isc_stdtime_t now, unsigned int options, isc_boolean_t use_hints, dns_db_t **dbp, dns_dbnode_t **nodep, dns_name_t *foundname, dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset)
isc_result_t dns_view_find2 (dns_view_t *view, dns_name_t *name, dns_rdatatype_t type, isc_stdtime_t now, unsigned int options, isc_boolean_t use_hints, isc_boolean_t use_static_stub, dns_db_t **dbp, dns_dbnode_t **nodep, dns_name_t *foundname, dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset)
 Find an rdataset whose owner name is 'name', and whose type is 'type'. In general, this function first searches view's zone and cache DBs for the best match data against 'name'. If nothing found there, and if 'use_hints' is ISC_TRUE, the view's hint DB (if configured) is searched. If the view is configured with a static-stub zone which gives the longest match for 'name' among the zones, however, the cache DB is not consulted unless 'use_static_stub' is ISC_FALSE (see below about this argument).
isc_result_t dns_view_simplefind (dns_view_t *view, dns_name_t *name, dns_rdatatype_t type, isc_stdtime_t now, unsigned int options, isc_boolean_t use_hints, dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset)
 Find an rdataset whose owner name is 'name', and whose type is 'type'.
isc_result_t dns_view_findzonecut (dns_view_t *view, dns_name_t *name, dns_name_t *fname, isc_stdtime_t now, unsigned int options, isc_boolean_t use_hints, dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset)
 See dns_view_findzonecut2().
isc_result_t dns_view_findzonecut2 (dns_view_t *view, dns_name_t *name, dns_name_t *fname, isc_stdtime_t now, unsigned int options, isc_boolean_t use_hints, isc_boolean_t use_cache, dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset)
 Find the best known zonecut containing 'name'.
isc_result_t dns_viewlist_find (dns_viewlist_t *list, const char *name, dns_rdataclass_t rdclass, dns_view_t **viewp)
 Search for a view with name 'name' and class 'rdclass' in 'list'. If found, '*viewp' is (strongly) attached to it.
isc_result_t dns_viewlist_findzone (dns_viewlist_t *list, dns_name_t *name, isc_boolean_t allclasses, dns_rdataclass_t rdclass, dns_zone_t **zonep)
 Search zone with 'name' in view with 'rdclass' in viewlist 'list' If found, zone is returned in *zonep. If allclasses is set rdclass is ignored.
isc_result_t dns_view_findzone (dns_view_t *view, dns_name_t *name, dns_zone_t **zonep)
 Search for the zone 'name' in the zone table of 'view'. If found, 'zonep' is (strongly) attached to it. There are no partial matches.
isc_result_t dns_view_load (dns_view_t *view, isc_boolean_t stop)
isc_result_t dns_view_loadnew (dns_view_t *view, isc_boolean_t stop)
isc_result_t dns_view_asyncload (dns_view_t *view, dns_zt_allloaded_t callback, void *arg)
 Load zones attached to this view. dns_view_load() loads all zones whose master file has changed since the last load; dns_view_loadnew() loads only zones that have never been loaded.
isc_result_t dns_view_gettsig (dns_view_t *view, dns_name_t *keyname, dns_tsigkey_t **keyp)
 Find the TSIG key configured in 'view' with name 'keyname', if any.
isc_result_t dns_view_getpeertsig (dns_view_t *view, isc_netaddr_t *peeraddr, dns_tsigkey_t **keyp)
 Find the TSIG key configured in 'view' for the server whose address is 'peeraddr', if any.
isc_result_t dns_view_checksig (dns_view_t *view, isc_buffer_t *source, dns_message_t *msg)
 Verifies the signature of a message.
void dns_view_dialup (dns_view_t *view)
 Perform dialup-time maintenance on the zones of 'view'.
isc_result_t dns_view_dumpdbtostream (dns_view_t *view, FILE *fp)
 Dump the current state of the view 'view' to the stream 'fp' for purposes of analysis or debugging.
isc_result_t dns_view_flushcache (dns_view_t *view)
isc_result_t dns_view_flushcache2 (dns_view_t *view, isc_boolean_t fixuponly)
 Flush the view's cache (and ADB). If 'fixuponly' is true, it only updates the internal reference to the cache DB with omitting actual flush operation. 'fixuponly' is intended to be used for a view that shares a cache with a different view. dns_view_flushcache() is a backward compatible version that always sets fixuponly to false.
isc_result_t dns_view_flushnode (dns_view_t *view, dns_name_t *name, isc_boolean_t tree)
 Flush the given name from the view's cache (and optionally ADB/badcache).
isc_result_t dns_view_flushname (dns_view_t *view, dns_name_t *name)
 Flush the given name from the view's cache, ADB and badcache. Equivalent to dns_view_flushnode(view, name, ISC_FALSE).
isc_result_t dns_view_adddelegationonly (dns_view_t *view, dns_name_t *name)
 Add the given name to the delegation only table.
isc_result_t dns_view_excludedelegationonly (dns_view_t *view, dns_name_t *name)
 Add the given name to be excluded from the root-delegation-only.
isc_boolean_t dns_view_isdelegationonly (dns_view_t *view, dns_name_t *name)
 Check if 'name' is in the delegation only table or if rootdelonly is set that name is not being excluded.
void dns_view_setrootdelonly (dns_view_t *view, isc_boolean_t value)
 Set the root delegation only flag.
isc_boolean_t dns_view_getrootdelonly (dns_view_t *view)
 Get the root delegation only flag.
isc_result_t dns_view_freezezones (dns_view_t *view, isc_boolean_t freeze)
 Freeze/thaw updates to master zones.
void dns_view_setadbstats (dns_view_t *view, isc_stats_t *stats)
 Set a adb statistics set 'stats' for 'view'.
void dns_view_getadbstats (dns_view_t *view, isc_stats_t **statsp)
 Get the adb statistics counter set for 'view'. If a statistics set is set '*statsp' will be attached to the set; otherwise, '*statsp' will be untouched.
void dns_view_setresstats (dns_view_t *view, isc_stats_t *stats)
 Set a general resolver statistics counter set 'stats' for 'view'.
void dns_view_getresstats (dns_view_t *view, isc_stats_t **statsp)
 Get the general statistics counter set for 'view'. If a statistics set is set '*statsp' will be attached to the set; otherwise, '*statsp' will be untouched.
void dns_view_setresquerystats (dns_view_t *view, dns_stats_t *stats)
 Set a statistics counter set of rdata type, 'stats', for 'view'. Once the statistic set is installed, view's resolver will count outgoing queries per rdata type.
void dns_view_getresquerystats (dns_view_t *view, dns_stats_t **statsp)
 Get the rdatatype statistics counter set for 'view'. If a statistics set is set '*statsp' will be attached to the set; otherwise, '*statsp' will be untouched.
isc_boolean_t dns_view_iscacheshared (dns_view_t *view)
 Check if the view shares the cache created by another view.
isc_result_t dns_view_initntatable (dns_view_t *view, isc_taskmgr_t *taskmgr, isc_timermgr_t *timermgr)
 Initialize the negative trust anchor table for the view.
isc_result_t dns_view_getntatable (dns_view_t *view, dns_ntatable_t **ntp)
 Get the negative trust anchor table for this view. Returns ISC_R_NOTFOUND if the table not been initialized for the view.
isc_result_t dns_view_initsecroots (dns_view_t *view, isc_mem_t *mctx)
 Initialize security roots for the view, detaching any previously existing security roots first. (Note that secroots_priv is NULL until this function is called, so any function using security roots must check that they have been initialized first. One way to do this is use dns_view_getsecroots() and check its return value.).
isc_result_t dns_view_getsecroots (dns_view_t *view, dns_keytable_t **ktp)
 Get the security roots for this view. Returns ISC_R_NOTFOUND if the security roots keytable has not been initialized for the view.
isc_result_t dns_view_issecuredomain (dns_view_t *view, dns_name_t *name, isc_stdtime_t now, isc_boolean_t checknta, isc_boolean_t *secure_domain)
 Is 'name' at or beneath a trusted key, and not covered by a valid negative trust anchor? Put answer in '*secure_domain'.
isc_boolean_t dns_view_ntacovers (dns_view_t *view, isc_stdtime_t now, dns_name_t *name, dns_name_t *anchor)
 Is there a current negative trust anchor above 'name' and below 'anchor'?
void dns_view_untrust (dns_view_t *view, dns_name_t *keyname, dns_rdata_dnskey_t *dnskey, isc_mem_t *mctx)
 Remove keys that match 'keyname' and 'dnskey' from the views trust anchors.
void dns_view_setnewzones (dns_view_t *view, isc_boolean_t allow, void *cfgctx, void(*cfg_destroy)(void **))
 Set whether or not to allow zones to be created or deleted at runtime.
void dns_view_restorekeyring (dns_view_t *view)
isc_result_t dns_view_searchdlz (dns_view_t *view, dns_name_t *name, unsigned int minlabels, dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo, dns_db_t **dbp)
 Search through the DLZ database(s) in view->dlz_searched to find one that can answer a query for 'name', using the DLZ driver's findzone method. If successful, '*dbp' is set to point to the DLZ database.
isc_uint32_t dns_view_getfailttl (dns_view_t *view)
 Get the view's servfail-ttl. zero => no servfail caching.
void dns_view_setfailttl (dns_view_t *view, isc_uint32_t failttl)
 Set the view's servfail-ttl. zero => no servfail caching.
isc_result_t dns_view_saventa (dns_view_t *view)
 Save NTA for names in this view to a file.
isc_result_t dns_view_loadnta (dns_view_t *view)
 Loads NTA for names in this view from a file.


Detailed Description

DNS View.

A "view" is a DNS namespace, together with an optional resolver and a forwarding policy. A "DNS namespace" is a (possibly empty) set of authoritative zones together with an optional cache and optional "hints" information.

Views start out "unfrozen". In this state, core attributes like the cache, set of zones, and forwarding policy may be set. While "unfrozen", the caller (e.g. nameserver configuration loading code), must ensure exclusive access to the view. When the view is "frozen", the core attributes become immutable, and the view module will ensure synchronization. Freezing allows the view's core attributes to be accessed without locking.

MP:

Reliability: Resources: Security: Standards:

Definition in file view.h.


Define Documentation

#define DNS_VIEW_H   1

Definition at line 19 of file view.h.

#define DNS_VIEW_MAGIC   ISC_MAGIC('V','i','e','w')

Definition at line 220 of file view.h.

Referenced by dns_view_create().

#define DNS_VIEW_VALID ( view   )     ISC_MAGIC_VALID(view, DNS_VIEW_MAGIC)

Definition at line 221 of file view.h.

Referenced by adb_shutdown(), configure_view(), dns_resolver_create(), dns_view_adddelegationonly(), dns_view_addzone(), dns_view_asyncload(), dns_view_attach(), dns_view_checksig(), dns_view_createresolver(), dns_view_createzonetable(), dns_view_dialup(), dns_view_dumpdbtostream(), dns_view_excludedelegationonly(), dns_view_find2(), dns_view_findzone(), dns_view_findzonecut2(), dns_view_flushcache2(), dns_view_flushnode(), dns_view_freeze(), dns_view_freezezones(), dns_view_getadbstats(), dns_view_getdynamickeyring(), dns_view_getfailttl(), dns_view_getntatable(), dns_view_getresquerystats(), dns_view_getresstats(), dns_view_getrootdelonly(), dns_view_getsecroots(), dns_view_initntatable(), dns_view_initsecroots(), dns_view_iscacheshared(), dns_view_isdelegationonly(), dns_view_issecuredomain(), dns_view_load(), dns_view_loadnew(), dns_view_loadnta(), dns_view_ntacovers(), dns_view_restorekeyring(), dns_view_saventa(), dns_view_searchdlz(), dns_view_setadbstats(), dns_view_setcache2(), dns_view_setdstport(), dns_view_setdynamickeyring(), dns_view_setfailttl(), dns_view_sethints(), dns_view_setkeyring(), dns_view_setnewzones(), dns_view_setresquerystats(), dns_view_setresstats(), dns_view_setrootdelonly(), dns_view_thaw(), dns_view_weakattach(), dns_view_weakdetach(), req_shutdown(), resolver_shutdown(), and view_flushanddetach().

#define DNS_VIEWATTR_RESSHUTDOWN   0x01

Definition at line 223 of file view.h.

Referenced by dns_view_create(), dns_view_createresolver(), and resolver_shutdown().

#define DNS_VIEWATTR_ADBSHUTDOWN   0x02

Definition at line 224 of file view.h.

Referenced by adb_shutdown(), dns_view_create(), and dns_view_createresolver().

#define DNS_VIEWATTR_REQSHUTDOWN   0x04

Definition at line 225 of file view.h.

Referenced by dns_view_create(), dns_view_createresolver(), and req_shutdown().


Function Documentation

isc_result_t dns_view_create ( isc_mem_t mctx,
dns_rdataclass_t  rdclass,
const char *  name,
dns_view_t **  viewp 
)

Create a view.

Notes:

Requires:

Returns:

Definition at line 81 of file view.c.

References dns_view::aaaa_acl, dns_view::acache, dns_view::acceptexpired, dns_view::aclenv, dns_view::adb, adb_shutdown(), dns_view::adbevent, dns_view::adbstats, dns_view::additionalfromauth, dns_view::additionalfromcache, dns_view::answeracl_exclude, dns_view::answernames_exclude, dns_view::attributes, dns_view::auth_nxdomain, buffer, dns_view::cache, dns_view::cacheacl, dns_view::cachedb, dns_view::cacheonacl, dns_view::cacheshared, dns_view::cfg_destroy, dns_view::delonly, dns_view::denyansweracl, dns_view::denyanswernames, DESTROYLOCK, dns_view::dlv, dns_view::dlv_fixed, dns_view::dlz_searched, dns_view::dlz_unsearched, dns_view::dns64, dns_view::dns64cnt, dns_aaaa_ok, dns_aclenv_init(), dns_badcache_init(), DNS_EVENT_VIEWADBSHUTDOWN, DNS_EVENT_VIEWREQSHUTDOWN, DNS_EVENT_VIEWRESSHUTDOWN, dns_fixedname_init, dns_fwdtable_create(), dns_fwdtable_destroy(), dns_one_answer, dns_order_create(), dns_order_detach(), dns_peerlist_detach(), dns_peerlist_new(), dns_tsigkeyring_create(), dns_tsigkeyring_detach(), DNS_VIEW_FAILCACHESIZE, DNS_VIEW_MAGIC, DNS_VIEWATTR_ADBSHUTDOWN, DNS_VIEWATTR_REQSHUTDOWN, DNS_VIEWATTR_RESSHUTDOWN, dns_zt_create(), dns_zt_detach(), dns_view::dstport, dns_view::dynamickeys, dns_view::enablednssec, dns_view::enablevalidation, dns_view::fail_ttl, dns_view::failcache, dns_view::flush, dns_view::frozen, dns_view::fwdtable, dns_view::hints, isc_bind9, ISC_EVENT_INIT, ISC_FALSE, isc_file_sanitize(), ISC_LINK_INIT, ISC_LIST_INIT, isc_mem_attach(), isc_mem_free, isc_mem_get, isc_mem_putanddetach, isc_mem_strdup, isc_mutex_init, ISC_R_NOMEMORY, ISC_R_SUCCESS, ISC_R_UNEXPECTED, isc_refcount_destroy, isc_refcount_init(), isc_result_totext(), ISC_TRUE, dns_view::lock, dns_view::magic, dns_view::managed_keys, dns_view::matchclients, dns_view::matchdestinations, dns_view::matchrecursiveonly, dns_view::maxbits, dns_view::maxcachettl, dns_view::maxncachettl, dns_view::maxudp, dns_view::mctx, dns_view::minimalresponses, dns_view::name, dns_view::new_zone_config, dns_view::new_zone_file, dns_view::nocasecompress, dns_view::notifyacl, dns_view::nta_file, dns_view::nta_lifetime, dns_view::nta_recheck, dns_view::ntatable_priv, dns_view::order, dns_view::peers, dns_view::preferred_glue, dns_view::prefetch_eligible, dns_view::prefetch_trigger, dns_view::provideixfr, dns_view::queryacl, dns_view::queryonacl, dns_view::rdclass, dns_view::recursion, dns_view::recursionacl, dns_view::recursiononacl, dns_view::redirect, dns_view::redirectfixed, dns_view::redirectzone, dns_view::references, req_shutdown(), dns_view::reqevent, dns_view::requestmgr, dns_view::requestnsid, dns_view::requestsit, REQUIRE, dns_view::resevent, dns_view::resolver, resolver_shutdown(), dns_view::resquerystats, dns_view::resstats, dns_view::rootdelonly, dns_view::rootexclude, dns_view::rpzs, dns_view::rrl, dns_view::secroots_priv, dns_view::situdp, dns_view::sortlist, dns_view::statickeys, dns_view::task, dns_view::transfer_format, dns_view::transferacl, UNEXPECTED_ERROR, dns_view::updateacl, dns_view::upfwdacl, dns_view::v4_aaaa, dns_view::v6_aaaa, dns_view::viewlist, dns_view::weakrefs, and dns_view::zonetable.

Referenced by create_view(), createview(), dns_test_makeview(), and dns_test_makezone().

void dns_view_attach ( dns_view_t source,
dns_view_t **  targetp 
)

Attach '*targetp' to 'source'.

Requires:

Ensures:

Definition at line 518 of file view.c.

References DNS_VIEW_VALID, isc_refcount_increment, dns_view::references, and REQUIRE.

Referenced by add_view_tolist(), client_request(), create_view(), dns_lookup_create(), and dns_viewlist_find().

void dns_view_detach ( dns_view_t **  viewp  ) 

Detach '*viewp' from its view.

Requires:

Ensures:

Definition at line 594 of file view.c.

References ISC_FALSE, and view_flushanddetach().

Referenced by add_keydata_zone(), ATF_TC_BODY(), configure_rpz(), configure_view(), configure_zone(), create_view(), createview(), destroyclient(), dns_client_addtrustedkey(), dns_client_clearservers(), dns_client_destroyrestrans(), dns_client_destroyupdatetrans(), dns_client_setdlv(), dns_client_setservers(), dns_client_startrequest(), dns_client_startresolve(), dns_client_startupdate(), dns_test_makeview(), dns_test_makezone(), dumpcontext_destroy(), exit_check(), load_configuration(), lookup_find(), newzone_parse(), ns_client_endrequest(), ns_lwdmanager_create(), ns_lwdmanager_detach(), ns_server_changezone(), shutdown_server(), and zone_from_args().

void dns_view_flushanddetach ( dns_view_t **  viewp  ) 

Detach '*viewp' from its view. If this was the last reference uncommitted changed in zones will be flushed to disk.

Requires:

Ensures:

Definition at line 589 of file view.c.

References ISC_TRUE, and view_flushanddetach().

Referenced by shutdown_server().

void dns_view_weakattach ( dns_view_t source,
dns_view_t **  targetp 
)

Weakly attach '*targetp' to 'source'.

Requires:

Ensures:

Definition at line 614 of file view.c.

References DNS_VIEW_VALID, dns_view::lock, LOCK, REQUIRE, UNLOCK, and dns_view::weakrefs.

Referenced by dns_validator_create(), and dns_zone_setview().

void dns_view_weakdetach ( dns_view_t **  targetp  ) 

Detach '*viewp' from its view.

Requires:

Ensures:

Definition at line 627 of file view.c.

References all_done(), destroy(), DNS_VIEW_VALID, INSIST, ISC_FALSE, dns_view::lock, LOCK, REQUIRE, UNLOCK, and dns_view::weakrefs.

Referenced by destroy(), dns_validator_create(), dns_zone_setview(), and zone_shutdown().

isc_result_t dns_view_createzonetable ( dns_view_t view  ) 

Create a zonetable for the view.

Requires:

Returns:

Definition at line 722 of file view.c.

References DNS_VIEW_VALID, dns_zt_create(), dns_view::frozen, dns_view::mctx, dns_view::rdclass, REQUIRE, and dns_view::zonetable.

isc_result_t dns_view_createresolver ( dns_view_t view,
isc_taskmgr_t taskmgr,
unsigned int  ntasks,
unsigned int  ndisp,
isc_socketmgr_t socketmgr,
isc_timermgr_t timermgr,
unsigned int  options,
dns_dispatchmgr_t dispatchmgr,
dns_dispatch_t dispatchv4,
dns_dispatch_t dispatchv6 
)

Create a resolver and address database for the view.

Requires:

Returns:

Definition at line 732 of file view.c.

References dns_view::adb, dns_view::adbevent, dns_view::attributes, dns_adb_create(), dns_adb_shutdown(), dns_adb_whenshutdown(), dns_requestmgr_create(), dns_requestmgr_whenshutdown(), dns_resolver_create(), dns_resolver_dispatchmgr(), dns_resolver_shutdown(), dns_resolver_taskmgr(), dns_resolver_whenshutdown(), DNS_VIEW_VALID, DNS_VIEWATTR_ADBSHUTDOWN, DNS_VIEWATTR_REQSHUTDOWN, DNS_VIEWATTR_RESSHUTDOWN, dns_view::frozen, isc_mem_create(), isc_mem_detach(), isc_mem_setname(), ISC_R_SUCCESS, isc_task_create(), isc_task_detach(), isc_task_setname(), dns_view::mctx, mctx, dns_view::reqevent, dns_view::requestmgr, REQUIRE, dns_view::resevent, dns_view::resolver, and dns_view::task.

Referenced by configure_view(), and createview().

void dns_view_setcache ( dns_view_t view,
dns_cache_t cache 
)

Definition at line 802 of file view.c.

References dns_view_setcache2(), and ISC_FALSE.

void dns_view_setcache2 ( dns_view_t view,
dns_cache_t cache,
isc_boolean_t  shared 
)

Set the view's cache database. If 'shared' is true, this means the cache is created by another view and is shared with that view. dns_view_setcache() is a backward compatible version equivalent to setcache2(..., ISC_FALSE).

Requires:

Ensures:

Definition at line 807 of file view.c.

References dns_view::acache, dns_view::cache, dns_view::cachedb, dns_view::cacheshared, dns_acache_putdb(), dns_acache_setdb(), dns_cache_attach(), dns_cache_attachdb(), dns_cache_detach(), dns_db_detach(), DNS_DB_VALID, DNS_VIEW_VALID, dns_view::frozen, INSIST, and REQUIRE.

Referenced by configure_view(), and dns_view_setcache().

void dns_view_sethints ( dns_view_t view,
dns_db_t hints 
)

Set the view's hints database.

Requires:

Ensures:

Definition at line 834 of file view.c.

References dns_db_attach(), dns_db_iszone(), DNS_VIEW_VALID, dns_view::frozen, dns_view::hints, and REQUIRE.

Referenced by configure_hints(), and configure_view().

void dns_view_setkeyring ( dns_view_t view,
dns_tsig_keyring_t ring 
)

Definition at line 844 of file view.c.

References dns_tsigkeyring_attach(), dns_tsigkeyring_detach(), DNS_VIEW_VALID, REQUIRE, and dns_view::statickeys.

Referenced by configure_view().

void dns_view_setdynamickeyring ( dns_view_t view,
dns_tsig_keyring_t ring 
)

Set the view's static TSIG keys.

Requires:

Ensures:

Definition at line 853 of file view.c.

References dns_tsigkeyring_attach(), dns_tsigkeyring_detach(), DNS_VIEW_VALID, dns_view::dynamickeys, and REQUIRE.

Referenced by configure_view().

void dns_view_getdynamickeyring ( dns_view_t view,
dns_tsig_keyring_t **  ringp 
)

Return the views dynamic keys.

Definition at line 862 of file view.c.

References dns_tsigkeyring_attach(), DNS_VIEW_VALID, dns_view::dynamickeys, and REQUIRE.

Referenced by configure_view().

void dns_view_setdstport ( dns_view_t view,
in_port_t  dstport 
)

Set the view's destination port. This is the port to which outgoing queries are sent. The default is 53, the standard DNS port.

Requires:

Ensures:

Definition at line 891 of file view.c.

References DNS_VIEW_VALID, dns_view::dstport, and REQUIRE.

Referenced by configure_view().

isc_result_t dns_view_addzone ( dns_view_t view,
dns_zone_t zone 
)

Add zone 'zone' to 'view'.

Requires:

Definition at line 917 of file view.c.

References DNS_VIEW_VALID, dns_zt_mount(), dns_view::frozen, REQUIRE, and dns_view::zonetable.

Referenced by configure_zone(), create_empty_zone(), dns64_reverse(), dns_dlz_writeablezone(), and dns_test_makezone().

void dns_view_freeze ( dns_view_t view  ) 

Freeze view. No changes can be made to view configuration while frozen.

Requires:

Ensures:

Definition at line 897 of file view.c.

References dns_view::cachedb, dns_resolver_freeze(), DNS_VIEW_VALID, dns_view::frozen, INSIST, ISC_TRUE, REQUIRE, and dns_view::resolver.

Referenced by dns_client_createx2(), do_addzone(), do_modzone(), and load_configuration().

void dns_view_thaw ( dns_view_t view  ) 

Thaw view. This allows zones to be added or removed at runtime. This is NOT thread-safe; the caller MUST have run isc_task_exclusive() prior to thawing the view.

Requires:

Ensures:

Definition at line 909 of file view.c.

References DNS_VIEW_VALID, dns_view::frozen, ISC_FALSE, and REQUIRE.

Referenced by do_addzone(), and do_modzone().

isc_result_t dns_view_find ( dns_view_t view,
dns_name_t name,
dns_rdatatype_t  type,
isc_stdtime_t  now,
unsigned int  options,
isc_boolean_t  use_hints,
dns_db_t **  dbp,
dns_dbnode_t **  nodep,
dns_name_t foundname,
dns_rdataset_t rdataset,
dns_rdataset_t sigrdataset 
)

Definition at line 950 of file view.c.

References dns_view_find2(), and ISC_FALSE.

Referenced by dns_view_simplefind(), and view_find().

isc_result_t dns_view_find2 ( dns_view_t view,
dns_name_t name,
dns_rdatatype_t  type,
isc_stdtime_t  now,
unsigned int  options,
isc_boolean_t  use_hints,
isc_boolean_t  use_static_stub,
dns_db_t **  dbp,
dns_dbnode_t **  nodep,
dns_name_t foundname,
dns_rdataset_t rdataset,
dns_rdataset_t sigrdataset 
)

Find an rdataset whose owner name is 'name', and whose type is 'type'. In general, this function first searches view's zone and cache DBs for the best match data against 'name'. If nothing found there, and if 'use_hints' is ISC_TRUE, the view's hint DB (if configured) is searched. If the view is configured with a static-stub zone which gives the longest match for 'name' among the zones, however, the cache DB is not consulted unless 'use_static_stub' is ISC_FALSE (see below about this argument).

dns_view_find() is a backward compatible version equivalent to dns_view_find2() with use_static_stub argument being ISC_FALSE.

Notes:

Requires:

Ensures:

Returns:

Definition at line 960 of file view.c.

References dns_view::cachedb, cleanup(), dns_db_attach(), dns_db_attachnode(), dns_db_detach(), dns_db_detachnode(), dns_db_find(), dns_db_iscache(), dns_name_equal(), DNS_R_DELEGATION, DNS_R_GLUE, DNS_R_HINT, DNS_R_HINTNXRRSET, DNS_R_NXDOMAIN, DNS_R_NXRRSET, DNS_R_PARTIALMATCH, dns_rdataset_clone(), dns_rdataset_disassociate(), dns_rdataset_init(), dns_rdataset_isassociated(), dns_resolver_prime(), DNS_VIEW_VALID, dns_zone_detach(), dns_zone_getdb(), dns_zone_getorigin(), dns_zone_gettype(), dns_zone_staticstub, dns_zt_find(), dns_view::frozen, dns_view::hints, INSIST, ISC_FALSE, ISC_R_NOTFOUND, ISC_R_SUCCESS, ISC_TRUE, dns_view::lock, LOCK, REQUIRE, dns_view::resolver, UNLOCK, zone, and dns_view::zonetable.

Referenced by dbfind_name(), and dns_view_find().

isc_result_t dns_view_simplefind ( dns_view_t view,
dns_name_t name,
dns_rdatatype_t  type,
isc_stdtime_t  now,
unsigned int  options,
isc_boolean_t  use_hints,
dns_rdataset_t rdataset,
dns_rdataset_t sigrdataset 
)

Find an rdataset whose owner name is 'name', and whose type is 'type'.

Notes:

Requires:

Ensures:

Returns:

Definition at line 1173 of file view.c.

References dns_fixedname_init, dns_fixedname_name, DNS_R_GLUE, DNS_R_HINT, DNS_R_HINTNXRRSET, DNS_R_NCACHENXDOMAIN, DNS_R_NCACHENXRRSET, DNS_R_NXDOMAIN, DNS_R_NXRRSET, dns_rdataset_disassociate(), dns_rdataset_isassociated(), dns_view_find(), ISC_R_NOTFOUND, and ISC_R_SUCCESS.

Referenced by dns_message_checksig().

isc_result_t dns_view_findzonecut ( dns_view_t view,
dns_name_t name,
dns_name_t fname,
isc_stdtime_t  now,
unsigned int  options,
isc_boolean_t  use_hints,
dns_rdataset_t rdataset,
dns_rdataset_t sigrdataset 
)

See dns_view_findzonecut2().

Definition at line 1217 of file view.c.

References dns_view_findzonecut2(), and ISC_TRUE.

Referenced by fctx_create(), and resquery_response().

isc_result_t dns_view_findzonecut2 ( dns_view_t view,
dns_name_t name,
dns_name_t fname,
isc_stdtime_t  now,
unsigned int  options,
isc_boolean_t  use_hints,
isc_boolean_t  use_cache,
dns_rdataset_t rdataset,
dns_rdataset_t sigrdataset 
)

Find the best known zonecut containing 'name'.

This uses local authority, cache, and optionally hints data. No external queries are performed.

Notes:

Requires:

Returns:

Definition at line 1228 of file view.c.

References dns_view::cachedb, cleanup(), dns_db_attach(), dns_db_detach(), dns_db_find(), dns_db_findzonecut(), dns_db_iscache(), DNS_DBFIND_NOEXACT, dns_fixedname_init, dns_fixedname_name, dns_name_copy(), dns_name_equal(), dns_name_issubdomain(), DNS_R_DELEGATION, DNS_R_PARTIALMATCH, dns_rdataset_clone(), dns_rdataset_disassociate(), dns_rdataset_init(), dns_rdataset_isassociated(), dns_rootname, DNS_VIEW_VALID, dns_zone_detach(), dns_zone_getdb(), dns_zone_staticstub, dns_zt_find(), DNS_ZTFIND_NOEXACT, finish, dns_view::frozen, dns_view::hints, ISC_FALSE, ISC_R_NOTFOUND, ISC_R_SUCCESS, ISC_TRUE, dns_view::lock, LOCK, REQUIRE, UNLOCK, zone, and dns_view::zonetable.

Referenced by dns_view_findzonecut(), fetch_name(), and proveunsecure().

isc_result_t dns_viewlist_find ( dns_viewlist_t *  list,
const char *  name,
dns_rdataclass_t  rdclass,
dns_view_t **  viewp 
)

Search for a view with name 'name' and class 'rdclass' in 'list'. If found, '*viewp' is (strongly) attached to it.

Requires:

Returns:

Definition at line 1412 of file view.c.

References dns_view_attach(), ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_NOTFOUND, ISC_R_SUCCESS, dns_view::name, dns_view::rdclass, and REQUIRE.

Referenced by add_keydata_zone(), configure_rpz(), configure_view(), configure_zone(), create_view(), dns_client_addtrustedkey(), dns_client_clearservers(), dns_client_setdlv(), dns_client_setservers(), dns_client_startrequest(), dns_client_startresolve(), dns_client_startupdate(), find_view(), newzone_parse(), ns_lwdmanager_create(), and zone_from_args().

isc_result_t dns_viewlist_findzone ( dns_viewlist_t *  list,
dns_name_t name,
isc_boolean_t  allclasses,
dns_rdataclass_t  rdclass,
dns_zone_t **  zonep 
)

Search zone with 'name' in view with 'rdclass' in viewlist 'list' If found, zone is returned in *zonep. If allclasses is set rdclass is ignored.

Returns:

Definition at line 1434 of file view.c.

References DNS_R_PARTIALMATCH, dns_zone_attach(), dns_zone_detach(), dns_zt_find(), INSIST, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_MULTIPLE, ISC_R_NOTFOUND, ISC_R_SUCCESS, dns_view::lock, LOCK, POST, dns_view::rdclass, REQUIRE, UNLOCK, and dns_view::zonetable.

Referenced by zone_from_args().

isc_result_t dns_view_findzone ( dns_view_t view,
dns_name_t name,
dns_zone_t **  zonep 
)

Search for the zone 'name' in the zone table of 'view'. If found, 'zonep' is (strongly) attached to it. There are no partial matches.

Requires:

Returns:

Definition at line 930 of file view.c.

References DNS_R_PARTIALMATCH, DNS_VIEW_VALID, dns_zone_detach(), dns_zt_find(), ISC_R_NOTFOUND, dns_view::lock, LOCK, REQUIRE, UNLOCK, and dns_view::zonetable.

Referenced by configure_view(), configure_zone(), and dns_dlz_writeablezone().

isc_result_t dns_view_load ( dns_view_t view,
isc_boolean_t  stop 
)

Definition at line 1492 of file view.c.

References DNS_VIEW_VALID, dns_zt_load(), REQUIRE, and dns_view::zonetable.

isc_result_t dns_view_loadnew ( dns_view_t view,
isc_boolean_t  stop 
)

Definition at line 1501 of file view.c.

References DNS_VIEW_VALID, dns_zt_loadnew(), REQUIRE, and dns_view::zonetable.

Referenced by load_new_zones().

isc_result_t dns_view_asyncload ( dns_view_t view,
dns_zt_allloaded_t  callback,
void *  arg 
)

Load zones attached to this view. dns_view_load() loads all zones whose master file has changed since the last load; dns_view_loadnew() loads only zones that have never been loaded.

dns_view_asyncload() loads zones asynchronously. When all zones in the view have finished loading, 'callback' is called with argument 'arg' to inform the caller.

If 'stop' is ISC_TRUE, stop on the first error and return it. If 'stop' is ISC_FALSE (or we are loading asynchronously), ignore errors.

Requires:

Definition at line 1510 of file view.c.

References DNS_VIEW_VALID, dns_zt_asyncload(), REQUIRE, and dns_view::zonetable.

Referenced by load_zones().

isc_result_t dns_view_gettsig ( dns_view_t view,
dns_name_t keyname,
dns_tsigkey_t **  keyp 
)

Find the TSIG key configured in 'view' with name 'keyname', if any.

Requires:

Returns:

Definition at line 1518 of file view.c.

References dns_tsigkey_find(), dns_view::dynamickeys, ISC_R_NOTFOUND, REQUIRE, and dns_view::statickeys.

Referenced by dns_view_getpeertsig(), got_transfer_quota(), ns_client_isself(), ns_query(), soa_query(), and zone_notify().

isc_result_t dns_view_getpeertsig ( dns_view_t view,
isc_netaddr_t peeraddr,
dns_tsigkey_t **  keyp 
)

Find the TSIG key configured in 'view' for the server whose address is 'peeraddr', if any.

Requires: keyp points to a NULL dns_tsigkey_t *.

Returns:

Definition at line 1532 of file view.c.

References dns_peer_getkey(), dns_peerlist_peerbyaddr(), dns_view_gettsig(), ISC_R_FAILURE, ISC_R_NOTFOUND, ISC_R_SUCCESS, and dns_view::peers.

Referenced by got_transfer_quota(), notify_isself(), notify_send_toaddr(), ns_query(), resquery_send(), and soa_query().

isc_result_t dns_view_checksig ( dns_view_t view,
isc_buffer_t source,
dns_message_t msg 
)

Verifies the signature of a message.

Requires:

Returns:

Definition at line 1552 of file view.c.

References dns_tsig_verify(), DNS_VIEW_VALID, dns_view::dynamickeys, REQUIRE, and dns_view::statickeys.

Referenced by dns_message_checksig().

void dns_view_dialup ( dns_view_t view  ) 

Perform dialup-time maintenance on the zones of 'view'.

Definition at line 606 of file view.c.

References dialup(), DNS_VIEW_VALID, dns_zt_apply(), ISC_FALSE, REQUIRE, and dns_view::zonetable.

Referenced by heartbeat_timer_tick().

isc_result_t dns_view_dumpdbtostream ( dns_view_t view,
FILE *  fp 
)

Dump the current state of the view 'view' to the stream 'fp' for purposes of analysis or debugging.

Currently the dumped state includes the view's cache; in the future it may also include other state such as the address database. It will not not include authoritative data since it is voluminous and easily obtainable by other means.

Requires:

Returns:

Definition at line 1561 of file view.c.

References dns_view::adb, dns_view::cachedb, dns_adb_dump(), dns_badcache_print(), dns_master_dumptostream(), dns_master_style_cache, dns_resolver_printbadcache(), DNS_VIEW_VALID, dns_view::failcache, ISC_R_SUCCESS, dns_view::mctx, dns_view::name, REQUIRE, and dns_view::resolver.

isc_result_t dns_view_flushcache ( dns_view_t view  ) 

Definition at line 1578 of file view.c.

References dns_view_flushcache2(), and ISC_FALSE.

Referenced by ns_server_validation().

isc_result_t dns_view_flushcache2 ( dns_view_t view,
isc_boolean_t  fixuponly 
)

Flush the view's cache (and ADB). If 'fixuponly' is true, it only updates the internal reference to the cache DB with omitting actual flush operation. 'fixuponly' is intended to be used for a view that shares a cache with a different view. dns_view_flushcache() is a backward compatible version that always sets fixuponly to false.

Requires: 'view' is valid.

No other tasks are executing.

Returns:

Definition at line 1583 of file view.c.

References dns_view::acache, dns_view::adb, dns_view::cache, dns_view::cachedb, dns_acache_putdb(), dns_acache_setdb(), dns_adb_flush(), dns_badcache_flush(), dns_cache_attachdb(), dns_cache_flush(), dns_db_detach(), dns_resolver_flushbadcache(), DNS_VIEW_VALID, dns_view::failcache, ISC_R_SUCCESS, REQUIRE, and dns_view::resolver.

Referenced by dns_view_flushcache(), and ns_server_flushcache().

isc_result_t dns_view_flushnode ( dns_view_t view,
dns_name_t name,
isc_boolean_t  tree 
)

Flush the given name from the view's cache (and optionally ADB/badcache).

Flush the given name from the cache, ADB, and bad cache. If 'tree' is true, also flush all subdomains of 'name'.

Requires:

Returns:

Definition at line 1616 of file view.c.

References dns_view::adb, dns_view::cache, dns_adb_flushname(), dns_adb_flushnames(), dns_badcache_flushname(), dns_badcache_flushtree(), dns_cache_flushnode(), dns_resolver_flushbadcache(), dns_resolver_flushbadnames(), DNS_VIEW_VALID, dns_view::failcache, ISC_R_SUCCESS, REQUIRE, and dns_view::resolver.

Referenced by dns_view_flushname(), ns_server_flushnode(), and ns_server_nta().

isc_result_t dns_view_flushname ( dns_view_t view,
dns_name_t name 
)

Flush the given name from the view's cache, ADB and badcache. Equivalent to dns_view_flushnode(view, name, ISC_FALSE).

Requires:

Returns:

Definition at line 1611 of file view.c.

References dns_view_flushnode(), and ISC_FALSE.

isc_result_t dns_view_adddelegationonly ( dns_view_t view,
dns_name_t name 
)

Add the given name to the delegation only table.

Requires:

Returns:

Definition at line 1644 of file view.c.

References dns_view::delonly, dns_name_dup(), dns_name_equal(), dns_name_hash(), dns_name_init(), DNS_VIEW_DELONLYHASH, DNS_VIEW_VALID, hash, ISC_FALSE, ISC_LIST_APPEND, ISC_LIST_HEAD, ISC_LIST_INIT, ISC_LIST_NEXT, isc_mem_get, isc_mem_put, ISC_R_NOMEMORY, ISC_R_SUCCESS, dns_view::mctx, and REQUIRE.

Referenced by configure_zone().

isc_result_t dns_view_excludedelegationonly ( dns_view_t view,
dns_name_t name 
)

Add the given name to be excluded from the root-delegation-only.

Requires:

Returns:

Definition at line 1679 of file view.c.

References dns_name_dup(), dns_name_equal(), dns_name_hash(), dns_name_init(), DNS_VIEW_DELONLYHASH, DNS_VIEW_VALID, hash, ISC_FALSE, ISC_LIST_APPEND, ISC_LIST_HEAD, ISC_LIST_INIT, ISC_LIST_NEXT, isc_mem_get, isc_mem_put, ISC_R_NOMEMORY, ISC_R_SUCCESS, dns_view::mctx, REQUIRE, and dns_view::rootexclude.

Referenced by configure_view().

isc_boolean_t dns_view_isdelegationonly ( dns_view_t view,
dns_name_t name 
)

Check if 'name' is in the delegation only table or if rootdelonly is set that name is not being excluded.

Requires:

Returns:

Definition at line 1714 of file view.c.

References dns_view::delonly, dns_name_countlabels(), dns_name_equal(), dns_name_hash(), DNS_VIEW_DELONLYHASH, DNS_VIEW_VALID, hash, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_TRUE, REQUIRE, dns_view::rootdelonly, and dns_view::rootexclude.

Referenced by resquery_response().

void dns_view_setrootdelonly ( dns_view_t view,
isc_boolean_t  value 
)

Set the root delegation only flag.

Requires:

Definition at line 1746 of file view.c.

References DNS_VIEW_VALID, REQUIRE, and dns_view::rootdelonly.

Referenced by configure_view().

isc_boolean_t dns_view_getrootdelonly ( dns_view_t view  ) 

Get the root delegation only flag.

Requires:

Definition at line 1752 of file view.c.

References DNS_VIEW_VALID, REQUIRE, and dns_view::rootdelonly.

isc_result_t dns_view_freezezones ( dns_view_t view,
isc_boolean_t  freeze 
)

Freeze/thaw updates to master zones.

Requires:

Definition at line 1758 of file view.c.

References DNS_VIEW_VALID, dns_zt_freezezones(), REQUIRE, and dns_view::zonetable.

Referenced by ns_server_freeze().

void dns_view_setadbstats ( dns_view_t view,
isc_stats_t stats 
)

Set a adb statistics set 'stats' for 'view'.

Requires:

Definition at line 1767 of file view.c.

References dns_view::adbstats, DNS_VIEW_VALID, dns_view::frozen, isc_stats_attach(), and REQUIRE.

void dns_view_getadbstats ( dns_view_t view,
isc_stats_t **  statsp 
)

Get the adb statistics counter set for 'view'. If a statistics set is set '*statsp' will be attached to the set; otherwise, '*statsp' will be untouched.

Requires:

Definition at line 1776 of file view.c.

References dns_view::adbstats, DNS_VIEW_VALID, isc_stats_attach(), and REQUIRE.

void dns_view_setresstats ( dns_view_t view,
isc_stats_t stats 
)

Set a general resolver statistics counter set 'stats' for 'view'.

Requires:

Definition at line 1785 of file view.c.

References DNS_VIEW_VALID, dns_view::frozen, isc_stats_attach(), REQUIRE, and dns_view::resstats.

Referenced by configure_view().

void dns_view_getresstats ( dns_view_t view,
isc_stats_t **  statsp 
)

Get the general statistics counter set for 'view'. If a statistics set is set '*statsp' will be attached to the set; otherwise, '*statsp' will be untouched.

Requires:

Definition at line 1795 of file view.c.

References DNS_VIEW_VALID, isc_stats_attach(), REQUIRE, and dns_view::resstats.

Referenced by configure_view().

void dns_view_setresquerystats ( dns_view_t view,
dns_stats_t stats 
)

Set a statistics counter set of rdata type, 'stats', for 'view'. Once the statistic set is installed, view's resolver will count outgoing queries per rdata type.

Requires:

Definition at line 1804 of file view.c.

References dns_stats_attach(), DNS_VIEW_VALID, dns_view::frozen, REQUIRE, and dns_view::resquerystats.

Referenced by configure_view().

void dns_view_getresquerystats ( dns_view_t view,
dns_stats_t **  statsp 
)

Get the rdatatype statistics counter set for 'view'. If a statistics set is set '*statsp' will be attached to the set; otherwise, '*statsp' will be untouched.

Requires:

Definition at line 1813 of file view.c.

References dns_stats_attach(), DNS_VIEW_VALID, REQUIRE, and dns_view::resquerystats.

Referenced by configure_view().

isc_boolean_t dns_view_iscacheshared ( dns_view_t view  ) 

Check if the view shares the cache created by another view.

Requires:

Returns:

Definition at line 827 of file view.c.

References dns_view::cacheshared, DNS_VIEW_VALID, and REQUIRE.

Referenced by dumpdone(), ns_server_flushcache(), and ns_stats_dump().

isc_result_t dns_view_initntatable ( dns_view_t view,
isc_taskmgr_t taskmgr,
isc_timermgr_t timermgr 
)

Initialize the negative trust anchor table for the view.

Requires:

Returns:

Definition at line 1822 of file view.c.

References dns_ntatable_create(), dns_ntatable_detach(), DNS_VIEW_VALID, dns_view::ntatable_priv, and REQUIRE.

Referenced by configure_view_dnsseckeys().

isc_result_t dns_view_getntatable ( dns_view_t view,
dns_ntatable_t **  ntp 
)

Get the negative trust anchor table for this view. Returns ISC_R_NOTFOUND if the table not been initialized for the view.

'*ntp' is attached on success; the caller is responsible for detaching it with dns_ntatable_detach().

Requires:

Returns:

Definition at line 1833 of file view.c.

References dns_ntatable_attach(), DNS_VIEW_VALID, ISC_R_NOTFOUND, ISC_R_SUCCESS, dns_view::ntatable_priv, and REQUIRE.

Referenced by dns_view_loadnta(), dns_view_saventa(), ns_server_dumpsecroots(), and ns_server_nta().

isc_result_t dns_view_initsecroots ( dns_view_t view,
isc_mem_t mctx 
)

Initialize security roots for the view, detaching any previously existing security roots first. (Note that secroots_priv is NULL until this function is called, so any function using security roots must check that they have been initialized first. One way to do this is use dns_view_getsecroots() and check its return value.).

Requires:

Returns:

Definition at line 1843 of file view.c.

References dns_keytable_create(), dns_keytable_detach(), DNS_VIEW_VALID, REQUIRE, and dns_view::secroots_priv.

Referenced by configure_view_dnsseckeys(), and createview().

isc_result_t dns_view_getsecroots ( dns_view_t view,
dns_keytable_t **  ktp 
)

Get the security roots for this view. Returns ISC_R_NOTFOUND if the security roots keytable has not been initialized for the view.

'*ktp' is attached on success; the caller is responsible for detaching it with dns_keytable_detach().

Requires:

Returns:

Definition at line 1851 of file view.c.

References dns_keytable_attach(), DNS_VIEW_VALID, ISC_R_NOTFOUND, ISC_R_SUCCESS, REQUIRE, and dns_view::secroots_priv.

Referenced by dns_client_addtrustedkey(), dns_validator_create(), dns_view_untrust(), fail_secure(), keyfetch_done(), load_secroots(), load_view_keys(), ns_server_dumpsecroots(), sync_keyzone(), and trust_key().

isc_result_t dns_view_issecuredomain ( dns_view_t view,
dns_name_t name,
isc_stdtime_t  now,
isc_boolean_t  checknta,
isc_boolean_t secure_domain 
)

Is 'name' at or beneath a trusted key, and not covered by a valid negative trust anchor? Put answer in '*secure_domain'.

If 'checknta' is ISC_FALSE, ignore the NTA table in determining whether this is a secure domain.

Requires:

Returns:

Definition at line 1873 of file view.c.

References dns_fixedname_init, dns_fixedname_name, dns_keytable_issecuredomain(), dns_ntatable_covered(), DNS_VIEW_VALID, ISC_FALSE, ISC_R_NOTFOUND, ISC_R_SUCCESS, dns_view::ntatable_priv, REQUIRE, dns_view::secroots_priv, and secure().

Referenced by issecuredomain(), and wouldvalidate().

isc_boolean_t dns_view_ntacovers ( dns_view_t view,
isc_stdtime_t  now,
dns_name_t name,
dns_name_t anchor 
)

Is there a current negative trust anchor above 'name' and below 'anchor'?

Requires:

Returns:

Definition at line 1861 of file view.c.

References dns_ntatable_covered(), DNS_VIEW_VALID, ISC_FALSE, dns_view::ntatable_priv, and REQUIRE.

Referenced by finddlvsep().

void dns_view_untrust ( dns_view_t view,
dns_name_t keyname,
dns_rdata_dnskey_t *  dnskey,
isc_mem_t mctx 
)

Remove keys that match 'keyname' and 'dnskey' from the views trust anchors.

Requires:

Definition at line 1904 of file view.c.

References buffer, dns_dnssec_keyfromrdata(), DNS_KEYFLAG_REVOKE, dns_keytable_deletekeynode(), dns_keytable_detach(), dns_rdata_fromstruct(), DNS_RDATA_INIT, dns_view_getsecroots(), dst_key_free(), isc_buffer_init, ISC_R_SUCCESS, key, and dns_rdata::rdclass.

Referenced by isselfsigned(), and keyfetch_done().

void dns_view_setnewzones ( dns_view_t view,
isc_boolean_t  allow,
void *  cfgctx,
void(*)(void **)  cfg_destroy 
)

Set whether or not to allow zones to be created or deleted at runtime.

If 'allow' is ISC_TRUE, determines the filename into which new zone configuration will be written. Preserves the configuration context (a pointer to which is passed in 'cfgctx') for use when parsing new zone configuration. 'cfg_destroy' points to a callback routine to destroy the configuration context when the view is destroyed. (This roundabout method is used in order to avoid libdns having a dependency on libisccfg and libbind9.)

If 'allow' is ISC_FALSE, removes any existing references to configuration context and frees any memory.

Requires:

Definition at line 1936 of file view.c.

References buffer, dns_view::cfg_destroy, DNS_VIEW_VALID, isc_file_sanitize(), isc_mem_free, isc_mem_strdup, ISC_R_SUCCESS, dns_view::mctx, dns_view::name, dns_view::new_zone_config, dns_view::new_zone_file, and REQUIRE.

Referenced by destroy(), and setup_newzones().

void dns_view_restorekeyring ( dns_view_t view  ) 

Definition at line 870 of file view.c.

References dns_keyring_restore(), DNS_VIEW_VALID, dns_view::dynamickeys, keyfile, dns_view::name, and REQUIRE.

Referenced by configure_view().

isc_result_t dns_view_searchdlz ( dns_view_t view,
dns_name_t name,
unsigned int  minlabels,
dns_clientinfomethods_t methods,
dns_clientinfo_t clientinfo,
dns_db_t **  dbp 
)

Search through the DLZ database(s) in view->dlz_searched to find one that can answer a query for 'name', using the DLZ driver's findzone method. If successful, '*dbp' is set to point to the DLZ database.

Returns:

Requires:

Definition at line 1968 of file view.c.

References dns_dlzdb::dbdata, dns_view::dlz_searched, dns_db_attach(), dns_db_detach(), DNS_DLZ_VALID, dns_fixedname_init, dns_fixedname_name, dns_name_copy(), dns_name_countlabels(), dns_name_split(), DNS_VIEW_VALID, dns_dlzimplementation::driverarg, dns_dlzmethods::findzone, dns_dlzdb::implementation, INSIST, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_NOTFOUND, ISC_R_SUCCESS, dns_dlzdb::mctx, dns_dlzimplementation::methods, dns_view::rdclass, and REQUIRE.

Referenced by query_getdb().

isc_uint32_t dns_view_getfailttl ( dns_view_t view  ) 

Get the view's servfail-ttl. zero => no servfail caching.

Requires:

Definition at line 2056 of file view.c.

References DNS_VIEW_VALID, dns_view::fail_ttl, and REQUIRE.

void dns_view_setfailttl ( dns_view_t view,
isc_uint32_t  failttl 
)

Set the view's servfail-ttl. zero => no servfail caching.

Requires:

Definition at line 2062 of file view.c.

References DNS_VIEW_VALID, dns_view::fail_ttl, and REQUIRE.

Referenced by configure_view().

isc_result_t dns_view_saventa ( dns_view_t view  ) 

Save NTA for names in this view to a file.

Requires:

Definition at line 2068 of file view.c.

References CHECK, cleanup(), dns_ntatable_detach(), dns_ntatable_save(), dns_view_getntatable(), DNS_VIEW_VALID, ISC_FALSE, isc_file_remove(), ISC_R_NOTFOUND, ISC_R_SUCCESS, isc_stdio_close(), isc_stdio_open(), ISC_TRUE, dns_view::nta_file, dns_view::nta_lifetime, removefile, and REQUIRE.

Referenced by ns_server_nta(), and ns_server_saventa().

isc_result_t dns_view_loadnta ( dns_view_t view  ) 

Loads NTA for names in this view from a file.

Requires:

Definition at line 2114 of file view.c.

References CHECK, cleanup(), dns_fixedname_init, dns_fixedname_name, dns_name_fromtext(), dns_ntatable_add(), dns_ntatable_detach(), dns_rootname, dns_time32_fromtext(), dns_view_getntatable(), DNS_VIEW_VALID, isc_buffer_add, isc_buffer_init, ISC_FALSE, isc_lex_close(), isc_lex_create(), isc_lex_destroy(), isc_lex_gettoken(), isc_lex_openfile(), ISC_LEXOPT_EOF, ISC_LEXOPT_EOL, ISC_R_SUCCESS, ISC_R_UNEXPECTEDTOKEN, isc_stdtime_get(), isc_tokentype_eof, isc_tokentype_eol, isc_tokentype_string, ISC_TRUE, dns_view::mctx, name, now, dns_view::nta_file, dns_view::nta_lifetime, REQUIRE, TLEN, token, TSTR, and isc_token::type.

Referenced by ns_server_loadnta().


Generated on Tue Apr 28 17:41:10 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha