• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/bind9-45.101/bind9/bin/named/

Lines Matching +refs:log +refs:view +refs:mode

85 #include <dns/view.h>
96 #include <named/log.h>
185 struct viewlistentry *view;
195 dns_view_t *view;
206 * Configuration context to retain for each view that allows
286 configure_forward(const cfg_obj_t *config, dns_view_t *view, dns_name_t *origin,
290 configure_alternates(const cfg_obj_t *config, dns_view_t *view,
295 const cfg_obj_t *vconfig, isc_mem_t *mctx, dns_view_t *view,
299 add_keydata_zone(dns_view_t *view, const char *directory, isc_mem_t *mctx);
308 * Configure a single view ACL at '*aclp'. Get its configuration from
309 * 'vconfig' (for per-view configuration) and maybe from 'config'
603 dns_view_t *view, isc_boolean_t managed,
612 CHECK(dns_view_getsecroots(view, &secroots));
657 * Configure DNSSEC keys for a view.
659 * The per-view configuration values and the server-global defaults are read
663 configure_view_dnsseckeys(dns_view_t *view, const cfg_obj_t *vconfig,
680 /* We don't need trust anchors for the _bind view */
681 if (strcmp(view->name, "_bind") == 0 &&
682 view->rdclass == dns_rdataclass_chaos) {
709 result = dns_view_initsecroots(view, mctx);
717 if (auto_dlv && view->rdclass == dns_rdataclass_in) {
723 "using built-in DLV key for view %s",
724 view->name);
743 CHECK(load_view_keys(builtin_keys, vconfig, view,
744 ISC_FALSE, view->dlv, mctx));
747 view, ISC_TRUE, view->dlv, mctx));
750 if (auto_root && view->rdclass == dns_rdataclass_in) {
756 "using built-in root key for view %s",
757 view->name);
776 CHECK(load_view_keys(builtin_keys, vconfig, view,
780 view, ISC_TRUE, dns_rootname,
784 CHECK(load_view_keys(view_keys, vconfig, view, ISC_FALSE,
786 CHECK(load_view_keys(view_managed_keys, vconfig, view, ISC_TRUE,
789 if (view->rdclass == dns_rdataclass_in) {
790 CHECK(load_view_keys(global_keys, vconfig, view, ISC_FALSE,
792 CHECK(load_view_keys(global_managed_keys, vconfig, view,
802 CHECK(add_keydata_zone(view, directory, ns_g_mctx));
841 * Get a dispatch appropriate for the resolver of a given view.
958 unsigned int mode = 0;
992 mode = DNS_RDATASETATTR_FIXEDORDER;
994 mode = DNS_RDATASETATTR_RANDOMIZE;
996 mode = 0;
1007 rdtype, rdclass, mode);
1013 rdtype, rdclass, mode));
1294 cache_reusable(dns_view_t *originview, dns_view_t *view,
1297 if (originview->checknames != view->checknames ||
1300 originview->acceptexpired != view->acceptexpired ||
1301 originview->enablevalidation != view->enablevalidation ||
1302 originview->maxcachettl != view->maxcachettl ||
1303 originview->maxncachettl != view->maxncachettl) {
1311 cache_sharable(dns_view_t *originview, dns_view_t *view,
1317 * If the cache cannot even reused for the same view, it cannot be
1320 if (!cache_reusable(originview, view, new_zero_no_soattl))
1340 dlzconfigure_callback(dns_view_t *view, dns_zone_t *zone) {
1342 dns_rdataclass_t zclass = view->rdclass;
1350 return ns_zone_configure_writeable_dlz(view->dlzdatabase,
1355 dns64_reverse(dns_view_t *view, isc_mem_t *mctx, isc_netaddr_t *na,
1362 const char *sep = ": view ";
1363 const char *viewname = view->name;
1407 dns_zone_setview(zone, view);
1409 dns_zone_setclass(zone, view->rdclass);
1413 if (view->queryacl != NULL)
1414 dns_zone_setqueryacl(zone, view->queryacl);
1415 if (view->queryonacl != NULL)
1416 dns_zone_setqueryonacl(zone, view->queryonacl);
1421 CHECK(dns_view_addzone(view, zone));
1433 configure_rpz(dns_view_t *view, const cfg_listelt_t *element) {
1443 new = isc_mem_get(view->mctx, sizeof(*new));
1453 ISC_LIST_INITANDAPPEND(view->rpz_zones, new, link);
1476 origin, DNS_NAME_DOWNCASE, view->mctx);
1494 result = dns_view_findzone(view, &new->origin, &zone);
1511 for (old = ISC_LIST_HEAD(view->rpz_zones);
1525 result = dns_name_fromstring(&new->cname, str, 0, view->mctx);
1536 dns_rpz_view_destroy(view);
1541 * Configure 'view' according to 'vconfig', taking defaults from 'config'
1544 * When configuring the default view, 'vconfig' will be NULL and the
1548 configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
1577 dns_view_t *pview = NULL; /* Production view */
1591 const char *sep = ": view ";
1592 const char *viewname = view->name;
1593 const char *forview = " for view ";
1607 REQUIRE(DNS_VIEW_VALID(view));
1613 * maps: view options, options, defaults
1614 * cfgmaps: view options, config
1615 * optionmaps: view options, options
1643 * Set the view's port number for outgoing queries.
1646 dns_view_setdstport(view, port);
1649 * Create additional cache for this view and zones under the view
1658 CHECK(dns_acache_create(&view->acache, cmctx, ns_g_taskmgr,
1663 if (view->acache != NULL) {
1667 dns_acache_setcleaninginterval(view->acache,
1692 dns_acache_setcachesize(view->acache, max_acache_size);
1696 ns_g_mctx, &view->queryacl));
1697 if (view->queryacl == NULL) {
1700 &view->queryacl));
1720 CHECK(configure_zone(config, zconfig, vconfig, mctx, view,
1729 nzctx = view->new_zone_config;
1733 "loading additional zones for view '%s'",
1734 view->name);
1745 mctx, view, actx,
1779 &view->dlzdatabase);
1789 result = dns_dlzconfigure(view, dlzconfigure_callback);
1834 view->checknames = ISC_TRUE;
1837 view->checknames = ISC_FALSE;
1839 view->checknames = ISC_FALSE;
1850 if (result == ISC_R_SUCCESS && strcmp(view->name, "_bind") &&
1851 strcmp(view->name, "_meta")) {
1936 dns_dns64_append(&view->dns64, dns64);
1937 view->dns64cnt++;
1938 result = dns64_reverse(view, mctx, &na, prefixlen,
1954 view->acceptexpired = cfg_obj_asboolean(obj);
1960 view->enablevalidation = cfg_obj_asboolean(obj);
1963 view->enablevalidation = ISC_TRUE;
1970 view->maxcachettl = cfg_obj_asuint32(obj);
1975 view->maxncachettl = cfg_obj_asuint32(obj);
1976 if (view->maxncachettl > 7 * 24 * 3600)
1977 view->maxncachettl = 7 * 24 * 3600;
1980 * Configure the view's cache.
1983 * attempt to lookup an existing cache at attach it to the view. If
1989 * When a matching view is found, the associated statistics are also
1993 * When the view's configuration changes, the cached data may become
1994 * invalid because it reflects our old view of the world. We check
1997 * options that should be checked. For example, if a view uses a
2007 cachename = view->name;
2011 if (!cache_sharable(nsc->primaryview, view, zero_no_soattl,
2017 nsc->primaryview->name, view->name);
2024 if (strcmp(cachename, view->name) == 0) {
2026 cachename, view->rdclass,
2031 if (!cache_reusable(pview, view,
2038 "for view %s due to "
2040 "mismatch", view->name);
2060 * equals the view name, but may also be a forward
2061 * reference to a view that share the cache with this
2062 * view but is not yet configured. If it is not the
2063 * view name but not a forward reference either, then it
2075 ns_g_timermgr, view->rdclass,
2088 nsc->primaryview = view;
2094 dns_view_setcache2(view, cache, shared_cache);
2102 if (result == ISC_R_SUCCESS && strcmp(view->name, "_bind") != 0) {
2119 ISC_TF(ISC_LIST_PREV(view, link)
2122 ISC_TF(ISC_LIST_PREV(view, link)
2131 CHECK(dns_view_createresolver(view, ns_g_taskmgr, 31,
2140 dns_view_setresstats(view, resstats);
2143 dns_view_setresquerystats(view, resquerystats);
2154 if (view != nsc->primaryview &&
2164 dns_adb_setadbsize(view->adb, max_adb_size);
2175 dns_resolver_setlamettl(view->resolver, lame_ttl);
2184 dns_resolver_settimeout(view->resolver, query_timeout);
2187 dns_resolver_setzeronosoattl(view->resolver, zero_no_soattl);
2200 dns_resolver_setudpsize(view->resolver, (isc_uint16_t)udpsize);
2213 view->maxudp = udpsize;
2218 dns_resolver_reset_algorithms(view->resolver);
2226 view->resolver));
2230 * A global or view "forwarders" option, if present,
2238 CHECK(configure_forward(config, view, dns_rootname,
2247 CHECK(configure_alternates(config, view, alternates));
2252 if (view->rdclass == dns_rdataclass_in && view->hints == NULL)
2253 dns_view_sethints(view, ns_g_server->in_roothints);
2256 * If we still have no hints, this is a non-IN view with no
2262 if (view->hints == NULL) {
2264 (void)dns_view_findzone(view, dns_rootname, &rootzone);
2272 "no root hints for view '%s'",
2273 view->name);
2277 * Configure the view's TSIG keys.
2279 CHECK(ns_tsigkeyring_fromconfig(config, vconfig, view->mctx, &ring));
2284 dns_view_setkeyring(view, ring);
2290 result = dns_viewlist_find(&ns_g_server->viewlist, view->name,
2291 view->rdclass, &pview);
2297 dns_view_setdynamickeyring(view, ring);
2301 dns_view_restorekeyring(view);
2304 * Configure the view's peer list.
2324 dns_peerlist_detach(&view->peers);
2325 view->peers = newpeers; /* Transfer ownership. */
2345 if (view->order != NULL)
2346 dns_order_detach(&view->order);
2347 dns_order_attach(order, &view->order);
2353 dns_aclenv_copy(&view->aclenv, &ns_g_server->aclenv);
2359 ns_g_mctx, &view->matchclients));
2361 actx, ns_g_mctx, &view->matchdestinations));
2369 view->matchrecursiveonly = ISC_TRUE;
2371 view->matchrecursiveonly = ISC_FALSE;
2379 view->recursion = cfg_obj_asboolean(obj);
2384 view->auth_nxdomain = cfg_obj_asboolean(obj);
2389 view->minimalresponses = cfg_obj_asboolean(obj);
2396 view->transfer_format = dns_many_answers;
2398 view->transfer_format = dns_one_answer;
2409 view->additionalfromauth = cfg_obj_asboolean(obj);
2410 if (view->recursion && ! view->additionalfromauth) {
2414 view->additionalfromauth = ISC_TRUE;
2420 view->additionalfromcache = cfg_obj_asboolean(obj);
2421 if (view->recursion && ! view->additionalfromcache) {
2425 view->additionalfromcache = ISC_TRUE;
2434 actx, ns_g_mctx, &view->cacheacl));
2436 actx, ns_g_mctx, &view->cacheonacl));
2437 if (view->cacheonacl == NULL)
2440 ns_g_mctx, &view->cacheonacl));
2441 if (strcmp(view->name, "_bind") != 0) {
2444 &view->recursionacl));
2447 &view->recursiononacl));
2456 if (view->cacheacl == NULL && view->recursionacl != NULL)
2457 dns_acl_attach(view->recursionacl, &view->cacheacl);
2462 * dns_acl_attach(view->queryacl, &view->cacheacl).
2464 if (view->cacheacl == NULL && view->recursion)
2466 actx, ns_g_mctx, &view->cacheacl));
2467 if (view->recursion &&
2468 view->recursionacl == NULL && view->cacheacl != NULL)
2469 dns_acl_attach(view->cacheacl, &view->recursionacl);
2475 if (view->recursionacl == NULL && view->recursion)
2479 &view->recursionacl));
2480 if (view->recursiononacl == NULL && view->recursion)
2484 &view->recursiononacl));
2485 if (view->cacheacl == NULL) {
2486 if (view->recursion)
2490 &view->cacheacl));
2492 CHECK(dns_acl_none(mctx, &view->cacheacl));
2499 "acl", actx, ns_g_mctx, &view->denyansweracl));
2502 &view->answeracl_exclude));
2509 &view->denyanswernames));
2512 &view->answernames_exclude));
2518 &view->sortlist));
2525 if (view->notifyacl == NULL)
2528 ns_g_mctx, &view->notifyacl));
2529 if (view->transferacl == NULL)
2532 ns_g_mctx, &view->transferacl));
2533 if (view->updateacl == NULL)
2536 ns_g_mctx, &view->updateacl));
2537 if (view->upfwdacl == NULL)
2540 ns_g_mctx, &view->upfwdacl));
2545 view->requestixfr = cfg_obj_asboolean(obj);
2550 view->provideixfr = cfg_obj_asboolean(obj);
2555 view->requestnsid = cfg_obj_asboolean(obj);
2565 dns_resolver_setclientsperquery(view->resolver,
2575 view->v4_aaaa = dns_v4_aaaa_filter;
2577 view->v4_aaaa = dns_v4_aaaa_ok;
2581 view->v4_aaaa = dns_v4_aaaa_break_dnssec;
2586 actx, ns_g_mctx, &view->v4_aaaa_acl));
2592 view->enablednssec = cfg_obj_asboolean(obj);
2629 dlv = dns_fixedname_name(&view->dlv_fixed);
2632 view->dlv = dns_fixedname_name(&view->dlv_fixed);
2635 view->dlv = NULL;
2641 CHECK(configure_view_dnsseckeys(view, vconfig, config, bindkeys,
2643 dns_resolver_resetmustbesecure(view->resolver);
2647 CHECK(mustbesecure(obj, view->resolver));
2654 view->preferred_glue = dns_rdatatype_a;
2656 view->preferred_glue = dns_rdatatype_aaaa;
2658 view->preferred_glue = 0;
2660 view->preferred_glue = 0;
2665 dns_view_setrootdelonly(view, ISC_TRUE);
2684 CHECK(dns_view_excludedelegationonly(view,
2689 dns_view_setrootdelonly(view, ISC_FALSE);
2699 view->rdclass == dns_rdataclass_in) {
2701 empty_zones_enable = view->recursion;
2702 } else if (view->rdclass == dns_rdataclass_in) {
2707 empty_zones_enable = view->recursion;
2787 (void)dns_view_findzone(view, name, &zone);
2798 result = dns_fwdtable_find(view->fwdtable, name,
2825 view->name, view->rdclass,
2838 dns_zone_setview(zone, view);
2839 CHECK(dns_view_addzone(view, zone));
2849 dns_zone_setview(zone, view);
2852 dns_zone_setclass(zone, view->rdclass);
2857 if (view->queryacl != NULL)
2858 dns_zone_setqueryacl(zone, view->queryacl);
2859 if (view->queryonacl != NULL)
2860 dns_zone_setqueryonacl(zone, view->queryonacl);
2866 CHECK(dns_view_addzone(view, zone));
2880 if (view->rdclass == dns_rdataclass_in && need_hints) {
2891 result = configure_rpz(view, element);
2933 configure_hints(dns_view_t *view, const char *filename) {
2938 result = dns_rootns_create(view->mctx, view->rdclass, filename, &db);
2940 dns_view_sethints(view, db);
2948 configure_alternates(const cfg_obj_t *config, dns_view_t *view,
3016 CHECK(dns_resolver_addalternate(view->resolver, NULL,
3024 CHECK(dns_resolver_addalternate(view->resolver, &sa,
3033 configure_forward(const cfg_obj_t *config, dns_view_t *view, dns_name_t *origin,
3077 sa = isc_mem_get(view->mctx, sizeof(isc_sockaddr_t));
3109 result = dns_fwdtable_add(view->fwdtable, origin, &addresses,
3127 isc_mem_put(view->mctx, sa, sizeof(isc_sockaddr_t));
3163 * Find a view based on its configuration info and attach to it.
3165 * If 'vconfig' is NULL, attach to the default view.
3174 dns_view_t *view = NULL;
3180 result = dns_viewlist_find(viewlist, viewname, viewclass, &view);
3184 *viewp = view;
3189 * Create a new view and add it to the list.
3191 * If 'vconfig' is NULL, create the default view.
3193 * The view created is attached to '*viewp'.
3202 dns_view_t *view = NULL;
3208 result = dns_viewlist_find(viewlist, viewname, viewclass, &view);
3213 INSIST(view == NULL);
3215 result = dns_view_create(ns_g_mctx, viewclass, viewname, &view);
3219 ISC_LIST_APPEND(*viewlist, view, link);
3220 dns_view_attach(view, viewp);
3229 const cfg_obj_t *vconfig, isc_mem_t *mctx, dns_view_t *view,
3232 dns_view_t *pview = NULL; /* Production view */
3267 view->rdclass, &zclass));
3268 if (zclass != view->rdclass) {
3274 vname = "<default view>";
3278 "zone '%s': wrong class for view '%s'",
3309 result = configure_hints(view, hintsfile);
3326 CHECK(dns_view_adddelegationonly(view, origin));
3348 result = configure_forward(config, view, origin, forwarders,
3357 result = dns_view_adddelegationonly(view, origin);
3364 result = dns_view_findzone(view, origin, &dupzone);
3380 * - The zone's view exists
3381 * - A zone with the right name exists in the view
3387 view->name, view->rdclass,
3401 * new view.
3403 dns_zone_setview(zone, view);
3404 if (view->acache != NULL)
3405 dns_zone_setacache(zone, view->acache);
3413 dns_zone_setview(zone, view);
3414 if (view->acache != NULL)
3415 dns_zone_setacache(zone, view->acache);
3429 CHECK(configure_forward(config, view, origin, forwarders,
3440 CHECK(dns_view_adddelegationonly(view, origin));
3454 * Add the zone to its view in the new view list.
3456 CHECK(dns_view_addzone(view, zone));
3481 add_keydata_zone(dns_view_t *view, const char *directory, isc_mem_t *mctx) {
3490 REQUIRE(view != NULL);
3494 view->name, view->rdclass,
3501 dns_zone_attach(pview->managed_keys, &view->managed_keys);
3502 dns_zone_setview(pview->managed_keys, view);
3504 dns_zone_synckeyzone(view->managed_keys);
3512 isc_sha256_data((void *)view->name, strlen(view->name), buffer);
3516 strcmp(view->name, "_default") == 0 ? KEYZONE : buffer);
3523 dns_zone_setview(zone, view);
3525 dns_zone_setclass(zone, view->rdclass);
3529 if (view->acache != NULL)
3530 dns_zone_setacache(zone, view->acache);
3545 if (view->managed_keys != NULL)
3546 dns_zone_detach(&view->managed_keys);
3547 dns_zone_attach(zone, &view->managed_keys);
3551 "set up managed keys zone for view %s, file '%s'",
3552 view->name, filename);
3680 dns_view_t *view;
3688 for (view = ISC_LIST_HEAD(server->viewlist);
3689 view != NULL;
3690 view = ISC_LIST_NEXT(view, link)) {
3693 dispatch6 = dns_resolver_dispatchv6(view->resolver);
3722 * check if the corresponding view is in our current view list.
3724 * of shutting down and have detached from their old view
3730 for (view = ISC_LIST_HEAD(server->viewlist);
3731 view != NULL && view != zoneview;
3732 view = ISC_LIST_NEXT(view, link))
3734 if (view == NULL)
3790 dns_view_t *view;
3794 view = ISC_LIST_HEAD(server->viewlist);
3795 while (view != NULL) {
3796 dns_view_dialup(view);
3797 view = ISC_LIST_NEXT(view, link);
4173 setup_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
4203 dns_view_setnewzones(view, ISC_FALSE, NULL, NULL);
4207 nzcfg = isc_mem_get(view->mctx, sizeof(*nzcfg));
4209 dns_view_setnewzones(view, ISC_FALSE, NULL, NULL);
4213 dns_view_setnewzones(view, allow, nzcfg, newzone_cfgctx_destroy);
4216 isc_mem_attach(view->mctx, &nzcfg->mctx);
4226 result = cfg_parser_create(view->mctx, ns_g_lctx, &nzparser);
4228 result = cfg_parse_file(nzparser, view->new_zone_file,
4274 dns_view_t *view = NULL;
4537 * Set the EDNS UDP size when we don't match a view.
4597 * used if we're in lwresd mode. This way is easier.
4726 (void)cfg_map_get(config, "view", &views);
4732 * "bind" view can be ignored as it only adds a negligible
4737 * zone configuration context, but otherwise view configuration
4746 view = NULL;
4748 CHECK(create_view(vconfig, &viewlist, &view));
4749 INSIST(view != NULL);
4752 CHECK(setup_newzones(view, config, vconfig, conf_parser,
4755 nzctx = view->new_zone_config;
4759 dns_view_detach(&view);
4764 * view here.
4767 CHECK(create_view(NULL, &viewlist, &view));
4768 INSIST(view != NULL);
4772 CHECK(setup_newzones(view, config, NULL, conf_parser,
4775 nzctx = view->new_zone_config;
4779 dns_view_detach(&view);
4801 view = NULL;
4802 CHECK(find_view(vconfig, &viewlist, &view));
4803 CHECK(configure_view(view, config, vconfig,
4806 dns_view_freeze(view);
4807 dns_view_detach(&view);
4811 * Make sure we have a default view if and only if there
4815 view = NULL;
4816 CHECK(find_view(NULL, &viewlist, &view));
4817 CHECK(configure_view(view, config, NULL,
4820 dns_view_freeze(view);
4821 dns_view_detach(&view);
4828 RUNTIME_CHECK(cfg_map_get(ns_g_config, "view",
4836 CHECK(create_view(vconfig, &builtin_viewlist, &view));
4837 CHECK(configure_view(view, config, vconfig,
4840 dns_view_freeze(view);
4841 dns_view_detach(&view);
4842 view = NULL;
4848 /* Swap our new view list with the production one. */
4853 /* Make the view list available to each of the views */
4854 view = ISC_LIST_HEAD(server->viewlist);
4855 while (view != NULL) {
4856 view->viewlist = &server->viewlist;
4857 view = ISC_LIST_NEXT(view, link);
4950 * Do this after changing UID to make sure that any log
5134 if (view != NULL)
5135 dns_view_detach(&view);
5138 * This cleans up either the old production view list
5142 for (view = ISC_LIST_HEAD(viewlist);
5143 view != NULL;
5144 view = view_next) {
5145 view_next = ISC_LIST_NEXT(view, link);
5146 ISC_LIST_UNLINK(viewlist, view, link);
5148 strcmp(view->name, "_bind") != 0)
5149 (void)dns_zt_apply(view->zonetable, ISC_FALSE,
5150 removed, view);
5151 dns_view_detach(&view);
5182 dns_view_t *view;
5190 for (view = ISC_LIST_HEAD(server->viewlist);
5191 view != NULL;
5192 view = ISC_LIST_NEXT(view, link))
5194 CHECK(dns_view_load(view, stop));
5195 if (view->managed_keys != NULL)
5196 CHECK(dns_zone_load(view->managed_keys));
5213 dns_view_t *view;
5221 for (view = ISC_LIST_HEAD(server->viewlist);
5222 view != NULL;
5223 view = ISC_LIST_NEXT(view, link))
5225 CHECK(dns_view_loadnew(view, stop));
5228 if (view->managed_keys != NULL)
5229 CHECK(dns_zone_loadnew(view->managed_keys));
5309 dns_view_t *view, *view_next;
5335 for (view = ISC_LIST_HEAD(server->viewlist);
5336 view != NULL;
5337 view = view_next) {
5338 view_next = ISC_LIST_NEXT(view, link);
5339 ISC_LIST_UNLINK(server->viewlist, view, link);
5341 dns_view_flushanddetach(&view);
5343 dns_view_detach(&view);
5821 dns_view_t *view = NULL;
5843 /* Look for the optional view name. */
5872 rdclass, &view);
5876 result = dns_zt_find(view->zonetable, dns_fixedname_name(&name),
5878 dns_view_detach(&view);
6165 add_view_tolist(struct dumpcontext *dctx, dns_view_t *view) {
6175 if (vle->view == view)
6181 vle->view = NULL;
6182 dns_view_attach(view, &vle->view);
6187 result = dns_zt_apply(view->zonetable, ISC_TRUE,
6207 dns_view_detach(&vle->view);
6236 if (dctx->view == NULL) {
6237 dctx->view = ISC_LIST_HEAD(dctx->viewlist);
6238 if (dctx->view == NULL)
6244 fprintf(dctx->fp, ";\n; Start view %s\n;\n", dctx->view->view->name);
6246 if (dctx->dumpcache && dns_view_iscacheshared(dctx->view->view)) {
6248 ";\n; Cache of view '%s' is shared as '%s'\n",
6249 dctx->view->view->name,
6250 dns_cache_getname(dctx->view->view->cache));
6256 if (dctx->view->view->cachedb != NULL)
6257 dns_db_attach(dctx->view->view->cachedb, &dctx->cache);
6260 ";\n; Cache dump of view '%s' (cache %s)\n;\n",
6261 dctx->view->view->name,
6262 dns_cache_getname(dctx->view->view->cache));
6279 dns_adb_dump(dctx->view->view->adb, dctx->fp);
6280 dns_resolver_printbadcache(dctx->view->view->resolver,
6293 dctx->zone = ISC_LIST_HEAD(dctx->view->zonelist);
6327 if (dctx->view != NULL)
6328 dctx->view = ISC_LIST_NEXT(dctx->view, link);
6329 if (dctx->view != NULL)
6349 dns_view_t *view;
6368 dctx->view = NULL;
6402 for (view = ISC_LIST_HEAD(server->viewlist);
6403 view != NULL;
6404 view = ISC_LIST_NEXT(view, link))
6406 if (ptr != NULL && strcmp(view->name, ptr) != 0)
6408 CHECK(add_view_tolist(dctx, view));
6426 dns_view_t *view;
6447 for (view = ISC_LIST_HEAD(server->viewlist);
6448 view != NULL;
6449 view = ISC_LIST_NEXT(view, link))
6451 if (ptr != NULL && strcmp(view->name, ptr) != 0)
6455 result = dns_view_getsecroots(view, &secroots);
6460 fprintf(fp, "\n Start view %s\n\n", view->name);
6548 dns_view_t *view;
6572 /* Look for the view name. */
6577 for (view = ISC_LIST_HEAD(server->viewlist);
6578 view != NULL;
6579 view = ISC_LIST_NEXT(view, link))
6581 if (viewname != NULL && strcasecmp(viewname, view->name) != 0)
6583 result = dns_view_flushcache(view);
6586 view->enablevalidation = enable;
6601 dns_view_t *view;
6612 /* Look for the view name. */
6628 * Mark caches that need to be flushed. This is an O(#view^2)
6633 for (view = ISC_LIST_HEAD(server->viewlist);
6634 view != NULL;
6635 view = ISC_LIST_NEXT(view, link))
6637 if (strcasecmp(viewname, view->name) != 0)
6643 if (nsc->cache == view->cache)
6664 "flushing cache in view '%s' failed: %s",
6679 for (view = ISC_LIST_HEAD(server->viewlist);
6680 view != NULL;
6681 view = ISC_LIST_NEXT(view, link))
6683 if (!dns_view_iscacheshared(view))
6688 if (!nsc->needflush || nsc->cache != view->cache)
6690 result = dns_view_flushcache2(view, ISC_TRUE);
6695 "fixing cache in view '%s' "
6696 "failed: %s", view->name,
6713 "flushing cache in view '%s' succeeded",
6724 "flushing cache in view '%s' failed: "
6725 "view not found", viewname);
6737 dns_view_t *view;
6763 /* Look for the view name. */
6770 for (view = ISC_LIST_HEAD(server->viewlist);
6771 view != NULL;
6772 view = ISC_LIST_NEXT(view, link))
6774 if (viewname != NULL && strcasecmp(viewname, view->name) != 0)
6782 result = dns_view_flushname(view, name);
6787 "flushing name '%s' in cache view '%s' "
6788 "failed: %s", target, view->name,
6796 "flushing name '%s' in cache view '%s' "
6808 "flushing name '%s' in cache view '%s' "
6809 "failed: view not found", target,
6937 dns_view_t *view;
6950 for (view = ISC_LIST_HEAD(server->viewlist);
6951 view != NULL;
6952 view = ISC_LIST_NEXT(view, link)) {
6953 if (viewname == NULL || strcmp(view->name, viewname) == 0) {
6954 RWLOCK(&view->dynamickeys->lock, isc_rwlocktype_write);
6955 result = delete_keynames(view->dynamickeys, target,
6957 RWUNLOCK(&view->dynamickeys->lock,
6978 list_keynames(dns_view_t *view, dns_tsig_keyring_t *ring, isc_buffer_t *text,
6993 if (view != NULL)
6994 viewname = view->name;
7026 "view \"%s\"; type \"dynamic\"; key \"%s\"; creator \"%s\";\n",
7031 "view \"%s\"; type \"static\"; key \"%s\";\n",
7056 dns_view_t *view;
7061 for (view = ISC_LIST_HEAD(server->viewlist);
7062 view != NULL;
7063 view = ISC_LIST_NEXT(view, link)) {
7064 RWLOCK(&view->statickeys->lock, isc_rwlocktype_read);
7065 result = list_keynames(view, view->statickeys, text,
7067 RWUNLOCK(&view->statickeys->lock, isc_rwlocktype_read);
7072 RWLOCK(&view->dynamickeys->lock, isc_rwlocktype_read);
7073 result = list_keynames(view, view->dynamickeys, text,
7075 RWUNLOCK(&view->dynamickeys->lock, isc_rwlocktype_read);
7147 dns_view_t *view;
7160 for (view = ISC_LIST_HEAD(server->viewlist);
7161 view != NULL;
7162 view = ISC_LIST_NEXT(view, link)) {
7163 result = dns_view_freezezones(view, freeze);
7229 view = dns_zone_getview(zone);
7230 if (strcmp(view->name, "_default") == 0 ||
7231 strcmp(view->name, "_bind") == 0)
7236 vname = view->name;
7292 dns_view_t *view = 0;
7322 /* Make sense of optional view argument */
7323 obj = cfg_tuple_get(parms, "view");
7328 CHECK(dns_viewlist_find(&server->viewlist, viewname, rdclass, &view));
7331 if (view->new_zone_file == NULL) {
7336 cfg = (struct cfg_context *) view->new_zone_config;
7343 result = dns_zt_find(view->zonetable, &dnsname, 0, NULL, &zone);
7355 /* Find the view statement */
7356 cfg_map_get(cfg->config, "view", &views);
7370 CHECK(isc_stdio_open(view->new_zone_file, "a", &fp));
7372 /* Mark view unfrozen so that zone can be added */
7374 dns_view_thaw(view);
7376 server->mctx, view, cfg->actx, ISC_FALSE);
7377 dns_view_freeze(view);
7383 CHECK(dns_zt_find(view->zonetable, &dnsname, 0, NULL, &zone));
7404 dns_zt_unmount(view->zonetable, zone);
7441 "zone %s added to view %s via addzone",
7456 if (view != NULL)
7457 dns_view_detach(&view);
7471 dns_view_t *view = NULL;
7502 view = dns_zone_getview(zone);
7503 filename = view->new_zone_file;
7505 /* No adding zones in this view */
7585 CHECK(isc_file_rename(tmpname, view->new_zone_file));
7601 CHECK(dns_zt_unmount(view->zonetable, zone));