Commit 669e9657 authored by Andreas Gustafsson's avatar Andreas Gustafsson

Split off the named.conf grammar into a source module separate

from the configuration parser, to facilitate reuse of the latter for
parsing non-BIND configuration files
parent b3ebf6f2
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: named-checkconf.c,v 1.19 2001/10/02 22:53:35 gson Exp $ */
/* $Id: named-checkconf.c,v 1.20 2002/01/04 02:31:57 gson Exp $ */
#include <config.h>
......@@ -31,7 +31,7 @@
#include <isc/string.h>
#include <isc/util.h>
#include <isccfg/cfg.h>
#include <isccfg/namedconf.h>
#include <bind9/check.h>
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: aclconf.c,v 1.27 2001/04/12 21:02:46 tale Exp $ */
/* $Id: aclconf.c,v 1.28 2002/01/04 02:31:59 gson Exp $ */
#include <config.h>
......@@ -23,6 +23,8 @@
#include <isc/string.h> /* Required for HP/UX (and others?) */
#include <isc/util.h>
#include <isccfg/namedconf.h>
#include <dns/acl.h>
#include <dns/fixedname.h>
#include <dns/log.h>
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: config.c,v 1.23 2001/11/30 01:58:44 gson Exp $ */
/* $Id: config.c,v 1.24 2002/01/04 02:32:00 gson Exp $ */
#include <config.h>
......@@ -30,7 +30,7 @@
#include <isc/sockaddr.h>
#include <isc/util.h>
#include <isccfg/cfg.h>
#include <isccfg/namedconf.h>
#include <dns/fixedname.h>
#include <dns/name.h>
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: controlconf.c,v 1.36 2001/11/27 21:51:31 bwelling Exp $ */
/* $Id: controlconf.c,v 1.37 2002/01/04 02:32:01 gson Exp $ */
#include <config.h>
......@@ -31,7 +31,7 @@
#include <isc/timer.h>
#include <isc/util.h>
#include <isccfg/cfg.h>
#include <isccfg/namedconf.h>
#include <bind9/check.h>
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: lwresd.c,v 1.39 2001/11/30 01:58:46 gson Exp $ */
/* $Id: lwresd.c,v 1.40 2002/01/04 02:32:02 gson Exp $ */
/*
* Main program for the Lightweight Resolver Daemon.
......@@ -38,7 +38,7 @@
#include <isc/task.h>
#include <isc/util.h>
#include <isccfg/cfg.h>
#include <isccfg/namedconf.h>
#include <dns/log.h>
#include <dns/result.h>
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: server.c,v 1.366 2001/12/01 00:39:22 marka Exp $ */
/* $Id: server.c,v 1.367 2002/01/04 02:32:04 gson Exp $ */
#include <config.h>
......@@ -35,7 +35,7 @@
#include <isc/timer.h>
#include <isc/util.h>
#include <isccfg/cfg.h>
#include <isccfg/namedconf.h>
#include <bind9/check.h>
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rndc.c,v 1.89 2001/12/01 00:34:20 marka Exp $ */
/* $Id: rndc.c,v 1.90 2002/01/04 02:32:06 gson Exp $ */
/*
* Principal Author: DCL
......@@ -38,7 +38,7 @@
#include <isc/thread.h>
#include <isc/util.h>
#include <isccfg/cfg.h>
#include <isccfg/namedconf.h>
#include <isccc/alist.h>
#include <isccc/base64.h>
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: cfg_test.c,v 1.12 2001/10/22 23:50:31 bwelling Exp $ */
/* $Id: cfg_test.c,v 1.13 2002/01/04 02:32:07 gson Exp $ */
#include <config.h>
......@@ -26,7 +26,7 @@
#include <isc/string.h>
#include <isc/util.h>
#include <isccfg/cfg.h>
#include <isccfg/namedconf.h>
#include <dns/log.h>
......
......@@ -45,8 +45,6 @@ options {
use-id-pool <boolean>; // obsolete
use-ixfr <boolean>;
version ( <quoted_string> | none );
allow-notify { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
allow-recursion { <address_match_element>; ... };
allow-v6-synthesis { <address_match_element>; ... };
sortlist { <address_match_element>; ... };
......@@ -62,8 +60,6 @@ options {
additional-from-cache <boolean>;
query-source <querysource4>;
query-source-v6 <querysource6>;
notify-source ( <ipv4_address> | * ) [ port ( <integer> | * ) ];
notify-source-v6 ( <ipv6_address> | * ) [ port ( <integer> | * ) ];
cleaning-interval <integer>;
min-roots <integer>; // not implemented
lame-ttl <integer>;
......@@ -73,9 +69,14 @@ options {
max-cache-size <size_no_default>;
check-names <string> <string>; // not implemented
cache-file <quoted_string>;
suppress-initial-notify <boolean>; // not yet implemented
allow-query { <address_match_element>; ... };
allow-transfer { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
allow-notify { <address_match_element>; ... };
notify <notifytype>;
notify-source ( <ipv4_address> | * ) [ port ( <integer> | * ) ];
notify-source-v6 ( <ipv6_address> | * ) [ port ( <integer> | * ) ];
also-notify [ port <integer> ] { ( <ipv4_address> | <ipv6_address>
) [ port <integer> ]; ... };
dialup <dialuptype>;
......@@ -109,11 +110,11 @@ acl <string> { <address_match_element>; ... };
logging {
channel <string> {
file <logfile>;
file <log_file>;
syslog <optional_facility>;
null;
stderr;
severity <logseverity>;
severity <log_severity>;
print-time <boolean>;
print-severity <boolean>;
print-category <boolean>;
......@@ -132,7 +133,6 @@ view <string> <optional_class> {
zone <string> <optional_class> {
type ( master | slave | stub | hint | forward );
allow-update { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
file <quoted_string>;
ixfr-base <quoted_string>; // obsolete
ixfr-tmp-file <quoted_string>; // obsolete
......@@ -146,7 +146,13 @@ view <string> <optional_class> {
check-names <string>; // not implemented
allow-query { <address_match_element>; ... };
allow-transfer { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
allow-notify { <address_match_element>; ... };
notify <notifytype>;
notify-source ( <ipv4_address> | * ) [ port ( <integer> | *
) ];
notify-source-v6 ( <ipv6_address> | * ) [ port ( <integer>
| * ) ];
also-notify [ port <integer> ] { ( <ipv4_address> |
<ipv6_address> ) [ port <integer> ]; ... };
dialup <dialuptype>;
......@@ -183,8 +189,6 @@ view <string> <optional_class> {
};
trusted-keys { <string> <integer> <integer> <integer>
<quoted_string>; ... };
allow-notify { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
allow-recursion { <address_match_element>; ... };
allow-v6-synthesis { <address_match_element>; ... };
sortlist { <address_match_element>; ... };
......@@ -200,8 +204,6 @@ view <string> <optional_class> {
additional-from-cache <boolean>;
query-source <querysource4>;
query-source-v6 <querysource6>;
notify-source ( <ipv4_address> | * ) [ port ( <integer> | * ) ];
notify-source-v6 ( <ipv6_address> | * ) [ port ( <integer> | * ) ];
cleaning-interval <integer>;
min-roots <integer>; // not implemented
lame-ttl <integer>;
......@@ -211,9 +213,14 @@ view <string> <optional_class> {
max-cache-size <size_no_default>;
check-names <string> <string>; // not implemented
cache-file <quoted_string>;
suppress-initial-notify <boolean>; // not yet implemented
allow-query { <address_match_element>; ... };
allow-transfer { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
allow-notify { <address_match_element>; ... };
notify <notifytype>;
notify-source ( <ipv4_address> | * ) [ port ( <integer> | * ) ];
notify-source-v6 ( <ipv6_address> | * ) [ port ( <integer> | * ) ];
also-notify [ port <integer> ] { ( <ipv4_address> | <ipv6_address>
) [ port <integer> ]; ... };
dialup <dialuptype>;
......@@ -253,7 +260,6 @@ key <string> {
zone <string> <optional_class> {
type ( master | slave | stub | hint | forward );
allow-update { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
file <quoted_string>;
ixfr-base <quoted_string>; // obsolete
ixfr-tmp-file <quoted_string>; // obsolete
......@@ -266,7 +272,11 @@ zone <string> <optional_class> {
check-names <string>; // not implemented
allow-query { <address_match_element>; ... };
allow-transfer { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
allow-notify { <address_match_element>; ... };
notify <notifytype>;
notify-source ( <ipv4_address> | * ) [ port ( <integer> | * ) ];
notify-source-v6 ( <ipv6_address> | * ) [ port ( <integer> | * ) ];
also-notify [ port <integer> ] { ( <ipv4_address> | <ipv6_address>
) [ port <integer> ]; ... };
dialup <dialuptype>;
......
......@@ -13,7 +13,7 @@
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# $Id: Makefile.in,v 1.7 2001/09/20 15:16:57 marka Exp $
# $Id: Makefile.in,v 1.8 2002/01/04 02:32:10 gson Exp $
srcdir = @srcdir@
VPATH = @srcdir@
......@@ -41,10 +41,10 @@ LIBS = @LIBS@
SUBDIRS = include
# Alphabetically
OBJS = log.@O@ parser.@O@ version.@O@
OBJS = log.@O@ namedconf.@O@ parser.@O@ version.@O@
# Alphabetically
SRCS = log.c parser.c version.c
SRCS = log.c namedconf.c parser.c version.c
TARGETS = timestamp
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: cfg.h,v 1.30 2001/08/03 23:19:01 gson Exp $ */
/* $Id: cfg.h,v 1.31 2002/01/04 02:32:14 gson Exp $ */
#ifndef ISCCFG_CFG_H
#define ISCCFG_CFG_H 1
......@@ -28,7 +28,6 @@
* This is the new, table-driven, YACC-free configuration file parser.
*/
/***
*** Imports
***/
......@@ -398,21 +397,6 @@ cfg_obj_log(cfg_obj_t *obj, isc_log_t *lctx, int level, const char *fmt, ...)
* with the file name(s) and line number where 'obj' was defined.
*/
/*
* Configuration object types.
*/
LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_namedconf;
/* A complete named.conf file. */
LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_rndcconf;
/* A complete rndc.conf file. */
LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_rndckey;
/* A complete rndc.key file. */
LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_keyref;
/* A key reference, used as an ACL element */
ISC_LANG_ENDDECLS
#endif /* ISCCFG_CFG_H */
/*
* Copyright (C) 2000-2002 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: namedconf.h,v 1.1 2002/01/04 02:32:15 gson Exp $ */
#ifndef ISCCFG_NAMEDCONF_H
#define ISCCFG_NAMEDCONF_H 1
/*
* This module defines the named.conf, rndc.conf, and rndc.key grammars.
*/
#include <isccfg/cfg.h>
/*
* Configuration object types.
*/
LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_namedconf;
/* A complete named.conf file. */
LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_rndcconf;
/* A complete rndc.conf file. */
LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_rndckey;
/* A complete rndc.key file. */
LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_keyref;
/* A key reference, used as an ACL element */
#endif /* ISCCFG_CFG_H */
/*
* Copyright (C) 2000-2002 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: namedconf.c,v 1.1 2002/01/04 02:32:12 gson Exp $ */
#include <config.h>
#include <string.h>
#include <isc/lex.h>
#include <isc/result.h>
#include <isc/string.h>
#include <isc/util.h>
#include <isccfg/cfg.h>
#include <isccfg/grammar.h>
#include <isccfg/log.h>
/* Check a return value. */
#define CHECK(op) \
do { result = (op); \
if (result != ISC_R_SUCCESS) goto cleanup; \
} while (0)
/* Clean up a configuration object if non-NULL. */
#define CLEANUP_OBJ(obj) \
do { if ((obj) != NULL) cfg_obj_destroy(pctx, &(obj)); } while (0)
/*
* Forward declarations of static functions.
*/
static isc_result_t
parse_enum_or_other(cfg_parser_t *pctx, const cfg_type_t *enumtype,
const cfg_type_t *othertype, cfg_obj_t **ret);
static isc_result_t
parse_keyvalue(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
static isc_result_t
parse_optional_keyvalue(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
static void
print_keyvalue(cfg_printer_t *pctx, cfg_obj_t *obj);
static void
doc_keyvalue(cfg_printer_t *pctx, const cfg_type_t *type);
static void
doc_optional_keyvalue(cfg_printer_t *pctx, const cfg_type_t *type);
static cfg_type_t cfg_type_optional_port;
static cfg_type_t cfg_type_bracketed_aml;
static cfg_type_t cfg_type_acl;
static cfg_type_t cfg_type_portiplist;
static cfg_type_t cfg_type_bracketed_sockaddrlist;
static cfg_type_t cfg_type_optional_keyref;
static cfg_type_t cfg_type_options;
static cfg_type_t cfg_type_view;
static cfg_type_t cfg_type_viewopts;
static cfg_type_t cfg_type_key;
static cfg_type_t cfg_type_server;
static cfg_type_t cfg_type_controls;
static cfg_type_t cfg_type_bracketed_sockaddrkeylist;
static cfg_type_t cfg_type_querysource4;
static cfg_type_t cfg_type_querysource6;
static cfg_type_t cfg_type_querysource;
static cfg_type_t cfg_type_sockaddr4wild;
static cfg_type_t cfg_type_sockaddr6wild;
static cfg_type_t cfg_type_zone;
static cfg_type_t cfg_type_zoneopts;
static cfg_type_t cfg_type_logging;
static cfg_type_t cfg_type_optional_facility;
static cfg_type_t cfg_type_optional_class;
static cfg_type_t cfg_type_destinationlist;
static cfg_type_t cfg_type_size;
static cfg_type_t cfg_type_sizenodefault;
static cfg_type_t cfg_type_negated;
static cfg_type_t cfg_type_addrmatchelt;
static cfg_type_t cfg_type_server_key_kludge;
static cfg_type_t cfg_type_optional_facility;
static cfg_type_t cfg_type_logseverity;
static cfg_type_t cfg_type_logfile;
static cfg_type_t cfg_type_lwres;
static cfg_type_t cfg_type_controls_sockaddr;
static cfg_type_t cfg_type_notifytype;
static cfg_type_t cfg_type_dialuptype;
/* tkey-dhkey */
static cfg_tuplefielddef_t tkey_dhkey_fields[] = {
{ "name", &cfg_type_qstring, 0 },
{ "keyid", &cfg_type_uint32, 0 },
{ NULL, NULL, 0 }
};
static cfg_type_t cfg_type_tkey_dhkey = {
"tkey-dhkey", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple,
tkey_dhkey_fields
};
/* listen-on */
static cfg_tuplefielddef_t listenon_fields[] = {
{ "port", &cfg_type_optional_port, 0 },
{ "acl", &cfg_type_bracketed_aml, 0 },
{ NULL, NULL, 0 }
};
static cfg_type_t cfg_type_listenon = {
"listenon", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple, listenon_fields };
/* acl */
static cfg_tuplefielddef_t acl_fields[] = {
{ "name", &cfg_type_astring, 0 },
{ "value", &cfg_type_bracketed_aml, 0 },
{ NULL, NULL, 0 }
};
static cfg_type_t cfg_type_acl = {
"acl", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple, acl_fields };
/*
* "sockaddrkeylist", a list of socket addresses with optional keys
* and an optional default port, as used in the masters option.
* E.g.,
* "port 1234 { 10.0.0.1 key foo; 1::2 port 69; }"
*/
static cfg_tuplefielddef_t sockaddrkey_fields[] = {
{ "sockaddr", &cfg_type_sockaddr, 0 },
{ "key", &cfg_type_optional_keyref, 0 },
{ NULL, NULL, 0 },
};
static cfg_type_t cfg_type_sockaddrkey = {
"sockaddrkey", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple,
sockaddrkey_fields
};
static cfg_type_t cfg_type_bracketed_sockaddrkeylist = {
"bracketed_sockaddrkeylist", cfg_parse_bracketed_list,
cfg_print_bracketed_list, cfg_doc_bracketed_list, &cfg_rep_list, &cfg_type_sockaddrkey
};
static cfg_tuplefielddef_t sockaddrkeylist_fields[] = {
{ "port", &cfg_type_optional_port, 0 },
{ "addresses", &cfg_type_bracketed_sockaddrkeylist, 0 },
{ NULL, NULL, 0 }
};
static cfg_type_t cfg_type_sockaddrkeylist = {
"sockaddrkeylist", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple,
sockaddrkeylist_fields
};
/*
* A list of socket addresses with an optional default port,
* as used in the also-notify option. E.g.,
* "port 1234 { 10.0.0.1; 1::2 port 69; }"
*/
static cfg_tuplefielddef_t portiplist_fields[] = {
{ "port", &cfg_type_optional_port, 0 },
{ "addresses", &cfg_type_bracketed_sockaddrlist, 0 },
{ NULL, NULL, 0 }
};
static cfg_type_t cfg_type_portiplist = {
"portiplist", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple,
portiplist_fields
};
/*
* A public key, as in the "pubkey" statement.
*/
static cfg_tuplefielddef_t pubkey_fields[] = {
{ "flags", &cfg_type_uint32, 0 },
{ "protocol", &cfg_type_uint32, 0 },
{ "algorithm", &cfg_type_uint32, 0 },
{ "key", &cfg_type_qstring, 0 },
{ NULL, NULL, 0 }
};
static cfg_type_t cfg_type_pubkey = {
"pubkey", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple, pubkey_fields };
/*
* A list of RR types, used in grant statements.
* 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,
&cfg_rep_list, &cfg_type_astring
};
static const char *mode_enums[] = { "grant", "deny", NULL };
static cfg_type_t cfg_type_mode = {
"mode", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum, &cfg_rep_string,
&mode_enums
};
static const char *matchtype_enums[] = {
"name", "subdomain", "wildcard", "self", NULL };
static cfg_type_t cfg_type_matchtype = {
"matchtype", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum, &cfg_rep_string,
&matchtype_enums
};
/*
* A grant statement, used in the update policy.
*/
static cfg_tuplefielddef_t grant_fields[] = {
{ "mode", &cfg_type_mode, 0 },
{ "identity", &cfg_type_astring, 0 }, /* domain name */
{ "matchtype", &cfg_type_matchtype, 0 },
{ "name", &cfg_type_astring, 0 }, /* domain name */
{ "types", &cfg_type_rrtypelist, 0 },
{ NULL, NULL, 0 }
};
static cfg_type_t cfg_type_grant = {
"grant", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple, grant_fields };
static cfg_type_t cfg_type_updatepolicy = {
"update_policy", cfg_parse_bracketed_list, cfg_print_bracketed_list, cfg_doc_bracketed_list,
&cfg_rep_list, &cfg_type_grant
};
/*
* A view statement.
*/
static cfg_tuplefielddef_t view_fields[] = {
{ "name", &cfg_type_astring, 0 },
{ "class", &cfg_type_optional_class, 0 },
{ "options", &cfg_type_viewopts, 0 },
{ NULL, NULL, 0 }
};
static cfg_type_t cfg_type_view = {
"view", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple, view_fields };
/*
* A zone statement.
*/
static cfg_tuplefielddef_t zone_fields[] = {
{ "name", &cfg_type_astring, 0 },
{ "class", &cfg_type_optional_class, 0 },
{ "options", &cfg_type_zoneopts, 0 },
{ NULL, NULL, 0 }
};
static cfg_type_t cfg_type_zone = {
"zone", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple, zone_fields };
/*
* A "category" clause in the "logging" statement.
*/
static cfg_tuplefielddef_t category_fields[] = {
{ "name", &cfg_type_astring, 0 },
{ "destinations", &cfg_type_destinationlist,0 },
{ NULL, NULL, 0 }
};
static cfg_type_t cfg_type_category = {
"category", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple, category_fields };