confcommon.c revision 499b34cea04a46823d003d4c0520c8b03e8513cb
/*
* Copyright (C) 1999-2001 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: confcommon.c,v 1.36 2001/01/09 21:51:53 bwelling Exp $ */
#include <config.h>
#include <ctype.h>
#include <syslog.h> /* XXXRTH */
#include <dns/confcommon.h>
#include <dns/rdataclass.h>
#include <dns/rdatatype.h>
/***
*** TYPES
***/
#define ordering_nametable_size \
(sizeof (ordering_nametable) / sizeof (struct dns_c_pvt_ont))
static struct dns_c_pvt_ont {
const char *strval;
} ordering_nametable[] = {
{ dns_c_ordering_fixed, "fixed" },
{ dns_c_ordering_random, "random" },
{ dns_c_ordering_cyclic, "cyclic" }
};
#define log_severity_nametable_size \
(sizeof (log_severity_nametable) / sizeof (struct dns_c_pvt_lsnt))
static struct dns_c_pvt_lsnt {
const char *strval;
} log_severity_nametable[] = {
{ dns_c_log_critical, "critical" },
{ dns_c_log_error, "error" },
{ dns_c_log_info, "info" },
{ dns_c_log_notice, "notice" },
{ dns_c_log_warn, "warning" },
{ dns_c_log_debug, "debug" },
{ dns_c_log_dynamic, "dynamic" }
};
static struct dsn_c_pvt_sfnt {
int val;
const char *strval;
} syslog_facil_nametable[] = {
{ LOG_KERN, "kern" },
{ LOG_USER, "user" },
{ LOG_MAIL, "mail" },
{ LOG_DAEMON, "daemon" },
{ LOG_AUTH, "auth" },
{ LOG_SYSLOG, "syslog" },
{ LOG_LPR, "lpr" },
#ifdef LOG_NEWS
{ LOG_NEWS, "news" },
#endif
#ifdef LOG_UUCP
{ LOG_UUCP, "uucp" },
#endif
#ifdef LOG_CRON
{ LOG_CRON, "cron" },
#endif
#ifdef LOG_AUTHPRIV
{ LOG_AUTHPRIV, "authpriv" },
#endif
#ifdef LOG_FTP
{ LOG_FTP, "ftp" },
#endif
{ LOG_LOCAL0, "local0"},
{ LOG_LOCAL1, "local1"},
{ LOG_LOCAL2, "local2"},
{ LOG_LOCAL3, "local3"},
{ LOG_LOCAL4, "local4"},
{ LOG_LOCAL5, "local5"},
{ LOG_LOCAL6, "local6"},
{ LOG_LOCAL7, "local7"},
{ 0, NULL }
};
static const char *category_nametable[] = {
"default",
"general",
"database",
"security",
"config",
"resolver",
"xfer-in",
"xfer-out",
"notify",
"client",
"network",
"update",
#if 0
"client",
"cname",
"config",
"control",
"database",
"db",
"default",
"eventlib",
"general",
"insist",
"lame-servers",
"load",
"maintenance",
"ncache",
"network",
"notify",
"os",
"packet",
"panic",
"parser",
"queries",
"resolver",
"response-checks",
"security",
"statistics",
"update",
"xfer-in",
"xfer-out",
#endif
};
/***
*** DATA
***/
/***
*** FUNCTIONS
***/
#if 0 /* XXXJAB delete this code */
#endif
void
/* XXXJAB These format strings may break if isc_offset_t is a large
enough type and val has a value greater than MAX_ULONG. I know
of no portablt solution to this. */
if (val == DNS_C_SIZE_SPEC_DEFAULT)
else if (val == 0)
else if (val == DNS_C_SIZE_SPEC_UNLIM)
else
}
void
char buffer[64];
} else {
}
}
void
char buffer[64];
} else {
}
}
void
while (count > 0) {
count--;
}
}
unsigned int i;
for (i = 0 ; i < ordering_nametable_size ; i++) {
break;
}
}
return (rval);
}
const char *
{
unsigned int i;
for (i = 0 ; i < ordering_nametable_size ; i++) {
break;
}
}
}
const char *
{
unsigned int i;
for (i = 0 ; i < log_severity_nametable_size ; i++) {
break;
}
}
}
dns_c_string2logseverity(const char *string,
{
unsigned int i;
for (i = 0 ; i < log_severity_nametable_size ; i++) {
break;
}
}
return rval;
}
#if 0
const char *
{
unsigned int i;
for (i = 0 ; i < category_nametable_size ; i++) {
break;
}
}
}
dns_c_string2category(const char *string,
{
unsigned int i;
for (i = 0 ; i < category_nametable_size ; i++) {
break;
}
}
return (rval);
}
#endif
const char *
int i;
break;
}
}
}
int i;
break;
}
}
return rval;
}
const char *
{
switch (tformat) {
case dns_one_answer:
rval = "one-answer";
break;
case dns_many_answers:
rval = "many-answers";
break;
}
}
const char *
{
switch (transport) {
case dns_trans_primary:
rval = "master";
break;
case dns_trans_secondary:
rval = "slave";
break;
case dns_trans_response:
rval = "response";
break;
}
}
const char *
{
switch (severity) {
case dns_severity_ignore:
rval = "ignore";
break;
case dns_severity_warn:
rval = "warn";
break;
case dns_severity_fail:
rval = "fail";
break;
}
}
const char *
{
switch (forw) {
case dns_c_forw_only:
rval = "only";
break;
case dns_c_forw_first:
rval = "first";
break;
case dns_c_forw_noanswer:
rval = "if-no-answer";
break;
case dns_c_forw_nodomain:
rval = "if-no-domain";
break;
}
}
const char *
{
switch (addata) {
case dns_c_ad_internal:
rval = "internal";
break;
case dns_c_ad_minimal:
rval = "minimal";
break;
case dns_c_ad_maximal:
rval = "maximal";
break;
}
}
int
int result = 0;
result = 1;
}
} else {
&in6addr_any, sizeof in6addr_any) == 0) {
result = 1;
}
}
return (result);
}
void
const char *p;
char tmpaddrstr[64];
void *addr;
if (dns_c_isanyaddr(inaddr)) {
} else {
}
} else {
if (p == NULL) {
} else {
}
}
}
}
} else {
&in6addr_any, sizeof in6addr_any) == 0) {
}
}
return (result);
}
void
const char *p;
char tmpaddrstr[64];
void *addr;
if (dns_c_netaddrisanyaddr(inaddr)) {
} else {
}
} else {
if (p == NULL) {
} else {
}
}
}
dns_c_need_quote(const char *string) {
break;
}
string++;
}
return rval;
}
void
{
}
}
return;
}
isc_buffer_t b;
isc_region_t r;
char t[1024];
/*
* Print 'name' on 'stream'.
*/
isc_buffer_init(&b, t, sizeof(t));
if (result != ISC_R_SUCCESS)
return (result);
isc_buffer_usedregion(&b, &r);
return (ISC_R_SUCCESS);
}
void
if (res == ISC_R_SUCCESS) {
}
if (res == ISC_R_SUCCESS) {
}
if (res == ISC_R_SUCCESS) {
}
if (res == ISC_R_SUCCESS) {
}
if (res == ISC_R_SUCCESS) {
}
if (res == ISC_R_SUCCESS) {
}
}
unsigned int len;
if (res != ISC_R_SUCCESS) {
return (res);
}
return (ISC_R_SUCCESS);
}
void
unsigned int i;
unsigned int tcount;
if (res != ISC_R_SUCCESS) {
return;
}
do {
switch(dns_ssurule_matchtype(rule)) {
case DNS_SSUMATCHTYPE_NAME:
break;
break;
break;
case DNS_SSUMATCHTYPE_SELF:
break;
default:
REQUIRE(0);
break;
}
for(i = 0 ; i < tcount ; i++) {
}
}
dns_c_checkcategory(const char *name) {
unsigned int i;
/*
* This function isn't called very often, so no need for fancy
* searches.
*/
for (i = 0 ; category_nametable[i] != NULL ; i++) {
return (ISC_R_SUCCESS);
}
}
return (ISC_R_FAILURE);
}