server.c revision bd77de5fcaea4dcf2f0250ded32adfccd3a38256
523230336909d30111cb060b7eb6fc39d23ad174Tinderbox User * Copyright (C) 1999, 2000 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Permission to use, copy, modify, and distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * purpose with or without fee is hereby granted, provided that the above
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * copyright notice and this permission notice appear in all copies.
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
6b7257f756eb0530cdf54df9a7fab8d51a5001c3David Lawrence * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence/* $Id: server.c,v 1.208 2000/08/02 18:13:06 bwelling Exp $ */
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington * Check an operation for failure. Assumes that the function
b6b9d8b8434e4eaab74b69cd14fcacf448055ca5Brian Wellington * using it has a 'result' variable and a 'cleanup' label.
b6b9d8b8434e4eaab74b69cd14fcacf448055ca5Brian Wellington if (result != ISC_R_SUCCESS) goto cleanup; \
2ba574f329c14376d26d7c0f22c89d7a978a2625Mark Andrews } while (0) \
b6b9d8b8434e4eaab74b69cd14fcacf448055ca5Brian Wellington } while (0) \
debd489a44363870f96f75818e89ec27d3cab736Francis Duponttypedef struct {
d96f74a3cb6212ac9e4a7a0fa8924f850348eae9Mark Andrewsns_server_reload(isc_task_t *task, isc_event_t *event);
fc39b6a96109b78154ec148d20eaf29e8abc14b6Mukund Sivaramanns_listenelt_fromconfig(dns_c_lstnon_t *celt, dns_c_ctx_t *cctx,
d6a0e00dc3e047f8470b938878926957070def77Mark Andrewsns_listenlist_fromconfig(dns_c_lstnlist_t *clist, dns_c_ctx_t *cctx,
60213f2815a7e6584a2285546d05633fa7b6f5b4Mark Andrews * Configure a single view ACL at '*aclp'. Get its configuration by
c30d291128e099a284fa6272b91b2bd64519a209Mark Andrews * calling 'getvcacl' (for per-view configuration) and maybe 'getscacl'
6150d3cb666a58d5e3a15275562c9fc5c5b6b2d8Evan Hunt * (for a global default).
323bb31d7c54078aa62146b3aa946b755cbfd52bMark Andrews * No value available. *aclp == NULL.
629a0159401a6c0d991a78a6d0b90ee84e83668cEvan Hunt result = dns_acl_fromconfig(cacl, cctx, actx, mctx, aclp);
d96f74a3cb6212ac9e4a7a0fa8924f850348eae9Mark Andrews * Convert a null-terminated string of base64 text into binary,
d96f74a3cb6212ac9e4a7a0fa8924f850348eae9Mark Andrews * storing it in a buffer. 'mctx' is only used internally.
d96f74a3cb6212ac9e4a7a0fa8924f850348eae9Mark Andrewsbase64_cstring_tobuffer(isc_mem_t *mctx, char *cstr, isc_buffer_t *target) {
9bd876a683709be588f6fac6781a76fdd57b2f08Mark Andrews * Configure DNSSEC keys for a view. Currently used only for
9bd876a683709be588f6fac6781a76fdd57b2f08Mark Andrews * the security roots.
d96f74a3cb6212ac9e4a7a0fa8924f850348eae9Mark Andrews * The per-view configuration values and their server-global
fdcfc6bae754ee8f0b43dfd872284a294a8f2fd2Mark Andrews * defaults are are read from 'cview' and 'cctx' using
fdcfc6bae754ee8f0b43dfd872284a294a8f2fd2Mark Andrews * the function 'cgetv' and 'cgets', respectively.
d96f74a3cb6212ac9e4a7a0fa8924f850348eae9Mark Andrews * The variable to be configured is '*target'.
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington keystruct.common.rdtype = dns_rdatatype_key;
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington * The key data in keystruct is not
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington * dynamically allocated.
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington isc_buffer_init(&keydatabuf, keydata, sizeof(keydata));
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington isc_buffer_init(&rrdatabuf, rrdata, sizeof(rrdata));
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington CHECK(base64_cstring_tobuffer(mctx, ckey->pubkey->key,
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews isc_buffer_add(&namebuf, strlen(ckey->domain));
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington CHECK(dst_key_fromdns(keyname, &rrdatabuf, mctx,
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington *target = keytable; /* Transfer ownership. */
e7c0d42b11358f08e04316d31c67c23261dcdf36Evan Hunt * Get a dispatch appropriate for the resolver of a given view.
e4cd5a1e5d0358abeee7618b02b4592c055d957fBrian Wellingtonget_view_querysource_dispatch(dns_c_ctx_t *cctx, dns_c_view_t *cview,
9e804040a29b9c3066c8471b43835f30707039b7Evan Hunt * Make compiler happy.
f07fe5a1ac9d1345eb7a36a0bc38716a03e25f61Mark Andrews result = dns_c_view_getquerysource(cview, &sa);
72ddc4cef9c6a6de53aae530dea1ddbb90631131Mark Andrews result = dns_c_view_getquerysourcev6(cview, &sa);
72ddc4cef9c6a6de53aae530dea1ddbb90631131Mark Andrews result = dns_c_ctx_getquerysourcev6(cctx, &sa);
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews * If we don't support this address family, we're done!
72ddc4cef9c6a6de53aae530dea1ddbb90631131Mark Andrews * Try to find a dispatcher that we can share.
72ddc4cef9c6a6de53aae530dea1ddbb90631131Mark Andrews result = dns_dispatch_getudp(ns_g_dispatchmgr, ns_g_socketmgr,
e32d354f754a5d7847a0862bcd6302827ea225bfEvan Hunt "could not get query source dispatcher");
72ddc4cef9c6a6de53aae530dea1ddbb90631131Mark Andrews * Configure 'view' according to 'cview', taking defaults from 'cctx'
72ddc4cef9c6a6de53aae530dea1ddbb90631131Mark Andrews * where values are missing in cctx.
72ddc4cef9c6a6de53aae530dea1ddbb90631131Mark Andrews * When configuring the default view, cctx will be NULL and the
72ddc4cef9c6a6de53aae530dea1ddbb90631131Mark Andrews * glboal defaults in cview used exclusively.
72ddc4cef9c6a6de53aae530dea1ddbb90631131Mark Andrewsconfigure_view(dns_view_t *view, dns_c_ctx_t *cctx, dns_c_view_t *cview,
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington dns_view_t *pview = NULL; /* Production view */
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington unsigned int i;
420e5e1022ff5ca4697ed5286462eeaf03614e53Brian Wellington RWLOCK(&view->conflock, isc_rwlocktype_write);
bcdf37e0ff7d73310b7bf247d755194a5718ba38Mark Andrews * Set the view's port number for outgoing queries.
b6b9d8b8434e4eaab74b69cd14fcacf448055ca5Brian Wellington * Configure the view's cache. Try to reuse an existing
b6b9d8b8434e4eaab74b69cd14fcacf448055ca5Brian Wellington * cache if possible, otherwise create a new cache.
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington * Note that the ADB is not preserved in either case.
72ddc4cef9c6a6de53aae530dea1ddbb90631131Mark Andrews * XXX Determining when it is safe to reuse a cache is
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington * tricky. When the view's configuration changes, the cached
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington * data may become invalid because it reflects our old
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington * view of the world. As more view attributes become
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington * configurable, we will have to add code here to check
72ddc4cef9c6a6de53aae530dea1ddbb90631131Mark Andrews * whether they have changed in ways that could
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington * invalidate the cache.
e32d354f754a5d7847a0862bcd6302827ea225bfEvan Hunt result = dns_viewlist_find(&ns_g_server->viewlist,
e32d354f754a5d7847a0862bcd6302827ea225bfEvan Hunt if (result != ISC_R_NOTFOUND && result != ISC_R_SUCCESS)
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews CHECK(dns_cache_create(cmctx, ns_g_taskmgr, ns_g_timermgr,
71ca6e64b4d208a090d255eb64c24f945e615ea0Brian Wellington result = dns_c_view_getcleaninterval(cview,
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington result = dns_c_ctx_getcleaninterval(cctx, &cleaning_interval);
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington cleaning_interval = 3600; /* Default is 1 hour. */
b6b9d8b8434e4eaab74b69cd14fcacf448055ca5Brian Wellington dns_cache_setcleaninginterval(cache, cleaning_interval);
b6b9d8b8434e4eaab74b69cd14fcacf448055ca5Brian Wellington * XXXRTH Temporary support for loading cache contents.
73a691c373488e4f70387a62462cd8ce0d991705David Lawrence isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
4423c99613db1399dbb5c51e86ef0d351a1418c2Mark Andrews CHECK(dns_db_load(view->cachedb, ns_g_cachefile));
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews * XXXRTH Hardwired number of tasks.
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews CHECK(get_view_querysource_dispatch(cctx, cview, AF_INET,
240e53b13217af266abb3dae8ba103614daf2bf7Mark Andrews CHECK(get_view_querysource_dispatch(cctx, cview, AF_INET6,
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews CHECK(dns_view_createresolver(view, ns_g_taskmgr, 31,
b6b9d8b8434e4eaab74b69cd14fcacf448055ca5Brian Wellington * Set resolver forwarding policy.
bcdf37e0ff7d73310b7bf247d755194a5718ba38Mark Andrews dns_c_view_getforwarders(cview, &forwarders) == ISC_R_SUCCESS) ||
b6b9d8b8434e4eaab74b69cd14fcacf448055ca5Brian Wellington (dns_c_ctx_getforwarders(cctx, &forwarders) == ISC_R_SUCCESS))
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews * Ugh. Convert between list formats.
45e1bd63587102c3bb361eaca42ee7b714fb3542Mark Andrews CHECK(dns_resolver_setforwarders(view->resolver, &addresses));
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews * XXXRTH The configuration type 'dns_c_forw_t' should be
4eb998928b9aef0ceda42d7529980d658138698aEvan Hunt * eliminated.
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews dns_c_view_getforward(cview, &forward) == ISC_R_SUCCESS)
45e1bd63587102c3bb361eaca42ee7b714fb3542Mark Andrews || dns_c_ctx_getforward(cctx, &forward) == ISC_R_SUCCESS) {
17a00ff54c51f6bdfddd7d9ceaef6f2dcf387cc1Mark Andrews CHECK(dns_resolver_setfwdpolicy(view->resolver, fwdpolicy));
73a691c373488e4f70387a62462cd8ce0d991705David Lawrence * We have default hints for class IN if we need them.
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews if (view->rdclass == dns_rdataclass_in && view->hints == NULL)
4144efb39046963989ad002cf88a0c195401100aJeremy Reed dns_view_sethints(view, ns_g_server->in_roothints);
4144efb39046963989ad002cf88a0c195401100aJeremy Reed * If we still have no hints, this is a non-IN view with no
73a691c373488e4f70387a62462cd8ce0d991705David Lawrence * "hints zone" configured. That's an error.
73a691c373488e4f70387a62462cd8ce0d991705David Lawrence isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
73a691c373488e4f70387a62462cd8ce0d991705David Lawrence "no root hints for view '%s'",
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews * Configure the view's TSIG keys.
0a77211c806fa84fd66638b5cccf550c7cd7760dAndreas Gustafsson CHECK(dns_tsigkeyring_fromconfig(cview, cctx, view->mctx, &ring));
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews * Configure the view's peer list.
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews result = dns_c_view_getpeerlist(cview, &newpeers);
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews result = dns_c_ctx_getpeerlist(cctx, &newpeers);
1d16cf8bb8596c3e4dc1123a5bdf360bf24a272bAutomatic Updater result = dns_peerlist_new(mctx, &newpeers);
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews view->peers = newpeers; /* Transfer ownership. */
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews * Configure the "match-clients" ACL.
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews CHECK(configure_view_acl(cview, cctx, actx, ns_g_mctx,
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews * Configure other configurable data.
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews (void)dns_c_ctx_getrecursion(cctx, &view->recursion);
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews (void)dns_c_view_getrecursion(cview, &view->recursion);
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews view->auth_nxdomain = ISC_FALSE; /* Was true in BIND 8 */
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews (void)dns_c_ctx_getauthnxdomain(cctx, &view->auth_nxdomain);
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews (void)dns_c_view_getauthnxdomain(cview, &view->auth_nxdomain);
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews * Set sources where additional data, CNAMEs, and DNAMEs may be found.
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews result = dns_c_view_getadditionalfromauth(cview,
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews result = dns_c_view_getadditionalfromcache(cview,
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews result = dns_c_ctx_getadditionalfromcache(cctx,
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews CHECK(configure_view_acl(cview, cctx, actx, ns_g_mctx,
4eb998928b9aef0ceda42d7529980d658138698aEvan Hunt CHECK(configure_view_acl(cview, cctx, actx, ns_g_mctx,
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews result = dns_c_view_getrequestixfr(cview, &view->requestixfr);
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews result = dns_c_ctx_getrequestixfr(cctx, &view->requestixfr);
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews result = dns_c_view_getprovideixfr(cview, &view->provideixfr);
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews result = dns_c_ctx_getprovideixfr(cctx, &view->provideixfr);
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews * For now, there is only one kind of trusted keys, the
1f1d36a87b65186d9f89aac7f456ab1fd2a39ef6Andreas Gustafsson * "security roots".
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews CHECK(configure_view_dnsseckeys(cview, cctx, mctx,
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews result = dns_c_view_getmaxcachettl(cview, &val);
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews result = dns_c_view_getmaxncachettl(cview, &val);
45e1bd63587102c3bb361eaca42ee7b714fb3542Mark Andrews result = dns_c_ctx_getmaxncachettl(cctx, &val);
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews RWUNLOCK(&view->conflock, isc_rwlocktype_write);
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews * Create the special view that handles queries under "bind. CH".
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews CHECK(dns_view_create(ns_g_mctx, dns_rdataclass_ch, "_bind", &view));
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews /* Transfer ownership. */
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews * Create the zone that handles queries for
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews * "version.bind. CH". The version string returned is that
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews * configured in 'cctx', or a compiled-in default if
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews * there is no "version" configuration option.
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrewscreate_version_zone(dns_c_ctx_t *cctx, dns_zonemgr_t *zmgr, dns_view_t *view)
73a691c373488e4f70387a62462cd8ce0d991705David Lawrence static unsigned char origindata[] = "\007version\004bind";
8f66dad9393ae0724f758c4a51e06ff55c2d1219Brian Wellington result = dns_c_ctx_getversion(cctx, &versiontext);
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews * Removing the const qualifier from ns_g_version is ok
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews * because the resulting string is not modified, only
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington * copied into a new buffer.
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews dns_rdata_fromregion(&rdata, dns_rdataclass_ch, dns_rdatatype_txt, &r);
1f1d36a87b65186d9f89aac7f456ab1fd2a39ef6Andreas Gustafsson dns_zone_setclass(zone, dns_rdataclass_ch);
9e804040a29b9c3066c8471b43835f30707039b7Evan Hunt CHECK(dns_db_create(ns_g_mctx, "rbt", &origin, dns_dbtype_zone,
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews CHECK(dns_difftuple_create(ns_g_mctx, DNS_DIFFOP_ADD, &origin,
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews CHECK(dns_zone_replacedb(zone, db, ISC_FALSE));
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * Create the special view that handles queries for
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * "authors.bind. CH". The strings returned list
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington * the authors of bind.
73a691c373488e4f70387a62462cd8ce0d991705David Lawrencecreate_authors_zone(dns_zonemgr_t *zmgr, dns_view_t *view) {
9e804040a29b9c3066c8471b43835f30707039b7Evan Hunt static unsigned char origindata[] = "\007authors\004bind";
3db78e0855a8dfc162180880cd70d9c1a03d9301David Lawrence static const unsigned char *authors[] =
94b50bce2b5deeac93734457d5474736d7b76af1Michael Sawyer "\014Mark Andrews",
30a4d5b0c23eb7a73d9635a98250560437a42d59David Lawrence "\015James Brister",
30a4d5b0c23eb7a73d9635a98250560437a42d59David Lawrence "\015Michael Graff",
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews "\022Andreas Gustafsson",
3734f3f1bad4160cdd7563bc4801bca7e82f8abdDavid Lawrence "\012Bob Halley",
3734f3f1bad4160cdd7563bc4801bca7e82f8abdDavid Lawrence "\016David Lawrence",
3734f3f1bad4160cdd7563bc4801bca7e82f8abdDavid Lawrence "\016Michael Sawyer",
1d16cf8bb8596c3e4dc1123a5bdf360bf24a272bAutomatic Updater "\020Brian Wellington",
1d16cf8bb8596c3e4dc1123a5bdf360bf24a272bAutomatic Updater dns_zone_setclass(zone, dns_rdataclass_ch);
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence CHECK(dns_db_create(ns_g_mctx, "rbt", &origin, dns_dbtype_zone,
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence CHECK(dns_difftuple_create(ns_g_mctx, DNS_DIFFOP_ADD, &origin,
8f66dad9393ae0724f758c4a51e06ff55c2d1219Brian Wellington CHECK(dns_zone_replacedb(zone, db, ISC_FALSE));
984ca288f1291c7b7bda9b3809a7af714e3ec82aAndreas Gustafsson dns_db_closeversion(db, &dbver, ISC_FALSE);
984ca288f1291c7b7bda9b3809a7af714e3ec82aAndreas Gustafssonconfigure_hints(dns_view_t *view, const char *filename) {
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan Hunt result = dns_rootns_create(view->mctx, view->rdclass, filename, &db);
984ca288f1291c7b7bda9b3809a7af714e3ec82aAndreas Gustafsson * Find an existing view matching the name and class of 'cview'
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * in 'viewlist', or create a new one and add it to the list.
984ca288f1291c7b7bda9b3809a7af714e3ec82aAndreas Gustafsson * If 'cview' is NULL, find or create the default view.
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * The view found or created is attached to '*viewp'.
e4cd5a1e5d0358abeee7618b02b4592c055d957fBrian Wellingtonfind_or_create_view(dns_c_view_t *cview, dns_viewlist_t *viewlist,
1f1d36a87b65186d9f89aac7f456ab1fd2a39ef6Andreas Gustafsson result = dns_c_view_getviewclass(cview, &viewclass);
71ca6e64b4d208a090d255eb64c24f945e615ea0Brian Wellington result = dns_viewlist_find(viewlist, viewname,
d32b13e0be7f01020365c83a0bd36483ace4d7c3Mark Andrews result = dns_view_create(ns_g_mctx, viewclass, viewname, &view);
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington * Configure or reconfigure a zone. This callback function
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * is called after parsing each "zone" statement in named.conf.
void *uap)
char *corigin;
goto cleanup;
corigin);
goto cleanup;
corigin);
goto cleanup;
corigin);
goto cleanup;
corigin);
goto cleanup;
goto cleanup;
&pview);
goto cleanup;
goto cleanup;
return (result);
static isc_result_t
return (result);
return (ISC_R_SUCCESS);
static isc_result_t
char *pidfilename;
filename);
&callbacks));
if (ns_g_port != 0) {
cctx,
&listenon);
cctx,
&listenon);
if (interface_interval == 0) {
&aclconfctx));
goto cleanup;
if (first_time)
* files specified in named.conf get created by the
if (ns_g_logstderr) {
return (result);
static isc_result_t
return (result);
sizeof(isc_event_t));
static isc_result_t
return (result);
goto cleanup;
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
return (result);
return (result);
return (ISC_R_SUCCESS);