confctx.c revision 515277c0e83829341f3c6f13c3cd32f8b4eeb104
/*
* Copyright (C) 1999 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 <syslog.h> /* XXXRTH */
#include <string.h>
#include <isc/assertions.h>
#include <dns/confcommon.h>
#include "confpvt.h"
/*
* Bit positions in the flags fields of the dns_c_options_t structure.
*/
#define MAX_NCACHE_TTL_BIT 0
#define TRANSFERS_IN_BIT 1
#define TRANSFERS_PER_NS_BIT 2
#define TRANSFERS_OUT_BIT 3
#define MAX_LOG_SIZE_IXFR_BIT 4
#define CLEAN_INTERVAL_BIT 5
#define INTERFACE_INTERVAL_BIT 6
#define STATS_INTERVAL_BIT 7
#define HEARTBEAT_INTERVAL_BIT 8
#define MAX_TRANSFER_TIME_IN_BIT 9
#define MAX_TRANSFER_TIME_OUT_BIT 10
#define MAX_TRANSFER_IDLE_IN_BIT 11
#define MAX_TRANSFER_IDLE_OUT_BIT 12
#define DATA_SIZE_BIT 13
#define STACK_SIZE_BIT 14
#define CORE_SIZE_BIT 15
#define FILES_BIT 16
#define QUERY_SOURCE_ADDR_BIT 17
#define QUERY_SOURCE_PORT_BIT 18
#define FAKE_IQUERY_BIT 19
#define RECURSION_BIT 20
#define FETCH_GLUE_BIT 21
#define NOTIFY_BIT 22
#define HOST_STATISTICS_BIT 23
#define DEALLOC_ON_EXIT_BIT 24
#define USE_IXFR_BIT 25
#define MAINTAIN_IXFR_BASE_BIT 26
#define HAS_OLD_CLIENTS_BIT 27
#define AUTH_NX_DOMAIN_BIT 28
#define MULTIPLE_CNAMES_BIT 29
#define USE_ID_POOL_BIT 30
#define DIALUP_BIT 31
#define CHECKNAME_PRIM_BIT 32
#define CHECKNAME_SEC_BIT 33
#define CHECKNAME_RESP_BIT 34
#define OPTIONS_TRANSFER_FORMAT_BIT 35
#define FORWARD_BIT 36
#define EXPERT_MODE_BIT 37
#define RFC2308_TYPE1_BIT 38
#define TCP_CLIENTS_BIT 39
#define RECURSIVE_CLIENTS_BIT 40
#define TRANSFER_SOURCE_BIT 41
char **field,
const char *newval);
dns_c_iplist_t **resval);
{
char *cpval;
"named-xfer is now obsolete");
}
"dump-file is not yet implemented.");
}
"memstatistics-file is not yet implemented.");
}
"the default for auth-nxdomain is now ``no''");
}
"deallocate-on-exit is obsolete.");
}
"fake-iquery is obsolete.");
}
"fetch-glue is not yet implemented.");
}
"has-old-clients is obsolete.");
}
"host-statistics is not yet implemented.");
}
"multiple-cnames is obsolete.");
}
"use-id-pool is obsolete.");
}
&severity) != ISC_R_NOTFOUND) ||
&severity) != ISC_R_NOTFOUND) ||
&severity) != ISC_R_NOTFOUND)) {
"check-names are not yet implemented.");
}
"max-ixfr-log-size is not yet implemented.");
}
"statistics-interval is not yet implemented.");
}
"topology is not yet implemented.");
}
"sortlist is not yet implemented.");
}
"rfc2308-type-1 is not yet implemented.");
}
/*
named-xfer obsolete
dump-file not yet implemented
memstatistics-file not yet implemented
auth-nxdomain default changed (to "no")
deallocate-on-exit obsolete (always "yes")
fake-iquery obsolete (always "no")
fetch-glue not yet implemented (always "no")
has-old-clients obsolete (always "no")
host-statistics not yet implemented
multiple-cnames obsolete (always "no")
use-id-pool obosolete (always "yes")
maintain-ixfr-base obosolete (always "yes")
check-names not yet implemented
max-ixfr-log-size not yet implemented
statistics-interval not yet implemented
topology not yet implemented
sortlist not yet implemented
*/
return (ISC_R_SUCCESS);
}
/* ************************************************************************ */
{
isc_result_t r;
return (ISC_R_NOMEMORY);
}
if (r != ISC_R_SUCCESS) {
return (r);
}
r = logging_init(cfg);
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_c_srvlist_delete(&c->servers);
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);
}
{
}
void
{
}
}
}
}
}
}
}
}
}
}
}
void
{
return;
}
}
}
}
{
}
}
{
}
{
if (deepcopy) {
if (res != ISC_R_SUCCESS) {
return (res);
}
} else {
}
}
{
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);
}
}
/*
* Modifiers for options.
*
*/
{
if (res != ISC_R_SUCCESS) {
return (res);
}
newval));
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
newval));
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
newval));
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
newval));
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
newval));
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
newval));
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
newval));
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
newval));
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
charval));
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
FILES_BIT));
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
NOTIFY_BIT));
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
USE_IXFR_BIT));
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
DIALUP_BIT));
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
switch(transtype) {
case dns_trans_primary:
break;
case dns_trans_secondary:
break;
case dns_trans_response:
break;
default:
"bad transport value: %d", transtype);
return (ISC_R_FAILURE);
}
}
{
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);
}
return (res);
}
{
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);
}
return (res);
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
return (res);
}
{
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 (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);
}
{
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);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
} else {
res = ISC_R_SUCCESS;
}
return (res);
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
FILES_BIT));
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
NOTIFY_BIT));
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
USE_IXFR_BIT));
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
DIALUP_BIT));
}
{
return (ISC_R_NOTFOUND);
}
res = ISC_R_SUCCESS;
} else {
}
return (res);
}
{
return (ISC_R_NOTFOUND);
}
return (ISC_R_SUCCESS);
} else {
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
return (ISC_R_SUCCESS);
} else {
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
switch (transtype) {
case dns_trans_primary:
break;
case dns_trans_secondary:
break;
case dns_trans_response:
break;
default:
"bad transport value: %d", transtype);
return (ISC_R_FAILURE);
}
if (isset) {
res = ISC_R_SUCCESS;
} else {
}
return (res);
}
{
return (ISC_R_NOTFOUND);
}
list));
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
list));
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
}
}
}
{
return (ISC_R_NOTFOUND);
}
return (ISC_R_NOTFOUND);
} else {
res = ISC_R_SUCCESS;
}
return (res);
}
{
return (ISC_R_NOTFOUND);
}
}
{
return (ISC_R_NOTFOUND);
} else {
return (ISC_R_SUCCESS);
}
}
{
return (ISC_R_NOTFOUND);
} else {
return (ISC_R_SUCCESS);
}
}
{
int i;
return (ISC_R_NOMEMORY);
}
opts->tkeydhkeyi = 0;
opts->max_ncache_ttl = 0;
opts->transfers_in = 0;
opts->transfers_per_ns = 0;
opts->transfers_out = 0;
opts->max_log_size_ixfr = 0;
opts->clean_interval = 0;
opts->interface_interval = 0;
opts->stats_interval = 0;
opts->heartbeat_interval = 0;
opts->tcp_clients = 0;
opts->recursive_clients = 0;
opts->max_transfer_time_in = 0;
opts->max_transfer_time_out = 0;
opts->max_transfer_idle_in = 0;
opts->max_transfer_idle_out = 0;
opts->stack_size = 0;
for (i = 0 ; i < DNS_C_TRANSCOUNT ; i++) {
}
return (ISC_R_SUCCESS);
}
{
isc_result_t r, result;
return (ISC_R_SUCCESS);
}
}
}
}
}
}
}
}
}
}
}
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;
}
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;
}
if (r != ISC_R_SUCCESS)
result = r;
}
return (result);
}
void
{
return;
}
}
}
}
} else { \
} \
}
}
}
"transfers-in", setflags1);
"transfers-per-ns", setflags1);
"transfers-out", setflags1);
"max-ixfr-log-size", setflags1);
"tcp-clients", setflags1);
"recursive-clients", setflags1);
"max-ncache-ttl", setflags1);
"cleaning-interval", setflags1);
"interface-interval", setflags1);
"statistics-interval", setflags1);
"heartbeat-interval", setflags1);
"max-transfer-time-in", setflags1);
"max-transfer-time-out", setflags1);
"max-transfer-idle-in", setflags1);
"max-transfer-idle-out", setflags1);
"expert-mode", setflags1);
"fake-iquery", setflags1);
"recursion", setflags1);
"fetch-glue", setflags1);
"notify", setflags1);
"host-statistics", setflags1);
"deallocate-on-exit", setflags1);
"use-ixfr", setflags1);
"maintain-ixfr-base", setflags1);
"has-old-clients", setflags1);
"auth-nxdomain", setflags1);
"multiple-cnames", setflags1);
"use-id-pool", setflags1);
"rfc2308-type1", setflags1);
"dialup", setflags1);
ISC_TRUE));
}
}
if (options->query_source_port == 0) {
} else {
}
}
}
ISC_TRUE),
ISC_TRUE));
}
ISC_TRUE),
ISC_TRUE));
}
ISC_TRUE),
ISC_TRUE));
}
}
}
}
}
}
}
}
}
}
}
}
{
if (res == ISC_R_SUCCESS) {
}
}
return rval;
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
return (res);
}
{
return (ISC_R_NOTFOUND);
}
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
{
return (ISC_R_NOTFOUND);
}
res = ISC_R_SUCCESS;
} else {
}
return (res);
}
/***************************************************************************/
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
{
}
} else if (copy) {
}
} else {
}
} else {
if (res != ISC_R_SUCCESS) {
return (res);
}
}
res = ISC_R_SUCCESS;
}
res = ISC_R_EXISTS;
}
return (res);
}
static isc_result_t
{
}
static isc_result_t
{
}
static isc_result_t
{
}
static isc_result_t
{
res = ISC_R_SUCCESS;
} else {
}
return (res);
}
static isc_result_t
{
res = ISC_R_SUCCESS;
} else {
}
return (res);
}
static isc_result_t
{
res = ISC_R_SUCCESS;
} else {
}
return (res);
}
static isc_result_t
{
res = ISC_R_SUCCESS;
} else {
}
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);
/*
* The ANY acl.
*/
if (r != ISC_R_SUCCESS) return (r);
if (r != ISC_R_SUCCESS) return (r);
if (r != ISC_R_SUCCESS) return (r);
/*
* The NONE acl
*/
if (r != ISC_R_SUCCESS) return (r);
if (r != ISC_R_SUCCESS) return (r);
if (r != ISC_R_SUCCESS) return (r);
/*
* The LOCALHOST acl
*/
if (r != ISC_R_SUCCESS) return (r);
if (r != ISC_R_SUCCESS) return (r);
if (r != ISC_R_SUCCESS) return (r);
/*
* The LOCALNETS acl
*/
if (r != ISC_R_SUCCESS) return (r);
if (r != ISC_R_SUCCESS) return (r);
if (r != ISC_R_SUCCESS) return (r);
return (ISC_R_SUCCESS);
}
static isc_result_t
{
if (res != ISC_R_SUCCESS) {
return (res);
}
/* default_syslog channel */
&chan);
if (res != ISC_R_SUCCESS) {
return (res);
}
/* default_debug channel */
if (res != ISC_R_SUCCESS) {
return (res);
}
/* null channel */
/* default_stderr channel */
&chan);
if (res != ISC_R_SUCCESS) {
return (res);
}
/* default category */
if (res != ISC_R_SUCCESS) {
return (res);
}
/* panic category */
if (res != ISC_R_SUCCESS) {
return (res);
}
/* eventlib category */
if (res != ISC_R_SUCCESS) {
return (res);
}
/* packet category */
if (res != ISC_R_SUCCESS) {
return (res);
}
return (ISC_R_SUCCESS);
}
static isc_result_t
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
return (res);
}