zoneconf.c revision a7e803adb0894257fbc0fc4560ff5d915c2b6194
e20788e1216ed720aefa84f3295f7899d9f28c22Mark Andrews * Copyright (C) 1999, 2000 Internet Software Consortium.
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt * Permission to use, copy, modify, and distribute this software for any
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt * purpose with or without fee is hereby granted, provided that the above
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt * copyright notice and this permission notice appear in all copies.
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt/* XXX copied from zone.c */
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt#define MAX_XFER_TIME (2*3600) /* Documented default is 2 hours. */
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt * Convenience function for configuring a single zone ACL.
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Huntconfigure_zone_acl(dns_c_zone_t *czone, dns_c_ctx_t *cctx,
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt isc_result_t (*getcacl)(dns_c_zone_t *, dns_c_ipmatchlist_t **),
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_acl_fromconfig(cacl, cctx, aclconfctx,
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntdns_zone_configure(dns_c_ctx_t *cctx, dns_aclconfctx_t *ac,
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt isc_sockaddr_fromin(&sockaddr_any4, &in4addr_any, 0);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt isc_sockaddr_fromin6(&sockaddr_any6, &in6addr_any, 0);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt /* XXX needs to be an zone option */
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_zone_getchecknames(czone, &severity);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt dns_zone_setchecknames(zone, dns_c_severity_fail);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = configure_zone_acl(czone, cctx, ac, zone,
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = configure_zone_acl(czone, cctx, ac, zone,
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = configure_zone_acl(czone, cctx, ac, zone,
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt dns_zone_setoption(zone, DNS_ZONE_O_DIALUP, boolean);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt dns_zone_setoption(zone, DNS_ZONE_O_NOTIFY, boolean);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_zone_getalsonotify(czone, &iplist);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_zone_getmaxtranstimeout(czone, &maxxfr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_ctx_getmaxtransfertimeout(cctx, &maxxfr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_zone_getmaxtransidleout(czone, &maxxfr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_ctx_getmaxtransferidleout(cctx, &maxxfr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt * forward zones are still in a state of flux
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt czone->u.fzone.check_names; /* XXX unused in BIND 8 */
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_zone_getchecknames(czone, &severity);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt dns_zone_setchecknames(zone, dns_c_severity_warn);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = configure_zone_acl(czone, cctx, ac, zone,
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_zone_getmaxtranstimein(czone, &maxxfr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_ctx_getmaxtransfertimein(cctx, &maxxfr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_zone_getmaxtransidlein(czone, &maxxfr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_ctx_getmaxtransferidlein(cctx, &maxxfr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_zone_gettransfersource(czone, &sockaddr);
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt result = dns_c_ctx_gettransfersource(cctx, &sockaddr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_zone_gettransfersourcev6(czone, &sockaddr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_ctx_gettransfersourcev6(cctx, &sockaddr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_zone_getmaxtranstimeout(czone, &maxxfr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_ctx_getmaxtransfertimeout(cctx, &maxxfr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_zone_getmaxtransidleout(czone, &maxxfr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_ctx_getmaxtransferidleout(cctx, &maxxfr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_zone_getchecknames(czone, &severity);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt dns_zone_setchecknames(zone, dns_c_severity_warn);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = configure_zone_acl(czone, cctx, ac, zone,
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_zone_getmaxtranstimein(czone, &maxxfr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_ctx_getmaxtransfertimein(cctx, &maxxfr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_zone_getmaxtransidlein(czone, &maxxfr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_ctx_getmaxtransferidlein(cctx, &maxxfr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_zone_gettransfersource(czone, &sockaddr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_ctx_gettransfersource(cctx, &sockaddr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_zone_gettransfersourcev6(czone, &sockaddr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_ctx_gettransfersourcev6(cctx, &sockaddr);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt result = dns_c_zone_getchecknames(czone, &severity);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt dns_zone_setchecknames(zone, dns_c_severity_fail);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntdns_zone_reusable(dns_zone_t *zone, dns_c_zone_t *czone)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt if (dns_zonetype_fromconf(czone->ztype) != dns_zone_gettype(zone))
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt /* XXX Compare masters, too. */