zoneconf.c revision 5f80c1428b9b7235fc9c1c80aa505457c3043504
/*
* Copyright (C) 1999, 2000 Internet Software Consortium.
*
* 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.
*
* 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.
*/
#include <config.h>
#include <dns/zoneconf.h>
/*
* These are BIND9 server defaults, not necessarily identical to the
* library defaults defined in zone.c.
*/
#define RETERR(x) do { \
isc_result_t _r = (x); \
if (_r != ISC_R_SUCCESS) \
return (_r); \
} while (0)
/*
* Convenience function for configuring a single zone ACL.
*/
static isc_result_t
dns_c_ipmatchlist_t **),
, dns_c_ipmatchlist_t **),
dns_c_ipmatchlist_t **),
void (*clearzacl)(dns_zone_t *))
{
}
}
if (result == ISC_R_SUCCESS) {
if (result != ISC_R_SUCCESS)
return (result);
return (ISC_R_SUCCESS);
} else if (result == ISC_R_NOTFOUND) {
return (ISC_R_SUCCESS);
} else {
return (result);
}
}
/*
* Conver a config file zone type into a server zone type.
*/
static dns_zonetype_t
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;
default:
/*
* Hint and forward zones are not really zones;
* they should never get this far.
*/
INSIST(0);
return (dns_zone_none); /*NOTREACHED*/
}
}
{
#ifdef notyet
#endif
/*
* Configure values common to all zone types.
*/
/* XXX needs to be an zone option */
#ifdef notyet
if (result == ISC_R_SUCCESS)
else
#endif
/*
* XXXAG This probably does not make sense for stubs.
*/
if (result != ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS)
/*
* Configure master functionality. This applies
* to primary masters (type "master") and slaves
* acting as masters (type "slave"), but not to stubs.
*/
if (result != ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS)
if (result == ISC_R_SUCCESS)
else
&maxxfr);
if (result != ISC_R_SUCCESS)
&maxxfr);
if (result != ISC_R_SUCCESS)
&maxxfr);
if (result != ISC_R_SUCCESS)
&maxxfr);
if (result != ISC_R_SUCCESS)
}
/*
* Configure update-related options. These apply to
* primary masters only.
*/
if (result == ISC_R_SUCCESS) {
}
}
/*
* Configure slave functionality.
*/
case dns_c_zone_slave:
case dns_c_zone_stub:
if (result == ISC_R_SUCCESS)
else
if (result != ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS)
&sockaddr);
if (result != ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS)
&sockaddr);
if (result != ISC_R_SUCCESS)
&sockaddr);
if (result != ISC_R_SUCCESS)
break;
default:
break;
}
return (ISC_R_SUCCESS);
}
const char *cfilename;
const char *zfilename;
return (ISC_FALSE);
return (ISC_FALSE);
/* XXX Compare masters, too. */
return (ISC_TRUE);
}
if (result != ISC_R_SUCCESS)
val = 10;
if (result != ISC_R_SUCCESS)
val = 2;
return (ISC_R_SUCCESS);
}