1999-12-16 23:11:07 +00:00
|
|
|
/*
|
2000-02-03 23:50:32 +00:00
|
|
|
* Copyright (C) 1999, 2000 Internet Software Consortium.
|
1999-12-16 23:11:07 +00:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
2000-07-27 09:55:03 +00:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
|
|
|
|
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
|
|
|
|
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
|
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
|
|
|
|
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
|
|
|
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
|
|
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
1999-12-16 23:11:07 +00:00
|
|
|
*/
|
|
|
|
|
2000-07-31 19:36:48 +00:00
|
|
|
/* $Id: zoneconf.c,v 1.50 2000/07/31 19:36:48 explorer Exp $ */
|
2000-06-22 22:00:42 +00:00
|
|
|
|
1999-12-16 23:11:07 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2000-05-08 19:23:32 +00:00
|
|
|
#include <isc/string.h> /* Required for HP/UX (and others?) */
|
2000-04-28 01:12:23 +00:00
|
|
|
#include <isc/util.h>
|
1999-12-16 23:11:07 +00:00
|
|
|
|
2000-05-08 14:38:29 +00:00
|
|
|
#include <dns/acl.h>
|
1999-12-16 23:11:07 +00:00
|
|
|
#include <dns/zone.h>
|
|
|
|
#include <dns/zoneconf.h>
|
2000-03-06 19:06:07 +00:00
|
|
|
#include <dns/ssu.h>
|
1999-12-16 23:11:07 +00:00
|
|
|
|
2000-05-25 19:27:48 +00:00
|
|
|
/*
|
|
|
|
* These are BIND9 server defaults, not necessarily identical to the
|
|
|
|
* library defaults defined in zone.c.
|
|
|
|
*/
|
1999-12-16 23:11:07 +00:00
|
|
|
#define MAX_XFER_TIME (2*3600) /* Documented default is 2 hours. */
|
2000-01-31 19:53:14 +00:00
|
|
|
#define DNS_DEFAULT_IDLEIN 3600 /* 1 hour */
|
|
|
|
#define DNS_DEFAULT_IDLEOUT 3600 /* 1 hour */
|
1999-12-16 23:11:07 +00:00
|
|
|
|
2000-05-25 19:27:48 +00:00
|
|
|
#define RETERR(x) do { \
|
|
|
|
isc_result_t _r = (x); \
|
|
|
|
if (_r != ISC_R_SUCCESS) \
|
|
|
|
return (_r); \
|
|
|
|
} while (0)
|
|
|
|
|
1999-12-16 23:11:07 +00:00
|
|
|
/*
|
|
|
|
* Convenience function for configuring a single zone ACL.
|
|
|
|
*/
|
|
|
|
static isc_result_t
|
2000-04-06 23:59:19 +00:00
|
|
|
configure_zone_acl(dns_c_zone_t *czone, dns_c_ctx_t *cctx, dns_c_view_t *cview,
|
1999-12-16 23:11:07 +00:00
|
|
|
dns_aclconfctx_t *aclconfctx, dns_zone_t *zone,
|
2000-05-08 14:38:29 +00:00
|
|
|
isc_result_t (*getcacl)(dns_c_zone_t *,
|
|
|
|
dns_c_ipmatchlist_t **),
|
|
|
|
isc_result_t (*getviewcacl)(dns_c_view_t *
|
|
|
|
, dns_c_ipmatchlist_t **),
|
|
|
|
isc_result_t (*getglobalcacl)(dns_c_ctx_t *,
|
|
|
|
dns_c_ipmatchlist_t **),
|
1999-12-16 23:11:07 +00:00
|
|
|
void (*setzacl)(dns_zone_t *, dns_acl_t *),
|
|
|
|
void (*clearzacl)(dns_zone_t *))
|
|
|
|
{
|
|
|
|
isc_result_t result;
|
|
|
|
dns_c_ipmatchlist_t *cacl;
|
|
|
|
dns_acl_t *dacl = NULL;
|
|
|
|
result = (*getcacl)(czone, &cacl);
|
2000-04-07 00:51:32 +00:00
|
|
|
if (result == ISC_R_NOTFOUND && getviewcacl != NULL && cview != NULL) {
|
2000-04-06 23:59:19 +00:00
|
|
|
result = (*getviewcacl)(cview, &cacl);
|
|
|
|
}
|
|
|
|
if (result == ISC_R_NOTFOUND && getglobalcacl != NULL) {
|
|
|
|
result = (*getglobalcacl)(cctx, &cacl);
|
2000-02-22 21:24:24 +00:00
|
|
|
}
|
1999-12-16 23:11:07 +00:00
|
|
|
if (result == ISC_R_SUCCESS) {
|
|
|
|
result = dns_acl_fromconfig(cacl, cctx, aclconfctx,
|
|
|
|
dns_zone_getmctx(zone), &dacl);
|
|
|
|
dns_c_ipmatchlist_detach(&cacl);
|
2000-04-06 22:03:35 +00:00
|
|
|
if (result != ISC_R_SUCCESS)
|
1999-12-16 23:11:07 +00:00
|
|
|
return (result);
|
|
|
|
(*setzacl)(zone, dacl);
|
|
|
|
dns_acl_detach(&dacl);
|
|
|
|
return (ISC_R_SUCCESS);
|
|
|
|
} else if (result == ISC_R_NOTFOUND) {
|
|
|
|
(*clearzacl)(zone);
|
|
|
|
return (ISC_R_SUCCESS);
|
|
|
|
} else {
|
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-05-25 19:27:48 +00:00
|
|
|
/*
|
|
|
|
* Conver a config file zone type into a server zone type.
|
|
|
|
*/
|
2000-01-21 19:22:35 +00:00
|
|
|
static dns_zonetype_t
|
|
|
|
dns_zonetype_fromconf(dns_c_zonetype_t cztype) {
|
|
|
|
switch (cztype) {
|
|
|
|
case dns_c_zone_master:
|
|
|
|
return dns_zone_master;
|
|
|
|
case dns_c_zone_slave:
|
|
|
|
return dns_zone_slave;
|
|
|
|
case dns_c_zone_stub:
|
|
|
|
return dns_zone_stub;
|
2000-05-25 19:27:48 +00:00
|
|
|
default:
|
|
|
|
/*
|
|
|
|
* Hint and forward zones are not really zones;
|
|
|
|
* they should never get this far.
|
|
|
|
*/
|
|
|
|
INSIST(0);
|
|
|
|
return (dns_zone_none); /*NOTREACHED*/
|
2000-01-21 19:22:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-12-23 00:09:04 +00:00
|
|
|
isc_result_t
|
2000-07-31 19:36:48 +00:00
|
|
|
dns_zone_configure(dns_c_ctx_t *cctx, dns_c_view_t *cview,
|
|
|
|
dns_c_zone_t *czone, dns_aclconfctx_t *ac,
|
2000-04-06 23:59:19 +00:00
|
|
|
dns_zone_t *zone)
|
1999-12-16 23:11:07 +00:00
|
|
|
{
|
|
|
|
isc_result_t result;
|
|
|
|
isc_boolean_t boolean;
|
|
|
|
const char *filename = NULL;
|
2000-07-24 22:59:44 +00:00
|
|
|
dns_notifytype_t notifytype;
|
2000-01-27 19:44:49 +00:00
|
|
|
#ifdef notyet
|
1999-12-16 23:11:07 +00:00
|
|
|
dns_c_severity_t severity;
|
2000-01-27 19:44:49 +00:00
|
|
|
#endif
|
2000-06-01 00:41:23 +00:00
|
|
|
dns_c_iplist_t *iplist;
|
1999-12-16 23:11:07 +00:00
|
|
|
isc_sockaddr_t sockaddr;
|
2000-06-02 17:31:43 +00:00
|
|
|
isc_uint32_t uintval;
|
2000-02-09 19:04:26 +00:00
|
|
|
isc_sockaddr_t sockaddr_any4, sockaddr_any6;
|
2000-05-25 19:27:48 +00:00
|
|
|
dns_ssutable_t *ssutable = NULL;
|
2000-01-31 15:09:09 +00:00
|
|
|
|
2000-07-31 19:36:48 +00:00
|
|
|
isc_sockaddr_any(&sockaddr_any4);
|
2000-05-25 05:13:19 +00:00
|
|
|
isc_sockaddr_any6(&sockaddr_any6);
|
2000-07-31 19:36:48 +00:00
|
|
|
|
2000-05-25 19:27:48 +00:00
|
|
|
/*
|
|
|
|
* Configure values common to all zone types.
|
|
|
|
*/
|
1999-12-16 23:11:07 +00:00
|
|
|
|
2000-05-25 19:27:48 +00:00
|
|
|
dns_zone_setclass(zone, czone->zclass);
|
1999-12-16 23:11:07 +00:00
|
|
|
|
2000-05-25 19:27:48 +00:00
|
|
|
dns_zone_settype(zone, dns_zonetype_fromconf(czone->ztype));
|
1999-12-16 23:11:07 +00:00
|
|
|
|
2000-05-25 19:27:48 +00:00
|
|
|
/* XXX needs to be an zone option */
|
|
|
|
RETERR(dns_zone_setdbtype(zone, "rbt"));
|
1999-12-16 23:11:07 +00:00
|
|
|
|
2000-06-05 03:44:17 +00:00
|
|
|
result = dns_c_zone_getfile(czone, &filename);
|
|
|
|
if (result == ISC_R_SUCCESS)
|
|
|
|
RETERR(dns_zone_setdatabase(zone, filename));
|
|
|
|
else if (czone->ztype != dns_c_zone_slave &&
|
|
|
|
czone->ztype != dns_c_zone_stub)
|
|
|
|
return (result);
|
1999-12-16 23:11:07 +00:00
|
|
|
|
2000-04-21 00:18:23 +00:00
|
|
|
#ifdef notyet
|
2000-05-25 19:27:48 +00:00
|
|
|
result = dns_c_zone_getchecknames(czone, &severity);
|
|
|
|
if (result == ISC_R_SUCCESS)
|
|
|
|
dns_zone_setchecknames(zone, severity);
|
|
|
|
else
|
|
|
|
dns_zone_setchecknames(zone, dns_c_severity_warn);
|
2000-04-21 00:18:23 +00:00
|
|
|
#endif
|
1999-12-16 23:11:07 +00:00
|
|
|
|
2000-05-25 19:27:48 +00:00
|
|
|
/*
|
|
|
|
* XXXAG This probably does not make sense for stubs.
|
|
|
|
*/
|
|
|
|
RETERR(configure_zone_acl(czone, cctx, cview, ac, zone,
|
|
|
|
dns_c_zone_getallowquery,
|
|
|
|
dns_c_view_getallowquery,
|
|
|
|
dns_c_ctx_getallowquery,
|
|
|
|
dns_zone_setqueryacl,
|
|
|
|
dns_zone_clearqueryacl));
|
|
|
|
|
|
|
|
result = dns_c_zone_getdialup(czone, &boolean);
|
|
|
|
if (result != ISC_R_SUCCESS)
|
|
|
|
result = dns_c_ctx_getdialup(cctx, &boolean);
|
|
|
|
if (result != ISC_R_SUCCESS)
|
|
|
|
boolean = ISC_FALSE;
|
2000-06-09 06:16:21 +00:00
|
|
|
dns_zone_setoption(zone, DNS_ZONEOPT_DIALUP, boolean);
|
2000-05-25 19:27:48 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Configure master functionality. This applies
|
|
|
|
* to primary masters (type "master") and slaves
|
|
|
|
* acting as masters (type "slave"), but not to stubs.
|
|
|
|
*/
|
|
|
|
if (czone->ztype != dns_c_zone_stub) {
|
2000-07-24 22:59:44 +00:00
|
|
|
result = dns_c_zone_getnotify(czone, ¬ifytype);
|
2000-04-21 00:18:23 +00:00
|
|
|
if (result != ISC_R_SUCCESS && cview != NULL)
|
2000-07-24 22:59:44 +00:00
|
|
|
result = dns_c_view_getnotify(cview, ¬ifytype);
|
2000-04-21 00:18:23 +00:00
|
|
|
if (result != ISC_R_SUCCESS)
|
2000-07-24 22:59:44 +00:00
|
|
|
result = dns_c_ctx_getnotify(cctx, ¬ifytype);
|
2000-04-21 00:18:23 +00:00
|
|
|
if (result != ISC_R_SUCCESS)
|
2000-07-24 22:59:44 +00:00
|
|
|
notifytype = dns_notifytype_yes;
|
|
|
|
dns_zone_setnotifytype(zone, notifytype);
|
1999-12-16 23:11:07 +00:00
|
|
|
|
2000-06-01 00:41:23 +00:00
|
|
|
iplist = NULL;
|
1999-12-16 23:11:07 +00:00
|
|
|
result = dns_c_zone_getalsonotify(czone, &iplist);
|
2000-06-01 00:41:23 +00:00
|
|
|
if (result != ISC_R_SUCCESS && cview != NULL)
|
|
|
|
result = dns_c_view_getalsonotify(cview, &iplist);
|
|
|
|
if (result != ISC_R_SUCCESS)
|
|
|
|
result = dns_c_ctx_getalsonotify(cctx, &iplist);
|
2000-07-25 20:26:11 +00:00
|
|
|
if (result == ISC_R_SUCCESS) {
|
|
|
|
result = dns_zone_setalsonotify(zone, iplist->ips,
|
|
|
|
iplist->nextidx);
|
|
|
|
dns_c_iplist_detach(&iplist);
|
|
|
|
if (result != ISC_R_SUCCESS)
|
|
|
|
return (result);
|
|
|
|
|
|
|
|
} else
|
2000-05-25 19:27:48 +00:00
|
|
|
RETERR(dns_zone_setalsonotify(zone, NULL, 0));
|
|
|
|
|
|
|
|
RETERR(configure_zone_acl(czone, cctx, cview, ac, zone,
|
|
|
|
dns_c_zone_getallowtransfer,
|
|
|
|
dns_c_view_gettransferacl,
|
|
|
|
dns_c_ctx_getallowtransfer,
|
|
|
|
dns_zone_setxfracl,
|
|
|
|
dns_zone_clearxfracl));
|
1999-12-16 23:11:07 +00:00
|
|
|
|
2000-06-05 09:17:14 +00:00
|
|
|
result = dns_c_zone_getmaxtranstimeout(czone, &uintval);
|
2000-04-07 18:16:02 +00:00
|
|
|
if (result != ISC_R_SUCCESS && cview != NULL)
|
2000-05-08 14:38:29 +00:00
|
|
|
result = dns_c_view_getmaxtransfertimeout(cview,
|
2000-06-05 09:17:14 +00:00
|
|
|
&uintval);
|
2000-04-07 18:16:02 +00:00
|
|
|
if (result != ISC_R_SUCCESS)
|
2000-05-08 14:38:29 +00:00
|
|
|
result = dns_c_ctx_getmaxtransfertimeout(cctx,
|
2000-06-05 09:17:14 +00:00
|
|
|
&uintval);
|
2000-04-07 18:16:02 +00:00
|
|
|
if (result != ISC_R_SUCCESS)
|
2000-06-05 09:17:14 +00:00
|
|
|
uintval = MAX_XFER_TIME;
|
|
|
|
dns_zone_setmaxxfrout(zone, uintval);
|
1999-12-16 23:11:07 +00:00
|
|
|
|
2000-06-05 09:17:14 +00:00
|
|
|
result = dns_c_zone_getmaxtransidleout(czone, &uintval);
|
2000-04-07 18:16:02 +00:00
|
|
|
if (result != ISC_R_SUCCESS && cview != NULL)
|
2000-05-08 14:38:29 +00:00
|
|
|
result = dns_c_view_getmaxtransferidleout(cview,
|
2000-06-05 09:17:14 +00:00
|
|
|
&uintval);
|
2000-04-21 00:20:22 +00:00
|
|
|
if (result != ISC_R_SUCCESS)
|
2000-05-08 14:38:29 +00:00
|
|
|
result = dns_c_ctx_getmaxtransferidleout(cctx,
|
2000-06-05 09:17:14 +00:00
|
|
|
&uintval);
|
2000-04-07 18:16:02 +00:00
|
|
|
if (result != ISC_R_SUCCESS)
|
2000-06-05 09:17:14 +00:00
|
|
|
uintval = DNS_DEFAULT_IDLEOUT;
|
|
|
|
dns_zone_setidleout(zone, uintval);
|
2000-05-25 19:27:48 +00:00
|
|
|
}
|
1999-12-16 23:11:07 +00:00
|
|
|
|
2000-05-25 19:27:48 +00:00
|
|
|
/*
|
|
|
|
* Configure update-related options. These apply to
|
|
|
|
* primary masters only.
|
|
|
|
*/
|
|
|
|
if (czone->ztype == dns_c_zone_master) {
|
|
|
|
RETERR(configure_zone_acl(czone, cctx, NULL, ac, zone,
|
|
|
|
dns_c_zone_getallowupd,
|
|
|
|
NULL, NULL,
|
|
|
|
dns_zone_setupdateacl,
|
|
|
|
dns_zone_clearupdateacl));
|
|
|
|
|
2000-05-26 00:48:59 +00:00
|
|
|
dns_zone_getssutable(zone, &ssutable);
|
|
|
|
if (ssutable != NULL)
|
|
|
|
dns_ssutable_detach(&ssutable);
|
2000-03-06 19:06:07 +00:00
|
|
|
result = dns_c_zone_getssuauth(czone, &ssutable);
|
|
|
|
if (result == ISC_R_SUCCESS) {
|
|
|
|
dns_ssutable_t *newssutable = NULL;
|
|
|
|
dns_ssutable_attach(ssutable, &newssutable);
|
|
|
|
dns_zone_setssutable(zone, newssutable);
|
|
|
|
}
|
2000-06-02 17:31:43 +00:00
|
|
|
|
|
|
|
result = dns_c_zone_getsigvalidityinterval(czone, &uintval);
|
|
|
|
if (result != ISC_R_SUCCESS && cview != NULL)
|
|
|
|
result = dns_c_view_getsigvalidityinterval(cview,
|
|
|
|
&uintval);
|
|
|
|
if (result != ISC_R_SUCCESS)
|
|
|
|
result = dns_c_ctx_getsigvalidityinterval(cctx,
|
|
|
|
&uintval);
|
|
|
|
if (result != ISC_R_SUCCESS)
|
|
|
|
uintval = 30 * 24 * 3600;
|
|
|
|
dns_zone_setsigvalidityinterval(zone, uintval);
|
2000-05-25 19:27:48 +00:00
|
|
|
}
|
2000-03-06 19:06:07 +00:00
|
|
|
|
2000-05-25 19:27:48 +00:00
|
|
|
/*
|
|
|
|
* Configure slave functionality.
|
|
|
|
*/
|
|
|
|
switch (czone->ztype) {
|
1999-12-16 23:11:07 +00:00
|
|
|
case dns_c_zone_slave:
|
|
|
|
case dns_c_zone_stub:
|
2000-06-01 00:41:23 +00:00
|
|
|
iplist = NULL;
|
1999-12-16 23:11:07 +00:00
|
|
|
result = dns_c_zone_getmasterips(czone, &iplist);
|
2000-04-28 00:58:42 +00:00
|
|
|
if (result == ISC_R_SUCCESS)
|
2000-07-26 18:47:43 +00:00
|
|
|
#ifndef NOMINUM_PUBLIC
|
2000-07-21 18:47:23 +00:00
|
|
|
result = dns_zone_setmasterswithkeys(zone,
|
|
|
|
iplist->ips,
|
|
|
|
iplist->keys,
|
|
|
|
iplist->nextidx);
|
2000-07-26 18:47:43 +00:00
|
|
|
#else /* NOMINUM_PUBLIC */
|
|
|
|
result = dns_zone_setmasters(zone, iplist->ips,
|
|
|
|
iplist->nextidx);
|
|
|
|
#endif /* NOMINUM_PUBLIC */
|
2000-04-28 00:58:42 +00:00
|
|
|
else
|
|
|
|
result = dns_zone_setmasters(zone, NULL, 0);
|
2000-05-25 19:27:48 +00:00
|
|
|
RETERR(result);
|
1999-12-16 23:11:07 +00:00
|
|
|
|
2000-06-05 09:17:14 +00:00
|
|
|
result = dns_c_zone_getmaxtranstimein(czone, &uintval);
|
2000-04-07 18:16:02 +00:00
|
|
|
if (result != ISC_R_SUCCESS)
|
2000-07-21 18:47:23 +00:00
|
|
|
result = dns_c_ctx_getmaxtransfertimein(cctx,
|
|
|
|
&uintval);
|
2000-04-07 18:16:02 +00:00
|
|
|
if (result != ISC_R_SUCCESS)
|
2000-06-05 09:17:14 +00:00
|
|
|
uintval = MAX_XFER_TIME;
|
|
|
|
dns_zone_setmaxxfrin(zone, uintval);
|
2000-01-31 19:53:14 +00:00
|
|
|
|
2000-06-05 09:17:14 +00:00
|
|
|
result = dns_c_zone_getmaxtransidlein(czone, &uintval);
|
2000-04-07 18:16:02 +00:00
|
|
|
if (result != ISC_R_SUCCESS)
|
2000-06-05 09:17:14 +00:00
|
|
|
result = dns_c_ctx_getmaxtransferidlein(cctx,
|
|
|
|
&uintval);
|
2000-04-07 18:16:02 +00:00
|
|
|
if (result != ISC_R_SUCCESS)
|
2000-06-05 09:17:14 +00:00
|
|
|
uintval = DNS_DEFAULT_IDLEIN;
|
|
|
|
dns_zone_setidlein(zone, uintval);
|
1999-12-16 23:11:07 +00:00
|
|
|
|
|
|
|
result = dns_c_zone_gettransfersource(czone, &sockaddr);
|
2000-04-07 17:27:22 +00:00
|
|
|
if (result != ISC_R_SUCCESS && cview != NULL)
|
2000-05-08 14:38:29 +00:00
|
|
|
result = dns_c_view_gettransfersource(cview,
|
|
|
|
&sockaddr);
|
2000-04-07 17:27:22 +00:00
|
|
|
if (result != ISC_R_SUCCESS)
|
2000-01-31 18:00:07 +00:00
|
|
|
result = dns_c_ctx_gettransfersource(cctx, &sockaddr);
|
2000-04-07 17:27:22 +00:00
|
|
|
if (result != ISC_R_SUCCESS)
|
|
|
|
sockaddr = sockaddr_any4;
|
2000-01-31 18:00:07 +00:00
|
|
|
dns_zone_setxfrsource4(zone, &sockaddr);
|
1999-12-16 23:11:07 +00:00
|
|
|
|
2000-02-09 19:04:26 +00:00
|
|
|
result = dns_c_zone_gettransfersourcev6(czone, &sockaddr);
|
2000-04-07 17:27:22 +00:00
|
|
|
if (result != ISC_R_SUCCESS && cview != NULL)
|
2000-05-08 14:38:29 +00:00
|
|
|
result = dns_c_view_gettransfersourcev6(cview,
|
|
|
|
&sockaddr);
|
2000-04-07 17:27:22 +00:00
|
|
|
if (result != ISC_R_SUCCESS)
|
2000-05-08 14:38:29 +00:00
|
|
|
result = dns_c_ctx_gettransfersourcev6(cctx,
|
|
|
|
&sockaddr);
|
2000-04-07 17:27:22 +00:00
|
|
|
if (result != ISC_R_SUCCESS)
|
|
|
|
sockaddr = sockaddr_any6;
|
2000-02-09 19:04:26 +00:00
|
|
|
dns_zone_setxfrsource6(zone, &sockaddr);
|
|
|
|
|
1999-12-16 23:11:07 +00:00
|
|
|
break;
|
2000-05-25 19:27:48 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
1999-12-16 23:11:07 +00:00
|
|
|
}
|
|
|
|
|
2000-04-06 22:03:35 +00:00
|
|
|
return (ISC_R_SUCCESS);
|
1999-12-16 23:11:07 +00:00
|
|
|
}
|
|
|
|
|
2000-01-21 19:22:35 +00:00
|
|
|
isc_boolean_t
|
2000-05-08 14:38:29 +00:00
|
|
|
dns_zone_reusable(dns_zone_t *zone, dns_c_zone_t *czone) {
|
2000-01-21 19:22:35 +00:00
|
|
|
const char *cfilename;
|
|
|
|
const char *zfilename;
|
|
|
|
|
|
|
|
if (dns_zonetype_fromconf(czone->ztype) != dns_zone_gettype(zone))
|
|
|
|
return (ISC_FALSE);
|
|
|
|
|
|
|
|
cfilename = NULL;
|
|
|
|
(void) dns_c_zone_getfile(czone, &cfilename);
|
|
|
|
zfilename = dns_zone_getdatabase(zone);
|
|
|
|
if (cfilename == NULL || zfilename == NULL ||
|
|
|
|
strcmp(cfilename, zfilename) != 0)
|
|
|
|
return (ISC_FALSE);
|
|
|
|
|
|
|
|
return (ISC_TRUE);
|
|
|
|
}
|
|
|
|
|
2000-01-27 19:44:49 +00:00
|
|
|
isc_result_t
|
2000-05-08 14:38:29 +00:00
|
|
|
dns_zonemgr_configure(dns_c_ctx_t *cctx, dns_zonemgr_t *zmgr) {
|
2000-06-05 09:17:14 +00:00
|
|
|
isc_uint32_t val;
|
2000-01-27 19:44:49 +00:00
|
|
|
isc_result_t result;
|
|
|
|
|
|
|
|
result = dns_c_ctx_gettransfersin(cctx, &val);
|
2000-04-06 22:03:35 +00:00
|
|
|
if (result != ISC_R_SUCCESS)
|
2000-01-27 19:44:49 +00:00
|
|
|
val = 10;
|
|
|
|
dns_zonemgr_settransfersin(zmgr, val);
|
|
|
|
|
2000-05-25 19:27:48 +00:00
|
|
|
result = dns_c_ctx_gettransfersperns(cctx, &val);
|
|
|
|
if (result != ISC_R_SUCCESS)
|
|
|
|
val = 2;
|
|
|
|
dns_zonemgr_settransfersperns(zmgr, val);
|
|
|
|
|
2000-01-27 19:44:49 +00:00
|
|
|
return (ISC_R_SUCCESS);
|
|
|
|
}
|
|
|
|
|