namedconf.c revision b655c721b6db0fcdcee99648ceba32a84022dff3
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * Copyright (C) 2002, 2003 Internet Software Consortium.
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * Permission to use, copy, modify, and/or distribute this software for any
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * purpose with or without fee is hereby granted, provided that the above
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * copyright notice and this permission notice appear in all copies.
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * PERFORMANCE OF THIS SOFTWARE.
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt/* $Id: namedconf.c,v 1.101 2009/07/10 23:47:58 tbox Exp $ */
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt#define TOKEN_STRING(pctx) (pctx->token.value.as_textregion.base)
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt/*% Check a return value. */
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt/*% Clean up a configuration object if non-NULL. */
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt do { if ((obj) != NULL) cfg_obj_destroy(pctx, &(obj)); } while (0)
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * Forward declarations of static functions.
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntparse_enum_or_other(cfg_parser_t *pctx, const cfg_type_t *enumtype,
static isc_result_t
static isc_result_t
static cfg_clausedef_t
static isc_result_t
return (result);
static isc_result_t
return (result);
static const char *matchtype_enums[] = {
"bracketed_sockaddrlist", cfg_parse_bracketed_list, cfg_print_bracketed_list, cfg_doc_bracketed_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);
static isc_result_t
return (ISC_R_UNEXPECTEDTOKEN);
goto cleanup;
return (result);
* 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
bindkeys_clauses[] = {
static cfg_clausedef_t
options_clauses[] = {
static cfg_clausedef_t
view_clauses[] = {
static cfg_clausedef_t
view_only_clauses[] = {
static isc_result_t
return (result);
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[] = {
/*% The bind.keys syntax (trusted-keys/managed-keys only). */
static cfg_clausedef_t *
bindkeys_clausesets[] = {
static cfg_clausedef_t *
options_clausesets[] = {
static cfg_clausedef_t *
view_clausesets[] = {
static cfg_clausedef_t *
zone_clausesets[] = {
static cfg_clausedef_t *
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 cfg_clausedef_t
statservers_clauses[] = {
static cfg_clausedef_t *
statservers_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);