zoneconf.c revision e82d19b0c77c8e408b3c1fb2e34488d4993f4b21
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews/*
1413616670fcb95b9ef236351502e4884ddca8bfTinderbox User * Copyright (C) 1999, 2000 Internet Software Consortium.
fcb54ce0a4f7377486df5bec83b3aa4711bf4131Mark 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
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * copyright notice and this permission notice appear in all copies.
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews *
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.
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews */
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
28a8f5b0de57d269cf2845c69cb6abe18cbd3b3aMark Andrews#include <config.h>
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein#include <isc/assertions.h>
0c310d16b05ee94743d33f6920907edee6084fc8Michael Graff#include <isc/error.h>
0c310d16b05ee94743d33f6920907edee6084fc8Michael Graff#include <isc/mem.h>
de153390f5a1f6d4fa86af91d4cae772d9846ca0Mark Andrews#include <isc/result.h>
0c310d16b05ee94743d33f6920907edee6084fc8Michael Graff
822f6cdabb1edd44472c7a758b5cae71376fa9beBrian Wellington#include <dns/aclconf.h>
ebfcb6cf66283096ebda1503b6cc042ce86b6bedBrian Wellington#include <dns/types.h>
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews#include <dns/zone.h>
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence#include <dns/zoneconf.h>
242bba8991b030b7764f0bdca3922d75c34ea51eAndreas Gustafsson#include <dns/ssu.h>
25a66b4e41e2b0a2af4840749bac80ae78c678bfMark Andrews
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence/* XXX copied from zone.c */
21f1794606dce19928cf455029e173321f166380Mark Andrews#define MAX_XFER_TIME (2*3600) /* Documented default is 2 hours. */
973a19342597823f111fce6a8cd5adfd0e2e7c0dMark Andrews#define DNS_DEFAULT_IDLEIN 3600 /* 1 hour */
0c310d16b05ee94743d33f6920907edee6084fc8Michael Graff#define DNS_DEFAULT_IDLEOUT 3600 /* 1 hour */
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence/*
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence * Convenience function for configuring a single zone ACL.
058e44186b74531402c1f99088eb9dbe4926f8daMark Andrews */
28b863e609ff2d97b78663b46894494cfa2ea411Mark Andrewsstatic isc_result_t
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrenceconfigure_zone_acl(dns_c_zone_t *czone, dns_c_ctx_t *cctx, dns_c_view_t *cview,
21825a8d005ccc2dfaf12889bf9eef3413555277Brian Wellington dns_aclconfctx_t *aclconfctx, dns_zone_t *zone,
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 isc_result_t (*getcacl)(dns_c_zone_t *, dns_c_ipmatchlist_t **),
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence isc_result_t (*getviewcacl)(dns_c_view_t *, dns_c_ipmatchlist_t **),
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews isc_result_t (*getglobalcacl)(dns_c_ctx_t *, dns_c_ipmatchlist_t **),
a98551ef592e9be6008e0141ceeb32efd586c5efMark Andrews void (*setzacl)(dns_zone_t *, dns_acl_t *),
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence void (*clearzacl)(dns_zone_t *))
a98551ef592e9be6008e0141ceeb32efd586c5efMark Andrews{
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence isc_result_t result;
54c26ab21c61c6d6b1e484bb88dc3ac263845d17Mark Andrews dns_c_ipmatchlist_t *cacl;
3ddd92da6651bc72aa79a04195ad389d86fd1a66Andreas Gustafsson dns_acl_t *dacl = NULL;
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson result = (*getcacl)(czone, &cacl);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson if (result == ISC_R_NOTFOUND && getviewcacl != NULL && cview != NULL) {
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews result = (*getviewcacl)(cview, &cacl);
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews }
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews if (result == ISC_R_NOTFOUND && getglobalcacl != NULL) {
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews result = (*getglobalcacl)(cctx, &cacl);
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews }
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews if (result == ISC_R_SUCCESS) {
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews result = dns_acl_fromconfig(cacl, cctx, aclconfctx,
c46f10e4a1702191b003cf8f8fc5059c15d29c48Mark Andrews dns_zone_getmctx(zone), &dacl);
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews dns_c_ipmatchlist_detach(&cacl);
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews if (result != ISC_R_SUCCESS)
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews return (result);
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews (*setzacl)(zone, dacl);
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews dns_acl_detach(&dacl);
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews return (ISC_R_SUCCESS);
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews } else if (result == ISC_R_NOTFOUND) {
eb6bd543c7d072efdca509eb17f8f301c1467b53Mark Andrews (*clearzacl)(zone);
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews return (ISC_R_SUCCESS);
c46f10e4a1702191b003cf8f8fc5059c15d29c48Mark Andrews } else {
c46f10e4a1702191b003cf8f8fc5059c15d29c48Mark Andrews return (result);
0b056755b2f423ba5f6adac8f7851d78f7d11437David Lawrence }
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence}
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrencestatic dns_zonetype_t
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrencedns_zonetype_fromconf(dns_c_zonetype_t cztype) {
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence switch (cztype) {
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence case dns_c_zone_master:
0b056755b2f423ba5f6adac8f7851d78f7d11437David Lawrence return dns_zone_master;
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence case dns_c_zone_forward:
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews return dns_zone_forward;
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence case dns_c_zone_slave:
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence return dns_zone_slave;
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence case dns_c_zone_stub:
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence return dns_zone_stub;
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence case dns_c_zone_hint:
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence return dns_zone_hint;
0b056755b2f423ba5f6adac8f7851d78f7d11437David Lawrence }
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence INSIST(0);
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence return (dns_zone_none); /*NOTREACHED*/
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence}
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrenceisc_result_t
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrencedns_zone_configure(dns_c_ctx_t *cctx, dns_c_view_t *cview,
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence dns_c_zone_t *czone, dns_aclconfctx_t *ac,
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence dns_zone_t *zone)
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence{
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence isc_result_t result;
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence isc_boolean_t boolean;
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews const char *filename = NULL;
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews#ifdef notyet
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews dns_c_severity_t severity;
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews#endif
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews dns_c_iplist_t *iplist = NULL;
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews isc_uint32_t i;
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein isc_sockaddr_t sockaddr;
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence isc_int32_t maxxfr;
0c8649cea98afc061dd2938fd315df53b8fc35caAndreas Gustafsson in_port_t port;
0c8649cea98afc061dd2938fd315df53b8fc35caAndreas Gustafsson struct in_addr in4addr_any;
0c8649cea98afc061dd2938fd315df53b8fc35caAndreas Gustafsson isc_sockaddr_t sockaddr_any4, sockaddr_any6;
0c8649cea98afc061dd2938fd315df53b8fc35caAndreas Gustafsson dns_ssutable_t *ssutable;
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein in4addr_any.s_addr = htonl(INADDR_ANY);
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein isc_sockaddr_fromin(&sockaddr_any4, &in4addr_any, 0);
e672951ed28b2e9cc7a19c3d7fa4a258382f981cAutomatic Updater isc_sockaddr_fromin6(&sockaddr_any6, &in6addr_any, 0);
0c8649cea98afc061dd2938fd315df53b8fc35caAndreas Gustafsson
0c8649cea98afc061dd2938fd315df53b8fc35caAndreas Gustafsson dns_zone_setclass(zone, czone->zclass);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence
2383eb527269d333df4222da20e4b422c3662daaEvan Hunt /* XXX needs to be an zone option */
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence result = dns_zone_setdbtype(zone, "rbt");
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence if (result != ISC_R_SUCCESS)
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence return (result);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence switch (czone->ztype) {
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence case dns_c_zone_master:
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence dns_zone_settype(zone, dns_zone_master);
9fe8cca06537c45375c1e1d36b82501caf0ae090Francis Dupont result = dns_c_zone_getfile(czone, &filename);
7712d1660a308ec3de17f1ddbbf801eb0d663f3eEvan Hunt if (result != ISC_R_SUCCESS)
9fe8cca06537c45375c1e1d36b82501caf0ae090Francis Dupont return (result);
9fe8cca06537c45375c1e1d36b82501caf0ae090Francis Dupont
7712d1660a308ec3de17f1ddbbf801eb0d663f3eEvan Hunt result = dns_zone_setdatabase(zone, filename);
9fe8cca06537c45375c1e1d36b82501caf0ae090Francis Dupont if (result != ISC_R_SUCCESS)
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence return (result);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence#ifdef notyet
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence result = dns_c_zone_getchecknames(czone, &severity);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence if (result == ISC_R_SUCCESS)
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence dns_zone_setchecknames(zone, severity);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence else
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence dns_zone_setchecknames(zone, dns_c_severity_fail);
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence#endif
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence result = configure_zone_acl(czone, cctx, NULL, ac, zone,
330705066b03f6ce0bc08a4bbfc5d2418038c68dBrian Wellington dns_c_zone_getallowupd,
330705066b03f6ce0bc08a4bbfc5d2418038c68dBrian Wellington NULL, NULL,
330705066b03f6ce0bc08a4bbfc5d2418038c68dBrian Wellington dns_zone_setupdateacl,
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence dns_zone_clearupdateacl);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence if (result != ISC_R_SUCCESS)
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence return (result);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence result = configure_zone_acl(czone, cctx, cview, ac, zone,
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence dns_c_zone_getallowquery,
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence dns_c_view_getallowquery,
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence dns_c_ctx_getallowquery,
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence dns_zone_setqueryacl,
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence dns_zone_clearqueryacl);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence if (result != ISC_R_SUCCESS)
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence return (result);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence result = configure_zone_acl(czone, cctx, cview, ac, zone,
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence dns_c_zone_getallowtransfer,
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence dns_c_view_gettransferacl,
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence dns_c_ctx_getallowtransfer,
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence dns_zone_setxfracl,
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence dns_zone_clearxfracl);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence if (result != ISC_R_SUCCESS)
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence return (result);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence result = dns_c_zone_getdialup(czone, &boolean);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence if (result == ISC_R_SUCCESS)
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence dns_zone_setoption(zone, DNS_ZONE_O_DIALUP, boolean);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence else
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence dns_zone_clearoption(zone, DNS_ZONE_O_DIALUP);
6098d364b690cb9dabf96e9664c4689c8559bd2eMark Andrews
6098d364b690cb9dabf96e9664c4689c8559bd2eMark Andrews result = dns_c_zone_getnotify(czone, &boolean);
6098d364b690cb9dabf96e9664c4689c8559bd2eMark Andrews if (result == ISC_R_SUCCESS)
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence dns_zone_setoption(zone, DNS_ZONE_O_NOTIFY, boolean);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence else
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence dns_zone_clearoption(zone, DNS_ZONE_O_NOTIFY);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence result = dns_c_zone_getalsonotify(czone, &iplist);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence if (result == ISC_R_SUCCESS) {
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence for (i = 0; i < iplist->nextidx; i++) {
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence result = dns_zone_addnotify(zone,
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence &iplist->ips[i]);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence if (result != ISC_R_SUCCESS)
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence return (result);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence }
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence } else
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence dns_zone_clearnotify(zone);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence result = dns_c_zone_getmaxtranstimeout(czone, &maxxfr);
76c8294c81fb48b1da6e1fc5b83322a4cedb8e58Andreas Gustafsson if (result != ISC_R_SUCCESS && cview != NULL)
76c8294c81fb48b1da6e1fc5b83322a4cedb8e58Andreas Gustafsson result = dns_c_view_getmaxtransfertimeout(cview, &maxxfr);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence if (result != ISC_R_SUCCESS)
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence result = dns_c_ctx_getmaxtransfertimeout(cctx, &maxxfr);
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence if (result != ISC_R_SUCCESS)
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence maxxfr = MAX_XFER_TIME;
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence dns_zone_setmaxxfrout(zone, maxxfr);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence
fd4810861c0c0ccb9aebde94e9d289442b2630dbMark Andrews result = dns_c_zone_getmaxtransidleout(czone, &maxxfr);
fd4810861c0c0ccb9aebde94e9d289442b2630dbMark Andrews if (result != ISC_R_SUCCESS)
fd4810861c0c0ccb9aebde94e9d289442b2630dbMark Andrews result = dns_c_ctx_getmaxtransferidleout(cctx, &maxxfr);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence if (result != ISC_R_SUCCESS && cview != NULL)
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence result = dns_c_view_getmaxtransferidleout(cview, &maxxfr);
8abddcd3f24476b945419659e7cb73bcb970886bDavid Lawrence if (result != ISC_R_SUCCESS)
7ab0e69f61e61e81d489c95c7ebd981e74e7ef16Andreas Gustafsson maxxfr = DNS_DEFAULT_IDLEOUT;
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews dns_zone_setidleout(zone, maxxfr);
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews ssutable = NULL;
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews result = dns_c_zone_getssuauth(czone, &ssutable);
c5223c9cb7c22620d5ee6611228673e95b48a270Mark Andrews if (result == ISC_R_SUCCESS) {
c5223c9cb7c22620d5ee6611228673e95b48a270Mark Andrews dns_ssutable_t *newssutable = NULL;
c5223c9cb7c22620d5ee6611228673e95b48a270Mark Andrews dns_ssutable_attach(ssutable, &newssutable);
c5223c9cb7c22620d5ee6611228673e95b48a270Mark Andrews dns_zone_setssutable(zone, newssutable);
6098d364b690cb9dabf96e9664c4689c8559bd2eMark Andrews }
6098d364b690cb9dabf96e9664c4689c8559bd2eMark Andrews
6098d364b690cb9dabf96e9664c4689c8559bd2eMark Andrews break;
fe3472c80b76b6fed0ae674fd63471d02477a03aMark Andrews
fe3472c80b76b6fed0ae674fd63471d02477a03aMark Andrews case dns_c_zone_forward:
fe3472c80b76b6fed0ae674fd63471d02477a03aMark Andrews#ifdef notyet
fe3472c80b76b6fed0ae674fd63471d02477a03aMark Andrews /*
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews * forward zones are still in a state of flux
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews */
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews czone->u.fzone.check_names; /* XXX unused in BIND 8 */
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews czone->u.fzone.forward; /* XXX*/
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews czone->u.fzone.forwarders; /* XXX*/
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews#endif
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews break;
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews case dns_c_zone_slave:
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews dns_zone_settype(zone, dns_zone_slave);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews result = dns_c_zone_getfile(czone, &filename);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews if (result != ISC_R_SUCCESS)
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews return (result);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews result = dns_zone_setdatabase(zone, filename);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews if (result != ISC_R_SUCCESS)
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews return (result);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews#ifdef notyet
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews result = dns_c_zone_getchecknames(czone, &severity);
6a528eaa09b6eed63144250dc61062f3a84880abMark Andrews if (result == ISC_R_SUCCESS)
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews dns_zone_setchecknames(zone, severity);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews else
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews dns_zone_setchecknames(zone, dns_c_severity_warn);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews#endif
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews result = configure_zone_acl(czone, cctx, cview, ac, zone,
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews dns_c_zone_getallowquery,
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews dns_c_view_getallowquery,
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews dns_c_ctx_getallowquery,
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews dns_zone_setqueryacl,
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews dns_zone_clearqueryacl);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews if (result != ISC_R_SUCCESS)
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews return (result);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews result = dns_c_zone_getmasterport(czone, &port);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews if (result != ISC_R_SUCCESS)
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews port = 53;
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews dns_zone_setmasterport(zone, port);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews result = dns_c_zone_getmasterips(czone, &iplist);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews if (result == ISC_R_SUCCESS) {
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews for (i = 0; i < iplist->nextidx; i++) {
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews result = dns_zone_addmaster(zone,
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews &iplist->ips[i]);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews if (result != ISC_R_SUCCESS)
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews return (result);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews }
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews } else
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews dns_zone_clearmasters(zone);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews result = dns_c_zone_getmaxtranstimein(czone, &maxxfr);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews if (result != ISC_R_SUCCESS)
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews result = dns_c_ctx_getmaxtransfertimein(cctx, &maxxfr);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews if (result != ISC_R_SUCCESS)
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews maxxfr = MAX_XFER_TIME;
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews dns_zone_setmaxxfrin(zone, maxxfr);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews result = dns_c_zone_getmaxtransidlein(czone, &maxxfr);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews if (result != ISC_R_SUCCESS)
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews result = dns_c_ctx_getmaxtransferidlein(cctx, &maxxfr);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews if (result != ISC_R_SUCCESS)
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews maxxfr = DNS_DEFAULT_IDLEIN;
e851ea826066ac5a5b01c2c23218faa0273a12e8Evan Hunt dns_zone_setidlein(zone, maxxfr);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews result = dns_c_zone_gettransfersource(czone, &sockaddr);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews if (result != ISC_R_SUCCESS && cview != NULL)
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews result = dns_c_view_gettransfersource(cview, &sockaddr);
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews if (result != ISC_R_SUCCESS)
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews result = dns_c_ctx_gettransfersource(cctx, &sockaddr);
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews if (result != ISC_R_SUCCESS)
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews sockaddr = sockaddr_any4;
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews dns_zone_setxfrsource4(zone, &sockaddr);
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews result = dns_c_zone_gettransfersourcev6(czone, &sockaddr);
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews if (result != ISC_R_SUCCESS && cview != NULL)
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews result = dns_c_view_gettransfersourcev6(cview, &sockaddr);
23cb957a81a51a9656917ea98d0ae56b7abdcaccMark Andrews if (result != ISC_R_SUCCESS)
b6a0341bcb113e93bd0bc41a9f9a1fc117444da6Mark Andrews result = dns_c_ctx_gettransfersourcev6(cctx, &sockaddr);
b6a0341bcb113e93bd0bc41a9f9a1fc117444da6Mark Andrews if (result != ISC_R_SUCCESS)
aa05bbdef7f7827dde158dcc913f4dade84c8511Brian Wellington sockaddr = sockaddr_any6;
23cb957a81a51a9656917ea98d0ae56b7abdcaccMark Andrews dns_zone_setxfrsource6(zone, &sockaddr);
23cb957a81a51a9656917ea98d0ae56b7abdcaccMark Andrews
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews result = dns_c_zone_getmaxtranstimeout(czone, &maxxfr);
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews if (result != ISC_R_SUCCESS && cview != NULL)
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews result = dns_c_view_getmaxtransfertimeout(cview, &maxxfr);
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews if (result != ISC_R_SUCCESS)
2002be4f65776451676df6ee21a2e28f52bcad6dMark Andrews result = dns_c_ctx_getmaxtransfertimeout(cctx, &maxxfr);
2002be4f65776451676df6ee21a2e28f52bcad6dMark Andrews if (result != ISC_R_SUCCESS)
2002be4f65776451676df6ee21a2e28f52bcad6dMark Andrews maxxfr = MAX_XFER_TIME;
2002be4f65776451676df6ee21a2e28f52bcad6dMark Andrews dns_zone_setmaxxfrout(zone, maxxfr);
78838d3e0cd62423c23de5503910e01884d2104bBrian Wellington
2002be4f65776451676df6ee21a2e28f52bcad6dMark Andrews result = dns_c_zone_getmaxtransidleout(czone, &maxxfr);
2002be4f65776451676df6ee21a2e28f52bcad6dMark Andrews if (result != ISC_R_SUCCESS)
2002be4f65776451676df6ee21a2e28f52bcad6dMark Andrews result = dns_c_ctx_getmaxtransferidleout(cctx, &maxxfr);
2002be4f65776451676df6ee21a2e28f52bcad6dMark Andrews if (result != ISC_R_SUCCESS && cview != NULL)
2002be4f65776451676df6ee21a2e28f52bcad6dMark Andrews result = dns_c_view_getmaxtransferidleout(cview, &maxxfr);
2002be4f65776451676df6ee21a2e28f52bcad6dMark Andrews if (result != ISC_R_SUCCESS)
d4422ec231e58b60693620cf298276e47f04f0ecMark Andrews maxxfr = DNS_DEFAULT_IDLEOUT;
2002be4f65776451676df6ee21a2e28f52bcad6dMark Andrews dns_zone_setidleout(zone, maxxfr);
2002be4f65776451676df6ee21a2e28f52bcad6dMark Andrews
2002be4f65776451676df6ee21a2e28f52bcad6dMark Andrews break;
d4422ec231e58b60693620cf298276e47f04f0ecMark Andrews
d4422ec231e58b60693620cf298276e47f04f0ecMark Andrews case dns_c_zone_stub:
d4422ec231e58b60693620cf298276e47f04f0ecMark Andrews dns_zone_settype(zone, dns_zone_stub);
f6407f9a0b890bebbfd5f738d9c4aef3d3315fe9Michael Graff result = dns_c_zone_getfile(czone, &filename);
d4422ec231e58b60693620cf298276e47f04f0ecMark Andrews if (result != ISC_R_SUCCESS)
2002be4f65776451676df6ee21a2e28f52bcad6dMark Andrews return (result);
2002be4f65776451676df6ee21a2e28f52bcad6dMark Andrews result = dns_zone_setdatabase(zone, filename);
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews if (result != ISC_R_SUCCESS)
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews return (result);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews#ifdef notyet
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews result = dns_c_zone_getchecknames(czone, &severity);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews if (result == ISC_R_SUCCESS)
bed8e84810a80dad3d37870be927d1dfd015f480Mark Andrews dns_zone_setchecknames(zone, severity);
bed8e84810a80dad3d37870be927d1dfd015f480Mark Andrews else
bed8e84810a80dad3d37870be927d1dfd015f480Mark Andrews dns_zone_setchecknames(zone, dns_c_severity_warn);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews#endif
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews result = configure_zone_acl(czone, cctx, cview, ac, zone,
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews dns_c_zone_getallowquery,
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews dns_c_view_getallowquery,
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews dns_c_ctx_getallowquery,
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews dns_zone_setqueryacl,
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews dns_zone_clearqueryacl);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews if (result != ISC_R_SUCCESS)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews return (result);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews result = dns_c_zone_getmasterport(czone, &port);
d981ca645597116d227a48bf37cc5edc061c854dBob Halley if (result != ISC_R_SUCCESS)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews port = 53;
e6bd97dded968f82e26b270842b789bff7bca422Mark Andrews dns_zone_setmasterport(zone, port);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews result = dns_c_zone_getmasterips(czone, &iplist);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews if (result == ISC_R_SUCCESS) {
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews for (i = 0; i < iplist->nextidx; i++) {
389c749a5ee18f1c0d6278ae49f2aae5d5f0d2dcMark Andrews result = dns_zone_addmaster(zone,
368b37b616234fce3d23099eb180f1dd38e1fb62Mark Andrews &iplist->ips[i]);
389c749a5ee18f1c0d6278ae49f2aae5d5f0d2dcMark Andrews if (result != ISC_R_SUCCESS)
cabaeca9ae5b98c80586b91e89cf552e17a75a9bBrian Wellington return (result);
cabaeca9ae5b98c80586b91e89cf552e17a75a9bBrian Wellington }
389c749a5ee18f1c0d6278ae49f2aae5d5f0d2dcMark Andrews } else
c03bb27f0675a6e60ceea66b451548e8481bc05cMark Andrews dns_zone_clearmasters(zone);
389c749a5ee18f1c0d6278ae49f2aae5d5f0d2dcMark Andrews
389c749a5ee18f1c0d6278ae49f2aae5d5f0d2dcMark Andrews result = dns_c_zone_getmaxtranstimein(czone, &maxxfr);
389c749a5ee18f1c0d6278ae49f2aae5d5f0d2dcMark Andrews if (result != ISC_R_SUCCESS)
389c749a5ee18f1c0d6278ae49f2aae5d5f0d2dcMark Andrews result = dns_c_ctx_getmaxtransfertimein(cctx, &maxxfr);
389c749a5ee18f1c0d6278ae49f2aae5d5f0d2dcMark Andrews if (result != ISC_R_SUCCESS)
389c749a5ee18f1c0d6278ae49f2aae5d5f0d2dcMark Andrews maxxfr = MAX_XFER_TIME;
389c749a5ee18f1c0d6278ae49f2aae5d5f0d2dcMark Andrews dns_zone_setmaxxfrin(zone, maxxfr);
389c749a5ee18f1c0d6278ae49f2aae5d5f0d2dcMark Andrews
c03bb27f0675a6e60ceea66b451548e8481bc05cMark Andrews result = dns_c_zone_getmaxtransidlein(czone, &maxxfr);
c03bb27f0675a6e60ceea66b451548e8481bc05cMark Andrews if (result != ISC_R_SUCCESS)
c03bb27f0675a6e60ceea66b451548e8481bc05cMark Andrews result = dns_c_ctx_getmaxtransferidlein(cctx, &maxxfr);
c03bb27f0675a6e60ceea66b451548e8481bc05cMark Andrews if (result != ISC_R_SUCCESS)
29c818c7d40fc8898b062903ec703851328a4deaMark Andrews maxxfr = DNS_DEFAULT_IDLEIN;
c03bb27f0675a6e60ceea66b451548e8481bc05cMark Andrews dns_zone_setidlein(zone, maxxfr);
c03bb27f0675a6e60ceea66b451548e8481bc05cMark Andrews
cabaeca9ae5b98c80586b91e89cf552e17a75a9bBrian Wellington result = dns_c_zone_gettransfersource(czone, &sockaddr);
cabaeca9ae5b98c80586b91e89cf552e17a75a9bBrian Wellington if (result != ISC_R_SUCCESS && cview != NULL)
cabaeca9ae5b98c80586b91e89cf552e17a75a9bBrian Wellington result = dns_c_view_gettransfersource(cview, &sockaddr);
f1cae4bcb7ee3060d893f5ab3ba55c1820bf3e4aBrian Wellington if (result != ISC_R_SUCCESS)
c03bb27f0675a6e60ceea66b451548e8481bc05cMark Andrews result = dns_c_ctx_gettransfersource(cctx, &sockaddr);
c03bb27f0675a6e60ceea66b451548e8481bc05cMark Andrews if (result != ISC_R_SUCCESS)
c03bb27f0675a6e60ceea66b451548e8481bc05cMark Andrews sockaddr = sockaddr_any4;
c03bb27f0675a6e60ceea66b451548e8481bc05cMark Andrews dns_zone_setxfrsource4(zone, &sockaddr);
29c818c7d40fc8898b062903ec703851328a4deaMark Andrews
29c818c7d40fc8898b062903ec703851328a4deaMark Andrews result = dns_c_zone_gettransfersourcev6(czone, &sockaddr);
29c818c7d40fc8898b062903ec703851328a4deaMark Andrews if (result != ISC_R_SUCCESS && cview != NULL)
29c818c7d40fc8898b062903ec703851328a4deaMark Andrews result = dns_c_view_gettransfersourcev6(cview, &sockaddr);
29c818c7d40fc8898b062903ec703851328a4deaMark Andrews if (result != ISC_R_SUCCESS)
29c818c7d40fc8898b062903ec703851328a4deaMark Andrews result = dns_c_ctx_gettransfersourcev6(cctx, &sockaddr);
29c818c7d40fc8898b062903ec703851328a4deaMark Andrews if (result != ISC_R_SUCCESS)
29c818c7d40fc8898b062903ec703851328a4deaMark Andrews sockaddr = sockaddr_any6;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews dns_zone_setxfrsource6(zone, &sockaddr);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews case dns_c_zone_hint:
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews dns_zone_settype(zone, dns_zone_hint);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews result = dns_c_zone_getfile(czone, &filename);
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence if (result != ISC_R_SUCCESS)
3d5cad69ec20157912e95cf3b79316dfb0a314f3Mark Andrews return (result);
3d5cad69ec20157912e95cf3b79316dfb0a314f3Mark Andrews result = dns_zone_setdatabase(zone, filename);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews if (result != ISC_R_SUCCESS)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews return (result);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews#ifdef notyet
735ca24fa61ad9cd0285776c2fc4c14032f8f194Mark Andrews result = dns_c_zone_getchecknames(czone, &severity);
735ca24fa61ad9cd0285776c2fc4c14032f8f194Mark Andrews if (result == ISC_R_SUCCESS)
c03bb27f0675a6e60ceea66b451548e8481bc05cMark Andrews dns_zone_setchecknames(zone, severity);
c03bb27f0675a6e60ceea66b451548e8481bc05cMark Andrews else
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews dns_zone_setchecknames(zone, dns_c_severity_fail);
d981ca645597116d227a48bf37cc5edc061c854dBob Halley#endif
d981ca645597116d227a48bf37cc5edc061c854dBob Halley break;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews }
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews return (ISC_R_SUCCESS);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews}
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
3d5cad69ec20157912e95cf3b79316dfb0a314f3Mark Andrewsisc_boolean_t
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrewsdns_zone_reusable(dns_zone_t *zone, dns_c_zone_t *czone)
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews{
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews const char *cfilename;
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews const char *zfilename;
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews
90e303b114e56db5809fdd19805243457fa43cd9Olafur Gudmundsson if (dns_zonetype_fromconf(czone->ztype) != dns_zone_gettype(zone))
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews return (ISC_FALSE);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews cfilename = NULL;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews (void) dns_c_zone_getfile(czone, &cfilename);
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews zfilename = dns_zone_getdatabase(zone);
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews if (cfilename == NULL || zfilename == NULL ||
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews strcmp(cfilename, zfilename) != 0)
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews return (ISC_FALSE);
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews /* XXX Compare masters, too. */
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews
735ca24fa61ad9cd0285776c2fc4c14032f8f194Mark Andrews return (ISC_TRUE);
735ca24fa61ad9cd0285776c2fc4c14032f8f194Mark Andrews}
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrewsisc_result_t
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrewsdns_zonemgr_configure(dns_c_ctx_t *cctx, dns_zonemgr_t *zmgr)
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews{
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews isc_int32_t val;
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews isc_result_t result;
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews result = dns_c_ctx_gettransfersin(cctx, &val);
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews if (result != ISC_R_SUCCESS)
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews val = 10;
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews dns_zonemgr_settransfersin(zmgr, val);
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews return (ISC_R_SUCCESS);
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews}
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews