confctx.c revision 10ba7f6f563d68b8f1284847ccce85b706e793fe
/*
* 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 DATA_SIZE_BIT 10
#define STACK_SIZE_BIT 11
#define CORE_SIZE_BIT 12
#define FILES_BIT 13
#define QUERY_SOURCE_ADDR_BIT 14
#define QUERY_SOURCE_PORT_BIT 15
#define FAKE_IQUERY_BIT 16
#define RECURSION_BIT 17
#define FETCH_GLUE_BIT 18
#define NOTIFY_BIT 19
#define HOST_STATISTICS_BIT 20
#define DEALLOC_ON_EXIT_BIT 21
#define USE_IXFR_BIT 22
#define MAINTAIN_IXFR_BASE_BIT 23
#define HAS_OLD_CLIENTS_BIT 24
#define AUTH_NX_DOMAIN_BIT 25
#define MULTIPLE_CNAMES_BIT 26
#define USE_ID_POOL_BIT 27
#define DIALUP_BIT 28
#define CHECKNAME_PRIM_BIT 29
#define CHECKNAME_SEC_BIT 30
#define CHECKNAME_RESP_BIT 31
#define OPTIONS_TRANSFER_FORMAT_BIT 32
#define FORWARD_BIT 33
#define EXPERT_MODE_BIT 34
char **field,
const char *newval);
{
isc_result_t r;
return (ISC_R_NOMEMORY);
}
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);
}
dns_c_ctx_t **cfg)
{
dns_c_ctx_t *c;
CHECK_CONFIG(*cfg);
c = *cfg;
isc_mem_put(c->mem, c, sizeof *c);
return (ISC_R_SUCCESS);
}
void
{
}
void
{
return;
}
}
}
}
{
(void) lctx;
}
}
{
(void) lctx;
}
{
if (deepcopy) {
if (res != ISC_R_SUCCESS) {
return (res);
}
} else {
}
}
{
&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);
}
{
(void)lctx;
}
{
return (res == ISC_R_SUCCESS);
}
{
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);
}
}
}
{
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);
}
}
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\n", 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 (result != ISC_R_SUCCESS) {
return (result);
}
}
if (result != ISC_R_SUCCESS) {
return (result);
}
}
#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 (result != ISC_R_SUCCESS) {
return (result);
}
return (result);
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
}
if (copy) {
if (res != ISC_R_SUCCESS) {
return (res);
}
} else {
}
}
/**
** Accessors
**/
{
(void)lctx;
return (ISC_R_NOTFOUND);
}
}
{
(void)lctx;
return (ISC_R_NOTFOUND);
}
}
{
(void)lctx;
return (ISC_R_NOTFOUND);
}
}
{
(void)lctx;
return (ISC_R_NOTFOUND);
}
}
{
(void)lctx;
return (ISC_R_NOTFOUND);
}
}
{
(void) lctx;
return (ISC_R_NOTFOUND);
}
}
{
(void) lctx;
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);
}
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);
}
DIALUP_BIT));
}
{
(void) lctx;
return (ISC_R_NOTFOUND);
}
res = ISC_R_SUCCESS;
} else {
}
return (res);
}
{
(void) lctx;
return (ISC_R_NOTFOUND);
}
return (ISC_R_SUCCESS);
} else {
return (ISC_R_NOTFOUND);
}
}
{
(void) lctx;
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\n", 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);
}
}
{
(void) lctx;
return (ISC_R_NOTFOUND);
}
}
}
{
(void) lctx;
return (ISC_R_NOTFOUND);
}
return (ISC_R_NOTFOUND);
} else {
res = ISC_R_SUCCESS;
}
return (res);
}
{
return (ISC_R_NOTFOUND);
}
}
{
(void) lctx;
return (ISC_R_NOTFOUND);
} else {
return (ISC_R_SUCCESS);
}
}
{
(void) lctx;
return (ISC_R_NOTFOUND);
} else {
return (ISC_R_SUCCESS);
}
}
{
int i;
(void) lctx;
return (ISC_R_NOMEMORY);
}
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->max_transfer_time_in = 0;
opts->stack_size = 0;
for (i = 0 ; i < DNS_C_TRANSCOUNT ; i++) {
}
return (ISC_R_SUCCESS);
}
{
isc_result_t r;
return (ISC_R_SUCCESS);
}
}
}
}
}
}
}
}
if (r != ISC_R_SUCCESS) return (r);
if (r != ISC_R_SUCCESS) return (r);
if (r != ISC_R_SUCCESS) return (r);
if (r != ISC_R_SUCCESS) return (r);
if (r != ISC_R_SUCCESS) return (r);
if (r != ISC_R_SUCCESS) return (r);
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);
}
void
{
return;
}
}
}
}
} else { \
} \
}
}
"transfers-in", setflags1);
"transfers-per-ns", setflags1);
"transfers-out", setflags1);
"max-ixfr-log-size", setflags1);
"max-ncache-ttl", setflags1);
"cleaning-interval", setflags1);
"interface-interval", setflags1);
"statistics-interval", setflags1);
"heartbeat-interval", setflags1);
"max-transfer-time-in", 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);
"dialup", setflags1);
ISC_TRUE));
}
} else {
}
}
ISC_TRUE),
ISC_TRUE));
}
ISC_TRUE),
ISC_TRUE));
}
ISC_TRUE),
ISC_TRUE));
}
}
}
}
}
}
}
}
{
if (res == ISC_R_SUCCESS) {
}
}
return rval;
}
/***************************************************************************/
static isc_result_t
{
char *p;
(void) lctx;
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;
}
/* XXX This can get removed and replaced with set_ipmatch_list_field */
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
{
(void) lctx;
}
static isc_result_t
{
(void) lctx;
}
static isc_result_t
{
(void) lctx;
}
static isc_result_t
{
(void) lctx;
res = ISC_R_SUCCESS;
} else {
}
return (res);
}
static isc_result_t
{
(void) lctx;
res = ISC_R_SUCCESS;
} else {
}
return (res);
}
static isc_result_t
{
(void) lctx;
res = ISC_R_SUCCESS;
} else {
}
return (res);
}
static isc_result_t
{
(void) lctx;
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);
}