namedconf.c revision 40354825af06e1b97b74c0a27e3de30ee37a3899
/*
* Copyright (C) 2002-2017 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/*! \file */
#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <isccfg/namedconf.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 void
const cfg_type_t *othertype);
static isc_result_t
static isc_result_t
static isc_result_t
static void
static void
static void
static void
static void
#ifdef HAVE_GEOIP
static isc_result_t
static void
static void
#endif /* HAVE_GEOIP */
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_dlz;
static cfg_type_t cfg_type_dnstap;
static cfg_type_t cfg_type_dnstapoutput;
static cfg_type_t cfg_type_dyndb;
static cfg_type_t cfg_type_filter_aaaa;
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_maxttl;
static cfg_type_t cfg_type_minimal;
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_dscp;
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_optional_uint32;
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_sizeorpercent;
static cfg_type_t cfg_type_sizeval;
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_ttlval;
static cfg_type_t cfg_type_view;
static cfg_type_t cfg_type_viewopts;
static cfg_type_t cfg_type_zone;
/*% 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 },
{ "dscp", &cfg_type_optional_dscp, 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 },
{ "dscp", &cfg_type_optional_dscp, 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 },
{ "dscp", &cfg_type_optional_dscp, 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 lwresd 'listen-on' option. E.g., "{ 10.0.0.1; 1::2 port 69; }"
*/
static cfg_tuplefielddef_t portiplist_fields[] = {
{ "port", &cfg_type_optional_port, 0 },
{ "dscp", &cfg_type_optional_dscp, 0 },
{ "addresses", &cfg_type_bracketed_dscpsockaddrlist, 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 isc_result_t
}
return (result);
}
static isc_result_t
} else
return (result);
}
static void
}
static const char *matchtype_enums[] = {
"6to4-self", "external", "krb5-self", "krb5-subdomain", "ms-self",
"ms-subdomain", "name", "self", "selfsub", "selfwild", "subdomain",
};
static cfg_type_t cfg_type_matchtype = {
};
static cfg_type_t cfg_type_matchname = {
};
/*%
* 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 = {
};
static isc_result_t
{
}
return (ISC_R_NOMEMORY);
}
return (ISC_R_SUCCESS);
}
return (ISC_R_UNEXPECTEDTOKEN);
return (result);
}
static void
if (cfg_obj_isstring(obj))
else
}
static void
}
/*%
* 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 dnssec key, as used in the "trusted-keys" statement.
*/
static cfg_tuplefielddef_t dnsseckey_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_dnsseckey = {
};
/*%
* A managed key initialization specifier, as used in the
* "managed-keys" statement.
*/
static cfg_tuplefielddef_t managedkey_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_managedkey = {
};
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 = {
};
/*%
* 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_type_t cfg_type_warn = {
};
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_dscpsockaddrlist = {
"bracketed_sockaddrlist", cfg_parse_bracketed_list,
};
static cfg_type_t cfg_type_bracketed_sockaddrlist = {
"bracketed_sockaddrlist", cfg_parse_bracketed_list,
};
static const char *autodnssec_enums[] = {
};
static cfg_type_t cfg_type_autodnssec = {
};
static const char *dnssecupdatemode_enums[] = {
};
static cfg_type_t cfg_type_dnssecupdatemode = {
};
static const char *updatemethods_enums[] = {
};
static cfg_type_t cfg_type_updatemethod = {
};
/*
* zone-statistics: full, terse, or none.
*
* for backward compatibility, we also support boolean values.
* yes represents "full", no represents "terse". in the future we
* may change no to mean "none".
*/
static isc_result_t
}
static void
}
static cfg_type_t cfg_type_zonestat = {
};
static cfg_type_t cfg_type_rrsetorder = {
};
static cfg_type_t cfg_type_optional_dscp = {
};
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 = {
};
/*% A list of dnssec keys, as in "trusted-keys" */
static cfg_type_t cfg_type_dnsseckeys = {
};
/*%
* A list of managed key entries, as in "trusted-keys". Currently
* (9.7.0) this has a format similar to dnssec keys, except the keyname
* is followed by the keyword "initial-key". In future releases, this
* keyword may take other values indicating different methods for the
* key to be initialized.
*/
static cfg_type_t cfg_type_managedkeys = {
};
static cfg_type_t cfg_type_forwardtype = {
};
static const char *zonetype_enums[] = {
"delegation-only", "forward", "hint", "master", "redirect",
};
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 = {
};
/*%
* A boolean ("yes" or "no"), or the special keyword "auto".
* Used in the dnssec-validation option.
*/
static void
}
static cfg_type_t cfg_type_auto = {
};
static isc_result_t
return (result);
}
static void
else
}
static void
}
static cfg_type_t cfg_type_boolorauto = {
};
/*%
* keyword hostname
*/
static void
}
static cfg_type_t cfg_type_hostname = {
};
/*%
* "server-id" argument.
*/
static isc_result_t
{
if (result == ISC_R_SUCCESS)
return (result);
}
return (result);
}
static void
}
static cfg_type_t cfg_type_serverid = {
/*%
* Port list.
*/
static void
}
static cfg_tuplefielddef_t porttuple_fields[] = {
{ "loport", &cfg_type_uint32, 0 },
{ "hiport", &cfg_type_uint32, 0 },
};
static cfg_type_t cfg_type_porttuple = {
};
static isc_result_t
}
return (result);
}
static isc_result_t
else {
"expected integer or 'range'");
return (ISC_R_UNEXPECTEDTOKEN);
}
"low port '%u' must not be larger "
"than high port",
goto cleanup;
}
}
return (result);
}
static cfg_type_t cfg_type_portrange = {
};
static cfg_type_t cfg_type_bracketed_portlist = {
"bracketed_sockaddrlist", cfg_parse_bracketed_list,
};
static cfg_type_t cfg_type_cookiealg = {
};
/*%
* fetch-quota-params
*/
static cfg_tuplefielddef_t fetchquota_fields[] = {
{ "frequency", &cfg_type_uint32, 0 },
{ "low", &cfg_type_fixedpoint, 0 },
{ "high", &cfg_type_fixedpoint, 0 },
{ "discount", &cfg_type_fixedpoint, 0 },
};
static cfg_type_t cfg_type_fetchquota = {
};
/*%
* fetches-per-server or fetches-per-zone
*/
static isc_result_t
{
}
static void
}
static cfg_type_t cfg_type_responsetype = {
};
static cfg_tuplefielddef_t fetchesper_fields[] = {
{ "fetches", &cfg_type_uint32, 0 },
{ "response", &cfg_type_responsetype, 0 },
};
static cfg_type_t cfg_type_fetchesper = {
};
/*%
* Clauses that can be found within the top level of the named.conf
* file only.
*/
static cfg_clausedef_t
namedconf_clauses[] = {
{ "logging", &cfg_type_logging, 0 },
{ "options", &cfg_type_options, 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
};
/*%
* Clauses that can occur in the bind.keys file.
*/
static cfg_clausedef_t
bindkeys_clauses[] = {
};
static cfg_type_t cfg_type_fstrm_model = {
};
/*%
* Clauses that can be found within the 'options' statement.
*/
static cfg_clausedef_t
options_clauses[] = {
{ "automatic-interface-scan", &cfg_type_boolean, 0 },
{ "avoid-v4-udp-ports", &cfg_type_bracketed_portlist, 0 },
{ "avoid-v6-udp-ports", &cfg_type_bracketed_portlist, 0 },
{ "bindkeys-file", &cfg_type_qstring, 0 },
{ "blackhole", &cfg_type_bracketed_aml, 0 },
{ "cookie-algorithm", &cfg_type_cookiealg, 0 },
{ "cookie-secret", &cfg_type_sstring, 0 },
{ "coresize", &cfg_type_size, 0 },
{ "datasize", &cfg_type_size, 0 },
#ifdef HAVE_DNSTAP
{ "dnstap-output", &cfg_type_dnstapoutput, 0 },
{ "dnstap-identity", &cfg_type_serverid, 0 },
{ "dnstap-version", &cfg_type_qstringornone, 0 },
#else
{ "dnstap-output", &cfg_type_dnstapoutput,
{ "dnstap-identity", &cfg_type_serverid,
{ "dnstap-version", &cfg_type_qstringornone,
#endif
{ "dscp", &cfg_type_uint32, 0 },
{ "dump-file", &cfg_type_qstring, 0 },
{ "files", &cfg_type_size, 0 },
{ "flush-zones-on-shutdown", &cfg_type_boolean, 0 },
#ifdef HAVE_DNSTAP
{ "fstrm-set-buffer-hint", &cfg_type_uint32, 0 },
{ "fstrm-set-flush-timeout", &cfg_type_uint32, 0 },
{ "fstrm-set-input-queue-size", &cfg_type_uint32, 0 },
{ "fstrm-set-output-notify-threshold", &cfg_type_uint32, 0 },
{ "fstrm-set-output-queue-model", &cfg_type_fstrm_model, 0 },
{ "fstrm-set-output-queue-size", &cfg_type_uint32, 0 },
{ "fstrm-set-reopen-interval", &cfg_type_uint32, 0 },
#else
{ "fstrm-set-buffer-hint", &cfg_type_uint32,
{ "fstrm-set-flush-timeout", &cfg_type_uint32,
{ "fstrm-set-input-queue-size", &cfg_type_uint32,
{ "fstrm-set-output-notify-threshold", &cfg_type_uint32,
{ "fstrm-set-output-queue-model", &cfg_type_fstrm_model,
{ "fstrm-set-output-queue-size", &cfg_type_uint32,
{ "fstrm-set-reopen-interval", &cfg_type_uint32,
#endif /* HAVE_DNSTAP */
#ifdef HAVE_GEOIP
{ "geoip-directory", &cfg_type_qstringornone, 0 },
{ "geoip-use-ecs", &cfg_type_boolean, 0 },
#else
{ "geoip-directory", &cfg_type_qstringornone,
#endif /* HAVE_GEOIP */
{ "heartbeat-interval", &cfg_type_uint32, 0 },
{ "hostname", &cfg_type_qstringornone, 0 },
{ "interface-interval", &cfg_type_uint32, 0 },
{ "keep-response-order", &cfg_type_bracketed_aml, 0 },
{ "lock-file", &cfg_type_qstringornone, 0 },
{ "managed-keys-directory", &cfg_type_qstring, 0 },
{ "match-mapped-addresses", &cfg_type_boolean, 0 },
{ "max-rsa-exponent-size", &cfg_type_uint32, 0 },
{ "memstatistics", &cfg_type_boolean, 0 },
{ "memstatistics-file", &cfg_type_qstring, 0 },
{ "notify-rate", &cfg_type_uint32, 0 },
{ "pid-file", &cfg_type_qstringornone, 0 },
{ "port", &cfg_type_uint32, 0 },
{ "querylog", &cfg_type_boolean, 0 },
{ "random-device", &cfg_type_qstring, 0 },
{ "recursing-file", &cfg_type_qstring, 0 },
{ "recursive-clients", &cfg_type_uint32, 0 },
{ "reserved-sockets", &cfg_type_uint32, 0 },
{ "secroots-file", &cfg_type_qstring, 0 },
{ "serial-query-rate", &cfg_type_uint32, 0 },
{ "server-id", &cfg_type_serverid, 0 },
{ "session-keyalg", &cfg_type_astring, 0 },
{ "session-keyfile", &cfg_type_qstringornone, 0 },
{ "session-keyname", &cfg_type_astring, 0 },
{ "stacksize", &cfg_type_size, 0 },
{ "startup-notify-rate", &cfg_type_uint32, 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-domain", &cfg_type_qstring, 0 },
{ "tkey-gssapi-credential", &cfg_type_qstring, 0 },
{ "tkey-gssapi-keytab", &cfg_type_qstring, 0 },
{ "transfer-message-size", &cfg_type_uint32, 0 },
{ "transfers-in", &cfg_type_uint32, 0 },
{ "transfers-out", &cfg_type_uint32, 0 },
{ "transfers-per-ns", &cfg_type_uint32, 0 },
{ "use-v4-udp-ports", &cfg_type_bracketed_portlist, 0 },
{ "use-v6-udp-ports", &cfg_type_bracketed_portlist, 0 },
{ "version", &cfg_type_qstringornone, 0 },
};
static cfg_type_t cfg_type_namelist = {
};
static cfg_type_t cfg_type_optional_exclude = {
};
static keyword_type_t exceptionnames_kw = {
"except-from", &cfg_type_namelist
};
static cfg_type_t cfg_type_optional_exceptionnames = {
};
static cfg_tuplefielddef_t denyaddresses_fields[] = {
{ "acl", &cfg_type_bracketed_aml, 0 },
{ "except-from", &cfg_type_optional_exceptionnames, 0 },
};
static cfg_type_t cfg_type_denyaddresses = {
};
static cfg_tuplefielddef_t denyaliases_fields[] = {
{ "name", &cfg_type_namelist, 0 },
{ "except-from", &cfg_type_optional_exceptionnames, 0 },
};
static cfg_type_t cfg_type_denyaliases = {
};
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_type_t cfg_type_dsdigestlist = {
};
static cfg_tuplefielddef_t disabledsdigest_fields[] = {
{ "name", &cfg_type_astring, 0 },
{ "digests", &cfg_type_dsdigestlist, 0 },
};
static cfg_type_t cfg_type_disabledsdigest = {
};
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 = {
};
static cfg_type_t cfg_type_masterstyle = {
};
/*%
* dnstap {
* <message type> [query | response] ;
* ...
* }
*
* ... where message type is one of: client, resolver, auth, forwarder, all
*/
static const char *dnstap_types[] = {
};
static cfg_type_t cfg_type_dnstap_type = {
};
static cfg_type_t cfg_type_dnstap_mode = {
};
static cfg_tuplefielddef_t dnstap_fields[] = {
{ "type", &cfg_type_dnstap_type, 0 },
{ "mode", &cfg_type_dnstap_mode, 0 },
};
static cfg_type_t cfg_type_dnstap_entry = {
};
static cfg_type_t cfg_type_dnstap = {
};
/*%
* dnstap-output
*/
static cfg_type_t cfg_type_dtmode = {
};
static cfg_tuplefielddef_t dtout_fields[] = {
{ "mode", &cfg_type_dtmode, 0 },
{ "path", &cfg_type_qstring, 0 },
};
static cfg_type_t cfg_type_dnstapoutput = {
};
/*%
* response-policy {
* zone <string> [ policy (given|disabled|passthru|drop|tcp-only|
* nxdomain|nodata|cname <domain> ) ]
* [ recursive-only yes|no ] [ log yes|no ]
* [ max-policy-ttl number ] ;
* } [ recursive-only yes|no ] [ max-policy-ttl number ]
* [ break-dnssec yes|no ] [ min-ns-dots number ]
* [ qname-wait-recurse yes|no ] ;
*/
static void
const char * const *p;
/*
* This is cfg_doc_enum() without the trailing " )".
*/
cfg_print_cstr(pctx, *p);
if (p[1] != NULL)
}
}
static void
}
/*
* Parse
* given|disabled|passthru|drop|tcp-only|nxdomain|nodata|cname <domain>
*/
static isc_result_t
{
const cfg_tuplefielddef_t *fields;
/*
* parse cname domain only after "policy cname"
*/
} else {
}
return (ISC_R_SUCCESS);
return (result);
}
/*
* Parse a tuple consisting of any kind of required field followed
* by 2 or more optional keyvalues that can be in any order.
*/
static isc_result_t
{
const cfg_tuplefielddef_t *fields, *f;
int fn;
/*
* The zone first field is required and always first.
*/
for (;;) {
break;
TOKEN_STRING(pctx));
goto cleanup;
}
break;
}
}
}
return (ISC_R_SUCCESS);
return (result);
}
static void
unsigned int i;
const cfg_tuplefielddef_t *fields, *f;
continue;
if (i != 0) {
}
}
}
static void
const cfg_tuplefielddef_t *fields, *f;
if (f != fields) {
}
if (f != fields)
}
}
static cfg_type_t cfg_type_rpz_zone = {
};
/*
* "no-op" is an obsolete equivalent of "passthru".
*/
static const char *rpz_policies[] = {
"cname", "disabled", "drop", "given", "no-op", "nodata",
};
static cfg_type_t cfg_type_rpz_policy_name = {
};
static cfg_type_t cfg_type_rpz_cname = {
};
static cfg_tuplefielddef_t rpz_policy_fields[] = {
{ "policy name", &cfg_type_rpz_policy_name, 0 },
{ "cname", &cfg_type_rpz_cname, 0 },
};
static cfg_type_t cfg_type_rpz_policy = {
"policy tuple", cfg_parse_rpz_policy,
};
static cfg_tuplefielddef_t rpz_zone_fields[] = {
{ "zone name", &cfg_type_rpz_zone, 0 },
{ "log", &cfg_type_boolean, 0 },
{ "max-policy-ttl", &cfg_type_uint32, 0 },
{ "policy", &cfg_type_rpz_policy, 0 },
{ "recursive-only", &cfg_type_boolean, 0 },
};
static cfg_type_t cfg_type_rpz_tuple = {
"rpz tuple", cfg_parse_kv_tuple,
};
static cfg_type_t cfg_type_rpz_list = {
};
static cfg_tuplefielddef_t rpz_fields[] = {
{ "zone list", &cfg_type_rpz_list, 0 },
{ "break-dnssec", &cfg_type_boolean, 0 },
{ "max-policy-ttl", &cfg_type_uint32, 0 },
{ "min-ns-dots", &cfg_type_uint32, 0 },
{ "nsip-wait-recurse", &cfg_type_boolean, 0 },
{ "qname-wait-recurse", &cfg_type_boolean, 0 },
{ "recursive-only", &cfg_type_boolean, 0 },
};
static cfg_type_t cfg_type_rpz = {
"rpz", cfg_parse_kv_tuple,
};
/*
* Catalog zones
*/
static cfg_type_t cfg_type_catz_zone = {
};
static cfg_tuplefielddef_t catz_zone_fields[] = {
{ "zone name", &cfg_type_catz_zone, 0 },
{ "default-masters", &cfg_type_namesockaddrkeylist, 0 },
{ "zone-directory", &cfg_type_qstring, 0 },
{ "in-memory", &cfg_type_boolean, 0 },
{ "min-update-interval", &cfg_type_uint32, 0 },
};
static cfg_type_t cfg_type_catz_tuple = {
"catz tuple", cfg_parse_kv_tuple,
};
static cfg_type_t cfg_type_catz_list = {
};
static cfg_tuplefielddef_t catz_fields[] = {
{ "zone list", &cfg_type_catz_list, 0 },
};
static cfg_type_t cfg_type_catz = {
};
/*
* rate-limit
*/
static cfg_clausedef_t rrl_clauses[] = {
{ "all-per-second", &cfg_type_uint32, 0 },
{ "errors-per-second", &cfg_type_uint32, 0 },
{ "exempt-clients", &cfg_type_bracketed_aml, 0 },
{ "ipv4-prefix-length", &cfg_type_uint32, 0 },
{ "ipv6-prefix-length", &cfg_type_uint32, 0 },
{ "log-only", &cfg_type_boolean, 0 },
{ "max-table-size", &cfg_type_uint32, 0 },
{ "min-table-size", &cfg_type_uint32, 0 },
{ "nodata-per-second", &cfg_type_uint32, 0 },
{ "nxdomains-per-second", &cfg_type_uint32, 0 },
{ "qps-scale", &cfg_type_uint32, 0 },
{ "referrals-per-second", &cfg_type_uint32, 0 },
{ "responses-per-second", &cfg_type_uint32, 0 },
{ "slip", &cfg_type_uint32, 0 },
{ "window", &cfg_type_uint32, 0 },
};
static cfg_clausedef_t *rrl_clausesets[] = {
};
static cfg_type_t cfg_type_rrl = {
};
/*%
* dnssec-lookaside
*/
static void
else
}
static void
}
static cfg_type_t cfg_type_optional_trustanchor = {
};
static cfg_tuplefielddef_t lookaside_fields[] = {
{ "domain", &cfg_type_astring, 0 },
{ "trust-anchor", &cfg_type_optional_trustanchor, 0 },
};
static cfg_type_t cfg_type_lookaside = {
};
static isc_result_t
{
} else {
}
return (result);
}
static void
}
static cfg_type_t cfg_type_optional_uint32 = {
};
static cfg_tuplefielddef_t prefetch_fields[] = {
{ "trigger", &cfg_type_uint32, 0 },
{ "eligible", &cfg_type_optional_uint32, 0 },
};
static cfg_type_t cfg_type_prefetch = {
};
/*
* DNS64.
*/
static cfg_clausedef_t
dns64_clauses[] = {
{ "break-dnssec", &cfg_type_boolean, 0 },
{ "clients", &cfg_type_bracketed_aml, 0 },
{ "exclude", &cfg_type_bracketed_aml, 0 },
{ "mapped", &cfg_type_bracketed_aml, 0 },
{ "recursive-only", &cfg_type_boolean, 0 },
{ "suffix", &cfg_type_netaddr6, 0 },
};
static cfg_clausedef_t *
dns64_clausesets[] = {
};
static cfg_type_t cfg_type_dns64 = {
};
/*%
* Clauses that can be found within the 'view' statement,
* with defaults in the 'options' statement.
*/
static cfg_clausedef_t
view_clauses[] = {
{ "acache-cleaning-interval", &cfg_type_uint32, 0 },
{ "acache-enable", &cfg_type_boolean, 0 },
{ "additional-from-auth", &cfg_type_boolean, 0 },
{ "additional-from-cache", &cfg_type_boolean, 0 },
{ "allow-new-zones", &cfg_type_boolean, 0 },
{ "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,
{ "attach-cache", &cfg_type_astring, 0 },
{ "cache-file", &cfg_type_qstring, 0 },
{ "catalog-zones", &cfg_type_catz, 0 },
{ "cleaning-interval", &cfg_type_uint32, 0 },
{ "clients-per-query", &cfg_type_uint32, 0 },
{ "deny-answer-addresses", &cfg_type_denyaddresses, 0 },
{ "deny-answer-aliases", &cfg_type_denyaliases, 0 },
{ "disable-algorithms", &cfg_type_disablealgorithm,
{ "disable-ds-digests", &cfg_type_disabledsdigest,
{ "dns64-contact", &cfg_type_astring, 0 },
{ "dns64-server", &cfg_type_astring, 0 },
{ "dnssec-accept-expired", &cfg_type_boolean, 0 },
{ "dnssec-enable", &cfg_type_boolean, 0 },
{ "dnssec-must-be-secure", &cfg_type_mustbesecure,
{ "dnssec-validation", &cfg_type_boolorauto, 0 },
#ifdef HAVE_DNSTAP
{ "dnstap", &cfg_type_dnstap, 0 },
#else
#endif /* HAVE_DNSTAP */
{ "dual-stack-servers", &cfg_type_nameportiplist, 0 },
{ "edns-udp-size", &cfg_type_uint32, 0 },
{ "empty-contact", &cfg_type_astring, 0 },
{ "empty-server", &cfg_type_astring, 0 },
{ "empty-zones-enable", &cfg_type_boolean, 0 },
{ "fetch-quota-params", &cfg_type_fetchquota, 0 },
{ "fetches-per-server", &cfg_type_fetchesper, 0 },
{ "fetches-per-zone", &cfg_type_fetchesper, 0 },
#ifdef ALLOW_FILTER_AAAA
{ "filter-aaaa", &cfg_type_bracketed_aml, 0 },
{ "filter-aaaa-on-v4", &cfg_type_filter_aaaa, 0 },
{ "filter-aaaa-on-v6", &cfg_type_filter_aaaa, 0 },
#else
{ "filter-aaaa", &cfg_type_bracketed_aml,
{ "filter-aaaa-on-v4", &cfg_type_filter_aaaa,
{ "filter-aaaa-on-v6", &cfg_type_filter_aaaa,
#endif
{ "ixfr-from-differences", &cfg_type_ixfrdifftype, 0 },
{ "lame-ttl", &cfg_type_ttlval, 0 },
#ifdef HAVE_LMDB
{ "lmdb-mapsize", &cfg_type_sizeval, 0 },
#else
#endif
{ "max-acache-size", &cfg_type_sizenodefault, 0 },
{ "max-cache-size", &cfg_type_sizeorpercent, 0 },
{ "max-cache-ttl", &cfg_type_uint32, 0 },
{ "max-clients-per-query", &cfg_type_uint32, 0 },
{ "max-ncache-ttl", &cfg_type_uint32, 0 },
{ "max-recursion-depth", &cfg_type_uint32, 0 },
{ "max-recursion-queries", &cfg_type_uint32, 0 },
{ "max-udp-size", &cfg_type_uint32, 0 },
{ "message-compression", &cfg_type_boolean, 0 },
{ "minimal-any", &cfg_type_boolean, 0 },
{ "minimal-responses", &cfg_type_minimal, 0 },
{ "no-case-compress", &cfg_type_bracketed_aml, 0 },
{ "nocookie-udp-size", &cfg_type_uint32, 0 },
{ "nta-lifetime", &cfg_type_ttlval, 0 },
{ "nta-recheck", &cfg_type_ttlval, 0 },
{ "nxdomain-redirect", &cfg_type_astring, 0 },
{ "preferred-glue", &cfg_type_astring, 0 },
{ "prefetch", &cfg_type_prefetch, 0 },
{ "provide-ixfr", &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 },
{ "queryport-pool-updateinterval", &cfg_type_uint32,
{ "rate-limit", &cfg_type_rrl, 0 },
{ "recursion", &cfg_type_boolean, 0 },
{ "request-nsid", &cfg_type_boolean, 0 },
{ "require-server-cookie", &cfg_type_boolean, 0 },
{ "resolver-query-timeout", &cfg_type_uint32, 0 },
{ "response-policy", &cfg_type_rpz, 0 },
{ "root-delegation-only", &cfg_type_optional_exclude, 0 },
{ "rrset-order", &cfg_type_rrsetorder, 0 },
{ "send-cookie", &cfg_type_boolean, 0 },
{ "servfail-ttl", &cfg_type_ttlval, 0 },
{ "sortlist", &cfg_type_bracketed_aml, 0 },
{ "transfer-format", &cfg_type_transferformat, 0 },
{ "trust-anchor-telemetry", &cfg_type_boolean,
{ "v6-bias", &cfg_type_uint32, 0 },
{ "zero-no-soa-ttl-cache", &cfg_type_boolean, 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 },
};
/*%
* Sig-validity-interval.
*/
static cfg_tuplefielddef_t validityinterval_fields[] = {
{ "validity", &cfg_type_uint32, 0 },
{ "re-sign", &cfg_type_optional_uint32, 0 },
};
static cfg_type_t cfg_type_validityinterval = {
};
/*%
* Clauses that can be found in a 'zone' statement,
* with defaults in the 'view' or 'options' statement.
*
* Note: CFG_ZONE_* options indicate in which zone types this clause is
* legal.
*/
static cfg_clausedef_t
zone_clauses[] = {
{ "allow-notify", &cfg_type_bracketed_aml,
},
{ "allow-query", &cfg_type_bracketed_aml,
},
{ "allow-query-on", &cfg_type_bracketed_aml,
},
{ "allow-transfer", &cfg_type_bracketed_aml,
},
{ "allow-update", &cfg_type_bracketed_aml,
},
{ "allow-update-forwarding", &cfg_type_bracketed_aml,
},
{ "also-notify", &cfg_type_namesockaddrkeylist,
},
{ "alt-transfer-source", &cfg_type_sockaddr4wild,
},
{ "alt-transfer-source-v6", &cfg_type_sockaddr6wild,
},
{ "auto-dnssec", &cfg_type_autodnssec,
},
{ "check-dup-records", &cfg_type_checkmode,
},
{ "check-integrity", &cfg_type_boolean,
},
{ "check-mx", &cfg_type_checkmode,
},
{ "check-mx-cname", &cfg_type_checkmode,
},
{ "check-sibling", &cfg_type_boolean,
},
{ "check-spf", &cfg_type_warn,
},
{ "check-srv-cname", &cfg_type_checkmode,
},
{ "check-wildcard", &cfg_type_boolean,
},
{ "dialup", &cfg_type_dialuptype,
},
{ "dnssec-dnskey-kskonly", &cfg_type_boolean,
},
{ "dnssec-loadkeys-interval", &cfg_type_uint32,
},
{ "dnssec-secure-to-insecure", &cfg_type_boolean,
},
{ "dnssec-update-mode", &cfg_type_dnssecupdatemode,
},
{ "forward", &cfg_type_forwardtype,
},
{ "forwarders", &cfg_type_portiplist,
},
{ "inline-signing", &cfg_type_boolean,
},
{ "key-directory", &cfg_type_qstring,
},
{ "maintain-ixfr-base", &cfg_type_boolean,
},
{ "masterfile-format", &cfg_type_masterformat,
},
{ "masterfile-style", &cfg_type_masterstyle,
},
{ "max-ixfr-log-size", &cfg_type_size,
},
{ "max-journal-size", &cfg_type_sizenodefault,
},
{ "max-records", &cfg_type_uint32,
},
{ "max-refresh-time", &cfg_type_uint32,
},
{ "max-retry-time", &cfg_type_uint32,
},
{ "max-transfer-idle-in", &cfg_type_uint32,
},
{ "max-transfer-idle-out", &cfg_type_uint32,
},
{ "max-transfer-time-in", &cfg_type_uint32,
},
{ "max-transfer-time-out", &cfg_type_uint32,
},
{ "max-zone-ttl", &cfg_type_maxttl,
},
{ "min-refresh-time", &cfg_type_uint32,
},
{ "min-retry-time", &cfg_type_uint32,
},
{ "multi-master", &cfg_type_boolean,
},
{ "notify", &cfg_type_notifytype,
},
{ "notify-delay", &cfg_type_uint32,
},
{ "notify-source", &cfg_type_sockaddr4wild,
},
{ "notify-source-v6", &cfg_type_sockaddr6wild,
},
{ "notify-to-soa", &cfg_type_boolean,
},
{ "nsec3-test-zone", &cfg_type_boolean,
},
{ "request-expire", &cfg_type_boolean,
},
{ "request-ixfr", &cfg_type_boolean,
},
{ "serial-update-method", &cfg_type_updatemethod,
},
{ "sig-signing-nodes", &cfg_type_uint32,
},
{ "sig-signing-signatures", &cfg_type_uint32,
},
{ "sig-signing-type", &cfg_type_uint32,
},
{ "sig-validity-interval", &cfg_type_validityinterval,
},
{ "transfer-source", &cfg_type_sockaddr4wild,
},
{ "transfer-source-v6", &cfg_type_sockaddr6wild,
},
{ "try-tcp-refresh", &cfg_type_boolean,
},
{ "update-check-ksk", &cfg_type_boolean,
},
{ "use-alt-transfer-source", &cfg_type_boolean,
},
{ "zero-no-soa-ttl", &cfg_type_boolean,
},
{ "zone-statistics", &cfg_type_zonestat,
},
};
/*%
* Clauses that can be found in a 'zone' statement only.
*
* Note: CFG_ZONE_* options indicate in which zone types this clause is
* legal.
*/
static cfg_clausedef_t
zone_only_clauses[] = {
/*
* Note that the format of the check-names option is different between
*/
{ "check-names", &cfg_type_checkmode,
},
{ "database", &cfg_type_astring,
},
{ "delegation-only", &cfg_type_boolean,
},
{ "dlz", &cfg_type_astring,
},
{ "file", &cfg_type_qstring,
},
{ "in-view", &cfg_type_astring,
},
{ "ixfr-base", &cfg_type_qstring,
},
{ "ixfr-from-differences", &cfg_type_boolean,
},
{ "ixfr-tmp-file", &cfg_type_qstring,
},
{ "journal", &cfg_type_qstring,
},
{ "masters", &cfg_type_namesockaddrkeylist,
},
{ "pubkey", &cfg_type_pubkey,
},
{ "server-addresses", &cfg_type_bracketed_sockaddrlist,
},
{ "server-names", &cfg_type_namelist,
},
{ "type", &cfg_type_zonetype,
},
{ "update-policy", &cfg_type_updatepolicy,
},
};
/*% 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[] = {
};
};
/*% 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[] = {
};
/*% The "dynamically loadable zones" statement syntax. */
static cfg_clausedef_t
dlz_clauses[] = {
{ "database", &cfg_type_astring, 0 },
{ "search", &cfg_type_boolean, 0 },
};
static cfg_clausedef_t *
dlz_clausesets[] = {
};
static cfg_type_t cfg_type_dlz = {
};
/*%
* The "dyndb" statement syntax.
*/
static cfg_tuplefielddef_t dyndb_fields[] = {
{ "name", &cfg_type_astring, 0 },
{ "library", &cfg_type_qstring, 0 },
{ "parameters", &cfg_type_bracketed_text, 0 },
};
static cfg_type_t cfg_type_dyndb = {
};
/*%
* Clauses that can be found within the 'key' statement.
*/
static cfg_clausedef_t
key_clauses[] = {
{ "algorithm", &cfg_type_astring, 0 },
{ "secret", &cfg_type_sstring, 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 },
{ "edns", &cfg_type_boolean, 0 },
{ "edns-udp-size", &cfg_type_uint32, 0 },
{ "edns-version", &cfg_type_uint32, 0 },
{ "keys", &cfg_type_server_key_kludge, 0 },
{ "max-udp-size", &cfg_type_uint32, 0 },
{ "notify-source", &cfg_type_sockaddr4wild, 0 },
{ "notify-source-v6", &cfg_type_sockaddr6wild, 0 },
{ "provide-ixfr", &cfg_type_boolean, 0 },
{ "query-source", &cfg_type_querysource4, 0 },
{ "query-source-v6", &cfg_type_querysource6, 0 },
{ "request-expire", &cfg_type_boolean, 0 },
{ "request-ixfr", &cfg_type_boolean, 0 },
{ "request-nsid", &cfg_type_boolean, 0 },
{ "send-cookie", &cfg_type_boolean, 0 },
{ "tcp-only", &cfg_type_boolean, 0 },
{ "transfer-format", &cfg_type_transferformat, 0 },
{ "transfer-source", &cfg_type_sockaddr4wild, 0 },
{ "transfer-source-v6", &cfg_type_sockaddr6wild, 0 },
{ "transfers", &cfg_type_uint32, 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 },
{ "buffered", &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 = {
};
/*%
* 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 = {
};
/*%
* For parsing an 'addzone' statement
*/
static cfg_tuplefielddef_t addzone_fields[] = {
{ "name", &cfg_type_astring, 0 },
{ "class", &cfg_type_optional_class, 0 },
{ "view", &cfg_type_optional_class, 0 },
{ "options", &cfg_type_zoneopts, 0 },
};
static cfg_type_t cfg_type_addzone = {
};
static cfg_clausedef_t
addzoneconf_clauses[] = {
};
static cfg_clausedef_t *
addzoneconf_clausesets[] = {
};
};
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);
"expected integer and optional unit");
return (result);
}
static isc_result_t
{
char *endp;
goto cleanup;
}
return (ISC_R_SUCCESS);
} else {
return (ISC_R_SUCCESS);
}
"expected integer and optional unit or percent");
return (result);
}
static void
}
/*%
* A size value (number + optional unit).
*/
static cfg_type_t cfg_type_sizeval = {
};
/*%
* A size, "unlimited", or "default".
*/
static isc_result_t
}
static void
}
static cfg_type_t cfg_type_size = {
};
/*%
* A size or "unlimited", but not "default".
*/
static cfg_type_t cfg_type_sizenodefault = {
};
/*%
* A size in absolute values or percents.
*/
static cfg_type_t cfg_type_sizeval_percent = {
};
/*%
* A size in absolute values or percents, or "unlimited", or "default"
*/
static isc_result_t
{
ret));
}
static void
}
static cfg_type_t cfg_type_sizeorpercent = {
};
/*%
* optional_keyvalue
*/
static isc_result_t
{
} else {
if (optional) {
} else {
goto cleanup;
}
}
return (result);
}
static isc_result_t
{
} else {
}
return (result);
}
static void
const cfg_type_t *othertype)
{
const char * const *p;
/*
* If othertype is cfg_type_void, it means that enumtype is
* optional.
*/
if (othertype == &cfg_type_void)
if (!first)
cfg_print_cstr(pctx, *p);
}
if (othertype == &cfg_type_sizeval_percent) {
if (!first)
} else if (othertype != &cfg_type_void) {
if (!first)
}
if (othertype == &cfg_type_void)
}
static isc_result_t
}
static isc_result_t
{
}
static void
}
static void
}
static void
}
static const char *dialup_enums[] = {
};
static isc_result_t
{
}
static void
}
static cfg_type_t cfg_type_dialuptype = {
};
static isc_result_t
{
}
static void
}
static cfg_type_t cfg_type_notifytype = {
};
static isc_result_t
}
static void
}
static cfg_type_t cfg_type_minimal = {
};
static isc_result_t
{
}
static void
}
static cfg_type_t cfg_type_ixfrdifftype = {
};
static isc_result_t
}
static void
}
static cfg_type_t cfg_type_filter_aaaa = {
};
};
static cfg_type_t cfg_type_optional_keyref = {
};
#ifdef HAVE_GEOIP
/*
* "geoip" ACL element:
* geoip [ db <database> ] search-type <string>
*/
static const char *geoiptype_enums[] = {
"area", "areacode", "asnum", "city", "continent", "country",
"country3", "countryname", "domain", "isp", "metro", "metrocode",
"netspeed", "org", "postal", "postalcode", "region", "regionname",
};
static cfg_type_t cfg_type_geoiptype = {
};
static const char *geoipdb_enums[] = {
"asnum", "city", "country", "domain", "isp", "netspeed",
};
static cfg_type_t cfg_type_geoipdb = {
};
static cfg_tuplefielddef_t geoip_fields[] = {
{ "negated", &cfg_type_void, 0 },
{ "db", &cfg_type_geoipdb, 0 },
{ "subtype", &cfg_type_geoiptype, 0 },
{ "search", &cfg_type_astring, 0 },
};
static cfg_type_t cfg_type_geoip = {
};
static isc_result_t
/* Parse the optional "db" field. */
} else {
}
}
return (ISC_R_SUCCESS);
return (result);
}
static void
}
}
static void
}
#endif /* HAVE_GEOIP */
/*%
* An EDNS client subnet address
*/
};
/*%
* 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 keyword_type_t controls_readonly_kw = {
"read-only", &cfg_type_boolean
};
static cfg_type_t cfg_type_controls_readonly = {
"controls_readonly", 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 },
{ "read-only", &cfg_type_controls_readonly, 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 },
{ "read-only", &cfg_type_controls_readonly, 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 void
}
static cfg_type_t cfg_type_optional_class = {
};
static isc_result_t
{
unsigned int have_address = 0;
unsigned int have_port = 0;
unsigned int have_dscp = 0;
if ((*flagp & CFG_ADDR_V4OK) != 0)
else if ((*flagp & CFG_ADDR_V6OK) != 0)
else
INSIST(0);
for (;;) {
"address") == 0)
{
/* read "address" */
&netaddr));
have_address++;
{
/* read "port" */
&port));
have_port++;
{
/* read "dscp" */
have_dscp++;
have_address == 0)
{
} else {
"expected 'address', 'port', "
"or 'dscp'");
return (ISC_R_UNEXPECTEDTOKEN);
}
} else
break;
}
have_address + have_port == 0) {
return (ISC_R_UNEXPECTEDTOKEN);
}
if (have_dscp > 1) {
return (ISC_R_UNEXPECTEDTOKEN);
}
return (ISC_R_SUCCESS);
return (result);
}
static void
}
}
static void
if (*flagp & CFG_ADDR_V4OK)
else if (*flagp & CFG_ADDR_V6OK)
else
INSIST(0);
"( [ [ address ] ( ");
if (*flagp & CFG_ADDR_V4OK)
else if (*flagp & CFG_ADDR_V6OK)
else
INSIST(0);
" [ dscp <integer> ]");
}
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
{
#ifdef HAVE_GEOIP
#else
"not supported in this build");
return (ISC_R_UNEXPECTEDTOKEN);
#endif
} 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[] = {
{ "negated", &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 void
}
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 void
}
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 void
}
static cfg_type_t cfg_type_logfile = {
};
/*% An IPv4 address with optional dscp and 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 = {
};
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 },
{ "lwres-tasks", &cfg_type_uint32, 0},
{ "lwres-clients", &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[] = {
};
};
/*
* session.key has exactly the same syntax as rndc.key, but it's defined
* separately for clarity (and so we can extend it someday, if needed).
*/
};
static cfg_tuplefielddef_t nameport_fields[] = {
{ "name", &cfg_type_astring, 0 },
{ "port", &cfg_type_optional_port, 0 },
{ "dscp", &cfg_type_optional_dscp, 0 },
};
static cfg_type_t cfg_type_nameport = {
};
static void
}
static isc_result_t
{
ret));
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
{
ret));
else
} else {
"expected IP address or masters name");
return (ISC_R_UNEXPECTEDTOKEN);
}
return (result);
}
static cfg_type_t cfg_type_masterselement = {
};
static isc_result_t
goto cleanup;
}
if (result == ISC_R_RANGE ) {
return (result);
} else if (result != ISC_R_SUCCESS)
goto cleanup;
return (ISC_R_SUCCESS);
"expected integer and optional unit");
return (result);
}
/*%
* A TTL value (number + optional unit).
*/
static cfg_type_t cfg_type_ttlval = {
};
static isc_result_t
}
static void
}
/*%
* A size or "unlimited", but not "default".
*/
static cfg_type_t cfg_type_maxttl = {
};
}
const cfg_clausedef_t *clause;
{
continue;
}
}
{
continue;
}
}
return (valid);
}
void
cfg_print_zonegrammar(const unsigned int zonetype,
void *closure)
{
#define NCLAUSES \
(((sizeof(zone_clauses) + sizeof(zone_only_clauses)) / \
sizeof(clause[0])) - 1)
pctx.f = f;
zone_only_clauses, sizeof(zone_only_clauses));
switch (zonetype) {
case CFG_ZONE_MASTER:
break;
case CFG_ZONE_SLAVE:
break;
case CFG_ZONE_STUB:
break;
case CFG_ZONE_HINT:
break;
case CFG_ZONE_FORWARD:
break;
case CFG_ZONE_STATICSTUB:
break;
case CFG_ZONE_REDIRECT:
break;
case CFG_ZONE_DELEGATION:
break;
case CFG_ZONE_INVIEW:
/* no zone type is specified for these */
break;
default:
INSIST(0);
}
continue;
}
}
}