namedconf.c revision 3b38e4b8344cb3bb28f2b116d2e39f8371ef8e34
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Copyright (C) 2002-2016 Internet Systems Consortium, Inc. ("ISC")
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * This Source Code Form is subject to the terms of the Mozilla Public
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * License, v. 2.0. If a copy of the MPL was not distributed with this
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * file, You can obtain one at http://mozilla.org/MPL/2.0/.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*! \file */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#define TOKEN_STRING(pctx) (pctx->token.value.as_textregion.base)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*% Check a return value. */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow } while (0)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*% Clean up a configuration object if non-NULL. */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow do { if ((obj) != NULL) cfg_obj_destroy(pctx, &(obj)); } while (0)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Forward declarations of static functions.
4bff34e37def8a90f9194d81bc345c52ba20086athurlowparse_enum_or_other(cfg_parser_t *pctx, const cfg_type_t *enumtype,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowdoc_enum_or_other(cfg_printer_t *pctx, const cfg_type_t *enumtype,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowparse_keyvalue(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowparse_optional_keyvalue(cfg_parser_t *pctx, const cfg_type_t *type,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowparse_updatepolicy(cfg_parser_t *pctx, const cfg_type_t *type,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowprint_updatepolicy(cfg_printer_t *pctx, const cfg_obj_t *obj);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowdoc_updatepolicy(cfg_printer_t *pctx, const cfg_type_t *type);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowprint_keyvalue(cfg_printer_t *pctx, const cfg_obj_t *obj);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowdoc_keyvalue(cfg_printer_t *pctx, const cfg_type_t *type);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowdoc_optional_keyvalue(cfg_printer_t *pctx, const cfg_type_t *type);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowparse_geoip(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
91d632c867159b669d90fc7e172295433d0519efgwrstatic void
91d632c867159b669d90fc7e172295433d0519efgwr#endif /* HAVE_GEOIP */
91d632c867159b669d90fc7e172295433d0519efgwrstatic cfg_type_t cfg_type_bracketed_namesockaddrkeylist;
91d632c867159b669d90fc7e172295433d0519efgwrstatic cfg_type_t cfg_type_bracketed_sockaddrnameportlist;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*% tkey-dhkey */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "tkey-dhkey", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*% listen-on */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "listenon", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "acl", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*% masters */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow { "addresses", &cfg_type_bracketed_namesockaddrkeylist, 0 },
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "masters", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * "sockaddrkeylist", a list of socket addresses with optional keys
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * and an optional default port, as used in the masters option.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * "port 1234 { mymasters; 10.0.0.1 key foo; 1::2 port 69; }"
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic cfg_tuplefielddef_t namesockaddrkey_fields[] = {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "namesockaddrkey", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic cfg_type_t cfg_type_bracketed_namesockaddrkeylist = {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "bracketed_namesockaddrkeylist", cfg_parse_bracketed_list,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow cfg_print_bracketed_list, cfg_doc_bracketed_list, &cfg_rep_list,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic cfg_tuplefielddef_t namesockaddrkeylist_fields[] = {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow { "addresses", &cfg_type_bracketed_namesockaddrkeylist, 0 },
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "sockaddrkeylist", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * A list of socket addresses with an optional default port, as used
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * in the lwresd 'listen-on' option. E.g., "{ 10.0.0.1; 1::2 port 69; }"
4bff34e37def8a90f9194d81bc345c52ba20086athurlow { "addresses", &cfg_type_bracketed_dscpsockaddrlist, 0 },
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "portiplist", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * A public key, as in the "pubkey" statement.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "pubkey", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * A list of RR types, used in grant statements.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Note that the old parser allows quotes around the RR type names.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "rrtypelist", cfg_parse_spacelist, cfg_print_spacelist,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic const char *mode_enums[] = { "deny", "grant", NULL };
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "mode", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowparse_matchtype(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlowparse_matchname(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlowdoc_matchname(cfg_printer_t *pctx, const cfg_type_t *type) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic const char *matchtype_enums[] = {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "6to4-self", "external", "krb5-self", "krb5-subdomain", "ms-self",
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "ms-subdomain", "name", "self", "selfsub", "selfwild", "subdomain",
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "optional_matchname", parse_matchname, cfg_print_ustring,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * A grant statement, used in the update policy.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow { "identity", &cfg_type_astring, 0 }, /* domain name */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "grant", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "update_policy", parse_updatepolicy, print_updatepolicy,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowparse_updatepolicy(cfg_parser_t *pctx, const cfg_type_t *type,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow CHECK(cfg_create_obj(pctx, &cfg_type_ustring, &obj));
4bff34e37def8a90f9194d81bc345c52ba20086athurlowprint_updatepolicy(cfg_printer_t *pctx, const cfg_obj_t *obj) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlowdoc_updatepolicy(cfg_printer_t *pctx, const cfg_type_t *type) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * A view statement.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "view", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * A zone statement.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "zone", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * A "category" clause in the "logging" statement.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "category", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * A dnssec key, as used in the "trusted-keys" statement.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "dnsseckey", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
91d632c867159b669d90fc7e172295433d0519efgwr * A managed key initialization specifier, as used in the
91d632c867159b669d90fc7e172295433d0519efgwr * "managed-keys" statement.
91d632c867159b669d90fc7e172295433d0519efgwr { "init", &cfg_type_ustring, 0 }, /* must be literal "initial-key" */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "managedkey", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
91d632c867159b669d90fc7e172295433d0519efgwrstatic keyword_type_t wild_class_kw = { "class", &cfg_type_ustring };
91d632c867159b669d90fc7e172295433d0519efgwr "optional_wild_class", parse_optional_keyvalue, print_keyvalue,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow doc_optional_keyvalue, &cfg_rep_string, &wild_class_kw
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic keyword_type_t wild_type_kw = { "type", &cfg_type_ustring };
91d632c867159b669d90fc7e172295433d0519efgwr print_keyvalue, doc_optional_keyvalue, &cfg_rep_string, &wild_type_kw
91d632c867159b669d90fc7e172295433d0519efgwrstatic keyword_type_t wild_name_kw = { "name", &cfg_type_qstring };
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "optional_wild_name", parse_optional_keyvalue, print_keyvalue,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow doc_optional_keyvalue, &cfg_rep_string, &wild_name_kw
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * An rrset ordering element.
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic cfg_tuplefielddef_t rrsetorderingelement_fields[] = {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow { "order", &cfg_type_ustring, 0 }, /* must be literal "order" */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "rrsetorderingelement", cfg_parse_tuple, cfg_print_tuple,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow cfg_doc_tuple, &cfg_rep_tuple, rrsetorderingelement_fields
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * A global or view "check-names" option. Note that the zone
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * "check-names" option has a different syntax.
91d632c867159b669d90fc7e172295433d0519efgwrstatic const char *checktype_enums[] = { "master", "slave", "response", NULL };
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "checktype", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic const char *checkmode_enums[] = { "fail", "warn", "ignore", NULL };
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "checkmode", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic const char *warn_enums[] = { "warn", "ignore", NULL };
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "warn", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "checknames", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic cfg_type_t cfg_type_bracketed_dscpsockaddrlist = {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow cfg_print_bracketed_list, cfg_doc_bracketed_list, &cfg_rep_list,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic cfg_type_t cfg_type_bracketed_sockaddrlist = {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow cfg_print_bracketed_list, cfg_doc_bracketed_list, &cfg_rep_list,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic const char *autodnssec_enums[] = {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "autodnssec", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic const char *dnssecupdatemode_enums[] = {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "dnssecupdatemode", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic const char *updatemethods_enums[] = {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "updatemethod", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * zone-statistics: full, terse, or none.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * for backward compatibility, we also support boolean values.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * yes represents "full", no represents "terse". in the future we
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * may change no to mean "none".
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic const char *zonestat_enums[] = { "full", "terse", "none", NULL };
4bff34e37def8a90f9194d81bc345c52ba20086athurlowparse_zonestat(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow return (parse_enum_or_other(pctx, type, &cfg_type_boolean, ret));
4bff34e37def8a90f9194d81bc345c52ba20086athurlowdoc_zonestat(cfg_printer_t *pctx, const cfg_type_t *type) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "zonestat", parse_zonestat, cfg_print_ustring, doc_zonestat,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "rrsetorder", cfg_parse_bracketed_list, cfg_print_bracketed_list,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow cfg_doc_bracketed_list, &cfg_rep_list, &cfg_type_rrsetorderingelement
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic keyword_type_t dscp_kw = { "dscp", &cfg_type_uint32 };
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "optional_dscp", parse_optional_keyvalue, print_keyvalue,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic keyword_type_t port_kw = { "port", &cfg_type_uint32 };
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "optional_port", parse_optional_keyvalue, print_keyvalue,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*% A list of keys, as in the "key" clause of the controls statement. */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "keylist", cfg_parse_bracketed_list, cfg_print_bracketed_list,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow cfg_doc_bracketed_list, &cfg_rep_list, &cfg_type_astring
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*% A list of dnssec keys, as in "trusted-keys" */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "dnsseckeys", cfg_parse_bracketed_list, cfg_print_bracketed_list,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow cfg_doc_bracketed_list, &cfg_rep_list, &cfg_type_dnsseckey
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * A list of managed key entries, as in "trusted-keys". Currently
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * (9.7.0) this has a format similar to dnssec keys, except the keyname
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * is followed by the keyword "initial-key". In future releases, this
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * keyword may take other values indicating different methods for the
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * key to be initialized.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "managedkeys", cfg_parse_bracketed_list, cfg_print_bracketed_list,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow cfg_doc_bracketed_list, &cfg_rep_list, &cfg_type_managedkey
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic const char *forwardtype_enums[] = { "first", "only", NULL };
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "forwardtype", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic const char *zonetype_enums[] = {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "delegation-only", "forward", "hint", "master", "redirect",
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "zonetype", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic const char *loglevel_enums[] = {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "critical", "error", "warning", "notice", "info", "dynamic", NULL
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "loglevel", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic const char *transferformat_enums[] = {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "transferformat", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * The special keyword "none", as used in the pid-file option.
4bff34e37def8a90f9194d81bc345c52ba20086athurlowprint_none(cfg_printer_t *pctx, const cfg_obj_t *obj) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * A quoted string or the special keyword "none". Used in the pid-file option.
4bff34e37def8a90f9194d81bc345c52ba20086athurlowparse_qstringornone(cfg_parser_t *pctx, const cfg_type_t *type,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowdoc_qstringornone(cfg_printer_t *pctx, const cfg_type_t *type) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "qstringornone", parse_qstringornone, NULL, doc_qstringornone,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * A boolean ("yes" or "no"), or the special keyword "auto".
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Used in the dnssec-validation option.
4bff34e37def8a90f9194d81bc345c52ba20086athurlowprint_auto(cfg_printer_t *pctx, const cfg_obj_t *obj) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlowparse_boolorauto(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlowprint_boolorauto(cfg_printer_t *pctx, const cfg_obj_t *obj) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlowdoc_boolorauto(cfg_printer_t *pctx, const cfg_type_t *type) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * keyword hostname
4bff34e37def8a90f9194d81bc345c52ba20086athurlowprint_hostname(cfg_printer_t *pctx, const cfg_obj_t *obj) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "hostname", NULL, print_hostname, NULL, &cfg_rep_boolean, NULL
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * "server-id" argument.
4bff34e37def8a90f9194d81bc345c52ba20086athurlowparse_serverid(cfg_parser_t *pctx, const cfg_type_t *type,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow result = cfg_create_obj(pctx, &cfg_type_hostname, ret);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowdoc_serverid(cfg_printer_t *pctx, const cfg_type_t *type) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow cfg_print_cstr(pctx, "( <quoted_string> | none | hostname )");
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "serverid", parse_serverid, NULL, doc_serverid, NULL, NULL };
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Port list.
4bff34e37def8a90f9194d81bc345c52ba20086athurlowprint_porttuple(cfg_printer_t *pctx, const cfg_obj_t *obj) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "porttuple", cfg_parse_tuple, print_porttuple, cfg_doc_tuple,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow cfg_parser_error(pctx, CFG_LOG_NEAR, "invalid port");
4bff34e37def8a90f9194d81bc345c52ba20086athurlowparse_portrange(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow CHECK(cfg_peektoken(pctx, ISC_LEXOPT_NUMBER | ISC_LEXOPT_CNUMBER));
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "expected integer or 'range'");
4bff34e37def8a90f9194d81bc345c52ba20086athurlow CHECK(cfg_create_tuple(pctx, &cfg_type_porttuple, &obj));
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "low port '%u' must not be larger "
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "than high port",
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "portrange", parse_portrange, NULL, cfg_doc_terminal,
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic const char *cookiealg_enums[] = { "aes", "sha1", "sha256", NULL };
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "cookiealg", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * fetch-quota-params
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "fetchquota", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * fetches-per-server or fetches-per-zone
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic const char *response_enums[] = { "drop", "fail", NULL };
4bff34e37def8a90f9194d81bc345c52ba20086athurlowparse_optional_enum(cfg_parser_t *pctx, const cfg_type_t *type,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow return (parse_enum_or_other(pctx, type, &cfg_type_void, ret));
4bff34e37def8a90f9194d81bc345c52ba20086athurlowdoc_optional_enum(cfg_printer_t *pctx, const cfg_type_t *type) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "responsetype", parse_optional_enum, cfg_print_ustring,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow "fetchesper", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
* Clauses that can be found within the top level of the named.conf
static cfg_clausedef_t
namedconf_clauses[] = {
static cfg_clausedef_t
static cfg_clausedef_t
bindkeys_clauses[] = {
static cfg_clausedef_t
options_clauses[] = {
#ifdef HAVE_DNSTAP
#ifdef HAVE_GEOIP
static const char *dnstap_types[] = {
static isc_result_t
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
int fn;
goto cleanup;
return (ISC_R_SUCCESS);
return (result);
if (f != fields) {
if (f != fields)
static const char *rpz_policies[] = {
static isc_result_t
return (result);
static cfg_clausedef_t
dns64_clauses[] = {
static cfg_clausedef_t *
dns64_clausesets[] = {
static cfg_clausedef_t
view_clauses[] = {
#ifdef HAVE_DNSTAP
#ifdef ALLOW_FILTER_AAAA
#ifdef HAVE_LMDB
static cfg_clausedef_t
view_only_clauses[] = {
static cfg_clausedef_t
zone_clauses[] = {
static cfg_clausedef_t
zone_only_clauses[] = {
/*% The top-level named.conf syntax. */
static cfg_clausedef_t *
namedconf_clausesets[] = {
/*% The bind.keys syntax (trusted-keys/managed-keys only). */
static cfg_clausedef_t *
bindkeys_clausesets[] = {
static cfg_clausedef_t *
options_clausesets[] = {
static cfg_clausedef_t *
view_clausesets[] = {
static cfg_clausedef_t *
zone_clausesets[] = {
static cfg_clausedef_t
dlz_clauses[] = {
static cfg_clausedef_t *
dlz_clausesets[] = {
static cfg_clausedef_t
key_clauses[] = {
static cfg_clausedef_t *
key_clausesets[] = {
static cfg_clausedef_t
server_clauses[] = {
static cfg_clausedef_t *
server_clausesets[] = {
static cfg_clausedef_t
channel_clauses[] = {
static cfg_clausedef_t *
channel_clausesets[] = {
static cfg_clausedef_t
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);
return (ISC_R_FAILURE);
return (ISC_R_FAILURE);
return (ISC_R_SUCCESS);
static isc_result_t
goto cleanup;
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
char *endp;
goto cleanup;
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
static isc_result_t
ret));
static isc_result_t
if (optional) {
goto cleanup;
return (result);
static isc_result_t
return (result);
if (!first)
if (!first)
if (!first)
static isc_result_t
static isc_result_t
static const char *dialup_enums[] = {
static isc_result_t
static isc_result_t
static isc_result_t
static isc_result_t
static isc_result_t
#ifdef HAVE_GEOIP
static const char *geoiptype_enums[] = {
static const char *geoipdb_enums[] = {
static isc_result_t
return (ISC_R_SUCCESS);
return (result);
static cfg_clausedef_t
controls_clauses[] = {
static cfg_clausedef_t *
controls_clausesets[] = {
static cfg_clausedef_t
statservers_clauses[] = {
static cfg_clausedef_t *
statservers_clausesets[] = {
static isc_result_t
return (result);
static isc_result_t
unsigned int have_address = 0;
unsigned int have_port = 0;
unsigned int have_dscp = 0;
INSIST(0);
&netaddr));
have_address++;
&port));
have_port++;
have_dscp++;
have_address == 0)
return (ISC_R_UNEXPECTEDTOKEN);
return (ISC_R_UNEXPECTEDTOKEN);
return (ISC_R_UNEXPECTEDTOKEN);
return (ISC_R_SUCCESS);
return (result);
INSIST(0);
INSIST(0);
static isc_result_t
#ifdef HAVE_GEOIP
return (ISC_R_UNEXPECTEDTOKEN);
goto bad;
bad:
return (ISC_R_UNEXPECTEDTOKEN);
return (result);
static unsigned int controls_sockaddr_flags =
static isc_result_t
if (braces) {
return (result);
static isc_result_t
return (result);
static isc_result_t
return (result);
static isc_result_t
static isc_result_t
return (ISC_R_SUCCESS);
return (result);
static cfg_clausedef_t
lwres_clauses[] = {
static cfg_clausedef_t *
lwres_clausesets[] = {
static cfg_clausedef_t
rndcconf_options_clauses[] = {
static cfg_clausedef_t *
static cfg_clausedef_t
rndcconf_server_clauses[] = {
static cfg_clausedef_t *
static cfg_clausedef_t
rndcconf_clauses[] = {
static cfg_clausedef_t *
rndcconf_clausesets[] = {
static cfg_clausedef_t
rndckey_clauses[] = {
static cfg_clausedef_t *
rndckey_clausesets[] = {
static isc_result_t
ret));
&obj));
return (ISC_R_UNEXPECTEDTOKEN);
return (result);
static isc_result_t
ret));
return (ISC_R_UNEXPECTEDTOKEN);
return (result);
static isc_result_t
goto cleanup;
return (result);
goto cleanup;
return (ISC_R_SUCCESS);
return (result);
static isc_result_t