confctx.c revision adf82221858138f295bce732e86dcac34645692e
/*
* 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.
*/
/* $Id: confctx.c,v 1.65 2000/06/09 08:48:38 brister Exp $ */
#include <config.h>
#include "confpvt.h"
#ifdef PVT_CONCAT
#endif
#define PVT_CONCAT(x,y) x ## y
{ \
\
if (result != ISC_R_SUCCESS) { \
return (result); \
} \
} \
\
\
sizeof (TYPE)); \
return (ISC_R_NOMEMORY); \
} \
} else { \
} \
\
\
}
{ \
\
\
\
return (ISC_R_NOTFOUND); \
} \
\
\
return (ISC_R_NOTFOUND); \
} else { \
return (ISC_R_SUCCESS); \
} \
}
{ \
\
\
\
return (ISC_R_NOTFOUND); \
} \
\
\
return (ISC_R_NOTFOUND); \
} else { \
\
return (ISC_R_SUCCESS); \
} \
}
{ \
isc_result_t res; \
\
\
if (res != ISC_R_SUCCESS) { \
return (res); \
} \
\
}
{ \
\
return (ISC_R_NOTFOUND); \
} \
\
\
\
}
{ \
\
return (ISC_R_NOTFOUND); \
} \
\
\
return (ISC_R_NOTFOUND); \
} \
\
\
return (ISC_R_SUCCESS); \
}
char **field,
const char *newval);
dns_c_iplist_t **resval);
{
char *cpval;
"option 'named-xfer' is now obsolete");
}
"option 'dump-file' is not yet implemented");
}
"option 'memstatistics-file' is not yet "
"implemented");
}
"the default for the 'auth-nxdomain' option "
"is now 'no'");
}
"option 'deallocate-on-exit' is obsolete");
}
"option 'dialup' is not yet implemented");
}
"option 'fake-iquery' is obsolete");
}
"option 'fetch-glue' is not yet implemented");
}
"option 'has-old-clients' is obsolete");
}
"option 'host-statistics' is not yet "
"implemented");
}
"option 'multiple-cnames' is obsolete");
}
"option 'rfc2308-type-1' is not yet "
"implemented");
}
"option 'use-id-pool' is obsolete");
}
"option 'treat-cr-as-space' is obsolete");
}
&severity) != ISC_R_NOTFOUND) ||
&severity) != ISC_R_NOTFOUND) ||
&severity) != ISC_R_NOTFOUND)) {
"option 'check-names' is not yet implemented");
}
"option 'blackhole' is not yet implemented");
}
"option 'lame-ttl' is not yet "
"implemented");
}
"option 'max-ncache-ttl' is not yet "
"implemented");
}
"option 'max-cache-ttl' is not yet "
"implemented");
}
"option 'min-roots' is not yet "
"implemented");
}
"option 'serial-queries' is not yet "
"implemented");
}
"option 'max-ixfr-log-size' is not yet "
"implemented");
}
"option 'coresize' is not yet "
"implemented");
}
"option 'datasize' is not yet "
"implemented");
}
"option 'files' is not yet "
"implemented");
}
"option 'cachesize' is not yet "
"implemented");
}
"option 'stacksize' is not yet "
"implemented");
}
"option 'heartbeat-interval' is not yet "
"implemented");
}
"option 'statistics-interval' is not yet "
"implemented");
}
"option 'topology' is deprecated");
}
"option 'sortlist' is not yet implemented");
}
"option 'rrset-order' is not yet implemented");
}
"option 'allow-update-forwarding' is not "
"yet implemented");
}
if (tmpres != ISC_R_SUCCESS) {
}
}
if (tmpres != ISC_R_SUCCESS) {
}
}
if (tmpres != ISC_R_SUCCESS) {
}
}
if (tmpres != ISC_R_SUCCESS) {
}
}
return (result);
}
/* ************************************************************************ */
{
isc_result_t r;
return (ISC_R_NOMEMORY);
}
if (r != ISC_R_SUCCESS) {
return (r);
}
r = logging_init(tmpcfg);
if (r != ISC_R_SUCCESS) {
return (r);
}
#if 1 /* XXX brister */
#else
if (r != ISC_R_SUCCESS) {
return r;
}
#endif
return (ISC_R_SUCCESS);
}
{
dns_c_ctx_t *c;
c = *cfg;
dns_peerlist_detach(&c->peers);
dns_c_acltable_delete(&c->acls);
dns_c_kdeflist_delete(&c->keydefs);
dns_c_zonelist_delete(&c->zlist);
if (c->trusted_keys != NULL)
dns_c_viewtable_delete(&c->views);
c->magic = 0;
isc_mem_put(c->mem, c, sizeof *c);
return (ISC_R_SUCCESS);
}
{
}
}
{
}
{
/* XXX should we validate that the zone is in our table? */
return (ISC_R_SUCCESS);
}
{
}
{
/* XXX should we validate that the zone is in our table? */
return (ISC_R_SUCCESS);
}
{
}
{
return (ISC_R_NOTFOUND);
} else {
return (ISC_R_SUCCESS);
}
}
{
return (ISC_R_SUCCESS);
} else {
return (ISC_R_FAILURE);
}
}
{
}
return (ISC_R_SUCCESS);
}
void
{
}
}
}
}
}
}
}
}
}
}
void
{
return;
}
}
}
}
}
} else { \
} \
}
}
\
\
\
if (port == 0) { \
} else { \
} \
}
}
#define PRINT_CHECKNAME(INDEX) \
}
}
/* XXX LAMETTL ??? */
ISC_TRUE));
}
ISC_TRUE));
}
defport);
}
defport);
}
}
}
}
}
void
{
return;
}
}
}
}
{
}
}
{
return (ISC_R_NOTFOUND);
}
return (ISC_R_SUCCESS);
}
{
}
{
if (deepcopy) {
if (res != ISC_R_SUCCESS) {
return (res);
}
} else {
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
} else {
return (ISC_R_SUCCESS);
}
}
{
}
res = ISC_R_SUCCESS;
} else if (deepcopy) {
} else {
res = ISC_R_SUCCESS;
}
return (res);
}
{
&newc);
if (res != ISC_R_SUCCESS) {
return (res);
}
return (res);
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
return (res);
}
{
&newc);
if (res != ISC_R_SUCCESS) {
return (res);
}
return (res);
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
return (res);
}
{
}
{
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
/* ***************************************************************** */
/* *********** OPTIONS *********** */
/* ***************************************************************** */
{
return (ISC_R_NOMEMORY);
}
opts->tkeydhkeyi = 0;
return (ISC_R_SUCCESS);
}
{
isc_result_t r, result;
return (ISC_R_SUCCESS);
}
} } while (0)
#define FREESTRING(FIELD) \
} } while (0)
#define FREEIPMLIST(FIELD) \
} } while (0)
}
if (r != ISC_R_SUCCESS)
result = r;
}
if (r != ISC_R_SUCCESS)
result = r;
}
if (r != ISC_R_SUCCESS)
result = r;
}
if (r != ISC_R_SUCCESS)
result = r;
}
return (result);
}
/*
* Modifiers for options.
*
*/
{
if (res != ISC_R_SUCCESS) {
return (res);
}
newval));
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
charval));
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
switch(transtype) {
case dns_trans_primary:
case dns_trans_secondary:
case dns_trans_response:
break;
default:
"bad transport value: %d", transtype);
return (ISC_R_FAILURE);
}
if (!existed) {
sizeof (**ptr));
}
}
{
return (ISC_R_NOTFOUND);
}
switch (transtype) {
case dns_trans_primary:
case dns_trans_secondary:
case dns_trans_response:
break;
default:
"bad transport value: %d", transtype);
return (ISC_R_FAILURE);
}
} else {
}
return (result);
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
switch(transtype) {
case dns_trans_primary:
case dns_trans_secondary:
case dns_trans_response:
break;
default:
"bad transport value: %d", transtype);
return (ISC_R_FAILURE);
}
return (ISC_R_NOTFOUND);
}
return (ISC_R_SUCCESS);
}
{ \
isc_result_t res; \
\
\
if (res != ISC_R_SUCCESS) { \
return (res); \
} \
\
\
} \
\
return (ISC_R_SUCCESS); \
} \
{ \
\
return (ISC_R_NOTFOUND); \
} \
\
\
return (ISC_R_SUCCESS); \
} else { \
return (ISC_R_NOTFOUND); \
} \
}
{ \
\
return (ISC_R_NOTFOUND); \
} \
\
\
return (ISC_R_SUCCESS); \
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
if (copy) {
if (res != ISC_R_SUCCESS) {
return (res);
}
} else {
}
} else {
}
res = ISC_R_SUCCESS;
}
res = ISC_R_EXISTS;
}
return (res);
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
if (copy) {
if (res != ISC_R_SUCCESS) {
return (res);
}
} else {
}
}
/**
** Accessors
**/
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
} else {
res = ISC_R_SUCCESS;
}
return (res);
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
if (res != ISC_R_SUCCESS) {
return (res);
}
}
#if 0
/* XXX we should probably check that a listen on statement
* hasn't been done for the same post, ipmatch list
* combination
*/
return (ISC_R_FAILURE);
}
}
#endif
if (res != ISC_R_SUCCESS) {
return (res);
}
return (res);
}
{
return (ISC_R_NOTFOUND);
}
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
if (res != ISC_R_SUCCESS) {
return (res);
}
}
#if 0
/* XXX we should probably check that a listen on statement
* hasn't been done for the same post, ipmatch list
* combination
*/
return (ISC_R_FAILURE);
}
}
#endif
if (res != ISC_R_SUCCESS) {
return (res);
}
return (res);
}
{
return (ISC_R_NOTFOUND);
}
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
return (res);
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
} else {
return (ISC_R_SUCCESS);
}
}
{
return (ISC_R_NOTFOUND);
} else {
return (ISC_R_SUCCESS);
}
}
{
return (ISC_R_NOTFOUND);
} else {
return (ISC_R_SUCCESS);
}
}
/*
**
*/
{
if (result != ISC_R_SUCCESS) {
return (result);
}
return (ISC_R_SUCCESS);
}
{
return (ISC_R_NOTFOUND);
}
return (ISC_R_SUCCESS);
}
{
return (ISC_R_NOTFOUND);
}
return (ISC_R_SUCCESS);
} else {
return (ISC_R_NOTFOUND);
}
}
/*
**
*/
{
if (res == ISC_R_SUCCESS) {
}
}
return rval;
}
/***************************************************************************/
static isc_result_t
{
char *p;
p = *field;
if (p != NULL) {
}
if (p != NULL) {
}
p = NULL;
} else if (p == NULL) {
if (p == NULL) {
return (ISC_R_NOMEMORY);
}
} else {
if (p == NULL) {
return (ISC_R_NOMEMORY);
}
}
*field = p;
}
static isc_result_t
{
}
} else if (copy) {
}
newval);
} else {
if (res != ISC_R_SUCCESS) {
return (res);
}
}
res = ISC_R_SUCCESS;
}
res = ISC_R_EXISTS;
}
return (res);
}
static isc_result_t
{
res = ISC_R_SUCCESS;
} else {
}
return (res);
}
static isc_result_t
{
isc_result_t r;
if (r != ISC_R_SUCCESS) return (r);
return (ISC_R_SUCCESS);
}
static isc_result_t
{
if (res != ISC_R_SUCCESS) {
return (res);
}
return (ISC_R_SUCCESS);
}
static isc_result_t
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
return (res);
}