/*
- * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2002, 2003 Internet Software Consortium.
*
- * Permission to use, copy, modify, and distribute this software for any
+ * Permission to use, copy, modify, and/or 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.
*
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: namedconf.c,v 1.30.18.39 2008/03/27 03:44:15 marka Exp $ */
+/* $Id: namedconf.c,v 1.30.18.40 2008/03/27 23:45:57 tbox Exp $ */
/*! \file */
/*% Check a return value. */
#define CHECK(op) \
- do { result = (op); \
+ do { result = (op); \
if (result != ISC_R_SUCCESS) goto cleanup; \
} while (0)
* Note that the old parser allows quotes around the RR type names.
*/
static cfg_type_t cfg_type_rrtypelist = {
- "rrtypelist", cfg_parse_spacelist, cfg_print_spacelist, cfg_doc_terminal,
+ "rrtypelist", cfg_parse_spacelist, cfg_print_spacelist, cfg_doc_terminal,
&cfg_rep_list, &cfg_type_astring
};
*/
static cfg_tuplefielddef_t grant_fields[] = {
{ "mode", &cfg_type_mode, 0 },
- { "identity", &cfg_type_astring, 0 }, /* domain name */
+ { "identity", &cfg_type_astring, 0 }, /* domain name */
{ "matchtype", &cfg_type_matchtype, 0 },
{ "name", &cfg_type_astring, 0 }, /* domain name */
{ "types", &cfg_type_rrtypelist, 0 },
{ "class", &cfg_type_optional_wild_class, 0 },
{ "type", &cfg_type_optional_wild_type, 0 },
{ "name", &cfg_type_optional_wild_name, 0 },
- { "order", &cfg_type_ustring, 0 }, /* must be literal "order" */
+ { "order", &cfg_type_ustring, 0 }, /* must be literal "order" */
{ "ordering", &cfg_type_ustring, 0 },
{ NULL, NULL, 0 }
};
static isc_result_t
parse_port(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
isc_result_t result;
-
+
UNUSED(type);
CHECK(cfg_parse_uint32(pctx, NULL, ret));
{ "key", &cfg_type_key, CFG_CLAUSEFLAG_MULTI },
{ "zone", &cfg_type_zone, CFG_CLAUSEFLAG_MULTI },
/* only 1 DLZ per view allowed */
- { "dlz", &cfg_type_dynamically_loadable_zones, 0 },
+ { "dlz", &cfg_type_dynamically_loadable_zones, 0 },
{ "server", &cfg_type_server, CFG_CLAUSEFLAG_MULTI },
{ "trusted-keys", &cfg_type_trustedkeys, CFG_CLAUSEFLAG_MULTI },
{ NULL, NULL, 0 }
};
static cfg_tuplefielddef_t mustbesecure_fields[] = {
- { "name", &cfg_type_astring, 0 },
- { "value", &cfg_type_boolean, 0 },
- { NULL, NULL, 0 }
+ { "name", &cfg_type_astring, 0 },
+ { "value", &cfg_type_boolean, 0 },
+ { NULL, NULL, 0 }
};
static cfg_type_t cfg_type_mustbesecure = {
namedconf_or_view_clauses,
view_clauses,
zone_clauses,
- dynamically_loadable_zones_clauses,
+ dynamically_loadable_zones_clauses,
NULL
};
static cfg_type_t cfg_type_viewopts = {
NULL
};
static cfg_type_t cfg_type_zoneopts = {
- "zoneopts", cfg_parse_map, cfg_print_map,
+ "zoneopts", cfg_parse_map, cfg_print_map,
cfg_doc_map, &cfg_rep_map, zone_clausesets };
-
+
/*% The "dynamically loadable zones" statement syntax. */
-
+
static cfg_clausedef_t *
dynamically_loadable_zones_clausesets[] = {
dynamically_loadable_zones_clauses,
- NULL
+ NULL
};
static cfg_type_t cfg_type_dynamically_loadable_zones_opts = {
- "dynamically_loadable_zones_opts", cfg_parse_map,
+ "dynamically_loadable_zones_opts", cfg_parse_map,
cfg_print_map, cfg_doc_map, &cfg_rep_map,
- dynamically_loadable_zones_clausesets
+ dynamically_loadable_zones_clausesets
};
-
+
/*%
* Clauses that can be found within the 'key' statement.
*/
};
static cfg_type_t cfg_type_key = {
"key", cfg_parse_named_map, cfg_print_map,
- cfg_doc_map, &cfg_rep_map, key_clausesets
+ cfg_doc_map, &cfg_rep_map, key_clausesets
};
parse_maybe_optional_keyvalue(cfg_parser_t *pctx, const cfg_type_t *type,
isc_boolean_t optional, cfg_obj_t **ret)
{
- isc_result_t result;
+ isc_result_t result;
cfg_obj_t *obj = NULL;
const keyword_type_t *kw = type->of;
parse_enum_or_other(cfg_parser_t *pctx, const cfg_type_t *enumtype,
const cfg_type_t *othertype, cfg_obj_t **ret)
{
- isc_result_t result;
+ isc_result_t result;
CHECK(cfg_peektoken(pctx, 0));
if (pctx->token.type == isc_tokentype_string &&
cfg_is_enum(TOKEN_STRING(pctx), enumtype->of)) {
}
static cfg_type_t cfg_type_notifytype = {
"notifytype", parse_notify_type, cfg_print_ustring, doc_enum_or_other,
- &cfg_rep_string, notify_enums,
+ &cfg_rep_string, notify_enums,
};
static const char *ixfrdiff_enums[] = { "master", "slave", NULL };
static isc_result_t
parse_ixfrdiff_type(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
- return (parse_enum_or_other(pctx, type, &cfg_type_boolean, ret));
+ return (parse_enum_or_other(pctx, type, &cfg_type_boolean, ret));
}
static cfg_type_t cfg_type_ixfrdifftype = {
- "ixfrdiff", parse_ixfrdiff_type, cfg_print_ustring, doc_enum_or_other,
- &cfg_rep_string, ixfrdiff_enums,
+ "ixfrdiff", parse_ixfrdiff_type, cfg_print_ustring, doc_enum_or_other,
+ &cfg_rep_string, ixfrdiff_enums,
};
static keyword_type_t key_kw = { "key", &cfg_type_astring };
/*%
* A "controls" statement is represented as a map with the multivalued
- * "inet" and "unix" clauses.
+ * "inet" and "unix" clauses.
*/
static keyword_type_t controls_allow_kw = {
"address") == 0)
{
/* read "address" */
- CHECK(cfg_gettoken(pctx, 0));
+ CHECK(cfg_gettoken(pctx, 0));
CHECK(cfg_parse_rawaddr(pctx, *flagp,
&netaddr));
have_address++;
} else if (strcasecmp(TOKEN_STRING(pctx), "port") == 0)
{
/* read "port" */
- CHECK(cfg_gettoken(pctx, 0));
+ CHECK(cfg_gettoken(pctx, 0));
CHECK(cfg_parse_rawport(pctx,
CFG_ADDR_WILDOK,
&port));
static isc_result_t
parse_addrmatchelt(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
- isc_result_t result;
+ isc_result_t result;
UNUSED(type);
CHECK(cfg_peektoken(pctx, CFG_LEXOPT_QSTRING));
parse_logfile(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
isc_result_t result;
cfg_obj_t *obj = NULL;
- const cfg_tuplefielddef_t *fields = type->of;
+ const cfg_tuplefielddef_t *fields = type->of;
- CHECK(cfg_create_tuple(pctx, type, &obj));
+ CHECK(cfg_create_tuple(pctx, type, &obj));
/* Parse the mandatory "file" field */
CHECK(cfg_parse_obj(pctx, fields[0].type, &obj->value.tuple[0]));
for (;;) {
CHECK(cfg_peektoken(pctx, 0));
if (pctx->token.type == isc_tokentype_string) {
- CHECK(cfg_gettoken(pctx, 0));
+ CHECK(cfg_gettoken(pctx, 0));
if (strcasecmp(TOKEN_STRING(pctx),
"versions") == 0 &&
obj->value.tuple[1] == NULL) {
return (ISC_R_SUCCESS);
cleanup:
- CLEANUP_OBJ(obj);
+ CLEANUP_OBJ(obj);
return (result);
}
parse_sockaddrnameport(cfg_parser_t *pctx, const cfg_type_t *type,
cfg_obj_t **ret)
{
- isc_result_t result;
+ isc_result_t result;
cfg_obj_t *obj = NULL;
UNUSED(type);
CHECK(cfg_parse_sockaddr(pctx, &cfg_type_sockaddr, ret));
else {
const cfg_tuplefielddef_t *fields =
- cfg_type_nameport.of;
+ cfg_type_nameport.of;
CHECK(cfg_create_tuple(pctx, &cfg_type_nameport,
- &obj));
+ &obj));
CHECK(cfg_parse_obj(pctx, fields[0].type,
&obj->value.tuple[0]));
CHECK(cfg_parse_obj(pctx, fields[1].type,
return (ISC_R_UNEXPECTEDTOKEN);
}
cleanup:
- CLEANUP_OBJ(obj);
+ CLEANUP_OBJ(obj);
return (result);
}
parse_masterselement(cfg_parser_t *pctx, const cfg_type_t *type,
cfg_obj_t **ret)
{
- isc_result_t result;
+ isc_result_t result;
cfg_obj_t *obj = NULL;
UNUSED(type);
return (ISC_R_UNEXPECTEDTOKEN);
}
cleanup:
- CLEANUP_OBJ(obj);
+ CLEANUP_OBJ(obj);
return (result);
}