namedconf.c revision b0b4ba753363812ac8de2353dedf02bf1cc9ffe8
/*
* Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2002, 2003 Internet Software Consortium.
*
* 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 ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC 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.82 2008/01/17 21:38:24 marka Exp $ */
/*! \file */
#include <config.h>
#include <string.h>
/*% Check a return value. */
} while (0)
/*% Clean up a configuration object if non-NULL. */
#define CLEANUP_OBJ(obj) \
/*%
* Forward declarations of static functions.
*/
static isc_result_t
static isc_result_t
static isc_result_t
static void
static void
static void
static cfg_type_t cfg_type_acl;
static cfg_type_t cfg_type_addrmatchelt;
static cfg_type_t cfg_type_bracketed_aml;
static cfg_type_t cfg_type_controls;
static cfg_type_t cfg_type_controls_sockaddr;
static cfg_type_t cfg_type_destinationlist;
static cfg_type_t cfg_type_dialuptype;
static cfg_type_t cfg_type_ixfrdifftype;
static cfg_type_t cfg_type_key;
static cfg_type_t cfg_type_logfile;
static cfg_type_t cfg_type_logging;
static cfg_type_t cfg_type_logseverity;
static cfg_type_t cfg_type_lwres;
static cfg_type_t cfg_type_masterselement;
static cfg_type_t cfg_type_nameportiplist;
static cfg_type_t cfg_type_negated;
static cfg_type_t cfg_type_notifytype;
static cfg_type_t cfg_type_optional_allow;
static cfg_type_t cfg_type_optional_class;
static cfg_type_t cfg_type_optional_facility;
static cfg_type_t cfg_type_optional_keyref;
static cfg_type_t cfg_type_optional_port;
static cfg_type_t cfg_type_options;
static cfg_type_t cfg_type_portiplist;
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_server;
static cfg_type_t cfg_type_server_key_kludge;
static cfg_type_t cfg_type_size;
static cfg_type_t cfg_type_sizenodefault;
static cfg_type_t cfg_type_sockaddr4wild;
static cfg_type_t cfg_type_sockaddr6wild;
static cfg_type_t cfg_type_statschannels;
static cfg_type_t cfg_type_view;
static cfg_type_t cfg_type_viewopts;
static cfg_type_t cfg_type_zone;
static cfg_type_t cfg_type_zoneopts;
/*
* Clauses that can be found in a 'dynamically loadable zones' statement
*/
static cfg_clausedef_t
{ "database", &cfg_type_astring, 0 },
};
/*
* A dynamically loadable zones statement.
*/
static cfg_tuplefielddef_t dynamically_loadable_zones_fields[] = {
{ "name", &cfg_type_astring, 0 },
{ "options", &cfg_type_dynamically_loadable_zones_opts, 0 },
};
static cfg_type_t cfg_type_dynamically_loadable_zones = {
};
/*% tkey-dhkey */
static cfg_tuplefielddef_t tkey_dhkey_fields[] = {
{ "name", &cfg_type_qstring, 0 },
{ "keyid", &cfg_type_uint32, 0 },
};
static cfg_type_t cfg_type_tkey_dhkey = {
};
/*% listen-on */
static cfg_tuplefielddef_t listenon_fields[] = {
{ "port", &cfg_type_optional_port, 0 },
{ "acl", &cfg_type_bracketed_aml, 0 },
};
static cfg_type_t cfg_type_listenon = {
/*% acl */
static cfg_tuplefielddef_t acl_fields[] = {
{ "name", &cfg_type_astring, 0 },
{ "value", &cfg_type_bracketed_aml, 0 },
};
static cfg_type_t cfg_type_acl = {
/*% masters */
static cfg_tuplefielddef_t masters_fields[] = {
{ "name", &cfg_type_astring, 0 },
{ "port", &cfg_type_optional_port, 0 },
{ "addresses", &cfg_type_bracketed_namesockaddrkeylist, 0 },
};
static cfg_type_t cfg_type_masters = {
/*%
* "sockaddrkeylist", a list of socket addresses with optional keys
* and an optional default port, as used in the masters option.
* E.g.,
* "port 1234 { mymasters; 10.0.0.1 key foo; 1::2 port 69; }"
*/
static cfg_tuplefielddef_t namesockaddrkey_fields[] = {
{ "masterselement", &cfg_type_masterselement, 0 },
{ "key", &cfg_type_optional_keyref, 0 },
};
static cfg_type_t cfg_type_namesockaddrkey = {
};
static cfg_type_t cfg_type_bracketed_namesockaddrkeylist = {
"bracketed_namesockaddrkeylist", cfg_parse_bracketed_list,
};
static cfg_tuplefielddef_t namesockaddrkeylist_fields[] = {
{ "port", &cfg_type_optional_port, 0 },
{ "addresses", &cfg_type_bracketed_namesockaddrkeylist, 0 },
};
static cfg_type_t cfg_type_namesockaddrkeylist = {
};
/*%
* 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 },
};
static cfg_type_t cfg_type_portiplist = {
};
/*%
* 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 },
};
static cfg_type_t cfg_type_pubkey = {
/*%
* 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 = {
};
static cfg_type_t cfg_type_mode = {
};
static const char *matchtype_enums[] = {
"name", "subdomain", "wildcard", "self", "selfsub", "selfwild",
"krb5-self", "ms-self", "krb5-subdomain", "ms-subdomain",
static cfg_type_t cfg_type_matchtype = {
};
/*%
* A grant statement, used in the update policy.
*/
static cfg_tuplefielddef_t grant_fields[] = {
{ "mode", &cfg_type_mode, 0 },
{ "matchtype", &cfg_type_matchtype, 0 },
{ "types", &cfg_type_rrtypelist, 0 },
};
static cfg_type_t cfg_type_grant = {
static cfg_type_t cfg_type_updatepolicy = {
};
/*%
* 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 },
};
static cfg_type_t cfg_type_view = {
/*%
* 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 },
};
static cfg_type_t cfg_type_zone = {
/*%
* A "category" clause in the "logging" statement.
*/
static cfg_tuplefielddef_t category_fields[] = {
{ "name", &cfg_type_astring, 0 },
{ "destinations", &cfg_type_destinationlist,0 },
};
static cfg_type_t cfg_type_category = {
/*%
* A trusted key, as used in the "trusted-keys" statement.
*/
static cfg_tuplefielddef_t trustedkey_fields[] = {
{ "name", &cfg_type_astring, 0 },
{ "flags", &cfg_type_uint32, 0 },
{ "protocol", &cfg_type_uint32, 0 },
{ "algorithm", &cfg_type_uint32, 0 },
{ "key", &cfg_type_qstring, 0 },
};
static cfg_type_t cfg_type_trustedkey = {
};
static cfg_type_t cfg_type_optional_wild_class = {
};
static cfg_type_t cfg_type_optional_wild_type = {
"optional_wild_type", parse_optional_keyvalue,
};
static cfg_type_t cfg_type_optional_wild_name = {
"optional_wild_name", parse_optional_keyvalue,
};
/*%
* An rrset ordering element.
*/
static cfg_tuplefielddef_t rrsetorderingelement_fields[] = {
{ "class", &cfg_type_optional_wild_class, 0 },
{ "type", &cfg_type_optional_wild_type, 0 },
{ "name", &cfg_type_optional_wild_name, 0 },
{ "ordering", &cfg_type_ustring, 0 },
};
static cfg_type_t cfg_type_rrsetorderingelement = {
};
/*%
* A global or view "check-names" option. Note that the zone
* "check-names" option has a different syntax.
*/
static cfg_type_t cfg_type_checktype = {
};
static cfg_type_t cfg_type_checkmode = {
};
static cfg_tuplefielddef_t checknames_fields[] = {
{ "type", &cfg_type_checktype, 0 },
{ "mode", &cfg_type_checkmode, 0 },
};
static cfg_type_t cfg_type_checknames = {
};
static cfg_type_t cfg_type_bracketed_sockaddrlist = {
"bracketed_sockaddrlist", cfg_parse_bracketed_list, cfg_print_bracketed_list, cfg_doc_bracketed_list,
};
static cfg_type_t cfg_type_rrsetorder = {
};
static cfg_type_t cfg_type_optional_port = {
};
/*% A list of keys, as in the "key" clause of the controls statement. */
static cfg_type_t cfg_type_keylist = {
"keylist", cfg_parse_bracketed_list, cfg_print_bracketed_list, cfg_doc_bracketed_list, &cfg_rep_list,
};
static cfg_type_t cfg_type_trustedkeys = {
"trusted-keys", cfg_parse_bracketed_list, cfg_print_bracketed_list, cfg_doc_bracketed_list, &cfg_rep_list,
};
static cfg_type_t cfg_type_forwardtype = {
};
static const char *zonetype_enums[] = {
static cfg_type_t cfg_type_zonetype = {
};
static const char *loglevel_enums[] = {
static cfg_type_t cfg_type_loglevel = {
};
static const char *transferformat_enums[] = {
static cfg_type_t cfg_type_transferformat = {
};
/*%
* The special keyword "none", as used in the pid-file option.
*/
static void
}
static cfg_type_t cfg_type_none = {
};
/*%
* A quoted string or the special keyword "none". Used in the pid-file option.
*/
static isc_result_t
{
return (result);
}
static void
}
static cfg_type_t cfg_type_qstringornone = {
/*%
* keyword hostname
*/
static void
}
static cfg_type_t cfg_type_hostname = {
};
/*%
* "server-id" argument.
*/
static isc_result_t
{
}
return (result);
}
static void
}
static cfg_type_t cfg_type_serverid = {
/*%
* Port list.
*/
static isc_result_t
}
return (result);
}
static cfg_type_t cfg_type_port = {
};
static cfg_type_t cfg_type_bracketed_portlist = {
"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
* file only.
*/
static cfg_clausedef_t
namedconf_clauses[] = {
{ "options", &cfg_type_options, 0 },
{ "logging", &cfg_type_logging, 0 },
{ "statistics-channels", &cfg_type_statschannels,
};
/*%
* Clauses that can occur at the top level or in the view
* statement, but not in the options block.
*/
static cfg_clausedef_t
/* only 1 DLZ per view allowed */
{ "dlz", &cfg_type_dynamically_loadable_zones, 0 },
};
/*%
* Clauses that can be found within the 'options' statement.
*/
static cfg_clausedef_t
options_clauses[] = {
{ "avoid-v4-udp-ports", &cfg_type_bracketed_portlist, 0 },
{ "avoid-v6-udp-ports", &cfg_type_bracketed_portlist, 0 },
{ "blackhole", &cfg_type_bracketed_aml, 0 },
{ "coresize", &cfg_type_size, 0 },
{ "datasize", &cfg_type_size, 0 },
{ "dump-file", &cfg_type_qstring, 0 },
{ "files", &cfg_type_size, 0 },
{ "heartbeat-interval", &cfg_type_uint32, 0 },
{ "hostname", &cfg_type_qstringornone, 0 },
{ "interface-interval", &cfg_type_uint32, 0 },
{ "match-mapped-addresses", &cfg_type_boolean, 0 },
{ "memstatistics-file", &cfg_type_qstring, 0 },
{ "memstatistics", &cfg_type_boolean, 0 },
{ "pid-file", &cfg_type_qstringornone, 0 },
{ "port", &cfg_type_uint32, 0 },
{ "querylog", &cfg_type_boolean, 0 },
{ "recursing-file", &cfg_type_qstring, 0 },
{ "random-device", &cfg_type_qstring, 0 },
{ "recursive-clients", &cfg_type_uint32, 0 },
{ "serial-query-rate", &cfg_type_uint32, 0 },
{ "server-id", &cfg_type_serverid, 0 },
{ "stacksize", &cfg_type_size, 0 },
{ "statistics-file", &cfg_type_qstring, 0 },
{ "tcp-clients", &cfg_type_uint32, 0 },
{ "tcp-listen-queue", &cfg_type_uint32, 0 },
{ "tkey-dhkey", &cfg_type_tkey_dhkey, 0 },
{ "tkey-gssapi-credential", &cfg_type_qstring, 0 },
{ "tkey-domain", &cfg_type_qstring, 0 },
{ "transfers-per-ns", &cfg_type_uint32, 0 },
{ "transfers-in", &cfg_type_uint32, 0 },
{ "transfers-out", &cfg_type_uint32, 0 },
{ "use-ixfr", &cfg_type_boolean, 0 },
{ "version", &cfg_type_qstringornone, 0 },
{ "flush-zones-on-shutdown", &cfg_type_boolean, 0 },
};
static cfg_type_t cfg_type_namelist = {
static cfg_type_t cfg_type_optional_exclude = {
static cfg_type_t cfg_type_algorithmlist = {
static cfg_tuplefielddef_t disablealgorithm_fields[] = {
{ "name", &cfg_type_astring, 0 },
{ "algorithms", &cfg_type_algorithmlist, 0 },
};
static cfg_type_t cfg_type_disablealgorithm = {
};
static cfg_tuplefielddef_t mustbesecure_fields[] = {
{ "name", &cfg_type_astring, 0 },
{ "value", &cfg_type_boolean, 0 },
};
static cfg_type_t cfg_type_mustbesecure = {
};
static cfg_type_t cfg_type_masterformat = {
};
/*%
* dnssec-lookaside
*/
static cfg_type_t cfg_type_trustanchor = {
};
static cfg_tuplefielddef_t lookaside_fields[] = {
{ "domain", &cfg_type_astring, 0 },
{ "trust-anchor", &cfg_type_trustanchor, 0 },
};
static cfg_type_t cfg_type_lookaside = {
};
/*%
* Clauses that can be found within the 'view' statement,
* with defaults in the 'options' statement.
*/
static cfg_clausedef_t
view_clauses[] = {
{ "allow-query-cache", &cfg_type_bracketed_aml, 0 },
{ "allow-query-cache-on", &cfg_type_bracketed_aml, 0 },
{ "allow-recursion", &cfg_type_bracketed_aml, 0 },
{ "allow-recursion-on", &cfg_type_bracketed_aml, 0 },
{ "allow-v6-synthesis", &cfg_type_bracketed_aml,
{ "sortlist", &cfg_type_bracketed_aml, 0 },
{ "minimal-responses", &cfg_type_boolean, 0 },
{ "recursion", &cfg_type_boolean, 0 },
{ "rrset-order", &cfg_type_rrsetorder, 0 },
{ "provide-ixfr", &cfg_type_boolean, 0 },
{ "request-ixfr", &cfg_type_boolean, 0 },
{ "additional-from-auth", &cfg_type_boolean, 0 },
{ "additional-from-cache", &cfg_type_boolean, 0 },
/*
* Note that the query-source option syntax is different
* from the other -source options.
*/
{ "query-source", &cfg_type_querysource4, 0 },
{ "query-source-v6", &cfg_type_querysource6, 0 },
{ "cleaning-interval", &cfg_type_uint32, 0 },
{ "lame-ttl", &cfg_type_uint32, 0 },
{ "max-ncache-ttl", &cfg_type_uint32, 0 },
{ "max-cache-ttl", &cfg_type_uint32, 0 },
{ "transfer-format", &cfg_type_transferformat, 0 },
{ "max-cache-size", &cfg_type_sizenodefault, 0 },
{ "cache-file", &cfg_type_qstring, 0 },
{ "preferred-glue", &cfg_type_astring, 0 },
{ "dual-stack-servers", &cfg_type_nameportiplist, 0 },
{ "edns-udp-size", &cfg_type_uint32, 0 },
{ "max-udp-size", &cfg_type_uint32, 0 },
{ "root-delegation-only", &cfg_type_optional_exclude, 0 },
{ "disable-algorithms", &cfg_type_disablealgorithm,
{ "dnssec-enable", &cfg_type_boolean, 0 },
{ "dnssec-validation", &cfg_type_boolean, 0 },
{ "dnssec-must-be-secure", &cfg_type_mustbesecure,
{ "dnssec-accept-expired", &cfg_type_boolean, 0 },
{ "ixfr-from-differences", &cfg_type_ixfrdifftype, 0 },
{ "acache-enable", &cfg_type_boolean, 0 },
{ "acache-cleaning-interval", &cfg_type_uint32, 0 },
{ "max-acache-size", &cfg_type_sizenodefault, 0 },
{ "clients-per-query", &cfg_type_uint32, 0 },
{ "max-clients-per-query", &cfg_type_uint32, 0 },
{ "empty-server", &cfg_type_astring, 0 },
{ "empty-contact", &cfg_type_astring, 0 },
{ "empty-zones-enable", &cfg_type_boolean, 0 },
{ "zero-no-soa-ttl-cache", &cfg_type_boolean, 0 },
{ "use-queryport-pool", &cfg_type_boolean, 0 },
{ "queryport-pool-ports", &cfg_type_uint32, 0 },
{ "queryport-pool-updateinterval", &cfg_type_uint32, 0 },
};
/*%
* Clauses that can be found within the 'view' statement only.
*/
static cfg_clausedef_t
view_only_clauses[] = {
{ "match-clients", &cfg_type_bracketed_aml, 0 },
{ "match-destinations", &cfg_type_bracketed_aml, 0 },
{ "match-recursive-only", &cfg_type_boolean, 0 },
};
/*%
* Clauses that can be found in a 'zone' statement,
* with defaults in the 'view' or 'options' statement.
*/
static cfg_clausedef_t
zone_clauses[] = {
{ "allow-notify", &cfg_type_bracketed_aml, 0 },
{ "allow-query", &cfg_type_bracketed_aml, 0 },
{ "allow-query-on", &cfg_type_bracketed_aml, 0 },
{ "allow-transfer", &cfg_type_bracketed_aml, 0 },
{ "allow-update", &cfg_type_bracketed_aml, 0 },
{ "allow-update-forwarding", &cfg_type_bracketed_aml, 0 },
{ "also-notify", &cfg_type_portiplist, 0 },
{ "alt-transfer-source", &cfg_type_sockaddr4wild, 0 },
{ "alt-transfer-source-v6", &cfg_type_sockaddr6wild, 0 },
{ "check-integrity", &cfg_type_boolean, 0 },
{ "check-mx", &cfg_type_checkmode, 0 },
{ "check-mx-cname", &cfg_type_checkmode, 0 },
{ "check-sibling", &cfg_type_boolean, 0 },
{ "check-srv-cname", &cfg_type_checkmode, 0 },
{ "check-wildcard", &cfg_type_boolean, 0 },
{ "dialup", &cfg_type_dialuptype, 0 },
{ "forward", &cfg_type_forwardtype, 0 },
{ "forwarders", &cfg_type_portiplist, 0 },
{ "key-directory", &cfg_type_qstring, 0 },
{ "masterfile-format", &cfg_type_masterformat, 0 },
{ "max-journal-size", &cfg_type_sizenodefault, 0 },
{ "max-refresh-time", &cfg_type_uint32, 0 },
{ "max-retry-time", &cfg_type_uint32, 0 },
{ "max-transfer-idle-in", &cfg_type_uint32, 0 },
{ "max-transfer-idle-out", &cfg_type_uint32, 0 },
{ "max-transfer-time-in", &cfg_type_uint32, 0 },
{ "max-transfer-time-out", &cfg_type_uint32, 0 },
{ "min-refresh-time", &cfg_type_uint32, 0 },
{ "min-retry-time", &cfg_type_uint32, 0 },
{ "multi-master", &cfg_type_boolean, 0 },
{ "notify", &cfg_type_notifytype, 0 },
{ "notify-delay", &cfg_type_uint32, 0 },
{ "notify-source", &cfg_type_sockaddr4wild, 0 },
{ "notify-source-v6", &cfg_type_sockaddr6wild, 0 },
{ "notify-to-soa", &cfg_type_boolean, 0 },
{ "sig-validity-interval", &cfg_type_uint32, 0 },
{ "transfer-source", &cfg_type_sockaddr4wild, 0 },
{ "transfer-source-v6", &cfg_type_sockaddr6wild, 0 },
{ "try-tcp-refresh", &cfg_type_boolean, 0 },
{ "update-check-ksk", &cfg_type_boolean, 0 },
{ "use-alt-transfer-source", &cfg_type_boolean, 0 },
{ "zero-no-soa-ttl", &cfg_type_boolean, 0 },
{ "zone-statistics", &cfg_type_boolean, 0 },
};
/*%
* Clauses that can be found in a 'zone' statement
* only.
*/
static cfg_clausedef_t
zone_only_clauses[] = {
{ "type", &cfg_type_zonetype, 0 },
{ "file", &cfg_type_qstring, 0 },
{ "journal", &cfg_type_qstring, 0 },
{ "masters", &cfg_type_namesockaddrkeylist, 0 },
{ "pubkey", &cfg_type_pubkey,
{ "update-policy", &cfg_type_updatepolicy, 0 },
{ "database", &cfg_type_astring, 0 },
{ "delegation-only", &cfg_type_boolean, 0 },
/*
* Note that the format of the check-names option is different between
*/
{ "check-names", &cfg_type_checkmode, 0 },
{ "ixfr-from-differences", &cfg_type_boolean, 0 },
};
/*% The top-level named.conf syntax. */
static cfg_clausedef_t *
namedconf_clausesets[] = {
};
};
/*% The "options" statement syntax. */
static cfg_clausedef_t *
options_clausesets[] = {
};
static cfg_type_t cfg_type_options = {
/*% The "view" statement syntax. */
static cfg_clausedef_t *
view_clausesets[] = {
};
static cfg_type_t cfg_type_viewopts = {
/*% The "zone" statement syntax. */
static cfg_clausedef_t *
zone_clausesets[] = {
};
static cfg_type_t cfg_type_zoneopts = {
/*% The "dynamically loadable zones" statement syntax. */
static cfg_clausedef_t *
};
"dynamically_loadable_zones_opts", cfg_parse_map,
};
/*%
* Clauses that can be found within the 'key' statement.
*/
static cfg_clausedef_t
key_clauses[] = {
{ "algorithm", &cfg_type_astring, 0 },
{ "secret", &cfg_type_astring, 0 },
};
static cfg_clausedef_t *
key_clausesets[] = {
};
static cfg_type_t cfg_type_key = {
};
/*%
* Clauses that can be found in a 'server' statement.
*/
static cfg_clausedef_t
server_clauses[] = {
{ "bogus", &cfg_type_boolean, 0 },
{ "provide-ixfr", &cfg_type_boolean, 0 },
{ "request-ixfr", &cfg_type_boolean, 0 },
{ "transfers", &cfg_type_uint32, 0 },
{ "transfer-format", &cfg_type_transferformat, 0 },
{ "keys", &cfg_type_server_key_kludge, 0 },
{ "edns", &cfg_type_boolean, 0 },
{ "edns-udp-size", &cfg_type_uint32, 0 },
{ "max-udp-size", &cfg_type_uint32, 0 },
{ "notify-source", &cfg_type_sockaddr4wild, 0 },
{ "notify-source-v6", &cfg_type_sockaddr6wild, 0 },
{ "query-source", &cfg_type_querysource4, 0 },
{ "query-source-v6", &cfg_type_querysource6, 0 },
{ "transfer-source", &cfg_type_sockaddr4wild, 0 },
{ "transfer-source-v6", &cfg_type_sockaddr6wild, 0 },
};
static cfg_clausedef_t *
server_clausesets[] = {
};
static cfg_type_t cfg_type_server = {
};
/*%
* Clauses that can be found in a 'channel' clause in the
* 'logging' statement.
*
* These have some additional constraints that need to be
* checked after parsing:
*
*/
static cfg_clausedef_t
channel_clauses[] = {
/* Destinations. We no longer require these to be first. */
{ "file", &cfg_type_logfile, 0 },
{ "syslog", &cfg_type_optional_facility, 0 },
{ "null", &cfg_type_void, 0 },
{ "stderr", &cfg_type_void, 0 },
/* Options. We now accept these for the null channel, too. */
{ "severity", &cfg_type_logseverity, 0 },
{ "print-time", &cfg_type_boolean, 0 },
{ "print-severity", &cfg_type_boolean, 0 },
{ "print-category", &cfg_type_boolean, 0 },
};
static cfg_clausedef_t *
channel_clausesets[] = {
};
static cfg_type_t cfg_type_channel = {
};
/*% A list of log destination, used in the "category" clause. */
static cfg_type_t cfg_type_destinationlist = {
&cfg_rep_list, &cfg_type_astring };
/*%
* Clauses that can be found in a 'logging' statement.
*/
static cfg_clausedef_t
logging_clauses[] = {
};
static cfg_clausedef_t *
logging_clausesets[] = {
};
static cfg_type_t cfg_type_logging = {
static isc_result_t
char *endp;
unsigned int len;
if (*endp == 0) {
return (ISC_R_SUCCESS);
}
return (ISC_R_FAILURE);
case 'k':
case 'K':
unit = 1024;
break;
case 'm':
case 'M':
break;
case 'g':
case 'G':
break;
default:
return (ISC_R_FAILURE);
}
return (ISC_R_FAILURE);
return (ISC_R_SUCCESS);
}
static isc_result_t
goto cleanup;
}
return (ISC_R_SUCCESS);
return (result);
}
/*%
* A size value (number + optional unit).
*/
static cfg_type_t cfg_type_sizeval = {
&cfg_rep_uint64, NULL };
/*%
* A size, "unlimited", or "default".
*/
static isc_result_t
}
static cfg_type_t cfg_type_size = {
};
/*%
* A size or "unlimited", but not "default".
*/
static cfg_type_t cfg_type_sizenodefault = {
};
/*%
* optional_keyvalue
*/
static isc_result_t
{
} else {
if (optional) {
} else {
goto cleanup;
}
}
return (result);
}
static isc_result_t
{
} else {
}
return (result);
}
static void
#if 0 /* XXX */
#endif
}
static isc_result_t
}
static isc_result_t
}
static void
}
static void
}
static void
}
static const char *dialup_enums[] = {
static isc_result_t
}
static cfg_type_t cfg_type_dialuptype = {
};
static isc_result_t
}
static cfg_type_t cfg_type_notifytype = {
};
static isc_result_t
}
static cfg_type_t cfg_type_ixfrdifftype = {
};
};
static cfg_type_t cfg_type_optional_keyref = {
};
/*%
* A "controls" statement is represented as a map with the multivalued
* "inet" and "unix" clauses.
*/
static keyword_type_t controls_allow_kw = {
"allow", &cfg_type_bracketed_aml };
static cfg_type_t cfg_type_controls_allow = {
"controls_allow", parse_keyvalue,
};
static keyword_type_t controls_keys_kw = {
"keys", &cfg_type_keylist };
static cfg_type_t cfg_type_controls_keys = {
"controls_keys", parse_optional_keyvalue,
};
static cfg_tuplefielddef_t inetcontrol_fields[] = {
{ "address", &cfg_type_controls_sockaddr, 0 },
{ "allow", &cfg_type_controls_allow, 0 },
{ "keys", &cfg_type_controls_keys, 0 },
};
static cfg_type_t cfg_type_inetcontrol = {
};
static keyword_type_t controls_perm_kw = {
"perm", &cfg_type_uint32 };
static cfg_type_t cfg_type_controls_perm = {
"controls_perm", parse_keyvalue,
};
static keyword_type_t controls_owner_kw = {
"owner", &cfg_type_uint32 };
static cfg_type_t cfg_type_controls_owner = {
"controls_owner", parse_keyvalue,
};
static keyword_type_t controls_group_kw = {
"group", &cfg_type_uint32 };
static cfg_type_t cfg_type_controls_group = {
"controls_allow", parse_keyvalue,
};
static cfg_tuplefielddef_t unixcontrol_fields[] = {
{ "path", &cfg_type_qstring, 0 },
{ "perm", &cfg_type_controls_perm, 0 },
{ "owner", &cfg_type_controls_owner, 0 },
{ "group", &cfg_type_controls_group, 0 },
{ "keys", &cfg_type_controls_keys, 0 },
};
static cfg_type_t cfg_type_unixcontrol = {
};
static cfg_clausedef_t
controls_clauses[] = {
};
static cfg_clausedef_t *
controls_clausesets[] = {
};
static cfg_type_t cfg_type_controls = {
};
/*%
* A "statistics-channels" statement is represented as a map with the
* multivalued "inet" clauses.
*/
static void
}
static cfg_type_t cfg_type_optional_allow = {
};
static cfg_tuplefielddef_t statserver_fields[] = {
{ "allow", &cfg_type_optional_allow, 0 },
};
static cfg_type_t cfg_type_statschannel = {
};
static cfg_clausedef_t
statservers_clauses[] = {
};
static cfg_clausedef_t *
statservers_clausesets[] = {
};
static cfg_type_t cfg_type_statschannels = {
};
/*%
* An optional class, as used in view and zone statements.
*/
static isc_result_t
else
return (result);
}
static cfg_type_t cfg_type_optional_class = {
};
static isc_result_t
unsigned int have_address = 0;
unsigned int have_port = 0;
if ((*flagp & CFG_ADDR_V4OK) != 0)
else if ((*flagp & CFG_ADDR_V6OK) != 0)
else
INSIST(0);
port = 0;
for (;;) {
"address") == 0)
{
/* read "address" */
&netaddr));
have_address++;
{
/* read "port" */
&port));
have_port++;
} else if (have_port == 0 && have_address == 0) {
} else {
"expected 'address' or 'port'");
return (ISC_R_UNEXPECTEDTOKEN);
}
} else
break;
}
have_address + have_port == 0) {
return (ISC_R_UNEXPECTEDTOKEN);
}
return (ISC_R_SUCCESS);
return (result);
}
static void
}
static cfg_type_t cfg_type_querysource4 = {
};
static cfg_type_t cfg_type_querysource6 = {
};
static cfg_type_t cfg_type_querysource = {
};
/*% addrmatchelt */
static isc_result_t
} else {
{
} else {
}
}
/* Nested match list. */
} else {
goto bad;
}
} else {
bad:
"expected IP match list element");
return (ISC_R_UNEXPECTEDTOKEN);
}
return (result);
}
/*%
* A negated address match list element (like "! 10.0.0.1").
* Somewhat sneakily, the caller is expected to parse the
* "!", but not to print it.
*/
static cfg_tuplefielddef_t negated_fields[] = {
{ "value", &cfg_type_addrmatchelt, 0 },
};
static void
}
static cfg_type_t cfg_type_negated = {
};
/*% An address match list element */
static cfg_type_t cfg_type_addrmatchelt = {
};
/*% A bracketed address match list */
static cfg_type_t cfg_type_bracketed_aml = {
};
/*%
* The socket address syntax in the "controls" statement is silly.
* It allows both socket address families, but also allows "*",
* whis is gratuitously interpreted as the IPv4 wildcard address.
*/
static unsigned int controls_sockaddr_flags =
static cfg_type_t cfg_type_controls_sockaddr = {
};
/*%
* Handle the special kludge syntax of the "keys" clause in the "server"
* statement, which takes a single key with or without braces and semicolon.
*/
static isc_result_t
{
/* Allow opening brace. */
}
if (braces) {
/* Skip semicolon if present. */
}
return (result);
}
static cfg_type_t cfg_type_server_key_kludge = {
};
/*%
* An optional logging facility.
*/
static isc_result_t
{
} else {
}
return (result);
}
static cfg_type_t cfg_type_optional_facility = {
/*%
* A log severity. Return as a string, except "debug N",
* which is returned as a keyword object.
*/
static cfg_type_t cfg_type_debuglevel = {
"debuglevel", parse_keyvalue,
};
static isc_result_t
} else {
/*
* The debug level is optional and defaults to 1.
* This makes little sense, but we support it for
* compatibility with BIND 8.
*/
}
} else {
}
return (result);
}
static cfg_type_t cfg_type_logseverity = {
/*%
* The "file" clause of the "channel" statement.
* This is yet another special case.
*/
static isc_result_t
}
static cfg_type_t cfg_type_logversions = {
};
static cfg_tuplefielddef_t logfile_fields[] = {
{ "file", &cfg_type_qstring, 0 },
{ "versions", &cfg_type_logversions, 0 },
{ "size", &cfg_type_size, 0 },
};
static isc_result_t
/* Parse the mandatory "file" field */
/* Parse "versions" and "size" fields in any order. */
for (;;) {
"versions") == 0 &&
"size") == 0 &&
} else {
break;
}
} else {
break;
}
}
/* Create void objects for missing optional values. */
return (ISC_R_SUCCESS);
return (result);
}
static void
}
}
}
static cfg_type_t cfg_type_logfile = {
};
/*% An IPv4 address with optional port, "*" accepted as wildcard. */
static cfg_type_t cfg_type_sockaddr4wild = {
};
/*% An IPv6 address with optional port, "*" accepted as wildcard. */
static cfg_type_t cfg_type_sockaddr6wild = {
};
/*%
* lwres
*/
static cfg_tuplefielddef_t lwres_view_fields[] = {
{ "name", &cfg_type_astring, 0 },
{ "class", &cfg_type_optional_class, 0 },
};
static cfg_type_t cfg_type_lwres_view = {
};
static cfg_type_t cfg_type_lwres_searchlist = {
&cfg_rep_list, &cfg_type_astring };
static cfg_clausedef_t
lwres_clauses[] = {
{ "listen-on", &cfg_type_portiplist, 0 },
{ "view", &cfg_type_lwres_view, 0 },
{ "search", &cfg_type_lwres_searchlist, 0 },
{ "ndots", &cfg_type_uint32, 0 },
};
static cfg_clausedef_t *
lwres_clausesets[] = {
};
static cfg_type_t cfg_type_lwres = {
};
/*%
* rndc
*/
static cfg_clausedef_t
rndcconf_options_clauses[] = {
{ "default-key", &cfg_type_astring, 0 },
{ "default-port", &cfg_type_uint32, 0 },
{ "default-server", &cfg_type_astring, 0 },
{ "default-source-address", &cfg_type_netaddr4wild, 0 },
{ "default-source-address-v6", &cfg_type_netaddr6wild, 0 },
};
static cfg_clausedef_t *
};
static cfg_type_t cfg_type_rndcconf_options = {
};
static cfg_clausedef_t
rndcconf_server_clauses[] = {
{ "key", &cfg_type_astring, 0 },
{ "port", &cfg_type_uint32, 0 },
{ "source-address", &cfg_type_netaddr4wild, 0 },
{ "source-address-v6", &cfg_type_netaddr6wild, 0 },
{ "addresses", &cfg_type_bracketed_sockaddrnameportlist, 0 },
};
static cfg_clausedef_t *
};
static cfg_type_t cfg_type_rndcconf_server = {
};
static cfg_clausedef_t
rndcconf_clauses[] = {
{ "options", &cfg_type_rndcconf_options, 0 },
};
static cfg_clausedef_t *
rndcconf_clausesets[] = {
};
};
static cfg_clausedef_t
rndckey_clauses[] = {
{ "key", &cfg_type_key, 0 },
};
static cfg_clausedef_t *
rndckey_clausesets[] = {
};
};
static cfg_tuplefielddef_t nameport_fields[] = {
{ "name", &cfg_type_astring, 0 },
{ "port", &cfg_type_optional_port, 0 },
};
static cfg_type_t cfg_type_nameport = {
};
static void
}
static isc_result_t
{
else {
const cfg_tuplefielddef_t *fields =
&obj));
}
} else {
"expected IP address or hostname");
return (ISC_R_UNEXPECTEDTOKEN);
}
return (result);
}
static cfg_type_t cfg_type_sockaddrnameport = {
};
"bracketed_sockaddrnameportlist", cfg_parse_bracketed_list,
};
/*%
* A list of socket addresses or name with an optional default port,
* as used in the dual-stack-servers option. E.g.,
* "port 1234 { dual-stack-servers.net; 10.0.0.1; 1::2 port 69; }"
*/
static cfg_tuplefielddef_t nameportiplist_fields[] = {
{ "port", &cfg_type_optional_port, 0 },
{ "addresses", &cfg_type_bracketed_sockaddrnameportlist, 0 },
};
static cfg_type_t cfg_type_nameportiplist = {
};
/*%
* masters element.
*/
static void
}
static isc_result_t
{
else
} else {
"expected IP address or masters name");
return (ISC_R_UNEXPECTEDTOKEN);
}
return (result);
}
static cfg_type_t cfg_type_masterselement = {
};