]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4520. [cleanup] Alphabetise more of the grammar when printing it
authorMark Andrews <marka@isc.org>
Tue, 29 Nov 2016 04:28:28 +0000 (15:28 +1100)
committerMark Andrews <marka@isc.org>
Tue, 29 Nov 2016 04:28:28 +0000 (15:28 +1100)
                        out. Fix unbalanced indenting. [RT #43755]

CHANGES
bin/tests/system/checkconf/good.conf
lib/isccfg/namedconf.c
lib/isccfg/parser.c

diff --git a/CHANGES b/CHANGES
index dda1f6c315773b0247bc8c68c1cd88cfc70533f3..a9edd588269c4785a32a67d9c974043d9c132c74 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+4520.  [cleanup]       Alphabetise more of the grammar when printing it
+                       out. Fix unbalanced indenting. [RT #43755]
+
 4519.  [port]          win32: handle ERROR_MORE_DATA. [RT #43534]
 
 4518.  [func]          The "print-time" option in the logging configuration
index e7df659100805b9f71bcf4b77ce8a7b6b9118857..60641522f790618eb562f1f4bf081b779b5ad5b9 100644 (file)
@@ -141,10 +141,6 @@ view "chaos" chaos {
                database "_builtin hostname";
        };
 };
-key "mykey" {
-       algorithm "hmac-md5";
-       secret "qwertyuiopasdfgh";
-};
 dyndb "name" "library.so" {
        this;
        \};
@@ -154,3 +150,7 @@ dyndb "name" "library.so" {
        "text \"";
        system;
 };
+key "mykey" {
+       algorithm "hmac-md5";
+       secret "qwertyuiopasdfgh";
+};
index ee38ffc780d5a2da8606dd0929698ed62258d390..b2b54b7824cd6295900ce2b7473a0f4cf3ff0c96 100644 (file)
@@ -150,8 +150,8 @@ static cfg_tuplefielddef_t tkey_dhkey_fields[] = {
 };
 
 static cfg_type_t cfg_type_tkey_dhkey = {
-       "tkey-dhkey", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple,
-       tkey_dhkey_fields
+       "tkey-dhkey", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
+       &cfg_rep_tuple, tkey_dhkey_fields
 };
 
 /*% listen-on */
@@ -177,7 +177,9 @@ static cfg_tuplefielddef_t acl_fields[] = {
 };
 
 static cfg_type_t cfg_type_acl = {
-       "acl", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple, acl_fields };
+       "acl", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
+       &cfg_rep_tuple, acl_fields
+};
 
 /*% masters */
 static cfg_tuplefielddef_t masters_fields[] = {
@@ -189,7 +191,9 @@ static cfg_tuplefielddef_t masters_fields[] = {
 };
 
 static cfg_type_t cfg_type_masters = {
-       "masters", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple, masters_fields };
+       "masters", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
+       &cfg_rep_tuple, masters_fields
+};
 
 /*%
  * "sockaddrkeylist", a list of socket addresses with optional keys
@@ -205,13 +209,14 @@ static cfg_tuplefielddef_t namesockaddrkey_fields[] = {
 };
 
 static cfg_type_t cfg_type_namesockaddrkey = {
-       "namesockaddrkey", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple,
-       namesockaddrkey_fields
+       "namesockaddrkey", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
+       &cfg_rep_tuple, namesockaddrkey_fields
 };
 
 static cfg_type_t cfg_type_bracketed_namesockaddrkeylist = {
        "bracketed_namesockaddrkeylist", cfg_parse_bracketed_list,
-       cfg_print_bracketed_list, cfg_doc_bracketed_list, &cfg_rep_list, &cfg_type_namesockaddrkey
+       cfg_print_bracketed_list, cfg_doc_bracketed_list, &cfg_rep_list,
+       &cfg_type_namesockaddrkey
 };
 
 static cfg_tuplefielddef_t namesockaddrkeylist_fields[] = {
@@ -221,8 +226,8 @@ static cfg_tuplefielddef_t namesockaddrkeylist_fields[] = {
        { NULL, NULL, 0 }
 };
 static cfg_type_t cfg_type_namesockaddrkeylist = {
-       "sockaddrkeylist", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple,
-       namesockaddrkeylist_fields
+       "sockaddrkeylist", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
+       &cfg_rep_tuple, namesockaddrkeylist_fields
 };
 
 /*%
@@ -252,7 +257,8 @@ static cfg_tuplefielddef_t pubkey_fields[] = {
 };
 static cfg_type_t cfg_type_pubkey = {
        "pubkey", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
-       &cfg_rep_tuple, pubkey_fields };
+       &cfg_rep_tuple, pubkey_fields
+};
 
 /*%
  * A list of RR types, used in grant statements.
@@ -263,15 +269,14 @@ static cfg_type_t cfg_type_rrtypelist = {
        cfg_doc_terminal, &cfg_rep_list, &cfg_type_astring
 };
 
-static const char *mode_enums[] = { "grant", "deny", NULL };
+static const char *mode_enums[] = { "deny", "grant", NULL };
 static cfg_type_t cfg_type_mode = {
        "mode", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
        &cfg_rep_string, &mode_enums
 };
 
 static isc_result_t
-parse_matchtype(cfg_parser_t *pctx, const cfg_type_t *type,
-               cfg_obj_t **ret) {
+parse_matchtype(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
        isc_result_t result;
 
        CHECK(cfg_peektoken(pctx, 0));
@@ -309,9 +314,10 @@ doc_matchname(cfg_printer_t *pctx, const cfg_type_t *type) {
 }
 
 static const char *matchtype_enums[] = {
-       "name", "subdomain", "wildcard", "self", "selfsub", "selfwild",
-       "krb5-self", "ms-self", "krb5-subdomain", "ms-subdomain",
-       "tcp-self", "6to4-self", "zonesub", "external", NULL };
+       "6to4-self", "external", "krb5-self", "krb5-subdomain", "ms-self",
+       "ms-subdomain", "name", "self", "selfsub", "selfwild", "subdomain",
+       "tcp-self", "wildcard", "zonesub", NULL
+};
 
 static cfg_type_t cfg_type_matchtype = {
        "matchtype", parse_matchtype, cfg_print_ustring,
@@ -346,7 +352,8 @@ static cfg_type_t cfg_type_updatepolicy = {
 
 static isc_result_t
 parse_updatepolicy(cfg_parser_t *pctx, const cfg_type_t *type,
-                  cfg_obj_t **ret) {
+                  cfg_obj_t **ret)
+{
        isc_result_t result;
        CHECK(cfg_gettoken(pctx, 0));
        if (pctx->token.type == isc_tokentype_special &&
@@ -487,8 +494,8 @@ static cfg_type_t cfg_type_optional_wild_type = {
 static keyword_type_t wild_name_kw = { "name", &cfg_type_qstring };
 
 static cfg_type_t cfg_type_optional_wild_name = {
-       "optional_wild_name", parse_optional_keyvalue,
-       print_keyvalue, doc_optional_keyvalue, &cfg_rep_string, &wild_name_kw
+       "optional_wild_name", parse_optional_keyvalue, print_keyvalue,
+       doc_optional_keyvalue, &cfg_rep_string, &wild_name_kw
 };
 
 /*%
@@ -503,8 +510,8 @@ static cfg_tuplefielddef_t rrsetorderingelement_fields[] = {
        { NULL, NULL, 0 }
 };
 static cfg_type_t cfg_type_rrsetorderingelement = {
-       "rrsetorderingelement", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple,
-       rrsetorderingelement_fields
+       "rrsetorderingelement", cfg_parse_tuple, cfg_print_tuple,
+       cfg_doc_tuple, &cfg_rep_tuple, rrsetorderingelement_fields
 };
 
 /*%
@@ -553,20 +560,25 @@ static cfg_type_t cfg_type_bracketed_sockaddrlist = {
        &cfg_type_sockaddr
 };
 
-static const char *autodnssec_enums[] = { "allow", "maintain", "off", NULL };
+static const char *autodnssec_enums[] = {
+        "allow", "maintain", "off", NULL
+};
 static cfg_type_t cfg_type_autodnssec = {
        "autodnssec", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
        &cfg_rep_string, &autodnssec_enums
 };
 
-static const char *dnssecupdatemode_enums[] = { "maintain", "no-resign", NULL };
+static const char *dnssecupdatemode_enums[] = {
+       "maintain", "no-resign", NULL
+};
 static cfg_type_t cfg_type_dnssecupdatemode = {
        "dnssecupdatemode", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
        &cfg_rep_string, &dnssecupdatemode_enums
 };
 
 static const char *updatemethods_enums[] = {
-       "increment", "unixtime", "date", NULL };
+       "date", "increment", "unixtime", NULL
+};
 static cfg_type_t cfg_type_updatemethod = {
        "updatemethod", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
        &cfg_rep_string, &updatemethods_enums
@@ -639,30 +651,33 @@ static cfg_type_t cfg_type_managedkeys = {
 
 static const char *forwardtype_enums[] = { "first", "only", NULL };
 static cfg_type_t cfg_type_forwardtype = {
-       "forwardtype", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum, &cfg_rep_string,
-       &forwardtype_enums
+       "forwardtype", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
+       &cfg_rep_string, &forwardtype_enums
 };
 
 static const char *zonetype_enums[] = {
-       "master", "slave", "stub", "static-stub", "hint", "forward",
-       "delegation-only", "redirect", NULL };
+       "delegation-only", "forward", "hint", "master", "redirect",
+       "slave", "static-stub", "stub", NULL
+};
 static cfg_type_t cfg_type_zonetype = {
        "zonetype", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
        &cfg_rep_string, &zonetype_enums
 };
 
 static const char *loglevel_enums[] = {
-       "critical", "error", "warning", "notice", "info", "dynamic", NULL };
+       "critical", "error", "warning", "notice", "info", "dynamic", NULL
+};
 static cfg_type_t cfg_type_loglevel = {
-       "loglevel", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum, &cfg_rep_string,
-       &loglevel_enums
+       "loglevel", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
+       &cfg_rep_string, &loglevel_enums
 };
 
 static const char *transferformat_enums[] = {
-       "many-answers", "one-answer", NULL };
+       "many-answers", "one-answer", NULL
+};
 static cfg_type_t cfg_type_transferformat = {
-       "transferformat", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum, &cfg_rep_string,
-       &transferformat_enums
+       "transferformat", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
+       &cfg_rep_string, &transferformat_enums
 };
 
 /*%
@@ -724,9 +739,7 @@ static cfg_type_t cfg_type_auto = {
 };
 
 static isc_result_t
-parse_boolorauto(cfg_parser_t *pctx, const cfg_type_t *type,
-                   cfg_obj_t **ret)
-{
+parse_boolorauto(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
        isc_result_t result;
 
        CHECK(cfg_gettoken(pctx, CFG_LEXOPT_QSTRING));
@@ -895,7 +908,8 @@ static cfg_type_t cfg_type_bracketed_portlist = {
 static const char *cookiealg_enums[] = { "aes", "sha1", "sha256", NULL };
 static cfg_type_t cfg_type_cookiealg = {
        "cookiealg", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
-       &cfg_rep_string, &cookiealg_enums };
+       &cfg_rep_string, &cookiealg_enums
+};
 
 /*%
  * fetch-quota-params
@@ -957,15 +971,15 @@ static cfg_type_t cfg_type_fetchesper = {
  */
 static cfg_clausedef_t
 namedconf_clauses[] = {
-       { "options", &cfg_type_options, 0 },
-       { "controls", &cfg_type_controls, CFG_CLAUSEFLAG_MULTI },
        { "acl", &cfg_type_acl, CFG_CLAUSEFLAG_MULTI },
-       { "masters", &cfg_type_masters, CFG_CLAUSEFLAG_MULTI },
+       { "controls", &cfg_type_controls, CFG_CLAUSEFLAG_MULTI },
        { "logging", &cfg_type_logging, 0 },
-       { "view", &cfg_type_view, CFG_CLAUSEFLAG_MULTI },
        { "lwres", &cfg_type_lwres, CFG_CLAUSEFLAG_MULTI },
+       { "masters", &cfg_type_masters, CFG_CLAUSEFLAG_MULTI },
+       { "options", &cfg_type_options, 0 },
        { "statistics-channels", &cfg_type_statschannels,
          CFG_CLAUSEFLAG_MULTI },
+       { "view", &cfg_type_view, CFG_CLAUSEFLAG_MULTI },
        { NULL, NULL, 0 }
 };
 
@@ -975,13 +989,13 @@ namedconf_clauses[] = {
  */
 static cfg_clausedef_t
 namedconf_or_view_clauses[] = {
-       { "key", &cfg_type_key, CFG_CLAUSEFLAG_MULTI },
-       { "zone", &cfg_type_zone, CFG_CLAUSEFLAG_MULTI },
        { "dlz", &cfg_type_dlz, CFG_CLAUSEFLAG_MULTI },
        { "dyndb", &cfg_type_dyndb, CFG_CLAUSEFLAG_MULTI },
+       { "key", &cfg_type_key, CFG_CLAUSEFLAG_MULTI },
+       { "managed-keys", &cfg_type_managedkeys, CFG_CLAUSEFLAG_MULTI },
        { "server", &cfg_type_server, CFG_CLAUSEFLAG_MULTI },
        { "trusted-keys", &cfg_type_dnsseckeys, CFG_CLAUSEFLAG_MULTI },
-       { "managed-keys", &cfg_type_managedkeys, CFG_CLAUSEFLAG_MULTI },
+       { "zone", &cfg_type_zone, CFG_CLAUSEFLAG_MULTI },
        { NULL, NULL, 0 }
 };
 
@@ -990,12 +1004,12 @@ namedconf_or_view_clauses[] = {
  */
 static cfg_clausedef_t
 bindkeys_clauses[] = {
-       { "trusted-keys", &cfg_type_dnsseckeys, CFG_CLAUSEFLAG_MULTI },
        { "managed-keys", &cfg_type_managedkeys, CFG_CLAUSEFLAG_MULTI },
+       { "trusted-keys", &cfg_type_dnsseckeys, CFG_CLAUSEFLAG_MULTI },
        { NULL, NULL, 0 }
 };
 
-static const char *fstrm_model_enums[] = { "spsc", "mpsc", NULL };
+static const char *fstrm_model_enums[] = { "mpsc", "spsc", NULL };
 static cfg_type_t cfg_type_fstrm_model = {
        "model", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
        &cfg_rep_string, &fstrm_model_enums
@@ -1028,23 +1042,25 @@ options_clauses[] = {
        { "fstrm-set-reopen-interval", &cfg_type_uint32, 0 },
 #else
        { "dnstap-output", &cfg_type_dnstapoutput,
-               CFG_CLAUSEFLAG_NOTCONFIGURED },
-       { "dnstap-identity", &cfg_type_serverid, CFG_CLAUSEFLAG_NOTCONFIGURED },
-       { "dnstap-version", &cfg_type_qstringornone, CFG_CLAUSEFLAG_NOTCONFIGURED },
+         CFG_CLAUSEFLAG_NOTCONFIGURED },
+       { "dnstap-identity", &cfg_type_serverid,
+         CFG_CLAUSEFLAG_NOTCONFIGURED },
+       { "dnstap-version", &cfg_type_qstringornone,
+         CFG_CLAUSEFLAG_NOTCONFIGURED },
        { "fstrm-set-buffer-hint", &cfg_type_uint32,
-               CFG_CLAUSEFLAG_NOTCONFIGURED },
+         CFG_CLAUSEFLAG_NOTCONFIGURED },
        { "fstrm-set-flush-timeout", &cfg_type_uint32,
-               CFG_CLAUSEFLAG_NOTCONFIGURED },
+         CFG_CLAUSEFLAG_NOTCONFIGURED },
        { "fstrm-set-input-queue-size", &cfg_type_uint32,
-               CFG_CLAUSEFLAG_NOTCONFIGURED },
+         CFG_CLAUSEFLAG_NOTCONFIGURED },
        { "fstrm-set-output-notify-threshold", &cfg_type_uint32,
-               CFG_CLAUSEFLAG_NOTCONFIGURED },
+         CFG_CLAUSEFLAG_NOTCONFIGURED },
        { "fstrm-set-output-queue-model", &cfg_type_fstrm_model,
-               CFG_CLAUSEFLAG_NOTCONFIGURED },
+         CFG_CLAUSEFLAG_NOTCONFIGURED },
        { "fstrm-set-output-queue-size", &cfg_type_uint32,
-               CFG_CLAUSEFLAG_NOTCONFIGURED },
+         CFG_CLAUSEFLAG_NOTCONFIGURED },
        { "fstrm-set-reopen-interval", &cfg_type_uint32,
-               CFG_CLAUSEFLAG_NOTCONFIGURED },
+         CFG_CLAUSEFLAG_NOTCONFIGURED },
 #endif /* HAVE_DNSTAP */
        { "session-keyfile", &cfg_type_qstringornone, 0 },
        { "session-keyname", &cfg_type_astring, 0 },
@@ -1120,19 +1136,24 @@ options_clauses[] = {
 
 static cfg_type_t cfg_type_namelist = {
        "namelist", cfg_parse_bracketed_list, cfg_print_bracketed_list,
-       cfg_doc_bracketed_list, &cfg_rep_list, &cfg_type_qstring };
+       cfg_doc_bracketed_list, &cfg_rep_list, &cfg_type_qstring
+};
 
 static keyword_type_t exclude_kw = { "exclude", &cfg_type_namelist };
 
 static cfg_type_t cfg_type_optional_exclude = {
        "optional_exclude", parse_optional_keyvalue, print_keyvalue,
-       doc_optional_keyvalue, &cfg_rep_list, &exclude_kw };
+       doc_optional_keyvalue, &cfg_rep_list, &exclude_kw
+};
 
-static keyword_type_t exceptionnames_kw = { "except-from", &cfg_type_namelist };
+static keyword_type_t exceptionnames_kw = {
+       "except-from", &cfg_type_namelist
+};
 
 static cfg_type_t cfg_type_optional_exceptionnames = {
        "optional_allow", parse_optional_keyvalue, print_keyvalue,
-       doc_optional_keyvalue, &cfg_rep_list, &exceptionnames_kw };
+       doc_optional_keyvalue, &cfg_rep_list, &exceptionnames_kw
+};
 
 static cfg_tuplefielddef_t denyaddresses_fields[] = {
        { "acl", &cfg_type_bracketed_aml, 0 },
@@ -1158,7 +1179,8 @@ static cfg_type_t cfg_type_denyaliases = {
 
 static cfg_type_t cfg_type_algorithmlist = {
        "algorithmlist", cfg_parse_bracketed_list, cfg_print_bracketed_list,
-       cfg_doc_bracketed_list, &cfg_rep_list, &cfg_type_astring };
+       cfg_doc_bracketed_list, &cfg_rep_list, &cfg_type_astring
+};
 
 static cfg_tuplefielddef_t disablealgorithm_fields[] = {
        { "name", &cfg_type_astring, 0 },
@@ -1173,7 +1195,8 @@ static cfg_type_t cfg_type_disablealgorithm = {
 
 static cfg_type_t cfg_type_dsdigestlist = {
        "dsdigestlist", cfg_parse_bracketed_list, cfg_print_bracketed_list,
-       cfg_doc_bracketed_list, &cfg_rep_list, &cfg_type_astring };
+       cfg_doc_bracketed_list, &cfg_rep_list, &cfg_type_astring
+};
 
 static cfg_tuplefielddef_t disabledsdigest_fields[] = {
        { "name", &cfg_type_astring, 0 },
@@ -1197,7 +1220,7 @@ static cfg_type_t cfg_type_mustbesecure = {
        &cfg_rep_tuple, mustbesecure_fields
 };
 
-static const char *masterformat_enums[] = { "text", "raw", "map", NULL };
+static const char *masterformat_enums[] = { "map", "raw", "text", NULL };
 static cfg_type_t cfg_type_masterformat = {
        "masterformat", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
        &cfg_rep_string, &masterformat_enums
@@ -1217,8 +1240,9 @@ static cfg_type_t cfg_type_masterstyle = {
  *
  *  ... where message type is one of: client, resolver, auth, forwarder, all
  */
-static const char *dnstap_types[] = { "client", "resolver",
-                                     "auth", "forwarder", "all", NULL };
+static const char *dnstap_types[] = {
+       "all", "auth", "client", "forwarder", "resolver", NULL
+};
 
 static const char *dnstap_modes[] = { "query", "response", NULL };
 
@@ -1240,7 +1264,8 @@ static cfg_tuplefielddef_t dnstap_fields[] = {
 
 static cfg_type_t cfg_type_dnstap_entry = {
        "dnstap_value", cfg_parse_tuple, cfg_print_tuple,
-       cfg_doc_tuple, &cfg_rep_tuple, dnstap_fields };
+       cfg_doc_tuple, &cfg_rep_tuple, dnstap_fields
+};
 
 static cfg_type_t cfg_type_dnstap = {
        "dnstap", cfg_parse_bracketed_list, cfg_print_bracketed_list,
@@ -1337,7 +1362,9 @@ cleanup:
  * by 2 or more optional keyvalues that can be in any order.
  */
 static isc_result_t
-cfg_parse_kv_tuple(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
+cfg_parse_kv_tuple(cfg_parser_t *pctx, const cfg_type_t *type,
+                  cfg_obj_t **ret)
+{
        const cfg_tuplefielddef_t *fields, *f;
        cfg_obj_t *obj = NULL;
        int fn;
@@ -1434,8 +1461,8 @@ static cfg_type_t cfg_type_rpz_zone = {
  * "no-op" is an obsolete equivalent of "passthru".
  */
 static const char *rpz_policies[] = {
-       "given", "disabled", "passthru", "no-op", "drop", "tcp-only",
-       "nxdomain", "nodata", "cname", NULL
+       "cname", "disabled", "drop", "given", "no-op", "nodata",
+       "nxdomain", "passthru", "tcp-only", NULL
 };
 static cfg_type_t cfg_type_rpz_policy_name = {
        "policy name", cfg_parse_enum, cfg_print_ustring,
@@ -1527,33 +1554,30 @@ static cfg_type_t cfg_type_catz = {
        cfg_doc_kv_tuple, &cfg_rep_tuple, catz_fields
 };
 
-
-
 /*
  * rate-limit
  */
 static cfg_clausedef_t rrl_clauses[] = {
-       { "responses-per-second", &cfg_type_uint32, 0 },
-       { "referrals-per-second", &cfg_type_uint32, 0 },
-       { "nodata-per-second", &cfg_type_uint32, 0 },
-       { "nxdomains-per-second", &cfg_type_uint32, 0 },
-       { "errors-per-second", &cfg_type_uint32, 0 },
        { "all-per-second", &cfg_type_uint32, 0 },
-       { "slip", &cfg_type_uint32, 0 },
-       { "window", &cfg_type_uint32, 0 },
-       { "log-only", &cfg_type_boolean, 0 },
-       { "qps-scale", &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 },
-       { "exempt-clients", &cfg_type_bracketed_aml, 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 },
        { NULL, NULL, 0 }
 };
 
 static cfg_clausedef_t *rrl_clausesets[] = {
-       rrl_clauses,
-       NULL
+       rrl_clauses, NULL
 };
 
 static cfg_type_t cfg_type_rrl = {
@@ -1625,7 +1649,8 @@ doc_optional_uint32(cfg_printer_t *pctx, const cfg_type_t *type) {
 
 static cfg_type_t cfg_type_optional_uint32 = {
        "optional_uint32", parse_optional_uint32, NULL, doc_optional_uint32,
-       NULL, NULL };
+       NULL, NULL
+};
 
 static cfg_tuplefielddef_t prefetch_fields[] = {
        { "trigger", &cfg_type_uint32, 0 },
@@ -1642,12 +1667,12 @@ static cfg_type_t cfg_type_prefetch = {
  */
 static cfg_clausedef_t
 dns64_clauses[] = {
+       { "break-dnssec", &cfg_type_boolean, 0 },
        { "clients", &cfg_type_bracketed_aml, 0 },
-       { "mapped", &cfg_type_bracketed_aml, 0 },
        { "exclude", &cfg_type_bracketed_aml, 0 },
-       { "suffix", &cfg_type_netaddr6, 0 },
+       { "mapped", &cfg_type_bracketed_aml, 0 },
        { "recursive-only", &cfg_type_boolean, 0 },
-       { "break-dnssec", &cfg_type_boolean, 0 },
+       { "suffix", &cfg_type_netaddr6, 0 },
        { NULL, NULL, 0 },
 };
 
@@ -1777,7 +1802,8 @@ view_clauses[] = {
        { "suppress-initial-notify", &cfg_type_boolean, CFG_CLAUSEFLAG_NYI },
        { "topology", &cfg_type_bracketed_aml, CFG_CLAUSEFLAG_NOTIMP },
        { "transfer-format", &cfg_type_transferformat, 0 },
-       { "trust-anchor-telemetry", &cfg_type_boolean, CFG_CLAUSEFLAG_EXPERIMENTAL },
+       { "trust-anchor-telemetry", &cfg_type_boolean,
+         CFG_CLAUSEFLAG_EXPERIMENTAL },
        { "use-queryport-pool", &cfg_type_boolean, CFG_CLAUSEFLAG_OBSOLETE },
        { "v6-bias", &cfg_type_uint32, 0 },
        { "zero-no-soa-ttl-cache", &cfg_type_boolean, 0 },
@@ -1947,7 +1973,9 @@ options_clausesets[] = {
        NULL
 };
 static cfg_type_t cfg_type_options = {
-       "options", cfg_parse_map, cfg_print_map, cfg_doc_map, &cfg_rep_map, options_clausesets };
+       "options", cfg_parse_map, cfg_print_map, cfg_doc_map, &cfg_rep_map,
+       options_clausesets
+};
 
 /*% The "view" statement syntax. */
 
@@ -2067,8 +2095,8 @@ server_clausesets[] = {
        NULL
 };
 static cfg_type_t cfg_type_server = {
-       "server", cfg_parse_netprefix_map, cfg_print_map, cfg_doc_map, &cfg_rep_map,
-       server_clausesets
+       "server", cfg_parse_netprefix_map, cfg_print_map, cfg_doc_map,
+       &cfg_rep_map, server_clausesets
 };
 
 /*%
@@ -2081,7 +2109,7 @@ static cfg_type_t cfg_type_server = {
  */
 
 static const char *printtime_enums[] = {
-       "local", "iso8601", "iso8601-utc", NULL
+       "iso8601", "iso8601-utc", "local", NULL
 };
 static isc_result_t
 parse_printtime(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
@@ -2123,31 +2151,29 @@ static cfg_type_t cfg_type_channel = {
 
 /*% A list of log destination, used in the "category" clause. */
 static cfg_type_t cfg_type_destinationlist = {
-       "destinationlist", cfg_parse_bracketed_list, cfg_print_bracketed_list, cfg_doc_bracketed_list,
-       &cfg_rep_list, &cfg_type_astring };
+       "destinationlist", cfg_parse_bracketed_list, cfg_print_bracketed_list,
+       cfg_doc_bracketed_list, &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_clauses[] = {
        { "channel", &cfg_type_channel, CFG_CLAUSEFLAG_MULTI },
        { "category", &cfg_type_category, CFG_CLAUSEFLAG_MULTI },
        { NULL, NULL, 0 }
 };
-static cfg_clausedef_t *
-logging_clausesets[] = {
-       logging_clauses,
-       NULL
+static cfg_clausedef_t * logging_clausesets[] = {
+       logging_clauses, NULL
 };
 static cfg_type_t cfg_type_logging = {
-       "logging", cfg_parse_map, cfg_print_map, cfg_doc_map, &cfg_rep_map, logging_clausesets };
-
+       "logging", cfg_parse_map, cfg_print_map, cfg_doc_map,
+       &cfg_rep_map, logging_clausesets
+};
 
 /*%
  * For parsing an 'addzone' statement
  */
-
 static cfg_tuplefielddef_t addzone_fields[] = {
        { "name", &cfg_type_astring, 0 },
        { "class", &cfg_type_optional_class, 0 },
@@ -2156,7 +2182,9 @@ static cfg_tuplefielddef_t addzone_fields[] = {
        { NULL, NULL, 0 }
 };
 static cfg_type_t cfg_type_addzone = {
-       "zone", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple, addzone_fields };
+       "zone", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
+       &cfg_rep_tuple, addzone_fields 
+};
 
 static cfg_clausedef_t
 addzoneconf_clauses[] = {
@@ -2235,7 +2263,8 @@ parse_sizeval(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
        return (ISC_R_SUCCESS);
 
  cleanup:
-       cfg_parser_error(pctx, CFG_LOG_NEAR, "expected integer and optional unit");
+       cfg_parser_error(pctx, CFG_LOG_NEAR,
+                        "expected integer and optional unit");
        return (result);
 }
 
@@ -2273,7 +2302,8 @@ parse_sizeval_percent(cfg_parser_t *pctx, const cfg_type_t *type,
        }
 
  cleanup:
-       cfg_parser_error(pctx, CFG_LOG_NEAR, "expected integer and optional unit or percent");
+       cfg_parser_error(pctx, CFG_LOG_NEAR,
+                        "expected integer and optional unit or percent");
        return (result);
 }
 
@@ -2294,7 +2324,8 @@ doc_sizeval_percent(cfg_printer_t *pctx, const cfg_type_t *type) {
  */
 static cfg_type_t cfg_type_sizeval = {
        "sizeval", parse_sizeval, cfg_print_uint64, cfg_doc_terminal,
-       &cfg_rep_uint64, NULL };
+       &cfg_rep_uint64, NULL
+};
 
 /*%
  * A size, "unlimited", or "default".
@@ -2310,7 +2341,7 @@ doc_size(cfg_printer_t *pctx, const cfg_type_t *type) {
        doc_enum_or_other(pctx, type, &cfg_type_sizeval);
 }
 
-static const char *size_enums[] = { "unlimited", "default", NULL };
+static const char *size_enums[] = { "default", "unlimited", NULL };
 static cfg_type_t cfg_type_size = {
        "size", parse_size, cfg_print_ustring, doc_size,
        &cfg_rep_string, size_enums
@@ -2351,7 +2382,7 @@ doc_parse_size_or_percent(cfg_printer_t *pctx, const cfg_type_t *type) {
        doc_enum_or_other(pctx, type, &cfg_type_sizeval_percent);
 }
 
-static const char *sizeorpercent_enums[] = { "unlimited", "default", NULL };
+static const char *sizeorpercent_enums[] = { "default", "unlimited", NULL };
 static cfg_type_t cfg_type_sizeorpercent = {
        "size_or_percent", parse_size_or_percent, cfg_print_ustring,
        doc_parse_size_or_percent, &cfg_rep_string, sizeorpercent_enums
@@ -2481,9 +2512,12 @@ doc_optional_keyvalue(cfg_printer_t *pctx, const cfg_type_t *type) {
 }
 
 static const char *dialup_enums[] = {
-       "notify", "notify-passive", "refresh", "passive", NULL };
+       "notify", "notify-passive", "passive", "refresh", NULL
+};
 static isc_result_t
-parse_dialup_type(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
+parse_dialup_type(cfg_parser_t *pctx, const cfg_type_t *type,
+                 cfg_obj_t **ret)
+{
        return (parse_enum_or_other(pctx, type, &cfg_type_boolean, ret));
 }
 static void
@@ -2497,7 +2531,9 @@ static cfg_type_t cfg_type_dialuptype = {
 
 static const char *notify_enums[] = { "explicit", "master-only", NULL };
 static isc_result_t
-parse_notify_type(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
+parse_notify_type(cfg_parser_t *pctx, const cfg_type_t *type,
+                 cfg_obj_t **ret)
+{
        return (parse_enum_or_other(pctx, type, &cfg_type_boolean, ret));
 }
 static void
@@ -2572,10 +2608,10 @@ static cfg_type_t cfg_type_optional_keyref = {
  * geoip [ db <database> ] search-type <string>
  */
 static const char *geoiptype_enums[] = {
-       "country", "country3", "countryname", "region", "regionname",
-       "city", "postalcode", "postal", "metrocode", "metro",
-       "areacode", "area", "timezone", "tz", "continent", "isp",
-       "domain", "asnum", "org", "netspeed", NULL
+       "area", "areacode", "asnum", "city", "continent", "country",
+       "country3", "countryname", "domain", "isp", "metro", "metrocode",
+       "netspeed", "org", "postal", "postalcode", "region", "regionname",
+       "timezone", "tz", NULL
 };
 static cfg_type_t cfg_type_geoiptype = {
        "geoiptype", cfg_parse_enum, cfg_print_ustring,
@@ -2583,8 +2619,8 @@ static cfg_type_t cfg_type_geoiptype = {
 };
 
 static const char *geoipdb_enums[] = {
-       "country", "region", "city",
-       "isp", "domain", "asnum", "org", "netspeed", NULL
+       "asnum", "city", "country", "domain", "isp", "netspeed",
+       "org", "region", NULL
 };
 static cfg_type_t cfg_type_geoipdb = {
        "geoipdb", cfg_parse_enum, cfg_print_ustring,
@@ -2622,7 +2658,8 @@ parse_geoip(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
                        CHECK(cfg_parse_obj(pctx, fields[1].type,
                                    &obj->value.tuple[1]));
                } else {
-                       CHECK(cfg_parse_void(pctx, NULL, &obj->value.tuple[1]));
+                       CHECK(cfg_parse_void(pctx, NULL,
+                                            &obj->value.tuple[1]));
                        cfg_ungettoken(pctx);
                }
        }
@@ -2648,7 +2685,6 @@ print_geoip(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        cfg_print_obj(pctx, obj->value.tuple[3]);
 }
 
-
 static void
 doc_geoip(cfg_printer_t *pctx, const cfg_type_t *type) {
        UNUSED(type);
@@ -2687,7 +2723,8 @@ static cfg_type_t cfg_type_controls_allow = {
 };
 
 static keyword_type_t controls_keys_kw = {
-       "keys", &cfg_type_keylist };
+       "keys", &cfg_type_keylist
+};
 
 static cfg_type_t cfg_type_controls_keys = {
        "controls_keys", parse_optional_keyvalue,
@@ -2714,12 +2751,13 @@ static cfg_tuplefielddef_t inetcontrol_fields[] = {
 };
 
 static cfg_type_t cfg_type_inetcontrol = {
-       "inetcontrol", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple,
-       inetcontrol_fields
+       "inetcontrol", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
+       &cfg_rep_tuple, inetcontrol_fields
 };
 
 static keyword_type_t controls_perm_kw = {
-       "perm", &cfg_type_uint32 };
+       "perm", &cfg_type_uint32
+};
 
 static cfg_type_t cfg_type_controls_perm = {
        "controls_perm", parse_keyvalue,
@@ -2728,7 +2766,8 @@ static cfg_type_t cfg_type_controls_perm = {
 };
 
 static keyword_type_t controls_owner_kw = {
-       "owner", &cfg_type_uint32 };
+       "owner", &cfg_type_uint32
+};
 
 static cfg_type_t cfg_type_controls_owner = {
        "controls_owner", parse_keyvalue,
@@ -2737,7 +2776,8 @@ static cfg_type_t cfg_type_controls_owner = {
 };
 
 static keyword_type_t controls_group_kw = {
-       "group", &cfg_type_uint32 };
+       "group", &cfg_type_uint32
+};
 
 static cfg_type_t cfg_type_controls_group = {
        "controls_allow", parse_keyvalue,
@@ -2756,8 +2796,8 @@ static cfg_tuplefielddef_t unixcontrol_fields[] = {
 };
 
 static cfg_type_t cfg_type_unixcontrol = {
-       "unixcontrol", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple,
-       unixcontrol_fields
+       "unixcontrol", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
+       &cfg_rep_tuple, unixcontrol_fields
 };
 
 static cfg_clausedef_t
@@ -2773,7 +2813,8 @@ controls_clausesets[] = {
        NULL
 };
 static cfg_type_t cfg_type_controls = {
-       "controls", cfg_parse_map, cfg_print_map, cfg_doc_map, &cfg_rep_map,    &controls_clausesets
+       "controls", cfg_parse_map, cfg_print_map, cfg_doc_map, &cfg_rep_map,
+       &controls_clausesets
 };
 
 /*%
@@ -2853,7 +2894,9 @@ static cfg_type_t cfg_type_optional_class = {
 };
 
 static isc_result_t
-parse_querysource(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
+parse_querysource(cfg_parser_t *pctx, const cfg_type_t *type,
+                 cfg_obj_t **ret)
+{
        isc_result_t result;
        cfg_obj_t *obj = NULL;
        isc_netaddr_t netaddr;
@@ -2968,7 +3011,9 @@ static cfg_type_t cfg_type_querysource = {
 /*% addrmatchelt */
 
 static isc_result_t
-parse_addrmatchelt(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
+parse_addrmatchelt(cfg_parser_t *pctx, const cfg_type_t *type,
+                  cfg_obj_t **ret)
+{
        isc_result_t result;
        UNUSED(type);
 
@@ -2988,8 +3033,8 @@ parse_addrmatchelt(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret)
                        CHECK(cfg_gettoken(pctx, 0));
                        CHECK(cfg_parse_obj(pctx, &cfg_type_geoip, ret));
 #else
-                       cfg_parser_error(pctx, CFG_LOG_NEAR,
-                                        "'geoip' not supported in this build");
+                       cfg_parser_error(pctx, CFG_LOG_NEAR, "'geoip' "
+                                        "not supported in this build");
                        return (ISC_R_UNEXPECTEDTOKEN);
 #endif
                } else {
@@ -3116,7 +3161,8 @@ static cfg_type_t cfg_type_server_key_kludge = {
  */
 
 static isc_result_t
-parse_optional_facility(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret)
+parse_optional_facility(cfg_parser_t *pctx, const cfg_type_t *type,
+                       cfg_obj_t **ret)
 {
        isc_result_t result;
        UNUSED(type);
@@ -3140,7 +3186,8 @@ doc_optional_facility(cfg_printer_t *pctx, const cfg_type_t *type) {
 
 static cfg_type_t cfg_type_optional_facility = {
        "optional_facility", parse_optional_facility, NULL,
-       doc_optional_facility, NULL, NULL };
+       doc_optional_facility, NULL, NULL
+};
 
 
 /*%
@@ -3156,7 +3203,9 @@ static cfg_type_t cfg_type_debuglevel = {
 };
 
 static isc_result_t
-parse_logseverity(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
+parse_logseverity(cfg_parser_t *pctx, const cfg_type_t *type,
+                 cfg_obj_t **ret)
+{
        isc_result_t result;
        UNUSED(type);
 
@@ -3186,7 +3235,8 @@ parse_logseverity(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
 
 static cfg_type_t cfg_type_logseverity = {
        "log_severity", parse_logseverity, NULL, cfg_doc_terminal,
-       NULL, NULL };
+       NULL, NULL
+};
 
 /*%
  * The "file" clause of the "channel" statement.
@@ -3195,7 +3245,9 @@ static cfg_type_t cfg_type_logseverity = {
 
 static const char *logversions_enums[] = { "unlimited", NULL };
 static isc_result_t
-parse_logversions(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
+parse_logversions(cfg_parser_t *pctx, const cfg_type_t *type,
+                 cfg_obj_t **ret)
+{
        return (parse_enum_or_other(pctx, type, &cfg_type_uint32, ret));
 }
 
@@ -3315,13 +3367,14 @@ static cfg_tuplefielddef_t lwres_view_fields[] = {
        { NULL, NULL, 0 }
 };
 static cfg_type_t cfg_type_lwres_view = {
-       "lwres_view", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, &cfg_rep_tuple,
-       lwres_view_fields
+       "lwres_view", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
+       &cfg_rep_tuple, lwres_view_fields
 };
 
 static cfg_type_t cfg_type_lwres_searchlist = {
        "lwres_searchlist", cfg_parse_bracketed_list, cfg_print_bracketed_list,
-       cfg_doc_bracketed_list, &cfg_rep_list, &cfg_type_astring };
+       cfg_doc_bracketed_list, &cfg_rep_list, &cfg_type_astring
+};
 
 static cfg_clausedef_t
 lwres_clauses[] = {
@@ -3483,7 +3536,8 @@ parse_sockaddrnameport(cfg_parser_t *pctx, const cfg_type_t *type,
        if (pctx->token.type == isc_tokentype_string ||
            pctx->token.type == isc_tokentype_qstring) {
                if (cfg_lookingat_netaddr(pctx, CFG_ADDR_V4OK | CFG_ADDR_V6OK))
-                       CHECK(cfg_parse_sockaddr(pctx, &cfg_type_sockaddr, ret));
+                       CHECK(cfg_parse_sockaddr(pctx, &cfg_type_sockaddr,
+                                                ret));
                else {
                        const cfg_tuplefielddef_t *fields =
                                                   cfg_type_nameport.of;
@@ -3567,7 +3621,8 @@ parse_masterselement(cfg_parser_t *pctx, const cfg_type_t *type,
        if (pctx->token.type == isc_tokentype_string ||
            pctx->token.type == isc_tokentype_qstring) {
                if (cfg_lookingat_netaddr(pctx, CFG_ADDR_V4OK | CFG_ADDR_V6OK))
-                       CHECK(cfg_parse_sockaddr(pctx, &cfg_type_sockaddr, ret));
+                       CHECK(cfg_parse_sockaddr(pctx, &cfg_type_sockaddr,
+                             ret));
                else
                        CHECK(cfg_parse_astring(pctx, &cfg_type_astring, ret));
        } else {
@@ -3612,7 +3667,8 @@ parse_ttlval(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
        return (ISC_R_SUCCESS);
 
  cleanup:
-       cfg_parser_error(pctx, CFG_LOG_NEAR, "expected integer and optional unit");
+       cfg_parser_error(pctx, CFG_LOG_NEAR,
+                        "expected integer and optional unit");
        return (result);
 }
 
index 4181186d4b81ebbe6bca5029e5b352653e380227..30004c331e7c999de98e1ddbd87db108a0b0b25a 100644 (file)
@@ -1104,6 +1104,14 @@ parse_btext(cfg_parser_t *pctx, const cfg_type_t *type,
 
 static void
 print_btext(cfg_printer_t *pctx, const cfg_obj_t *obj) {
+       /*
+        * We need to print "{" instead of running print_open()
+        * in order to preserve the exact original formatting
+        * of the bracketed text. But we increment the indent value
+        * so that print_close() will leave us back in our original
+        * state.
+        */
+       pctx->indent++;
        cfg_print_cstr(pctx, "{");
        cfg_print_chars(pctx, obj->value.string.base, obj->value.string.length);
        print_close(pctx);