zoneconf.c revision 37cf280f4913d821a01d7d98e9208bc6b58881a6
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence/*
5fa46bc91672ef5737aee6f99763161511566c24Tinderbox User * Copyright (C) 1999, 2000 Internet Software Consortium.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews *
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * Permission to use, copy, modify, and distribute this software for any
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater * purpose with or without fee is hereby granted, provided that the above
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence * copyright notice and this permission notice appear in all copies.
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence *
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * SOFTWARE.
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence */
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence
28a8f5b0de57d269cf2845c69cb6abe18cbd3b3aMark Andrews#include <config.h>
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer#include <isc/assertions.h>
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer#include <isc/error.h>
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer#include <isc/mem.h>
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer#include <isc/result.h>
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer#include <isc/util.h>
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer#include <dns/aclconf.h>
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer#include <dns/types.h>
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer#include <dns/zone.h>
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer#include <dns/zoneconf.h>
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer#include <dns/ssu.h>
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer/* XXX copied from zone.c */
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer#define MAX_XFER_TIME (2*3600) /* Documented default is 2 hours. */
747abb4993e03b8812514e4476bff67f5248c717Evan Hunt#define DNS_DEFAULT_IDLEIN 3600 /* 1 hour */
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer#define DNS_DEFAULT_IDLEOUT 3600 /* 1 hour */
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer/*
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer * Convenience function for configuring a single zone ACL.
e30d8c5a4728ca05720ec3fdefa99200e09dca39Evan Hunt */
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayerstatic isc_result_t
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayerconfigure_zone_acl(dns_c_zone_t *czone, dns_c_ctx_t *cctx, dns_c_view_t *cview,
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_aclconfctx_t *aclconfctx, dns_zone_t *zone,
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer isc_result_t (*getcacl)(dns_c_zone_t *, dns_c_ipmatchlist_t **),
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer isc_result_t (*getviewcacl)(dns_c_view_t *, dns_c_ipmatchlist_t **),
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer isc_result_t (*getglobalcacl)(dns_c_ctx_t *, dns_c_ipmatchlist_t **),
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer void (*setzacl)(dns_zone_t *, dns_acl_t *),
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer void (*clearzacl)(dns_zone_t *))
7e9d637131516486630290d36c4c0db544cb700eMark Andrews{
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer isc_result_t result;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_c_ipmatchlist_t *cacl;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_acl_t *dacl = NULL;
7e9d637131516486630290d36c4c0db544cb700eMark Andrews result = (*getcacl)(czone, &cacl);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews if (result == ISC_R_NOTFOUND && getviewcacl != NULL && cview != NULL) {
7e9d637131516486630290d36c4c0db544cb700eMark Andrews result = (*getviewcacl)(cview, &cacl);
0b9ea3fca6019f741f18376b5b26c0fa0835477fMark Andrews }
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result == ISC_R_NOTFOUND && getglobalcacl != NULL) {
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = (*getglobalcacl)(cctx, &cacl);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer }
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result == ISC_R_SUCCESS) {
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_acl_fromconfig(cacl, cctx, aclconfctx,
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_zone_getmctx(zone), &dacl);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_c_ipmatchlist_detach(&cacl);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer return (result);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer (*setzacl)(zone, dacl);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_acl_detach(&dacl);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer return (ISC_R_SUCCESS);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer } else if (result == ISC_R_NOTFOUND) {
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer (*clearzacl)(zone);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer return (ISC_R_SUCCESS);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer } else {
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer return (result);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer }
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer}
68c2ccc953059f389cefc0f8a5ce0f83be7458c9Danny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayerstatic dns_zonetype_t
68c2ccc953059f389cefc0f8a5ce0f83be7458c9Danny Mayerdns_zonetype_fromconf(dns_c_zonetype_t cztype) {
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer switch (cztype) {
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer case dns_c_zone_master:
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer return dns_zone_master;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer case dns_c_zone_forward:
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer return dns_zone_forward;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer case dns_c_zone_slave:
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer return dns_zone_slave;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer case dns_c_zone_stub:
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer return dns_zone_stub;
7e9d637131516486630290d36c4c0db544cb700eMark Andrews case dns_c_zone_hint:
68c2ccc953059f389cefc0f8a5ce0f83be7458c9Danny Mayer return dns_zone_hint;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer }
68c2ccc953059f389cefc0f8a5ce0f83be7458c9Danny Mayer INSIST(0);
e76d4c91bfadf823f04dcca1c1c5bcc14c67671dAndreas Gustafsson return (dns_zone_none); /*NOTREACHED*/
68c2ccc953059f389cefc0f8a5ce0f83be7458c9Danny Mayer}
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayerisc_result_t
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayerdns_zone_configure(dns_c_ctx_t *cctx, dns_c_view_t *cview,
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_c_zone_t *czone, dns_aclconfctx_t *ac,
68c2ccc953059f389cefc0f8a5ce0f83be7458c9Danny Mayer dns_zone_t *zone)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer{
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer isc_result_t result;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer isc_boolean_t boolean;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer const char *filename = NULL;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer#ifdef notyet
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_c_severity_t severity;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer#endif
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_c_iplist_t *iplist = NULL;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer isc_sockaddr_t sockaddr;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer isc_int32_t maxxfr;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer struct in_addr in4addr_any;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer isc_sockaddr_t sockaddr_any4, sockaddr_any6;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_ssutable_t *ssutable;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
39125379e5c9331f3dafd8d4bcb23fd52e30bfa8Andreas Gustafsson in4addr_any.s_addr = htonl(INADDR_ANY);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews isc_sockaddr_fromin(&sockaddr_any4, &in4addr_any, 0);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer isc_sockaddr_fromin6(&sockaddr_any6, &in6addr_any, 0);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
7e9d637131516486630290d36c4c0db544cb700eMark Andrews dns_zone_setclass(zone, czone->zclass);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer /* XXX needs to be an zone option */
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_zone_setdbtype(zone, "rbt");
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer return (result);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer switch (czone->ztype) {
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer case dns_c_zone_master:
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_zone_settype(zone, dns_zone_master);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_zone_getfile(czone, &filename);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer return (result);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_zone_setdatabase(zone, filename);
bb48ac4f813537a060579615a52f9c7963f5e3c4Danny Mayer if (result != ISC_R_SUCCESS)
bb48ac4f813537a060579615a52f9c7963f5e3c4Danny Mayer return (result);
bb48ac4f813537a060579615a52f9c7963f5e3c4Danny Mayer#ifdef notyet
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_zone_getchecknames(czone, &severity);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result == ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_zone_setchecknames(zone, severity);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer else
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_zone_setchecknames(zone, dns_c_severity_fail);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer#endif
7829fad4093f2c1985b1efb7cea00287ff015d2bckb result = configure_zone_acl(czone, cctx, NULL, ac, zone,
7829fad4093f2c1985b1efb7cea00287ff015d2bckb dns_c_zone_getallowupd,
7829fad4093f2c1985b1efb7cea00287ff015d2bckb NULL, NULL,
8e6b386ab7e2d1bd8efedecbb8f4efb6b572a866Tinderbox User dns_zone_setupdateacl,
7829fad4093f2c1985b1efb7cea00287ff015d2bckb dns_zone_clearupdateacl);
8e6b386ab7e2d1bd8efedecbb8f4efb6b572a866Tinderbox User if (result != ISC_R_SUCCESS)
7829fad4093f2c1985b1efb7cea00287ff015d2bckb return (result);
7829fad4093f2c1985b1efb7cea00287ff015d2bckb
8e6b386ab7e2d1bd8efedecbb8f4efb6b572a866Tinderbox User result = configure_zone_acl(czone, cctx, cview, ac, zone,
7829fad4093f2c1985b1efb7cea00287ff015d2bckb dns_c_zone_getallowquery,
7829fad4093f2c1985b1efb7cea00287ff015d2bckb dns_c_view_getallowquery,
7829fad4093f2c1985b1efb7cea00287ff015d2bckb dns_c_ctx_getallowquery,
7829fad4093f2c1985b1efb7cea00287ff015d2bckb dns_zone_setqueryacl,
7829fad4093f2c1985b1efb7cea00287ff015d2bckb dns_zone_clearqueryacl);
7829fad4093f2c1985b1efb7cea00287ff015d2bckb if (result != ISC_R_SUCCESS)
7829fad4093f2c1985b1efb7cea00287ff015d2bckb return (result);
7829fad4093f2c1985b1efb7cea00287ff015d2bckb
7829fad4093f2c1985b1efb7cea00287ff015d2bckb result = configure_zone_acl(czone, cctx, cview, ac, zone,
7829fad4093f2c1985b1efb7cea00287ff015d2bckb dns_c_zone_getallowtransfer,
7829fad4093f2c1985b1efb7cea00287ff015d2bckb dns_c_view_gettransferacl,
7829fad4093f2c1985b1efb7cea00287ff015d2bckb dns_c_ctx_getallowtransfer,
7829fad4093f2c1985b1efb7cea00287ff015d2bckb dns_zone_setxfracl,
7829fad4093f2c1985b1efb7cea00287ff015d2bckb dns_zone_clearxfracl);
c514f38c801755da4dbe405139d8512873b332b0ckb if (result != ISC_R_SUCCESS)
c514f38c801755da4dbe405139d8512873b332b0ckb return (result);
c514f38c801755da4dbe405139d8512873b332b0ckb
c514f38c801755da4dbe405139d8512873b332b0ckb result = dns_c_zone_getdialup(czone, &boolean);
c514f38c801755da4dbe405139d8512873b332b0ckb#ifdef notyet
c514f38c801755da4dbe405139d8512873b332b0ckb if (result != ISC_R_SUCCESS && cview != NULL)
c514f38c801755da4dbe405139d8512873b332b0ckb result = dns_c_view_getdialup(cview, &boolean);
7829fad4093f2c1985b1efb7cea00287ff015d2bckb#endif
c514f38c801755da4dbe405139d8512873b332b0ckb if (result != ISC_R_SUCCESS)
c514f38c801755da4dbe405139d8512873b332b0ckb result = dns_c_ctx_getdialup(cctx, &boolean);
c514f38c801755da4dbe405139d8512873b332b0ckb if (result != ISC_R_SUCCESS)
c514f38c801755da4dbe405139d8512873b332b0ckb boolean = ISC_FALSE;
c514f38c801755da4dbe405139d8512873b332b0ckb dns_zone_setoption(zone, DNS_ZONE_O_DIALUP, boolean);
7829fad4093f2c1985b1efb7cea00287ff015d2bckb
7829fad4093f2c1985b1efb7cea00287ff015d2bckb result = dns_c_zone_getnotify(czone, &boolean);
7829fad4093f2c1985b1efb7cea00287ff015d2bckb if (result != ISC_R_SUCCESS && cview != NULL)
e76d4c91bfadf823f04dcca1c1c5bcc14c67671dAndreas Gustafsson result = dns_c_view_getnotify(cview, &boolean);
e76d4c91bfadf823f04dcca1c1c5bcc14c67671dAndreas Gustafsson if (result != ISC_R_SUCCESS)
e76d4c91bfadf823f04dcca1c1c5bcc14c67671dAndreas Gustafsson result = dns_c_ctx_getnotify(cctx, &boolean);
e76d4c91bfadf823f04dcca1c1c5bcc14c67671dAndreas Gustafsson if (result != ISC_R_SUCCESS)
e76d4c91bfadf823f04dcca1c1c5bcc14c67671dAndreas Gustafsson boolean = ISC_TRUE;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_zone_setoption(zone, DNS_ZONE_O_NOTIFY, boolean);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_zone_getalsonotify(czone, &iplist);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result == ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_zone_setnotifyalso(zone, iplist->ips,
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer iplist->nextidx);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer else
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_zone_setnotifyalso(zone, NULL, 0);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer return (result);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_zone_getmaxtranstimeout(czone, &maxxfr);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS && cview != NULL)
1e71bc82b8e1a95d423d8db1c136080dc034433dAndreas Gustafsson result = dns_c_view_getmaxtransfertimeout(cview, &maxxfr);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
68c2ccc953059f389cefc0f8a5ce0f83be7458c9Danny Mayer result = dns_c_ctx_getmaxtransfertimeout(cctx, &maxxfr);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer maxxfr = MAX_XFER_TIME;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_zone_setmaxxfrout(zone, maxxfr);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_zone_getmaxtransidleout(czone, &maxxfr);
68c2ccc953059f389cefc0f8a5ce0f83be7458c9Danny Mayer if (result != ISC_R_SUCCESS && cview != NULL)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_view_getmaxtransferidleout(cview, &maxxfr);
68c2ccc953059f389cefc0f8a5ce0f83be7458c9Danny Mayer if (result != ISC_R_SUCCESS)
68c2ccc953059f389cefc0f8a5ce0f83be7458c9Danny Mayer result = dns_c_ctx_getmaxtransferidleout(cctx, &maxxfr);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews if (result != ISC_R_SUCCESS)
68c2ccc953059f389cefc0f8a5ce0f83be7458c9Danny Mayer maxxfr = DNS_DEFAULT_IDLEOUT;
68c2ccc953059f389cefc0f8a5ce0f83be7458c9Danny Mayer dns_zone_setidleout(zone, maxxfr);
bbb3705e4cbdacf7cf6da7e448d79d97fdab2411Mark Andrews
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer ssutable = NULL;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_zone_getssuauth(czone, &ssutable);
68c2ccc953059f389cefc0f8a5ce0f83be7458c9Danny Mayer if (result == ISC_R_SUCCESS) {
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_ssutable_t *newssutable = NULL;
68c2ccc953059f389cefc0f8a5ce0f83be7458c9Danny Mayer dns_ssutable_attach(ssutable, &newssutable);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_zone_setssutable(zone, newssutable);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer }
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer break;
68c2ccc953059f389cefc0f8a5ce0f83be7458c9Danny Mayer
e76d4c91bfadf823f04dcca1c1c5bcc14c67671dAndreas Gustafsson case dns_c_zone_forward:
e76d4c91bfadf823f04dcca1c1c5bcc14c67671dAndreas Gustafsson#ifdef notyet
e76d4c91bfadf823f04dcca1c1c5bcc14c67671dAndreas Gustafsson /*
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer * forward zones are still in a state of flux
1e71bc82b8e1a95d423d8db1c136080dc034433dAndreas Gustafsson */
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer czone->u.fzone.check_names; /* XXX unused in BIND 8 */
1b8eaf41431cc05a5f74446254729987061a9e9bAndreas Gustafsson czone->u.fzone.forward; /* XXX*/
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer czone->u.fzone.forwarders; /* XXX*/
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer#endif
1e71bc82b8e1a95d423d8db1c136080dc034433dAndreas Gustafsson break;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer case dns_c_zone_slave:
e76d4c91bfadf823f04dcca1c1c5bcc14c67671dAndreas Gustafsson dns_zone_settype(zone, dns_zone_slave);
e76d4c91bfadf823f04dcca1c1c5bcc14c67671dAndreas Gustafsson result = dns_c_zone_getfile(czone, &filename);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
e76d4c91bfadf823f04dcca1c1c5bcc14c67671dAndreas Gustafsson return (result);
bbb3705e4cbdacf7cf6da7e448d79d97fdab2411Mark Andrews result = dns_zone_setdatabase(zone, filename);
1e71bc82b8e1a95d423d8db1c136080dc034433dAndreas Gustafsson if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer return (result);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer#ifdef notyet
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_zone_getchecknames(czone, &severity);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result == ISC_R_SUCCESS)
bdec94477cc9ecac9ff14d3399f47f3d71cd370aAndreas Gustafsson dns_zone_setchecknames(zone, severity);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer else
bb48ac4f813537a060579615a52f9c7963f5e3c4Danny Mayer dns_zone_setchecknames(zone, dns_c_severity_warn);
bb48ac4f813537a060579615a52f9c7963f5e3c4Danny Mayer#endif
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = configure_zone_acl(czone, cctx, cview, ac, zone,
fdacf913e123db672888ff6b24a89caea6b12a50Danny Mayer dns_c_zone_getallowquery,
bdec94477cc9ecac9ff14d3399f47f3d71cd370aAndreas Gustafsson dns_c_view_getallowquery,
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_c_ctx_getallowquery,
bdec94477cc9ecac9ff14d3399f47f3d71cd370aAndreas Gustafsson dns_zone_setqueryacl,
bdec94477cc9ecac9ff14d3399f47f3d71cd370aAndreas Gustafsson dns_zone_clearqueryacl);
bdec94477cc9ecac9ff14d3399f47f3d71cd370aAndreas Gustafsson if (result != ISC_R_SUCCESS)
bdec94477cc9ecac9ff14d3399f47f3d71cd370aAndreas Gustafsson return (result);
bdec94477cc9ecac9ff14d3399f47f3d71cd370aAndreas Gustafsson
bdec94477cc9ecac9ff14d3399f47f3d71cd370aAndreas Gustafsson result = dns_c_zone_getmasterips(czone, &iplist);
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic Updater if (result == ISC_R_SUCCESS)
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic Updater result = dns_zone_setmasters(zone, iplist->ips,
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic Updater iplist->nextidx);
bdec94477cc9ecac9ff14d3399f47f3d71cd370aAndreas Gustafsson else
bdec94477cc9ecac9ff14d3399f47f3d71cd370aAndreas Gustafsson result = dns_zone_setmasters(zone, NULL, 0);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer return (result);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_zone_getmaxtranstimein(czone, &maxxfr);
b602bf9e8b67cb2b1ff9ee8b2a48793bf6c70e16Danny Mayer if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_ctx_getmaxtransfertimein(cctx, &maxxfr);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer maxxfr = MAX_XFER_TIME;
b602bf9e8b67cb2b1ff9ee8b2a48793bf6c70e16Danny Mayer dns_zone_setmaxxfrin(zone, maxxfr);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_zone_getmaxtransidlein(czone, &maxxfr);
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic Updater if (result != ISC_R_SUCCESS)
528baec07b1b9a566d47fc638ba5cbbe01475c74Andreas Gustafsson result = dns_c_ctx_getmaxtransferidlein(cctx, &maxxfr);
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic Updater if (result != ISC_R_SUCCESS)
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic Updater maxxfr = DNS_DEFAULT_IDLEIN;
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic Updater dns_zone_setidlein(zone, maxxfr);
528baec07b1b9a566d47fc638ba5cbbe01475c74Andreas Gustafsson
528baec07b1b9a566d47fc638ba5cbbe01475c74Andreas Gustafsson result = dns_c_zone_gettransfersource(czone, &sockaddr);
528baec07b1b9a566d47fc638ba5cbbe01475c74Andreas Gustafsson if (result != ISC_R_SUCCESS && cview != NULL)
528baec07b1b9a566d47fc638ba5cbbe01475c74Andreas Gustafsson result = dns_c_view_gettransfersource(cview, &sockaddr);
528baec07b1b9a566d47fc638ba5cbbe01475c74Andreas Gustafsson if (result != ISC_R_SUCCESS)
b602bf9e8b67cb2b1ff9ee8b2a48793bf6c70e16Danny Mayer result = dns_c_ctx_gettransfersource(cctx, &sockaddr);
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic Updater if (result != ISC_R_SUCCESS)
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic Updater sockaddr = sockaddr_any4;
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic Updater dns_zone_setxfrsource4(zone, &sockaddr);
b602bf9e8b67cb2b1ff9ee8b2a48793bf6c70e16Danny Mayer
b602bf9e8b67cb2b1ff9ee8b2a48793bf6c70e16Danny Mayer result = dns_c_zone_gettransfersourcev6(czone, &sockaddr);
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic Updater if (result != ISC_R_SUCCESS && cview != NULL)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_view_gettransfersourcev6(cview, &sockaddr);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence result = dns_c_ctx_gettransfersourcev6(cctx, &sockaddr);
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer sockaddr = sockaddr_any6;
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence dns_zone_setxfrsource6(zone, &sockaddr);
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_zone_getmaxtranstimeout(czone, &maxxfr);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS && cview != NULL)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_view_getmaxtransfertimeout(cview, &maxxfr);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_ctx_getmaxtransfertimeout(cctx, &maxxfr);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer maxxfr = MAX_XFER_TIME;
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence dns_zone_setmaxxfrout(zone, maxxfr);
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence
bb48ac4f813537a060579615a52f9c7963f5e3c4Danny Mayer result = dns_c_zone_getmaxtransidleout(czone, &maxxfr);
bb48ac4f813537a060579615a52f9c7963f5e3c4Danny Mayer if (result != ISC_R_SUCCESS && cview != NULL)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_view_getmaxtransferidleout(cview, &maxxfr);
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_ctx_getmaxtransferidleout(cctx, &maxxfr);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer maxxfr = DNS_DEFAULT_IDLEOUT;
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence dns_zone_setidleout(zone, maxxfr);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence result = dns_c_zone_getdialup(czone, &boolean);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer#ifdef notyet
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS && cview != NULL)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_view_getdialup(cview, &boolean);
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence#endif
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_ctx_getdialup(cctx, &boolean);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence boolean = ISC_FALSE;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_zone_setoption(zone, DNS_ZONE_O_DIALUP, boolean);
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence result = dns_c_zone_getnotify(czone, &boolean);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS && cview != NULL)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_view_getnotify(cview, &boolean);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_ctx_getnotify(cctx, &boolean);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer boolean = ISC_TRUE;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_zone_setoption(zone, DNS_ZONE_O_NOTIFY, boolean);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
bbb3705e4cbdacf7cf6da7e448d79d97fdab2411Mark Andrews result = dns_c_zone_getalsonotify(czone, &iplist);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result == ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_zone_setnotifyalso(zone, iplist->ips,
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer iplist->nextidx);
bb48ac4f813537a060579615a52f9c7963f5e3c4Danny Mayer else
bb48ac4f813537a060579615a52f9c7963f5e3c4Danny Mayer result = dns_zone_setnotifyalso(zone, NULL, 0);
bb48ac4f813537a060579615a52f9c7963f5e3c4Danny Mayer if (result != ISC_R_SUCCESS)
7e9d637131516486630290d36c4c0db544cb700eMark Andrews return (result);
e76d4c91bfadf823f04dcca1c1c5bcc14c67671dAndreas Gustafsson
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer break;
b9c80c8bddbb88384d7baef297a873b5f8715e49Mark Andrews
b9c80c8bddbb88384d7baef297a873b5f8715e49Mark Andrews case dns_c_zone_stub:
e76d4c91bfadf823f04dcca1c1c5bcc14c67671dAndreas Gustafsson dns_zone_settype(zone, dns_zone_stub);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_zone_getfile(czone, &filename);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer return (result);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_zone_setdatabase(zone, filename);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer return (result);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer#ifdef notyet
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_zone_getchecknames(czone, &severity);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result == ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_zone_setchecknames(zone, severity);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews else
7e9d637131516486630290d36c4c0db544cb700eMark Andrews dns_zone_setchecknames(zone, dns_c_severity_warn);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer#endif
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = configure_zone_acl(czone, cctx, cview, ac, zone,
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_c_zone_getallowquery,
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_c_view_getallowquery,
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_c_ctx_getallowquery,
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_zone_setqueryacl,
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_zone_clearqueryacl);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
68c2ccc953059f389cefc0f8a5ce0f83be7458c9Danny Mayer return (result);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
7e9d637131516486630290d36c4c0db544cb700eMark Andrews result = dns_c_zone_getmasterips(czone, &iplist);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result == ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_zone_setmasters(zone, iplist->ips,
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer iplist->nextidx);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer else
135bcc2e42a94543f11af2a4196b13552ab46d89Automatic Updater result = dns_zone_setmasters(zone, NULL, 0);
98455e209089def083d4389b35e6ac195631d6c2Mark Andrews if (result != ISC_R_SUCCESS)
433e06a25cdd92d665abda3e64c2c65f4a3f9b21Mark Andrews return (result);
433e06a25cdd92d665abda3e64c2c65f4a3f9b21Mark Andrews
433e06a25cdd92d665abda3e64c2c65f4a3f9b21Mark Andrews result = dns_c_zone_getmaxtranstimein(czone, &maxxfr);
0b9ea3fca6019f741f18376b5b26c0fa0835477fMark Andrews if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_ctx_getmaxtransfertimein(cctx, &maxxfr);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer maxxfr = MAX_XFER_TIME;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_zone_setmaxxfrin(zone, maxxfr);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_zone_getmaxtransidlein(czone, &maxxfr);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_ctx_getmaxtransferidlein(cctx, &maxxfr);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer maxxfr = DNS_DEFAULT_IDLEIN;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer dns_zone_setidlein(zone, maxxfr);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews
7e9d637131516486630290d36c4c0db544cb700eMark Andrews result = dns_c_zone_gettransfersource(czone, &sockaddr);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews if (result != ISC_R_SUCCESS && cview != NULL)
7e9d637131516486630290d36c4c0db544cb700eMark Andrews result = dns_c_view_gettransfersource(cview, &sockaddr);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews if (result != ISC_R_SUCCESS)
7e9d637131516486630290d36c4c0db544cb700eMark Andrews result = dns_c_ctx_gettransfersource(cctx, &sockaddr);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews if (result != ISC_R_SUCCESS)
7e9d637131516486630290d36c4c0db544cb700eMark Andrews sockaddr = sockaddr_any4;
7e9d637131516486630290d36c4c0db544cb700eMark Andrews dns_zone_setxfrsource4(zone, &sockaddr);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews
7e9d637131516486630290d36c4c0db544cb700eMark Andrews result = dns_c_zone_gettransfersourcev6(czone, &sockaddr);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews if (result != ISC_R_SUCCESS && cview != NULL)
7e9d637131516486630290d36c4c0db544cb700eMark Andrews result = dns_c_view_gettransfersourcev6(cview, &sockaddr);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews if (result != ISC_R_SUCCESS)
7e9d637131516486630290d36c4c0db544cb700eMark Andrews result = dns_c_ctx_gettransfersourcev6(cctx, &sockaddr);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews if (result != ISC_R_SUCCESS)
7e9d637131516486630290d36c4c0db544cb700eMark Andrews sockaddr = sockaddr_any6;
7e9d637131516486630290d36c4c0db544cb700eMark Andrews dns_zone_setxfrsource6(zone, &sockaddr);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews
7e9d637131516486630290d36c4c0db544cb700eMark Andrews case dns_c_zone_hint:
7e9d637131516486630290d36c4c0db544cb700eMark Andrews dns_zone_settype(zone, dns_zone_hint);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews result = dns_c_zone_getfile(czone, &filename);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews if (result != ISC_R_SUCCESS)
7e9d637131516486630290d36c4c0db544cb700eMark Andrews return (result);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews result = dns_zone_setdatabase(zone, filename);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews if (result != ISC_R_SUCCESS)
7e9d637131516486630290d36c4c0db544cb700eMark Andrews return (result);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews#ifdef notyet
7e9d637131516486630290d36c4c0db544cb700eMark Andrews result = dns_c_zone_getchecknames(czone, &severity);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews if (result == ISC_R_SUCCESS)
7e9d637131516486630290d36c4c0db544cb700eMark Andrews dns_zone_setchecknames(zone, severity);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews else
7e9d637131516486630290d36c4c0db544cb700eMark Andrews dns_zone_setchecknames(zone, dns_c_severity_fail);
7e9d637131516486630290d36c4c0db544cb700eMark Andrews#endif
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer break;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer }
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
bb48ac4f813537a060579615a52f9c7963f5e3c4Danny Mayer return (ISC_R_SUCCESS);
bb48ac4f813537a060579615a52f9c7963f5e3c4Danny Mayer}
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayerisc_boolean_t
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayerdns_zone_reusable(dns_zone_t *zone, dns_c_zone_t *czone)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer{
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer const char *cfilename;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer const char *zfilename;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (dns_zonetype_fromconf(czone->ztype) != dns_zone_gettype(zone))
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer return (ISC_FALSE);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer cfilename = NULL;
bb48ac4f813537a060579615a52f9c7963f5e3c4Danny Mayer (void) dns_c_zone_getfile(czone, &cfilename);
bb48ac4f813537a060579615a52f9c7963f5e3c4Danny Mayer zfilename = dns_zone_getdatabase(zone);
bb48ac4f813537a060579615a52f9c7963f5e3c4Danny Mayer if (cfilename == NULL || zfilename == NULL ||
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer strcmp(cfilename, zfilename) != 0)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer return (ISC_FALSE);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer /* XXX Compare masters, too. */
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer return (ISC_TRUE);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer}
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayerisc_result_t
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayerdns_zonemgr_configure(dns_c_ctx_t *cctx, dns_zonemgr_t *zmgr)
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer{
bb48ac4f813537a060579615a52f9c7963f5e3c4Danny Mayer isc_int32_t val;
bb48ac4f813537a060579615a52f9c7963f5e3c4Danny Mayer isc_result_t result;
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer result = dns_c_ctx_gettransfersin(cctx, &val);
e35c1bb3ecd9a6597360b9160b397c8053af69bfDanny Mayer if (result != ISC_R_SUCCESS)
32babe43eb479d2ae8736f9985a84d1b9d95a33aScott Mann val = 10;
32babe43eb479d2ae8736f9985a84d1b9d95a33aScott Mann dns_zonemgr_settransfersin(zmgr, val);
32babe43eb479d2ae8736f9985a84d1b9d95a33aScott Mann
32babe43eb479d2ae8736f9985a84d1b9d95a33aScott Mann return (ISC_R_SUCCESS);
32babe43eb479d2ae8736f9985a84d1b9d95a33aScott Mann}
32babe43eb479d2ae8736f9985a84d1b9d95a33aScott Mann
32babe43eb479d2ae8736f9985a84d1b9d95a33aScott Mann