namedconf.c revision 73fb13fe97cf2f1d93d5e2ea56583fdb2f40b6f3
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * Copyright (C) 2002, 2003 Internet Software Consortium.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * Permission to use, copy, modify, and distribute this software for any
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * purpose with or without fee is hereby granted, provided that the above
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * copyright notice and this permission notice appear in all copies.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * PERFORMANCE OF THIS SOFTWARE.
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafsson/* $Id: namedconf.c,v 1.41 2004/11/11 01:08:24 marka Exp $ */
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafsson#define TOKEN_STRING(pctx) (pctx->token.value.as_textregion.base)
b6d52ee5bea1b9d9074698e693b49ce96edff47bMark Andrews/* Check a return value. */
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafsson if (result != ISC_R_SUCCESS) goto cleanup; \
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafsson/* Clean up a configuration object if non-NULL. */
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafsson do { if ((obj) != NULL) cfg_obj_destroy(pctx, &(obj)); } while (0)
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafsson * Forward declarations of static functions.
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafssonparse_enum_or_other(cfg_parser_t *pctx, const cfg_type_t *enumtype,
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafsson const cfg_type_t *othertype, cfg_obj_t **ret);
a8f94d29b38872fbc6cf9a1a8223ff8453357da1Andreas Gustafssonparse_keyvalue(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
a8f94d29b38872fbc6cf9a1a8223ff8453357da1Andreas Gustafssonparse_optional_keyvalue(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
a8f94d29b38872fbc6cf9a1a8223ff8453357da1Andreas Gustafssonprint_keyvalue(cfg_printer_t *pctx, cfg_obj_t *obj);
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafssondoc_keyvalue(cfg_printer_t *pctx, const cfg_type_t *type);
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafssondoc_optional_keyvalue(cfg_printer_t *pctx, const cfg_type_t *type);
965605e238d96eb685b94df4d46d7185d1b6f121Mark Andrewsstatic cfg_type_t cfg_type_bracketed_namesockaddrkeylist;
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafssonstatic cfg_type_t cfg_type_bracketed_sockaddrlist;
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafssonstatic cfg_type_t cfg_type_bracketed_sockaddrnameportlist;
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafssonstatic cfg_type_t cfg_type_controls_sockaddr;
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafssonstatic cfg_type_t cfg_type_destinationlist;
static const char *matchtype_enums[] = {
"bracketed_sockaddrlist", cfg_parse_bracketed_list, cfg_print_bracketed_list, cfg_doc_bracketed_list,
"keylist", cfg_parse_bracketed_list, cfg_print_bracketed_list, cfg_doc_bracketed_list, &cfg_rep_list,
"trusted-keys", cfg_parse_bracketed_list, cfg_print_bracketed_list, cfg_doc_bracketed_list, &cfg_rep_list,
static const char *zonetype_enums[] = {
static const char *loglevel_enums[] = {
static const char *transferformat_enums[] = {
static isc_result_t
return (result);
static isc_result_t
return (result);
static isc_result_t
return (result);
"bracketed_sockaddrlist", cfg_parse_bracketed_list, cfg_print_bracketed_list, cfg_doc_bracketed_list,
* Clauses that can be found within the top level of the named.conf
static cfg_clausedef_t
namedconf_clauses[] = {
static cfg_clausedef_t
static cfg_clausedef_t
options_clauses[] = {
static cfg_clausedef_t
view_clauses[] = {
static cfg_clausedef_t
view_only_clauses[] = {
static cfg_clausedef_t
zone_clauses[] = {
static cfg_clausedef_t
zone_only_clauses[] = {
/* The top-level named.conf syntax. */
static cfg_clausedef_t *
namedconf_clausesets[] = {
static cfg_clausedef_t *
options_clausesets[] = {
static cfg_clausedef_t *
view_clausesets[] = {
static cfg_clausedef_t *
zone_clausesets[] = {
static cfg_clausedef_t
key_clauses[] = {
static cfg_clausedef_t *
key_clausesets[] = {
static cfg_clausedef_t
server_clauses[] = {
static cfg_clausedef_t *
server_clausesets[] = {
static cfg_clausedef_t
channel_clauses[] = {
static cfg_clausedef_t *
channel_clausesets[] = {
static cfg_clausedef_t
logging_clauses[] = {
static cfg_clausedef_t *
logging_clausesets[] = {
static isc_result_t
char *endp;
unsigned int len;
if (*endp == 0) {
return (ISC_R_SUCCESS);
return (ISC_R_FAILURE);
return (ISC_R_FAILURE);
return (ISC_R_FAILURE);
return (ISC_R_SUCCESS);
static isc_result_t
goto cleanup;
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
static isc_result_t
if (optional) {
goto cleanup;
return (result);
static isc_result_t
return (result);
static isc_result_t
static isc_result_t
static const char *dialup_enums[] = {
static isc_result_t
static isc_result_t
static isc_result_t
static cfg_clausedef_t
controls_clauses[] = {
static cfg_clausedef_t *
controls_clausesets[] = {
static isc_result_t
return (result);
static isc_result_t
unsigned int have_address = 0;
unsigned int have_port = 0;
INSIST(0);
port = 0;
&netaddr));
have_address++;
&port));
have_port++;
return (ISC_R_UNEXPECTEDTOKEN);
return (ISC_R_UNEXPECTEDTOKEN);
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
goto bad;
bad:
return (ISC_R_UNEXPECTEDTOKEN);
return (result);
static unsigned int controls_sockaddr_flags =
static isc_result_t
if (braces) {
return (result);
static isc_result_t
return (result);
static isc_result_t
return (result);
static isc_result_t
static isc_result_t
return (ISC_R_SUCCESS);
return (result);
static cfg_clausedef_t
lwres_clauses[] = {
static cfg_clausedef_t *
lwres_clausesets[] = {
static cfg_clausedef_t
rndcconf_options_clauses[] = {
static cfg_clausedef_t *
static cfg_clausedef_t
rndcconf_server_clauses[] = {
static cfg_clausedef_t *
static cfg_clausedef_t
rndcconf_clauses[] = {
static cfg_clausedef_t *
rndcconf_clausesets[] = {
static cfg_clausedef_t
rndckey_clauses[] = {
static cfg_clausedef_t *
rndckey_clausesets[] = {
static isc_result_t
&obj));
return (ISC_R_UNEXPECTEDTOKEN);
return (result);
static isc_result_t
return (ISC_R_UNEXPECTEDTOKEN);
return (result);