Commit 6d9af6c5a7 for bind
commit 6d9af6c5a75784fe8991d17bfaa46f726db73e52
Author: Alessio Podda <alessio@isc.org>
Date: Fri Mar 20 09:25:23 2026 +0100
Intern configuration clause names
diff --git a/bin/check/named-checkconf.c b/bin/check/named-checkconf.c
index 3926eb2413..53dbbe0557 100644
--- a/bin/check/named-checkconf.c
+++ b/bin/check/named-checkconf.c
@@ -40,6 +40,7 @@
#include <dns/zone.h>
#include <isccfg/check.h>
+#include <isccfg/clause.h>
#include <isccfg/grammar.h>
#include <isccfg/namedconf.h>
@@ -59,7 +60,7 @@ usage(int status) {
}
static bool
-get_maps(const cfg_obj_t **maps, const char *name, const cfg_obj_t **obj) {
+get_maps(const cfg_obj_t **maps, enum cfg_clause name, const cfg_obj_t **obj) {
int i;
for (i = 0;; i++) {
if (maps[i] == NULL) {
@@ -84,7 +85,8 @@ get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
return false;
}
checknames = NULL;
- result = cfg_map_get(maps[i], "check-names", &checknames);
+ result = cfg_map_get(maps[i], CFG_CLAUSE_CHECK_NAMES,
+ &checknames);
if (result != ISC_R_SUCCESS) {
continue;
}
@@ -175,14 +177,14 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
maps[i++] = cfg_tuple_get(vconfig, "options");
}
if (config != NULL) {
- cfg_map_get(config, "options", &obj);
+ cfg_map_get(config, CFG_CLAUSE_OPTIONS, &obj);
if (obj != NULL) {
maps[i++] = obj;
}
}
maps[i] = NULL;
- cfg_map_get(zoptions, "in-view", &inviewobj);
+ cfg_map_get(zoptions, CFG_CLAUSE_IN_VIEW, &inviewobj);
if (inviewobj != NULL && list) {
const char *inview = cfg_obj_asstring(inviewobj);
printf("%s %s %s in-view %s\n", zname, zclass, view, inview);
@@ -191,7 +193,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
return ISC_R_SUCCESS;
}
- cfg_map_get(zoptions, "type", &typeobj);
+ cfg_map_get(zoptions, CFG_CLAUSE_TYPE, &typeobj);
if (typeobj == NULL) {
return ISC_R_FAILURE;
}
@@ -205,19 +207,19 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
/*
* Skip checks when using an alternate data source.
*/
- cfg_map_get(zoptions, "database", &dbobj);
+ cfg_map_get(zoptions, CFG_CLAUSE_DATABASE, &dbobj);
if (dbobj != NULL &&
strcmp(ZONEDB_DEFAULT, cfg_obj_asstring(dbobj)) != 0)
{
return ISC_R_SUCCESS;
}
- cfg_map_get(zoptions, "dlz", &dlzobj);
+ cfg_map_get(zoptions, CFG_CLAUSE_DLZ, &dlzobj);
if (dlzobj != NULL) {
return ISC_R_SUCCESS;
}
- cfg_map_get(zoptions, "file", &fileobj);
+ cfg_map_get(zoptions, CFG_CLAUSE_FILE, &fileobj);
if (fileobj != NULL) {
zfile = cfg_obj_asstring(fileobj);
}
@@ -240,9 +242,10 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
* Is the redirect zone configured as a secondary?
*/
if (strcasecmp(cfg_obj_asstring(typeobj), "redirect") == 0) {
- cfg_map_get(zoptions, "primaries", &primariesobj);
+ cfg_map_get(zoptions, CFG_CLAUSE_PRIMARIES, &primariesobj);
if (primariesobj == NULL) {
- cfg_map_get(zoptions, "masters", &primariesobj);
+ cfg_map_get(zoptions, CFG_CLAUSE_MASTERS,
+ &primariesobj);
}
if (primariesobj != NULL) {
@@ -255,7 +258,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
}
obj = NULL;
- if (get_maps(maps, "check-dup-records", &obj)) {
+ if (get_maps(maps, CFG_CLAUSE_CHECK_DUP_RECORDS, &obj)) {
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
zone_options |= DNS_ZONEOPT_CHECKDUPRR;
zone_options &= ~DNS_ZONEOPT_CHECKDUPRRFAIL;
@@ -274,7 +277,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
}
obj = NULL;
- if (get_maps(maps, "check-mx", &obj)) {
+ if (get_maps(maps, CFG_CLAUSE_CHECK_MX, &obj)) {
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
zone_options |= DNS_ZONEOPT_CHECKMX;
zone_options &= ~DNS_ZONEOPT_CHECKMXFAIL;
@@ -293,7 +296,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
}
obj = NULL;
- if (get_maps(maps, "check-integrity", &obj)) {
+ if (get_maps(maps, CFG_CLAUSE_CHECK_INTEGRITY, &obj)) {
if (cfg_obj_asboolean(obj)) {
zone_options |= DNS_ZONEOPT_CHECKINTEGRITY;
} else {
@@ -304,7 +307,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
}
obj = NULL;
- if (get_maps(maps, "check-mx-cname", &obj)) {
+ if (get_maps(maps, CFG_CLAUSE_CHECK_MX_CNAME, &obj)) {
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
zone_options |= DNS_ZONEOPT_WARNMXCNAME;
zone_options &= ~DNS_ZONEOPT_IGNOREMXCNAME;
@@ -323,7 +326,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
}
obj = NULL;
- if (get_maps(maps, "check-srv-cname", &obj)) {
+ if (get_maps(maps, CFG_CLAUSE_CHECK_SRV_CNAME, &obj)) {
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
zone_options |= DNS_ZONEOPT_WARNSRVCNAME;
zone_options &= ~DNS_ZONEOPT_IGNORESRVCNAME;
@@ -342,7 +345,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
}
obj = NULL;
- if (get_maps(maps, "check-sibling", &obj)) {
+ if (get_maps(maps, CFG_CLAUSE_CHECK_SIBLING, &obj)) {
if (cfg_obj_asboolean(obj)) {
zone_options |= DNS_ZONEOPT_CHECKSIBLING;
} else {
@@ -351,7 +354,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
}
obj = NULL;
- if (get_maps(maps, "check-spf", &obj)) {
+ if (get_maps(maps, CFG_CLAUSE_CHECK_SPF, &obj)) {
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
zone_options |= DNS_ZONEOPT_CHECKSPF;
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
@@ -364,7 +367,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
}
obj = NULL;
- if (get_maps(maps, "check-svcb", &obj)) {
+ if (get_maps(maps, CFG_CLAUSE_CHECK_SVCB, &obj)) {
if (cfg_obj_asboolean(obj)) {
zone_options |= DNS_ZONEOPT_CHECKSVCB;
} else {
@@ -375,7 +378,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
}
obj = NULL;
- if (get_maps(maps, "check-wildcard", &obj)) {
+ if (get_maps(maps, CFG_CLAUSE_CHECK_WILDCARD, &obj)) {
if (cfg_obj_asboolean(obj)) {
zone_options |= DNS_ZONEOPT_CHECKWILDCARD;
} else {
@@ -406,7 +409,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
masterformat = dns_masterformat_text;
fmtobj = NULL;
- if (get_maps(maps, "masterfile-format", &fmtobj)) {
+ if (get_maps(maps, CFG_CLAUSE_MASTERFILE_FORMAT, &fmtobj)) {
const char *masterformatstr = cfg_obj_asstring(fmtobj);
if (strcasecmp(masterformatstr, "text") == 0) {
masterformat = dns_masterformat_text;
@@ -418,7 +421,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
}
obj = NULL;
- if (get_maps(maps, "max-zone-ttl", &obj)) {
+ if (get_maps(maps, CFG_CLAUSE_MAX_ZONE_TTL, &obj)) {
maxttl = cfg_obj_asduration(obj);
zone_options |= DNS_ZONEOPT_CHECKTTL;
}
@@ -448,9 +451,9 @@ configure_view(const char *vclass, const char *view, const cfg_obj_t *config,
zonelist = NULL;
if (voptions != NULL) {
- (void)cfg_map_get(voptions, "zone", &zonelist);
+ (void)cfg_map_get(voptions, CFG_CLAUSE_ZONE, &zonelist);
} else {
- (void)cfg_map_get(config, "zone", &zonelist);
+ (void)cfg_map_get(config, CFG_CLAUSE_ZONE, &zonelist);
}
CFG_LIST_FOREACH(zonelist, element) {
@@ -488,7 +491,7 @@ load_zones_fromconfig(const cfg_obj_t *config, bool list_zones) {
views = NULL;
- (void)cfg_map_get(config, "view", &views);
+ (void)cfg_map_get(config, CFG_CLAUSE_VIEW, &views);
CFG_LIST_FOREACH(views, element) {
const cfg_obj_t *classobj;
dns_rdataclass_t viewclass;
diff --git a/bin/delv/delv.c b/bin/delv/delv.c
index 09a990f782..795fdababf 100644
--- a/bin/delv/delv.c
+++ b/bin/delv/delv.c
@@ -76,6 +76,7 @@
#include <dst/dst.h>
+#include <isccfg/clause.h>
#include <isccfg/grammar.h>
#include <isccfg/namedconf.h>
@@ -161,10 +162,10 @@ static dns_fixedname_t qfn;
/* Default trust anchors and clause/type definitions */
static char anchortext[] = TRUST_ANCHORS;
-static cfg_clausedef_t delv_clauses[] = { { "builtin-trust-anchors",
+static cfg_clausedef_t delv_clauses[] = { { CFG_CLAUSE_BUILTIN_TRUST_ANCHORS,
&cfg_type_builtin_dnsseckeys,
CFG_CLAUSEFLAG_MULTI, NULL },
- { NULL, NULL, 0, NULL } };
+ { CFG_CLAUSE__NONE, NULL, 0, NULL } };
static cfg_clausedef_t *delv_clausesets[] = { delv_clauses, NULL };
static cfg_type_t delv_type = { "delv", cfg_parse_mapbody, NULL,
NULL, &cfg_rep_map, delv_clausesets };
@@ -840,7 +841,7 @@ setup_dnsseckeys(dns_client_t *client, dns_view_t *toview) {
}
INSIST(bindkeys != NULL);
- cfg_map_get(bindkeys, "trust-anchors", &trust_anchors);
+ cfg_map_get(bindkeys, CFG_CLAUSE_TRUST_ANCHORS, &trust_anchors);
} else {
isc_buffer_t b;
@@ -852,7 +853,8 @@ setup_dnsseckeys(dns_client_t *client, dns_view_t *toview) {
fatal("Unable to parse built-in keys");
}
INSIST(bindkeys != NULL);
- cfg_map_get(bindkeys, "builtin-trust-anchors", &trust_anchors);
+ cfg_map_get(bindkeys, CFG_CLAUSE_BUILTIN_TRUST_ANCHORS,
+ &trust_anchors);
}
if (trust_anchors != NULL) {
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
index 57575a2ece..1c7f144411 100644
--- a/bin/dig/dighost.c
+++ b/bin/dig/dighost.c
@@ -77,6 +77,7 @@
#include <dst/dst.h>
+#include <isccfg/clause.h>
#include <isccfg/namedconf.h>
#include <irs/resconf.h>
@@ -1094,10 +1095,10 @@ read_confkey(void) {
CHECK(cfg_parse_file(keyfile, &cfg_type_sessionkey, 0, &file));
- CHECK(cfg_map_get(file, "key", &keyobj));
+ CHECK(cfg_map_get(file, CFG_CLAUSE_KEY, &keyobj));
- (void)cfg_map_get(keyobj, "secret", &secretobj);
- (void)cfg_map_get(keyobj, "algorithm", &algorithmobj);
+ (void)cfg_map_get(keyobj, CFG_CLAUSE_SECRET, &secretobj);
+ (void)cfg_map_get(keyobj, CFG_CLAUSE_ALGORITHM, &algorithmobj);
if (secretobj == NULL || algorithmobj == NULL) {
fatal("key must have algorithm and secret");
}
diff --git a/bin/dnssec/dnssectool.c b/bin/dnssec/dnssectool.c
index 1d58b780e3..7c629f74d6 100644
--- a/bin/dnssec/dnssectool.c
+++ b/bin/dnssec/dnssectool.c
@@ -57,6 +57,8 @@
#include <dns/secalg.h>
#include <dns/time.h>
+#include <isccfg/clause.h>
+
#include "dnssectool.h"
#define KEYSTATES_NVALUES 4
@@ -627,7 +629,7 @@ kasp_from_conf(cfg_obj_t *config, isc_mem_t *mctx, const char *name,
isc_result_totext(result));
}
- (void)cfg_map_get(config, "key-store", &keystores);
+ (void)cfg_map_get(config, CFG_CLAUSE_KEY_STORE, &keystores);
CFG_LIST_FOREACH(keystores, element) {
cfg_obj_t *kconfig = cfg_listelt_value(element);
result = cfg_keystore_fromconfig(kconfig, mctx, &kslist, NULL);
@@ -645,7 +647,7 @@ kasp_from_conf(cfg_obj_t *config, isc_mem_t *mctx, const char *name,
}
dns_keystore_detach(&keystore);
- (void)cfg_map_get(config, "dnssec-policy", &kasps);
+ (void)cfg_map_get(config, CFG_CLAUSE_DNSSEC_POLICY, &kasps);
CFG_LIST_FOREACH(kasps, element) {
dns_kasp_t *kasp = NULL;
diff --git a/bin/named/config.c b/bin/named/config.c
index 3380f12635..13300a4f47 100644
--- a/bin/named/config.c
+++ b/bin/named/config.c
@@ -42,6 +42,7 @@
#include <dst/dst.h>
#include <isccfg/check.h>
+#include <isccfg/clause.h>
#include <isccfg/grammar.h>
#include <isccfg/namedconf.h>
@@ -95,7 +96,7 @@ out:
}
isc_result_t
-named_config_get(cfg_obj_t const *const *maps, const char *name,
+named_config_get(cfg_obj_t const *const *maps, enum cfg_clause name,
const cfg_obj_t **obj) {
int i;
@@ -109,7 +110,7 @@ named_config_get(cfg_obj_t const *const *maps, const char *name,
isc_result_t
named_config_findopt(const cfg_obj_t *opts1, const cfg_obj_t *opts2,
- const char *name, const cfg_obj_t **objp) {
+ enum cfg_clause name, const cfg_obj_t **objp) {
isc_result_t result = ISC_R_NOTFOUND;
REQUIRE(*objp == NULL);
@@ -138,7 +139,7 @@ named_checknames_get(const cfg_obj_t **maps, const char *const names[],
for (i = 0; maps[i] != NULL; i++) {
checknames = NULL;
- if (cfg_map_get(maps[i], "check-names", &checknames) ==
+ if (cfg_map_get(maps[i], CFG_CLAUSE_CHECK_NAMES, &checknames) ==
ISC_R_SUCCESS)
{
/*
@@ -245,7 +246,7 @@ named_config_getzonetype(const cfg_obj_t *zonetypeobj) {
}
isc_result_t
-named_config_getremotesdef(const cfg_obj_t *cctx, const char *list,
+named_config_getremotesdef(const cfg_obj_t *cctx, enum cfg_clause list,
const char *name, const cfg_obj_t **ret) {
const cfg_obj_t *obj = NULL;
@@ -313,8 +314,10 @@ named_config_getname(isc_mem_t *mctx, const cfg_obj_t *obj,
oldlen = newlen; \
}
-static const char *remotesnames[4] = { "remote-servers", "parental-agents",
- "primaries", "masters" };
+static const enum cfg_clause remotesnames[4] = { CFG_CLAUSE_REMOTE_SERVERS,
+ CFG_CLAUSE_PARENTAL_AGENTS,
+ CFG_CLAUSE_PRIMARIES,
+ CFG_CLAUSE_MASTERS };
typedef struct {
isc_sockaddr_t *addrs;
@@ -560,9 +563,9 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
/*
* Get system defaults.
*/
- CHECK(named_config_getport(config, "port", &def_port));
+ CHECK(named_config_getport(config, CFG_CLAUSE_PORT, &def_port));
- CHECK(named_config_getport(config, "tls-port", &def_tlsport));
+ CHECK(named_config_getport(config, CFG_CLAUSE_TLS_PORT, &def_tlsport));
/*
* Process the (nested) list(s).
@@ -641,7 +644,7 @@ cleanup:
}
isc_result_t
-named_config_getport(const cfg_obj_t *config, const char *type,
+named_config_getport(const cfg_obj_t *config, enum cfg_clause type,
in_port_t *portp) {
const cfg_obj_t *maps[3];
const cfg_obj_t *options = NULL;
@@ -649,7 +652,7 @@ named_config_getport(const cfg_obj_t *config, const char *type,
isc_result_t result;
int i;
- (void)cfg_map_get(config, "options", &options);
+ (void)cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
i = 0;
if (options != NULL) {
maps[i++] = options;
diff --git a/bin/named/controlconf.c b/bin/named/controlconf.c
index c3e8ec4717..024e06ecf7 100644
--- a/bin/named/controlconf.c
+++ b/bin/named/controlconf.c
@@ -41,6 +41,7 @@
#include <isccc/util.h>
#include <isccfg/check.h>
+#include <isccfg/clause.h>
#include <isccfg/namedconf.h>
#include <named/config.h>
@@ -732,8 +733,10 @@ register_keys(const cfg_obj_t *control, const cfg_obj_t *keylist,
const char *secretstr = NULL;
unsigned int algtype;
- (void)cfg_map_get(keydef, "algorithm", &algobj);
- (void)cfg_map_get(keydef, "secret", &secretobj);
+ (void)cfg_map_get(keydef, CFG_CLAUSE_ALGORITHM,
+ &algobj);
+ (void)cfg_map_get(keydef, CFG_CLAUSE_SECRET,
+ &secretobj);
INSIST(algobj != NULL && secretobj != NULL);
algstr = cfg_obj_asstring(algobj);
@@ -798,7 +801,7 @@ get_rndckey(isc_mem_t *mctx, controlkeylist_t *keyids) {
}
CHECK(cfg_parse_file(named_g_keyfile, &cfg_type_rndckey, 0, &config));
- CHECK(cfg_map_get(config, "key", &key));
+ CHECK(cfg_map_get(config, CFG_CLAUSE_KEY, &key));
keyid = isc_mem_get(mctx, sizeof(*keyid));
*keyid = (controlkey_t){
@@ -810,8 +813,8 @@ get_rndckey(isc_mem_t *mctx, controlkeylist_t *keyids) {
CHECK(isccfg_check_key(key));
- (void)cfg_map_get(key, "algorithm", &algobj);
- (void)cfg_map_get(key, "secret", &secretobj);
+ (void)cfg_map_get(key, CFG_CLAUSE_ALGORITHM, &algobj);
+ (void)cfg_map_get(key, CFG_CLAUSE_SECRET, &secretobj);
INSIST(algobj != NULL && secretobj != NULL);
algstr = cfg_obj_asstring(algobj);
@@ -875,7 +878,7 @@ get_key_info(const cfg_obj_t *config, const cfg_obj_t *control,
if (!cfg_obj_isvoid(control_keylist) &&
cfg_list_first(control_keylist) != NULL)
{
- result = cfg_map_get(config, "key", &global_keylist);
+ result = cfg_map_get(config, CFG_CLAUSE_KEY, &global_keylist);
if (result == ISC_R_SUCCESS) {
*global_keylistp = global_keylist;
@@ -1132,7 +1135,7 @@ named_controls_configure(named_controls_t *cp, const cfg_obj_t *config,
/*
* Get the list of named.conf 'controls' statements.
*/
- (void)cfg_map_get(config, "controls", &controlslist);
+ (void)cfg_map_get(config, CFG_CLAUSE_CONTROLS, &controlslist);
/*
* Run through the new control channel list, noting sockets that
@@ -1150,7 +1153,8 @@ named_controls_configure(named_controls_t *cp, const cfg_obj_t *config,
controls = cfg_listelt_value(element);
- (void)cfg_map_get(controls, "unix", &unixcontrols);
+ (void)cfg_map_get(controls, CFG_CLAUSE_UNIX,
+ &unixcontrols);
if (unixcontrols != NULL) {
cfg_obj_log(controls, ISC_LOG_ERROR,
"UNIX domain sockets are not "
@@ -1158,7 +1162,8 @@ named_controls_configure(named_controls_t *cp, const cfg_obj_t *config,
return ISC_R_FAILURE;
}
- (void)cfg_map_get(controls, "inet", &inetcontrols);
+ (void)cfg_map_get(controls, CFG_CLAUSE_INET,
+ &inetcontrols);
if (inetcontrols == NULL) {
continue;
}
diff --git a/bin/named/include/named/config.h b/bin/named/include/named/config.h
index c9647e9cf2..e51a9b20c9 100644
--- a/bin/named/include/named/config.h
+++ b/bin/named/include/named/config.h
@@ -21,6 +21,7 @@
#include <dns/zone.h>
#include <isccfg/cfg.h>
+#include <isccfg/clause.h>
isc_result_t
named_config_parsedefaults(cfg_obj_t **conf);
@@ -29,7 +30,7 @@ isc_result_t
named_config_parsefile(cfg_obj_t **conf);
isc_result_t
-named_config_get(cfg_obj_t const *const *maps, const char *name,
+named_config_get(cfg_obj_t const *const *maps, enum cfg_clause name,
const cfg_obj_t **obj);
isc_result_t
@@ -51,7 +52,7 @@ dns_zonetype_t
named_config_getzonetype(const cfg_obj_t *zonetypeobj);
isc_result_t
-named_config_getremotesdef(const cfg_obj_t *cctx, const char *list,
+named_config_getremotesdef(const cfg_obj_t *cctx, enum cfg_clause list,
const char *name, const cfg_obj_t **ret);
isc_result_t
@@ -59,7 +60,7 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
isc_mem_t *mctx, dns_ipkeylist_t *ipkl);
isc_result_t
-named_config_getport(const cfg_obj_t *config, const char *type,
+named_config_getport(const cfg_obj_t *config, enum cfg_clause type,
in_port_t *portp);
isc_result_t
@@ -68,7 +69,7 @@ named_config_getkeyalgorithm(const char *str, unsigned int *typep,
isc_result_t
named_config_findopt(const cfg_obj_t *opts1, const cfg_obj_t *opts2,
- const char *name, const cfg_obj_t **objp);
+ enum cfg_clause name, const cfg_obj_t **objp);
isc_result_t
named_config_effective(cfg_obj_t **effective, const cfg_obj_t *defaults,
diff --git a/bin/named/logconf.c b/bin/named/logconf.c
index b1e8cdc7f9..f905395d35 100644
--- a/bin/named/logconf.c
+++ b/bin/named/logconf.c
@@ -24,6 +24,7 @@
#include <isc/util.h>
#include <isccfg/cfg.h>
+#include <isccfg/clause.h>
#include <named/log.h>
#include <named/logconf.h>
@@ -93,10 +94,10 @@ channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *logconfig) {
channelname = cfg_obj_asstring(cfg_map_getname(channel));
- (void)cfg_map_get(channel, "file", &fileobj);
- (void)cfg_map_get(channel, "syslog", &syslogobj);
- (void)cfg_map_get(channel, "null", &nullobj);
- (void)cfg_map_get(channel, "stderr", &stderrobj);
+ (void)cfg_map_get(channel, CFG_CLAUSE_FILE, &fileobj);
+ (void)cfg_map_get(channel, CFG_CLAUSE_SYSLOG, &syslogobj);
+ (void)cfg_map_get(channel, CFG_CLAUSE_NULL, &nullobj);
+ (void)cfg_map_get(channel, CFG_CLAUSE_STDERR, &stderrobj);
i = 0;
if (fileobj != NULL) {
@@ -204,10 +205,12 @@ channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *logconfig) {
const cfg_obj_t *printtime = NULL;
const cfg_obj_t *buffered = NULL;
- (void)cfg_map_get(channel, "print-category", &printcat);
- (void)cfg_map_get(channel, "print-severity", &printsev);
- (void)cfg_map_get(channel, "print-time", &printtime);
- (void)cfg_map_get(channel, "buffered", &buffered);
+ (void)cfg_map_get(channel, CFG_CLAUSE_PRINT_CATEGORY,
+ &printcat);
+ (void)cfg_map_get(channel, CFG_CLAUSE_PRINT_SEVERITY,
+ &printsev);
+ (void)cfg_map_get(channel, CFG_CLAUSE_PRINT_TIME, &printtime);
+ (void)cfg_map_get(channel, CFG_CLAUSE_BUFFERED, &buffered);
if (printcat != NULL && cfg_obj_asboolean(printcat)) {
flags |= ISC_LOG_PRINTCATEGORY;
@@ -236,7 +239,9 @@ channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *logconfig) {
}
level = ISC_LOG_INFO;
- if (cfg_map_get(channel, "severity", &severity) == ISC_R_SUCCESS) {
+ if (cfg_map_get(channel, CFG_CLAUSE_SEVERITY, &severity) ==
+ ISC_R_SUCCESS)
+ {
if (cfg_obj_isstring(severity)) {
const char *str = cfg_obj_asstring(severity);
if (strcasecmp(str, "critical") == 0) {
@@ -315,13 +320,13 @@ named_logconfig(isc_logconfig_t *logconfig, const cfg_obj_t *logstmt) {
named_log_setdefaultsslkeylogfile(logconfig);
}
- (void)cfg_map_get(logstmt, "channel", &channels);
+ (void)cfg_map_get(logstmt, CFG_CLAUSE_CHANNEL, &channels);
CFG_LIST_FOREACH(channels, element) {
const cfg_obj_t *channel = cfg_listelt_value(element);
CHECK(channel_fromconf(channel, logconfig));
}
- (void)cfg_map_get(logstmt, "category", &categories);
+ (void)cfg_map_get(logstmt, CFG_CLAUSE_CATEGORY, &categories);
CFG_LIST_FOREACH(categories, element) {
const cfg_obj_t *category = cfg_listelt_value(element);
CHECK(category_fromconf(category, logconfig));
diff --git a/bin/named/nzd.c b/bin/named/nzd.c
index ec2c352406..d3edcc9900 100644
--- a/bin/named/nzd.c
+++ b/bin/named/nzd.c
@@ -23,6 +23,7 @@
#include <dns/zoneproperties.h>
#include <isccfg/cfg.h>
+#include <isccfg/clause.h>
#include <isccfg/namedconf.h>
#include <named/nzd.h>
@@ -399,7 +400,7 @@ nzd_load_nzf(dns_view_t *view) {
}
zonelist = NULL;
- CHECK(cfg_map_get(nzf_config, "zone", &zonelist));
+ CHECK(cfg_map_get(nzf_config, CFG_CLAUSE_ZONE, &zonelist));
if (!cfg_obj_islist(zonelist)) {
CLEANUP(ISC_R_FAILURE);
}
diff --git a/bin/named/server.c b/bin/named/server.c
index 96e3445ca6..90b75696fc 100644
--- a/bin/named/server.c
+++ b/bin/named/server.c
@@ -114,6 +114,7 @@
#include <isccfg/cfg.h>
#include <isccfg/check.h>
+#include <isccfg/clause.h>
#include <isccfg/grammar.h>
#include <isccfg/kaspconf.h>
#include <isccfg/namedconf.h>
@@ -475,7 +476,8 @@ configure_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
cfg_aclconfctx_t *aclctx, dns_kasplist_t *kasplist);
static const cfg_obj_t *
-find_maplist(const cfg_obj_t *config, const char *listname, const char *name);
+find_maplist(const cfg_obj_t *config, enum cfg_clause listname,
+ const char *name);
static isc_result_t
add_keydata_zone(dns_view_t *view, const char *directory, isc_mem_t *mctx);
@@ -498,7 +500,7 @@ putnull(isc_buffer_t *b);
*/
static isc_result_t
configure_view_acl(const cfg_obj_t *vconfig, const cfg_obj_t *config,
- const char *aclname, const char *acltuplename,
+ enum cfg_clause aclname, const char *acltuplename,
cfg_aclconfctx_t *aclctx, isc_mem_t *mctx,
dns_acl_t **aclp) {
isc_result_t result;
@@ -514,7 +516,7 @@ configure_view_acl(const cfg_obj_t *vconfig, const cfg_obj_t *config,
}
if (config != NULL) {
const cfg_obj_t *options = NULL;
- (void)cfg_map_get(config, "options", &options);
+ (void)cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
if (options != NULL) {
maps[i++] = options;
}
@@ -545,7 +547,7 @@ configure_view_acl(const cfg_obj_t *vconfig, const cfg_obj_t *config,
static isc_result_t
configure_view_nametable(const cfg_obj_t *vconfig, const cfg_obj_t *config,
- const char *confname, const char *conftuplename,
+ enum cfg_clause confname, const char *conftuplename,
isc_mem_t *mctx, dns_nametree_t **ntp) {
isc_result_t result = ISC_R_SUCCESS;
const cfg_obj_t *maps[3];
@@ -560,14 +562,15 @@ configure_view_nametable(const cfg_obj_t *vconfig, const cfg_obj_t *config,
if (*ntp != NULL) {
dns_nametree_detach(ntp);
}
- dns_nametree_create(mctx, DNS_NAMETREE_BOOL, confname, ntp);
+ dns_nametree_create(mctx, DNS_NAMETREE_BOOL,
+ cfg_clause_as_string[confname], ntp);
if (vconfig != NULL) {
maps[i++] = cfg_tuple_get(vconfig, "options");
}
if (config != NULL) {
const cfg_obj_t *options = NULL;
- (void)cfg_map_get(config, "options", &options);
+ (void)cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
if (options != NULL) {
maps[i++] = options;
}
@@ -600,7 +603,8 @@ configure_view_nametable(const cfg_obj_t *vconfig, const cfg_obj_t *config,
if (result != ISC_R_SUCCESS) {
cfg_obj_log(nameobj, ISC_LOG_ERROR,
"failed to add %s for %s: %s", str,
- confname, isc_result_totext(result));
+ cfg_clause_as_string[confname],
+ isc_result_totext(result));
goto cleanup;
}
}
@@ -1059,16 +1063,16 @@ configure_view_dnsseckeys(dns_view_t *view, const cfg_obj_t *vconfig,
if (vconfig != NULL) {
voptions = cfg_tuple_get(vconfig, "options");
if (voptions != NULL) {
- (void)cfg_map_get(voptions, "trust-anchors",
+ (void)cfg_map_get(voptions, CFG_CLAUSE_TRUST_ANCHORS,
&view_trust_anchors);
maps[i++] = voptions;
}
}
if (config != NULL) {
- (void)cfg_map_get(config, "trust-anchors",
+ (void)cfg_map_get(config, CFG_CLAUSE_TRUST_ANCHORS,
&global_trust_anchors);
- (void)cfg_map_get(config, "options", &options);
+ (void)cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
if (options != NULL) {
maps[i++] = options;
}
@@ -1095,7 +1099,7 @@ configure_view_dnsseckeys(dns_view_t *view, const cfg_obj_t *vconfig,
"from '%s'",
view->name, named_g_bindkeysfile);
- CHECK(cfg_map_get(bindkeys, "trust-anchors",
+ CHECK(cfg_map_get(bindkeys, CFG_CLAUSE_TRUST_ANCHORS,
&builtin_keys));
if (builtin_keys == NULL) {
@@ -1114,7 +1118,8 @@ configure_view_dnsseckeys(dns_view_t *view, const cfg_obj_t *vconfig,
"using built-in root key for view %s",
view->name);
- CHECK(cfg_map_get(config, "builtin-trust-anchors",
+ CHECK(cfg_map_get(config,
+ CFG_CLAUSE_BUILTIN_TRUST_ANCHORS,
&builtin_keys));
}
@@ -1140,7 +1145,7 @@ configure_view_dnsseckeys(dns_view_t *view, const cfg_obj_t *vconfig,
* Add key zone for managed keys.
*/
obj = NULL;
- (void)named_config_get(maps, "managed-keys-directory", &obj);
+ (void)named_config_get(maps, CFG_CLAUSE_MANAGED_KEYS_DIRECTORY, &obj);
directory = (obj != NULL ? cfg_obj_asstring(obj) : NULL);
if (directory != NULL) {
result = isc_file_isdirectory(directory);
@@ -1183,11 +1188,12 @@ get_view_querysource_dispatch(const cfg_obj_t **maps, int af,
switch (af) {
case AF_INET:
- result = named_config_get(maps, "query-source", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_QUERY_SOURCE, &obj);
INSIST(result == ISC_R_SUCCESS);
break;
case AF_INET6:
- result = named_config_get(maps, "query-source-v6", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_QUERY_SOURCE_V6,
+ &obj);
INSIST(result == ISC_R_SUCCESS);
break;
default:
@@ -1331,115 +1337,115 @@ configure_peer(const cfg_obj_t *cpeer, isc_mem_t *mctx, dns_peer_t **peerp) {
RETERR(dns_peer_newprefix(mctx, &na, prefixlen, &peer));
obj = NULL;
- (void)cfg_map_get(cpeer, "bogus", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_BOGUS, &obj);
if (obj != NULL) {
CHECK(dns_peer_setbogus(peer, cfg_obj_asboolean(obj)));
}
obj = NULL;
- (void)cfg_map_get(cpeer, "provide-ixfr", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_PROVIDE_IXFR, &obj);
if (obj != NULL) {
CHECK(dns_peer_setprovideixfr(peer, cfg_obj_asboolean(obj)));
}
obj = NULL;
- (void)cfg_map_get(cpeer, "request-expire", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_REQUEST_EXPIRE, &obj);
if (obj != NULL) {
CHECK(dns_peer_setrequestexpire(peer, cfg_obj_asboolean(obj)));
}
obj = NULL;
- (void)cfg_map_get(cpeer, "request-ixfr", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_REQUEST_IXFR, &obj);
if (obj != NULL) {
CHECK(dns_peer_setrequestixfr(peer, cfg_obj_asboolean(obj)));
}
obj = NULL;
- (void)cfg_map_get(cpeer, "request-ixfr-max-diffs", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_REQUEST_IXFR_MAX_DIFFS, &obj);
if (obj != NULL) {
CHECK(dns_peer_setrequestixfrmaxdiffs(peer,
cfg_obj_asuint32(obj)));
}
obj = NULL;
- (void)cfg_map_get(cpeer, "request-nsid", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_REQUEST_NSID, &obj);
if (obj != NULL) {
CHECK(dns_peer_setrequestnsid(peer, cfg_obj_asboolean(obj)));
}
obj = NULL;
- (void)cfg_map_get(cpeer, "request-zoneversion", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_REQUEST_ZONEVERSION, &obj);
if (obj != NULL) {
CHECK(dns_peer_setrequestzoneversion(peer,
cfg_obj_asboolean(obj)));
}
obj = NULL;
- (void)cfg_map_get(cpeer, "send-cookie", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_SEND_COOKIE, &obj);
if (obj != NULL) {
CHECK(dns_peer_setsendcookie(peer, cfg_obj_asboolean(obj)));
}
obj = NULL;
- (void)cfg_map_get(cpeer, "require-cookie", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_REQUIRE_COOKIE, &obj);
if (obj != NULL) {
CHECK(dns_peer_setrequirecookie(peer, cfg_obj_asboolean(obj)));
}
obj = NULL;
- (void)cfg_map_get(cpeer, "edns", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_EDNS, &obj);
if (obj != NULL) {
CHECK(dns_peer_setsupportedns(peer, cfg_obj_asboolean(obj)));
}
obj = NULL;
- (void)cfg_map_get(cpeer, "edns-udp-size", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_EDNS_UDP_SIZE, &obj);
if (obj != NULL) {
CHECK(dns_peer_setudpsize(peer,
(uint16_t)cfg_obj_asuint32(obj)));
}
obj = NULL;
- (void)cfg_map_get(cpeer, "edns-version", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_EDNS_VERSION, &obj);
if (obj != NULL) {
CHECK(dns_peer_setednsversion(peer,
(uint8_t)cfg_obj_asuint32(obj)));
}
obj = NULL;
- (void)cfg_map_get(cpeer, "max-udp-size", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_MAX_UDP_SIZE, &obj);
if (obj != NULL) {
CHECK(dns_peer_setmaxudp(peer,
(uint16_t)cfg_obj_asuint32(obj)));
}
obj = NULL;
- (void)cfg_map_get(cpeer, "padding", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_PADDING, &obj);
if (obj != NULL) {
CHECK(dns_peer_setpadding(peer,
(uint16_t)cfg_obj_asuint32(obj)));
}
obj = NULL;
- (void)cfg_map_get(cpeer, "tcp-only", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_TCP_ONLY, &obj);
if (obj != NULL) {
CHECK(dns_peer_setforcetcp(peer, cfg_obj_asboolean(obj)));
}
obj = NULL;
- (void)cfg_map_get(cpeer, "tcp-keepalive", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_TCP_KEEPALIVE, &obj);
if (obj != NULL) {
CHECK(dns_peer_settcpkeepalive(peer, cfg_obj_asboolean(obj)));
}
obj = NULL;
- (void)cfg_map_get(cpeer, "transfers", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_TRANSFERS, &obj);
if (obj != NULL) {
CHECK(dns_peer_settransfers(peer, cfg_obj_asuint32(obj)));
}
obj = NULL;
- (void)cfg_map_get(cpeer, "transfer-format", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_TRANSFER_FORMAT, &obj);
if (obj != NULL) {
const char *str = cfg_obj_asstring(obj);
if (strcasecmp(str, "many-answers") == 0) {
@@ -1453,16 +1459,16 @@ configure_peer(const cfg_obj_t *cpeer, isc_mem_t *mctx, dns_peer_t **peerp) {
}
obj = NULL;
- (void)cfg_map_get(cpeer, "keys", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_KEYS, &obj);
if (obj != NULL) {
CHECK(dns_peer_setkeybycharp(peer, cfg_obj_asstring(obj)));
}
obj = NULL;
if (na.family == AF_INET) {
- (void)cfg_map_get(cpeer, "transfer-source", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_TRANSFER_SOURCE, &obj);
} else {
- (void)cfg_map_get(cpeer, "transfer-source-v6", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_TRANSFER_SOURCE_V6, &obj);
}
if (obj != NULL) {
CHECK(dns_peer_settransfersource(peer,
@@ -1471,9 +1477,9 @@ configure_peer(const cfg_obj_t *cpeer, isc_mem_t *mctx, dns_peer_t **peerp) {
obj = NULL;
if (na.family == AF_INET) {
- (void)cfg_map_get(cpeer, "notify-source", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_NOTIFY_SOURCE, &obj);
} else {
- (void)cfg_map_get(cpeer, "notify-source-v6", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_NOTIFY_SOURCE_V6, &obj);
}
if (obj != NULL) {
CHECK(dns_peer_setnotifysource(peer, cfg_obj_assockaddr(obj)));
@@ -1481,9 +1487,9 @@ configure_peer(const cfg_obj_t *cpeer, isc_mem_t *mctx, dns_peer_t **peerp) {
obj = NULL;
if (na.family == AF_INET) {
- (void)cfg_map_get(cpeer, "query-source", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_QUERY_SOURCE, &obj);
} else {
- (void)cfg_map_get(cpeer, "query-source-v6", &obj);
+ (void)cfg_map_get(cpeer, CFG_CLAUSE_QUERY_SOURCE_V6, &obj);
}
if (obj != NULL) {
INSIST(cfg_obj_issockaddr(obj));
@@ -2332,7 +2338,7 @@ catz_addmodzone_cb(void *arg) {
goto cleanup;
}
isc_buffer_free(&confbuf);
- CHECK(cfg_map_get(zoneconf, "zone", &zlist));
+ CHECK(cfg_map_get(zoneconf, CFG_CLAUSE_ZONE, &zlist));
if (!cfg_obj_islist(zlist)) {
CLEANUP(ISC_R_FAILURE);
}
@@ -2604,7 +2610,7 @@ catz_reconfigure(dns_catz_entry_t *entry, void *arg1, void *arg2) {
goto cleanup;
}
- CHECK(cfg_map_get(zoneconf, "zone", &zlist));
+ CHECK(cfg_map_get(zoneconf, CFG_CLAUSE_ZONE, &zlist));
if (!cfg_obj_islist(zlist)) {
CLEANUP(ISC_R_FAILURE);
}
@@ -2819,19 +2825,24 @@ cleanup:
} \
} while (0)
-#define CHECK_RRL_RATE(rate, def, max_rate, name) \
- do { \
- obj = NULL; \
- rrl->rate.str = name; \
- result = cfg_map_get(map, name, &obj); \
- if (result == ISC_R_SUCCESS) { \
- rrl->rate.r = cfg_obj_asuint32(obj); \
- CHECK_RRL(rrl->rate.r <= max_rate, name " %d > %d", \
- rrl->rate.r, max_rate); \
- } else { \
- rrl->rate.r = def; \
- } \
- rrl->rate.scaled = rrl->rate.r; \
+#define CHECK_RRL_RATE(rate, def, max_rate, name) \
+ do { \
+ obj = NULL; \
+ rrl->rate.str = cfg_clause_as_string[name]; \
+ result = cfg_map_get(map, name, &obj); \
+ if (result == ISC_R_SUCCESS) { \
+ rrl->rate.r = cfg_obj_asuint32(obj); \
+ if (!(rrl->rate.r <= max_rate)) { \
+ cfg_obj_log(obj, ISC_LOG_ERROR, "%s %d > %d", \
+ cfg_clause_as_string[name], \
+ rrl->rate.r, max_rate); \
+ result = ISC_R_RANGE; \
+ goto cleanup; \
+ } \
+ } else { \
+ rrl->rate.r = def; \
+ } \
+ rrl->rate.scaled = rrl->rate.r; \
} while (0)
static isc_result_t
@@ -2850,7 +2861,7 @@ configure_rrl(dns_view_t *view, const cfg_obj_t *config, const cfg_obj_t *map,
*/
min_entries = 500;
obj = NULL;
- result = cfg_map_get(map, "min-table-size", &obj);
+ result = cfg_map_get(map, CFG_CLAUSE_MIN_TABLE_SIZE, &obj);
if (result == ISC_R_SUCCESS) {
min_entries = cfg_obj_asuint32(obj);
if (min_entries < 1) {
@@ -2861,7 +2872,7 @@ configure_rrl(dns_view_t *view, const cfg_obj_t *config, const cfg_obj_t *map,
i = ISC_MAX(20000, min_entries);
obj = NULL;
- result = cfg_map_get(map, "max-table-size", &obj);
+ result = cfg_map_get(map, CFG_CLAUSE_MAX_TABLE_SIZE, &obj);
if (result == ISC_R_SUCCESS) {
i = cfg_obj_asuint32(obj);
CHECK_RRL(i >= min_entries,
@@ -2871,23 +2882,24 @@ configure_rrl(dns_view_t *view, const cfg_obj_t *config, const cfg_obj_t *map,
rrl->max_entries = i;
CHECK_RRL_RATE(responses_per_second, 0, DNS_RRL_MAX_RATE,
- "responses-per-second");
+ CFG_CLAUSE_RESPONSES_PER_SECOND);
CHECK_RRL_RATE(referrals_per_second, rrl->responses_per_second.r,
- DNS_RRL_MAX_RATE, "referrals-per-second");
+ DNS_RRL_MAX_RATE, CFG_CLAUSE_REFERRALS_PER_SECOND);
CHECK_RRL_RATE(nodata_per_second, rrl->responses_per_second.r,
- DNS_RRL_MAX_RATE, "nodata-per-second");
+ DNS_RRL_MAX_RATE, CFG_CLAUSE_NODATA_PER_SECOND);
CHECK_RRL_RATE(nxdomains_per_second, rrl->responses_per_second.r,
- DNS_RRL_MAX_RATE, "nxdomains-per-second");
+ DNS_RRL_MAX_RATE, CFG_CLAUSE_NXDOMAINS_PER_SECOND);
CHECK_RRL_RATE(errors_per_second, rrl->responses_per_second.r,
- DNS_RRL_MAX_RATE, "errors-per-second");
+ DNS_RRL_MAX_RATE, CFG_CLAUSE_ERRORS_PER_SECOND);
- CHECK_RRL_RATE(all_per_second, 0, DNS_RRL_MAX_RATE, "all-per-second");
+ CHECK_RRL_RATE(all_per_second, 0, DNS_RRL_MAX_RATE,
+ CFG_CLAUSE_ALL_PER_SECOND);
- CHECK_RRL_RATE(slip, 2, DNS_RRL_MAX_SLIP, "slip");
+ CHECK_RRL_RATE(slip, 2, DNS_RRL_MAX_SLIP, CFG_CLAUSE_SLIP);
i = 15;
obj = NULL;
- result = cfg_map_get(map, "window", &obj);
+ result = cfg_map_get(map, CFG_CLAUSE_WINDOW, &obj);
if (result == ISC_R_SUCCESS) {
i = cfg_obj_asuint32(obj);
CHECK_RRL(i >= 1 && i <= DNS_RRL_MAX_WINDOW,
@@ -2897,7 +2909,7 @@ configure_rrl(dns_view_t *view, const cfg_obj_t *config, const cfg_obj_t *map,
i = 0;
obj = NULL;
- result = cfg_map_get(map, "qps-scale", &obj);
+ result = cfg_map_get(map, CFG_CLAUSE_QPS_SCALE, &obj);
if (result == ISC_R_SUCCESS) {
i = cfg_obj_asuint32(obj);
CHECK_RRL(i >= 1, "invalid 'qps-scale %d'%s", i, "");
@@ -2907,7 +2919,7 @@ configure_rrl(dns_view_t *view, const cfg_obj_t *config, const cfg_obj_t *map,
i = 24;
obj = NULL;
- result = cfg_map_get(map, "ipv4-prefix-length", &obj);
+ result = cfg_map_get(map, CFG_CLAUSE_IPV4_PREFIX_LENGTH, &obj);
if (result == ISC_R_SUCCESS) {
i = cfg_obj_asuint32(obj);
CHECK_RRL(i >= 8 && i <= 32,
@@ -2922,7 +2934,7 @@ configure_rrl(dns_view_t *view, const cfg_obj_t *config, const cfg_obj_t *map,
i = 56;
obj = NULL;
- result = cfg_map_get(map, "ipv6-prefix-length", &obj);
+ result = cfg_map_get(map, CFG_CLAUSE_IPV6_PREFIX_LENGTH, &obj);
if (result == ISC_R_SUCCESS) {
i = cfg_obj_asuint32(obj);
CHECK_RRL(i >= 16 && i <= DNS_RRL_MAX_PREFIX,
@@ -2942,7 +2954,7 @@ configure_rrl(dns_view_t *view, const cfg_obj_t *config, const cfg_obj_t *map,
}
obj = NULL;
- result = cfg_map_get(map, "exempt-clients", &obj);
+ result = cfg_map_get(map, CFG_CLAUSE_EXEMPT_CLIENTS, &obj);
if (result == ISC_R_SUCCESS) {
result = cfg_acl_fromconfig(obj, config, aclctx, isc_g_mctx, 0,
&rrl->exempt);
@@ -2951,7 +2963,7 @@ configure_rrl(dns_view_t *view, const cfg_obj_t *config, const cfg_obj_t *map,
}
obj = NULL;
- result = cfg_map_get(map, "log-only", &obj);
+ result = cfg_map_get(map, CFG_CLAUSE_LOG_ONLY, &obj);
if (result == ISC_R_SUCCESS && cfg_obj_asboolean(obj)) {
rrl->log_only = true;
} else {
@@ -3067,9 +3079,9 @@ create_empty_zone(dns_zone_t *pzone, dns_name_t *name, dns_view_t *view,
contact = dns_fixedname_initname(&cfixed);
if (voptions != NULL) {
- (void)cfg_map_get(voptions, "zone", &zonelist);
+ (void)cfg_map_get(voptions, CFG_CLAUSE_ZONE, &zonelist);
} else {
- (void)cfg_map_get(config, "zone", &zonelist);
+ (void)cfg_map_get(config, CFG_CLAUSE_ZONE, &zonelist);
}
/*
* Look for forward "zones" beneath this empty zone and if so
@@ -3090,13 +3102,14 @@ create_empty_zone(dns_zone_t *pzone, dns_name_t *name, dns_view_t *view,
toptions = named_zone_templateopts(config, zoptions);
obj = NULL;
- (void)named_config_findopt(zoptions, toptions, "type", &obj);
+ (void)named_config_findopt(zoptions, toptions, CFG_CLAUSE_TYPE,
+ &obj);
if (obj != NULL &&
strcasecmp(cfg_obj_asstring(obj), "forward") == 0)
{
obj = NULL;
(void)named_config_findopt(zoptions, toptions,
- "forward", &obj);
+ CFG_CLAUSE_FORWARD, &obj);
if (obj == NULL) {
continue;
}
@@ -3321,7 +3334,7 @@ configure_dnstap(const cfg_obj_t **maps, dns_view_t *view) {
unsigned int i;
struct fstrm_iothr_options *fopt = NULL;
- result = named_config_get(maps, "dnstap", &dlist);
+ result = named_config_get(maps, CFG_CLAUSE_DNSTAP, &dlist);
if (result != ISC_R_SUCCESS) {
return ISC_R_SUCCESS;
}
@@ -3373,7 +3386,7 @@ configure_dnstap(const cfg_obj_t **maps, dns_view_t *view) {
isc_log_rollsuffix_t suffix = isc_log_rollsuffix_increment;
obj = NULL;
- CHECKM(named_config_get(maps, "dnstap-output", &obj),
+ CHECKM(named_config_get(maps, CFG_CLAUSE_DNSTAP_OUTPUT, &obj),
"'dnstap-output' must be set if 'dnstap' is set");
obj2 = cfg_tuple_get(obj, "mode");
@@ -3431,23 +3444,24 @@ configure_dnstap(const cfg_obj_t **maps, dns_view_t *view) {
fopt, FSTRM_IOTHR_QUEUE_MODEL_MPSC);
obj = NULL;
- result = named_config_get(maps, "fstrm-set-buffer-hint", &obj);
+ result = named_config_get(
+ maps, CFG_CLAUSE_FSTRM_SET_BUFFER_HINT, &obj);
if (result == ISC_R_SUCCESS) {
i = cfg_obj_asuint32(obj);
fstrm_iothr_options_set_buffer_hint(fopt, i);
}
obj = NULL;
- result = named_config_get(maps, "fstrm-set-flush-timeout",
- &obj);
+ result = named_config_get(
+ maps, CFG_CLAUSE_FSTRM_SET_FLUSH_TIMEOUT, &obj);
if (result == ISC_R_SUCCESS) {
i = cfg_obj_asuint32(obj);
fstrm_iothr_options_set_flush_timeout(fopt, i);
}
obj = NULL;
- result = named_config_get(maps, "fstrm-set-input-queue-size",
- &obj);
+ result = named_config_get(
+ maps, CFG_CLAUSE_FSTRM_SET_INPUT_QUEUE_SIZE, &obj);
if (result == ISC_R_SUCCESS) {
i = cfg_obj_asuint32(obj);
fstrm_iothr_options_set_input_queue_size(fopt, i);
@@ -3455,15 +3469,16 @@ configure_dnstap(const cfg_obj_t **maps, dns_view_t *view) {
obj = NULL;
result = named_config_get(
- maps, "fstrm-set-output-notify-threshold", &obj);
+ maps, CFG_CLAUSE_FSTRM_SET_OUTPUT_NOTIFY_THRESHOLD,
+ &obj);
if (result == ISC_R_SUCCESS) {
i = cfg_obj_asuint32(obj);
fstrm_iothr_options_set_queue_notify_threshold(fopt, i);
}
obj = NULL;
- result = named_config_get(maps, "fstrm-set-output-queue-model",
- &obj);
+ result = named_config_get(
+ maps, CFG_CLAUSE_FSTRM_SET_OUTPUT_QUEUE_MODEL, &obj);
if (result == ISC_R_SUCCESS) {
if (strcasecmp(cfg_obj_asstring(obj), "spsc") == 0) {
i = FSTRM_IOTHR_QUEUE_MODEL_SPSC;
@@ -3474,16 +3489,16 @@ configure_dnstap(const cfg_obj_t **maps, dns_view_t *view) {
}
obj = NULL;
- result = named_config_get(maps, "fstrm-set-output-queue-size",
- &obj);
+ result = named_config_get(
+ maps, CFG_CLAUSE_FSTRM_SET_OUTPUT_QUEUE_SIZE, &obj);
if (result == ISC_R_SUCCESS) {
i = cfg_obj_asuint32(obj);
fstrm_iothr_options_set_output_queue_size(fopt, i);
}
obj = NULL;
- result = named_config_get(maps, "fstrm-set-reopen-interval",
- &obj);
+ result = named_config_get(
+ maps, CFG_CLAUSE_FSTRM_SET_REOPEN_INTERVAL, &obj);
if (result == ISC_R_SUCCESS) {
i = cfg_obj_asduration(obj);
fstrm_iothr_options_set_reopen_interval(fopt, i);
@@ -3503,7 +3518,7 @@ configure_dnstap(const cfg_obj_t **maps, dns_view_t *view) {
}
obj = NULL;
- result = named_config_get(maps, "dnstap-version", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_DNSTAP_VERSION, &obj);
if (result != ISC_R_SUCCESS) {
/* not specified; use the product and version */
dns_dt_setversion(named_g_server->dtenv, PACKAGE_STRING);
@@ -3513,7 +3528,7 @@ configure_dnstap(const cfg_obj_t **maps, dns_view_t *view) {
}
obj = NULL;
- result = named_config_get(maps, "dnstap-identity", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_DNSTAP_IDENTITY, &obj);
if (result == ISC_R_SUCCESS && cfg_obj_isboolean(obj)) {
/* "hostname" is interpreted as boolean true */
char buf[256];
@@ -3660,7 +3675,7 @@ configure_max_cache_size(dns_view_t *view, const cfg_obj_t *maps[4]) {
}
obj = NULL;
- result = named_config_get(maps, "max-cache-size", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_CACHE_SIZE, &obj);
INSIST(result == ISC_R_SUCCESS);
if (cfg_obj_isstring(obj) &&
strcasecmp(cfg_obj_asstring(obj), "default") == 0)
@@ -3711,12 +3726,12 @@ configure_view_delegdb(const cfg_obj_t **maps, dns_view_t *pview,
}
obj = NULL;
- result = named_config_get(maps, "min-delegation-ttl", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MIN_DELEGATION_TTL, &obj);
INSIST(result == ISC_R_SUCCESS);
minttl = cfg_obj_asduration(obj);
obj = NULL;
- result = named_config_get(maps, "max-delegation-ttl", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_DELEGATION_TTL, &obj);
INSIST(result == ISC_R_SUCCESS);
maxttl = cfg_obj_asduration(obj);
@@ -3827,7 +3842,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
REQUIRE(DNS_VIEW_VALID(view));
if (config != NULL) {
- (void)cfg_map_get(config, "options", &options);
+ (void)cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
}
/*
@@ -3851,7 +3866,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
/*
* Set the view's port number for outgoing queries.
*/
- CHECKM(named_config_getport(config, "port", &port), "port");
+ CHECKM(named_config_getport(config, CFG_CLAUSE_PORT, &port), "port");
dns_view_setdstport(view, port);
/*
@@ -3860,14 +3875,17 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
*/
obj = NULL;
if (view->rdclass == dns_rdataclass_in &&
- named_config_get(maps, "response-policy", &obj) == ISC_R_SUCCESS)
+ named_config_get(maps, CFG_CLAUSE_RESPONSE_POLICY, &obj) ==
+ ISC_R_SUCCESS)
{
CHECK(configure_rpz(view, NULL, obj, &old_rpz_ok, first_time));
rpz_configured = true;
}
obj = NULL;
- if (named_config_get(maps, "catalog-zones", &obj) == ISC_R_SUCCESS) {
+ if (named_config_get(maps, CFG_CLAUSE_CATALOG_ZONES, &obj) ==
+ ISC_R_SUCCESS)
+ {
CHECK(configure_catz(view, NULL, config, obj));
catz_configured = true;
}
@@ -3877,9 +3895,9 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
*/
zonelist = NULL;
if (voptions != NULL) {
- (void)cfg_map_get(voptions, "zone", &zonelist);
+ (void)cfg_map_get(voptions, CFG_CLAUSE_ZONE, &zonelist);
} else {
- (void)cfg_map_get(config, "zone", &zonelist);
+ (void)cfg_map_get(config, CFG_CLAUSE_ZONE, &zonelist);
}
/*
@@ -3930,16 +3948,16 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
*/
dlzlist = NULL;
if (voptions != NULL) {
- (void)cfg_map_get(voptions, "dlz", &dlzlist);
+ (void)cfg_map_get(voptions, CFG_CLAUSE_DLZ, &dlzlist);
} else {
- (void)cfg_map_get(config, "dlz", &dlzlist);
+ (void)cfg_map_get(config, CFG_CLAUSE_DLZ, &dlzlist);
}
CFG_LIST_FOREACH(dlzlist, element) {
dlz = cfg_listelt_value(element);
obj = NULL;
- (void)cfg_map_get(dlz, "database", &obj);
+ (void)cfg_map_get(dlz, CFG_CLAUSE_DATABASE, &obj);
if (obj != NULL) {
dns_dlzdb_t *dlzdb = NULL;
const cfg_obj_t *name, *search = NULL;
@@ -3968,7 +3986,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* method now. If not searchable, we'll take
* care of it when we process the zone statement.
*/
- (void)cfg_map_get(dlz, "search", &search);
+ (void)cfg_map_get(dlz, CFG_CLAUSE_SEARCH, &search);
if (search == NULL || cfg_obj_asboolean(search)) {
dlzdb->search = true;
CHECK(dns_dlzconfigure(view, dlzdb,
@@ -3988,7 +4006,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* we can reuse/share an existing cache.
*/
obj = NULL;
- result = named_config_get(maps, "recursion", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_RECURSION, &obj);
INSIST(result == ISC_R_SUCCESS);
view->recursion = (view->rdclass == dns_rdataclass_in &&
cfg_obj_asboolean(obj));
@@ -4022,17 +4040,17 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
}
obj = NULL;
- result = named_config_get(maps, "zero-no-soa-ttl-cache", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_ZERO_NO_SOA_TTL_CACHE, &obj);
INSIST(result == ISC_R_SUCCESS);
zero_no_soattl = cfg_obj_asboolean(obj);
obj = NULL;
- result = named_config_get(maps, "resolver-use-dns64", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_RESOLVER_USE_DNS64, &obj);
INSIST(result == ISC_R_SUCCESS);
view->usedns64 = cfg_obj_asboolean(obj);
obj = NULL;
- result = named_config_get(maps, "dns64", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_DNS64, &obj);
if (result == ISC_R_SUCCESS && strcmp(view->name, "_bind") &&
strcmp(view->name, "_meta"))
{
@@ -4042,7 +4060,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
const cfg_obj_t *myobj;
myobj = NULL;
- result = named_config_get(maps, "dns64-server", &myobj);
+ result = named_config_get(maps, CFG_CLAUSE_DNS64_SERVER,
+ &myobj);
if (result == ISC_R_SUCCESS) {
server = cfg_obj_asstring(myobj);
} else {
@@ -4050,7 +4069,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
}
myobj = NULL;
- result = named_config_get(maps, "dns64-contact", &myobj);
+ result = named_config_get(maps, CFG_CLAUSE_DNS64_CONTACT,
+ &myobj);
if (result == ISC_R_SUCCESS) {
contact = cfg_obj_asstring(myobj);
} else {
@@ -4066,7 +4086,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
&prefixlen);
obj = NULL;
- (void)cfg_map_get(map, "suffix", &obj);
+ (void)cfg_map_get(map, CFG_CLAUSE_SUFFIX, &obj);
if (obj != NULL) {
sp = &suffix;
isc_netaddr_fromsockaddr(
@@ -4077,19 +4097,19 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
clients = mapped = excluded = NULL;
obj = NULL;
- (void)cfg_map_get(map, "clients", &obj);
+ (void)cfg_map_get(map, CFG_CLAUSE_CLIENTS, &obj);
if (obj != NULL) {
CHECK(cfg_acl_fromconfig(obj, config, aclctx,
mctx, 0, &clients));
}
obj = NULL;
- (void)cfg_map_get(map, "mapped", &obj);
+ (void)cfg_map_get(map, CFG_CLAUSE_MAPPED, &obj);
if (obj != NULL) {
CHECK(cfg_acl_fromconfig(obj, config, aclctx,
mctx, 0, &mapped));
}
obj = NULL;
- (void)cfg_map_get(map, "exclude", &obj);
+ (void)cfg_map_get(map, CFG_CLAUSE_EXCLUDE, &obj);
if (obj != NULL) {
CHECK(cfg_acl_fromconfig(obj, config, aclctx,
mctx, 0, &excluded));
@@ -4101,13 +4121,13 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
}
obj = NULL;
- (void)cfg_map_get(map, "recursive-only", &obj);
+ (void)cfg_map_get(map, CFG_CLAUSE_RECURSIVE_ONLY, &obj);
if (obj != NULL && cfg_obj_asboolean(obj)) {
dns64options |= DNS_DNS64_RECURSIVE_ONLY;
}
obj = NULL;
- (void)cfg_map_get(map, "break-dnssec", &obj);
+ (void)cfg_map_get(map, CFG_CLAUSE_BREAK_DNSSEC, &obj);
if (obj != NULL && cfg_obj_asboolean(obj)) {
dns64options |= DNS_DNS64_BREAK_DNSSEC;
}
@@ -4132,12 +4152,12 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
}
obj = NULL;
- result = named_config_get(maps, "dnssec-accept-expired", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_DNSSEC_ACCEPT_EXPIRED, &obj);
INSIST(result == ISC_R_SUCCESS);
view->acceptexpired = cfg_obj_asboolean(obj);
obj = NULL;
- result = named_config_get(maps, "dnssec-validation", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_DNSSEC_VALIDATION, &obj);
INSIST(result == ISC_R_SUCCESS);
if (cfg_obj_isboolean(obj)) {
view->enablevalidation = cfg_obj_asboolean(obj);
@@ -4151,36 +4171,36 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
}
obj = NULL;
- result = named_config_get(maps, "max-cache-ttl", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_CACHE_TTL, &obj);
INSIST(result == ISC_R_SUCCESS);
view->maxcachettl = cfg_obj_asduration(obj);
obj = NULL;
- result = named_config_get(maps, "max-ncache-ttl", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_NCACHE_TTL, &obj);
INSIST(result == ISC_R_SUCCESS);
view->maxncachettl = cfg_obj_asduration(obj);
obj = NULL;
- result = named_config_get(maps, "min-cache-ttl", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MIN_CACHE_TTL, &obj);
INSIST(result == ISC_R_SUCCESS);
view->mincachettl = cfg_obj_asduration(obj);
obj = NULL;
- result = named_config_get(maps, "min-ncache-ttl", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MIN_NCACHE_TTL, &obj);
INSIST(result == ISC_R_SUCCESS);
view->minncachettl = cfg_obj_asduration(obj);
obj = NULL;
- result = named_config_get(maps, "synth-from-dnssec", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_SYNTH_FROM_DNSSEC, &obj);
INSIST(result == ISC_R_SUCCESS);
view->synthfromdnssec = cfg_obj_asboolean(obj);
obj = NULL;
- result = named_config_get(maps, "stale-cache-enable", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_STALE_CACHE_ENABLE, &obj);
INSIST(result == ISC_R_SUCCESS);
if (cfg_obj_asboolean(obj)) {
obj = NULL;
- result = named_config_get(maps, "max-stale-ttl", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_STALE_TTL, &obj);
INSIST(result == ISC_R_SUCCESS);
max_stale_ttl = ISC_MAX(cfg_obj_asduration(obj), 1);
}
@@ -4190,7 +4210,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
*/
obj = NULL;
- result = named_config_get(maps, "stale-answer-enable", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_STALE_ANSWER_ENABLE, &obj);
INSIST(result == ISC_R_SUCCESS);
view->staleanswersenable = cfg_obj_asboolean(obj);
@@ -4204,7 +4224,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
}
obj = NULL;
- result = named_config_get(maps, "stale-answer-client-timeout", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_STALE_ANSWER_CLIENT_TIMEOUT,
+ &obj);
INSIST(result == ISC_R_SUCCESS);
if (cfg_obj_isstring(obj)) {
/*
@@ -4234,7 +4255,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
}
obj = NULL;
- result = named_config_get(maps, "stale-refresh-time", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_STALE_REFRESH_TIME, &obj);
INSIST(result == ISC_R_SUCCESS);
stale_refresh_time = cfg_obj_asduration(obj);
@@ -4268,7 +4289,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* ensure these configuration options don't invalidate reusing/sharing.
*/
obj = NULL;
- result = named_config_get(maps, "attach-cache", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_ATTACH_CACHE, &obj);
if (result == ISC_R_SUCCESS) {
cachename = cfg_obj_asstring(obj);
} else {
@@ -4370,7 +4391,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
dns_cache_detach(&cache);
obj = NULL;
- result = named_config_get(maps, "stale-answer-ttl", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_STALE_ANSWER_TTL, &obj);
INSIST(result == ISC_R_SUCCESS);
view->staleanswerttl = ISC_MAX(cfg_obj_asduration(obj), 1);
@@ -4456,7 +4477,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
double low, high, discount;
obj = NULL;
- result = named_config_get(maps, "fetches-per-server", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_FETCHES_PER_SERVER,
+ &obj);
INSIST(result == ISC_R_SUCCESS);
obj2 = cfg_tuple_get(obj, "fetches");
fps = cfg_obj_asuint32(obj2);
@@ -4478,7 +4500,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
}
obj = NULL;
- result = named_config_get(maps, "fetch-quota-params", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_FETCH_QUOTA_PARAMS,
+ &obj);
INSIST(result == ISC_R_SUCCESS);
obj2 = cfg_tuple_get(obj, "frequency");
@@ -4504,7 +4527,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* Set resolver's lame-ttl.
*/
obj = NULL;
- result = named_config_get(maps, "lame-ttl", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_LAME_TTL, &obj);
INSIST(result == ISC_R_SUCCESS);
lame_ttl = cfg_obj_asduration(obj);
if (lame_ttl > 0) {
@@ -4517,7 +4540,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* Set the resolver's query timeout.
*/
obj = NULL;
- result = named_config_get(maps, "resolver-query-timeout", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_RESOLVER_QUERY_TIMEOUT,
+ &obj);
INSIST(result == ISC_R_SUCCESS);
query_timeout = cfg_obj_asuint32(obj);
dns_resolver_settimeout(view->resolver, query_timeout);
@@ -4529,7 +4553,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* Set the resolver's EDNS UDP size.
*/
obj = NULL;
- result = named_config_get(maps, "edns-udp-size", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_EDNS_UDP_SIZE, &obj);
INSIST(result == ISC_R_SUCCESS);
dns_view_setudpsize(view, (uint16_t)cfg_obj_asuint32(obj));
@@ -4537,7 +4561,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* Set the maximum UDP response size.
*/
obj = NULL;
- result = named_config_get(maps, "max-udp-size", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_UDP_SIZE, &obj);
INSIST(result == ISC_R_SUCCESS);
view->maxudp = cfg_obj_asuint32(obj);
@@ -4545,7 +4569,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* Set the maximum UDP when a COOKIE is not provided.
*/
obj = NULL;
- result = named_config_get(maps, "nocookie-udp-size", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_NOCOOKIE_UDP_SIZE, &obj);
INSIST(result == ISC_R_SUCCESS);
view->nocookieudp = cfg_obj_asuint32(obj);
if (view->nocookieudp > view->maxudp) {
@@ -4556,7 +4580,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* Set supported DNSSEC algorithms.
*/
disabled = NULL;
- (void)named_config_get(maps, "disable-algorithms", &disabled);
+ (void)named_config_get(maps, CFG_CLAUSE_DISABLE_ALGORITHMS, &disabled);
if (disabled != NULL) {
CFG_LIST_FOREACH(disabled, element) {
CHECK(disable_algorithms(cfg_listelt_value(element),
@@ -4568,7 +4592,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* Set supported DS digest types.
*/
disabled = NULL;
- (void)named_config_get(maps, "disable-ds-digests", &disabled);
+ (void)named_config_get(maps, CFG_CLAUSE_DISABLE_DS_DIGESTS, &disabled);
if (disabled != NULL) {
CFG_LIST_FOREACH(disabled, element) {
CHECK(disable_ds_digests(cfg_listelt_value(element),
@@ -4582,8 +4606,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
*/
forwardtype = NULL;
forwarders = NULL;
- (void)named_config_get(maps, "forward", &forwardtype);
- (void)named_config_get(maps, "forwarders", &forwarders);
+ (void)named_config_get(maps, CFG_CLAUSE_FORWARD, &forwardtype);
+ (void)named_config_get(maps, CFG_CLAUSE_FORWARDERS, &forwarders);
if (forwarders != NULL) {
CHECK(configure_forward(config, view, dns_rootname, forwarders,
forwardtype));
@@ -4593,7 +4617,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* Dual Stack Servers.
*/
alternates = NULL;
- (void)named_config_get(maps, "dual-stack-servers", &alternates);
+ (void)named_config_get(maps, CFG_CLAUSE_DUAL_STACK_SERVERS,
+ &alternates);
if (alternates != NULL) {
CHECK(configure_alternates(config, view, alternates));
}
@@ -4610,12 +4635,13 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* Configure SIG(0) check limits when matching a DNS message to a view.
*/
obj = NULL;
- result = named_config_get(maps, "sig0key-checks-limit", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_SIG0KEY_CHECKS_LIMIT, &obj);
INSIST(result == ISC_R_SUCCESS);
view->sig0key_checks_limit = cfg_obj_asuint32(obj);
obj = NULL;
- result = named_config_get(maps, "sig0message-checks-limit", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_SIG0MESSAGE_CHECKS_LIMIT,
+ &obj);
INSIST(result == ISC_R_SUCCESS);
view->sig0message_checks_limit = cfg_obj_asuint32(obj);
@@ -4665,7 +4691,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
const cfg_obj_t *peers = NULL;
dns_peerlist_t *newpeers = NULL;
- (void)named_config_get(cfgmaps, "server", &peers);
+ (void)named_config_get(cfgmaps, CFG_CLAUSE_SERVER, &peers);
dns_peerlist_new(mctx, &newpeers);
CFG_LIST_FOREACH(peers, element) {
const cfg_obj_t *cpeer = cfg_listelt_value(element);
@@ -4692,7 +4718,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
const cfg_obj_t *rrsetorder = NULL;
if (ISC_R_SUCCESS ==
- named_config_get(maps, "rrset-order", &rrsetorder))
+ named_config_get(maps, CFG_CLAUSE_RRSET_ORDER, &rrsetorder))
{
dns_order_create(mctx, &order);
CFG_LIST_FOREACH(rrsetorder, element) {
@@ -4717,16 +4743,18 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* must be passed so that named ACLs defined at the global level
* can be retrieved.)
*/
- CHECK(configure_view_acl(vconfig, config, "match-clients", NULL, aclctx,
- isc_g_mctx, &view->matchclients));
- CHECK(configure_view_acl(vconfig, config, "match-destinations", NULL,
- aclctx, isc_g_mctx, &view->matchdestinations));
+ CHECK(configure_view_acl(vconfig, config, CFG_CLAUSE_MATCH_CLIENTS,
+ NULL, aclctx, isc_g_mctx,
+ &view->matchclients));
+ CHECK(configure_view_acl(vconfig, config, CFG_CLAUSE_MATCH_DESTINATIONS,
+ NULL, aclctx, isc_g_mctx,
+ &view->matchdestinations));
/*
* Configure the "match-recursive-only" option.
*/
obj = NULL;
- (void)named_config_get(maps, "match-recursive-only", &obj);
+ (void)named_config_get(maps, CFG_CLAUSE_MATCH_RECURSIVE_ONLY, &obj);
if (obj != NULL && cfg_obj_asboolean(obj)) {
view->matchrecursiveonly = true;
} else {
@@ -4737,7 +4765,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* Configure other configurable data.
*/
obj = NULL;
- result = named_config_get(maps, "qname-minimization", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_QNAME_MINIMIZATION, &obj);
INSIST(result == ISC_R_SUCCESS);
qminmode = cfg_obj_asstring(obj);
INSIST(qminmode != NULL);
@@ -4753,17 +4781,17 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
}
obj = NULL;
- result = named_config_get(maps, "auth-nxdomain", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_AUTH_NXDOMAIN, &obj);
INSIST(result == ISC_R_SUCCESS);
view->auth_nxdomain = cfg_obj_asboolean(obj);
obj = NULL;
- result = named_config_get(maps, "minimal-any", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MINIMAL_ANY, &obj);
INSIST(result == ISC_R_SUCCESS);
view->minimal_any = cfg_obj_asboolean(obj);
obj = NULL;
- result = named_config_get(maps, "minimal-responses", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MINIMAL_RESPONSES, &obj);
INSIST(result == ISC_R_SUCCESS);
if (cfg_obj_isboolean(obj)) {
if (cfg_obj_asboolean(obj)) {
@@ -4783,7 +4811,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
}
obj = NULL;
- result = named_config_get(maps, "transfer-format", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_TRANSFER_FORMAT, &obj);
INSIST(result == ISC_R_SUCCESS);
str = cfg_obj_asstring(obj);
if (strcasecmp(str, "many-answers") == 0) {
@@ -4795,41 +4823,43 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
}
obj = NULL;
- result = named_config_get(maps, "trust-anchor-telemetry", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_TRUST_ANCHOR_TELEMETRY,
+ &obj);
INSIST(result == ISC_R_SUCCESS);
view->trust_anchor_telemetry = cfg_obj_asboolean(obj);
obj = NULL;
- result = named_config_get(maps, "root-key-sentinel", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_ROOT_KEY_SENTINEL, &obj);
INSIST(result == ISC_R_SUCCESS);
view->root_key_sentinel = cfg_obj_asboolean(obj);
- CHECK(configure_view_acl(vconfig, config, "allow-query", NULL, aclctx,
- isc_g_mctx, &view->queryacl));
- CHECK(configure_view_acl(vconfig, config, "allow-query-on", NULL,
- aclctx, isc_g_mctx, &view->queryonacl));
+ CHECK(configure_view_acl(vconfig, config, CFG_CLAUSE_ALLOW_QUERY, NULL,
+ aclctx, isc_g_mctx, &view->queryacl));
+ CHECK(configure_view_acl(vconfig, config, CFG_CLAUSE_ALLOW_QUERY_ON,
+ NULL, aclctx, isc_g_mctx, &view->queryonacl));
- CHECK(configure_view_acl(vconfig, config, "allow-query-cache", NULL,
- aclctx, isc_g_mctx, &view->cacheacl));
- CHECK(configure_view_acl(vconfig, config, "allow-query-cache-on", NULL,
- aclctx, isc_g_mctx, &view->cacheonacl));
+ CHECK(configure_view_acl(vconfig, config, CFG_CLAUSE_ALLOW_QUERY_CACHE,
+ NULL, aclctx, isc_g_mctx, &view->cacheacl));
+ CHECK(configure_view_acl(vconfig, config,
+ CFG_CLAUSE_ALLOW_QUERY_CACHE_ON, NULL, aclctx,
+ isc_g_mctx, &view->cacheonacl));
- CHECK(configure_view_acl(vconfig, config, "allow-proxy", NULL, aclctx,
- isc_g_mctx, &view->proxyacl));
+ CHECK(configure_view_acl(vconfig, config, CFG_CLAUSE_ALLOW_PROXY, NULL,
+ aclctx, isc_g_mctx, &view->proxyacl));
- CHECK(configure_view_acl(vconfig, config, "allow-proxy-on", NULL,
- aclctx, isc_g_mctx, &view->proxyonacl));
+ CHECK(configure_view_acl(vconfig, config, CFG_CLAUSE_ALLOW_PROXY_ON,
+ NULL, aclctx, isc_g_mctx, &view->proxyonacl));
if (view->rdclass != dns_rdataclass_in) {
dns_acl_none(isc_g_mctx, &view->recursionacl);
dns_acl_none(isc_g_mctx, &view->recursiononacl);
} else {
- CHECK(configure_view_acl(vconfig, config, "allow-recursion",
- NULL, aclctx, isc_g_mctx,
- &view->recursionacl));
- CHECK(configure_view_acl(vconfig, config, "allow-recursion-on",
- NULL, aclctx, isc_g_mctx,
- &view->recursiononacl));
+ CHECK(configure_view_acl(
+ vconfig, config, CFG_CLAUSE_ALLOW_RECURSION, NULL,
+ aclctx, isc_g_mctx, &view->recursionacl));
+ CHECK(configure_view_acl(
+ vconfig, config, CFG_CLAUSE_ALLOW_RECURSION_ON, NULL,
+ aclctx, isc_g_mctx, &view->recursiononacl));
}
/*
@@ -4837,69 +4867,71 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* clients. This causes case not always to be preserved,
* and is needed by some broken clients.
*/
- CHECK(configure_view_acl(vconfig, config, "no-case-compress", NULL,
- aclctx, isc_g_mctx, &view->nocasecompress));
+ CHECK(configure_view_acl(vconfig, config, CFG_CLAUSE_NO_CASE_COMPRESS,
+ NULL, aclctx, isc_g_mctx,
+ &view->nocasecompress));
/*
* Disable name compression completely, this is a tradeoff
* between CPU and network usage.
*/
obj = NULL;
- result = named_config_get(maps, "message-compression", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MESSAGE_COMPRESSION, &obj);
INSIST(result == ISC_R_SUCCESS);
view->msgcompression = cfg_obj_asboolean(obj);
/*
* Filter setting on addresses in the answer section.
*/
- CHECK(configure_view_acl(vconfig, config, "deny-answer-addresses",
- "acl", aclctx, isc_g_mctx,
- &view->denyansweracl));
- CHECK(configure_view_nametable(vconfig, config, "deny-answer-addresses",
- "except-from", isc_g_mctx,
- &view->answeracl_exclude));
+ CHECK(configure_view_acl(vconfig, config,
+ CFG_CLAUSE_DENY_ANSWER_ADDRESSES, "acl",
+ aclctx, isc_g_mctx, &view->denyansweracl));
+ CHECK(configure_view_nametable(
+ vconfig, config, CFG_CLAUSE_DENY_ANSWER_ADDRESSES,
+ "except-from", isc_g_mctx, &view->answeracl_exclude));
/*
* Filter setting on names (CNAME/DNAME targets) in the answer section.
*/
- CHECK(configure_view_nametable(vconfig, config, "deny-answer-aliases",
- "name", isc_g_mctx,
- &view->denyanswernames));
- CHECK(configure_view_nametable(vconfig, config, "deny-answer-aliases",
- "except-from", isc_g_mctx,
- &view->answernames_exclude));
+ CHECK(configure_view_nametable(vconfig, config,
+ CFG_CLAUSE_DENY_ANSWER_ALIASES, "name",
+ isc_g_mctx, &view->denyanswernames));
+ CHECK(configure_view_nametable(
+ vconfig, config, CFG_CLAUSE_DENY_ANSWER_ALIASES, "except-from",
+ isc_g_mctx, &view->answernames_exclude));
/*
* Configure default allow-transfer and allow-notify ACLs so they
* can be inherited by zones.
*/
if (view->transferacl == NULL) {
- CHECK(configure_view_acl(vconfig, config, "allow-transfer",
- NULL, aclctx, isc_g_mctx,
- &view->transferacl));
+ CHECK(configure_view_acl(
+ vconfig, config, CFG_CLAUSE_ALLOW_TRANSFER, NULL,
+ aclctx, isc_g_mctx, &view->transferacl));
}
if (view->notifyacl == NULL) {
- CHECK(configure_view_acl(vconfig, config, "allow-notify", NULL,
- aclctx, isc_g_mctx, &view->notifyacl));
+ CHECK(configure_view_acl(vconfig, config,
+ CFG_CLAUSE_ALLOW_NOTIFY, NULL, aclctx,
+ isc_g_mctx, &view->notifyacl));
}
obj = NULL;
- result = named_config_get(maps, "provide-ixfr", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_PROVIDE_IXFR, &obj);
INSIST(result == ISC_R_SUCCESS);
view->provideixfr = cfg_obj_asboolean(obj);
obj = NULL;
- result = named_config_get(maps, "request-nsid", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_REQUEST_NSID, &obj);
INSIST(result == ISC_R_SUCCESS);
view->requestnsid = cfg_obj_asboolean(obj);
obj = NULL;
- result = named_config_get(maps, "request-zoneversion", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_REQUEST_ZONEVERSION, &obj);
INSIST(result == ISC_R_SUCCESS);
view->requestzoneversion = cfg_obj_asboolean(obj);
obj = NULL;
- result = named_config_get(maps, "send-cookie", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_SEND_COOKIE, &obj);
INSIST(result == ISC_R_SUCCESS);
view->sendcookie = cfg_obj_asboolean(obj);
@@ -4907,7 +4939,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
if (view->pad_acl != NULL) {
dns_acl_detach(&view->pad_acl);
}
- result = named_config_get(maps, "response-padding", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_RESPONSE_PADDING, &obj);
INSIST(result == ISC_R_SUCCESS);
padding = cfg_obj_asuint32(cfg_tuple_get(obj, "block-size"));
@@ -4922,22 +4954,22 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
isc_g_mctx, 0, &view->pad_acl));
obj = NULL;
- result = named_config_get(maps, "require-server-cookie", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_REQUIRE_SERVER_COOKIE, &obj);
INSIST(result == ISC_R_SUCCESS);
view->requireservercookie = cfg_obj_asboolean(obj);
obj = NULL;
- result = named_config_get(maps, "v6-bias", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_V6_BIAS, &obj);
INSIST(result == ISC_R_SUCCESS);
view->v6bias = cfg_obj_asuint32(obj) * 1000;
obj = NULL;
- result = named_config_get(maps, "clients-per-query", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_CLIENTS_PER_QUERY, &obj);
INSIST(result == ISC_R_SUCCESS);
clients_per_query = cfg_obj_asuint32(obj);
obj = NULL;
- result = named_config_get(maps, "max-clients-per-query", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_CLIENTS_PER_QUERY, &obj);
INSIST(result == ISC_R_SUCCESS);
max_clients_per_query = cfg_obj_asuint32(obj);
@@ -4958,7 +4990,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* for zone databases.
*/
obj = NULL;
- result = named_config_get(maps, "max-records-per-type", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_RECORDS_PER_TYPE, &obj);
INSIST(result == ISC_R_SUCCESS);
dns_view_setmaxrrperset(view, cfg_obj_asuint32(obj));
@@ -4967,52 +4999,54 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* for zone databases.
*/
obj = NULL;
- result = named_config_get(maps, "max-types-per-name", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_TYPES_PER_NAME, &obj);
INSIST(result == ISC_R_SUCCESS);
dns_view_setmaxtypepername(view, cfg_obj_asuint32(obj));
obj = NULL;
- result = named_config_get(maps, "max-recursion-depth", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_RECURSION_DEPTH, &obj);
INSIST(result == ISC_R_SUCCESS);
dns_resolver_setmaxdepth(view->resolver, cfg_obj_asuint32(obj));
obj = NULL;
- result = named_config_get(maps, "max-recursion-queries", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_RECURSION_QUERIES, &obj);
INSIST(result == ISC_R_SUCCESS);
dns_resolver_setmaxqueries(view->resolver, cfg_obj_asuint32(obj));
obj = NULL;
- result = named_config_get(maps, "max-query-restarts", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_QUERY_RESTARTS, &obj);
INSIST(result == ISC_R_SUCCESS);
dns_view_setmaxrestarts(view, cfg_obj_asuint32(obj));
obj = NULL;
- result = named_config_get(maps, "max-query-count", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_QUERY_COUNT, &obj);
INSIST(result == ISC_R_SUCCESS);
dns_view_setmaxqueries(view, cfg_obj_asuint32(obj));
obj = NULL;
- result = named_config_get(maps, "max-delegation-servers", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_DELEGATION_SERVERS,
+ &obj);
INSIST(result == ISC_R_SUCCESS);
CHECK(dns_view_setmaxdelegationservers(view, cfg_obj_asuint32(obj)));
obj = NULL;
- result = named_config_get(maps, "max-validations-per-fetch", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_VALIDATIONS_PER_FETCH,
+ &obj);
if (result == ISC_R_SUCCESS) {
dns_resolver_setmaxvalidations(view->resolver,
cfg_obj_asuint32(obj));
}
obj = NULL;
- result = named_config_get(maps, "max-validation-failures-per-fetch",
- &obj);
+ result = named_config_get(
+ maps, CFG_CLAUSE_MAX_VALIDATION_FAILURES_PER_FETCH, &obj);
if (result == ISC_R_SUCCESS) {
dns_resolver_setmaxvalidationfails(view->resolver,
cfg_obj_asuint32(obj));
}
obj = NULL;
- result = named_config_get(maps, "fetches-per-zone", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_FETCHES_PER_ZONE, &obj);
INSIST(result == ISC_R_SUCCESS);
obj2 = cfg_tuple_get(obj, "fetches");
dns_resolver_setfetchesperzone(view->resolver, cfg_obj_asuint32(obj2));
@@ -5034,7 +5068,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
}
obj = NULL;
- result = named_config_get(maps, "prefetch", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_PREFETCH, &obj);
INSIST(result == ISC_R_SUCCESS);
prefetch_trigger = cfg_tuple_get(obj, "trigger");
view->prefetch_trigger = cfg_obj_asuint32(prefetch_trigger);
@@ -5049,17 +5083,17 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
auto_root));
obj = NULL;
- result = named_config_get(maps, "nta-recheck", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_NTA_RECHECK, &obj);
INSIST(result == ISC_R_SUCCESS);
view->nta_recheck = cfg_obj_asduration(obj);
obj = NULL;
- result = named_config_get(maps, "nta-lifetime", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_NTA_LIFETIME, &obj);
INSIST(result == ISC_R_SUCCESS);
view->nta_lifetime = cfg_obj_asduration(obj);
obj = NULL;
- result = named_config_get(maps, "preferred-glue", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_PREFERRED_GLUE, &obj);
if (result == ISC_R_SUCCESS) {
str = cfg_obj_asstring(obj);
if (strcasecmp(str, "a") == 0) {
@@ -5078,9 +5112,9 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
*/
dyndb_list = NULL;
if (voptions != NULL) {
- (void)cfg_map_get(voptions, "dyndb", &dyndb_list);
+ (void)cfg_map_get(voptions, CFG_CLAUSE_DYNDB, &dyndb_list);
} else {
- (void)cfg_map_get(config, "dyndb", &dyndb_list);
+ (void)cfg_map_get(config, CFG_CLAUSE_DYNDB, &dyndb_list);
}
CFG_LIST_FOREACH(dyndb_list, element) {
@@ -5100,9 +5134,9 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
*/
plugin_list = NULL;
if (voptions != NULL) {
- (void)cfg_map_get(voptions, "plugin", &plugin_list);
+ (void)cfg_map_get(voptions, CFG_CLAUSE_PLUGIN, &plugin_list);
} else {
- (void)cfg_map_get(config, "plugin", &plugin_list);
+ (void)cfg_map_get(config, CFG_CLAUSE_PLUGIN, &plugin_list);
}
if (plugin_list != NULL) {
@@ -5129,8 +5163,9 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* they are disabled by default.
*/
obj = NULL;
- (void)named_config_get(maps, "empty-zones-enable", &obj);
- (void)named_config_get(maps, "disable-empty-zone", &disablelist);
+ (void)named_config_get(maps, CFG_CLAUSE_EMPTY_ZONES_ENABLE, &obj);
+ (void)named_config_get(maps, CFG_CLAUSE_DISABLE_EMPTY_ZONE,
+ &disablelist);
if (obj == NULL && disablelist == NULL &&
view->rdclass == dns_rdataclass_in)
{
@@ -5161,7 +5196,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
name = dns_fixedname_initname(&fixed);
obj = NULL;
- result = named_config_get(maps, "empty-server", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_EMPTY_SERVER, &obj);
if (result == ISC_R_SUCCESS) {
CHECK(dns_name_fromstring(name, cfg_obj_asstring(obj),
dns_rootname, 0, NULL));
@@ -5174,7 +5209,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
}
obj = NULL;
- result = named_config_get(maps, "empty-contact", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_EMPTY_CONTACT, &obj);
if (result == ISC_R_SUCCESS) {
CHECK(dns_name_fromstring(name, cfg_obj_asstring(obj),
dns_rootname, 0, NULL));
@@ -5187,7 +5222,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
}
obj = NULL;
- result = named_config_get(maps, "zone-statistics", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_ZONE_STATISTICS,
+ &obj);
INSIST(result == ISC_R_SUCCESS);
if (cfg_obj_isboolean(obj)) {
if (cfg_obj_asboolean(obj)) {
@@ -5279,7 +5315,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
obj = NULL;
if (view->rdclass == dns_rdataclass_in) {
- (void)named_config_get(maps, "ipv4only-enable", &obj);
+ (void)named_config_get(maps, CFG_CLAUSE_IPV4ONLY_ENABLE, &obj);
}
if (view->rdclass == dns_rdataclass_in && (obj != NULL)
? cfg_obj_asboolean(obj)
@@ -5299,7 +5335,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
size_t ipv4only_zone;
obj = NULL;
- result = named_config_get(maps, "ipv4only-server", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_IPV4ONLY_SERVER,
+ &obj);
if (result == ISC_R_SUCCESS) {
server = cfg_obj_asstring(obj);
} else {
@@ -5307,7 +5344,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
}
obj = NULL;
- result = named_config_get(maps, "ipv4only-contact", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_IPV4ONLY_CONTACT,
+ &obj);
if (result == ISC_R_SUCCESS) {
contact = cfg_obj_asstring(obj);
} else {
@@ -5374,7 +5412,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
}
obj = NULL;
- result = named_config_get(maps, "rate-limit", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_RATE_LIMIT, &obj);
if (result == ISC_R_SUCCESS) {
CHECK(configure_rrl(view, config, obj, aclctx));
}
@@ -5383,7 +5421,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* Set the servfail-ttl.
*/
obj = NULL;
- result = named_config_get(maps, "servfail-ttl", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_SERVFAIL_TTL, &obj);
INSIST(result == ISC_R_SUCCESS);
fail_ttl = cfg_obj_asduration(obj);
if (fail_ttl > 30) {
@@ -5395,7 +5433,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* Name space to look up redirect information in.
*/
obj = NULL;
- result = named_config_get(maps, "nxdomain-redirect", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_NXDOMAIN_REDIRECT, &obj);
if (result == ISC_R_SUCCESS) {
dns_name_t *name = dns_name(&view->redirectfixed);
CHECK(dns_name_fromstring(name, cfg_obj_asstring(obj),
@@ -5409,7 +5447,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* Exceptions to DNSSEC validation.
*/
obj = NULL;
- result = named_config_get(maps, "validate-except", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_VALIDATE_EXCEPT, &obj);
if (result == ISC_R_SUCCESS) {
result = dns_view_getntatable(view, &ntatable);
}
@@ -5453,8 +5491,8 @@ cleanup:
obj = NULL;
if (rpz_configured &&
pview->rdclass == dns_rdataclass_in &&
- named_config_get(maps, "response-policy", &obj) ==
- ISC_R_SUCCESS)
+ named_config_get(maps, CFG_CLAUSE_RESPONSE_POLICY,
+ &obj) == ISC_R_SUCCESS)
{
/*
* We are swapping the places of the `view` and
@@ -5479,8 +5517,8 @@ cleanup:
obj = NULL;
if (catz_configured &&
pview->rdclass == dns_rdataclass_in &&
- named_config_get(maps, "catalog-zones", &obj) ==
- ISC_R_SUCCESS)
+ named_config_get(maps, CFG_CLAUSE_CATALOG_ZONES,
+ &obj) == ISC_R_SUCCESS)
{
/*
* We are swapping the places of the `view` and
@@ -5585,7 +5623,7 @@ configure_alternates(const cfg_obj_t *config, dns_view_t *view,
/*
* Determine which port to send requests to.
*/
- CHECKM(named_config_getport(config, "port", &port), "port");
+ CHECKM(named_config_getport(config, CFG_CLAUSE_PORT, &port), "port");
if (alternates != NULL) {
portobj = cfg_tuple_get(alternates, "port");
@@ -5665,7 +5703,8 @@ validate_tls(const cfg_obj_t *config, dns_view_t *view, const cfg_obj_t *obj,
}
if (strcasecmp(str, "ephemeral") != 0) {
- const cfg_obj_t *tlsmap = find_maplist(config, "tls", str);
+ const cfg_obj_t *tlsmap = find_maplist(config, CFG_CLAUSE_TLS,
+ str);
if (tlsmap == NULL) {
cfg_obj_log(obj, ISC_LOG_ERROR,
@@ -5702,8 +5741,9 @@ configure_forward(const cfg_obj_t *config, dns_view_t *view,
/*
* Determine which port to send forwarded requests to.
*/
- CHECKM(named_config_getport(config, "port", &port), "port");
- CHECKM(named_config_getport(config, "tls-port", &tls_port), "tls-port");
+ CHECKM(named_config_getport(config, CFG_CLAUSE_PORT, &port), "port");
+ CHECKM(named_config_getport(config, CFG_CLAUSE_TLS_PORT, &tls_port),
+ "tls-port");
if (forwarders != NULL) {
portobj = cfg_tuple_get(forwarders, "port");
@@ -5935,7 +5975,8 @@ configure_zone_nscheck(const cfg_obj_t *options, const cfg_obj_t *vconfig,
if (vconfig) {
voptions = cfg_tuple_get(vconfig, "options");
}
- (void)named_config_findopt(voptions, options, "check-ns", &modeobj);
+ (void)named_config_findopt(voptions, options, CFG_CLAUSE_CHECK_NS,
+ &modeobj);
mode = cfg_obj_asstring(modeobj);
if (strcmp(mode, "fail") == 0) {
@@ -5988,7 +6029,7 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
bool fullsign = false;
options = NULL;
- (void)cfg_map_get(config, "options", &options);
+ (void)cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
zoptions = cfg_tuple_get(zconfig, "options");
toptions = named_zone_templateopts(config, zoptions);
@@ -6022,7 +6063,7 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
CLEANUP(ISC_R_FAILURE);
}
- (void)cfg_map_get(zoptions, "in-view", &viewobj);
+ (void)cfg_map_get(zoptions, CFG_CLAUSE_IN_VIEW, &viewobj);
if (viewobj != NULL) {
const char *inview = cfg_obj_asstring(viewobj);
dns_view_t *otherview = NULL;
@@ -6061,10 +6102,12 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
* other view.
*/
forwarders = NULL;
- result = cfg_map_get(zoptions, "forwarders", &forwarders);
+ result = cfg_map_get(zoptions, CFG_CLAUSE_FORWARDERS,
+ &forwarders);
if (result == ISC_R_SUCCESS) {
forwardtype = NULL;
- (void)cfg_map_get(zoptions, "forward", &forwardtype);
+ (void)cfg_map_get(zoptions, CFG_CLAUSE_FORWARD,
+ &forwardtype);
CHECK(configure_forward(config, view, origin,
forwarders, forwardtype));
}
@@ -6072,7 +6115,8 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
goto cleanup;
}
- (void)named_config_findopt(zoptions, toptions, "type", &typeobj);
+ (void)named_config_findopt(zoptions, toptions, CFG_CLAUSE_TYPE,
+ &typeobj);
if (typeobj == NULL) {
cfg_obj_log(zconfig, ISC_LOG_ERROR,
"zone '%s' 'type' not specified", zname);
@@ -6086,7 +6130,7 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
*/
if (strcasecmp(ztypestr, "hint") == 0) {
const cfg_obj_t *fileobj = NULL;
- (void)named_config_findopt(zoptions, toptions, "file",
+ (void)named_config_findopt(zoptions, toptions, CFG_CLAUSE_FILE,
&fileobj);
if (fileobj == NULL) {
isc_log_write(NAMED_LOGCATEGORY_GENERAL,
@@ -6115,10 +6159,10 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
forwardtype = NULL;
forwarders = NULL;
- (void)named_config_findopt(zoptions, toptions, "forward",
- &forwardtype);
- (void)named_config_findopt(zoptions, toptions, "forwarders",
- &forwarders);
+ (void)named_config_findopt(zoptions, toptions,
+ CFG_CLAUSE_FORWARD, &forwardtype);
+ (void)named_config_findopt(zoptions, toptions,
+ CFG_CLAUSE_FORWARDERS, &forwarders);
CHECK(configure_forward(config, view, origin, forwarders,
forwardtype));
goto cleanup;
@@ -6275,10 +6319,11 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
* selective forwarding.
*/
forwarders = NULL;
- named_config_findopt(zoptions, toptions, "forwarders", &forwarders);
+ named_config_findopt(zoptions, toptions, CFG_CLAUSE_FORWARDERS,
+ &forwarders);
if (forwarders != NULL) {
forwardtype = NULL;
- named_config_findopt(zoptions, toptions, "forward",
+ named_config_findopt(zoptions, toptions, CFG_CLAUSE_FORWARD,
&forwardtype);
CHECK(configure_forward(config, view, origin, forwarders,
forwardtype));
@@ -6316,7 +6361,8 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
CHECK(dns_zone_link(zone, raw));
}
named_config_findopt(zoptions, toptions,
- "ixfr-from-differences", &ixfrfromdiffs);
+ CFG_CLAUSE_IXFR_FROM_DIFFERENCES,
+ &ixfrfromdiffs);
if (ixfrfromdiffs != NULL) {
isc_log_write(NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_INFO,
@@ -6466,7 +6512,7 @@ cleanup:
* Configure a single server quota.
*/
static void
-configure_server_quota(const cfg_obj_t **maps, const char *name,
+configure_server_quota(const cfg_obj_t **maps, enum cfg_clause name,
isc_quota_t *quota) {
const cfg_obj_t *obj = NULL;
isc_result_t result;
@@ -6999,7 +7045,7 @@ configure_session_key(const cfg_obj_t **maps, named_server_t *server,
isc_result_t result;
obj = NULL;
- result = named_config_get(maps, "session-keyfile", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_SESSION_KEYFILE, &obj);
if (result == ISC_R_SUCCESS) {
if (cfg_obj_isvoid(obj)) {
keyfile = NULL; /* disable it */
@@ -7011,7 +7057,7 @@ configure_session_key(const cfg_obj_t **maps, named_server_t *server,
}
obj = NULL;
- result = named_config_get(maps, "session-keyname", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_SESSION_KEYNAME, &obj);
INSIST(result == ISC_R_SUCCESS);
keynamestr = cfg_obj_asstring(obj);
isc_buffer_constinit(&buffer, keynamestr, strlen(keynamestr));
@@ -7020,7 +7066,7 @@ configure_session_key(const cfg_obj_t **maps, named_server_t *server,
RETERR(dns_name_fromtext(keyname, &buffer, dns_rootname, 0));
obj = NULL;
- result = named_config_get(maps, "session-keyalg", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_SESSION_KEYALG, &obj);
INSIST(result == ISC_R_SUCCESS);
algstr = cfg_obj_asstring(obj);
result = named_config_getkeyalgorithm(algstr, &algtype, &bits);
@@ -7167,13 +7213,13 @@ setup_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig) {
if (voptions != NULL) {
maps[i++] = voptions;
}
- result = cfg_map_get(config, "options", &options);
+ result = cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
if (result == ISC_R_SUCCESS) {
maps[i++] = options;
}
maps[i] = NULL;
- result = named_config_get(maps, "allow-new-zones", &nz);
+ result = named_config_get(maps, CFG_CLAUSE_ALLOW_NEW_ZONES, &nz);
if (result == ISC_R_SUCCESS) {
view->newzone.allowed = cfg_obj_asboolean(nz);
}
@@ -7182,7 +7228,7 @@ setup_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig) {
* A non-empty catalog-zones statement implies allow-new-zones
*/
const cfg_obj_t *cz = NULL;
- result = named_config_get(maps, "catalog-zones", &cz);
+ result = named_config_get(maps, CFG_CLAUSE_CATALOG_ZONES, &cz);
if (result == ISC_R_SUCCESS) {
const cfg_listelt_t *e =
cfg_list_first(cfg_tuple_get(cz, "zone list"));
@@ -7192,7 +7238,7 @@ setup_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig) {
}
}
- result = named_config_get(maps, "new-zones-directory", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_NEW_ZONES_DIRECTORY, &obj);
if (result == ISC_R_SUCCESS) {
dir = cfg_obj_asstring(obj);
result = isc_file_isdirectory(dir);
@@ -7221,7 +7267,7 @@ setup_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig) {
uint64_t mapsize = 0ULL;
obj = NULL;
- result = named_config_get(maps, "lmdb-mapsize", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_LMDB_MAPSIZE, &obj);
if (result == ISC_R_SUCCESS && obj != NULL) {
mapsize = cfg_obj_asuint64(obj);
if (mapsize < (1ULL << 20)) { /* 1 megabyte */
@@ -7452,7 +7498,7 @@ for_all_newzone_cfgs(newzone_cfg_cb_t callback, cfg_obj_t *config,
* Extract zone configuration from configuration object.
*/
zlist = NULL;
- result = cfg_map_get(zconfigobj, "zone", &zlist);
+ result = cfg_map_get(zconfigobj, CFG_CLAUSE_ZONE, &zlist);
if (result != ISC_R_SUCCESS) {
break;
} else if (!cfg_obj_islist(zlist)) {
@@ -7576,7 +7622,7 @@ create_views(cfg_obj_t *config, dns_viewlist_t *viewlist) {
APPLY_CONFIGURATION_SUBROUTINE_LOG;
- (void)cfg_map_get(config, "view", &views);
+ (void)cfg_map_get(config, CFG_CLAUSE_VIEW, &views);
CFG_LIST_FOREACH(views, element) {
cfg_obj_t *vconfig = cfg_listelt_value(element);
const char *vname = NULL;
@@ -7649,7 +7695,7 @@ configure_views(cfg_obj_t *config, const cfg_obj_t *bindkeys,
* views that have zones were already created at parsing
* time, but views with no zones must be created here.
*/
- (void)cfg_map_get(config, "view", &views);
+ (void)cfg_map_get(config, CFG_CLAUSE_VIEW, &views);
CFG_LIST_FOREACH(views, element) {
cfg_obj_t *vconfig = cfg_listelt_value(element);
dns_view_t *view = NULL;
@@ -7734,7 +7780,7 @@ configure_keystores(const cfg_obj_t *config, dns_keystorelist_t *keystorelist) {
* Create the DNSSEC key stores.
*/
keystores = NULL;
- (void)cfg_map_get(config, "key-store", &keystores);
+ (void)cfg_map_get(config, CFG_CLAUSE_KEY_STORE, &keystores);
CFG_LIST_FOREACH(keystores, element) {
cfg_obj_t *kconfig = cfg_listelt_value(element);
@@ -7760,7 +7806,7 @@ configure_kasplist(const cfg_obj_t *config, dns_kasplist_t *kasplist,
/*
* Create the DNSSEC key and signing policies (KASP).
*/
- (void)cfg_map_get(config, "dnssec-policy", &kasps);
+ (void)cfg_map_get(config, CFG_CLAUSE_DNSSEC_POLICY, &kasps);
CFG_LIST_FOREACH(kasps, element) {
cfg_obj_t *kconfig = cfg_listelt_value(element);
dns_kasp_t *kasp = NULL;
@@ -7839,7 +7885,7 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
*/
i = 0;
options = NULL;
- result = cfg_map_get(effectiveconfig, "options", &options);
+ result = cfg_map_get(effectiveconfig, CFG_CLAUSE_OPTIONS, &options);
if (result == ISC_R_SUCCESS) {
maps[i++] = options;
}
@@ -7899,22 +7945,23 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
#if HAVE_LIBNGHTTP2
obj = NULL;
- result = named_config_get(maps, "http-port", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_HTTP_PORT, &obj);
INSIST(result == ISC_R_SUCCESS);
named_g_httpport = (in_port_t)cfg_obj_asuint32(obj);
obj = NULL;
- result = named_config_get(maps, "https-port", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_HTTPS_PORT, &obj);
INSIST(result == ISC_R_SUCCESS);
named_g_httpsport = (in_port_t)cfg_obj_asuint32(obj);
obj = NULL;
- result = named_config_get(maps, "http-listener-clients", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_HTTP_LISTENER_CLIENTS, &obj);
INSIST(result == ISC_R_SUCCESS);
named_g_http_listener_clients = cfg_obj_asuint32(obj);
obj = NULL;
- result = named_config_get(maps, "http-streams-per-connection", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_HTTP_STREAMS_PER_CONNECTION,
+ &obj);
INSIST(result == ISC_R_SUCCESS);
named_g_http_streams_per_conn = cfg_obj_asuint32(obj);
#endif
@@ -7932,7 +7979,7 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
* ACLs that can't work.
*/
obj = NULL;
- result = named_config_get(maps, "geoip-directory", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_GEOIP_DIRECTORY, &obj);
INSIST(result == ISC_R_SUCCESS);
if (cfg_obj_isstring(obj)) {
char *dir = UNCONST(cfg_obj_asstring(obj));
@@ -7944,13 +7991,15 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
/*
* Configure various server options.
*/
- configure_server_quota(maps, "transfers-out",
+ configure_server_quota(maps, CFG_CLAUSE_TRANSFERS_OUT,
&server->sctx->xfroutquota);
- configure_server_quota(maps, "tcp-clients", &server->sctx->tcpquota);
- configure_server_quota(maps, "recursive-clients",
+ configure_server_quota(maps, CFG_CLAUSE_TCP_CLIENTS,
+ &server->sctx->tcpquota);
+ configure_server_quota(maps, CFG_CLAUSE_RECURSIVE_CLIENTS,
&server->sctx->recursionquota);
- configure_server_quota(maps, "update-quota", &server->sctx->updquota);
- configure_server_quota(maps, "sig0checks-quota",
+ configure_server_quota(maps, CFG_CLAUSE_UPDATE_QUOTA,
+ &server->sctx->updquota);
+ configure_server_quota(maps, CFG_CLAUSE_SIG0CHECKS_QUOTA,
&server->sctx->sig0checksquota);
max = isc_quota_getmax(&server->sctx->recursionquota);
@@ -7973,7 +8022,8 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
isc_quota_soft(&server->sctx->recursionquota, softquota);
obj = NULL;
- result = named_config_get(maps, "sig0checks-quota-exempt", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_SIG0CHECKS_QUOTA_EXEMPT,
+ &obj);
if (result == ISC_R_SUCCESS) {
result = cfg_acl_fromconfig(
obj, effectiveconfig, aclctx, isc_g_mctx, 0,
@@ -7985,8 +8035,8 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
* Set "blackhole". Only legal at options level; there is
* no default.
*/
- result = configure_view_acl(NULL, effectiveconfig, "blackhole", NULL,
- aclctx, isc_g_mctx,
+ result = configure_view_acl(NULL, effectiveconfig, CFG_CLAUSE_BLACKHOLE,
+ NULL, aclctx, isc_g_mctx,
&server->sctx->blackholeacl);
if (result != ISC_R_SUCCESS) {
goto cleanup_tls;
@@ -7998,7 +8048,8 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
}
obj = NULL;
- result = named_config_get(maps, "match-mapped-addresses", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MATCH_MAPPED_ADDRESSES,
+ &obj);
INSIST(result == ISC_R_SUCCESS);
env->match_mapped = cfg_obj_asboolean(obj);
@@ -8006,7 +8057,7 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
* Configure the network manager
*/
obj = NULL;
- result = named_config_get(maps, "tcp-initial-timeout", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_TCP_INITIAL_TIMEOUT, &obj);
INSIST(result == ISC_R_SUCCESS);
initial = cfg_obj_asuint32(obj) * 100;
if (initial > MAX_INITIAL_TIMEOUT) {
@@ -8024,7 +8075,7 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
}
obj = NULL;
- result = named_config_get(maps, "tcp-idle-timeout", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_TCP_IDLE_TIMEOUT, &obj);
INSIST(result == ISC_R_SUCCESS);
idle = cfg_obj_asuint32(obj) * 100;
if (idle > MAX_IDLE_TIMEOUT) {
@@ -8042,7 +8093,7 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
}
obj = NULL;
- result = named_config_get(maps, "tcp-keepalive-timeout", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_TCP_KEEPALIVE_TIMEOUT, &obj);
INSIST(result == ISC_R_SUCCESS);
keepalive = cfg_obj_asuint32(obj) * 100;
if (keepalive > MAX_KEEPALIVE_TIMEOUT) {
@@ -8060,7 +8111,8 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
}
obj = NULL;
- result = named_config_get(maps, "tcp-advertised-timeout", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_TCP_ADVERTISED_TIMEOUT,
+ &obj);
INSIST(result == ISC_R_SUCCESS);
advertised = cfg_obj_asuint32(obj) * 100;
if (advertised > MAX_ADVERTISED_TIMEOUT) {
@@ -8072,7 +8124,7 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
}
obj = NULL;
- result = named_config_get(maps, "tcp-primaries-timeout", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_TCP_PRIMARIES_TIMEOUT, &obj);
INSIST(result == ISC_R_SUCCESS);
primaries = cfg_obj_asuint32(obj) * 100;
if (primaries > MAX_PRIMARIES_TIMEOUT) {
@@ -8090,7 +8142,7 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
}
obj = NULL;
- result = named_config_get(maps, "tcp-reuse-timeout", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_TCP_REUSE_TIMEOUT, &obj);
INSIST(result == ISC_R_SUCCESS);
reuse = cfg_obj_asuint32(obj) * 100;
if (reuse > MAX_REUSE_TIMEOUT) {
@@ -8118,25 +8170,25 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
/* Set the kernel send and receive buffer sizes */
obj = NULL;
- result = named_config_get(maps, "tcp-receive-buffer", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_TCP_RECEIVE_BUFFER, &obj);
INSIST(result == ISC_R_SUCCESS);
recv_tcp_buffer_size = cfg_obj_asuint32(obj);
CAP_IF_NOT_ZERO(recv_tcp_buffer_size, 4096, INT32_MAX);
obj = NULL;
- result = named_config_get(maps, "tcp-send-buffer", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_TCP_SEND_BUFFER, &obj);
INSIST(result == ISC_R_SUCCESS);
send_tcp_buffer_size = cfg_obj_asuint32(obj);
CAP_IF_NOT_ZERO(send_tcp_buffer_size, 4096, INT32_MAX);
obj = NULL;
- result = named_config_get(maps, "udp-receive-buffer", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_UDP_RECEIVE_BUFFER, &obj);
INSIST(result == ISC_R_SUCCESS);
recv_udp_buffer_size = cfg_obj_asuint32(obj);
CAP_IF_NOT_ZERO(recv_udp_buffer_size, 4096, INT32_MAX);
obj = NULL;
- result = named_config_get(maps, "udp-send-buffer", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_UDP_SEND_BUFFER, &obj);
INSIST(result == ISC_R_SUCCESS);
send_udp_buffer_size = cfg_obj_asuint32(obj);
CAP_IF_NOT_ZERO(send_udp_buffer_size, 4096, INT32_MAX);
@@ -8181,13 +8233,13 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
* Set the EDNS UDP size when we don't match a view.
*/
obj = NULL;
- result = named_config_get(maps, "edns-udp-size", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_EDNS_UDP_SIZE, &obj);
INSIST(result == ISC_R_SUCCESS);
server->sctx->udpsize = (uint16_t)cfg_obj_asuint32(obj);
/* Set the transfer message size for TCP */
obj = NULL;
- result = named_config_get(maps, "transfer-message-size", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_TRANSFER_MESSAGE_SIZE, &obj);
INSIST(result == ISC_R_SUCCESS);
transfer_message_size = cfg_obj_asuint32(obj);
if (transfer_message_size < 512) {
@@ -8202,28 +8254,28 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
* Configure the zone manager.
*/
obj = NULL;
- result = named_config_get(maps, "transfers-in", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_TRANSFERS_IN, &obj);
INSIST(result == ISC_R_SUCCESS);
dns_zonemgr_settransfersin(server->zonemgr, cfg_obj_asuint32(obj));
obj = NULL;
- result = named_config_get(maps, "transfers-per-ns", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_TRANSFERS_PER_NS, &obj);
INSIST(result == ISC_R_SUCCESS);
dns_zonemgr_settransfersperns(server->zonemgr, cfg_obj_asuint32(obj));
obj = NULL;
- result = named_config_get(maps, "notify-rate", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_NOTIFY_RATE, &obj);
INSIST(result == ISC_R_SUCCESS);
dns_zonemgr_setnotifyrate(server->zonemgr, cfg_obj_asuint32(obj));
obj = NULL;
- result = named_config_get(maps, "startup-notify-rate", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_STARTUP_NOTIFY_RATE, &obj);
INSIST(result == ISC_R_SUCCESS);
dns_zonemgr_setstartupnotifyrate(server->zonemgr,
cfg_obj_asuint32(obj));
obj = NULL;
- result = named_config_get(maps, "serial-query-rate", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_SERIAL_QUERY_RATE, &obj);
INSIST(result == ISC_R_SUCCESS);
dns_zonemgr_setserialqueryrate(server->zonemgr, cfg_obj_asuint32(obj));
@@ -8233,7 +8285,7 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
if (named_g_port != 0) {
listen_port = named_g_port;
} else {
- result = named_config_getport(effectiveconfig, "port",
+ result = named_config_getport(effectiveconfig, CFG_CLAUSE_PORT,
&listen_port);
if (result != ISC_R_SUCCESS) {
goto cleanup_portsets;
@@ -8244,7 +8296,7 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
* Find the listen queue depth.
*/
obj = NULL;
- result = named_config_get(maps, "tcp-listen-queue", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_TCP_LISTEN_QUEUE, &obj);
INSIST(result == ISC_R_SUCCESS);
backlog = cfg_obj_asuint32(obj);
if ((backlog > 0) && (backlog < 10)) {
@@ -8253,7 +8305,7 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
ns_interfacemgr_setbacklog(server->interfacemgr, backlog);
obj = NULL;
- result = named_config_get(maps, "reuseport", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_REUSEPORT, &obj);
INSIST(result == ISC_R_SUCCESS);
loadbalancesockets = cfg_obj_asboolean(obj);
#if HAVE_SO_REUSEPORT_LB
@@ -8278,7 +8330,8 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
const cfg_obj_t *clistenon = NULL;
ns_listenlist_t *listenon = NULL;
- result = named_config_get(maps, "listen-on", &clistenon);
+ result = named_config_get(maps, CFG_CLAUSE_LISTEN_ON,
+ &clistenon);
if (result != ISC_R_SUCCESS) {
goto cleanup_portsets;
}
@@ -8302,7 +8355,8 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
const cfg_obj_t *clistenon = NULL;
ns_listenlist_t *listenon = NULL;
- result = named_config_get(maps, "listen-on-v6", &clistenon);
+ result = named_config_get(maps, CFG_CLAUSE_LISTEN_ON_V6,
+ &clistenon);
if (result != ISC_R_SUCCESS) {
goto cleanup_portsets;
}
@@ -8355,7 +8409,7 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
* as specified by the "interface-interval" option.
*/
obj = NULL;
- result = named_config_get(maps, "interface-interval", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_INTERFACE_INTERVAL, &obj);
INSIST(result == ISC_R_SUCCESS);
interface_interval = cfg_obj_asduration(obj);
server->interface_interval = interface_interval;
@@ -8364,7 +8418,8 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
* Enable automatic interface scans.
*/
obj = NULL;
- result = named_config_get(maps, "automatic-interface-scan", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_AUTOMATIC_INTERFACE_SCAN,
+ &obj);
INSIST(result == ISC_R_SUCCESS);
server->sctx->interface_auto = cfg_obj_asboolean(obj);
@@ -8407,7 +8462,8 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
* Write the PID file.
*/
obj = NULL;
- if (named_config_get(maps, "pid-file", &obj) == ISC_R_SUCCESS) {
+ if (named_config_get(maps, CFG_CLAUSE_PID_FILE, &obj) == ISC_R_SUCCESS)
+ {
if (cfg_obj_isvoid(obj)) {
named_os_writepidfile(NULL, first_time);
} else {
@@ -8507,7 +8563,7 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
"statement for logging due to "
"-g option");
- (void)cfg_map_get(effectiveconfig, "logging", &logobj);
+ (void)cfg_map_get(effectiveconfig, CFG_CLAUSE_LOGGING, &logobj);
if (logobj != NULL) {
result = named_logconfig(NULL, logobj);
if (result != ISC_R_SUCCESS) {
@@ -8526,7 +8582,7 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
isc_logconfig_create(&logc);
logobj = NULL;
- (void)cfg_map_get(effectiveconfig, "logging", &logobj);
+ (void)cfg_map_get(effectiveconfig, CFG_CLAUSE_LOGGING, &logobj);
if (logobj != NULL) {
result = named_logconfig(logc, logobj);
if (result != ISC_R_SUCCESS) {
@@ -8582,13 +8638,16 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
const cfg_obj_t *categories = NULL;
obj = NULL;
- if (named_config_get(maps, "querylog", &obj) == ISC_R_SUCCESS) {
+ if (named_config_get(maps, CFG_CLAUSE_QUERYLOG, &obj) ==
+ ISC_R_SUCCESS)
+ {
ns_server_setoption(server->sctx, NS_SERVER_LOGQUERIES,
cfg_obj_asboolean(obj));
} else {
- (void)cfg_map_get(effectiveconfig, "logging", &logobj);
+ (void)cfg_map_get(effectiveconfig, CFG_CLAUSE_LOGGING,
+ &logobj);
if (logobj != NULL) {
- (void)cfg_map_get(logobj, "category",
+ (void)cfg_map_get(logobj, CFG_CLAUSE_CATEGORY,
&categories);
}
if (categories != NULL) {
@@ -8609,7 +8668,7 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
}
}
obj = NULL;
- result = named_config_get(maps, "responselog", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_RESPONSELOG, &obj);
if (result == ISC_R_SUCCESS) {
ns_server_setoption(server->sctx,
NS_SERVER_LOGRESPONSES,
@@ -8618,8 +8677,8 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
}
obj = NULL;
- if (options != NULL &&
- cfg_map_get(options, "memstatistics", &obj) == ISC_R_SUCCESS)
+ if (options != NULL && cfg_map_get(options, CFG_CLAUSE_MEMSTATISTICS,
+ &obj) == ISC_R_SUCCESS)
{
named_g_memstatistics = cfg_obj_asboolean(obj);
} else {
@@ -8628,7 +8687,8 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
}
obj = NULL;
- if (named_config_get(maps, "memstatistics-file", &obj) == ISC_R_SUCCESS)
+ if (named_config_get(maps, CFG_CLAUSE_MEMSTATISTICS_FILE, &obj) ==
+ ISC_R_SUCCESS)
{
named_main_setmemstats(cfg_obj_asstring(obj));
} else if (named_g_memstatistics) {
@@ -8638,27 +8698,27 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
}
obj = NULL;
- result = named_config_get(maps, "statistics-file", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_STATISTICS_FILE, &obj);
INSIST(result == ISC_R_SUCCESS);
setstring(server, &server->statsfile, cfg_obj_asstring(obj));
obj = NULL;
- result = named_config_get(maps, "dump-file", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_DUMP_FILE, &obj);
INSIST(result == ISC_R_SUCCESS);
setstring(server, &server->dumpfile, cfg_obj_asstring(obj));
obj = NULL;
- result = named_config_get(maps, "secroots-file", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_SECROOTS_FILE, &obj);
INSIST(result == ISC_R_SUCCESS);
setstring(server, &server->secrootsfile, cfg_obj_asstring(obj));
obj = NULL;
- result = named_config_get(maps, "recursing-file", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_RECURSING_FILE, &obj);
INSIST(result == ISC_R_SUCCESS);
setstring(server, &server->recfile, cfg_obj_asstring(obj));
obj = NULL;
- result = named_config_get(maps, "version", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_VERSION, &obj);
if (result == ISC_R_SUCCESS) {
setversionfromobj(server, obj);
} else {
@@ -8666,7 +8726,7 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
}
obj = NULL;
- result = named_config_get(maps, "hostname", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_HOSTNAME, &obj);
if (result == ISC_R_SUCCESS) {
sethostnamefromobj(server, obj);
} else {
@@ -8674,7 +8734,7 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
}
obj = NULL;
- result = named_config_get(maps, "server-id", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_SERVER_ID, &obj);
if (result == ISC_R_SUCCESS) {
setserveridfromobj(server, obj);
} else {
@@ -8682,7 +8742,8 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
}
obj = NULL;
- result = named_config_get(maps, "flush-zones-on-shutdown", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_FLUSH_ZONES_ON_SHUTDOWN,
+ &obj);
if (result == ISC_R_SUCCESS) {
server->flushonshutdown = cfg_obj_asboolean(obj);
} else {
@@ -8690,12 +8751,12 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
}
obj = NULL;
- result = named_config_get(maps, "answer-cookie", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_ANSWER_COOKIE, &obj);
INSIST(result == ISC_R_SUCCESS);
server->sctx->answercookie = cfg_obj_asboolean(obj);
obj = NULL;
- result = named_config_get(maps, "cookie-algorithm", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_COOKIE_ALGORITHM, &obj);
INSIST(result == ISC_R_SUCCESS);
if (strcasecmp(cfg_obj_asstring(obj), "siphash24") == 0) {
server->sctx->cookiealg = ns_cookiealg_siphash24;
@@ -8704,7 +8765,7 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *userconfig,
}
obj = NULL;
- result = named_config_get(maps, "cookie-secret", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_COOKIE_SECRET, &obj);
if (result == ISC_R_SUCCESS) {
const char *str;
bool first = true;
@@ -10446,7 +10507,8 @@ cleanup:
}
static const cfg_obj_t *
-find_maplist(const cfg_obj_t *config, const char *listname, const char *name) {
+find_maplist(const cfg_obj_t *config, enum cfg_clause listname,
+ const char *name) {
isc_result_t result;
const cfg_obj_t *maplist = NULL;
@@ -10523,7 +10585,7 @@ listenelt_fromconfig(const cfg_obj_t *listener, const cfg_obj_t *config,
do_tls = true;
- tlsmap = find_maplist(config, "tls", tlsname);
+ tlsmap = find_maplist(config, CFG_CLAUSE_TLS, tlsname);
if (tlsmap == NULL) {
cfg_obj_log(tlsobj, ISC_LOG_ERROR,
"tls '%s' is not defined",
@@ -10531,20 +10593,22 @@ listenelt_fromconfig(const cfg_obj_t *listener, const cfg_obj_t *config,
return ISC_R_FAILURE;
}
- CHECK(cfg_map_get(tlsmap, "key-file", &keyobj));
+ CHECK(cfg_map_get(tlsmap, CFG_CLAUSE_KEY_FILE,
+ &keyobj));
key = cfg_obj_asstring(keyobj);
- CHECK(cfg_map_get(tlsmap, "cert-file", &certobj));
+ CHECK(cfg_map_get(tlsmap, CFG_CLAUSE_CERT_FILE,
+ &certobj));
cert = cfg_obj_asstring(certobj);
- if (cfg_map_get(tlsmap, "ca-file", &ca_obj) ==
+ if (cfg_map_get(tlsmap, CFG_CLAUSE_CA_FILE, &ca_obj) ==
ISC_R_SUCCESS)
{
ca_file = cfg_obj_asstring(ca_obj);
}
- if (cfg_map_get(tlsmap, "protocols", &tls_proto_list) ==
- ISC_R_SUCCESS)
+ if (cfg_map_get(tlsmap, CFG_CLAUSE_PROTOCOLS,
+ &tls_proto_list) == ISC_R_SUCCESS)
{
INSIST(tls_proto_list != NULL);
CFG_LIST_FOREACH(tls_proto_list, proto) {
@@ -10563,26 +10627,27 @@ listenelt_fromconfig(const cfg_obj_t *listener, const cfg_obj_t *config,
}
}
- if (cfg_map_get(tlsmap, "dhparam-file", &dhparam_obj) ==
- ISC_R_SUCCESS)
+ if (cfg_map_get(tlsmap, CFG_CLAUSE_DHPARAM_FILE,
+ &dhparam_obj) == ISC_R_SUCCESS)
{
dhparam_file = cfg_obj_asstring(dhparam_obj);
}
- if (cfg_map_get(tlsmap, "ciphers", &ciphers_obj) ==
- ISC_R_SUCCESS)
+ if (cfg_map_get(tlsmap, CFG_CLAUSE_CIPHERS,
+ &ciphers_obj) == ISC_R_SUCCESS)
{
ciphers = cfg_obj_asstring(ciphers_obj);
}
- if (cfg_map_get(tlsmap, "cipher-suites",
+ if (cfg_map_get(tlsmap, CFG_CLAUSE_CIPHER_SUITES,
&cipher_suites_obj) == ISC_R_SUCCESS)
{
cipher_suites =
cfg_obj_asstring(cipher_suites_obj);
}
- if (cfg_map_get(tlsmap, "prefer-server-ciphers",
+ if (cfg_map_get(tlsmap,
+ CFG_CLAUSE_PREFER_SERVER_CIPHERS,
&prefer_server_ciphers_obj) ==
ISC_R_SUCCESS)
{
@@ -10591,7 +10656,7 @@ listenelt_fromconfig(const cfg_obj_t *listener, const cfg_obj_t *config,
tls_prefer_server_ciphers_set = true;
}
- if (cfg_map_get(tlsmap, "session-tickets",
+ if (cfg_map_get(tlsmap, CFG_CLAUSE_SESSION_TICKETS,
&session_tickets_obj) == ISC_R_SUCCESS)
{
tls_session_tickets =
@@ -10624,7 +10689,7 @@ listenelt_fromconfig(const cfg_obj_t *listener, const cfg_obj_t *config,
return ISC_R_FAILURE;
}
- http_server = find_maplist(config, "http", httpname);
+ http_server = find_maplist(config, CFG_CLAUSE_HTTP, httpname);
if (http_server == NULL && strcasecmp(httpname, "default") != 0)
{
cfg_obj_log(httpobj, ISC_LOG_ERROR,
@@ -10643,28 +10708,28 @@ listenelt_fromconfig(const cfg_obj_t *listener, const cfg_obj_t *config,
port = named_g_httpsport;
} else {
RETERR(named_config_getport(
- config, "https-port", &port));
+ config, CFG_CLAUSE_HTTPS_PORT, &port));
}
} else if (http && !do_tls) {
if (named_g_httpport != 0) {
port = named_g_httpport;
} else {
- RETERR(named_config_getport(config, "http-port",
- &port));
+ RETERR(named_config_getport(
+ config, CFG_CLAUSE_HTTP_PORT, &port));
}
} else if (do_tls) {
if (named_g_tlsport != 0) {
port = named_g_tlsport;
} else {
- RETERR(named_config_getport(config, "tls-port",
- &port));
+ RETERR(named_config_getport(
+ config, CFG_CLAUSE_TLS_PORT, &port));
}
} else {
if (named_g_port != 0) {
port = named_g_port;
} else {
- RETERR(named_config_getport(config, "port",
- &port));
+ RETERR(named_config_getport(
+ config, CFG_CLAUSE_PORT, &port));
}
}
} else {
@@ -10747,19 +10812,21 @@ listenelt_http(const cfg_obj_t *http, const uint16_t family, bool tls,
const cfg_obj_t *cfg_max_clients = NULL;
const cfg_obj_t *cfg_max_streams = NULL;
- if (cfg_map_get(http, "endpoints", &eplist) == ISC_R_SUCCESS) {
+ if (cfg_map_get(http, CFG_CLAUSE_ENDPOINTS, &eplist) ==
+ ISC_R_SUCCESS)
+ {
INSIST(eplist != NULL);
len = cfg_list_length(eplist, false);
}
- if (cfg_map_get(http, "listener-clients", &cfg_max_clients) ==
- ISC_R_SUCCESS)
+ if (cfg_map_get(http, CFG_CLAUSE_LISTENER_CLIENTS,
+ &cfg_max_clients) == ISC_R_SUCCESS)
{
INSIST(cfg_max_clients != NULL);
max_clients = cfg_obj_asuint32(cfg_max_clients);
}
- if (cfg_map_get(http, "streams-per-connection",
+ if (cfg_map_get(http, CFG_CLAUSE_STREAMS_PER_CONNECTION,
&cfg_max_streams) == ISC_R_SUCCESS)
{
INSIST(cfg_max_streams != NULL);
@@ -12221,7 +12288,7 @@ newzone_parse(named_server_t *server, char *command, dns_view_t **viewp,
CHECK(cfg_parse_buffer(&argbuf, bn, 0, &cfg_type_addzoneconf, 0,
&zoneconf));
- CHECK(cfg_map_get(zoneconf, "zone", &zlist));
+ CHECK(cfg_map_get(zoneconf, CFG_CLAUSE_ZONE, &zlist));
if (!cfg_obj_islist(zlist)) {
CLEANUP(ISC_R_FAILURE);
}
@@ -12233,16 +12300,16 @@ newzone_parse(named_server_t *server, char *command, dns_view_t **viewp,
zoptions = cfg_tuple_get(zoneobj, "options");
obj = NULL;
- (void)cfg_map_get(zoptions, "type", &obj);
+ (void)cfg_map_get(zoptions, CFG_CLAUSE_TYPE, &obj);
if (obj == NULL) {
- (void)cfg_map_get(zoptions, "in-view", &obj);
+ (void)cfg_map_get(zoptions, CFG_CLAUSE_IN_VIEW, &obj);
if (obj != NULL) {
(void)putstr(text, "'in-view' zones not supported by ");
(void)putstr(text, bn);
CLEANUP(ISC_R_FAILURE);
}
- (void)cfg_map_get(zoptions, "template", &obj);
+ (void)cfg_map_get(zoptions, CFG_CLAUSE_TEMPLATE, &obj);
if (obj == NULL) {
(void)putstr(text, "no zone type or "
"template specified");
@@ -12313,7 +12380,7 @@ delete_zoneconf(dns_view_t *view, const cfg_obj_t *config,
REQUIRE(config != NULL);
REQUIRE(zname != NULL);
- cfg_map_get(config, "zone", &zl);
+ cfg_map_get(config, CFG_CLAUSE_ZONE, &zl);
if (!cfg_obj_islist(zl)) {
return ISC_R_FAILURE;
diff --git a/bin/named/statschannel.c b/bin/named/statschannel.c
index ea1a1ecb92..3bc57558b2 100644
--- a/bin/named/statschannel.c
+++ b/bin/named/statschannel.c
@@ -40,6 +40,8 @@
#include <dns/zoneproperties.h>
#include <dns/zt.h>
+#include <isccfg/clause.h>
+
#include <ns/stats.h>
#include <named/log.h>
@@ -4008,7 +4010,8 @@ named_statschannels_configure(named_server_t *server, const cfg_obj_t *config,
/*
* Get the list of named.conf 'statistics-channels' statements.
*/
- (void)cfg_map_get(config, "statistics-channels", &statschannellist);
+ (void)cfg_map_get(config, CFG_CLAUSE_STATISTICS_CHANNELS,
+ &statschannellist);
/*
* Run through the new address/port list, noting sockets that are
@@ -4044,7 +4047,8 @@ named_statschannels_configure(named_server_t *server, const cfg_obj_t *config,
const cfg_obj_t *listenercfg = NULL;
statschannel = cfg_listelt_value(element);
- (void)cfg_map_get(statschannel, "inet", &listenercfg);
+ (void)cfg_map_get(statschannel, CFG_CLAUSE_INET,
+ &listenercfg);
if (listenercfg == NULL) {
continue;
}
diff --git a/bin/named/tkeyconf.c b/bin/named/tkeyconf.c
index f383f95392..95456b3d0e 100644
--- a/bin/named/tkeyconf.c
+++ b/bin/named/tkeyconf.c
@@ -20,6 +20,7 @@
#include <dst/gssapi.h>
#include <isccfg/cfg.h>
+#include <isccfg/clause.h>
#include <named/log.h>
#include <named/tkeyconf.h>
@@ -33,8 +34,8 @@ named_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
if (options != NULL) {
const cfg_obj_t *obj = NULL;
- isc_result_t result = cfg_map_get(options, "tkey-gssapi-keytab",
- &obj);
+ isc_result_t result = cfg_map_get(
+ options, CFG_CLAUSE_TKEY_GSSAPI_KEYTAB, &obj);
if (result == ISC_R_SUCCESS) {
const char *s = cfg_obj_asstring(obj);
tctx->gssapi_keytab = isc_mem_strdup(mctx, s);
diff --git a/bin/named/transportconf.c b/bin/named/transportconf.c
index 5f3701b393..d8a95c0d2b 100644
--- a/bin/named/transportconf.c
+++ b/bin/named/transportconf.c
@@ -23,6 +23,7 @@
#include <dns/transport.h>
#include <isccfg/cfg.h>
+#include <isccfg/clause.h>
#include <named/log.h>
#include <named/transportconf.h>
@@ -106,22 +107,24 @@ add_doh_transports(const cfg_obj_t *transportlist, dns_transport_list_t *list) {
list);
dns_transport_set_tlsname(transport, dohid);
- parse_transport_option(doh, transport, "key-file",
+ parse_transport_option(doh, transport, CFG_CLAUSE_KEY_FILE,
dns_transport_set_keyfile);
- parse_transport_option(doh, transport, "cert-file",
+ parse_transport_option(doh, transport, CFG_CLAUSE_CERT_FILE,
dns_transport_set_certfile);
- parse_transport_tls_versions(doh, transport, "protocols",
+ parse_transport_tls_versions(doh, transport,
+ CFG_CLAUSE_PROTOCOLS,
dns_transport_set_tls_versions);
- parse_transport_option(doh, transport, "ciphers",
+ parse_transport_option(doh, transport, CFG_CLAUSE_CIPHERS,
dns_transport_set_ciphers);
- parse_transport_option(doh, transport, "cipher-suites",
+ parse_transport_option(doh, transport, CFG_CLAUSE_CIPHER_SUITES,
dns_transport_set_cipher_suites);
parse_transport_bool_option(
- doh, transport, "prefer-server-ciphers",
+ doh, transport, CFG_CLAUSE_PREFER_SERVER_CIPHERS,
dns_transport_set_prefer_server_ciphers);
- parse_transport_option(doh, transport, "ca-file",
+ parse_transport_option(doh, transport, CFG_CLAUSE_CA_FILE,
dns_transport_set_cafile);
- parse_transport_option(doh, transport, "remote-hostname",
+ parse_transport_option(doh, transport,
+ CFG_CLAUSE_REMOTE_HOSTNAME,
dns_transport_set_remote_hostname);
}
@@ -155,22 +158,24 @@ add_tls_transports(const cfg_obj_t *transportlist, dns_transport_list_t *list) {
transport = dns_transport_new(tlsname, DNS_TRANSPORT_TLS, list);
dns_transport_set_tlsname(transport, tlsid);
- parse_transport_option(tls, transport, "key-file",
+ parse_transport_option(tls, transport, CFG_CLAUSE_KEY_FILE,
dns_transport_set_keyfile);
- parse_transport_option(tls, transport, "cert-file",
+ parse_transport_option(tls, transport, CFG_CLAUSE_CERT_FILE,
dns_transport_set_certfile);
- parse_transport_tls_versions(tls, transport, "protocols",
+ parse_transport_tls_versions(tls, transport,
+ CFG_CLAUSE_PROTOCOLS,
dns_transport_set_tls_versions);
- parse_transport_option(tls, transport, "ciphers",
+ parse_transport_option(tls, transport, CFG_CLAUSE_CIPHERS,
dns_transport_set_ciphers);
- parse_transport_option(tls, transport, "cipher-suites",
+ parse_transport_option(tls, transport, CFG_CLAUSE_CIPHER_SUITES,
dns_transport_set_cipher_suites);
parse_transport_bool_option(
- tls, transport, "prefer-server-ciphers",
+ tls, transport, CFG_CLAUSE_PREFER_SERVER_CIPHERS,
dns_transport_set_prefer_server_ciphers);
- parse_transport_option(tls, transport, "ca-file",
+ parse_transport_option(tls, transport, CFG_CLAUSE_CA_FILE,
dns_transport_set_cafile);
- parse_transport_option(tls, transport, "remote-hostname",
+ parse_transport_option(tls, transport,
+ CFG_CLAUSE_REMOTE_HOSTNAME,
dns_transport_set_remote_hostname);
}
@@ -188,14 +193,14 @@ transport_list_fromconfig(const cfg_obj_t *config, dns_transport_list_t *list) {
isc_result_t result = ISC_R_SUCCESS;
if (result == ISC_R_SUCCESS &&
- cfg_map_get(config, "tls", &obj) == ISC_R_SUCCESS)
+ cfg_map_get(config, CFG_CLAUSE_TLS, &obj) == ISC_R_SUCCESS)
{
result = add_tls_transports(obj, list);
obj = NULL;
}
if (result == ISC_R_SUCCESS &&
- cfg_map_get(config, "doh", &obj) == ISC_R_SUCCESS)
+ cfg_map_get(config, CFG_CLAUSE_DOH, &obj) == ISC_R_SUCCESS)
{
result = add_doh_transports(obj, list);
obj = NULL;
diff --git a/bin/named/tsigconf.c b/bin/named/tsigconf.c
index 1a790a6823..c29b1ef64b 100644
--- a/bin/named/tsigconf.c
+++ b/bin/named/tsigconf.c
@@ -25,6 +25,7 @@
#include <dns/tsig.h>
#include <isccfg/cfg.h>
+#include <isccfg/clause.h>
#include <named/config.h>
#include <named/log.h>
@@ -58,8 +59,8 @@ add_initial_keys(const cfg_obj_t *list, dns_tsigkeyring_t *ring,
algobj = NULL;
secretobj = NULL;
- (void)cfg_map_get(key, "algorithm", &algobj);
- (void)cfg_map_get(key, "secret", &secretobj);
+ (void)cfg_map_get(key, CFG_CLAUSE_ALGORITHM, &algobj);
+ (void)cfg_map_get(key, CFG_CLAUSE_SECRET, &secretobj);
INSIST(algobj != NULL && secretobj != NULL);
/*
@@ -148,7 +149,7 @@ named_tsigkeyring_fromconfig(const cfg_obj_t *config, const cfg_obj_t *vconfig,
break;
}
keylist = NULL;
- result = cfg_map_get(maps[i], "key", &keylist);
+ result = cfg_map_get(maps[i], CFG_CLAUSE_KEY, &keylist);
if (result != ISC_R_SUCCESS) {
continue;
}
diff --git a/bin/named/zoneconf.c b/bin/named/zoneconf.c
index fec189da03..a7989ede35 100644
--- a/bin/named/zoneconf.c
+++ b/bin/named/zoneconf.c
@@ -41,9 +41,11 @@
#include <dns/stats.h>
#include <dns/tsig.h>
#include <dns/view.h>
-#include <dns/zone.h> /* WMM: remove include */
+#include <dns/zone.h>
#include <dns/zoneproperties.h>
+#include <isccfg/clause.h>
+
#include <ns/client.h>
#include <ns/hooks.h>
@@ -80,7 +82,7 @@ configure_zone_acl(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
const cfg_obj_t *aclobj = NULL;
int i = 0;
dns_acl_t **aclp = NULL, *acl = NULL;
- const char *aclname;
+ enum cfg_clause aclname;
dns_view_t *view = NULL;
view = dns_zone_getview(zone);
@@ -90,37 +92,37 @@ configure_zone_acl(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
if (view != NULL) {
aclp = &view->notifyacl;
}
- aclname = "allow-notify";
+ aclname = CFG_CLAUSE_ALLOW_NOTIFY;
break;
case allow_query:
if (view != NULL) {
aclp = &view->queryacl;
}
- aclname = "allow-query";
+ aclname = CFG_CLAUSE_ALLOW_QUERY;
break;
case allow_query_on:
if (view != NULL) {
aclp = &view->queryonacl;
}
- aclname = "allow-query-on";
+ aclname = CFG_CLAUSE_ALLOW_QUERY_ON;
break;
case allow_transfer:
if (view != NULL) {
aclp = &view->transferacl;
}
- aclname = "allow-transfer";
+ aclname = CFG_CLAUSE_ALLOW_TRANSFER;
break;
case allow_update:
if (view != NULL) {
aclp = &view->updateacl;
}
- aclname = "allow-update";
+ aclname = CFG_CLAUSE_ALLOW_UPDATE;
break;
case allow_update_forwarding:
if (view != NULL) {
aclp = &view->upfwdacl;
}
- aclname = "allow-update-forwarding";
+ aclname = CFG_CLAUSE_ALLOW_UPDATE_FORWARDING;
break;
default:
UNREACHABLE();
@@ -165,7 +167,7 @@ configure_zone_acl(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
}
if (config != NULL) {
const cfg_obj_t *options = NULL;
- (void)cfg_map_get(config, "options", &options);
+ (void)cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
if (options != NULL) {
maps[i++] = options;
}
@@ -208,7 +210,7 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, const cfg_obj_t *tconfig,
isc_buffer_init(&dbuf, debug, sizeof(debug));
isc_buffer_setmctx(&dbuf, mctx);
- (void)named_config_findopt(zconfig, tconfig, "update-policy",
+ (void)named_config_findopt(zconfig, tconfig, CFG_CLAUSE_UPDATE_POLICY,
&updatepolicy);
if (updatepolicy == NULL) {
dns_zone_setssutable(zone, NULL);
@@ -585,7 +587,8 @@ configure_staticstub(const cfg_obj_t *zconfig, const cfg_obj_t *tconfig,
/* Prepare zone RRs from the configuration */
obj = NULL;
- (void)named_config_findopt(zconfig, tconfig, "server-addresses", &obj);
+ (void)named_config_findopt(zconfig, tconfig,
+ CFG_CLAUSE_SERVER_ADDRESSES, &obj);
if (obj != NULL) {
CHECK(configure_staticstub_serveraddrs(obj, zone, &rdatalist_ns,
&rdatalist_a,
@@ -593,7 +596,8 @@ configure_staticstub(const cfg_obj_t *zconfig, const cfg_obj_t *tconfig,
}
obj = NULL;
- (void)named_config_findopt(zconfig, tconfig, "server-names", &obj);
+ (void)named_config_findopt(zconfig, tconfig, CFG_CLAUSE_SERVER_NAMES,
+ &obj);
if (obj != NULL) {
CHECK(configure_staticstub_servernames(obj, zone, &rdatalist_ns,
zname));
@@ -682,7 +686,7 @@ static dns_zonetype_t
zonetype_fromconfig(const cfg_obj_t *zmap, const cfg_obj_t *tmap) {
const cfg_obj_t *obj = NULL;
- (void)named_config_findopt(zmap, tmap, "type", &obj);
+ (void)named_config_findopt(zmap, tmap, CFG_CLAUSE_TYPE, &obj);
INSIST(obj != NULL);
return named_config_getzonetype(obj);
}
@@ -850,7 +854,7 @@ process_notifysoatype(dns_notifytype_t ntype, dns_zonetype_t ztype,
* Only log a message if "notify" was set in the configuration
* hierarchy supplied in 'maps'.
*/
- if (named_config_get(maps, "notify", &obj) == ISC_R_SUCCESS) {
+ if (named_config_get(maps, CFG_CLAUSE_NOTIFY, &obj) == ISC_R_SUCCESS) {
cfg_obj_log(obj, ISC_LOG_INFO,
"'notify explicit;' will be used for mirror zone "
"'%s'",
@@ -874,7 +878,7 @@ process_notify_options(dns_rdatatype_t type, const cfg_obj_t **maps,
*/
if (notifycfg) {
obj = NULL;
- result = cfg_map_get(maps[0], "notify", &obj);
+ result = cfg_map_get(maps[0], CFG_CLAUSE_NOTIFY, &obj);
if (result == ISC_R_SUCCESS && obj != NULL) {
dns_zone_setnotifytype(zone, type,
cfg_obj_asboolean(obj));
@@ -887,22 +891,22 @@ process_notify_options(dns_rdatatype_t type, const cfg_obj_t **maps,
}
obj = NULL;
- result = named_config_get(maps, "notify-delay", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_NOTIFY_DELAY, &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setnotifydelay(zone, type, cfg_obj_asuint32(obj));
obj = NULL;
- result = named_config_get(maps, "notify-defer", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_NOTIFY_DEFER, &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setnotifydefer(zone, type, cfg_obj_asuint32(obj));
obj = NULL;
- result = named_config_get(maps, "notify-source", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_NOTIFY_SOURCE, &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setnotifysrc4(zone, type, cfg_obj_assockaddr(obj));
obj = NULL;
- result = named_config_get(maps, "notify-source-v6", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_NOTIFY_SOURCE_V6, &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setnotifysrc6(zone, type, cfg_obj_assockaddr(obj));
}
@@ -912,7 +916,7 @@ process_notify_cfg(const cfg_obj_t **maps, dns_zone_t *zone, dns_zone_t *raw) {
isc_result_t result;
const cfg_obj_t *obj = NULL;
- result = named_config_get(maps, "notify-cfg", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_NOTIFY_CFG, &obj);
if (result == ISC_R_SUCCESS && obj != NULL) {
CFG_LIST_FOREACH(obj, element) {
const cfg_obj_t *nmaps[MAPS_SIZE + 1];
@@ -1036,7 +1040,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
i++;
}
- (void)cfg_map_get(config, "options", &options);
+ (void)cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
if (options != NULL) {
nodefault[i] = maps[i] = options;
i++;
@@ -1074,13 +1078,13 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
}
obj = NULL;
- result = named_config_get(nooptions, "database", &obj);
+ result = named_config_get(nooptions, CFG_CLAUSE_DATABASE, &obj);
if (result == ISC_R_SUCCESS) {
cpval = isc_mem_strdup(mctx, cfg_obj_asstring(obj));
}
obj = NULL;
- result = named_config_get(nooptions, "dlz", &obj);
+ result = named_config_get(nooptions, CFG_CLAUSE_DLZ, &obj);
if (result == ISC_R_SUCCESS) {
const char *dlzname = cfg_obj_asstring(obj);
size_t len = strlen(dlzname) + 5;
@@ -1106,13 +1110,13 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
}
obj = NULL;
- result = named_config_get(nooptions, "file", &obj);
+ result = named_config_get(nooptions, CFG_CLAUSE_FILE, &obj);
if (result == ISC_R_SUCCESS) {
filename = cfg_obj_asstring(obj);
}
obj = NULL;
- result = named_config_get(nooptions, "initial-file", &obj);
+ result = named_config_get(nooptions, CFG_CLAUSE_INITIAL_FILE, &obj);
if (result == ISC_R_SUCCESS) {
initial_file = cfg_obj_asstring(obj);
}
@@ -1123,7 +1127,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
masterformat = dns_masterformat_text;
}
obj = NULL;
- result = named_config_get(maps, "masterfile-format", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MASTERFILE_FORMAT, &obj);
if (result == ISC_R_SUCCESS) {
const char *masterformatstr = cfg_obj_asstring(obj);
@@ -1135,7 +1139,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
}
obj = NULL;
- result = named_config_get(maps, "masterfile-style", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MASTERFILE_STYLE, &obj);
if (result == ISC_R_SUCCESS) {
const char *masterstylestr = cfg_obj_asstring(obj);
if (strcasecmp(masterstylestr, "full") == 0) {
@@ -1146,7 +1150,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
}
obj = NULL;
- result = named_config_get(maps, "max-records", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_RECORDS, &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setmaxrecords(mayberaw, cfg_obj_asuint32(obj));
if (zone != mayberaw) {
@@ -1154,7 +1158,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
}
obj = NULL;
- result = named_config_get(maps, "max-records-per-type", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_RECORDS_PER_TYPE, &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setmaxrrperset(mayberaw, cfg_obj_asuint32(obj));
if (zone != mayberaw) {
@@ -1162,7 +1166,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
}
obj = NULL;
- result = named_config_get(maps, "max-types-per-name", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_TYPES_PER_NAME, &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setmaxtypepername(mayberaw, cfg_obj_asuint32(obj));
if (zone != mayberaw) {
@@ -1188,7 +1192,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
}
obj = NULL;
- result = named_config_get(nooptions, "journal", &obj);
+ result = named_config_get(nooptions, CFG_CLAUSE_JOURNAL, &obj);
if (result == ISC_R_SUCCESS) {
dns_zone_setjournal(mayberaw, cfg_obj_asstring(obj));
}
@@ -1215,7 +1219,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_zone_clearqueryonacl));
obj = NULL;
- result = named_config_get(maps, "zone-statistics", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_ZONE_STATISTICS, &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
if (cfg_obj_isboolean(obj)) {
if (cfg_obj_asboolean(obj)) {
@@ -1278,7 +1282,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_kasp_detach(&kasp);
obj = NULL;
- result = named_config_get(maps, "dnssec-policy", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_DNSSEC_POLICY, &obj);
if (result == ISC_R_SUCCESS) {
kaspname = cfg_obj_asstring(obj);
if (strcmp(kaspname, "none") != 0) {
@@ -1300,13 +1304,14 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
}
obj = NULL;
- result = named_config_get(maps, "provide-zoneversion", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_PROVIDE_ZONEVERSION,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setoption(zone, DNS_ZONEOPT_ZONEVERSION,
cfg_obj_asboolean(obj));
obj = NULL;
- result = named_config_get(maps, "notify", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_NOTIFY, &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
if (cfg_obj_isboolean(obj)) {
if (cfg_obj_asboolean(obj)) {
@@ -1335,7 +1340,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_zone_setnotifytype(zone, dns_rdatatype_soa, notifytype);
obj = NULL;
- result = named_config_get(maps, "also-notify", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_ALSO_NOTIFY, &obj);
if (result == ISC_R_SUCCESS &&
(notifytype == dns_notifytype_yes ||
notifytype == dns_notifytype_explicit ||
@@ -1356,17 +1361,19 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
}
obj = NULL;
- result = named_config_get(maps, "parental-source", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_PARENTAL_SOURCE,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setparentalsrc4(zone, cfg_obj_assockaddr(obj));
obj = NULL;
- result = named_config_get(maps, "parental-source-v6", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_PARENTAL_SOURCE_V6,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setparentalsrc6(zone, cfg_obj_assockaddr(obj));
obj = NULL;
- result = named_config_get(maps, "notify-to-soa", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_NOTIFY_TO_SOA, &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setoption(zone, DNS_ZONEOPT_NOTIFYTOSOA,
cfg_obj_asboolean(obj));
@@ -1379,21 +1386,24 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_zone_setxfracl, dns_zone_clearxfracl));
obj = NULL;
- result = named_config_get(maps, "max-transfer-time-out", &obj);
+ result = named_config_get(
+ maps, CFG_CLAUSE_MAX_TRANSFER_TIME_OUT, &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setmaxxfrout(
zone, transferinsecs ? cfg_obj_asuint32(obj)
: cfg_obj_asuint32(obj) * 60);
obj = NULL;
- result = named_config_get(maps, "max-transfer-idle-out", &obj);
+ result = named_config_get(
+ maps, CFG_CLAUSE_MAX_TRANSFER_IDLE_OUT, &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setidleout(zone, transferinsecs
? cfg_obj_asuint32(obj)
: cfg_obj_asuint32(obj) * 60);
obj = NULL;
- result = named_config_get(maps, "max-journal-size", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_JOURNAL_SIZE,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
if (raw != NULL) {
dns_zone_setjournalsize(raw, -1);
@@ -1416,7 +1426,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_zone_setjournalsize(zone, journal_size);
obj = NULL;
- result = named_config_get(maps, "ixfr-from-differences", &obj);
+ result = named_config_get(
+ maps, CFG_CLAUSE_IXFR_FROM_DIFFERENCES, &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
if (cfg_obj_isboolean(obj)) {
ixfrdiff = cfg_obj_asboolean(obj);
@@ -1445,7 +1456,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
}
obj = NULL;
- result = named_config_get(maps, "max-ixfr-ratio", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_IXFR_RATIO,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
if (cfg_obj_isstring(obj)) {
dns_zone_setixfrratio(zone, 0);
@@ -1454,17 +1466,19 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
}
obj = NULL;
- result = named_config_get(maps, "request-expire", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_REQUEST_EXPIRE,
+ &obj);
INSIST(result == ISC_R_SUCCESS);
dns_zone_setrequestexpire(zone, cfg_obj_asboolean(obj));
obj = NULL;
- result = named_config_get(maps, "request-ixfr", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_REQUEST_IXFR, &obj);
INSIST(result == ISC_R_SUCCESS);
dns_zone_setrequestixfr(zone, cfg_obj_asboolean(obj));
obj = NULL;
- result = named_config_get(maps, "request-ixfr-max-diffs", &obj);
+ result = named_config_get(
+ maps, CFG_CLAUSE_REQUEST_IXFR_MAX_DIFFS, &obj);
INSIST(result == ISC_R_SUCCESS);
dns_zone_setrequestixfrmaxdiffs(zone, cfg_obj_asuint32(obj));
@@ -1495,13 +1509,13 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
}
obj = NULL;
- result = named_config_get(maps, "check-sibling", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_CHECK_SIBLING, &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setoption(zone, DNS_ZONEOPT_CHECKSIBLING,
cfg_obj_asboolean(obj));
obj = NULL;
- result = named_config_get(maps, "check-spf", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_CHECK_SPF, &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
check = true;
@@ -1513,32 +1527,35 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_zone_setoption(zone, DNS_ZONEOPT_CHECKSPF, check);
obj = NULL;
- result = named_config_get(maps, "check-svcb", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_CHECK_SVCB, &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setoption(zone, DNS_ZONEOPT_CHECKSVCB,
cfg_obj_asboolean(obj));
obj = NULL;
- result = named_config_get(maps, "zero-no-soa-ttl", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_ZERO_NO_SOA_TTL,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setzeronosoattl(zone, cfg_obj_asboolean(obj));
obj = NULL;
- result = named_config_get(maps, "nsec3-test-zone", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_NSEC3_TEST_ZONE,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setoption(zone, DNS_ZONEOPT_NSEC3TESTZONE,
cfg_obj_asboolean(obj));
obj = NULL;
- result = named_config_get(nooptions, "log-report-channel",
- &obj);
+ result = named_config_get(nooptions,
+ CFG_CLAUSE_LOG_REPORT_CHANNEL, &obj);
if (result == ISC_R_SUCCESS) {
logreports = cfg_obj_asboolean(obj);
dns_zone_setoption(zone, DNS_ZONEOPT_LOGREPORTS,
logreports);
}
obj = NULL;
- result = named_config_get(maps, "send-report-channel", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_SEND_REPORT_CHANNEL,
+ &obj);
if (result == ISC_R_SUCCESS && obj != NULL) {
dns_fixedname_t fixed;
dns_name_t *rad = dns_fixedname_initname(&fixed);
@@ -1586,7 +1603,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_notifytype_no);
obj = NULL;
- result = named_config_get(maps, "max-journal-size", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_JOURNAL_SIZE,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setjournalsize(zone, -1);
if (cfg_obj_isstring(obj)) {
@@ -1607,7 +1625,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
maxttl = dns_kasp_zonemaxttl(dns_zone_getkasp(zone), false);
} else {
obj = NULL;
- result = named_config_get(maps, "max-zone-ttl", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_ZONE_TTL, &obj);
if (result == ISC_R_SUCCESS) {
if (cfg_obj_isduration(obj)) {
maxttl = cfg_obj_asduration(obj);
@@ -1678,30 +1696,33 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
}
obj = NULL;
- result = named_config_get(maps, "key-directory", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_KEY_DIRECTORY, &obj);
if (result == ISC_R_SUCCESS) {
filename = cfg_obj_asstring(obj);
dns_zone_setkeydirectory(zone, filename);
}
obj = NULL;
- result = named_config_get(maps, "sig-signing-signatures", &obj);
+ result = named_config_get(
+ maps, CFG_CLAUSE_SIG_SIGNING_SIGNATURES, &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setsignatures(zone, cfg_obj_asuint32(obj));
obj = NULL;
- result = named_config_get(maps, "sig-signing-nodes", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_SIG_SIGNING_NODES,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setnodes(zone, cfg_obj_asuint32(obj));
obj = NULL;
- result = named_config_get(maps, "sig-signing-type", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_SIG_SIGNING_TYPE,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setprivatetype(zone, cfg_obj_asuint32(obj));
obj = NULL;
- result = named_config_get(maps, "dnssec-loadkeys-interval",
- &obj);
+ result = named_config_get(
+ maps, CFG_CLAUSE_DNSSEC_LOADKEYS_INTERVAL, &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
CHECK(dns_zone_setrefreshkeyinterval(zone,
cfg_obj_asuint32(obj)));
@@ -1719,7 +1740,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
*/
if (ztype == dns_zone_primary || ztype == dns_zone_secondary) {
const cfg_obj_t *parentals = NULL;
- (void)named_config_get(nooptions, "parental-agents",
+ (void)named_config_get(nooptions, CFG_CLAUSE_PARENTAL_AGENTS,
&parentals);
if (parentals != NULL) {
dns_ipkeylist_t ipkl;
@@ -1734,7 +1755,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
}
obj = NULL;
- result = named_config_get(maps, "checkds", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_CHECKDS, &obj);
if (result == ISC_R_SUCCESS) {
if (cfg_obj_isboolean(obj)) {
if (cfg_obj_asboolean(obj)) {
@@ -1766,7 +1787,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
*/
if (ztype == dns_zone_primary) {
obj = NULL;
- result = named_config_get(maps, "check-wildcard", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_CHECK_WILDCARD,
+ &obj);
if (result == ISC_R_SUCCESS) {
check = cfg_obj_asboolean(obj);
} else {
@@ -1775,7 +1797,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKWILDCARD, check);
obj = NULL;
- result = named_config_get(maps, "check-dup-records", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_CHECK_DUP_RECORDS,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dupcheck = cfg_obj_asstring(obj);
if (strcasecmp(dupcheck, "warn") == 0) {
@@ -1792,7 +1815,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKDUPRRFAIL, fail);
obj = NULL;
- result = named_config_get(maps, "check-mx", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_CHECK_MX, &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
fail = false;
@@ -1808,13 +1831,15 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKMXFAIL, fail);
obj = NULL;
- result = named_config_get(maps, "check-integrity", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_CHECK_INTEGRITY,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKINTEGRITY,
cfg_obj_asboolean(obj));
obj = NULL;
- result = named_config_get(maps, "check-mx-cname", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_CHECK_MX_CNAME,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
warn = true;
@@ -1830,7 +1855,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_zone_setoption(mayberaw, DNS_ZONEOPT_IGNOREMXCNAME, ignore);
obj = NULL;
- result = named_config_get(maps, "check-srv-cname", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_CHECK_SRV_CNAME,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
warn = true;
@@ -1847,7 +1873,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
ignore);
obj = NULL;
- result = named_config_get(maps, "serial-update-method", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_SERIAL_UPDATE_METHOD,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
if (strcasecmp(cfg_obj_asstring(obj), "unixtime") == 0) {
dns_zone_setserialupdatemethod(
@@ -1871,7 +1898,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
* are explicitly enabled by zone configuration.
*/
obj = NULL;
- (void)named_config_get(nooptions, "allow-transfer", &obj);
+ (void)named_config_get(nooptions, CFG_CLAUSE_ALLOW_TRANSFER,
+ &obj);
if (obj == NULL) {
dns_acl_t *none = NULL;
dns_acl_none(mctx, &none);
@@ -1884,9 +1912,10 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
case dns_zone_redirect:
count = 0;
obj = NULL;
- (void)named_config_get(nooptions, "primaries", &obj);
+ (void)named_config_get(nooptions, CFG_CLAUSE_PRIMARIES, &obj);
if (obj == NULL) {
- (void)named_config_get(nooptions, "masters", &obj);
+ (void)named_config_get(nooptions, CFG_CLAUSE_MASTERS,
+ &obj);
}
/*
@@ -1897,7 +1926,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_name_isroot(dns_zone_getorigin(zone)))
{
result = named_config_getremotesdef(
- config, "remote-servers",
+ config, CFG_CLAUSE_REMOTE_SERVERS,
DEFAULT_IANA_ROOT_ZONE_PRIMARIES, &obj);
CHECK(result);
}
@@ -1920,14 +1949,16 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
multi = false;
if (count > 1) {
obj = NULL;
- result = named_config_get(maps, "multi-master", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MULTI_MASTER,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
multi = cfg_obj_asboolean(obj);
}
dns_zone_setoption(mayberaw, DNS_ZONEOPT_MULTIMASTER, multi);
obj = NULL;
- result = named_config_get(maps, "min-transfer-rate-in", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MIN_TRANSFER_RATE_IN,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
uint32_t traffic_bytes =
cfg_obj_asuint32(cfg_tuple_get(obj, "traffic_bytes"));
@@ -1938,51 +1969,59 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
: time_minutes * 60);
obj = NULL;
- result = named_config_get(maps, "max-transfer-time-in", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_TRANSFER_TIME_IN,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setmaxxfrin(
mayberaw, transferinsecs ? cfg_obj_asuint32(obj)
: cfg_obj_asuint32(obj) * 60);
obj = NULL;
- result = named_config_get(maps, "max-transfer-idle-in", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_TRANSFER_IDLE_IN,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setidlein(mayberaw,
transferinsecs ? cfg_obj_asuint32(obj)
: cfg_obj_asuint32(obj) * 60);
obj = NULL;
- result = named_config_get(maps, "max-refresh-time", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_REFRESH_TIME,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setmaxrefreshtime(mayberaw, cfg_obj_asuint32(obj));
obj = NULL;
- result = named_config_get(maps, "min-refresh-time", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MIN_REFRESH_TIME,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setminrefreshtime(mayberaw, cfg_obj_asuint32(obj));
obj = NULL;
- result = named_config_get(maps, "max-retry-time", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MAX_RETRY_TIME,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setmaxretrytime(mayberaw, cfg_obj_asuint32(obj));
obj = NULL;
- result = named_config_get(maps, "min-retry-time", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_MIN_RETRY_TIME,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setminretrytime(mayberaw, cfg_obj_asuint32(obj));
obj = NULL;
- result = named_config_get(maps, "transfer-source", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_TRANSFER_SOURCE,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setxfrsource4(mayberaw, cfg_obj_assockaddr(obj));
obj = NULL;
- result = named_config_get(maps, "transfer-source-v6", &obj);
+ result = named_config_get(maps, CFG_CLAUSE_TRANSFER_SOURCE_V6,
+ &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
dns_zone_setxfrsource6(mayberaw, cfg_obj_assockaddr(obj));
obj = NULL;
- (void)named_config_get(maps, "try-tcp-refresh", &obj);
+ (void)named_config_get(maps, CFG_CLAUSE_TRY_TCP_REFRESH, &obj);
dns_zone_setoption(mayberaw, DNS_ZONEOPT_TRYTCPREFRESH,
cfg_obj_asboolean(obj));
break;
@@ -2084,7 +2123,7 @@ named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig,
}
obj = NULL;
- (void)named_config_findopt(zoptions, toptions, "file", &obj);
+ (void)named_config_findopt(zoptions, toptions, CFG_CLAUSE_FILE, &obj);
if (obj != NULL) {
cfilename = cfg_obj_asstring(obj);
} else {
@@ -2132,7 +2171,7 @@ named_zone_inlinesigning(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
}
if (config != NULL) {
const cfg_obj_t *options = NULL;
- (void)cfg_map_get(config, "options", &options);
+ (void)cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
if (options != NULL) {
maps[i++] = options;
}
@@ -2141,7 +2180,7 @@ named_zone_inlinesigning(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
/* Check the value in dnssec-policy. */
policy = NULL;
- res = named_config_get(maps, "dnssec-policy", &policy);
+ res = named_config_get(maps, CFG_CLAUSE_DNSSEC_POLICY, &policy);
/* If no dnssec-policy found, then zone is not using inline-signing. */
if (res != ISC_R_SUCCESS ||
strcmp(cfg_obj_asstring(policy), "none") == 0)
@@ -2163,7 +2202,7 @@ named_zone_inlinesigning(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
* dnssec-policy. This is a zone-only option, so look in the
* zone and template blocks only.
*/
- res = named_config_get(noopts, "inline-signing", &signing);
+ res = named_config_get(noopts, CFG_CLAUSE_INLINE_SIGNING, &signing);
if (res == ISC_R_SUCCESS && cfg_obj_isboolean(signing)) {
return cfg_obj_asboolean(signing);
}
@@ -2176,8 +2215,8 @@ named_zone_templateopts(const cfg_obj_t *config, const cfg_obj_t *zoptions) {
const cfg_obj_t *templates = NULL;
const cfg_obj_t *obj = NULL;
- (void)cfg_map_get(config, "template", &templates);
- (void)cfg_map_get(zoptions, "template", &obj);
+ (void)cfg_map_get(config, CFG_CLAUSE_TEMPLATE, &templates);
+ (void)cfg_map_get(zoptions, CFG_CLAUSE_TEMPLATE, &obj);
if (obj != NULL && templates != NULL) {
const char *tmplname = cfg_obj_asstring(obj);
CFG_LIST_FOREACH(templates, e) {
@@ -2213,11 +2252,11 @@ named_zone_loadplugins(dns_zone_t *zone, const cfg_obj_t *config,
* Load zone-specific plugin instances.
*/
if (toptions != NULL) {
- (void)cfg_map_get(toptions, "plugin", &tpluginlist);
+ (void)cfg_map_get(toptions, CFG_CLAUSE_PLUGIN, &tpluginlist);
}
if (zoptions != NULL) {
- (void)cfg_map_get(zoptions, "plugin", &zpluginlist);
+ (void)cfg_map_get(zoptions, CFG_CLAUSE_PLUGIN, &zpluginlist);
}
if (tpluginlist != NULL || zpluginlist != NULL) {
diff --git a/bin/nsupdate/nsupdate.c b/bin/nsupdate/nsupdate.c
index dde58e8380..e8b4529282 100644
--- a/bin/nsupdate/nsupdate.c
+++ b/bin/nsupdate/nsupdate.c
@@ -73,6 +73,7 @@
#include <dst/dst.h>
+#include <isccfg/clause.h>
#include <isccfg/namedconf.h>
#include <irs/resconf.h>
@@ -585,10 +586,10 @@ read_sessionkey(isc_mem_t *mctx) {
CHECK(cfg_parse_file(keyfile, &cfg_type_sessionkey, 0, &sessionkey));
- CHECK(cfg_map_get(sessionkey, "key", &key));
+ CHECK(cfg_map_get(sessionkey, CFG_CLAUSE_KEY, &key));
- (void)cfg_map_get(key, "secret", &secretobj);
- (void)cfg_map_get(key, "algorithm", &algorithmobj);
+ (void)cfg_map_get(key, CFG_CLAUSE_SECRET, &secretobj);
+ (void)cfg_map_get(key, CFG_CLAUSE_ALGORITHM, &algorithmobj);
if (secretobj == NULL || algorithmobj == NULL) {
fatal("key must have algorithm and secret");
}
diff --git a/bin/rndc/rndc.c b/bin/rndc/rndc.c
index 969ff19efe..fe36788004 100644
--- a/bin/rndc/rndc.c
+++ b/bin/rndc/rndc.c
@@ -49,6 +49,7 @@
#include <isccc/types.h>
#include <isccc/util.h>
+#include <isccfg/clause.h>
#include <isccfg/namedconf.h>
#include "util.h"
@@ -634,14 +635,15 @@ parse_config(const char *keyname, cfg_obj_t **configp) {
}
if (!key_only) {
- (void)cfg_map_get(config, "options", &options);
+ (void)cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
}
if (key_only && servername == NULL) {
servername = "127.0.0.1";
} else if (servername == NULL && options != NULL) {
const cfg_obj_t *defserverobj = NULL;
- (void)cfg_map_get(options, "default-server", &defserverobj);
+ (void)cfg_map_get(options, CFG_CLAUSE_DEFAULT_SERVER,
+ &defserverobj);
if (defserverobj != NULL) {
servername = cfg_obj_asstring(defserverobj);
}
@@ -652,7 +654,7 @@ parse_config(const char *keyname, cfg_obj_t **configp) {
}
if (!key_only) {
- (void)cfg_map_get(config, "server", &servers);
+ (void)cfg_map_get(config, CFG_CLAUSE_SERVER, &servers);
if (servers != NULL) {
CFG_LIST_FOREACH(servers, elt) {
const char *name = NULL;
@@ -673,11 +675,12 @@ parse_config(const char *keyname, cfg_obj_t **configp) {
if (keyname != NULL) {
/* Was set on command line, do nothing. */
} else if (server != NULL) {
- DO("get key for server", cfg_map_get(server, "key", &defkey));
+ DO("get key for server",
+ cfg_map_get(server, CFG_CLAUSE_KEY, &defkey));
keyname = cfg_obj_asstring(defkey);
} else if (options != NULL) {
DO("get default key",
- cfg_map_get(options, "default-key", &defkey));
+ cfg_map_get(options, CFG_CLAUSE_DEFAULT_KEY, &defkey));
keyname = cfg_obj_asstring(defkey);
} else if (!key_only) {
fatal("no key for server and no default");
@@ -687,9 +690,10 @@ parse_config(const char *keyname, cfg_obj_t **configp) {
* Get the key's definition.
*/
if (key_only) {
- DO("get key", cfg_map_get(config, "key", &key));
+ DO("get key", cfg_map_get(config, CFG_CLAUSE_KEY, &key));
} else {
- DO("get config key list", cfg_map_get(config, "key", &keys));
+ DO("get config key list",
+ cfg_map_get(config, CFG_CLAUSE_KEY, &keys));
bool match = false;
CFG_LIST_FOREACH(keys, elt) {
const char *name = NULL;
@@ -705,8 +709,8 @@ parse_config(const char *keyname, cfg_obj_t **configp) {
fatal("no key definition for name %s", keyname);
}
}
- (void)cfg_map_get(key, "secret", &secretobj);
- (void)cfg_map_get(key, "algorithm", &algorithmobj);
+ (void)cfg_map_get(key, CFG_CLAUSE_SECRET, &secretobj);
+ (void)cfg_map_get(key, CFG_CLAUSE_ALGORITHM, &algorithmobj);
if (secretobj == NULL || algorithmobj == NULL) {
fatal("key must have algorithm and secret");
}
@@ -743,10 +747,11 @@ parse_config(const char *keyname, cfg_obj_t **configp) {
/* Was set on command line, do nothing. */
} else {
if (server != NULL) {
- (void)cfg_map_get(server, "port", &defport);
+ (void)cfg_map_get(server, CFG_CLAUSE_PORT, &defport);
}
if (defport == NULL && options != NULL) {
- (void)cfg_map_get(options, "default-port", &defport);
+ (void)cfg_map_get(options, CFG_CLAUSE_DEFAULT_PORT,
+ &defport);
}
}
if (defport != NULL) {
@@ -759,7 +764,7 @@ parse_config(const char *keyname, cfg_obj_t **configp) {
}
if (server != NULL) {
- result = cfg_map_get(server, "addresses", &addresses);
+ result = cfg_map_get(server, CFG_CLAUSE_ADDRESSES, &addresses);
} else {
result = ISC_R_NOTFOUND;
}
@@ -816,7 +821,7 @@ parse_config(const char *keyname, cfg_obj_t **configp) {
if (!local4set && server != NULL) {
address = NULL;
- cfg_map_get(server, "source-address", &address);
+ cfg_map_get(server, CFG_CLAUSE_SOURCE_ADDRESS, &address);
if (address != NULL) {
local4 = *cfg_obj_assockaddr(address);
local4set = true;
@@ -824,7 +829,8 @@ parse_config(const char *keyname, cfg_obj_t **configp) {
}
if (!local4set && options != NULL) {
address = NULL;
- cfg_map_get(options, "default-source-address", &address);
+ cfg_map_get(options, CFG_CLAUSE_DEFAULT_SOURCE_ADDRESS,
+ &address);
if (address != NULL) {
local4 = *cfg_obj_assockaddr(address);
local4set = true;
@@ -833,7 +839,7 @@ parse_config(const char *keyname, cfg_obj_t **configp) {
if (!local6set && server != NULL) {
address = NULL;
- cfg_map_get(server, "source-address-v6", &address);
+ cfg_map_get(server, CFG_CLAUSE_SOURCE_ADDRESS_V6, &address);
if (address != NULL) {
local6 = *cfg_obj_assockaddr(address);
local6set = true;
@@ -841,7 +847,8 @@ parse_config(const char *keyname, cfg_obj_t **configp) {
}
if (!local6set && options != NULL) {
address = NULL;
- cfg_map_get(options, "default-source-address-v6", &address);
+ cfg_map_get(options, CFG_CLAUSE_DEFAULT_SOURCE_ADDRESS_V6,
+ &address);
if (address != NULL) {
local6 = *cfg_obj_assockaddr(address);
local6set = true;
diff --git a/lib/isc/symtab.c b/lib/isc/symtab.c
index fcd192be60..3bb0465e19 100644
--- a/lib/isc/symtab.c
+++ b/lib/isc/symtab.c
@@ -141,7 +141,8 @@ static inline uint32_t
elt_hash(elt_t *restrict elt, bool case_sensitive) {
const uint8_t *ptr = elt->key;
size_t len = elt->size;
- return fx_hash_bytes(0, ptr, len, case_sensitive);
+ return fx_add_to_hash(fx_hash_bytes(0, ptr, len, case_sensitive),
+ elt->type);
}
isc_result_t
diff --git a/lib/isccfg/aclconf.c b/lib/isccfg/aclconf.c
index 5010a017b5..1237fd50a5 100644
--- a/lib/isccfg/aclconf.c
+++ b/lib/isccfg/aclconf.c
@@ -27,6 +27,7 @@
#include <dns/iptable.h>
#include <isccfg/aclconf.h>
+#include <isccfg/clause.h>
#include <isccfg/namedconf.h>
#define LOOP_MAGIC ISC_MAGIC('L', 'O', 'O', 'P')
@@ -79,7 +80,7 @@ static isc_result_t
get_acl_def(const cfg_obj_t *cctx, const char *name, const cfg_obj_t **ret) {
const cfg_obj_t *acls = NULL;
- RETERR(cfg_map_get(cctx, "acl", &acls));
+ RETERR(cfg_map_get(cctx, CFG_CLAUSE_ACL, &acls));
CFG_LIST_FOREACH(acls, elt) {
const cfg_obj_t *acl = cfg_listelt_value(elt);
const char *aclname =
diff --git a/lib/isccfg/check.c b/lib/isccfg/check.c
index f8434aeb61..30087e0d50 100644
--- a/lib/isccfg/check.c
+++ b/lib/isccfg/check.c
@@ -65,6 +65,7 @@
#include <isccfg/aclconf.h>
#include <isccfg/cfg.h>
#include <isccfg/check.h>
+#include <isccfg/clause.h>
#include <isccfg/grammar.h>
#include <isccfg/kaspconf.h>
#include <isccfg/namedconf.h>
@@ -86,7 +87,8 @@ keydirexist(const cfg_obj_t *zcgf, const char *optname, dns_name_t *zname,
isc_mem_t *mctx);
static const cfg_obj_t *
-find_maplist(const cfg_obj_t *config, const char *listname, const char *name);
+find_maplist(const cfg_obj_t *config, enum cfg_clause listname,
+ const char *name);
static isc_result_t
validate_remotes(const cfg_obj_t *obj, const cfg_obj_t *voptions,
@@ -193,7 +195,8 @@ check_order(const cfg_obj_t *options) {
isc_result_t tresult;
const cfg_obj_t *obj = NULL;
- if (cfg_map_get(options, "rrset-order", &obj) != ISC_R_SUCCESS) {
+ if (cfg_map_get(options, CFG_CLAUSE_RRSET_ORDER, &obj) != ISC_R_SUCCESS)
+ {
return result;
}
@@ -218,7 +221,7 @@ check_dual_stack(const cfg_obj_t *options) {
isc_result_t result = ISC_R_SUCCESS;
isc_result_t tresult;
- (void)cfg_map_get(options, "dual-stack-servers", &alternates);
+ (void)cfg_map_get(options, CFG_CLAUSE_DUAL_STACK_SERVERS, &alternates);
if (alternates == NULL) {
return ISC_R_SUCCESS;
@@ -282,7 +285,8 @@ validate_tls(const cfg_obj_t *config, const cfg_obj_t *obj, const char *str) {
}
if (strcasecmp(str, "ephemeral") != 0) {
- const cfg_obj_t *tlsmap = find_maplist(config, "tls", str);
+ const cfg_obj_t *tlsmap = find_maplist(config, CFG_CLAUSE_TLS,
+ str);
if (tlsmap == NULL) {
cfg_obj_log(obj, ISC_LOG_ERROR,
@@ -301,8 +305,8 @@ check_forward(const cfg_obj_t *config, const cfg_obj_t *options,
const cfg_obj_t *forwarders = NULL;
const cfg_obj_t *faddresses = NULL;
- (void)cfg_map_get(options, "forward", &forward);
- (void)cfg_map_get(options, "forwarders", &forwarders);
+ (void)cfg_map_get(options, CFG_CLAUSE_FORWARD, &forward);
+ (void)cfg_map_get(options, CFG_CLAUSE_FORWARDERS, &forwarders);
if (forwarders != NULL && global != NULL) {
const char *file = cfg_obj_file(global);
@@ -452,7 +456,7 @@ exists(const cfg_obj_t *obj, const char *name, int value, isc_symtab_t *symtab,
}
static isc_result_t
-checkacl(const char *aclname, cfg_aclconfctx_t *aclctx,
+checkacl(enum cfg_clause aclname, cfg_aclconfctx_t *aclctx,
const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
const cfg_obj_t *config, isc_mem_t *mctx) {
isc_result_t result = ISC_R_SUCCESS;
@@ -469,7 +473,7 @@ checkacl(const char *aclname, cfg_aclconfctx_t *aclctx,
}
if (config != NULL && aclobj == NULL) {
options = NULL;
- cfg_map_get(config, "options", &options);
+ cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
if (options != NULL) {
cfg_map_get(options, aclname, &aclobj);
}
@@ -482,9 +486,7 @@ checkacl(const char *aclname, cfg_aclconfctx_t *aclctx,
dns_acl_detach(&acl);
}
- if (strcasecmp(aclname, "allow-transfer") == 0 &&
- cfg_obj_istuple(aclobj))
- {
+ if (aclname == CFG_CLAUSE_ALLOW_TRANSFER && cfg_obj_istuple(aclobj)) {
const cfg_obj_t *obj_port = cfg_tuple_get(
cfg_tuple_get(aclobj, "port-transport"), "port");
const cfg_obj_t *obj_proto = cfg_tuple_get(
@@ -533,15 +535,15 @@ check_viewacls(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
isc_result_t result = ISC_R_SUCCESS, tresult;
int i = 0;
- static const char *acls[] = {
- "allow-proxy", "allow-proxy-on",
- "allow-query", "allow-query-on",
- "allow-query-cache", "allow-query-cache-on",
- "blackhole", "match-clients",
- "match-destinations", NULL
+ static const enum cfg_clause acls[] = {
+ CFG_CLAUSE_ALLOW_PROXY, CFG_CLAUSE_ALLOW_PROXY_ON,
+ CFG_CLAUSE_ALLOW_QUERY, CFG_CLAUSE_ALLOW_QUERY_ON,
+ CFG_CLAUSE_ALLOW_QUERY_CACHE, CFG_CLAUSE_ALLOW_QUERY_CACHE_ON,
+ CFG_CLAUSE_BLACKHOLE, CFG_CLAUSE_MATCH_CLIENTS,
+ CFG_CLAUSE_MATCH_DESTINATIONS,
};
- while (acls[i] != NULL) {
+ while (i < (int)ARRAY_SIZE(acls)) {
tresult = checkacl(acls[i++], aclctx, NULL, voptions, config,
mctx);
if (tresult != ISC_R_SUCCESS) {
@@ -572,16 +574,18 @@ check_dns64(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
int nbytes;
int i;
- static const char *acls[] = { "clients", "exclude", "mapped", NULL };
+ static const enum cfg_clause acls[] = { CFG_CLAUSE_CLIENTS,
+ CFG_CLAUSE_EXCLUDE,
+ CFG_CLAUSE_MAPPED };
if (voptions != NULL) {
- cfg_map_get(voptions, "dns64", &dns64);
+ cfg_map_get(voptions, CFG_CLAUSE_DNS64, &dns64);
}
if (config != NULL && dns64 == NULL) {
options = NULL;
- cfg_map_get(config, "options", &options);
+ cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
if (options != NULL) {
- cfg_map_get(options, "dns64", &dns64);
+ cfg_map_get(options, CFG_CLAUSE_DNS64, &dns64);
}
}
if (dns64 == NULL) {
@@ -615,7 +619,7 @@ check_dns64(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
continue;
}
- for (i = 0; acls[i] != NULL; i++) {
+ for (i = 0; i < (int)ARRAY_SIZE(acls); i++) {
obj = NULL;
(void)cfg_map_get(map, acls[i], &obj);
if (obj != NULL) {
@@ -634,7 +638,7 @@ check_dns64(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
}
obj = NULL;
- (void)cfg_map_get(map, "suffix", &obj);
+ (void)cfg_map_get(map, CFG_CLAUSE_SUFFIX, &obj);
if (obj != NULL) {
static const unsigned char zeros[16];
isc_netaddr_fromsockaddr(&sa, cfg_obj_assockaddr(obj));
@@ -673,10 +677,10 @@ check_dns64(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
} \
} while (0)
-#define CHECK_RRL_RATE(rate, def, max_rate, name) \
+#define CHECK_RRL_RATE(rate, def, max_rate, clause, name) \
do { \
obj = NULL; \
- mresult = cfg_map_get(map, name, &obj); \
+ mresult = cfg_map_get(map, clause, &obj); \
if (mresult == ISC_R_SUCCESS) { \
rate = cfg_obj_asuint32(obj); \
CHECK_RRL(rate <= max_rate, name " %d > %d", rate, \
@@ -702,13 +706,13 @@ check_ratelimit(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
int slip;
if (voptions != NULL) {
- cfg_map_get(voptions, "rate-limit", &map);
+ cfg_map_get(voptions, CFG_CLAUSE_RATE_LIMIT, &map);
}
if (config != NULL && map == NULL) {
options = NULL;
- cfg_map_get(config, "options", &options);
+ cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
if (options != NULL) {
- cfg_map_get(options, "rate-limit", &map);
+ cfg_map_get(options, CFG_CLAUSE_RATE_LIMIT, &map);
}
}
if (map == NULL) {
@@ -717,7 +721,7 @@ check_ratelimit(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
min_entries = 500;
obj = NULL;
- mresult = cfg_map_get(map, "min-table-size", &obj);
+ mresult = cfg_map_get(map, CFG_CLAUSE_MIN_TABLE_SIZE, &obj);
if (mresult == ISC_R_SUCCESS) {
min_entries = cfg_obj_asuint32(obj);
if (min_entries < 1) {
@@ -726,7 +730,7 @@ check_ratelimit(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
}
obj = NULL;
- mresult = cfg_map_get(map, "max-table-size", &obj);
+ mresult = cfg_map_get(map, CFG_CLAUSE_MAX_TABLE_SIZE, &obj);
if (mresult == ISC_R_SUCCESS) {
i = cfg_obj_asuint32(obj);
CHECK_RRL(i >= min_entries,
@@ -735,23 +739,28 @@ check_ratelimit(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
}
CHECK_RRL_RATE(responses_per_second, 0, DNS_RRL_MAX_RATE,
- "responses-per-second");
+ CFG_CLAUSE_RESPONSES_PER_SECOND, "responses-per-second");
CHECK_RRL_RATE(referrals_per_second, responses_per_second,
- DNS_RRL_MAX_RATE, "referrals-per-second");
+ DNS_RRL_MAX_RATE, CFG_CLAUSE_REFERRALS_PER_SECOND,
+ "referrals-per-second");
CHECK_RRL_RATE(nodata_per_second, responses_per_second,
- DNS_RRL_MAX_RATE, "nodata-per-second");
+ DNS_RRL_MAX_RATE, CFG_CLAUSE_NODATA_PER_SECOND,
+ "nodata-per-second");
CHECK_RRL_RATE(nxdomains_per_second, responses_per_second,
- DNS_RRL_MAX_RATE, "nxdomains-per-second");
+ DNS_RRL_MAX_RATE, CFG_CLAUSE_NXDOMAINS_PER_SECOND,
+ "nxdomains-per-second");
CHECK_RRL_RATE(errors_per_second, responses_per_second,
- DNS_RRL_MAX_RATE, "errors-per-second");
+ DNS_RRL_MAX_RATE, CFG_CLAUSE_ERRORS_PER_SECOND,
+ "errors-per-second");
- CHECK_RRL_RATE(all_per_second, 0, DNS_RRL_MAX_RATE, "all-per-second");
+ CHECK_RRL_RATE(all_per_second, 0, DNS_RRL_MAX_RATE,
+ CFG_CLAUSE_ALL_PER_SECOND, "all-per-second");
- CHECK_RRL_RATE(slip, 2, DNS_RRL_MAX_SLIP, "slip");
+ CHECK_RRL_RATE(slip, 2, DNS_RRL_MAX_SLIP, CFG_CLAUSE_SLIP, "slip");
obj = NULL;
- mresult = cfg_map_get(map, "window", &obj);
+ mresult = cfg_map_get(map, CFG_CLAUSE_WINDOW, &obj);
if (mresult == ISC_R_SUCCESS) {
i = cfg_obj_asuint32(obj);
CHECK_RRL(i >= 1 && i <= DNS_RRL_MAX_WINDOW,
@@ -759,14 +768,14 @@ check_ratelimit(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
}
obj = NULL;
- mresult = cfg_map_get(map, "qps-scale", &obj);
+ mresult = cfg_map_get(map, CFG_CLAUSE_QPS_SCALE, &obj);
if (mresult == ISC_R_SUCCESS) {
i = cfg_obj_asuint32(obj);
CHECK_RRL(i >= 1, "invalid 'qps-scale %d'%s", i, "");
}
obj = NULL;
- mresult = cfg_map_get(map, "ipv4-prefix-length", &obj);
+ mresult = cfg_map_get(map, CFG_CLAUSE_IPV4_PREFIX_LENGTH, &obj);
if (mresult == ISC_R_SUCCESS) {
i = cfg_obj_asuint32(obj);
CHECK_RRL(i >= 8 && i <= 32,
@@ -774,7 +783,7 @@ check_ratelimit(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
}
obj = NULL;
- mresult = cfg_map_get(map, "ipv6-prefix-length", &obj);
+ mresult = cfg_map_get(map, CFG_CLAUSE_IPV6_PREFIX_LENGTH, &obj);
if (mresult == ISC_R_SUCCESS) {
i = cfg_obj_asuint32(obj);
CHECK_RRL(i >= 16 && i <= DNS_RRL_MAX_PREFIX,
@@ -783,7 +792,7 @@ check_ratelimit(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
}
obj = NULL;
- (void)cfg_map_get(map, "exempt-clients", &obj);
+ (void)cfg_map_get(map, CFG_CLAUSE_EXEMPT_CLIENTS, &obj);
if (obj != NULL) {
dns_acl_t *acl = NULL;
isc_result_t tresult;
@@ -809,13 +818,14 @@ check_fetchlimit(const cfg_obj_t *voptions, const cfg_obj_t *config) {
double low, high, discount;
if (voptions != NULL) {
- cfg_map_get(voptions, "fetch-quota-params", &map);
+ cfg_map_get(voptions, CFG_CLAUSE_FETCH_QUOTA_PARAMS, &map);
}
if (config != NULL && map == NULL) {
options = NULL;
- cfg_map_get(config, "options", &options);
+ cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
if (options != NULL) {
- cfg_map_get(options, "fetch-quota-params", &map);
+ cfg_map_get(options, CFG_CLAUSE_FETCH_QUOTA_PARAMS,
+ &map);
}
}
if (map == NULL) {
@@ -870,17 +880,17 @@ check_recursionacls(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
const char *forview = " for view ";
int i = 0;
- static const char *acls[] = { "allow-recursion", "allow-recursion-on",
- NULL };
+ static const enum cfg_clause acls[] = { CFG_CLAUSE_ALLOW_RECURSION,
+ CFG_CLAUSE_ALLOW_RECURSION_ON };
if (voptions != NULL) {
- cfg_map_get(voptions, "recursion", &obj);
+ cfg_map_get(voptions, CFG_CLAUSE_RECURSION, &obj);
}
if (obj == NULL && config != NULL) {
options = NULL;
- cfg_map_get(config, "options", &options);
+ cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
if (options != NULL) {
- cfg_map_get(options, "recursion", &obj);
+ cfg_map_get(options, CFG_CLAUSE_RECURSION, &obj);
}
}
if (obj == NULL) {
@@ -894,7 +904,7 @@ check_recursionacls(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
forview = "";
}
- for (i = 0; acls[i] != NULL; i++) {
+ for (i = 0; i < (int)ARRAY_SIZE(acls); i++) {
aclobj = options = NULL;
acl = NULL;
@@ -903,7 +913,7 @@ check_recursionacls(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
}
if (config != NULL && aclobj == NULL) {
options = NULL;
- cfg_map_get(config, "options", &options);
+ cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
if (options != NULL) {
cfg_map_get(options, acls[i], &aclobj);
}
@@ -927,7 +937,8 @@ check_recursionacls(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
cfg_obj_log(aclobj, ISC_LOG_WARNING,
"both \"recursion no;\" and "
"\"%s\" active%s%s",
- acls[i], forview, viewname);
+ cfg_clause_as_string[acls[i]], forview,
+ viewname);
}
if (acl != NULL) {
@@ -939,14 +950,14 @@ check_recursionacls(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
}
typedef struct {
- const char *name;
+ enum cfg_clause name;
unsigned int scale;
unsigned int max;
} intervaltable;
#ifdef HAVE_DNSTAP
typedef struct {
- const char *name;
+ enum cfg_clause name;
unsigned int min;
unsigned int max;
} fstrmtable;
@@ -986,7 +997,8 @@ kasp_name_allowed(const cfg_listelt_t *element) {
}
static const cfg_obj_t *
-find_maplist(const cfg_obj_t *config, const char *listname, const char *name) {
+find_maplist(const cfg_obj_t *config, enum cfg_clause listname,
+ const char *name) {
isc_result_t result = ISC_R_SUCCESS;
const cfg_obj_t *maplist = NULL;
@@ -1038,7 +1050,7 @@ check_listener(const cfg_obj_t *listener, const cfg_obj_t *config,
do_tls = true;
- tlsmap = find_maplist(config, "tls", tlsname);
+ tlsmap = find_maplist(config, CFG_CLAUSE_TLS, tlsname);
if (tlsmap == NULL) {
cfg_obj_log(tlsobj, ISC_LOG_ERROR,
"tls '%s' is not defined",
@@ -1060,7 +1072,7 @@ check_listener(const cfg_obj_t *listener, const cfg_obj_t *config,
result = ISC_R_FAILURE;
}
- http_server = find_maplist(config, "http", httpname);
+ http_server = find_maplist(config, CFG_CLAUSE_HTTP, httpname);
if (http_server == NULL && strcasecmp(httpname, "default") != 0)
{
cfg_obj_log(httpobj, ISC_LOG_ERROR,
@@ -1142,16 +1154,17 @@ check_listeners(const cfg_obj_t *list, const cfg_obj_t *config,
}
static void
-check_range_uint32(const cfg_obj_t *map, isc_result_t *result, const char *name,
- uint32_t lower, uint32_t upper) {
+check_range_uint32(const cfg_obj_t *map, isc_result_t *result,
+ enum cfg_clause name, uint32_t lower, uint32_t upper) {
const cfg_obj_t *obj = NULL;
(void)cfg_map_get(map, name, &obj);
if (obj != NULL) {
uint32_t value = cfg_obj_asuint32(obj);
if (value < lower || value > upper) {
cfg_obj_log(obj, ISC_LOG_ERROR,
- "%s '%u' out of range (%u..%u)", name,
- value, lower, upper);
+ "%s '%u' out of range (%u..%u)",
+ cfg_clause_as_string[name], value, lower,
+ upper);
if (*result == ISC_R_SUCCESS) {
*result = ISC_R_RANGE;
}
@@ -1160,7 +1173,7 @@ check_range_uint32(const cfg_obj_t *map, isc_result_t *result, const char *name,
}
static isc_result_t
-check_port(const cfg_obj_t *options, const char *type, in_port_t *portp) {
+check_port(const cfg_obj_t *options, enum cfg_clause type, in_port_t *portp) {
const cfg_obj_t *portobj = NULL;
isc_result_t result = ISC_R_SUCCESS;
@@ -1184,13 +1197,13 @@ check_delegation_ttl(const cfg_obj_t *options) {
uint32_t min = 0, max = 0;
const cfg_obj_t *obj = NULL;
- (void)cfg_map_get(options, "min-delegation-ttl", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_MIN_DELEGATION_TTL, &obj);
if (obj != NULL) {
min = cfg_obj_asduration(obj);
}
obj = NULL;
- (void)cfg_map_get(options, "max-delegation-ttl", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_MAX_DELEGATION_TTL, &obj);
if (obj != NULL) {
max = cfg_obj_asduration(obj);
}
@@ -1220,9 +1233,9 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
dns_keystorelist_t kslist;
const char *ccalg = "siphash24";
cfg_aclconfctx_t *aclctx = NULL;
- static const char *sources[] = {
- "query-source",
- "query-source-v6",
+ static const enum cfg_clause sources[] = {
+ CFG_CLAUSE_QUERY_SOURCE,
+ CFG_CLAUSE_QUERY_SOURCE_V6,
};
/*
@@ -1230,22 +1243,35 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
* (scale * value) <= UINT32_MAX
*/
static intervaltable intervals[] = {
- { "interface-interval", 60, 28 * 24 * 60 }, /* 28 days */
- { "max-transfer-idle-in", 60, 28 * 24 * 60 }, /* 28 days */
- { "max-transfer-idle-out", 60, 28 * 24 * 60 }, /* 28 days */
- { "max-transfer-time-in", 60, 28 * 24 * 60 }, /* 28 days */
- { "max-transfer-time-out", 60, 28 * 24 * 60 }, /* 28 days */
+ { CFG_CLAUSE_INTERFACE_INTERVAL, 60, 28 * 24 * 60 }, /* 28 days
+ */
+ { CFG_CLAUSE_MAX_TRANSFER_IDLE_IN, 60, 28 * 24 * 60 }, /* 28
+ days
+ */
+ { CFG_CLAUSE_MAX_TRANSFER_IDLE_OUT, 60, 28 * 24 * 60 }, /* 28
+ days
+ */
+ { CFG_CLAUSE_MAX_TRANSFER_TIME_IN, 60, 28 * 24 * 60 }, /* 28
+ days
+ */
+ { CFG_CLAUSE_MAX_TRANSFER_TIME_OUT, 60, 28 * 24 * 60 }, /* 28
+ days
+ */
/* minimum and maximum cache and negative cache TTLs */
- { "min-cache-ttl", 1, MAX_MIN_CACHE_TTL }, /* 90 secs */
- { "max-cache-ttl", 1, UINT32_MAX }, /* no limit */
- { "min-ncache-ttl", 1, MAX_MIN_NCACHE_TTL }, /* 90 secs */
- { "max-ncache-ttl", 1, MAX_MAX_NCACHE_TTL }, /* 7 days */
+ { CFG_CLAUSE_MIN_CACHE_TTL, 1, MAX_MIN_CACHE_TTL }, /* 90 secs
+ */
+ { CFG_CLAUSE_MAX_CACHE_TTL, 1, UINT32_MAX }, /* no limit */
+ { CFG_CLAUSE_MIN_NCACHE_TTL, 1, MAX_MIN_NCACHE_TTL }, /* 90 secs
+ */
+ { CFG_CLAUSE_MAX_NCACHE_TTL, 1, MAX_MAX_NCACHE_TTL }, /* 7 days
+ */
};
- static const char *server_contact[] = { "empty-server", "empty-contact",
- "dns64-server", "dns64-contact",
- NULL };
+ static const enum cfg_clause server_contact[] = {
+ CFG_CLAUSE_EMPTY_SERVER, CFG_CLAUSE_EMPTY_CONTACT,
+ CFG_CLAUSE_DNS64_SERVER, CFG_CLAUSE_DNS64_CONTACT
+ };
#ifndef IOV_MAX
/*
@@ -1257,19 +1283,21 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
#ifdef HAVE_DNSTAP
static fstrmtable fstrm[] = {
- { "fstrm-set-buffer-hint", FSTRM_IOTHR_BUFFER_HINT_MIN,
+ { CFG_CLAUSE_FSTRM_SET_BUFFER_HINT, FSTRM_IOTHR_BUFFER_HINT_MIN,
FSTRM_IOTHR_BUFFER_HINT_MAX },
- { "fstrm-set-flush-timeout", FSTRM_IOTHR_FLUSH_TIMEOUT_MIN,
+ { CFG_CLAUSE_FSTRM_SET_FLUSH_TIMEOUT,
+ FSTRM_IOTHR_FLUSH_TIMEOUT_MIN,
FSTRM_IOTHR_FLUSH_TIMEOUT_MAX },
- { "fstrm-set-input-queue-size",
+ { CFG_CLAUSE_FSTRM_SET_INPUT_QUEUE_SIZE,
FSTRM_IOTHR_INPUT_QUEUE_SIZE_MIN,
FSTRM_IOTHR_INPUT_QUEUE_SIZE_MAX },
- { "fstrm-set-output-notify-threshold",
+ { CFG_CLAUSE_FSTRM_SET_OUTPUT_NOTIFY_THRESHOLD,
FSTRM_IOTHR_QUEUE_NOTIFY_THRESHOLD_MIN, 0 },
- { "fstrm-set-output-queue-size",
+ { CFG_CLAUSE_FSTRM_SET_OUTPUT_QUEUE_SIZE,
FSTRM_IOTHR_OUTPUT_QUEUE_SIZE_MIN,
FSTRM_IOTHR_OUTPUT_QUEUE_SIZE_MAX },
- { "fstrm-set-reopen-interval", FSTRM_IOTHR_REOPEN_INTERVAL_MIN,
+ { CFG_CLAUSE_FSTRM_SET_REOPEN_INTERVAL,
+ FSTRM_IOTHR_REOPEN_INTERVAL_MIN,
FSTRM_IOTHR_REOPEN_INTERVAL_MAX }
};
#endif /* ifdef HAVE_DNSTAP */
@@ -1278,19 +1306,19 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
/*
* Check port values, and record "port" for later use.
*/
- tresult = check_port(options, "port", &dnsport);
+ tresult = check_port(options, CFG_CLAUSE_PORT, &dnsport);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
- tresult = check_port(options, "tls-port", NULL);
+ tresult = check_port(options, CFG_CLAUSE_TLS_PORT, NULL);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
- tresult = check_port(options, "http-port", NULL);
+ tresult = check_port(options, CFG_CLAUSE_HTTP_PORT, NULL);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
- tresult = check_port(options, "https-port", NULL);
+ tresult = check_port(options, CFG_CLAUSE_HTTPS_PORT, NULL);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
@@ -1345,12 +1373,13 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
if (val > intervals[i].max) {
cfg_obj_log(obj, ISC_LOG_ERROR,
"%s '%u' is out of range (0..%u)",
- intervals[i].name, val, intervals[i].max);
+ cfg_clause_as_string[intervals[i].name],
+ val, intervals[i].max);
result = ISC_R_RANGE;
} else if (val > (UINT32_MAX / intervals[i].scale)) {
- cfg_obj_log(obj, ISC_LOG_ERROR,
- "%s '%d' is out of range",
- intervals[i].name, val);
+ cfg_obj_log(
+ obj, ISC_LOG_ERROR, "%s '%d' is out of range",
+ cfg_clause_as_string[intervals[i].name], val);
result = ISC_R_RANGE;
}
}
@@ -1361,7 +1390,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
ISC_LIST_INIT(kslist);
obj = NULL;
- (void)cfg_map_get(options, "key-store", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_KEY_STORE, &obj);
if (obj != NULL) {
if (optlevel != optlevel_config) {
cfg_obj_log(obj, ISC_LOG_ERROR,
@@ -1393,8 +1422,8 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
}
kopt = cfg_tuple_get(kconfig, "options");
- if (cfg_map_get(kopt, "directory", &kobj) ==
- ISC_R_SUCCESS)
+ if (cfg_map_get(kopt, CFG_CLAUSE_DIRECTORY,
+ &kobj) == ISC_R_SUCCESS)
{
val = cfg_obj_asstring(kobj);
ret = isc_file_isdirectory(val);
@@ -1454,7 +1483,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
* Check dnssec-policy.
*/
obj = NULL;
- (void)cfg_map_get(options, "dnssec-policy", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_DNSSEC_POLICY, &obj);
if (obj != NULL) {
bool bad_kasp = false;
bool bad_name = false;
@@ -1539,7 +1568,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
* Other checks.
*/
obj = NULL;
- cfg_map_get(options, "max-rsa-exponent-size", &obj);
+ cfg_map_get(options, CFG_CLAUSE_MAX_RSA_EXPONENT_SIZE, &obj);
if (obj != NULL) {
uint32_t val;
@@ -1554,7 +1583,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
}
obj = NULL;
- (void)cfg_map_get(options, "preferred-glue", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_PREFERRED_GLUE, &obj);
if (obj != NULL) {
str = cfg_obj_asstring(obj);
if (strcasecmp(str, "a") != 0 && strcasecmp(str, "aaaa") != 0 &&
@@ -1570,7 +1599,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
* Set supported DNSSEC algorithms.
*/
obj = NULL;
- (void)cfg_map_get(options, "disable-algorithms", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_DISABLE_ALGORITHMS, &obj);
if (obj != NULL) {
CFG_LIST_FOREACH(obj, element) {
obj = cfg_listelt_value(element);
@@ -1585,7 +1614,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
* Set supported DS digest types.
*/
obj = NULL;
- (void)cfg_map_get(options, "disable-ds-digests", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_DISABLE_DS_DIGESTS, &obj);
if (obj != NULL) {
CFG_LIST_FOREACH(obj, element) {
obj = cfg_listelt_value(element);
@@ -1602,7 +1631,8 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
*/
if (optlevel != optlevel_zone) {
obj = NULL;
- (void)cfg_map_get(options, "send-report-channel", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_SEND_REPORT_CHANNEL,
+ &obj);
if (obj != NULL) {
str = cfg_obj_asstring(obj);
tresult = check_name(str);
@@ -1619,15 +1649,17 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
/*
* Check server/contacts for syntactic validity.
*/
- for (i = 0; server_contact[i] != NULL; i++) {
+ for (i = 0; i < ARRAY_SIZE(server_contact); i++) {
obj = NULL;
(void)cfg_map_get(options, server_contact[i], &obj);
if (obj != NULL) {
str = cfg_obj_asstring(obj);
if (check_name(str) != ISC_R_SUCCESS) {
- cfg_obj_log(obj, ISC_LOG_ERROR,
- "%s: invalid name '%s'",
- server_contact[i], str);
+ cfg_obj_log(
+ obj, ISC_LOG_ERROR,
+ "%s: invalid name '%s'",
+ cfg_clause_as_string[server_contact[i]],
+ str);
if (result == ISC_R_SUCCESS) {
result = ISC_R_FAILURE;
}
@@ -1639,7 +1671,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
* Check empty zone configuration.
*/
obj = NULL;
- (void)cfg_map_get(options, "disable-empty-zone", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_DISABLE_EMPTY_ZONE, &obj);
CFG_LIST_FOREACH(obj, element) {
obj = cfg_listelt_value(element);
str = cfg_obj_asstring(obj);
@@ -1658,7 +1690,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
* 1024 bytes should be big enough.
*/
obj = NULL;
- (void)cfg_map_get(options, "server-id", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_SERVER_ID, &obj);
if (obj != NULL && cfg_obj_isstring(obj) &&
strlen(cfg_obj_asstring(obj)) > 1024U)
{
@@ -1670,7 +1702,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
}
obj = NULL;
- (void)cfg_map_get(options, "nta-lifetime", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_NTA_LIFETIME, &obj);
if (obj != NULL) {
lifetime = cfg_obj_asduration(obj);
if (lifetime > 604800) { /* 7 days */
@@ -1689,7 +1721,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
}
obj = NULL;
- (void)cfg_map_get(options, "nta-recheck", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_NTA_RECHECK, &obj);
if (obj != NULL) {
uint32_t recheck = cfg_obj_asduration(obj);
if (recheck > 604800) { /* 7 days */
@@ -1710,7 +1742,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
}
obj = NULL;
- (void)cfg_map_get(options, "cookie-algorithm", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_COOKIE_ALGORITHM, &obj);
if (obj != NULL) {
ccalg = cfg_obj_asstring(obj);
if (strcasecmp(ccalg, "aes") == 0) {
@@ -1724,7 +1756,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
}
obj = NULL;
- (void)cfg_map_get(options, "cookie-secret", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_COOKIE_SECRET, &obj);
if (obj != NULL) {
unsigned char secret[32];
@@ -1787,19 +1819,20 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
if (fstrm[i].max != 0U) {
cfg_obj_log(obj, ISC_LOG_ERROR,
"%s '%u' out of range (%u..%u)",
- fstrm[i].name, value, fstrm[i].min,
- fstrm[i].max);
+ cfg_clause_as_string[fstrm[i].name],
+ value, fstrm[i].min, fstrm[i].max);
} else {
cfg_obj_log(obj, ISC_LOG_ERROR,
"%s out of range (%u < %u)",
- fstrm[i].name, value, fstrm[i].min);
+ cfg_clause_as_string[fstrm[i].name],
+ value, fstrm[i].min);
}
if (result == ISC_R_SUCCESS) {
result = ISC_R_RANGE;
}
}
- if (strcmp(fstrm[i].name, "fstrm-set-input-queue-size") == 0) {
+ if (fstrm[i].name == CFG_CLAUSE_FSTRM_SET_INPUT_QUEUE_SIZE) {
int bits = 0;
do {
bits += value & 0x1;
@@ -1808,7 +1841,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
if (bits != 1) {
cfg_obj_log(obj, ISC_LOG_ERROR,
"%s '%u' not a power-of-2",
- fstrm[i].name,
+ cfg_clause_as_string[fstrm[i].name],
cfg_obj_asuint32(obj));
if (result == ISC_R_SUCCESS) {
result = ISC_R_RANGE;
@@ -1819,7 +1852,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
/* Check that dnstap-ouput values are consistent */
obj = NULL;
- (void)cfg_map_get(options, "dnstap-output", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_DNSTAP_OUTPUT, &obj);
if (obj != NULL) {
const cfg_obj_t *obj2;
dns_dtmode_t dmode;
@@ -1878,7 +1911,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
#endif /* ifdef HAVE_DNSTAP */
obj = NULL;
- (void)cfg_map_get(options, "lmdb-mapsize", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_LMDB_MAPSIZE, &obj);
if (obj != NULL) {
uint64_t mapsize = cfg_obj_asuint64(obj);
@@ -1904,7 +1937,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
}
obj = NULL;
- (void)cfg_map_get(options, "max-ixfr-ratio", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_MAX_IXFR_RATIO, &obj);
if (obj != NULL && cfg_obj_ispercentage(obj)) {
uint32_t percent = cfg_obj_aspercentage(obj);
if (percent == 0) {
@@ -1922,7 +1955,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
}
obj = NULL;
- (void)cfg_map_get(options, "check-names", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_CHECK_NAMES, &obj);
if (obj != NULL && !cfg_obj_islist(obj)) {
obj = NULL;
}
@@ -1996,7 +2029,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
}
obj = NULL;
- (void)cfg_map_get(options, "stale-refresh-time", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_STALE_REFRESH_TIME, &obj);
if (obj != NULL) {
uint32_t refresh_time = cfg_obj_asduration(obj);
if (refresh_time > 0 && refresh_time < 30) {
@@ -2009,7 +2042,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
cfg_aclconfctx_create(mctx, &aclctx);
obj = NULL;
- (void)cfg_map_get(options, "sig0checks-quota-exempt", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_SIG0CHECKS_QUOTA_EXEMPT, &obj);
if (obj != NULL) {
dns_acl_t *acl = NULL;
@@ -2024,7 +2057,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
}
obj = NULL;
- (void)cfg_map_get(options, "listen-on", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_LISTEN_ON, &obj);
if (obj != NULL) {
INSIST(config != NULL);
tresult = check_listeners(obj, config, aclctx, mctx);
@@ -2034,7 +2067,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
}
obj = NULL;
- (void)cfg_map_get(options, "listen-on-v6", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_LISTEN_ON_V6, &obj);
if (obj != NULL) {
INSIST(config != NULL);
tresult = check_listeners(obj, config, aclctx, mctx);
@@ -2043,10 +2076,11 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
}
}
- check_range_uint32(options, &result, "max-query-restarts", 1, 255);
+ check_range_uint32(options, &result, CFG_CLAUSE_MAX_QUERY_RESTARTS, 1,
+ 255);
obj = NULL;
- (void)cfg_map_get(options, "prefetch", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_PREFETCH, &obj);
if (obj != NULL) {
const cfg_obj_t *trigger = cfg_tuple_get(obj, "trigger");
const cfg_obj_t *eligible = cfg_tuple_get(obj, "eligible");
@@ -2076,9 +2110,11 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
}
}
- check_range_uint32(options, &result, "edns-udp-size", 512, 4096);
- check_range_uint32(options, &result, "max-udp-size", 512, 4096);
- check_range_uint32(options, &result, "nocookie-udp-size", 128,
+ check_range_uint32(options, &result, CFG_CLAUSE_EDNS_UDP_SIZE, 512,
+ 4096);
+ check_range_uint32(options, &result, CFG_CLAUSE_MAX_UDP_SIZE, 512,
+ 4096);
+ check_range_uint32(options, &result, CFG_CLAUSE_NOCOOKIE_UDP_SIZE, 128,
UINT32_MAX);
if (aclctx != NULL) {
@@ -2092,7 +2128,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
* Check "remote-servers" style list.
*/
static isc_result_t
-check_remoteserverlist(const cfg_obj_t *cctx, const char *list,
+check_remoteserverlist(const cfg_obj_t *cctx, enum cfg_clause list,
isc_symtab_t *symtab, isc_mem_t *mctx) {
isc_symvalue_t symvalue;
isc_result_t result = ISC_R_SUCCESS, tresult;
@@ -2130,7 +2166,8 @@ check_remoteserverlist(const cfg_obj_t *cctx, const char *list,
cfg_obj_log(obj, ISC_LOG_ERROR,
"%s list '%s' is duplicated: "
"also defined at %s:%u",
- list, name, file, line);
+ cfg_clause_as_string[list], name, file,
+ line);
isc_mem_free(mctx, tmp);
result = tresult;
break;
@@ -2155,20 +2192,24 @@ check_remoteserverlists(const cfg_obj_t *cctx, isc_mem_t *mctx) {
isc_symtab_create(mctx, freekey, mctx, false, &symtab);
- tresult = check_remoteserverlist(cctx, "remote-servers", symtab, mctx);
+ tresult = check_remoteserverlist(cctx, CFG_CLAUSE_REMOTE_SERVERS,
+ symtab, mctx);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
/* parental-agents, primaries, masters are treated as synonyms */
- tresult = check_remoteserverlist(cctx, "parental-agents", symtab, mctx);
+ tresult = check_remoteserverlist(cctx, CFG_CLAUSE_PARENTAL_AGENTS,
+ symtab, mctx);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
- tresult = check_remoteserverlist(cctx, "primaries", symtab, mctx);
+ tresult = check_remoteserverlist(cctx, CFG_CLAUSE_PRIMARIES, symtab,
+ mctx);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
- tresult = check_remoteserverlist(cctx, "masters", symtab, mctx);
+ tresult = check_remoteserverlist(cctx, CFG_CLAUSE_MASTERS, symtab,
+ mctx);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
@@ -2216,7 +2257,7 @@ check_httpserver(const cfg_obj_t *http, isc_symtab_t *symtab) {
}
/* Check endpoints are valid */
- tresult = cfg_map_get(http, "endpoints", &eps);
+ tresult = cfg_map_get(http, CFG_CLAUSE_ENDPOINTS, &eps);
if (tresult == ISC_R_SUCCESS) {
bool empty = true;
CFG_LIST_FOREACH(eps, elt) {
@@ -2253,7 +2294,7 @@ check_httpservers(const cfg_obj_t *config, isc_mem_t *mctx) {
isc_symtab_create(mctx, NULL, NULL, false, &symtab);
- result = cfg_map_get(config, "http", &obj);
+ result = cfg_map_get(config, CFG_CLAUSE_HTTP, &obj);
if (result != ISC_R_SUCCESS) {
result = ISC_R_SUCCESS;
goto done;
@@ -2314,8 +2355,8 @@ check_tls_definition(const cfg_obj_t *tlsobj, const char *name,
}
}
- (void)cfg_map_get(tlsobj, "key-file", &tls_key);
- (void)cfg_map_get(tlsobj, "cert-file", &tls_cert);
+ (void)cfg_map_get(tlsobj, CFG_CLAUSE_KEY_FILE, &tls_key);
+ (void)cfg_map_get(tlsobj, CFG_CLAUSE_CERT_FILE, &tls_cert);
if ((tls_key == NULL && tls_cert != NULL) ||
(tls_cert == NULL && tls_key != NULL))
{
@@ -2327,7 +2368,7 @@ check_tls_definition(const cfg_obj_t *tlsobj, const char *name,
}
/* Check protocols are valid */
- tresult = cfg_map_get(tlsobj, "protocols", &tls_proto_list);
+ tresult = cfg_map_get(tlsobj, CFG_CLAUSE_PROTOCOLS, &tls_proto_list);
if (tresult == ISC_R_SUCCESS) {
INSIST(tls_proto_list != NULL);
CFG_LIST_FOREACH(tls_proto_list, proto) {
@@ -2375,7 +2416,7 @@ check_tls_definition(const cfg_obj_t *tlsobj, const char *name,
}
/* Check cipher list string is valid */
- tresult = cfg_map_get(tlsobj, "ciphers", &tls_ciphers);
+ tresult = cfg_map_get(tlsobj, CFG_CLAUSE_CIPHERS, &tls_ciphers);
if (tresult == ISC_R_SUCCESS) {
const char *ciphers = cfg_obj_asstring(tls_ciphers);
if (!isc_tls_cipherlist_valid(ciphers)) {
@@ -2389,7 +2430,8 @@ check_tls_definition(const cfg_obj_t *tlsobj, const char *name,
}
/* Check if the cipher suites string is valid */
- tresult = cfg_map_get(tlsobj, "cipher-suites", &tls_cipher_suites);
+ tresult = cfg_map_get(tlsobj, CFG_CLAUSE_CIPHER_SUITES,
+ &tls_cipher_suites);
if (tresult == ISC_R_SUCCESS) {
const char *cipher_suites = cfg_obj_asstring(tls_cipher_suites);
if (!isc_tls_cipher_suites_valid(cipher_suites)) {
@@ -2411,7 +2453,7 @@ check_tls_definitions(const cfg_obj_t *config, isc_mem_t *mctx) {
const cfg_obj_t *obj = NULL;
isc_symtab_t *symtab = NULL;
- result = cfg_map_get(config, "tls", &obj);
+ result = cfg_map_get(config, CFG_CLAUSE_TLS, &obj);
if (result != ISC_R_SUCCESS) {
result = ISC_R_SUCCESS;
return result;
@@ -2435,7 +2477,7 @@ check_tls_definitions(const cfg_obj_t *config, isc_mem_t *mctx) {
}
static isc_result_t
-get_remotes(const cfg_obj_t *cctx, const char *list, const char *name,
+get_remotes(const cfg_obj_t *cctx, enum cfg_clause list, const char *name,
const cfg_obj_t **ret) {
const cfg_obj_t *obj = NULL;
@@ -2461,19 +2503,19 @@ get_remoteservers_def(const char *name, const cfg_obj_t *cctx,
const cfg_obj_t **ret) {
isc_result_t result;
- result = get_remotes(cctx, "remote-servers", name, ret);
+ result = get_remotes(cctx, CFG_CLAUSE_REMOTE_SERVERS, name, ret);
if (result == ISC_R_SUCCESS) {
return result;
}
- result = get_remotes(cctx, "primaries", name, ret);
+ result = get_remotes(cctx, CFG_CLAUSE_PRIMARIES, name, ret);
if (result == ISC_R_SUCCESS) {
return result;
}
- result = get_remotes(cctx, "parental-agents", name, ret);
+ result = get_remotes(cctx, CFG_CLAUSE_PARENTAL_AGENTS, name, ret);
if (result == ISC_R_SUCCESS) {
return result;
}
- return get_remotes(cctx, "masters", name, ret);
+ return get_remotes(cctx, CFG_CLAUSE_MASTERS, name, ret);
}
static bool
@@ -2484,7 +2526,7 @@ lookup_key(const cfg_obj_t *config, const dns_name_t *keyname) {
return false;
}
- (void)cfg_map_get(config, "key", &keys);
+ (void)cfg_map_get(config, CFG_CLAUSE_KEY, &keys);
CFG_LIST_FOREACH(keys, elt) {
/*
* `key` are normalized TSIG which must be identified by
@@ -2563,7 +2605,7 @@ validate_remotes_tls(const cfg_obj_t *config, const cfg_obj_t *tls) {
if (strcasecmp(str, "ephemeral") != 0) {
const cfg_obj_t *tlsmap = NULL;
- tlsmap = find_maplist(config, "tls", str);
+ tlsmap = find_maplist(config, CFG_CLAUSE_TLS, str);
if (tlsmap == NULL) {
cfg_obj_log(tls, ISC_LOG_ERROR,
"tls '%s' is not defined",
@@ -2845,9 +2887,10 @@ check_nonzero(const cfg_obj_t *options) {
const cfg_obj_t *obj = NULL;
unsigned int i;
- static const char *nonzero[] = { "max-retry-time", "min-retry-time",
- "max-refresh-time",
- "min-refresh-time" };
+ static const enum cfg_clause nonzero[] = {
+ CFG_CLAUSE_MAX_RETRY_TIME, CFG_CLAUSE_MIN_RETRY_TIME,
+ CFG_CLAUSE_MAX_REFRESH_TIME, CFG_CLAUSE_MIN_REFRESH_TIME
+ };
/*
* Check if value is zero.
*/
@@ -2857,7 +2900,7 @@ check_nonzero(const cfg_obj_t *options) {
cfg_obj_asuint32(obj) == 0)
{
cfg_obj_log(obj, ISC_LOG_ERROR, "'%s' must not be zero",
- nonzero[i]);
+ cfg_clause_as_string[nonzero[i]]);
result = ISC_R_FAILURE;
}
}
@@ -2873,7 +2916,7 @@ check_mirror_zone_notify(const cfg_obj_t *zoptions, const char *znamestr) {
bool notify_configuration_ok = true;
const cfg_obj_t *obj = NULL;
- (void)cfg_map_get(zoptions, "notify", &obj);
+ (void)cfg_map_get(zoptions, CFG_CLAUSE_NOTIFY, &obj);
if (obj == NULL) {
/*
* "notify" not set at zone level. This is fine.
@@ -2935,10 +2978,10 @@ check_recursion(const cfg_obj_t *config, const cfg_obj_t *voptions,
obj = NULL;
result = ISC_R_NOTFOUND;
if (voptions != NULL) {
- result = cfg_map_get(voptions, "recursion", &obj);
+ result = cfg_map_get(voptions, CFG_CLAUSE_RECURSION, &obj);
}
if (result != ISC_R_SUCCESS && goptions != NULL) {
- result = cfg_map_get(goptions, "recursion", &obj);
+ result = cfg_map_get(goptions, CFG_CLAUSE_RECURSION, &obj);
}
if (result == ISC_R_SUCCESS && !cfg_obj_asboolean(obj)) {
retval = false;
@@ -2952,10 +2995,12 @@ check_recursion(const cfg_obj_t *config, const cfg_obj_t *voptions,
obj = NULL;
result = ISC_R_NOTFOUND;
if (voptions != NULL) {
- result = cfg_map_get(voptions, "allow-recursion", &obj);
+ result = cfg_map_get(voptions, CFG_CLAUSE_ALLOW_RECURSION,
+ &obj);
}
if (result != ISC_R_SUCCESS && goptions != NULL) {
- result = cfg_map_get(goptions, "allow-recursion", &obj);
+ result = cfg_map_get(goptions, CFG_CLAUSE_ALLOW_RECURSION,
+ &obj);
}
if (result == ISC_R_SUCCESS) {
CHECK(cfg_acl_fromconfig(obj, config, aclctx, mctx, 0, &acl));
@@ -2992,8 +3037,8 @@ check_keydir(const cfg_obj_t *config, const cfg_obj_t *zconfig,
timenow = isc_time_now();
now = isc_time_seconds(&timenow);
- (void)cfg_map_get(config, "dnssec-policy", &kasps);
- (void)cfg_map_get(config, "key-store", &keystores);
+ (void)cfg_map_get(config, CFG_CLAUSE_DNSSEC_POLICY, &kasps);
+ (void)cfg_map_get(config, CFG_CLAUSE_KEY_STORE, &keystores);
ISC_LIST_INIT(kasplist);
ISC_LIST_INIT(kslist);
@@ -3285,8 +3330,8 @@ check_plugins(const cfg_obj_t *plugins, const cfg_obj_t *config,
*/
static isc_result_t
get_zoneopt(const cfg_obj_t *opts1, const cfg_obj_t *opts2,
- const cfg_obj_t *opts3, const cfg_obj_t *opts4, const char *name,
- const cfg_obj_t **objp) {
+ const cfg_obj_t *opts3, const cfg_obj_t *opts4,
+ enum cfg_clause name, const cfg_obj_t **objp) {
isc_result_t result = ISC_R_NOTFOUND;
REQUIRE(*objp == NULL);
@@ -3340,11 +3385,11 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
const cfg_clausedef_t *option = NULL;
const char *kaspname = NULL;
const char *dir = NULL;
- static const char *acls[] = {
- "allow-notify",
- "allow-transfer",
- "allow-update",
- "allow-update-forwarding",
+ static const enum cfg_clause acls[] = {
+ CFG_CLAUSE_ALLOW_NOTIFY,
+ CFG_CLAUSE_ALLOW_TRANSFER,
+ CFG_CLAUSE_ALLOW_UPDATE,
+ CFG_CLAUSE_ALLOW_UPDATE_FORWARDING,
};
znamestr = cfg_obj_asstring(cfg_tuple_get(zconfig, "name"));
@@ -3352,12 +3397,12 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
zoptions = cfg_tuple_get(zconfig, "options");
if (config != NULL) {
- cfg_map_get(config, "options", &goptions);
+ cfg_map_get(config, CFG_CLAUSE_OPTIONS, &goptions);
}
/* If the zone specifies a template, find it too */
- (void)cfg_map_get(config, "template", &templates);
- (void)cfg_map_get(zoptions, "template", &obj);
+ (void)cfg_map_get(config, CFG_CLAUSE_TEMPLATE, &templates);
+ (void)cfg_map_get(zoptions, CFG_CLAUSE_TEMPLATE, &obj);
if (obj != NULL) {
tmplname = cfg_obj_asstring(obj);
@@ -3379,13 +3424,14 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
}
}
- (void)cfg_map_get(zoptions, "in-view", &inviewobj);
+ (void)cfg_map_get(zoptions, CFG_CLAUSE_IN_VIEW, &inviewobj);
if (inviewobj != NULL) {
target = cfg_obj_asstring(inviewobj);
ztype = CFG_ZONE_INVIEW;
} else {
obj = NULL;
- (void)get_zoneopt(zoptions, toptions, NULL, NULL, "type", &obj);
+ (void)get_zoneopt(zoptions, toptions, NULL, NULL,
+ CFG_CLAUSE_TYPE, &obj);
if (obj == NULL) {
cfg_obj_log(zconfig, ISC_LOG_ERROR,
"zone '%s': type not present", znamestr);
@@ -3544,12 +3590,12 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
const cfg_obj_t *fwd = NULL;
unsigned int maxopts = 1;
- (void)cfg_map_get(zoptions, "forward", &fwd);
+ (void)cfg_map_get(zoptions, CFG_CLAUSE_FORWARD, &fwd);
if (fwd != NULL) {
maxopts++;
}
fwd = NULL;
- (void)cfg_map_get(zoptions, "forwarders", &fwd);
+ (void)cfg_map_get(zoptions, CFG_CLAUSE_FORWARDERS, &fwd);
if (fwd != NULL) {
maxopts++;
}
@@ -3580,7 +3626,7 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
*/
obj = NULL;
(void)get_zoneopt(zoptions, toptions, voptions, goptions,
- "dnssec-policy", &obj);
+ CFG_CLAUSE_DNSSEC_POLICY, &obj);
if (obj != NULL) {
kaspname = cfg_obj_asstring(obj);
if (strcmp(kaspname, "default") == 0) {
@@ -3594,7 +3640,8 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
kasp_inlinesigning = false;
} else {
const cfg_obj_t *kasps = NULL;
- (void)cfg_map_get(config, "dnssec-policy", &kasps);
+ (void)cfg_map_get(config, CFG_CLAUSE_DNSSEC_POLICY,
+ &kasps);
CFG_LIST_FOREACH(kasps, element) {
const cfg_obj_t *kobj = cfg_tuple_get(
cfg_listelt_value(element), "name");
@@ -3605,8 +3652,10 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
const cfg_obj_t *kopt = cfg_tuple_get(
cfg_listelt_value(element),
"options");
- if (cfg_map_get(kopt, "inline-signing",
- &inlinesigning) ==
+ if (cfg_map_get(
+ kopt,
+ CFG_CLAUSE_INLINE_SIGNING,
+ &inlinesigning) ==
ISC_R_SUCCESS)
{
kasp_inlinesigning =
@@ -3644,7 +3693,7 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
if (has_dnssecpolicy) {
obj = NULL;
(void)get_zoneopt(zoptions, toptions, voptions, goptions,
- "max-zone-ttl", &obj);
+ CFG_CLAUSE_MAX_ZONE_TTL, &obj);
if (obj != NULL) {
cfg_obj_log(obj, ISC_LOG_ERROR,
"zone '%s': option 'max-zone-ttl' "
@@ -3675,7 +3724,8 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
cfg_obj_log(obj, ISC_LOG_WARNING,
"option '%s' is not allowed "
"in '%s' zone '%s'%s%s%s",
- option->name, typestr, znamestr,
+ cfg_clause_as_string[option->name], typestr,
+ znamestr,
topt ? " (referencing template '" : "",
topt ? tmplname : "", topt ? "')" : "");
result = ISC_R_FAILURE;
@@ -3716,7 +3766,7 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
obj = NULL;
(void)get_zoneopt(zoptions, toptions, voptions, goptions,
- "notify", &obj);
+ CFG_CLAUSE_NOTIFY, &obj);
if (obj != NULL) {
if (cfg_obj_isboolean(obj)) {
donotify = cfg_obj_asboolean(obj);
@@ -3732,8 +3782,8 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
}
obj = NULL;
- (void)get_zoneopt(zoptions, toptions, NULL, NULL, "also-notify",
- &obj);
+ (void)get_zoneopt(zoptions, toptions, NULL, NULL,
+ CFG_CLAUSE_ALSO_NOTIFY, &obj);
if (obj != NULL && !donotify) {
cfg_obj_log(zoptions, ISC_LOG_WARNING,
"zone '%s': 'also-notify' set but "
@@ -3742,7 +3792,7 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
}
if (obj == NULL) {
(void)get_zoneopt(voptions, goptions, NULL, NULL,
- "also-notify", &obj);
+ CFG_CLAUSE_ALSO_NOTIFY, &obj);
}
if (obj != NULL && donotify) {
uint32_t count;
@@ -3756,7 +3806,7 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
obj = NULL;
(void)get_zoneopt(zoptions, toptions, voptions, goptions,
- "notify-cfg", &obj);
+ CFG_CLAUSE_NOTIFY_CFG, &obj);
if (obj != NULL) {
CFG_LIST_FOREACH(obj, element) {
const cfg_obj_t *map =
@@ -3807,18 +3857,18 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
!dns_name_isroot(zname)))
{
obj = NULL;
- (void)get_zoneopt(zoptions, toptions, NULL, NULL, "primaries",
- &obj);
+ (void)get_zoneopt(zoptions, toptions, NULL, NULL,
+ CFG_CLAUSE_PRIMARIES, &obj);
if (obj == NULL) {
/* If "primaries" was unset, check for "masters" */
(void)get_zoneopt(zoptions, toptions, NULL, NULL,
- "masters", &obj);
+ CFG_CLAUSE_MASTERS, &obj);
} else {
const cfg_obj_t *obj2 = NULL;
/* ...bug if it was set, "masters" must not be. */
(void)get_zoneopt(zoptions, toptions, NULL, NULL,
- "masters", &obj2);
+ CFG_CLAUSE_MASTERS, &obj2);
if (obj2 != NULL) {
cfg_obj_log(obj, ISC_LOG_ERROR,
"'primaries' and 'masters' cannot "
@@ -3856,7 +3906,7 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
if (ztype == CFG_ZONE_PRIMARY || ztype == CFG_ZONE_SECONDARY) {
obj = NULL;
(void)get_zoneopt(zoptions, toptions, NULL, NULL,
- "parental-agents", &obj);
+ CFG_CLAUSE_PARENTAL_AGENTS, &obj);
if (obj != NULL) {
uint32_t count;
tresult = validate_remotes(obj, voptions, config,
@@ -3897,9 +3947,9 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
const cfg_obj_t *au = NULL, *up = NULL;
(void)get_zoneopt(zoptions, toptions, NULL, NULL,
- "allow-update", &au);
+ CFG_CLAUSE_ALLOW_UPDATE, &au);
(void)get_zoneopt(zoptions, toptions, NULL, NULL,
- "update-policy", &up);
+ CFG_CLAUSE_UPDATE_POLICY, &up);
if (au != NULL && up != NULL) {
cfg_obj_log(au, ISC_LOG_ERROR,
@@ -3921,7 +3971,7 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
*/
if (au == NULL) {
(void)get_zoneopt(voptions, goptions, NULL, NULL,
- "allow-update", &au);
+ CFG_CLAUSE_ALLOW_UPDATE, &au);
}
if (up != NULL) {
@@ -3945,7 +3995,7 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
obj = NULL;
(void)get_zoneopt(zoptions, toptions, NULL, NULL,
- "inline-signing", &obj);
+ CFG_CLAUSE_INLINE_SIGNING, &obj);
if (obj != NULL) {
inline_signing = signing = cfg_obj_asboolean(obj);
} else if (has_dnssecpolicy) {
@@ -3972,7 +4022,7 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
obj = NULL;
(void)get_zoneopt(zoptions, toptions, NULL, NULL,
- "sig-signing-type", &obj);
+ CFG_CLAUSE_SIG_SIGNING_TYPE, &obj);
if (obj != NULL) {
uint32_t type = cfg_obj_asuint32(obj);
if (type < 0xff00U || type > 0xffffU) {
@@ -3986,7 +4036,7 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
obj = NULL;
(void)get_zoneopt(zoptions, toptions, NULL, NULL,
- "dnssec-loadkeys-interval", &obj);
+ CFG_CLAUSE_DNSSEC_LOADKEYS_INTERVAL, &obj);
if (obj != NULL && ztype == CFG_ZONE_SECONDARY && !signing) {
cfg_obj_log(obj, ISC_LOG_ERROR,
"dnssec-loadkeys-interval: requires "
@@ -4001,8 +4051,8 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
*/
obj = NULL;
if (root) {
- (void)get_zoneopt(voptions, goptions, NULL, NULL, "forwarders",
- &obj);
+ (void)get_zoneopt(voptions, goptions, NULL, NULL,
+ CFG_CLAUSE_FORWARDERS, &obj);
}
if (check_forward(config, zoptions, obj) != ISC_R_SUCCESS) {
result = ISC_R_FAILURE;
@@ -4016,15 +4066,15 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
(dns_name_isrfc1918(zname) || dns_name_isula(zname)))
{
obj = NULL;
- (void)get_zoneopt(zoptions, toptions, NULL, NULL, "forward",
- &obj);
+ (void)get_zoneopt(zoptions, toptions, NULL, NULL,
+ CFG_CLAUSE_FORWARD, &obj);
if (obj == NULL) {
/*
* Forward mode not explicitly configured
* at the zone or template level.
*/
(void)get_zoneopt(voptions, goptions, NULL, NULL,
- "forward", &obj);
+ CFG_CLAUSE_FORWARD, &obj);
if (obj == NULL ||
strcasecmp(cfg_obj_asstring(obj), "first") == 0)
{
@@ -4043,8 +4093,8 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
* Check validity of static stub server addresses.
*/
obj = NULL;
- (void)get_zoneopt(zoptions, toptions, NULL, NULL, "server-addresses",
- &obj);
+ (void)get_zoneopt(zoptions, toptions, NULL, NULL,
+ CFG_CLAUSE_SERVER_ADDRESSES, &obj);
if (ztype == CFG_ZONE_STATICSTUB && obj != NULL) {
CFG_LIST_FOREACH(obj, element) {
isc_sockaddr_t sa;
@@ -4067,7 +4117,8 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
* Check validity of static stub server names.
*/
obj = NULL;
- (void)get_zoneopt(zoptions, toptions, NULL, NULL, "server-names", &obj);
+ (void)get_zoneopt(zoptions, toptions, NULL, NULL,
+ CFG_CLAUSE_SERVER_NAMES, &obj);
if (zname != NULL && ztype == CFG_ZONE_STATICSTUB && obj != NULL) {
CFG_LIST_FOREACH(obj, element) {
const char *snamestr = NULL;
@@ -4100,8 +4151,8 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
}
obj = NULL;
- (void)get_zoneopt(zoptions, toptions, NULL, NULL, "send-report-channel",
- &obj);
+ (void)get_zoneopt(zoptions, toptions, NULL, NULL,
+ CFG_CLAUSE_SEND_REPORT_CHANNEL, &obj);
if (obj != NULL) {
const char *str = cfg_obj_asstring(obj);
dns_fixedname_t fad;
@@ -4130,7 +4181,7 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
*/
obj = NULL;
(void)get_zoneopt(zoptions, toptions, voptions, goptions,
- "key-directory", &obj);
+ CFG_CLAUSE_KEY_DIRECTORY, &obj);
if (obj != NULL) {
dir = cfg_obj_asstring(obj);
@@ -4181,7 +4232,7 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
if (ztype == CFG_ZONE_PRIMARY || ztype == CFG_ZONE_SECONDARY) {
obj = NULL;
(void)get_zoneopt(zoptions, toptions, NULL, NULL,
- "log-report-channel", &obj);
+ CFG_CLAUSE_LOG_REPORT_CHANNEL, &obj);
if (obj != NULL && cfg_obj_asboolean(obj) &&
dns_name_isroot(zname))
{
@@ -4209,13 +4260,14 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
*/
obj = NULL;
dlz = false;
- (void)get_zoneopt(zoptions, toptions, NULL, NULL, "dlz", &obj);
+ (void)get_zoneopt(zoptions, toptions, NULL, NULL, CFG_CLAUSE_DLZ, &obj);
if (obj != NULL) {
dlz = true;
}
obj = NULL;
- (void)get_zoneopt(zoptions, toptions, NULL, NULL, "database", &obj);
+ (void)get_zoneopt(zoptions, toptions, NULL, NULL, CFG_CLAUSE_DATABASE,
+ &obj);
if (dlz && obj != NULL) {
cfg_obj_log(zconfig, ISC_LOG_ERROR,
"zone '%s': cannot specify both 'dlz' "
@@ -4229,8 +4281,8 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
strcmp(ZONEDB_DEFAULT, cfg_obj_asstring(obj)) == 0))
{
const cfg_obj_t *fileobj = NULL;
- (void)get_zoneopt(zoptions, toptions, NULL, NULL, "file",
- &fileobj);
+ (void)get_zoneopt(zoptions, toptions, NULL, NULL,
+ CFG_CLAUSE_FILE, &fileobj);
if (fileobj == NULL &&
(ztype == CFG_ZONE_PRIMARY || ztype == CFG_ZONE_HINT ||
(ztype == CFG_ZONE_SECONDARY && inline_signing)))
@@ -4273,13 +4325,13 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
*/
obj = NULL;
tresult = get_zoneopt(zoptions, toptions, voptions, goptions,
- "masterfile-format", &obj);
+ CFG_CLAUSE_MASTERFILE_FORMAT, &obj);
if (tresult == ISC_R_SUCCESS &&
strcasecmp(cfg_obj_asstring(obj), "raw") == 0)
{
obj = NULL;
tresult = get_zoneopt(zoptions, toptions, voptions, goptions,
- "masterfile-style", &obj);
+ CFG_CLAUSE_MASTERFILE_STYLE, &obj);
if (tresult == ISC_R_SUCCESS) {
cfg_obj_log(obj, ISC_LOG_ERROR,
"zone '%s': 'masterfile-style' "
@@ -4294,7 +4346,7 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
obj = NULL;
(void)get_zoneopt(zoptions, toptions, voptions, goptions,
- "max-journal-size", &obj);
+ CFG_CLAUSE_MAX_JOURNAL_SIZE, &obj);
if (obj != NULL && cfg_obj_isuint64(obj)) {
uint64_t value = cfg_obj_asuint64(obj);
if (value > DNS_JOURNAL_SIZE_MAX) {
@@ -4310,7 +4362,7 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
obj = NULL;
(void)get_zoneopt(zoptions, toptions, voptions, goptions,
- "min-transfer-rate-in", &obj);
+ CFG_CLAUSE_MIN_TRANSFER_RATE_IN, &obj);
if (obj != NULL) {
uint32_t traffic_bytes =
cfg_obj_asuint32(cfg_tuple_get(obj, "traffic_bytes"));
@@ -4341,7 +4393,7 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
if ((flags & BIND_CHECK_PLUGINS) != 0 && zoptions != NULL) {
const cfg_obj_t *plugins = NULL;
- (void)cfg_map_get(zoptions, "plugin", &plugins);
+ (void)cfg_map_get(zoptions, CFG_CLAUSE_PLUGIN, &plugins);
tresult = check_plugins(plugins, config, aclctx, zname, mctx);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
@@ -4379,8 +4431,8 @@ isccfg_check_key(const cfg_obj_t *key) {
{ NULL, 0 }
};
- (void)cfg_map_get(key, "algorithm", &algobj);
- (void)cfg_map_get(key, "secret", &secretobj);
+ (void)cfg_map_get(key, CFG_CLAUSE_ALGORITHM, &algobj);
+ (void)cfg_map_get(key, CFG_CLAUSE_SECRET, &secretobj);
if (secretobj == NULL || algobj == NULL) {
cfg_obj_log(key, ISC_LOG_ERROR,
"key '%s' must have both 'secret' and "
@@ -4566,7 +4618,7 @@ keydirexist(const cfg_obj_t *zcfg, const char *optname, dns_name_t *zname,
* iff the zone is using the same policy, or has no policy.
*/
(void)cfg_map_get(cfg_tuple_get(exist, "options"),
- "dnssec-policy", &kasp);
+ CFG_CLAUSE_DNSSEC_POLICY, &kasp);
if (kasp == NULL ||
strcmp(cfg_obj_asstring(kasp), "none") == 0 ||
strcmp(cfg_obj_asstring(kasp), kaspnamestr) == 0)
@@ -4681,35 +4733,35 @@ rndckey_exists(const cfg_obj_t *keylist, const char *keyname) {
}
static struct {
- const char *v4;
- const char *v6;
-} sources[] = { { "transfer-source", "transfer-source-v6" },
- { "notify-source", "notify-source-v6" },
- { "parental-source", "parental-source-v6" },
- { "query-source", "query-source-v6" },
- { NULL, NULL } };
+ enum cfg_clause v4;
+ enum cfg_clause v6;
+} sources[] = { { CFG_CLAUSE_TRANSFER_SOURCE, CFG_CLAUSE_TRANSFER_SOURCE_V6 },
+ { CFG_CLAUSE_NOTIFY_SOURCE, CFG_CLAUSE_NOTIFY_SOURCE_V6 },
+ { CFG_CLAUSE_PARENTAL_SOURCE, CFG_CLAUSE_PARENTAL_SOURCE_V6 },
+ { CFG_CLAUSE_QUERY_SOURCE, CFG_CLAUSE_QUERY_SOURCE_V6 },
+ { CFG_CLAUSE__NONE, CFG_CLAUSE__NONE } };
static struct {
- const char *name;
+ enum cfg_clause name;
isc_result_t (*set)(dns_peer_t *peer, bool newval);
} bools[] = {
- { "bogus", dns_peer_setbogus },
- { "edns", dns_peer_setsupportedns },
- { "provide-ixfr", dns_peer_setprovideixfr },
- { "request-expire", dns_peer_setrequestexpire },
- { "request-ixfr", dns_peer_setrequestixfr },
- { "request-nsid", dns_peer_setrequestnsid },
- { "request-zoneversion", dns_peer_setrequestzoneversion },
- { "send-cookie", dns_peer_setsendcookie },
- { "tcp-keepalive", dns_peer_settcpkeepalive },
- { "tcp-only", dns_peer_setforcetcp },
+ { CFG_CLAUSE_BOGUS, dns_peer_setbogus },
+ { CFG_CLAUSE_EDNS, dns_peer_setsupportedns },
+ { CFG_CLAUSE_PROVIDE_IXFR, dns_peer_setprovideixfr },
+ { CFG_CLAUSE_REQUEST_EXPIRE, dns_peer_setrequestexpire },
+ { CFG_CLAUSE_REQUEST_IXFR, dns_peer_setrequestixfr },
+ { CFG_CLAUSE_REQUEST_NSID, dns_peer_setrequestnsid },
+ { CFG_CLAUSE_REQUEST_ZONEVERSION, dns_peer_setrequestzoneversion },
+ { CFG_CLAUSE_SEND_COOKIE, dns_peer_setsendcookie },
+ { CFG_CLAUSE_TCP_KEEPALIVE, dns_peer_settcpkeepalive },
+ { CFG_CLAUSE_TCP_ONLY, dns_peer_setforcetcp },
};
static struct {
- const char *name;
+ enum cfg_clause name;
isc_result_t (*set)(dns_peer_t *peer, uint32_t newval);
} uint32s[] = {
- { "request-ixfr-max-diffs", dns_peer_setrequestixfrmaxdiffs },
+ { CFG_CLAUSE_REQUEST_IXFR_MAX_DIFFS, dns_peer_setrequestixfrmaxdiffs },
};
static isc_result_t
@@ -4723,17 +4775,17 @@ check_servers(const cfg_obj_t *config, const cfg_obj_t *voptions,
const cfg_obj_t *keys = NULL;
char buf[ISC_NETADDR_FORMATSIZE];
char namebuf[DNS_NAME_FORMATSIZE];
- const char *xfr = NULL;
+ enum cfg_clause xfr = CFG_CLAUSE__NONE;
const char *keyval = NULL;
isc_buffer_t b;
int source;
dns_name_t *keyname = NULL;
servers = NULL;
if (voptions != NULL) {
- (void)cfg_map_get(voptions, "server", &servers);
+ (void)cfg_map_get(voptions, CFG_CLAUSE_SERVER, &servers);
}
if (servers == NULL) {
- (void)cfg_map_get(config, "server", &servers);
+ (void)cfg_map_get(config, CFG_CLAUSE_SERVER, &servers);
}
if (servers == NULL) {
return ISC_R_SUCCESS;
@@ -4777,7 +4829,7 @@ check_servers(const cfg_obj_t *config, const cfg_obj_t *voptions,
isc_netaddr_format(&n1, buf, sizeof(buf));
cfg_obj_log(v1, ISC_LOG_ERROR,
"server '%s/%u': %s not legal", buf,
- p1, xfr);
+ p1, cfg_clause_as_string[xfr]);
result = ISC_R_FAILURE;
}
@@ -4800,12 +4852,14 @@ check_servers(const cfg_obj_t *config, const cfg_obj_t *voptions,
in_port_t port =
isc_sockaddr_getport(sa);
if (port == dnsport) {
- cfg_obj_log(obj, ISC_LOG_ERROR,
- "'%s' cannot "
- "specify the "
- "DNS listener port "
- "(%d)",
- xfr, port);
+ cfg_obj_log(
+ obj, ISC_LOG_ERROR,
+ "'%s' cannot "
+ "specify the "
+ "DNS listener port "
+ "(%d)",
+ cfg_clause_as_string[xfr],
+ port);
result = ISC_R_FAILURE;
}
} else {
@@ -4813,11 +4867,11 @@ check_servers(const cfg_obj_t *config, const cfg_obj_t *voptions,
"'none' is not a legal "
"'%s' parameter in a "
"server block",
- xfr);
+ cfg_clause_as_string[xfr]);
result = ISC_R_FAILURE;
}
}
- } while (sources[++source].v4 != NULL);
+ } while (sources[++source].v4 != CFG_CLAUSE__NONE);
const cfg_listelt_t *e2 = e1;
while ((e2 = cfg_list_next(e2)) != NULL) {
@@ -4844,7 +4898,7 @@ check_servers(const cfg_obj_t *config, const cfg_obj_t *voptions,
}
keys = NULL;
- cfg_map_get(v1, "keys", &keys);
+ cfg_map_get(v1, CFG_CLAUSE_KEYS, &keys);
if (keys != NULL) {
/*
* Normalize key name.
@@ -4880,7 +4934,8 @@ check_servers(const cfg_obj_t *config, const cfg_obj_t *voptions,
cfg_obj_log(opt, ISC_LOG_ERROR,
"setting server option "
"'%s' failed: %s",
- bools[i].name,
+ cfg_clause_as_string
+ [bools[i].name],
isc_result_totext(tresult));
result = ISC_R_FAILURE;
}
@@ -4896,7 +4951,8 @@ check_servers(const cfg_obj_t *config, const cfg_obj_t *voptions,
cfg_obj_log(opt, ISC_LOG_ERROR,
"setting server option "
"'%s' failed: %s",
- uint32s[i].name,
+ cfg_clause_as_string
+ [uint32s[i].name],
isc_result_totext(tresult));
result = ISC_R_FAILURE;
}
@@ -4904,10 +4960,13 @@ check_servers(const cfg_obj_t *config, const cfg_obj_t *voptions,
}
dns_peer_detach(&peer);
- check_range_uint32(v1, &result, "edns-udp-size", 512, 4096);
- check_range_uint32(v1, &result, "max-udp-size", 512, 4096);
- check_range_uint32(v1, &result, "edns-version", 0, 255);
- check_range_uint32(v1, &result, "padding", 0, 512);
+ check_range_uint32(v1, &result, CFG_CLAUSE_EDNS_UDP_SIZE, 512,
+ 4096);
+ check_range_uint32(v1, &result, CFG_CLAUSE_MAX_UDP_SIZE, 512,
+ 4096);
+ check_range_uint32(v1, &result, CFG_CLAUSE_EDNS_VERSION, 0,
+ 255);
+ check_range_uint32(v1, &result, CFG_CLAUSE_PADDING, 0, 512);
}
return result;
}
@@ -5538,7 +5597,8 @@ check_rpz_catz(const char *rpz_catz, const cfg_obj_t *rpz_obj,
zoneobj = cfg_tuple_get(zoneobj, "options");
}
if (zoneobj != NULL && cfg_obj_ismap(zoneobj)) {
- (void)cfg_map_get(zoneobj, "type", &obj);
+ (void)cfg_map_get(zoneobj, CFG_CLAUSE_TYPE,
+ &obj);
}
if (obj != NULL) {
zonetype = cfg_obj_asstring(obj);
@@ -5680,17 +5740,17 @@ check_dnstap(const cfg_obj_t *voptions, const cfg_obj_t *config) {
const cfg_obj_t *obj = NULL;
if (config != NULL) {
- (void)cfg_map_get(config, "options", &options);
+ (void)cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
}
if (options != NULL) {
- (void)cfg_map_get(options, "dnstap-output", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_DNSTAP_OUTPUT, &obj);
}
if (obj == NULL) {
if (voptions != NULL) {
- (void)cfg_map_get(voptions, "dnstap", &obj);
+ (void)cfg_map_get(voptions, CFG_CLAUSE_DNSTAP, &obj);
}
if (options != NULL && obj == NULL) {
- (void)cfg_map_get(options, "dnstap", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_DNSTAP, &obj);
}
if (obj != NULL) {
cfg_obj_log(obj, ISC_LOG_ERROR,
@@ -5732,7 +5792,7 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
/*
* Get global options block
*/
- (void)cfg_map_get(config, "options", &options);
+ (void)cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
/*
* The most relevant options for this view
@@ -5763,9 +5823,9 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
}
if (voptions != NULL) {
- (void)cfg_map_get(voptions, "zone", &zones);
+ (void)cfg_map_get(voptions, CFG_CLAUSE_ZONE, &zones);
} else {
- (void)cfg_map_get(config, "zone", &zones);
+ (void)cfg_map_get(config, CFG_CLAUSE_ZONE, &zones);
}
CFG_LIST_FOREACH(zones, element) {
@@ -5785,7 +5845,7 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
*/
if (opts != NULL) {
obj = NULL;
- if ((cfg_map_get(opts, "response-policy", &obj) ==
+ if ((cfg_map_get(opts, CFG_CLAUSE_RESPONSE_POLICY, &obj) ==
ISC_R_SUCCESS) &&
(check_rpz_catz("response-policy zone", obj, viewname,
symtab,
@@ -5795,7 +5855,7 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
}
obj = NULL;
- if ((cfg_map_get(opts, "catalog-zones", &obj) ==
+ if ((cfg_map_get(opts, CFG_CLAUSE_CATALOG_ZONES, &obj) ==
ISC_R_SUCCESS) &&
(check_rpz_catz("catalog zone", obj, viewname, symtab,
@@ -5810,7 +5870,7 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
*/
if (opts != NULL) {
obj = NULL;
- if ((cfg_map_get(opts, "response-policy", &obj) ==
+ if ((cfg_map_get(opts, CFG_CLAUSE_RESPONSE_POLICY, &obj) ==
ISC_R_SUCCESS) &&
(check_rpz(obj) != ISC_R_SUCCESS))
{
@@ -5823,7 +5883,9 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
*/
if (opts != NULL) {
obj = NULL;
- if (cfg_map_get(opts, "catalog-zones", &obj) == ISC_R_SUCCESS) {
+ if (cfg_map_get(opts, CFG_CLAUSE_CATALOG_ZONES, &obj) ==
+ ISC_R_SUCCESS)
+ {
if (vclass != dns_rdataclass_in) {
cfg_obj_log(
obj, ISC_LOG_ERROR,
@@ -5881,7 +5943,7 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
*/
isc_symtab_create(mctx, freekey, mctx, false, &symtab);
- (void)cfg_map_get(config, "key", &keys);
+ (void)cfg_map_get(config, CFG_CLAUSE_KEY, &keys);
tresult = check_keylist(keys, symtab, mctx);
if (tresult == ISC_R_EXISTS) {
result = ISC_R_FAILURE;
@@ -5892,7 +5954,7 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
if (voptions != NULL) {
keys = NULL;
- (void)cfg_map_get(voptions, "key", &keys);
+ (void)cfg_map_get(voptions, CFG_CLAUSE_KEY, &keys);
tresult = check_keylist(keys, symtab, mctx);
if (tresult == ISC_R_EXISTS) {
result = ISC_R_FAILURE;
@@ -5915,9 +5977,9 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
* Load all DNSSEC keys.
*/
if (voptions != NULL) {
- (void)cfg_map_get(voptions, "trust-anchors", &view_ta);
+ (void)cfg_map_get(voptions, CFG_CLAUSE_TRUST_ANCHORS, &view_ta);
}
- (void)cfg_map_get(config, "trust-anchors", &global_ta);
+ (void)cfg_map_get(config, CFG_CLAUSE_TRUST_ANCHORS, &global_ta);
check_keys[0] = view_ta;
check_keys[1] = global_ta;
@@ -6006,10 +6068,10 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
obj = NULL;
if (voptions != NULL) {
- (void)cfg_map_get(voptions, "dnssec-validation", &obj);
+ (void)cfg_map_get(voptions, CFG_CLAUSE_DNSSEC_VALIDATION, &obj);
}
if (obj == NULL && options != NULL) {
- (void)cfg_map_get(options, "dnssec-validation", &obj);
+ (void)cfg_map_get(options, CFG_CLAUSE_DNSSEC_VALIDATION, &obj);
}
if (obj != NULL) {
if (!cfg_obj_isboolean(obj)) {
@@ -6079,9 +6141,10 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
const cfg_obj_t *plugins = NULL;
if (voptions != NULL) {
- (void)cfg_map_get(voptions, "plugin", &plugins);
+ (void)cfg_map_get(voptions, CFG_CLAUSE_PLUGIN,
+ &plugins);
} else {
- (void)cfg_map_get(config, "plugin", &plugins);
+ (void)cfg_map_get(config, CFG_CLAUSE_PLUGIN, &plugins);
}
tresult = check_plugins(plugins, config, aclctx, NULL, mctx);
@@ -6123,7 +6186,7 @@ check_logging(const cfg_obj_t *config, isc_mem_t *mctx) {
isc_symvalue_t symvalue;
int i;
- (void)cfg_map_get(config, "logging", &logobj);
+ (void)cfg_map_get(config, CFG_CLAUSE_LOGGING, &logobj);
if (logobj == NULL) {
return ISC_R_SUCCESS;
}
@@ -6137,16 +6200,16 @@ check_logging(const cfg_obj_t *config, isc_mem_t *mctx) {
RUNTIME_CHECK(tresult == ISC_R_SUCCESS);
}
- cfg_map_get(logobj, "channel", &channels);
+ cfg_map_get(logobj, CFG_CLAUSE_CHANNEL, &channels);
CFG_LIST_FOREACH(channels, element) {
channel = cfg_listelt_value(element);
channelname = cfg_obj_asstring(cfg_map_getname(channel));
fileobj = syslogobj = nullobj = stderrobj = NULL;
- (void)cfg_map_get(channel, "file", &fileobj);
- (void)cfg_map_get(channel, "syslog", &syslogobj);
- (void)cfg_map_get(channel, "null", &nullobj);
- (void)cfg_map_get(channel, "stderr", &stderrobj);
+ (void)cfg_map_get(channel, CFG_CLAUSE_FILE, &fileobj);
+ (void)cfg_map_get(channel, CFG_CLAUSE_SYSLOG, &syslogobj);
+ (void)cfg_map_get(channel, CFG_CLAUSE_NULL, &nullobj);
+ (void)cfg_map_get(channel, CFG_CLAUSE_STDERR, &stderrobj);
i = 0;
if (fileobj != NULL) {
i++;
@@ -6173,7 +6236,7 @@ check_logging(const cfg_obj_t *config, isc_mem_t *mctx) {
RUNTIME_CHECK(tresult == ISC_R_SUCCESS);
}
- cfg_map_get(logobj, "category", &categories);
+ cfg_map_get(logobj, CFG_CLAUSE_CATEGORY, &categories);
CFG_LIST_FOREACH(categories, element) {
category = cfg_listelt_value(element);
@@ -6243,12 +6306,12 @@ check_controls(const cfg_obj_t *config, isc_mem_t *mctx) {
dns_acl_t *acl = NULL;
isc_symtab_t *symtab = NULL;
- (void)cfg_map_get(config, "controls", &controlslist);
+ (void)cfg_map_get(config, CFG_CLAUSE_CONTROLS, &controlslist);
if (controlslist == NULL) {
return ISC_R_SUCCESS;
}
- (void)cfg_map_get(config, "key", &keylist);
+ (void)cfg_map_get(config, CFG_CLAUSE_KEY, &keylist);
cfg_aclconfctx_create(mctx, &aclctx);
@@ -6262,8 +6325,8 @@ check_controls(const cfg_obj_t *config, isc_mem_t *mctx) {
controls = cfg_listelt_value(element);
unixcontrols = NULL;
inetcontrols = NULL;
- (void)cfg_map_get(controls, "unix", &unixcontrols);
- (void)cfg_map_get(controls, "inet", &inetcontrols);
+ (void)cfg_map_get(controls, CFG_CLAUSE_UNIX, &unixcontrols);
+ (void)cfg_map_get(controls, CFG_CLAUSE_INET, &inetcontrols);
CFG_LIST_FOREACH(inetcontrols, element2) {
char socktext[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_t addr;
@@ -6330,7 +6393,7 @@ isccfg_check_namedconf(const cfg_obj_t *config, unsigned int flags,
static const char *builtin[] = { "localhost", "localnets", "any",
"none" };
- (void)cfg_map_get(config, "options", &options);
+ (void)cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
if (options != NULL &&
check_options(options, config, check_algorithms, mctx,
@@ -6361,7 +6424,7 @@ isccfg_check_namedconf(const cfg_obj_t *config, unsigned int flags,
result = ISC_R_FAILURE;
}
- (void)cfg_map_get(config, "view", &views);
+ (void)cfg_map_get(config, CFG_CLAUSE_VIEW, &views);
if (views != NULL && options != NULL) {
if (check_dual_stack(options) != ISC_R_SUCCESS) {
@@ -6395,7 +6458,7 @@ isccfg_check_namedconf(const cfg_obj_t *config, unsigned int flags,
const cfg_obj_t *zones = NULL;
const cfg_obj_t *plugins = NULL;
- (void)cfg_map_get(config, "zone", &zones);
+ (void)cfg_map_get(config, CFG_CLAUSE_ZONE, &zones);
if (zones != NULL) {
cfg_obj_log(zones, ISC_LOG_ERROR,
"when using 'view' statements, "
@@ -6403,7 +6466,7 @@ isccfg_check_namedconf(const cfg_obj_t *config, unsigned int flags,
result = ISC_R_FAILURE;
}
- (void)cfg_map_get(config, "plugin", &plugins);
+ (void)cfg_map_get(config, CFG_CLAUSE_PLUGIN, &plugins);
if (plugins != NULL) {
cfg_obj_log(plugins, ISC_LOG_ERROR,
"when using 'view' statements, "
@@ -6491,7 +6554,7 @@ isccfg_check_namedconf(const cfg_obj_t *config, unsigned int flags,
}
}
- cfg_map_get(config, "acl", &acls);
+ cfg_map_get(config, CFG_CLAUSE_ACL, &acls);
if (acls != NULL) {
const char *aclname = NULL;
diff --git a/lib/isccfg/clause.c b/lib/isccfg/clause.c
new file mode 100644
index 0000000000..ca6c07bf31
--- /dev/null
+++ b/lib/isccfg/clause.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * 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 https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+#include <stddef.h>
+
+#include <isccfg/clause.h>
+
+/* clang-format off */
+const char *cfg_clause_as_string[] = {
+ [CFG_CLAUSE__NONE] = NULL,
+#define X(name, str) [name] = str,
+ CFG_CLAUSES
+#undef X
+};
+/* clang-format on */
diff --git a/lib/isccfg/include/isccfg/cfg.h b/lib/isccfg/include/isccfg/cfg.h
index 51ae849ed2..12c8c62778 100644
--- a/lib/isccfg/include/isccfg/cfg.h
+++ b/lib/isccfg/include/isccfg/cfg.h
@@ -35,6 +35,8 @@
#include <isc/refcount.h>
#include <isc/types.h>
+#include <isccfg/clause.h>
+
/***
*** Types
***/
@@ -137,8 +139,8 @@ cfg_parser_currentfile(cfg_parser_t *pctx);
*/
isc_result_t
-cfg_map_add(cfg_obj_t *map, const cfg_obj_t *obj,
- const cfg_clausedef_t *clause);
+cfg_map_addclone(cfg_obj_t *map, const cfg_obj_t *obj,
+ const cfg_clausedef_t *clause);
/*%<
* Clone 'obj' and add its clone to the specified clause in mapbody 'mapobj'.
* If the clause is tagged with CFG_CLAUSEFLAG_MULTI, the function expects
@@ -205,14 +207,15 @@ cfg_obj_ispercentage(const cfg_obj_t *obj);
*/
isc_result_t
-cfg_map_get(const cfg_obj_t *mapobj, const char *name, const cfg_obj_t **obj);
+cfg_map_get(const cfg_obj_t *mapobj, enum cfg_clause name,
+ const cfg_obj_t **obj);
/*%<
* Extract an element from a configuration object, which
* must be of a map type.
*
* Requires:
* \li 'mapobj' points to a valid configuration object of a map type.
- * \li 'name' points to a null-terminated string.
+ * \li 'name' is a valid enum cfg_clause value.
* \li 'obj' is non-NULL and '*obj' is NULL.
*
* Returns:
@@ -584,7 +587,7 @@ cfg_map_nextclause(const cfg_type_t *map, const void **clauses,
unsigned int *idx);
const cfg_clausedef_t *
-cfg_map_findclause(const cfg_type_t *map, const char *name);
+cfg_map_findclause(const cfg_type_t *map, enum cfg_clause name);
typedef isc_result_t(pluginlist_cb_t)(const cfg_obj_t *config,
const cfg_obj_t *obj,
diff --git a/lib/isccfg/include/isccfg/clause.h b/lib/isccfg/include/isccfg/clause.h
new file mode 100644
index 0000000000..c0d0ae1cba
--- /dev/null
+++ b/lib/isccfg/include/isccfg/clause.h
@@ -0,0 +1,644 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * 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 https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+#pragma once
+
+/*! \file isccfg/clause.h
+ * \brief
+ * Interned clause names for cfg_clausedef_t.
+ */
+
+/* clang-format off */
+
+#define CFG_CLAUSES \
+ X(CFG_CLAUSE_6TO4_SELF, "6to4-self") \
+ X(CFG_CLAUSE_ACACHE_CLEANING_INTERVAL, "acache-cleaning-interval") \
+ X(CFG_CLAUSE_ACACHE_ENABLE, "acache-enable") \
+ X(CFG_CLAUSE_ACL, "acl") \
+ X(CFG_CLAUSE_ADDITIONAL_FROM_AUTH, "additional-from-auth") \
+ X(CFG_CLAUSE_ADDITIONAL_FROM_CACHE, "additional-from-cache") \
+ X(CFG_CLAUSE_ADDRESS, "address") \
+ X(CFG_CLAUSE_ADDRESSES, "addresses") \
+ X(CFG_CLAUSE_ADD_SOA, "add-soa") \
+ X(CFG_CLAUSE_ADDZONECONF, "addzoneconf") \
+ X(CFG_CLAUSE_ALGORITHM, "algorithm") \
+ X(CFG_CLAUSE_ALGORITHMLIST, "algorithmlist") \
+ X(CFG_CLAUSE_ALGORITHMS, "algorithms") \
+ X(CFG_CLAUSE_ALL, "all") \
+ X(CFG_CLAUSE_ALLOW, "allow") \
+ X(CFG_CLAUSE_ALLOW_NEW_ZONES, "allow-new-zones") \
+ X(CFG_CLAUSE_ALLOW_NOTIFY, "allow-notify") \
+ X(CFG_CLAUSE_ALLOW_PROXY, "allow-proxy") \
+ X(CFG_CLAUSE_ALLOW_PROXY_ON, "allow-proxy-on") \
+ X(CFG_CLAUSE_ALLOW_QUERY, "allow-query") \
+ X(CFG_CLAUSE_ALLOW_QUERY_CACHE, "allow-query-cache") \
+ X(CFG_CLAUSE_ALLOW_QUERY_CACHE_ON, "allow-query-cache-on") \
+ X(CFG_CLAUSE_ALLOW_QUERY_ON, "allow-query-on") \
+ X(CFG_CLAUSE_ALLOW_RECURSION, "allow-recursion") \
+ X(CFG_CLAUSE_ALLOW_RECURSION_ON, "allow-recursion-on") \
+ X(CFG_CLAUSE_ALLOW_TRANSFER, "allow-transfer") \
+ X(CFG_CLAUSE_ALLOW_UPDATE, "allow-update") \
+ X(CFG_CLAUSE_ALLOW_UPDATE_FORWARDING, "allow-update-forwarding") \
+ X(CFG_CLAUSE_ALLOW_V6_SYNTHESIS, "allow-v6-synthesis") \
+ X(CFG_CLAUSE_ALL_PER_SECOND, "all-per-second") \
+ X(CFG_CLAUSE_ALSO_NOTIFY, "also-notify") \
+ X(CFG_CLAUSE_ALT_TRANSFER_SOURCE, "alt-transfer-source") \
+ X(CFG_CLAUSE_ALT_TRANSFER_SOURCE_V6, "alt-transfer-source-v6") \
+ X(CFG_CLAUSE_AML, "aml") \
+ X(CFG_CLAUSE_ANCHORTYPE, "anchortype") \
+ X(CFG_CLAUSE_ANSWER_COOKIE, "answer-cookie") \
+ X(CFG_CLAUSE_ATTACH_CACHE, "attach-cache") \
+ X(CFG_CLAUSE_AUTH_NXDOMAIN, "auth-nxdomain") \
+ X(CFG_CLAUSE_AUTO, "auto") \
+ X(CFG_CLAUSE_AUTO_DNSSEC, "auto-dnssec") \
+ X(CFG_CLAUSE_AUTOMATIC_INTERFACE_SCAN, "automatic-interface-scan") \
+ X(CFG_CLAUSE_AVOID_V4_UDP_PORTS, "avoid-v4-udp-ports") \
+ X(CFG_CLAUSE_AVOID_V6_UDP_PORTS, "avoid-v6-udp-ports") \
+ X(CFG_CLAUSE_BINDKEYS, "bindkeys") \
+ X(CFG_CLAUSE_BINDKEYS_FILE, "bindkeys-file") \
+ X(CFG_CLAUSE_BLACKHOLE, "blackhole") \
+ X(CFG_CLAUSE_BLOCK_SIZE, "block-size") \
+ X(CFG_CLAUSE_BLOCKSIZE, "blocksize") \
+ X(CFG_CLAUSE_BOGUS, "bogus") \
+ X(CFG_CLAUSE_BRACKETED_NETADDRLIST, "bracketed_netaddrlist") \
+ X(CFG_CLAUSE_BREAK_DNSSEC, "break-dnssec") \
+ X(CFG_CLAUSE_BUFFERED, "buffered") \
+ X(CFG_CLAUSE_BUILTIN_TRUST_ANCHORS, "builtin-trust-anchors") \
+ X(CFG_CLAUSE_CACHE_FILE, "cache-file") \
+ X(CFG_CLAUSE_CA_FILE, "ca-file") \
+ X(CFG_CLAUSE_CATALOG_ZONES, "catalog-zones") \
+ X(CFG_CLAUSE_CATEGORY, "category") \
+ X(CFG_CLAUSE_CDNSKEY, "cdnskey") \
+ X(CFG_CLAUSE_CDS_DIGEST_TYPES, "cds-digest-types") \
+ X(CFG_CLAUSE_CERT_FILE, "cert-file") \
+ X(CFG_CLAUSE_CHANNEL, "channel") \
+ X(CFG_CLAUSE_CHECKDS, "checkds") \
+ X(CFG_CLAUSE_CHECK_DUP_RECORDS, "check-dup-records") \
+ X(CFG_CLAUSE_CHECK_INTEGRITY, "check-integrity") \
+ X(CFG_CLAUSE_CHECKMODE, "checkmode") \
+ X(CFG_CLAUSE_CHECK_MX, "check-mx") \
+ X(CFG_CLAUSE_CHECK_MX_CNAME, "check-mx-cname") \
+ X(CFG_CLAUSE_CHECK_NAMES, "check-names") \
+ X(CFG_CLAUSE_CHECK_NS, "check-ns") \
+ X(CFG_CLAUSE_CHECKNAMES, "checknames") \
+ X(CFG_CLAUSE_CHECK_SIBLING, "check-sibling") \
+ X(CFG_CLAUSE_CHECK_SPF, "check-spf") \
+ X(CFG_CLAUSE_CHECK_SRV_CNAME, "check-srv-cname") \
+ X(CFG_CLAUSE_CHECK_SVCB, "check-svcb") \
+ X(CFG_CLAUSE_CHECKTYPE, "checktype") \
+ X(CFG_CLAUSE_CHECK_WILDCARD, "check-wildcard") \
+ X(CFG_CLAUSE_CIPHERS, "ciphers") \
+ X(CFG_CLAUSE_CIPHER_SUITES, "cipher-suites") \
+ X(CFG_CLAUSE_CLASS, "class") \
+ X(CFG_CLAUSE_CLEANING_INTERVAL, "cleaning-interval") \
+ X(CFG_CLAUSE_CLIENTS, "clients") \
+ X(CFG_CLAUSE_CLIENTS_PER_QUERY, "clients-per-query") \
+ X(CFG_CLAUSE_CNAME, "cname") \
+ X(CFG_CLAUSE_CONTROLS, "controls") \
+ X(CFG_CLAUSE_COOKIEALG, "cookiealg") \
+ X(CFG_CLAUSE_COOKIE_ALGORITHM, "cookie-algorithm") \
+ X(CFG_CLAUSE_COOKIE_SECRET, "cookie-secret") \
+ X(CFG_CLAUSE_CORESIZE, "coresize") \
+ X(CFG_CLAUSE_CRITICAL, "critical") \
+ X(CFG_CLAUSE_CSK, "csk") \
+ X(CFG_CLAUSE_DATA, "data") \
+ X(CFG_CLAUSE_DATABASE, "database") \
+ X(CFG_CLAUSE_DATASIZE, "datasize") \
+ X(CFG_CLAUSE_DATE, "date") \
+ X(CFG_CLAUSE_DEALLOCATE_ON_EXIT, "deallocate-on-exit") \
+ X(CFG_CLAUSE_DEBUG, "debug") \
+ X(CFG_CLAUSE_DEBUGLEVEL, "debuglevel") \
+ X(CFG_CLAUSE_DEFAULT, "default") \
+ X(CFG_CLAUSE_DEFAULT_KEY, "default-key") \
+ X(CFG_CLAUSE_DEFAULT_MASTERS, "default-masters") \
+ X(CFG_CLAUSE_DEFAULT_PORT, "default-port") \
+ X(CFG_CLAUSE_DEFAULT_PRIMARIES, "default-primaries") \
+ X(CFG_CLAUSE_DEFAULT_SERVER, "default-server") \
+ X(CFG_CLAUSE_DEFAULT_SOURCE_ADDRESS, "default-source-address") \
+ X(CFG_CLAUSE_DEFAULT_SOURCE_ADDRESS_V6, "default-source-address-v6") \
+ X(CFG_CLAUSE_DELEGATION_ONLY, "delegation-only") \
+ X(CFG_CLAUSE_DELV, "delv") \
+ X(CFG_CLAUSE_DENY, "deny") \
+ X(CFG_CLAUSE_DENY_ANSWER_ADDRESSES, "deny-answer-addresses") \
+ X(CFG_CLAUSE_DENY_ANSWER_ALIASES, "deny-answer-aliases") \
+ X(CFG_CLAUSE_DESTINATIONLIST, "destinationlist") \
+ X(CFG_CLAUSE_DESTINATIONS, "destinations") \
+ X(CFG_CLAUSE_DHPARAM_FILE, "dhparam-file") \
+ X(CFG_CLAUSE_DIALUP, "dialup") \
+ X(CFG_CLAUSE_DIGESTS, "digests") \
+ X(CFG_CLAUSE_DIRECTORY, "directory") \
+ X(CFG_CLAUSE_DISABLE_ALGORITHMS, "disable-algorithms") \
+ X(CFG_CLAUSE_DISABLED, "disabled") \
+ X(CFG_CLAUSE_DISABLE_DS_DIGESTS, "disable-ds-digests") \
+ X(CFG_CLAUSE_DISABLE_EMPTY_ZONE, "disable-empty-zone") \
+ X(CFG_CLAUSE_DISCOUNT, "discount") \
+ X(CFG_CLAUSE_DLZ, "dlz") \
+ X(CFG_CLAUSE_DNS64, "dns64") \
+ X(CFG_CLAUSE_DNS64_CONTACT, "dns64-contact") \
+ X(CFG_CLAUSE_DNS64_SERVER, "dns64-server") \
+ X(CFG_CLAUSE_DNSKEY_SIG_VALIDITY, "dnskey-sig-validity") \
+ X(CFG_CLAUSE_DNSKEY_TTL, "dnskey-ttl") \
+ X(CFG_CLAUSE_DNSRPS_ENABLE, "dnsrps-enable") \
+ X(CFG_CLAUSE_DNSRPS_LIBRARY, "dnsrps-library") \
+ X(CFG_CLAUSE_DNSRPS_OPTIONS, "dnsrps-options") \
+ X(CFG_CLAUSE_DNSSEC_ACCEPT_EXPIRED, "dnssec-accept-expired") \
+ X(CFG_CLAUSE_DNSSEC_DNSKEY_KSKONLY, "dnssec-dnskey-kskonly") \
+ X(CFG_CLAUSE_DNSSEC_ENABLE, "dnssec-enable") \
+ X(CFG_CLAUSE_DNSSECKEYS, "dnsseckeys") \
+ X(CFG_CLAUSE_DNSSEC_LOADKEYS_INTERVAL, "dnssec-loadkeys-interval") \
+ X(CFG_CLAUSE_DNSSEC_LOOKASIDE, "dnssec-lookaside") \
+ X(CFG_CLAUSE_DNSSEC_MUST_BE_SECURE, "dnssec-must-be-secure") \
+ X(CFG_CLAUSE_DNSSEC_POLICY, "dnssec-policy") \
+ X(CFG_CLAUSE_DNSSEC_SECURE_TO_INSECURE, "dnssec-secure-to-insecure") \
+ X(CFG_CLAUSE_DNSSEC_UPDATE_MODE, "dnssec-update-mode") \
+ X(CFG_CLAUSE_DNSSEC_VALIDATION, "dnssec-validation") \
+ X(CFG_CLAUSE_DNSTAP, "dnstap") \
+ X(CFG_CLAUSE_DNSTAP_IDENTITY, "dnstap-identity") \
+ X(CFG_CLAUSE_DNSTAP_OUTPUT, "dnstap-output") \
+ X(CFG_CLAUSE_DNSTAPOUTPUT, "dnstapoutput") \
+ X(CFG_CLAUSE_DNSTAP_TYPE, "dnstap_type") \
+ X(CFG_CLAUSE_DNSTAP_VALUE, "dnstap_value") \
+ X(CFG_CLAUSE_DNSTAP_VERSION, "dnstap-version") \
+ X(CFG_CLAUSE_DOH, "doh") \
+ X(CFG_CLAUSE_DROP, "drop") \
+ X(CFG_CLAUSE_DSCP, "dscp") \
+ X(CFG_CLAUSE_DSDIGESTLIST, "dsdigestlist") \
+ X(CFG_CLAUSE_DTMODE, "dtmode") \
+ X(CFG_CLAUSE_DUAL_STACK_SERVERS, "dual-stack-servers") \
+ X(CFG_CLAUSE_DUMP_FILE, "dump-file") \
+ X(CFG_CLAUSE_DYNDB, "dyndb") \
+ X(CFG_CLAUSE_EDE, "ede") \
+ X(CFG_CLAUSE_EDNS, "edns") \
+ X(CFG_CLAUSE_EDNS_UDP_SIZE, "edns-udp-size") \
+ X(CFG_CLAUSE_EDNS_VERSION, "edns-version") \
+ X(CFG_CLAUSE_ELIGIBLE, "eligible") \
+ X(CFG_CLAUSE_EMPTY_CONTACT, "empty-contact") \
+ X(CFG_CLAUSE_EMPTY_SERVER, "empty-server") \
+ X(CFG_CLAUSE_EMPTY_ZONES_ENABLE, "empty-zones-enable") \
+ X(CFG_CLAUSE_ENDPOINTS, "endpoints") \
+ X(CFG_CLAUSE_ERRORS_PER_SECOND, "errors-per-second") \
+ X(CFG_CLAUSE_EXCEPT_FROM, "except-from") \
+ X(CFG_CLAUSE_EXCLUDE, "exclude") \
+ X(CFG_CLAUSE_EXEMPT_CLIENTS, "exempt-clients") \
+ X(CFG_CLAUSE_EXPLICIT, "explicit") \
+ X(CFG_CLAUSE_FAIL, "fail") \
+ X(CFG_CLAUSE_FAKE_IQUERY, "fake-iquery") \
+ X(CFG_CLAUSE_FETCHES, "fetches") \
+ X(CFG_CLAUSE_FETCHESPER, "fetchesper") \
+ X(CFG_CLAUSE_FETCHES_PER_SERVER, "fetches-per-server") \
+ X(CFG_CLAUSE_FETCHES_PER_ZONE, "fetches-per-zone") \
+ X(CFG_CLAUSE_FETCH_GLUE, "fetch-glue") \
+ X(CFG_CLAUSE_FETCHQUOTA, "fetchquota") \
+ X(CFG_CLAUSE_FETCH_QUOTA_PARAMS, "fetch-quota-params") \
+ X(CFG_CLAUSE_FILE, "file") \
+ X(CFG_CLAUSE_FILES, "files") \
+ X(CFG_CLAUSE_FILTER_AAAA, "filter-aaaa") \
+ X(CFG_CLAUSE_FILTER_AAAA_ON_V4, "filter-aaaa-on-v4") \
+ X(CFG_CLAUSE_FILTER_AAAA_ON_V6, "filter-aaaa-on-v6") \
+ X(CFG_CLAUSE_FIRST, "first") \
+ X(CFG_CLAUSE_FLUSH_ZONES_ON_SHUTDOWN, "flush-zones-on-shutdown") \
+ X(CFG_CLAUSE_FORWARD, "forward") \
+ X(CFG_CLAUSE_FORWARDERS, "forwarders") \
+ X(CFG_CLAUSE_FREQUENCY, "frequency") \
+ X(CFG_CLAUSE_FSTRM_SET_BUFFER_HINT, "fstrm-set-buffer-hint") \
+ X(CFG_CLAUSE_FSTRM_SET_FLUSH_TIMEOUT, "fstrm-set-flush-timeout") \
+ X(CFG_CLAUSE_FSTRM_SET_INPUT_QUEUE_SIZE, "fstrm-set-input-queue-size") \
+ X(CFG_CLAUSE_FSTRM_SET_OUTPUT_NOTIFY_THRESHOLD, "fstrm-set-output-notify-threshold") \
+ X(CFG_CLAUSE_FSTRM_SET_OUTPUT_QUEUE_MODEL, "fstrm-set-output-queue-model") \
+ X(CFG_CLAUSE_FSTRM_SET_OUTPUT_QUEUE_SIZE, "fstrm-set-output-queue-size") \
+ X(CFG_CLAUSE_FSTRM_SET_REOPEN_INTERVAL, "fstrm-set-reopen-interval") \
+ X(CFG_CLAUSE_FULL, "full") \
+ X(CFG_CLAUSE_GEOIP_DIRECTORY, "geoip-directory") \
+ X(CFG_CLAUSE_GEOIP_USE_ECS, "geoip-use-ecs") \
+ X(CFG_CLAUSE_GLUE_CACHE, "glue-cache") \
+ X(CFG_CLAUSE_GRANT, "grant") \
+ X(CFG_CLAUSE_GROUP, "group") \
+ X(CFG_CLAUSE_HAS_OLD_CLIENTS, "has-old-clients") \
+ X(CFG_CLAUSE_HEARTBEAT_INTERVAL, "heartbeat-interval") \
+ X(CFG_CLAUSE_HIGH, "high") \
+ X(CFG_CLAUSE_HOSTNAME, "hostname") \
+ X(CFG_CLAUSE_HOST_STATISTICS, "host-statistics") \
+ X(CFG_CLAUSE_HOST_STATISTICS_MAX, "host-statistics-max") \
+ X(CFG_CLAUSE_HTTP, "http") \
+ X(CFG_CLAUSE_HTTP_LISTENER_CLIENTS, "http-listener-clients") \
+ X(CFG_CLAUSE_HTTP_PORT, "http-port") \
+ X(CFG_CLAUSE_HTTPS_PORT, "https-port") \
+ X(CFG_CLAUSE_HTTP_STREAMS_PER_CONNECTION, "http-streams-per-connection") \
+ X(CFG_CLAUSE_IDENTITY, "identity") \
+ X(CFG_CLAUSE_INCREMENT, "increment") \
+ X(CFG_CLAUSE_INET, "inet") \
+ X(CFG_CLAUSE_INITIAL_FILE, "initial-file") \
+ X(CFG_CLAUSE_INLINE_SIGNING, "inline-signing") \
+ X(CFG_CLAUSE_IN_MEMORY, "in-memory") \
+ X(CFG_CLAUSE_INTERFACE_INTERVAL, "interface-interval") \
+ X(CFG_CLAUSE_IN_VIEW, "in-view") \
+ X(CFG_CLAUSE_IPV4ONLY_CONTACT, "ipv4only-contact") \
+ X(CFG_CLAUSE_IPV4ONLY_ENABLE, "ipv4only-enable") \
+ X(CFG_CLAUSE_IPV4ONLY_SERVER, "ipv4only-server") \
+ X(CFG_CLAUSE_IPV4_PREFIX_LENGTH, "ipv4-prefix-length") \
+ X(CFG_CLAUSE_IPV6_PREFIX_LENGTH, "ipv6-prefix-length") \
+ X(CFG_CLAUSE_ISO8601, "iso8601") \
+ X(CFG_CLAUSE_ITERATIONS, "iterations") \
+ X(CFG_CLAUSE_IXFR_BASE, "ixfr-base") \
+ X(CFG_CLAUSE_IXFR_FROM_DIFFERENCES, "ixfr-from-differences") \
+ X(CFG_CLAUSE_IXFR_RATIO, "ixfr_ratio") \
+ X(CFG_CLAUSE_IXFR_TMP_FILE, "ixfr-tmp-file") \
+ X(CFG_CLAUSE_JOURNAL, "journal") \
+ X(CFG_CLAUSE_KASPKEY, "kaspkey") \
+ X(CFG_CLAUSE_KASPKEYS, "kaspkeys") \
+ X(CFG_CLAUSE_KEEP_RESPONSE_ORDER, "keep-response-order") \
+ X(CFG_CLAUSE_KEY, "key") \
+ X(CFG_CLAUSE_KEY_DIRECTORY, "key-directory") \
+ X(CFG_CLAUSE_KEY_FILE, "key-file") \
+ X(CFG_CLAUSE_KEYLIST, "keylist") \
+ X(CFG_CLAUSE_KEYREF, "keyref") \
+ X(CFG_CLAUSE_KEYS, "keys") \
+ X(CFG_CLAUSE_KEYSTORAGE, "keystorage") \
+ X(CFG_CLAUSE_KEY_STORE, "key-store") \
+ X(CFG_CLAUSE_LAME_TTL, "lame-ttl") \
+ X(CFG_CLAUSE_LENGTH, "length") \
+ X(CFG_CLAUSE_LIBRARY, "library") \
+ X(CFG_CLAUSE_LIFETIME, "lifetime") \
+ X(CFG_CLAUSE_LISTENER_CLIENTS, "listener-clients") \
+ X(CFG_CLAUSE_LISTEN_ON, "listen-on") \
+ X(CFG_CLAUSE_LISTENON, "listenon") \
+ X(CFG_CLAUSE_LISTEN_ON_V6, "listen-on-v6") \
+ X(CFG_CLAUSE_LMDB_MAPSIZE, "lmdb-mapsize") \
+ X(CFG_CLAUSE_LOCK_FILE, "lock-file") \
+ X(CFG_CLAUSE_LOG, "log") \
+ X(CFG_CLAUSE_LOG_FILE, "log_file") \
+ X(CFG_CLAUSE_LOGGING, "logging") \
+ X(CFG_CLAUSE_LOGLEVEL, "loglevel") \
+ X(CFG_CLAUSE_LOG_ONLY, "log-only") \
+ X(CFG_CLAUSE_LOG_REPORT_CHANNEL, "log-report-channel") \
+ X(CFG_CLAUSE_LOG_SEVERITY, "log_severity") \
+ X(CFG_CLAUSE_LOGSUFFIX, "logsuffix") \
+ X(CFG_CLAUSE_LOW, "low") \
+ X(CFG_CLAUSE_LWRES, "lwres") \
+ X(CFG_CLAUSE_MAINTAIN, "maintain") \
+ X(CFG_CLAUSE_MAINTAIN_IXFR_BASE, "maintain-ixfr-base") \
+ X(CFG_CLAUSE_MANAGEDKEY, "managedkey") \
+ X(CFG_CLAUSE_MANAGED_KEYS, "managed-keys") \
+ X(CFG_CLAUSE_MANAGED_KEYS_DIRECTORY, "managed-keys-directory") \
+ X(CFG_CLAUSE_MANUAL_MODE, "manual-mode") \
+ X(CFG_CLAUSE_MANY_ANSWERS, "many-answers") \
+ X(CFG_CLAUSE_MAPPED, "mapped") \
+ X(CFG_CLAUSE_MASTERFILE_FORMAT, "masterfile-format") \
+ X(CFG_CLAUSE_MASTERFILE_STYLE, "masterfile-style") \
+ X(CFG_CLAUSE_MASTERS, "masters") \
+ X(CFG_CLAUSE_MATCH_CLIENTS, "match-clients") \
+ X(CFG_CLAUSE_MATCH_DESTINATIONS, "match-destinations") \
+ X(CFG_CLAUSE_MATCH_MAPPED_ADDRESSES, "match-mapped-addresses") \
+ X(CFG_CLAUSE_MATCH_RECURSIVE_ONLY, "match-recursive-only") \
+ X(CFG_CLAUSE_MATCHTYPE, "matchtype") \
+ X(CFG_CLAUSE_MAX_ACACHE_SIZE, "max-acache-size") \
+ X(CFG_CLAUSE_MAX_CACHE_SIZE, "max-cache-size") \
+ X(CFG_CLAUSE_MAX_CACHE_TTL, "max-cache-ttl") \
+ X(CFG_CLAUSE_MAX_CLIENTS_PER_QUERY, "max-clients-per-query") \
+ X(CFG_CLAUSE_MAX_DELEGATION_SERVERS, "max-delegation-servers") \
+ X(CFG_CLAUSE_MAX_DELEGATION_TTL, "max-delegation-ttl") \
+ X(CFG_CLAUSE_MAX_IXFR_LOG_SIZE, "max-ixfr-log-size") \
+ X(CFG_CLAUSE_MAX_IXFR_RATIO, "max-ixfr-ratio") \
+ X(CFG_CLAUSE_MAX_JOURNAL_SIZE, "max-journal-size") \
+ X(CFG_CLAUSE_MAX_NCACHE_TTL, "max-ncache-ttl") \
+ X(CFG_CLAUSE_MAX_POLICY_TTL, "max-policy-ttl") \
+ X(CFG_CLAUSE_MAX_QUERY_COUNT, "max-query-count") \
+ X(CFG_CLAUSE_MAX_QUERY_RESTARTS, "max-query-restarts") \
+ X(CFG_CLAUSE_MAX_RECORDS, "max-records") \
+ X(CFG_CLAUSE_MAX_RECORDS_PER_TYPE, "max-records-per-type") \
+ X(CFG_CLAUSE_MAX_RECURSION_DEPTH, "max-recursion-depth") \
+ X(CFG_CLAUSE_MAX_RECURSION_QUERIES, "max-recursion-queries") \
+ X(CFG_CLAUSE_MAX_REFRESH_TIME, "max-refresh-time") \
+ X(CFG_CLAUSE_MAX_RETRY_TIME, "max-retry-time") \
+ X(CFG_CLAUSE_MAX_RSA_EXPONENT_SIZE, "max-rsa-exponent-size") \
+ X(CFG_CLAUSE_MAX_STALE_TTL, "max-stale-ttl") \
+ X(CFG_CLAUSE_MAX_TABLE_SIZE, "max-table-size") \
+ X(CFG_CLAUSE_MAX_TRANSFER_IDLE_IN, "max-transfer-idle-in") \
+ X(CFG_CLAUSE_MAX_TRANSFER_IDLE_OUT, "max-transfer-idle-out") \
+ X(CFG_CLAUSE_MAX_TRANSFER_TIME_IN, "max-transfer-time-in") \
+ X(CFG_CLAUSE_MAX_TRANSFER_TIME_OUT, "max-transfer-time-out") \
+ X(CFG_CLAUSE_MAX_TYPES_PER_NAME, "max-types-per-name") \
+ X(CFG_CLAUSE_MAX_UDP_SIZE, "max-udp-size") \
+ X(CFG_CLAUSE_MAX_VALIDATION_FAILURES_PER_FETCH, "max-validation-failures-per-fetch") \
+ X(CFG_CLAUSE_MAX_VALIDATIONS_PER_FETCH, "max-validations-per-fetch") \
+ X(CFG_CLAUSE_MAX_ZONE_TTL, "max-zone-ttl") \
+ X(CFG_CLAUSE_MEMSTATISTICS, "memstatistics") \
+ X(CFG_CLAUSE_MEMSTATISTICS_FILE, "memstatistics-file") \
+ X(CFG_CLAUSE_MESSAGE_COMPRESSION, "message-compression") \
+ X(CFG_CLAUSE_MIN_CACHE_TTL, "min-cache-ttl") \
+ X(CFG_CLAUSE_MIN_DELEGATION_TTL, "min-delegation-ttl") \
+ X(CFG_CLAUSE_MINIMAL_ANY, "minimal-any") \
+ X(CFG_CLAUSE_MINIMAL_RESPONSES, "minimal-responses") \
+ X(CFG_CLAUSE_MIN_NCACHE_TTL, "min-ncache-ttl") \
+ X(CFG_CLAUSE_MIN_NS_DOTS, "min-ns-dots") \
+ X(CFG_CLAUSE_MIN_REFRESH_TIME, "min-refresh-time") \
+ X(CFG_CLAUSE_MIN_RETRY_TIME, "min-retry-time") \
+ X(CFG_CLAUSE_MIN_ROOTS, "min-roots") \
+ X(CFG_CLAUSE_MIN_TABLE_SIZE, "min-table-size") \
+ X(CFG_CLAUSE_MIN_TRANSFER_RATE_IN, "min-transfer-rate-in") \
+ X(CFG_CLAUSE_MIN_UPDATE_INTERVAL, "min-update-interval") \
+ X(CFG_CLAUSE_MODE, "mode") \
+ X(CFG_CLAUSE_MPSC, "mpsc") \
+ X(CFG_CLAUSE_MULTI_MASTER, "multi-master") \
+ X(CFG_CLAUSE_MULTIPLE_CNAMES, "multiple-cnames") \
+ X(CFG_CLAUSE_NAME, "name") \
+ X(CFG_CLAUSE_NAMEDCONF, "namedconf") \
+ X(CFG_CLAUSE_NAMED_XFER, "named-xfer") \
+ X(CFG_CLAUSE_NAMELIST, "namelist") \
+ X(CFG_CLAUSE_NAMEPORT, "nameport") \
+ X(CFG_CLAUSE_NEW_ZONES_DIRECTORY, "new-zones-directory") \
+ X(CFG_CLAUSE_NO_AUTH, "no-auth") \
+ X(CFG_CLAUSE_NO_CASE_COMPRESS, "no-case-compress") \
+ X(CFG_CLAUSE_NOCOOKIE_UDP_SIZE, "nocookie-udp-size") \
+ X(CFG_CLAUSE_NODATA_PER_SECOND, "nodata-per-second") \
+ X(CFG_CLAUSE_NONE, "none") \
+ X(CFG_CLAUSE_NOSIT_UDP_SIZE, "nosit-udp-size") \
+ X(CFG_CLAUSE_NOTIFY, "notify") \
+ X(CFG_CLAUSE_NOTIFY_CFG, "notify-cfg") \
+ X(CFG_CLAUSE_NOTIFY_DEFER, "notify-defer") \
+ X(CFG_CLAUSE_NOTIFY_DELAY, "notify-delay") \
+ X(CFG_CLAUSE_NOTIFY_RATE, "notify-rate") \
+ X(CFG_CLAUSE_NOTIFY_SOURCE, "notify-source") \
+ X(CFG_CLAUSE_NOTIFY_SOURCE_V6, "notify-source-v6") \
+ X(CFG_CLAUSE_NOTIFY_TO_SOA, "notify-to-soa") \
+ X(CFG_CLAUSE_NSDNAME_ENABLE, "nsdname-enable") \
+ X(CFG_CLAUSE_NSDNAME_WAIT_RECURSE, "nsdname-wait-recurse") \
+ X(CFG_CLAUSE_NSEC3PARAM, "nsec3param") \
+ X(CFG_CLAUSE_NSEC3_TEST_ZONE, "nsec3-test-zone") \
+ X(CFG_CLAUSE_NSIP_ENABLE, "nsip-enable") \
+ X(CFG_CLAUSE_NSIP_WAIT_RECURSE, "nsip-wait-recurse") \
+ X(CFG_CLAUSE_NTA_LIFETIME, "nta-lifetime") \
+ X(CFG_CLAUSE_NTA_RECHECK, "nta-recheck") \
+ X(CFG_CLAUSE_NULL, "null") \
+ X(CFG_CLAUSE_NXDOMAIN_REDIRECT, "nxdomain-redirect") \
+ X(CFG_CLAUSE_NXDOMAINS_PER_SECOND, "nxdomains-per-second") \
+ X(CFG_CLAUSE_OFFLINE_KSK, "offline-ksk") \
+ X(CFG_CLAUSE_OPTIONAL_CLASS, "optional_class") \
+ X(CFG_CLAUSE_OPTIONAL_FACILITY, "optional_facility") \
+ X(CFG_CLAUSE_OPTIONAL_UINT32, "optional_uint32") \
+ X(CFG_CLAUSE_OPTIONS, "options") \
+ X(CFG_CLAUSE_OPTOUT, "optout") \
+ X(CFG_CLAUSE_ORDER, "order") \
+ X(CFG_CLAUSE_ORDERING, "ordering") \
+ X(CFG_CLAUSE_OWNER, "owner") \
+ X(CFG_CLAUSE_PADDING, "padding") \
+ X(CFG_CLAUSE_PARAMETERS, "parameters") \
+ X(CFG_CLAUSE_PARENTAL_AGENTS, "parental-agents") \
+ X(CFG_CLAUSE_PARENTAL_SOURCE, "parental-source") \
+ X(CFG_CLAUSE_PARENTAL_SOURCE_V6, "parental-source-v6") \
+ X(CFG_CLAUSE_PARENT_DS_TTL, "parent-ds-ttl") \
+ X(CFG_CLAUSE_PARENT_PROPAGATION_DELAY, "parent-propagation-delay") \
+ X(CFG_CLAUSE_PARENT_REGISTRATION_DELAY, "parent-registration-delay") \
+ X(CFG_CLAUSE_PATH, "path") \
+ X(CFG_CLAUSE_PERM, "perm") \
+ X(CFG_CLAUSE_PID_FILE, "pid-file") \
+ X(CFG_CLAUSE_PKCS11_URI, "pkcs11-uri") \
+ X(CFG_CLAUSE_PLUGIN, "plugin") \
+ X(CFG_CLAUSE_PLUGINTYPE, "plugintype") \
+ X(CFG_CLAUSE_POLICY, "policy") \
+ X(CFG_CLAUSE_POLICY_NAME, "policy name") \
+ X(CFG_CLAUSE_POLICY_TUPLE, "policy tuple") \
+ X(CFG_CLAUSE_PORT, "port") \
+ X(CFG_CLAUSE_PORTIPLIST, "portiplist") \
+ X(CFG_CLAUSE_PORT_TRANSPORT, "port-transport") \
+ X(CFG_CLAUSE_PREFERRED_GLUE, "preferred-glue") \
+ X(CFG_CLAUSE_PREFER_SERVER_CIPHERS, "prefer-server-ciphers") \
+ X(CFG_CLAUSE_PREFETCH, "prefetch") \
+ X(CFG_CLAUSE_PRIMARIES, "primaries") \
+ X(CFG_CLAUSE_PRIMARY, "primary") \
+ X(CFG_CLAUSE_PRINT_CATEGORY, "print-category") \
+ X(CFG_CLAUSE_PRINT_SEVERITY, "print-severity") \
+ X(CFG_CLAUSE_PRINT_TIME, "print-time") \
+ X(CFG_CLAUSE_PRINTTIME, "printtime") \
+ X(CFG_CLAUSE_PROTOCOLS, "protocols") \
+ X(CFG_CLAUSE_PROVIDE_IXFR, "provide-ixfr") \
+ X(CFG_CLAUSE_PROVIDE_ZONEVERSION, "provide-zoneversion") \
+ X(CFG_CLAUSE_PROXY, "proxy") \
+ X(CFG_CLAUSE_PUBKEY, "pubkey") \
+ X(CFG_CLAUSE_PUBLISH_SAFETY, "publish-safety") \
+ X(CFG_CLAUSE_PURGE_KEYS, "purge-keys") \
+ X(CFG_CLAUSE_QMINMETHOD, "qminmethod") \
+ X(CFG_CLAUSE_QNAME_MINIMIZATION, "qname-minimization") \
+ X(CFG_CLAUSE_QNAME_WAIT_RECURSE, "qname-wait-recurse") \
+ X(CFG_CLAUSE_QPS_SCALE, "qps-scale") \
+ X(CFG_CLAUSE_QSTRINGORNONE, "qstringornone") \
+ X(CFG_CLAUSE_QUERY, "query") \
+ X(CFG_CLAUSE_QUERYLOG, "querylog") \
+ X(CFG_CLAUSE_QUERYPORT_POOL_PORTS, "queryport-pool-ports") \
+ X(CFG_CLAUSE_QUERYPORT_POOL_UPDATEINTERVAL, "queryport-pool-updateinterval") \
+ X(CFG_CLAUSE_QUERY_SOURCE, "query-source") \
+ X(CFG_CLAUSE_QUERYSOURCE, "querysource") \
+ X(CFG_CLAUSE_QUERY_SOURCE_V6, "query-source-v6") \
+ X(CFG_CLAUSE_RANDOM_DEVICE, "random-device") \
+ X(CFG_CLAUSE_RATE_LIMIT, "rate-limit") \
+ X(CFG_CLAUSE_RAW, "raw") \
+ X(CFG_CLAUSE_RDATA1, "rdata1") \
+ X(CFG_CLAUSE_RDATA2, "rdata2") \
+ X(CFG_CLAUSE_RDATA3, "rdata3") \
+ X(CFG_CLAUSE_READ_ONLY, "read-only") \
+ X(CFG_CLAUSE_RECURSING_FILE, "recursing-file") \
+ X(CFG_CLAUSE_RECURSION, "recursion") \
+ X(CFG_CLAUSE_RECURSIVE_CLIENTS, "recursive-clients") \
+ X(CFG_CLAUSE_RECURSIVE_ONLY, "recursive-only") \
+ X(CFG_CLAUSE_REFERRALS_PER_SECOND, "referrals-per-second") \
+ X(CFG_CLAUSE_REMOTE_HOSTNAME, "remote-hostname") \
+ X(CFG_CLAUSE_REMOTES_ELEMENT, "remotes_element") \
+ X(CFG_CLAUSE_REMOTESELEMENT, "remoteselement") \
+ X(CFG_CLAUSE_REMOTE_SERVERS, "remote-servers") \
+ X(CFG_CLAUSE_REQUEST_EXPIRE, "request-expire") \
+ X(CFG_CLAUSE_REQUEST_IXFR, "request-ixfr") \
+ X(CFG_CLAUSE_REQUEST_IXFR_MAX_DIFFS, "request-ixfr-max-diffs") \
+ X(CFG_CLAUSE_REQUEST_NSID, "request-nsid") \
+ X(CFG_CLAUSE_REQUEST_SIT, "request-sit") \
+ X(CFG_CLAUSE_REQUEST_ZONEVERSION, "request-zoneversion") \
+ X(CFG_CLAUSE_REQUIRE_COOKIE, "require-cookie") \
+ X(CFG_CLAUSE_REQUIRE_SERVER_COOKIE, "require-server-cookie") \
+ X(CFG_CLAUSE_RESERVED_SOCKETS, "reserved-sockets") \
+ X(CFG_CLAUSE_RE_SIGN, "re-sign") \
+ X(CFG_CLAUSE_RESOLVER_NONBACKOFF_TRIES, "resolver-nonbackoff-tries") \
+ X(CFG_CLAUSE_RESOLVER_QUERY_TIMEOUT, "resolver-query-timeout") \
+ X(CFG_CLAUSE_RESOLVER_RETRY_INTERVAL, "resolver-retry-interval") \
+ X(CFG_CLAUSE_RESOLVER_USE_DNS64, "resolver-use-dns64") \
+ X(CFG_CLAUSE_RESPONSE, "response") \
+ X(CFG_CLAUSE_RESPONSELOG, "responselog") \
+ X(CFG_CLAUSE_RESPONSE_PADDING, "response-padding") \
+ X(CFG_CLAUSE_RESPONSE_POLICY, "response-policy") \
+ X(CFG_CLAUSE_RESPONSES_PER_SECOND, "responses-per-second") \
+ X(CFG_CLAUSE_RETIRE_SAFETY, "retire-safety") \
+ X(CFG_CLAUSE_REUSEPORT, "reuseport") \
+ X(CFG_CLAUSE_RFC2308_TYPE1, "rfc2308-type1") \
+ X(CFG_CLAUSE_RNDCCONF, "rndcconf") \
+ X(CFG_CLAUSE_RNDCKEY, "rndckey") \
+ X(CFG_CLAUSE_ROLE, "role") \
+ X(CFG_CLAUSE_ROOT_DELEGATION_ONLY, "root-delegation-only") \
+ X(CFG_CLAUSE_ROOT_KEY_SENTINEL, "root-key-sentinel") \
+ X(CFG_CLAUSE_RPZ, "rpz") \
+ X(CFG_CLAUSE_RPZ_TUPLE, "rpz tuple") \
+ X(CFG_CLAUSE_RRSET_ORDER, "rrset-order") \
+ X(CFG_CLAUSE_RRSETORDER, "rrsetorder") \
+ X(CFG_CLAUSE_SALT_LENGTH, "salt-length") \
+ X(CFG_CLAUSE_SEARCH, "search") \
+ X(CFG_CLAUSE_SECRET, "secret") \
+ X(CFG_CLAUSE_SECROOTS_FILE, "secroots-file") \
+ X(CFG_CLAUSE_SEND_COOKIE, "send-cookie") \
+ X(CFG_CLAUSE_SEND_REPORT_CHANNEL, "send-report-channel") \
+ X(CFG_CLAUSE_SERIAL_QUERIES, "serial-queries") \
+ X(CFG_CLAUSE_SERIAL_QUERY_RATE, "serial-query-rate") \
+ X(CFG_CLAUSE_SERIAL_UPDATE_METHOD, "serial-update-method") \
+ X(CFG_CLAUSE_SERVER, "server") \
+ X(CFG_CLAUSE_SERVER_ADDRESSES, "server-addresses") \
+ X(CFG_CLAUSE_SERVER_ID, "server-id") \
+ X(CFG_CLAUSE_SERVERID, "serverid") \
+ X(CFG_CLAUSE_SERVER_LIST, "server-list") \
+ X(CFG_CLAUSE_SERVER_NAMES, "server-names") \
+ X(CFG_CLAUSE_SERVFAIL_TTL, "servfail-ttl") \
+ X(CFG_CLAUSE_SERVFAIL_UNTIL_READY, "servfail-until-ready") \
+ X(CFG_CLAUSE_SESSIONKEY, "sessionkey") \
+ X(CFG_CLAUSE_SESSION_KEYALG, "session-keyalg") \
+ X(CFG_CLAUSE_SESSION_KEYFILE, "session-keyfile") \
+ X(CFG_CLAUSE_SESSION_KEYNAME, "session-keyname") \
+ X(CFG_CLAUSE_SESSION_TICKETS, "session-tickets") \
+ X(CFG_CLAUSE_SEVERITY, "severity") \
+ X(CFG_CLAUSE_SIG0CHECKS_QUOTA, "sig0checks-quota") \
+ X(CFG_CLAUSE_SIG0CHECKS_QUOTA_EXEMPT, "sig0checks-quota-exempt") \
+ X(CFG_CLAUSE_SIG0KEY_CHECKS_LIMIT, "sig0key-checks-limit") \
+ X(CFG_CLAUSE_SIG0MESSAGE_CHECKS_LIMIT, "sig0message-checks-limit") \
+ X(CFG_CLAUSE_SIGNATURES_JITTER, "signatures-jitter") \
+ X(CFG_CLAUSE_SIGNATURES_REFRESH, "signatures-refresh") \
+ X(CFG_CLAUSE_SIGNATURES_VALIDITY, "signatures-validity") \
+ X(CFG_CLAUSE_SIGNATURES_VALIDITY_DNSKEY, "signatures-validity-dnskey") \
+ X(CFG_CLAUSE_SIG_SIGNING_NODES, "sig-signing-nodes") \
+ X(CFG_CLAUSE_SIG_SIGNING_SIGNATURES, "sig-signing-signatures") \
+ X(CFG_CLAUSE_SIG_SIGNING_TYPE, "sig-signing-type") \
+ X(CFG_CLAUSE_SIG_VALIDITY_INTERVAL, "sig-validity-interval") \
+ X(CFG_CLAUSE_SIPHASH24, "siphash24") \
+ X(CFG_CLAUSE_SIT_SECRET, "sit-secret") \
+ X(CFG_CLAUSE_SIZE, "size") \
+ X(CFG_CLAUSE_SIZEVAL, "sizeval") \
+ X(CFG_CLAUSE_SLIP, "slip") \
+ X(CFG_CLAUSE_SOCKADDRNAMEPORT_ELEMENT, "sockaddrnameport_element") \
+ X(CFG_CLAUSE_SORTLIST, "sortlist") \
+ X(CFG_CLAUSE_SOURCE, "source") \
+ X(CFG_CLAUSE_SOURCE_ADDRESS, "source-address") \
+ X(CFG_CLAUSE_SOURCE_ADDRESS_V6, "source-address-v6") \
+ X(CFG_CLAUSE_SOURCE_V6, "source-v6") \
+ X(CFG_CLAUSE_STACKSIZE, "stacksize") \
+ X(CFG_CLAUSE_STALE_ANSWER_CLIENT_TIMEOUT, "stale-answer-client-timeout") \
+ X(CFG_CLAUSE_STALE_ANSWER_ENABLE, "stale-answer-enable") \
+ X(CFG_CLAUSE_STALE_ANSWER_TTL, "stale-answer-ttl") \
+ X(CFG_CLAUSE_STALE_CACHE_ENABLE, "stale-cache-enable") \
+ X(CFG_CLAUSE_STALE_REFRESH_TIME, "stale-refresh-time") \
+ X(CFG_CLAUSE_STARTUP_NOTIFY_RATE, "startup-notify-rate") \
+ X(CFG_CLAUSE_STATIC_KEY, "static-key") \
+ X(CFG_CLAUSE_STATISTICS_CHANNELS, "statistics-channels") \
+ X(CFG_CLAUSE_STATISTICS_FILE, "statistics-file") \
+ X(CFG_CLAUSE_STATISTICS_INTERVAL, "statistics-interval") \
+ X(CFG_CLAUSE_STDERR, "stderr") \
+ X(CFG_CLAUSE_STREAMS_PER_CONNECTION, "streams-per-connection") \
+ X(CFG_CLAUSE_STRICT, "strict") \
+ X(CFG_CLAUSE_SUFFIX, "suffix") \
+ X(CFG_CLAUSE_SUPPORT_IXFR, "support-ixfr") \
+ X(CFG_CLAUSE_SUPPRESS_INITIAL_NOTIFY, "suppress-initial-notify") \
+ X(CFG_CLAUSE_SYNTH_FROM_DNSSEC, "synth-from-dnssec") \
+ X(CFG_CLAUSE_SYSLOG, "syslog") \
+ X(CFG_CLAUSE_TAG_MAX, "tag-max") \
+ X(CFG_CLAUSE_TAG_MIN, "tag-min") \
+ X(CFG_CLAUSE_TAG_RANGE, "tag-range") \
+ X(CFG_CLAUSE_TAGRANGE, "tagrange") \
+ X(CFG_CLAUSE_TCP_ADVERTISED_TIMEOUT, "tcp-advertised-timeout") \
+ X(CFG_CLAUSE_TCP_CLIENTS, "tcp-clients") \
+ X(CFG_CLAUSE_TCP_IDLE_TIMEOUT, "tcp-idle-timeout") \
+ X(CFG_CLAUSE_TCP_INITIAL_TIMEOUT, "tcp-initial-timeout") \
+ X(CFG_CLAUSE_TCP_KEEPALIVE, "tcp-keepalive") \
+ X(CFG_CLAUSE_TCP_KEEPALIVE_TIMEOUT, "tcp-keepalive-timeout") \
+ X(CFG_CLAUSE_TCP_LISTEN_QUEUE, "tcp-listen-queue") \
+ X(CFG_CLAUSE_TCP_ONLY, "tcp-only") \
+ X(CFG_CLAUSE_TCP_PRIMARIES_TIMEOUT, "tcp-primaries-timeout") \
+ X(CFG_CLAUSE_TCP_RECEIVE_BUFFER, "tcp-receive-buffer") \
+ X(CFG_CLAUSE_TCP_REUSE_TIMEOUT, "tcp-reuse-timeout") \
+ X(CFG_CLAUSE_TCP_SEND_BUFFER, "tcp-send-buffer") \
+ X(CFG_CLAUSE_TEMPLATE, "template") \
+ X(CFG_CLAUSE_TIME_MINUTES, "time_minutes") \
+ X(CFG_CLAUSE_TKEY_DHKEY, "tkey-dhkey") \
+ X(CFG_CLAUSE_TKEY_DOMAIN, "tkey-domain") \
+ X(CFG_CLAUSE_TKEY_GSSAPI_CREDENTIAL, "tkey-gssapi-credential") \
+ X(CFG_CLAUSE_TKEY_GSSAPI_KEYTAB, "tkey-gssapi-keytab") \
+ X(CFG_CLAUSE_TLS, "tls") \
+ X(CFG_CLAUSE_TLSCONF, "tlsconf") \
+ X(CFG_CLAUSE_TLS_PORT, "tls-port") \
+ X(CFG_CLAUSE_TLS_PROTOCOLS, "tls_protocols") \
+ X(CFG_CLAUSE_TOPOLOGY, "topology") \
+ X(CFG_CLAUSE_TRAFFIC_BYTES, "traffic_bytes") \
+ X(CFG_CLAUSE_TRANSFER_FORMAT, "transfer-format") \
+ X(CFG_CLAUSE_TRANSFER_MESSAGE_SIZE, "transfer-message-size") \
+ X(CFG_CLAUSE_TRANSFERS, "transfers") \
+ X(CFG_CLAUSE_TRANSFERS_IN, "transfers-in") \
+ X(CFG_CLAUSE_TRANSFER_SOURCE, "transfer-source") \
+ X(CFG_CLAUSE_TRANSFER_SOURCE_V6, "transfer-source-v6") \
+ X(CFG_CLAUSE_TRANSFERS_OUT, "transfers-out") \
+ X(CFG_CLAUSE_TRANSFERS_PER_NS, "transfers-per-ns") \
+ X(CFG_CLAUSE_TRANSPORT, "transport") \
+ X(CFG_CLAUSE_TREAT_CR_AS_SPACE, "treat-cr-as-space") \
+ X(CFG_CLAUSE_TRIGGER, "trigger") \
+ X(CFG_CLAUSE_TRUST_ANCHORS, "trust-anchors") \
+ X(CFG_CLAUSE_TRUST_ANCHOR_TELEMETRY, "trust-anchor-telemetry") \
+ X(CFG_CLAUSE_TRUSTED_KEYS, "trusted-keys") \
+ X(CFG_CLAUSE_TRY_TCP_REFRESH, "try-tcp-refresh") \
+ X(CFG_CLAUSE_TUPLE, "tuple") \
+ X(CFG_CLAUSE_TYPE, "type") \
+ X(CFG_CLAUSE_TYPES, "types") \
+ X(CFG_CLAUSE_UDP_RECEIVE_BUFFER, "udp-receive-buffer") \
+ X(CFG_CLAUSE_UDP_SEND_BUFFER, "udp-send-buffer") \
+ X(CFG_CLAUSE_UNIX, "unix") \
+ X(CFG_CLAUSE_UNLIMITED, "unlimited") \
+ X(CFG_CLAUSE_UPDATE_CHECK_KSK, "update-check-ksk") \
+ X(CFG_CLAUSE_UPDATE_POLICY, "update-policy") \
+ X(CFG_CLAUSE_UPDATE_QUOTA, "update-quota") \
+ X(CFG_CLAUSE_USE_ALT_TRANSFER_SOURCE, "use-alt-transfer-source") \
+ X(CFG_CLAUSE_USE_ID_POOL, "use-id-pool") \
+ X(CFG_CLAUSE_USE_IXFR, "use-ixfr") \
+ X(CFG_CLAUSE_USE_QUERYPORT_POOL, "use-queryport-pool") \
+ X(CFG_CLAUSE_USE_V4_UDP_PORTS, "use-v4-udp-ports") \
+ X(CFG_CLAUSE_USE_V6_UDP_PORTS, "use-v6-udp-ports") \
+ X(CFG_CLAUSE_V6_BIAS, "v6-bias") \
+ X(CFG_CLAUSE_VALIDATE_EXCEPT, "validate-except") \
+ X(CFG_CLAUSE_VALIDITY, "validity") \
+ X(CFG_CLAUSE_VALUE, "value") \
+ X(CFG_CLAUSE_VERSION, "version") \
+ X(CFG_CLAUSE_VERSIONS, "versions") \
+ X(CFG_CLAUSE_VIEW, "view") \
+ X(CFG_CLAUSE_WARN, "warn") \
+ X(CFG_CLAUSE_WINDOW, "window") \
+ X(CFG_CLAUSE_ZERO_NO_SOA_TTL, "zero-no-soa-ttl") \
+ X(CFG_CLAUSE_ZERO_NO_SOA_TTL_CACHE, "zero-no-soa-ttl-cache") \
+ X(CFG_CLAUSE_ZONE, "zone") \
+ X(CFG_CLAUSE_ZONE_DIRECTORY, "zone-directory") \
+ X(CFG_CLAUSE_ZONE_LIST, "zone list") \
+ X(CFG_CLAUSE_ZONE_NAME, "zone name") \
+ X(CFG_CLAUSE_ZONEOPTS, "zoneopts") \
+ X(CFG_CLAUSE_ZONE_PROPAGATION_DELAY, "zone-propagation-delay") \
+ X(CFG_CLAUSE_ZONESTAT, "zonestat") \
+ X(CFG_CLAUSE_ZONE_STATISTICS, "zone-statistics") \
+ X(CFG_CLAUSE_ZONETYPE, "zonetype")
+
+/* clang-format on */
+
+enum cfg_clause {
+ CFG_CLAUSE__NONE = 0,
+#define X(name, str) name,
+ CFG_CLAUSES
+#undef X
+ CFG_CLAUSE__COUNT
+};
+
+extern const char *cfg_clause_as_string[];
diff --git a/lib/isccfg/include/isccfg/grammar.h b/lib/isccfg/include/isccfg/grammar.h
index e367707187..1ce2a4d598 100644
--- a/lib/isccfg/include/isccfg/grammar.h
+++ b/lib/isccfg/include/isccfg/grammar.h
@@ -25,6 +25,7 @@
#include <isc/types.h>
#include <isccfg/cfg.h>
+#include <isccfg/clause.h>
#include <isccfg/duration.h>
/*
@@ -87,7 +88,6 @@ enum {
CFG_ZONE_MIRROR = 1 << 23,
};
-typedef struct cfg_clausedef cfg_clausedef_t;
typedef struct cfg_tuplefielddef cfg_tuplefielddef_t;
typedef struct cfg_printer cfg_printer_t;
typedef ISC_LIST(cfg_listelt_t) cfg_list_t;
@@ -138,7 +138,7 @@ typedef void (*cfg_mergefunc_t)(const cfg_obj_t *config,
const cfg_obj_t *defaultobj);
struct cfg_clausedef {
- const char *name;
+ enum cfg_clause name;
cfg_type_t *type;
unsigned int flags;
cfg_mergefunc_t merge;
@@ -625,7 +625,7 @@ cfg_is_enum(const char *s, const char *const *enums);
/*%< Return true iff the string 's' is one of the strings in 'enums' */
bool
-cfg_clause_validforzone(const char *name, unsigned int ztype);
+cfg_clause_validforzone(enum cfg_clause name, unsigned int ztype);
/*%<
* Check whether an option is legal for the specified zone type.
*/
diff --git a/lib/isccfg/kaspconf.c b/lib/isccfg/kaspconf.c
index 0b1593c4cf..1002542b82 100644
--- a/lib/isccfg/kaspconf.c
+++ b/lib/isccfg/kaspconf.c
@@ -33,6 +33,7 @@
#include <dst/dst.h>
#include <isccfg/cfg.h>
+#include <isccfg/clause.h>
#include <isccfg/duration.h>
#include <isccfg/kaspconf.h>
#include <isccfg/namedconf.h>
@@ -76,7 +77,8 @@ kaspcfg_log(const cfg_obj_t *config, int level, const char *fmt, ...) {
* Utility function for getting a configuration option.
*/
static isc_result_t
-confget(cfg_obj_t const *const *maps, const char *name, const cfg_obj_t **obj) {
+confget(cfg_obj_t const *const *maps, enum cfg_clause name,
+ const cfg_obj_t **obj) {
for (size_t i = 0;; i++) {
if (maps[i] == NULL) {
return ISC_R_NOTFOUND;
@@ -110,7 +112,7 @@ parse_duration(const char *str) {
* Utility function for configuring durations.
*/
static uint32_t
-get_duration(const cfg_obj_t **maps, const char *option, const char *dfl) {
+get_duration(const cfg_obj_t **maps, enum cfg_clause option, const char *dfl) {
const cfg_obj_t *obj;
isc_result_t result;
obj = NULL;
@@ -127,7 +129,7 @@ get_duration(const cfg_obj_t **maps, const char *option, const char *dfl) {
* Utility function for configuring strings.
*/
static const char *
-get_string(const cfg_obj_t **maps, const char *option) {
+get_string(const cfg_obj_t **maps, enum cfg_clause option) {
const cfg_obj_t *obj;
isc_result_t result;
obj = NULL;
@@ -630,15 +632,15 @@ cfg_kasp_fromconfig(const cfg_obj_t *config, dns_kasp_t *default_kasp,
maps[i] = NULL;
/* Configuration: Signatures */
- sigjitter = get_duration(maps, "signatures-jitter",
+ sigjitter = get_duration(maps, CFG_CLAUSE_SIGNATURES_JITTER,
DNS_KASP_SIG_JITTER);
dns_kasp_setsigjitter(kasp, sigjitter);
- sigrefresh = get_duration(maps, "signatures-refresh",
+ sigrefresh = get_duration(maps, CFG_CLAUSE_SIGNATURES_REFRESH,
DNS_KASP_SIG_REFRESH);
dns_kasp_setsigrefresh(kasp, sigrefresh);
- sigvalidity = get_duration(maps, "signatures-validity-dnskey",
+ sigvalidity = get_duration(maps, CFG_CLAUSE_SIGNATURES_VALIDITY_DNSKEY,
DNS_KASP_SIG_VALIDITY_DNSKEY);
if (sigrefresh >= (sigvalidity * 0.9)) {
if (log_errors) {
@@ -663,7 +665,7 @@ cfg_kasp_fromconfig(const cfg_obj_t *config, dns_kasp_t *default_kasp,
result = ISC_R_FAILURE;
}
- sigvalidity = get_duration(maps, "signatures-validity",
+ sigvalidity = get_duration(maps, CFG_CLAUSE_SIGNATURES_VALIDITY,
DNS_KASP_SIG_VALIDITY);
if (sigrefresh >= (sigvalidity * 0.9)) {
if (log_errors) {
@@ -693,7 +695,7 @@ cfg_kasp_fromconfig(const cfg_obj_t *config, dns_kasp_t *default_kasp,
}
/* Configuration: Zone settings */
- (void)confget(maps, "inline-signing", &inlinesigning);
+ (void)confget(maps, CFG_CLAUSE_INLINE_SIGNING, &inlinesigning);
if (inlinesigning != NULL && cfg_obj_isboolean(inlinesigning)) {
dns_kasp_setinlinesigning(kasp,
cfg_obj_asboolean(inlinesigning));
@@ -702,44 +704,46 @@ cfg_kasp_fromconfig(const cfg_obj_t *config, dns_kasp_t *default_kasp,
}
obj = NULL;
- (void)confget(maps, "manual-mode", &obj);
+ (void)confget(maps, CFG_CLAUSE_MANUAL_MODE, &obj);
if (obj != NULL) {
manual_mode = cfg_obj_asboolean(obj);
}
dns_kasp_setmanualmode(kasp, manual_mode);
- maxttl = get_duration(maps, "max-zone-ttl", DNS_KASP_ZONE_MAXTTL);
+ maxttl = get_duration(maps, CFG_CLAUSE_MAX_ZONE_TTL,
+ DNS_KASP_ZONE_MAXTTL);
dns_kasp_setzonemaxttl(kasp, maxttl);
- zonepropdelay = get_duration(maps, "zone-propagation-delay",
+ zonepropdelay = get_duration(maps, CFG_CLAUSE_ZONE_PROPAGATION_DELAY,
DNS_KASP_ZONE_PROPDELAY);
dns_kasp_setzonepropagationdelay(kasp, zonepropdelay);
/* Configuration: Parent settings */
- dsttl = get_duration(maps, "parent-ds-ttl", DNS_KASP_DS_TTL);
+ dsttl = get_duration(maps, CFG_CLAUSE_PARENT_DS_TTL, DNS_KASP_DS_TTL);
dns_kasp_setdsttl(kasp, dsttl);
- parentpropdelay = get_duration(maps, "parent-propagation-delay",
+ parentpropdelay = get_duration(maps,
+ CFG_CLAUSE_PARENT_PROPAGATION_DELAY,
DNS_KASP_PARENT_PROPDELAY);
dns_kasp_setparentpropagationdelay(kasp, parentpropdelay);
/* Configuration: Keys */
obj = NULL;
- (void)confget(maps, "offline-ksk", &obj);
+ (void)confget(maps, CFG_CLAUSE_OFFLINE_KSK, &obj);
if (obj != NULL) {
offline_ksk = cfg_obj_asboolean(obj);
}
dns_kasp_setofflineksk(kasp, offline_ksk);
obj = NULL;
- (void)confget(maps, "cdnskey", &obj);
+ (void)confget(maps, CFG_CLAUSE_CDNSKEY, &obj);
if (obj != NULL) {
dns_kasp_setcdnskey(kasp, cfg_obj_asboolean(obj));
} else {
dns_kasp_setcdnskey(kasp, true);
}
- (void)confget(maps, "cds-digest-types", &cds);
+ (void)confget(maps, CFG_CLAUSE_CDS_DIGEST_TYPES, &cds);
if (cds != NULL) {
CFG_LIST_FOREACH(cds, element) {
CHECK(add_digest(kasp, cfg_listelt_value(element),
@@ -749,19 +753,19 @@ cfg_kasp_fromconfig(const cfg_obj_t *config, dns_kasp_t *default_kasp,
dns_kasp_adddigest(kasp, DNS_DSDIGEST_SHA256);
}
- dnskeyttl = get_duration(maps, "dnskey-ttl", DNS_KASP_KEY_TTL);
+ dnskeyttl = get_duration(maps, CFG_CLAUSE_DNSKEY_TTL, DNS_KASP_KEY_TTL);
dns_kasp_setdnskeyttl(kasp, dnskeyttl);
- publishsafety = get_duration(maps, "publish-safety",
+ publishsafety = get_duration(maps, CFG_CLAUSE_PUBLISH_SAFETY,
DNS_KASP_PUBLISH_SAFETY);
dns_kasp_setpublishsafety(kasp, publishsafety);
- retiresafety = get_duration(maps, "retire-safety",
+ retiresafety = get_duration(maps, CFG_CLAUSE_RETIRE_SAFETY,
DNS_KASP_RETIRE_SAFETY);
dns_kasp_setretiresafety(kasp, retiresafety);
- dns_kasp_setpurgekeys(
- kasp, get_duration(maps, "purge-keys", DNS_KASP_PURGE_KEYS));
+ dns_kasp_setpurgekeys(kasp, get_duration(maps, CFG_CLAUSE_PURGE_KEYS,
+ DNS_KASP_PURGE_KEYS));
ipub = dnskeyttl + publishsafety + zonepropdelay;
iret = dsttl + retiresafety + parentpropdelay;
@@ -771,7 +775,7 @@ cfg_kasp_fromconfig(const cfg_obj_t *config, dns_kasp_t *default_kasp,
zonepropdelay;
zsk_min_lifetime = ISC_MAX(ipub, iret);
- (void)confget(maps, "keys", &keys);
+ (void)confget(maps, CFG_CLAUSE_KEYS, &keys);
if (keys != NULL) {
char role[DST_MAX_ALGS] = { 0 };
bool warn[DST_MAX_ALGS][2] = { { false } };
@@ -893,7 +897,7 @@ cfg_kasp_fromconfig(const cfg_obj_t *config, dns_kasp_t *default_kasp,
}
/* Configuration: NSEC3 */
- (void)confget(maps, "nsec3param", &nsec3);
+ (void)confget(maps, CFG_CLAUSE_NSEC3PARAM, &nsec3);
if (nsec3 == NULL) {
if (default_kasp != NULL && dns_kasp_nsec3(default_kasp)) {
dns_kasp_setnsec3param(
@@ -1068,10 +1072,10 @@ cfg_keystore_fromconfig(const cfg_obj_t *config, isc_mem_t *mctx,
koptions = cfg_tuple_get(config, "options");
maps[i++] = koptions;
maps[i] = NULL;
- dns_keystore_setdirectory(keystore,
- get_string(maps, "directory"));
- dns_keystore_setpkcs11uri(keystore,
- get_string(maps, "pkcs11-uri"));
+ dns_keystore_setdirectory(
+ keystore, get_string(maps, CFG_CLAUSE_DIRECTORY));
+ dns_keystore_setpkcs11uri(
+ keystore, get_string(maps, CFG_CLAUSE_PKCS11_URI));
}
/* Append it to the list for future lookups. */
diff --git a/lib/isccfg/meson.build b/lib/isccfg/meson.build
index 87dc349f40..9da92965a0 100644
--- a/lib/isccfg/meson.build
+++ b/lib/isccfg/meson.build
@@ -13,6 +13,7 @@ isccfg_srcset.add(
files(
'aclconf.c',
'check.c',
+ 'clause.c',
'duration.c',
'kaspconf.c',
'namedconf.c',
diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c
index a2567befbd..37e6974225 100644
--- a/lib/isccfg/namedconf.c
+++ b/lib/isccfg/namedconf.c
@@ -28,6 +28,7 @@
#include <dns/ttl.h>
#include <isccfg/cfg.h>
+#include <isccfg/clause.h>
#include <isccfg/grammar.h>
#include <isccfg/namedconf.h>
@@ -1201,8 +1202,8 @@ map_merge(const cfg_obj_t *config ISC_ATTR_UNUSED, cfg_obj_t *effectivemap,
if (effectiveres == ISC_R_NOTFOUND &&
defaultres == ISC_R_SUCCESS)
{
- INSIST(cfg_map_add(effectivemap, defaultobj, clause) ==
- ISC_R_SUCCESS);
+ INSIST(cfg_map_addclone(effectivemap, defaultobj,
+ clause) == ISC_R_SUCCESS);
continue;
}
@@ -1225,18 +1226,18 @@ policy_merge(const cfg_obj_t *config ISC_ATTR_UNUSED, cfg_obj_t *eff,
}
static void
-cloneto(cfg_obj_t *options, const cfg_obj_t *obj, const char *clausename) {
+cloneto(cfg_obj_t *options, const cfg_obj_t *obj, enum cfg_clause clausename) {
isc_result_t result;
const cfg_clausedef_t *clause = cfg_map_findclause(options->type,
clausename);
- result = cfg_map_add(options, obj, clause);
+ result = cfg_map_addclone(options, obj, clause);
INSIST(result == ISC_R_SUCCESS);
}
static void
setdefaultacl(cfg_obj_t *options, const cfg_obj_t *defaultoptions,
- const char *aclname) {
+ enum cfg_clause aclname) {
const cfg_obj_t *obj = NULL;
isc_result_t result;
@@ -1253,7 +1254,7 @@ setdefaultacl(cfg_obj_t *options, const cfg_obj_t *defaultoptions,
}
static const cfg_obj_t *
-aclobj(const cfg_obj_t *o, const cfg_obj_t *v, const char *name) {
+aclobj(const cfg_obj_t *o, const cfg_obj_t *v, enum cfg_clause name) {
const cfg_obj_t *obj = NULL;
cfg_map_get(v, name, &obj);
@@ -1270,7 +1271,7 @@ setacls(const cfg_obj_t *config, cfg_obj_t *voptions,
const cfg_obj_t *query = NULL, *cache = NULL, *cacheon = NULL;
const cfg_obj_t *recursion = NULL, *recursionon = NULL;
- cfg_map_get(config, "options", &options);
+ cfg_map_get(config, CFG_CLAUSE_OPTIONS, &options);
INSIST(options != NULL);
/*
@@ -1280,12 +1281,12 @@ setacls(const cfg_obj_t *config, cfg_obj_t *voptions,
INSIST((options == voptions && defaultoptions != NULL) ||
(options != voptions && defaultoptions == NULL));
- query = aclobj(options, voptions, "allow-query");
- recursion = aclobj(options, voptions, "allow-recursion");
- cache = aclobj(options, voptions, "allow-query-cache");
+ query = aclobj(options, voptions, CFG_CLAUSE_ALLOW_QUERY);
+ recursion = aclobj(options, voptions, CFG_CLAUSE_ALLOW_RECURSION);
+ cache = aclobj(options, voptions, CFG_CLAUSE_ALLOW_QUERY_CACHE);
- cacheon = aclobj(options, voptions, "allow-query-cache-on");
- recursionon = aclobj(options, voptions, "allow-recursion-on");
+ cacheon = aclobj(options, voptions, CFG_CLAUSE_ALLOW_QUERY_CACHE_ON);
+ recursionon = aclobj(options, voptions, CFG_CLAUSE_ALLOW_RECURSION_ON);
bool aq = query != NULL && !query->cloned;
bool aqc = cache != NULL && !cache->cloned;
@@ -1300,9 +1301,10 @@ setacls(const cfg_obj_t *config, cfg_obj_t *voptions,
*/
if (!aqc) {
if (ar) {
- cloneto(voptions, recursion, "allow-query-cache");
+ cloneto(voptions, recursion,
+ CFG_CLAUSE_ALLOW_QUERY_CACHE);
} else if (aq) {
- cloneto(voptions, query, "allow-query-cache");
+ cloneto(voptions, query, CFG_CLAUSE_ALLOW_QUERY_CACHE);
}
}
@@ -1312,9 +1314,9 @@ setacls(const cfg_obj_t *config, cfg_obj_t *voptions,
*/
if (!ar) {
if (aqc) {
- cloneto(voptions, cache, "allow-recursion");
+ cloneto(voptions, cache, CFG_CLAUSE_ALLOW_RECURSION);
} else if (aq) {
- cloneto(voptions, query, "allow-recursion");
+ cloneto(voptions, query, CFG_CLAUSE_ALLOW_RECURSION);
}
}
@@ -1323,9 +1325,9 @@ setacls(const cfg_obj_t *config, cfg_obj_t *voptions,
* if set, and vice versa.
*/
if (!aqco && aro) {
- cloneto(voptions, recursionon, "allow-query-cache-on");
+ cloneto(voptions, recursionon, CFG_CLAUSE_ALLOW_QUERY_CACHE_ON);
} else if (!aro && aqco) {
- cloneto(voptions, cacheon, "allow-recursion-on");
+ cloneto(voptions, cacheon, CFG_CLAUSE_ALLOW_RECURSION_ON);
}
if (options == voptions) {
@@ -1334,10 +1336,14 @@ setacls(const cfg_obj_t *config, cfg_obj_t *voptions,
* of the default ACL if they are not defined. Those will be
* used for user views ACLs too.
*/
- setdefaultacl(voptions, defaultoptions, "allow-query-cache");
- setdefaultacl(voptions, defaultoptions, "allow-recursion");
- setdefaultacl(voptions, defaultoptions, "allow-query-cache-on");
- setdefaultacl(voptions, defaultoptions, "allow-recursion-on");
+ setdefaultacl(voptions, defaultoptions,
+ CFG_CLAUSE_ALLOW_QUERY_CACHE);
+ setdefaultacl(voptions, defaultoptions,
+ CFG_CLAUSE_ALLOW_RECURSION);
+ setdefaultacl(voptions, defaultoptions,
+ CFG_CLAUSE_ALLOW_QUERY_CACHE_ON);
+ setdefaultacl(voptions, defaultoptions,
+ CFG_CLAUSE_ALLOW_RECURSION_ON);
}
}
@@ -1395,43 +1401,46 @@ view_merge(const cfg_obj_t *config, cfg_obj_t *eff, const cfg_obj_t *def) {
* file only.
*/
static cfg_clausedef_t namedconf_clauses[] = {
- { "acl", &cfg_type_acl, CFG_CLAUSEFLAG_MULTI, NULL },
- { "controls", &cfg_type_controls, CFG_CLAUSEFLAG_MULTI, NULL },
- { "dnssec-policy", &cfg_type_dnssecpolicy, CFG_CLAUSEFLAG_MULTI,
- policy_merge },
+ { CFG_CLAUSE_ACL, &cfg_type_acl, CFG_CLAUSEFLAG_MULTI, NULL },
+ { CFG_CLAUSE_CONTROLS, &cfg_type_controls, CFG_CLAUSEFLAG_MULTI, NULL },
+ { CFG_CLAUSE_DNSSEC_POLICY, &cfg_type_dnssecpolicy,
+ CFG_CLAUSEFLAG_MULTI, policy_merge },
#if HAVE_LIBNGHTTP2
- { "http", &cfg_type_http_description,
+ { CFG_CLAUSE_HTTP, &cfg_type_http_description,
CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_OPTIONAL, NULL },
#else
- { "http", &cfg_type_http_description,
+ { CFG_CLAUSE_HTTP, &cfg_type_http_description,
CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_NOTCONFIGURED, NULL },
#endif
- { "key-store", &cfg_type_keystore, CFG_CLAUSEFLAG_MULTI, NULL },
- { "logging", &cfg_type_logging, 0, NULL },
- { "lwres", NULL, CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "masters", &cfg_type_serverlist,
+ { CFG_CLAUSE_KEY_STORE, &cfg_type_keystore, CFG_CLAUSEFLAG_MULTI,
+ NULL },
+ { CFG_CLAUSE_LOGGING, &cfg_type_logging, 0, NULL },
+ { CFG_CLAUSE_LWRES, NULL, CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_ANCIENT,
+ NULL },
+ { CFG_CLAUSE_MASTERS, &cfg_type_serverlist,
CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_NODOC, NULL },
- { "options", &cfg_type_options, 0, options_merge },
- { "parental-agents", &cfg_type_serverlist,
+ { CFG_CLAUSE_OPTIONS, &cfg_type_options, 0, options_merge },
+ { CFG_CLAUSE_PARENTAL_AGENTS, &cfg_type_serverlist,
CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_NODOC, NULL },
- { "primaries", &cfg_type_serverlist,
+ { CFG_CLAUSE_PRIMARIES, &cfg_type_serverlist,
CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_NODOC, NULL },
- { "remote-servers", &cfg_type_serverlist, CFG_CLAUSEFLAG_MULTI, NULL },
+ { CFG_CLAUSE_REMOTE_SERVERS, &cfg_type_serverlist, CFG_CLAUSEFLAG_MULTI,
+ NULL },
#if defined(HAVE_LIBXML2) || defined(HAVE_JSON_C)
- { "statistics-channels", &cfg_type_statschannels,
+ { CFG_CLAUSE_STATISTICS_CHANNELS, &cfg_type_statschannels,
CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_OPTIONAL, NULL },
#else
- { "statistics-channels", &cfg_type_statschannels,
+ { CFG_CLAUSE_STATISTICS_CHANNELS, &cfg_type_statschannels,
CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_NOTCONFIGURED, NULL },
#endif
- { "template", &cfg_type_template, CFG_CLAUSEFLAG_MULTI, NULL },
- { "builtin-trust-anchors", &cfg_type_builtin_dnsseckeys,
+ { CFG_CLAUSE_TEMPLATE, &cfg_type_template, CFG_CLAUSEFLAG_MULTI, NULL },
+ { CFG_CLAUSE_BUILTIN_TRUST_ANCHORS, &cfg_type_builtin_dnsseckeys,
CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_BUILTINONLY |
CFG_CLAUSEFLAG_NODOC,
NULL },
- { "tls", &cfg_type_tlsconf, CFG_CLAUSEFLAG_MULTI, NULL },
- { "view", &cfg_type_view, CFG_CLAUSEFLAG_MULTI, view_merge },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_TLS, &cfg_type_tlsconf, CFG_CLAUSEFLAG_MULTI, NULL },
+ { CFG_CLAUSE_VIEW, &cfg_type_view, CFG_CLAUSEFLAG_MULTI, view_merge },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
/*%
@@ -1439,19 +1448,20 @@ static cfg_clausedef_t namedconf_clauses[] = {
* statement, but not in the options block.
*/
static cfg_clausedef_t namedconf_or_view_clauses[] = {
- { "dlz", &cfg_type_dlz, CFG_CLAUSEFLAG_MULTI, NULL },
- { "dyndb", &cfg_type_dyndb, CFG_CLAUSEFLAG_MULTI, NULL },
- { "key", &cfg_type_key, CFG_CLAUSEFLAG_MULTI, NULL },
- { "managed-keys", &cfg_type_dnsseckeys,
+ { CFG_CLAUSE_DLZ, &cfg_type_dlz, CFG_CLAUSEFLAG_MULTI, NULL },
+ { CFG_CLAUSE_DYNDB, &cfg_type_dyndb, CFG_CLAUSEFLAG_MULTI, NULL },
+ { CFG_CLAUSE_KEY, &cfg_type_key, CFG_CLAUSEFLAG_MULTI, NULL },
+ { CFG_CLAUSE_MANAGED_KEYS, &cfg_type_dnsseckeys,
CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "plugin", &cfg_type_plugin, CFG_CLAUSEFLAG_MULTI, NULL },
- { "server", &cfg_type_server, CFG_CLAUSEFLAG_MULTI, NULL },
- { "trust-anchors", &cfg_type_dnsseckeys, CFG_CLAUSEFLAG_MULTI, NULL },
- { "trusted-keys", NULL, CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_ANCIENT,
- NULL },
- { "zone", &cfg_type_zone, CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_NODOC,
+ { CFG_CLAUSE_PLUGIN, &cfg_type_plugin, CFG_CLAUSEFLAG_MULTI, NULL },
+ { CFG_CLAUSE_SERVER, &cfg_type_server, CFG_CLAUSEFLAG_MULTI, NULL },
+ { CFG_CLAUSE_TRUST_ANCHORS, &cfg_type_dnsseckeys, CFG_CLAUSEFLAG_MULTI,
NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_TRUSTED_KEYS, NULL,
+ CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_ZONE, &cfg_type_zone,
+ CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_NODOC, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
/*%
@@ -1459,12 +1469,13 @@ static cfg_clausedef_t namedconf_or_view_clauses[] = {
* called bind.keys).
*/
static cfg_clausedef_t bindkeys_clauses[] = {
- { "managed-keys", &cfg_type_dnsseckeys,
+ { CFG_CLAUSE_MANAGED_KEYS, &cfg_type_dnsseckeys,
CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "trust-anchors", &cfg_type_dnsseckeys, CFG_CLAUSEFLAG_MULTI, NULL },
- { "trusted-keys", NULL, CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_ANCIENT,
+ { CFG_CLAUSE_TRUST_ANCHORS, &cfg_type_dnsseckeys, CFG_CLAUSEFLAG_MULTI,
NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_TRUSTED_KEYS, NULL,
+ CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
static const char *fstrm_model_enums[] = { "mpsc", "spsc", NULL };
@@ -1477,166 +1488,176 @@ static cfg_type_t cfg_type_fstrm_model = {
* Clauses that can be found within the 'options' statement.
*/
static cfg_clausedef_t options_clauses[] = {
- { "answer-cookie", &cfg_type_boolean, 0, NULL },
- { "automatic-interface-scan", &cfg_type_boolean, 0, NULL },
- { "avoid-v4-udp-ports", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "avoid-v6-udp-ports", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "bindkeys-file", &cfg_type_qstring, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "blackhole", &cfg_type_bracketed_aml, 0, NULL },
- { "cookie-algorithm", &cfg_type_cookiealg, 0, NULL },
- { "cookie-secret", &cfg_type_sstring, CFG_CLAUSEFLAG_MULTI, NULL },
- { "coresize", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "datasize", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "deallocate-on-exit", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "directory", &cfg_type_qstring, CFG_CLAUSEFLAG_CHDIR, NULL },
- { "dnsrps-library", &cfg_type_qstring, CFG_CLAUSEFLAG_OBSOLETE, NULL },
-#ifdef HAVE_DNSTAP
- { "dnstap-output", &cfg_type_dnstapoutput, CFG_CLAUSEFLAG_OPTIONAL,
+ { CFG_CLAUSE_ANSWER_COOKIE, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_AUTOMATIC_INTERFACE_SCAN, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_AVOID_V4_UDP_PORTS, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_AVOID_V6_UDP_PORTS, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_BINDKEYS_FILE, &cfg_type_qstring, CFG_CLAUSEFLAG_ANCIENT,
NULL },
- { "dnstap-identity", &cfg_type_serverid, CFG_CLAUSEFLAG_OPTIONAL,
+ { CFG_CLAUSE_BLACKHOLE, &cfg_type_bracketed_aml, 0, NULL },
+ { CFG_CLAUSE_COOKIE_ALGORITHM, &cfg_type_cookiealg, 0, NULL },
+ { CFG_CLAUSE_COOKIE_SECRET, &cfg_type_sstring, CFG_CLAUSEFLAG_MULTI,
NULL },
- { "dnstap-version", &cfg_type_qstringornone, CFG_CLAUSEFLAG_OPTIONAL,
+ { CFG_CLAUSE_CORESIZE, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_DATASIZE, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_DEALLOCATE_ON_EXIT, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_DIRECTORY, &cfg_type_qstring, CFG_CLAUSEFLAG_CHDIR, NULL },
+ { CFG_CLAUSE_DNSRPS_LIBRARY, &cfg_type_qstring, CFG_CLAUSEFLAG_OBSOLETE,
NULL },
+#ifdef HAVE_DNSTAP
+ { CFG_CLAUSE_DNSTAP_OUTPUT, &cfg_type_dnstapoutput,
+ CFG_CLAUSEFLAG_OPTIONAL, NULL },
+ { CFG_CLAUSE_DNSTAP_IDENTITY, &cfg_type_serverid,
+ CFG_CLAUSEFLAG_OPTIONAL, NULL },
+ { CFG_CLAUSE_DNSTAP_VERSION, &cfg_type_qstringornone,
+ CFG_CLAUSEFLAG_OPTIONAL, NULL },
#else /* ifdef HAVE_DNSTAP */
- { "dnstap-output", &cfg_type_dnstapoutput, CFG_CLAUSEFLAG_NOTCONFIGURED,
- NULL },
- { "dnstap-identity", &cfg_type_serverid, CFG_CLAUSEFLAG_NOTCONFIGURED,
- NULL },
- { "dnstap-version", &cfg_type_qstringornone,
+ { CFG_CLAUSE_DNSTAP_OUTPUT, &cfg_type_dnstapoutput,
+ CFG_CLAUSEFLAG_NOTCONFIGURED, NULL },
+ { CFG_CLAUSE_DNSTAP_IDENTITY, &cfg_type_serverid,
+ CFG_CLAUSEFLAG_NOTCONFIGURED, NULL },
+ { CFG_CLAUSE_DNSTAP_VERSION, &cfg_type_qstringornone,
CFG_CLAUSEFLAG_NOTCONFIGURED, NULL },
#endif /* ifdef HAVE_DNSTAP */
- { "dscp", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "dump-file", &cfg_type_qstring, 0, NULL },
- { "fake-iquery", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "files", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "flush-zones-on-shutdown", &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_DSCP, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_DUMP_FILE, &cfg_type_qstring, 0, NULL },
+ { CFG_CLAUSE_FAKE_IQUERY, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_FILES, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_FLUSH_ZONES_ON_SHUTDOWN, &cfg_type_boolean, 0, NULL },
#ifdef HAVE_DNSTAP
- { "fstrm-set-buffer-hint", &cfg_type_uint32, CFG_CLAUSEFLAG_OPTIONAL,
- NULL },
- { "fstrm-set-flush-timeout", &cfg_type_uint32, CFG_CLAUSEFLAG_OPTIONAL,
- NULL },
- { "fstrm-set-input-queue-size", &cfg_type_uint32,
+ { CFG_CLAUSE_FSTRM_SET_BUFFER_HINT, &cfg_type_uint32,
+ CFG_CLAUSEFLAG_OPTIONAL, NULL },
+ { CFG_CLAUSE_FSTRM_SET_FLUSH_TIMEOUT, &cfg_type_uint32,
+ CFG_CLAUSEFLAG_OPTIONAL, NULL },
+ { CFG_CLAUSE_FSTRM_SET_INPUT_QUEUE_SIZE, &cfg_type_uint32,
CFG_CLAUSEFLAG_OPTIONAL, NULL },
- { "fstrm-set-output-notify-threshold", &cfg_type_uint32,
+ { CFG_CLAUSE_FSTRM_SET_OUTPUT_NOTIFY_THRESHOLD, &cfg_type_uint32,
CFG_CLAUSEFLAG_OPTIONAL, NULL },
- { "fstrm-set-output-queue-model", &cfg_type_fstrm_model,
+ { CFG_CLAUSE_FSTRM_SET_OUTPUT_QUEUE_MODEL, &cfg_type_fstrm_model,
CFG_CLAUSEFLAG_OPTIONAL, NULL },
- { "fstrm-set-output-queue-size", &cfg_type_uint32,
+ { CFG_CLAUSE_FSTRM_SET_OUTPUT_QUEUE_SIZE, &cfg_type_uint32,
CFG_CLAUSEFLAG_OPTIONAL, NULL },
- { "fstrm-set-reopen-interval", &cfg_type_duration,
+ { CFG_CLAUSE_FSTRM_SET_REOPEN_INTERVAL, &cfg_type_duration,
CFG_CLAUSEFLAG_OPTIONAL, NULL },
#else /* ifdef HAVE_DNSTAP */
- { "fstrm-set-buffer-hint", &cfg_type_uint32,
+ { CFG_CLAUSE_FSTRM_SET_BUFFER_HINT, &cfg_type_uint32,
CFG_CLAUSEFLAG_NOTCONFIGURED, NULL },
- { "fstrm-set-flush-timeout", &cfg_type_uint32,
+ { CFG_CLAUSE_FSTRM_SET_FLUSH_TIMEOUT, &cfg_type_uint32,
CFG_CLAUSEFLAG_NOTCONFIGURED, NULL },
- { "fstrm-set-input-queue-size", &cfg_type_uint32,
+ { CFG_CLAUSE_FSTRM_SET_INPUT_QUEUE_SIZE, &cfg_type_uint32,
CFG_CLAUSEFLAG_NOTCONFIGURED, NULL },
- { "fstrm-set-output-notify-threshold", &cfg_type_uint32,
+ { CFG_CLAUSE_FSTRM_SET_OUTPUT_NOTIFY_THRESHOLD, &cfg_type_uint32,
CFG_CLAUSEFLAG_NOTCONFIGURED, NULL },
- { "fstrm-set-output-queue-model", &cfg_type_fstrm_model,
+ { CFG_CLAUSE_FSTRM_SET_OUTPUT_QUEUE_MODEL, &cfg_type_fstrm_model,
CFG_CLAUSEFLAG_NOTCONFIGURED, NULL },
- { "fstrm-set-output-queue-size", &cfg_type_uint32,
+ { CFG_CLAUSE_FSTRM_SET_OUTPUT_QUEUE_SIZE, &cfg_type_uint32,
CFG_CLAUSEFLAG_NOTCONFIGURED, NULL },
- { "fstrm-set-reopen-interval", &cfg_type_duration,
+ { CFG_CLAUSE_FSTRM_SET_REOPEN_INTERVAL, &cfg_type_duration,
CFG_CLAUSEFLAG_NOTCONFIGURED, NULL },
#endif /* HAVE_DNSTAP */
#if defined(HAVE_GEOIP2)
- { "geoip-directory", &cfg_type_qstringornone, 0, NULL },
+ { CFG_CLAUSE_GEOIP_DIRECTORY, &cfg_type_qstringornone, 0, NULL },
#else /* if defined(HAVE_GEOIP2) */
- { "geoip-directory", &cfg_type_qstringornone,
+ { CFG_CLAUSE_GEOIP_DIRECTORY, &cfg_type_qstringornone,
CFG_CLAUSEFLAG_NOTCONFIGURED, NULL },
#endif /* HAVE_GEOIP2 */
- { "geoip-use-ecs", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "has-old-clients", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "heartbeat-interval", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "host-statistics", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "host-statistics-max", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "hostname", &cfg_type_qstringornone, 0, NULL },
- { "interface-interval", &cfg_type_duration, 0, NULL },
- { "keep-response-order", &cfg_type_bracketed_aml,
+ { CFG_CLAUSE_GEOIP_USE_ECS, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_HAS_OLD_CLIENTS, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_HEARTBEAT_INTERVAL, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_HOST_STATISTICS, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_HOST_STATISTICS_MAX, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_HOSTNAME, &cfg_type_qstringornone, 0, NULL },
+ { CFG_CLAUSE_INTERFACE_INTERVAL, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_KEEP_RESPONSE_ORDER, &cfg_type_bracketed_aml,
CFG_CLAUSEFLAG_OBSOLETE, NULL },
- { "listen-on", &cfg_type_listenon, CFG_CLAUSEFLAG_MULTI, NULL },
- { "listen-on-v6", &cfg_type_listenon, CFG_CLAUSEFLAG_MULTI, NULL },
- { "lock-file", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "managed-keys-directory", &cfg_type_qstring, 0, NULL },
- { "match-mapped-addresses", &cfg_type_boolean, 0, NULL },
- { "max-rsa-exponent-size", &cfg_type_uint32, 0, NULL },
- { "memstatistics", &cfg_type_boolean, 0, NULL },
- { "memstatistics-file", &cfg_type_qstring, 0, NULL },
- { "multiple-cnames", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "named-xfer", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "notify-rate", &cfg_type_uint32, 0, NULL },
- { "pid-file", &cfg_type_qstringornone, 0, NULL },
- { "port", &cfg_type_uint32, 0, NULL },
- { "tls-port", &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_LISTEN_ON, &cfg_type_listenon, CFG_CLAUSEFLAG_MULTI,
+ NULL },
+ { CFG_CLAUSE_LISTEN_ON_V6, &cfg_type_listenon, CFG_CLAUSEFLAG_MULTI,
+ NULL },
+ { CFG_CLAUSE_LOCK_FILE, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_MANAGED_KEYS_DIRECTORY, &cfg_type_qstring, 0, NULL },
+ { CFG_CLAUSE_MATCH_MAPPED_ADDRESSES, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_MAX_RSA_EXPONENT_SIZE, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_MEMSTATISTICS, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_MEMSTATISTICS_FILE, &cfg_type_qstring, 0, NULL },
+ { CFG_CLAUSE_MULTIPLE_CNAMES, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_NAMED_XFER, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_NOTIFY_RATE, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_PID_FILE, &cfg_type_qstringornone, 0, NULL },
+ { CFG_CLAUSE_PORT, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_TLS_PORT, &cfg_type_uint32, 0, NULL },
#if HAVE_LIBNGHTTP2
- { "http-port", &cfg_type_uint32, CFG_CLAUSEFLAG_OPTIONAL, NULL },
- { "http-listener-clients", &cfg_type_uint32, CFG_CLAUSEFLAG_OPTIONAL,
+ { CFG_CLAUSE_HTTP_PORT, &cfg_type_uint32, CFG_CLAUSEFLAG_OPTIONAL,
NULL },
- { "http-streams-per-connection", &cfg_type_uint32,
+ { CFG_CLAUSE_HTTP_LISTENER_CLIENTS, &cfg_type_uint32,
CFG_CLAUSEFLAG_OPTIONAL, NULL },
- { "https-port", &cfg_type_uint32, CFG_CLAUSEFLAG_OPTIONAL, NULL },
+ { CFG_CLAUSE_HTTP_STREAMS_PER_CONNECTION, &cfg_type_uint32,
+ CFG_CLAUSEFLAG_OPTIONAL, NULL },
+ { CFG_CLAUSE_HTTPS_PORT, &cfg_type_uint32, CFG_CLAUSEFLAG_OPTIONAL,
+ NULL },
#else
- { "http-port", &cfg_type_uint32, CFG_CLAUSEFLAG_NOTCONFIGURED, NULL },
- { "http-listener-clients", &cfg_type_uint32,
+ { CFG_CLAUSE_HTTP_PORT, &cfg_type_uint32, CFG_CLAUSEFLAG_NOTCONFIGURED,
+ NULL },
+ { CFG_CLAUSE_HTTP_LISTENER_CLIENTS, &cfg_type_uint32,
CFG_CLAUSEFLAG_NOTCONFIGURED, NULL },
- { "http-streams-per-connection", &cfg_type_uint32,
+ { CFG_CLAUSE_HTTP_STREAMS_PER_CONNECTION, &cfg_type_uint32,
CFG_CLAUSEFLAG_NOTCONFIGURED, NULL },
- { "https-port", &cfg_type_uint32, CFG_CLAUSEFLAG_NOTCONFIGURED, NULL },
-#endif
- { "querylog", &cfg_type_boolean, 0, NULL },
- { "random-device", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "recursing-file", &cfg_type_qstring, 0, NULL },
- { "recursive-clients", &cfg_type_uint32, 0, NULL },
- { "reuseport", &cfg_type_boolean, 0, NULL },
- { "reserved-sockets", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "responselog", &cfg_type_boolean, 0, NULL },
- { "secroots-file", &cfg_type_qstring, 0, NULL },
- { "serial-queries", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "serial-query-rate", &cfg_type_uint32, 0, NULL },
- { "server-id", &cfg_type_serverid, 0, NULL },
- { "session-keyalg", &cfg_type_astring, 0, NULL },
- { "session-keyfile", &cfg_type_qstringornone, 0, NULL },
- { "session-keyname", &cfg_type_astring, 0, NULL },
- { "sig0checks-quota", &cfg_type_uint32, CFG_CLAUSEFLAG_EXPERIMENTAL,
+ { CFG_CLAUSE_HTTPS_PORT, &cfg_type_uint32, CFG_CLAUSEFLAG_NOTCONFIGURED,
NULL },
- { "sig0checks-quota-exempt", &cfg_type_bracketed_aml,
+#endif
+ { CFG_CLAUSE_QUERYLOG, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_RANDOM_DEVICE, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_RECURSING_FILE, &cfg_type_qstring, 0, NULL },
+ { CFG_CLAUSE_RECURSIVE_CLIENTS, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_REUSEPORT, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_RESERVED_SOCKETS, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_RESPONSELOG, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_SECROOTS_FILE, &cfg_type_qstring, 0, NULL },
+ { CFG_CLAUSE_SERIAL_QUERIES, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_SERIAL_QUERY_RATE, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_SERVER_ID, &cfg_type_serverid, 0, NULL },
+ { CFG_CLAUSE_SESSION_KEYALG, &cfg_type_astring, 0, NULL },
+ { CFG_CLAUSE_SESSION_KEYFILE, &cfg_type_qstringornone, 0, NULL },
+ { CFG_CLAUSE_SESSION_KEYNAME, &cfg_type_astring, 0, NULL },
+ { CFG_CLAUSE_SIG0CHECKS_QUOTA, &cfg_type_uint32,
+ CFG_CLAUSEFLAG_EXPERIMENTAL, NULL },
+ { CFG_CLAUSE_SIG0CHECKS_QUOTA_EXEMPT, &cfg_type_bracketed_aml,
CFG_CLAUSEFLAG_EXPERIMENTAL, NULL },
- { "sit-secret", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "stacksize", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "startup-notify-rate", &cfg_type_uint32, 0, NULL },
- { "statistics-file", &cfg_type_qstring, 0, NULL },
- { "statistics-interval", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "tcp-advertised-timeout", &cfg_type_uint32, 0, NULL },
- { "tcp-clients", &cfg_type_uint32, 0, NULL },
- { "tcp-idle-timeout", &cfg_type_uint32, 0, NULL },
- { "tcp-initial-timeout", &cfg_type_uint32, 0, NULL },
- { "tcp-keepalive-timeout", &cfg_type_uint32, 0, NULL },
- { "tcp-listen-queue", &cfg_type_uint32, 0, NULL },
- { "tcp-primaries-timeout", &cfg_type_uint32, 0, NULL },
- { "tcp-receive-buffer", &cfg_type_uint32, 0, NULL },
- { "tcp-reuse-timeout", &cfg_type_uint32, 0, NULL },
- { "tcp-send-buffer", &cfg_type_uint32, 0, NULL },
- { "tkey-dhkey", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "tkey-domain", &cfg_type_qstring, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "tkey-gssapi-credential", &cfg_type_qstring, CFG_CLAUSEFLAG_ANCIENT,
+ { CFG_CLAUSE_SIT_SECRET, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_STACKSIZE, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_STARTUP_NOTIFY_RATE, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_STATISTICS_FILE, &cfg_type_qstring, 0, NULL },
+ { CFG_CLAUSE_STATISTICS_INTERVAL, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_TCP_ADVERTISED_TIMEOUT, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_TCP_CLIENTS, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_TCP_IDLE_TIMEOUT, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_TCP_INITIAL_TIMEOUT, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_TCP_KEEPALIVE_TIMEOUT, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_TCP_LISTEN_QUEUE, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_TCP_PRIMARIES_TIMEOUT, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_TCP_RECEIVE_BUFFER, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_TCP_REUSE_TIMEOUT, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_TCP_SEND_BUFFER, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_TKEY_DHKEY, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_TKEY_DOMAIN, &cfg_type_qstring, CFG_CLAUSEFLAG_ANCIENT,
NULL },
- { "tkey-gssapi-keytab", &cfg_type_qstring, 0, NULL },
- { "transfer-message-size", &cfg_type_uint32, 0, NULL },
- { "transfers-in", &cfg_type_uint32, 0, NULL },
- { "transfers-out", &cfg_type_uint32, 0, NULL },
- { "transfers-per-ns", &cfg_type_uint32, 0, NULL },
- { "treat-cr-as-space", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "udp-receive-buffer", &cfg_type_uint32, 0, NULL },
- { "udp-send-buffer", &cfg_type_uint32, 0, NULL },
- { "update-quota", &cfg_type_uint32, 0, NULL },
- { "use-id-pool", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "use-ixfr", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "use-v4-udp-ports", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "use-v6-udp-ports", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "version", &cfg_type_qstringornone, 0, NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_TKEY_GSSAPI_CREDENTIAL, &cfg_type_qstring,
+ CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_TKEY_GSSAPI_KEYTAB, &cfg_type_qstring, 0, NULL },
+ { CFG_CLAUSE_TRANSFER_MESSAGE_SIZE, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_TRANSFERS_IN, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_TRANSFERS_OUT, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_TRANSFERS_PER_NS, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_TREAT_CR_AS_SPACE, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_UDP_RECEIVE_BUFFER, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_UDP_SEND_BUFFER, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_UPDATE_QUOTA, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_USE_ID_POOL, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_USE_IXFR, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_USE_V4_UDP_PORTS, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_USE_V6_UDP_PORTS, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_VERSION, &cfg_type_qstringornone, 0, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
static cfg_type_t cfg_type_namelist = { "namelist",
@@ -2179,22 +2200,22 @@ static cfg_type_t cfg_type_catz = {
* rate-limit
*/
static cfg_clausedef_t rrl_clauses[] = {
- { "all-per-second", &cfg_type_uint32, 0, NULL },
- { "errors-per-second", &cfg_type_uint32, 0, NULL },
- { "exempt-clients", &cfg_type_bracketed_aml, 0, NULL },
- { "ipv4-prefix-length", &cfg_type_uint32, 0, NULL },
- { "ipv6-prefix-length", &cfg_type_uint32, 0, NULL },
- { "log-only", &cfg_type_boolean, 0, NULL },
- { "max-table-size", &cfg_type_uint32, 0, NULL },
- { "min-table-size", &cfg_type_uint32, 0, NULL },
- { "nodata-per-second", &cfg_type_uint32, 0, NULL },
- { "nxdomains-per-second", &cfg_type_uint32, 0, NULL },
- { "qps-scale", &cfg_type_uint32, 0, NULL },
- { "referrals-per-second", &cfg_type_uint32, 0, NULL },
- { "responses-per-second", &cfg_type_uint32, 0, NULL },
- { "slip", &cfg_type_uint32, 0, NULL },
- { "window", &cfg_type_uint32, 0, NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_ALL_PER_SECOND, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_ERRORS_PER_SECOND, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_EXEMPT_CLIENTS, &cfg_type_bracketed_aml, 0, NULL },
+ { CFG_CLAUSE_IPV4_PREFIX_LENGTH, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_IPV6_PREFIX_LENGTH, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_LOG_ONLY, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_MAX_TABLE_SIZE, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_MIN_TABLE_SIZE, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_NODATA_PER_SECOND, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_NXDOMAINS_PER_SECOND, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_QPS_SCALE, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_REFERRALS_PER_SECOND, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_RESPONSES_PER_SECOND, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_SLIP, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_WINDOW, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
static cfg_clausedef_t *rrl_clausesets[] = { rrl_clauses, NULL };
@@ -2244,13 +2265,13 @@ static cfg_type_t cfg_type_prefetch = { "prefetch", cfg_parse_tuple,
* DNS64.
*/
static cfg_clausedef_t dns64_clauses[] = {
- { "break-dnssec", &cfg_type_boolean, 0, NULL },
- { "clients", &cfg_type_bracketed_aml, 0, NULL },
- { "exclude", &cfg_type_bracketed_aml, 0, NULL },
- { "mapped", &cfg_type_bracketed_aml, 0, NULL },
- { "recursive-only", &cfg_type_boolean, 0, NULL },
- { "suffix", &cfg_type_netaddr6, 0, NULL },
- { NULL, NULL, 0, NULL },
+ { CFG_CLAUSE_BREAK_DNSSEC, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_CLIENTS, &cfg_type_bracketed_aml, 0, NULL },
+ { CFG_CLAUSE_EXCLUDE, &cfg_type_bracketed_aml, 0, NULL },
+ { CFG_CLAUSE_MAPPED, &cfg_type_bracketed_aml, 0, NULL },
+ { CFG_CLAUSE_RECURSIVE_ONLY, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_SUFFIX, &cfg_type_netaddr6, 0, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL },
};
static cfg_clausedef_t *dns64_clausesets[] = { dns64_clauses, NULL };
@@ -2350,165 +2371,176 @@ checknames_merge(const cfg_obj_t *config ISC_ATTR_UNUSED,
*/
static cfg_clausedef_t view_clauses[] = {
- { "acache-cleaning-interval", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "acache-enable", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "additional-from-auth", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "additional-from-cache", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "allow-new-zones", &cfg_type_boolean, 0, NULL },
- { "allow-proxy", &cfg_type_bracketed_aml, CFG_CLAUSEFLAG_EXPERIMENTAL,
+ { CFG_CLAUSE_ACACHE_CLEANING_INTERVAL, NULL, CFG_CLAUSEFLAG_ANCIENT,
NULL },
- { "allow-proxy-on", &cfg_type_bracketed_aml,
+ { CFG_CLAUSE_ACACHE_ENABLE, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_ADDITIONAL_FROM_AUTH, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_ADDITIONAL_FROM_CACHE, NULL, CFG_CLAUSEFLAG_ANCIENT,
+ NULL },
+ { CFG_CLAUSE_ALLOW_NEW_ZONES, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_ALLOW_PROXY, &cfg_type_bracketed_aml,
+ CFG_CLAUSEFLAG_EXPERIMENTAL, NULL },
+ { CFG_CLAUSE_ALLOW_PROXY_ON, &cfg_type_bracketed_aml,
CFG_CLAUSEFLAG_EXPERIMENTAL, NULL },
- { "allow-query-cache", &cfg_type_bracketed_aml, 0, NULL },
- { "allow-query-cache-on", &cfg_type_bracketed_aml, 0, NULL },
- { "allow-recursion", &cfg_type_bracketed_aml, 0, NULL },
- { "allow-recursion-on", &cfg_type_bracketed_aml, 0, NULL },
- { "allow-v6-synthesis", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "attach-cache", &cfg_type_astring, 0, NULL },
- { "auth-nxdomain", &cfg_type_boolean, 0, NULL },
- { "cache-file", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "catalog-zones", &cfg_type_catz, 0, NULL },
- { "check-names", &cfg_type_checknames, CFG_CLAUSEFLAG_MULTI,
+ { CFG_CLAUSE_ALLOW_QUERY_CACHE, &cfg_type_bracketed_aml, 0, NULL },
+ { CFG_CLAUSE_ALLOW_QUERY_CACHE_ON, &cfg_type_bracketed_aml, 0, NULL },
+ { CFG_CLAUSE_ALLOW_RECURSION, &cfg_type_bracketed_aml, 0, NULL },
+ { CFG_CLAUSE_ALLOW_RECURSION_ON, &cfg_type_bracketed_aml, 0, NULL },
+ { CFG_CLAUSE_ALLOW_V6_SYNTHESIS, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_ATTACH_CACHE, &cfg_type_astring, 0, NULL },
+ { CFG_CLAUSE_AUTH_NXDOMAIN, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_CACHE_FILE, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_CATALOG_ZONES, &cfg_type_catz, 0, NULL },
+ { CFG_CLAUSE_CHECK_NAMES, &cfg_type_checknames, CFG_CLAUSEFLAG_MULTI,
checknames_merge },
- { "check-ns", &cfg_type_checkmode, 0, NULL },
- { "cleaning-interval", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "clients-per-query", &cfg_type_uint32, 0, NULL },
- { "deny-answer-addresses", &cfg_type_denyaddresses, 0, NULL },
- { "deny-answer-aliases", &cfg_type_denyaliases, 0, NULL },
- { "disable-algorithms", &cfg_type_disablealgorithm,
+ { CFG_CLAUSE_CHECK_NS, &cfg_type_checkmode, 0, NULL },
+ { CFG_CLAUSE_CLEANING_INTERVAL, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_CLIENTS_PER_QUERY, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_DENY_ANSWER_ADDRESSES, &cfg_type_denyaddresses, 0, NULL },
+ { CFG_CLAUSE_DENY_ANSWER_ALIASES, &cfg_type_denyaliases, 0, NULL },
+ { CFG_CLAUSE_DISABLE_ALGORITHMS, &cfg_type_disablealgorithm,
CFG_CLAUSEFLAG_MULTI, NULL },
- { "disable-ds-digests", &cfg_type_disabledsdigest, CFG_CLAUSEFLAG_MULTI,
- NULL },
- { "disable-empty-zone", &cfg_type_astring, CFG_CLAUSEFLAG_MULTI, NULL },
- { "dns64", &cfg_type_dns64, CFG_CLAUSEFLAG_MULTI, NULL },
- { "dns64-contact", &cfg_type_astring, 0, NULL },
- { "dns64-server", &cfg_type_astring, 0, NULL },
- { "dnsrps-enable", &cfg_type_boolean, CFG_CLAUSEFLAG_OBSOLETE, NULL },
- { "dnsrps-options", &cfg_type_bracketed_tokens, CFG_CLAUSEFLAG_OBSOLETE,
+ { CFG_CLAUSE_DISABLE_DS_DIGESTS, &cfg_type_disabledsdigest,
+ CFG_CLAUSEFLAG_MULTI, NULL },
+ { CFG_CLAUSE_DISABLE_EMPTY_ZONE, &cfg_type_astring,
+ CFG_CLAUSEFLAG_MULTI, NULL },
+ { CFG_CLAUSE_DNS64, &cfg_type_dns64, CFG_CLAUSEFLAG_MULTI, NULL },
+ { CFG_CLAUSE_DNS64_CONTACT, &cfg_type_astring, 0, NULL },
+ { CFG_CLAUSE_DNS64_SERVER, &cfg_type_astring, 0, NULL },
+ { CFG_CLAUSE_DNSRPS_ENABLE, &cfg_type_boolean, CFG_CLAUSEFLAG_OBSOLETE,
NULL },
- { "dnssec-accept-expired", &cfg_type_boolean, 0, NULL },
- { "dnssec-enable", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "dnssec-lookaside", NULL,
+ { CFG_CLAUSE_DNSRPS_OPTIONS, &cfg_type_bracketed_tokens,
+ CFG_CLAUSEFLAG_OBSOLETE, NULL },
+ { CFG_CLAUSE_DNSSEC_ACCEPT_EXPIRED, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_DNSSEC_ENABLE, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_DNSSEC_LOOKASIDE, NULL,
CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "dnssec-must-be-secure", NULL,
+ { CFG_CLAUSE_DNSSEC_MUST_BE_SECURE, NULL,
CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "dnssec-validation", &cfg_type_boolorauto, 0, NULL },
+ { CFG_CLAUSE_DNSSEC_VALIDATION, &cfg_type_boolorauto, 0, NULL },
#ifdef HAVE_DNSTAP
- { "dnstap", &cfg_type_dnstap, CFG_CLAUSEFLAG_OPTIONAL, NULL },
+ { CFG_CLAUSE_DNSTAP, &cfg_type_dnstap, CFG_CLAUSEFLAG_OPTIONAL, NULL },
#else /* ifdef HAVE_DNSTAP */
- { "dnstap", &cfg_type_dnstap, CFG_CLAUSEFLAG_NOTCONFIGURED, NULL },
+ { CFG_CLAUSE_DNSTAP, &cfg_type_dnstap, CFG_CLAUSEFLAG_NOTCONFIGURED,
+ NULL },
#endif /* HAVE_DNSTAP */
- { "dual-stack-servers", &cfg_type_nameportiplist, 0, NULL },
- { "edns-udp-size", &cfg_type_uint32, 0, NULL },
- { "empty-contact", &cfg_type_astring, 0, NULL },
- { "empty-server", &cfg_type_astring, 0, NULL },
- { "empty-zones-enable", &cfg_type_boolean, 0, NULL },
- { "fetch-glue", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "fetch-quota-params", &cfg_type_fetchquota, 0, NULL },
- { "fetches-per-server", &cfg_type_fetchesper, 0, NULL },
- { "fetches-per-zone", &cfg_type_fetchesper, 0, NULL },
- { "filter-aaaa", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "filter-aaaa-on-v4", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "filter-aaaa-on-v6", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "glue-cache", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "ipv4only-enable", &cfg_type_boolean, 0, NULL },
- { "ipv4only-contact", &cfg_type_astring, 0, NULL },
- { "ipv4only-server", &cfg_type_astring, 0, NULL },
- { "ixfr-from-differences", &cfg_type_ixfrdifftype, 0, NULL },
- { "lame-ttl", &cfg_type_duration, 0, NULL },
- { "lmdb-mapsize", &cfg_type_sizeval, CFG_CLAUSEFLAG_OPTIONAL, NULL },
- { "max-acache-size", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "max-cache-size", &cfg_type_maxcachesize, 0, NULL },
- { "max-cache-ttl", &cfg_type_duration, 0, NULL },
- { "max-delegation-ttl", &cfg_type_duration, 0, NULL },
- { "max-clients-per-query", &cfg_type_uint32, 0, NULL },
- { "max-delegation-servers", &cfg_type_uint32,
+ { CFG_CLAUSE_DUAL_STACK_SERVERS, &cfg_type_nameportiplist, 0, NULL },
+ { CFG_CLAUSE_EDNS_UDP_SIZE, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_EMPTY_CONTACT, &cfg_type_astring, 0, NULL },
+ { CFG_CLAUSE_EMPTY_SERVER, &cfg_type_astring, 0, NULL },
+ { CFG_CLAUSE_EMPTY_ZONES_ENABLE, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_FETCH_GLUE, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_FETCH_QUOTA_PARAMS, &cfg_type_fetchquota, 0, NULL },
+ { CFG_CLAUSE_FETCHES_PER_SERVER, &cfg_type_fetchesper, 0, NULL },
+ { CFG_CLAUSE_FETCHES_PER_ZONE, &cfg_type_fetchesper, 0, NULL },
+ { CFG_CLAUSE_FILTER_AAAA, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_FILTER_AAAA_ON_V4, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_FILTER_AAAA_ON_V6, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_GLUE_CACHE, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_IPV4ONLY_ENABLE, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_IPV4ONLY_CONTACT, &cfg_type_astring, 0, NULL },
+ { CFG_CLAUSE_IPV4ONLY_SERVER, &cfg_type_astring, 0, NULL },
+ { CFG_CLAUSE_IXFR_FROM_DIFFERENCES, &cfg_type_ixfrdifftype, 0, NULL },
+ { CFG_CLAUSE_LAME_TTL, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_LMDB_MAPSIZE, &cfg_type_sizeval, CFG_CLAUSEFLAG_OPTIONAL,
+ NULL },
+ { CFG_CLAUSE_MAX_ACACHE_SIZE, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_MAX_CACHE_SIZE, &cfg_type_maxcachesize, 0, NULL },
+ { CFG_CLAUSE_MAX_CACHE_TTL, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_MAX_DELEGATION_TTL, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_MAX_CLIENTS_PER_QUERY, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_MAX_DELEGATION_SERVERS, &cfg_type_uint32,
CFG_CLAUSEFLAG_EXPERIMENTAL, NULL },
- { "max-ncache-ttl", &cfg_type_duration, 0, NULL },
- { "max-recursion-depth", &cfg_type_uint32, 0, NULL },
- { "max-recursion-queries", &cfg_type_uint32, 0, NULL },
- { "max-query-count", &cfg_type_uint32, 0, NULL },
- { "max-query-restarts", &cfg_type_uint32, 0, NULL },
- { "max-stale-ttl", &cfg_type_duration, 0, NULL },
- { "max-udp-size", &cfg_type_uint32, 0, NULL },
- { "max-validations-per-fetch", &cfg_type_uint32,
+ { CFG_CLAUSE_MAX_NCACHE_TTL, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_MAX_RECURSION_DEPTH, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_MAX_RECURSION_QUERIES, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_MAX_QUERY_COUNT, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_MAX_QUERY_RESTARTS, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_MAX_STALE_TTL, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_MAX_UDP_SIZE, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_MAX_VALIDATIONS_PER_FETCH, &cfg_type_uint32,
CFG_CLAUSEFLAG_EXPERIMENTAL, NULL },
- { "max-validation-failures-per-fetch", &cfg_type_uint32,
+ { CFG_CLAUSE_MAX_VALIDATION_FAILURES_PER_FETCH, &cfg_type_uint32,
CFG_CLAUSEFLAG_EXPERIMENTAL, NULL },
- { "message-compression", &cfg_type_boolean, 0, NULL },
- { "min-cache-ttl", &cfg_type_duration, 0, NULL },
- { "min-delegation-ttl", &cfg_type_duration, 0, NULL },
- { "min-ncache-ttl", &cfg_type_duration, 0, NULL },
- { "min-roots", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "minimal-any", &cfg_type_boolean, 0, NULL },
- { "minimal-responses", &cfg_type_minimal, 0, NULL },
- { "new-zones-directory", &cfg_type_qstring, 0, NULL },
- { "no-case-compress", &cfg_type_bracketed_aml, 0, NULL },
- { "nocookie-udp-size", &cfg_type_uint32, 0, NULL },
- { "nosit-udp-size", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "nta-lifetime", &cfg_type_duration, 0, NULL },
- { "nta-recheck", &cfg_type_duration, 0, NULL },
- { "nxdomain-redirect", &cfg_type_astring, CFG_CLAUSEFLAG_DEPRECATED,
- NULL },
- { "preferred-glue", &cfg_type_astring, 0, NULL },
- { "prefetch", &cfg_type_prefetch, 0, prefetch_merge },
- { "provide-ixfr", &cfg_type_boolean, 0, NULL },
- { "qname-minimization", &cfg_type_qminmethod, 0, NULL },
+ { CFG_CLAUSE_MESSAGE_COMPRESSION, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_MIN_CACHE_TTL, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_MIN_DELEGATION_TTL, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_MIN_NCACHE_TTL, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_MIN_ROOTS, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_MINIMAL_ANY, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_MINIMAL_RESPONSES, &cfg_type_minimal, 0, NULL },
+ { CFG_CLAUSE_NEW_ZONES_DIRECTORY, &cfg_type_qstring, 0, NULL },
+ { CFG_CLAUSE_NO_CASE_COMPRESS, &cfg_type_bracketed_aml, 0, NULL },
+ { CFG_CLAUSE_NOCOOKIE_UDP_SIZE, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_NOSIT_UDP_SIZE, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_NTA_LIFETIME, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_NTA_RECHECK, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_NXDOMAIN_REDIRECT, &cfg_type_astring,
+ CFG_CLAUSEFLAG_DEPRECATED, NULL },
+ { CFG_CLAUSE_PREFERRED_GLUE, &cfg_type_astring, 0, NULL },
+ { CFG_CLAUSE_PREFETCH, &cfg_type_prefetch, 0, prefetch_merge },
+ { CFG_CLAUSE_PROVIDE_IXFR, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_QNAME_MINIMIZATION, &cfg_type_qminmethod, 0, NULL },
/*
* Note that the query-source option syntax is different
* from the other -source options.
*/
- { "query-source", &cfg_type_querysource4, 0, NULL },
- { "query-source-v6", &cfg_type_querysource6, 0, NULL },
- { "queryport-pool-ports", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "queryport-pool-updateinterval", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "rate-limit", &cfg_type_rrl, 0, NULL },
- { "recursion", &cfg_type_boolean, 0, NULL },
- { "request-nsid", &cfg_type_boolean, 0, NULL },
- { "request-sit", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "request-zoneversion", &cfg_type_boolean, 0, NULL },
- { "require-server-cookie", &cfg_type_boolean, 0, NULL },
- { "resolver-nonbackoff-tries", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "resolver-query-timeout", &cfg_type_uint32, 0, NULL },
- { "resolver-retry-interval", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "response-padding", &cfg_type_resppadding, 0, NULL },
- { "response-policy", &cfg_type_rpz, 0, NULL },
- { "rfc2308-type1", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "root-delegation-only", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "root-key-sentinel", &cfg_type_boolean, 0, NULL },
- { "rrset-order", &cfg_type_rrsetorder, 0, NULL },
- { "send-cookie", &cfg_type_boolean, 0, NULL },
- { "servfail-ttl", &cfg_type_duration, 0, NULL },
- { "sig0key-checks-limit", &cfg_type_uint32, 0, NULL },
- { "sig0message-checks-limit", &cfg_type_uint32, 0, NULL },
- { "sortlist", &cfg_type_bracketed_aml, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "stale-answer-enable", &cfg_type_boolean, 0, NULL },
- { "stale-answer-client-timeout", &cfg_type_staleanswerclienttimeout, 0,
+ { CFG_CLAUSE_QUERY_SOURCE, &cfg_type_querysource4, 0, NULL },
+ { CFG_CLAUSE_QUERY_SOURCE_V6, &cfg_type_querysource6, 0, NULL },
+ { CFG_CLAUSE_QUERYPORT_POOL_PORTS, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_QUERYPORT_POOL_UPDATEINTERVAL, NULL,
+ CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_RATE_LIMIT, &cfg_type_rrl, 0, NULL },
+ { CFG_CLAUSE_RECURSION, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_REQUEST_NSID, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_REQUEST_SIT, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_REQUEST_ZONEVERSION, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_REQUIRE_SERVER_COOKIE, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_RESOLVER_NONBACKOFF_TRIES, NULL, CFG_CLAUSEFLAG_ANCIENT,
+ NULL },
+ { CFG_CLAUSE_RESOLVER_QUERY_TIMEOUT, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_RESOLVER_RETRY_INTERVAL, NULL, CFG_CLAUSEFLAG_ANCIENT,
+ NULL },
+ { CFG_CLAUSE_RESPONSE_PADDING, &cfg_type_resppadding, 0, NULL },
+ { CFG_CLAUSE_RESPONSE_POLICY, &cfg_type_rpz, 0, NULL },
+ { CFG_CLAUSE_RFC2308_TYPE1, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_ROOT_DELEGATION_ONLY, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_ROOT_KEY_SENTINEL, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_RRSET_ORDER, &cfg_type_rrsetorder, 0, NULL },
+ { CFG_CLAUSE_SEND_COOKIE, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_SERVFAIL_TTL, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_SIG0KEY_CHECKS_LIMIT, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_SIG0MESSAGE_CHECKS_LIMIT, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_SORTLIST, &cfg_type_bracketed_aml, CFG_CLAUSEFLAG_ANCIENT,
NULL },
- { "stale-answer-ttl", &cfg_type_duration, 0, NULL },
- { "stale-cache-enable", &cfg_type_boolean, 0, NULL },
- { "stale-refresh-time", &cfg_type_duration, 0, NULL },
- { "suppress-initial-notify", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "synth-from-dnssec", &cfg_type_boolean, 0, NULL },
- { "topology", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "transfer-format", &cfg_type_transferformat, 0, NULL },
- { "trust-anchor-telemetry", &cfg_type_boolean, 0, NULL },
- { "resolver-use-dns64", &cfg_type_boolean, 0, NULL },
- { "use-queryport-pool", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "validate-except", &cfg_type_namelist, 0, NULL },
- { "v6-bias", &cfg_type_uint32, 0, NULL },
- { "zero-no-soa-ttl-cache", &cfg_type_boolean, 0, NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_STALE_ANSWER_ENABLE, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_STALE_ANSWER_CLIENT_TIMEOUT,
+ &cfg_type_staleanswerclienttimeout, 0, NULL },
+ { CFG_CLAUSE_STALE_ANSWER_TTL, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_STALE_CACHE_ENABLE, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_STALE_REFRESH_TIME, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_SUPPRESS_INITIAL_NOTIFY, NULL, CFG_CLAUSEFLAG_ANCIENT,
+ NULL },
+ { CFG_CLAUSE_SYNTH_FROM_DNSSEC, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_TOPOLOGY, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_TRANSFER_FORMAT, &cfg_type_transferformat, 0, NULL },
+ { CFG_CLAUSE_TRUST_ANCHOR_TELEMETRY, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_RESOLVER_USE_DNS64, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_USE_QUERYPORT_POOL, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_VALIDATE_EXCEPT, &cfg_type_namelist, 0, NULL },
+ { CFG_CLAUSE_V6_BIAS, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_ZERO_NO_SOA_TTL_CACHE, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
/*%
* Clauses that can be found within the 'view' statement only.
*/
static cfg_clausedef_t view_only_clauses[] = {
- { "match-clients", &cfg_type_bracketed_aml, 0, NULL },
- { "match-destinations", &cfg_type_bracketed_aml, 0, NULL },
- { "match-recursive-only", &cfg_type_boolean, 0, NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_MATCH_CLIENTS, &cfg_type_bracketed_aml, 0, NULL },
+ { CFG_CLAUSE_MATCH_DESTINATIONS, &cfg_type_bracketed_aml, 0, NULL },
+ { CFG_CLAUSE_MATCH_RECURSIVE_ONLY, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
/*%
@@ -2548,27 +2580,28 @@ static cfg_type_t cfg_type_checkdstype = {
* Clauses that can be found in a 'dnssec-policy' statement.
*/
static cfg_clausedef_t dnssecpolicy_clauses[] = {
- { "cdnskey", &cfg_type_boolean, 0, NULL },
- { "cds-digest-types", &cfg_type_algorithmlist, 0, NULL },
- { "dnskey-ttl", &cfg_type_duration, 0, NULL },
- { "inline-signing", &cfg_type_boolean, 0, NULL },
- { "keys", &cfg_type_kaspkeys, 0, NULL },
- { "manual-mode", &cfg_type_boolean, 0, NULL },
- { "max-zone-ttl", &cfg_type_duration, 0, NULL },
- { "nsec3param", &cfg_type_nsec3, 0, NULL },
- { "offline-ksk", &cfg_type_boolean, 0, NULL },
- { "parent-ds-ttl", &cfg_type_duration, 0, NULL },
- { "parent-propagation-delay", &cfg_type_duration, 0, NULL },
- { "parent-registration-delay", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "publish-safety", &cfg_type_duration, 0, NULL },
- { "purge-keys", &cfg_type_duration, 0, NULL },
- { "retire-safety", &cfg_type_duration, 0, NULL },
- { "signatures-jitter", &cfg_type_duration, 0, NULL },
- { "signatures-refresh", &cfg_type_duration, 0, NULL },
- { "signatures-validity", &cfg_type_duration, 0, NULL },
- { "signatures-validity-dnskey", &cfg_type_duration, 0, NULL },
- { "zone-propagation-delay", &cfg_type_duration, 0, NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_CDNSKEY, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_CDS_DIGEST_TYPES, &cfg_type_algorithmlist, 0, NULL },
+ { CFG_CLAUSE_DNSKEY_TTL, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_INLINE_SIGNING, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_KEYS, &cfg_type_kaspkeys, 0, NULL },
+ { CFG_CLAUSE_MANUAL_MODE, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_MAX_ZONE_TTL, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_NSEC3PARAM, &cfg_type_nsec3, 0, NULL },
+ { CFG_CLAUSE_OFFLINE_KSK, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_PARENT_DS_TTL, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_PARENT_PROPAGATION_DELAY, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_PARENT_REGISTRATION_DELAY, NULL, CFG_CLAUSEFLAG_ANCIENT,
+ NULL },
+ { CFG_CLAUSE_PUBLISH_SAFETY, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_PURGE_KEYS, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_RETIRE_SAFETY, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_SIGNATURES_JITTER, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_SIGNATURES_REFRESH, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_SIGNATURES_VALIDITY, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_SIGNATURES_VALIDITY_DNSKEY, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE_ZONE_PROPAGATION_DELAY, &cfg_type_duration, 0, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
/*
@@ -2600,185 +2633,191 @@ static cfg_type_t cfg_type_min_transfer_rate_in = {
* Example: allow-transfer port 853 protocol tls { ... };
*/
static cfg_clausedef_t zone_clauses[] = {
- { "allow-notify", &cfg_type_bracketed_aml,
+ { CFG_CLAUSE_ALLOW_NOTIFY, &cfg_type_bracketed_aml,
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR, NULL },
- { "allow-query", &cfg_type_bracketed_aml,
+ { CFG_CLAUSE_ALLOW_QUERY, &cfg_type_bracketed_aml,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR |
CFG_ZONE_STUB | CFG_ZONE_REDIRECT | CFG_ZONE_STATICSTUB,
NULL },
- { "allow-query-on", &cfg_type_bracketed_aml,
+ { CFG_CLAUSE_ALLOW_QUERY_ON, &cfg_type_bracketed_aml,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR |
CFG_ZONE_STUB | CFG_ZONE_REDIRECT | CFG_ZONE_STATICSTUB,
NULL },
- { "allow-transfer", &cfg_type_transport_acl,
+ { CFG_CLAUSE_ALLOW_TRANSFER, &cfg_type_transport_acl,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR, NULL },
- { "allow-update", &cfg_type_bracketed_aml, CFG_ZONE_PRIMARY, NULL },
- { "allow-update-forwarding", &cfg_type_bracketed_aml,
+ { CFG_CLAUSE_ALLOW_UPDATE, &cfg_type_bracketed_aml, CFG_ZONE_PRIMARY,
+ NULL },
+ { CFG_CLAUSE_ALLOW_UPDATE_FORWARDING, &cfg_type_bracketed_aml,
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR, NULL },
- { "also-notify", &cfg_type_namesockaddrkeylist,
+ { CFG_CLAUSE_ALSO_NOTIFY, &cfg_type_namesockaddrkeylist,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR, NULL },
- { "alt-transfer-source", NULL,
+ { CFG_CLAUSE_ALT_TRANSFER_SOURCE, NULL,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR |
CFG_CLAUSEFLAG_ANCIENT,
NULL },
- { "alt-transfer-source-v6", NULL,
+ { CFG_CLAUSE_ALT_TRANSFER_SOURCE_V6, NULL,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR |
CFG_CLAUSEFLAG_ANCIENT,
NULL },
- { "auto-dnssec", NULL,
+ { CFG_CLAUSE_AUTO_DNSSEC, NULL,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_CLAUSEFLAG_ANCIENT,
NULL },
- { "check-dup-records", &cfg_type_checkmode, CFG_ZONE_PRIMARY, NULL },
- { "check-integrity", &cfg_type_boolean, CFG_ZONE_PRIMARY, NULL },
- { "check-mx", &cfg_type_checkmode, CFG_ZONE_PRIMARY, NULL },
- { "check-mx-cname", &cfg_type_checkmode, CFG_ZONE_PRIMARY, NULL },
- { "check-sibling", &cfg_type_boolean, CFG_ZONE_PRIMARY, NULL },
- { "check-spf", &cfg_type_warn, CFG_ZONE_PRIMARY, NULL },
- { "check-srv-cname", &cfg_type_checkmode, CFG_ZONE_PRIMARY, NULL },
- { "check-svcb", &cfg_type_boolean, CFG_ZONE_PRIMARY, NULL },
- { "check-wildcard", &cfg_type_boolean, CFG_ZONE_PRIMARY, NULL },
- { "dialup", NULL,
+ { CFG_CLAUSE_CHECK_DUP_RECORDS, &cfg_type_checkmode, CFG_ZONE_PRIMARY,
+ NULL },
+ { CFG_CLAUSE_CHECK_INTEGRITY, &cfg_type_boolean, CFG_ZONE_PRIMARY,
+ NULL },
+ { CFG_CLAUSE_CHECK_MX, &cfg_type_checkmode, CFG_ZONE_PRIMARY, NULL },
+ { CFG_CLAUSE_CHECK_MX_CNAME, &cfg_type_checkmode, CFG_ZONE_PRIMARY,
+ NULL },
+ { CFG_CLAUSE_CHECK_SIBLING, &cfg_type_boolean, CFG_ZONE_PRIMARY, NULL },
+ { CFG_CLAUSE_CHECK_SPF, &cfg_type_warn, CFG_ZONE_PRIMARY, NULL },
+ { CFG_CLAUSE_CHECK_SRV_CNAME, &cfg_type_checkmode, CFG_ZONE_PRIMARY,
+ NULL },
+ { CFG_CLAUSE_CHECK_SVCB, &cfg_type_boolean, CFG_ZONE_PRIMARY, NULL },
+ { CFG_CLAUSE_CHECK_WILDCARD, &cfg_type_boolean, CFG_ZONE_PRIMARY,
+ NULL },
+ { CFG_CLAUSE_DIALUP, NULL,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_STUB |
CFG_CLAUSEFLAG_ANCIENT,
NULL },
- { "dnssec-dnskey-kskonly", &cfg_type_boolean,
+ { CFG_CLAUSE_DNSSEC_DNSKEY_KSKONLY, &cfg_type_boolean,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_CLAUSEFLAG_OBSOLETE,
NULL },
- { "dnssec-loadkeys-interval", &cfg_type_uint32,
+ { CFG_CLAUSE_DNSSEC_LOADKEYS_INTERVAL, &cfg_type_uint32,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY, NULL },
- { "dnssec-policy", &cfg_type_astring,
+ { CFG_CLAUSE_DNSSEC_POLICY, &cfg_type_astring,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY, NULL },
- { "dnssec-secure-to-insecure", &cfg_type_boolean,
+ { CFG_CLAUSE_DNSSEC_SECURE_TO_INSECURE, &cfg_type_boolean,
CFG_ZONE_PRIMARY | CFG_CLAUSEFLAG_OBSOLETE, NULL },
- { "dnssec-update-mode", &cfg_type_dnssecupdatemode,
+ { CFG_CLAUSE_DNSSEC_UPDATE_MODE, &cfg_type_dnssecupdatemode,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_CLAUSEFLAG_OBSOLETE,
NULL },
- { "forward", &cfg_type_forwardtype,
+ { CFG_CLAUSE_FORWARD, &cfg_type_forwardtype,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_STUB |
CFG_ZONE_STATICSTUB | CFG_ZONE_FORWARD,
NULL },
- { "forwarders", &cfg_type_portiplist,
+ { CFG_CLAUSE_FORWARDERS, &cfg_type_portiplist,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_STUB |
CFG_ZONE_STATICSTUB | CFG_ZONE_FORWARD,
NULL },
- { "key-directory", &cfg_type_qstring,
+ { CFG_CLAUSE_KEY_DIRECTORY, &cfg_type_qstring,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY, NULL },
- { "maintain-ixfr-base", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "masterfile-format", &cfg_type_masterformat,
+ { CFG_CLAUSE_MAINTAIN_IXFR_BASE, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_MASTERFILE_FORMAT, &cfg_type_masterformat,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR |
CFG_ZONE_STUB | CFG_ZONE_REDIRECT,
NULL },
- { "masterfile-style", &cfg_type_masterstyle,
+ { CFG_CLAUSE_MASTERFILE_STYLE, &cfg_type_masterstyle,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR |
CFG_ZONE_STUB | CFG_ZONE_REDIRECT,
NULL },
- { "max-ixfr-log-size", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "max-ixfr-ratio", &cfg_type_ixfrratio,
+ { CFG_CLAUSE_MAX_IXFR_LOG_SIZE, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_MAX_IXFR_RATIO, &cfg_type_ixfrratio,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR, NULL },
- { "max-journal-size", &cfg_type_size,
+ { CFG_CLAUSE_MAX_JOURNAL_SIZE, &cfg_type_size,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR, NULL },
- { "max-records", &cfg_type_uint32,
+ { CFG_CLAUSE_MAX_RECORDS, &cfg_type_uint32,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR |
CFG_ZONE_STUB | CFG_ZONE_STATICSTUB | CFG_ZONE_REDIRECT,
NULL },
- { "max-records-per-type", &cfg_type_uint32,
+ { CFG_CLAUSE_MAX_RECORDS_PER_TYPE, &cfg_type_uint32,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR |
CFG_ZONE_STUB | CFG_ZONE_STATICSTUB | CFG_ZONE_REDIRECT,
NULL },
- { "max-types-per-name", &cfg_type_uint32,
+ { CFG_CLAUSE_MAX_TYPES_PER_NAME, &cfg_type_uint32,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR |
CFG_ZONE_STUB | CFG_ZONE_STATICSTUB | CFG_ZONE_REDIRECT,
NULL },
- { "max-refresh-time", &cfg_type_uint32,
+ { CFG_CLAUSE_MAX_REFRESH_TIME, &cfg_type_uint32,
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR | CFG_ZONE_STUB, NULL },
- { "max-retry-time", &cfg_type_uint32,
+ { CFG_CLAUSE_MAX_RETRY_TIME, &cfg_type_uint32,
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR | CFG_ZONE_STUB, NULL },
- { "min-transfer-rate-in", &cfg_type_min_transfer_rate_in,
+ { CFG_CLAUSE_MIN_TRANSFER_RATE_IN, &cfg_type_min_transfer_rate_in,
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR | CFG_ZONE_STUB, NULL },
- { "max-transfer-idle-in", &cfg_type_uint32,
+ { CFG_CLAUSE_MAX_TRANSFER_IDLE_IN, &cfg_type_uint32,
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR | CFG_ZONE_STUB, NULL },
- { "max-transfer-idle-out", &cfg_type_uint32,
+ { CFG_CLAUSE_MAX_TRANSFER_IDLE_OUT, &cfg_type_uint32,
CFG_ZONE_PRIMARY | CFG_ZONE_MIRROR | CFG_ZONE_SECONDARY, NULL },
- { "max-transfer-time-in", &cfg_type_uint32,
+ { CFG_CLAUSE_MAX_TRANSFER_TIME_IN, &cfg_type_uint32,
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR | CFG_ZONE_STUB, NULL },
- { "max-transfer-time-out", &cfg_type_uint32,
+ { CFG_CLAUSE_MAX_TRANSFER_TIME_OUT, &cfg_type_uint32,
CFG_ZONE_PRIMARY | CFG_ZONE_MIRROR | CFG_ZONE_SECONDARY, NULL },
- { "max-zone-ttl", &cfg_type_maxduration,
+ { CFG_CLAUSE_MAX_ZONE_TTL, &cfg_type_maxduration,
CFG_ZONE_PRIMARY | CFG_ZONE_REDIRECT | CFG_CLAUSEFLAG_DEPRECATED,
NULL },
- { "min-refresh-time", &cfg_type_uint32,
+ { CFG_CLAUSE_MIN_REFRESH_TIME, &cfg_type_uint32,
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR | CFG_ZONE_STUB, NULL },
- { "min-retry-time", &cfg_type_uint32,
+ { CFG_CLAUSE_MIN_RETRY_TIME, &cfg_type_uint32,
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR | CFG_ZONE_STUB, NULL },
- { "multi-master", &cfg_type_boolean,
+ { CFG_CLAUSE_MULTI_MASTER, &cfg_type_boolean,
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR | CFG_ZONE_STUB, NULL },
- { "notify", &cfg_type_notifytype,
+ { CFG_CLAUSE_NOTIFY, &cfg_type_notifytype,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR, NULL },
- { "notify-cfg", &cfg_type_notifycfg,
+ { CFG_CLAUSE_NOTIFY_CFG, &cfg_type_notifycfg,
CFG_CLAUSEFLAG_MULTI | CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY |
CFG_ZONE_MIRROR,
NULL },
- { "notify-defer", &cfg_type_uint32,
+ { CFG_CLAUSE_NOTIFY_DEFER, &cfg_type_uint32,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR, NULL },
- { "notify-delay", &cfg_type_uint32,
+ { CFG_CLAUSE_NOTIFY_DELAY, &cfg_type_uint32,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR, NULL },
- { "notify-source", &cfg_type_sockaddr4wild,
+ { CFG_CLAUSE_NOTIFY_SOURCE, &cfg_type_sockaddr4wild,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR, NULL },
- { "notify-source-v6", &cfg_type_sockaddr6wild,
+ { CFG_CLAUSE_NOTIFY_SOURCE_V6, &cfg_type_sockaddr6wild,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR, NULL },
- { "notify-to-soa", &cfg_type_boolean,
+ { CFG_CLAUSE_NOTIFY_TO_SOA, &cfg_type_boolean,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY, NULL },
- { "nsec3-test-zone", &cfg_type_boolean,
+ { CFG_CLAUSE_NSEC3_TEST_ZONE, &cfg_type_boolean,
CFG_CLAUSEFLAG_TESTONLY | CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY,
NULL },
- { "parental-source", &cfg_type_sockaddr4wild,
+ { CFG_CLAUSE_PARENTAL_SOURCE, &cfg_type_sockaddr4wild,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY, NULL },
- { "parental-source-v6", &cfg_type_sockaddr6wild,
+ { CFG_CLAUSE_PARENTAL_SOURCE_V6, &cfg_type_sockaddr6wild,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY, NULL },
- { "provide-zoneversion", &cfg_type_boolean,
+ { CFG_CLAUSE_PROVIDE_ZONEVERSION, &cfg_type_boolean,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR, NULL },
- { "send-report-channel", &cfg_type_astring,
+ { CFG_CLAUSE_SEND_REPORT_CHANNEL, &cfg_type_astring,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY, NULL },
- { "request-expire", &cfg_type_boolean,
+ { CFG_CLAUSE_REQUEST_EXPIRE, &cfg_type_boolean,
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR, NULL },
- { "request-ixfr", &cfg_type_boolean,
+ { CFG_CLAUSE_REQUEST_IXFR, &cfg_type_boolean,
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR, NULL },
- { "request-ixfr-max-diffs", &cfg_type_uint32,
+ { CFG_CLAUSE_REQUEST_IXFR_MAX_DIFFS, &cfg_type_uint32,
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR, NULL },
- { "serial-update-method", &cfg_type_updatemethod, CFG_ZONE_PRIMARY,
- NULL },
- { "sig-signing-nodes", &cfg_type_uint32,
+ { CFG_CLAUSE_SERIAL_UPDATE_METHOD, &cfg_type_updatemethod,
+ CFG_ZONE_PRIMARY, NULL },
+ { CFG_CLAUSE_SIG_SIGNING_NODES, &cfg_type_uint32,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY, NULL },
- { "sig-signing-signatures", &cfg_type_uint32,
+ { CFG_CLAUSE_SIG_SIGNING_SIGNATURES, &cfg_type_uint32,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY, NULL },
- { "sig-signing-type", &cfg_type_uint32,
+ { CFG_CLAUSE_SIG_SIGNING_TYPE, &cfg_type_uint32,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY, NULL },
- { "sig-validity-interval", &cfg_type_validityinterval,
+ { CFG_CLAUSE_SIG_VALIDITY_INTERVAL, &cfg_type_validityinterval,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_CLAUSEFLAG_OBSOLETE,
NULL },
- { "dnskey-sig-validity", &cfg_type_uint32,
+ { CFG_CLAUSE_DNSKEY_SIG_VALIDITY, &cfg_type_uint32,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_CLAUSEFLAG_OBSOLETE,
NULL },
- { "transfer-source", &cfg_type_sockaddr4wild,
+ { CFG_CLAUSE_TRANSFER_SOURCE, &cfg_type_sockaddr4wild,
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR | CFG_ZONE_STUB, NULL },
- { "transfer-source-v6", &cfg_type_sockaddr6wild,
+ { CFG_CLAUSE_TRANSFER_SOURCE_V6, &cfg_type_sockaddr6wild,
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR | CFG_ZONE_STUB, NULL },
- { "try-tcp-refresh", &cfg_type_boolean,
+ { CFG_CLAUSE_TRY_TCP_REFRESH, &cfg_type_boolean,
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR, NULL },
- { "update-check-ksk", &cfg_type_boolean,
+ { CFG_CLAUSE_UPDATE_CHECK_KSK, &cfg_type_boolean,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_CLAUSEFLAG_OBSOLETE,
NULL },
- { "use-alt-transfer-source", NULL,
+ { CFG_CLAUSE_USE_ALT_TRANSFER_SOURCE, NULL,
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR | CFG_ZONE_STUB |
CFG_CLAUSEFLAG_ANCIENT,
NULL },
- { "zero-no-soa-ttl", &cfg_type_boolean,
+ { CFG_CLAUSE_ZERO_NO_SOA_TTL, &cfg_type_boolean,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR, NULL },
- { "zone-statistics", &cfg_type_zonestat,
+ { CFG_CLAUSE_ZONE_STATISTICS, &cfg_type_zonestat,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR |
CFG_ZONE_STUB | CFG_ZONE_STATICSTUB | CFG_ZONE_REDIRECT,
NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
/*%
@@ -2792,76 +2831,78 @@ static cfg_clausedef_t zone_only_clauses[] = {
* Note that the format of the check-names option is different between
* the zone options and the global/view options. Ugh.
*/
- { "type", &cfg_type_zonetype,
+ { CFG_CLAUSE_TYPE, &cfg_type_zonetype,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR |
CFG_ZONE_STUB | CFG_ZONE_STATICSTUB | CFG_ZONE_HINT |
CFG_ZONE_REDIRECT | CFG_ZONE_FORWARD,
NULL },
- { "check-names", &cfg_type_checkmode,
+ { CFG_CLAUSE_CHECK_NAMES, &cfg_type_checkmode,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR |
CFG_ZONE_HINT | CFG_ZONE_STUB,
NULL },
- { "check-ns", &cfg_type_checkmode,
+ { CFG_CLAUSE_CHECK_NS, &cfg_type_checkmode,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR |
CFG_ZONE_HINT | CFG_ZONE_STUB,
NULL },
- { "checkds", &cfg_type_checkdstype,
+ { CFG_CLAUSE_CHECKDS, &cfg_type_checkdstype,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY, NULL },
- { "database", &cfg_type_astring,
+ { CFG_CLAUSE_DATABASE, &cfg_type_astring,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR |
CFG_ZONE_STUB,
NULL },
- { "delegation-only", NULL,
+ { CFG_CLAUSE_DELEGATION_ONLY, NULL,
CFG_ZONE_HINT | CFG_ZONE_STUB | CFG_ZONE_FORWARD |
CFG_CLAUSEFLAG_ANCIENT,
NULL },
- { "dlz", &cfg_type_astring,
+ { CFG_CLAUSE_DLZ, &cfg_type_astring,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_REDIRECT, NULL },
- { "file", &cfg_type_qstring,
+ { CFG_CLAUSE_FILE, &cfg_type_qstring,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR |
CFG_ZONE_STUB | CFG_ZONE_HINT | CFG_ZONE_REDIRECT,
NULL },
- { "initial-file", &cfg_type_qstring, CFG_ZONE_PRIMARY, NULL },
- { "inline-signing", &cfg_type_boolean,
+ { CFG_CLAUSE_INITIAL_FILE, &cfg_type_qstring, CFG_ZONE_PRIMARY, NULL },
+ { CFG_CLAUSE_INLINE_SIGNING, &cfg_type_boolean,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY, NULL },
- { "ixfr-base", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "ixfr-from-differences", &cfg_type_boolean,
+ { CFG_CLAUSE_IXFR_BASE, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_IXFR_FROM_DIFFERENCES, &cfg_type_boolean,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR, NULL },
- { "ixfr-tmp-file", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "journal", &cfg_type_qstring,
+ { CFG_CLAUSE_IXFR_TMP_FILE, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_JOURNAL, &cfg_type_qstring,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR, NULL },
- { "log-report-channel", &cfg_type_boolean,
+ { CFG_CLAUSE_LOG_REPORT_CHANNEL, &cfg_type_boolean,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY, NULL },
- { "masters", &cfg_type_namesockaddrkeylist,
+ { CFG_CLAUSE_MASTERS, &cfg_type_namesockaddrkeylist,
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR | CFG_ZONE_STUB |
CFG_ZONE_REDIRECT | CFG_CLAUSEFLAG_NODOC,
NULL },
- { "parental-agents", &cfg_type_namesockaddrkeylist,
+ { CFG_CLAUSE_PARENTAL_AGENTS, &cfg_type_namesockaddrkeylist,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY, NULL },
- { "plugin", &cfg_type_plugin,
+ { CFG_CLAUSE_PLUGIN, &cfg_type_plugin,
CFG_CLAUSEFLAG_MULTI | CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY |
CFG_ZONE_REDIRECT | CFG_ZONE_MIRROR,
NULL },
- { "primaries", &cfg_type_namesockaddrkeylist,
+ { CFG_CLAUSE_PRIMARIES, &cfg_type_namesockaddrkeylist,
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR | CFG_ZONE_STUB |
CFG_ZONE_REDIRECT,
NULL },
- { "pubkey", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "server-addresses", &cfg_type_bracketed_netaddrlist,
+ { CFG_CLAUSE_PUBKEY, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_SERVER_ADDRESSES, &cfg_type_bracketed_netaddrlist,
CFG_ZONE_STATICSTUB, NULL },
- { "server-names", &cfg_type_namelist, CFG_ZONE_STATICSTUB, NULL },
- { "update-policy", &cfg_type_updatepolicy, CFG_ZONE_PRIMARY, NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_SERVER_NAMES, &cfg_type_namelist, CFG_ZONE_STATICSTUB,
+ NULL },
+ { CFG_CLAUSE_UPDATE_POLICY, &cfg_type_updatepolicy, CFG_ZONE_PRIMARY,
+ NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
static cfg_clausedef_t non_template_clauses[] = {
- { "in-view", &cfg_type_astring, CFG_ZONE_INVIEW, NULL },
- { "template", &cfg_type_astring,
+ { CFG_CLAUSE_IN_VIEW, &cfg_type_astring, CFG_ZONE_INVIEW, NULL },
+ { CFG_CLAUSE_TEMPLATE, &cfg_type_astring,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR |
CFG_ZONE_STUB | CFG_ZONE_STATICSTUB | CFG_ZONE_HINT |
CFG_ZONE_REDIRECT | CFG_ZONE_FORWARD,
NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
/*% The top-level named.conf syntax. */
@@ -2929,9 +2970,9 @@ cfg_type_t cfg_type_dnssecpolicyopts = {
/*% The "dynamically loadable zones" statement syntax. */
static cfg_clausedef_t dlz_clauses[] = {
- { "database", &cfg_type_astring, 0, NULL },
- { "search", &cfg_type_boolean, 0, NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_DATABASE, &cfg_type_astring, 0, NULL },
+ { CFG_CLAUSE_SEARCH, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
static cfg_clausedef_t *dlz_clausesets[] = { dlz_clauses, NULL };
static cfg_type_t cfg_type_dlz = { "dlz", cfg_parse_named_map,
@@ -2976,9 +3017,9 @@ static cfg_type_t cfg_type_plugin = { "plugin", cfg_parse_tuple,
* Clauses that can be found within the 'key' statement.
*/
static cfg_clausedef_t key_clauses[] = {
- { "algorithm", &cfg_type_astring, 0, NULL },
- { "secret", &cfg_type_sstring, 0, NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_ALGORITHM, &cfg_type_astring, 0, NULL },
+ { CFG_CLAUSE_SECRET, &cfg_type_sstring, 0, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
static cfg_clausedef_t *key_clausesets[] = { key_clauses, NULL };
@@ -2990,9 +3031,9 @@ static cfg_type_t cfg_type_key = { "key", cfg_parse_named_map,
* A key-store statement.
*/
static cfg_clausedef_t keystore_clauses[] = {
- { "directory", &cfg_type_astring, 0, NULL },
- { "pkcs11-uri", &cfg_type_qstring, 0, NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_DIRECTORY, &cfg_type_astring, 0, NULL },
+ { CFG_CLAUSE_PKCS11_URI, &cfg_type_qstring, 0, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
static cfg_clausedef_t *keystore_clausesets[] = { keystore_clauses, NULL };
@@ -3018,34 +3059,34 @@ static cfg_type_t cfg_type_keystore = { "key-store", cfg_parse_tuple,
* exercise the new clause when adding new clauses.
*/
static cfg_clausedef_t server_clauses[] = {
- { "bogus", &cfg_type_boolean, 0, NULL },
- { "edns", &cfg_type_boolean, 0, NULL },
- { "edns-udp-size", &cfg_type_uint32, 0, NULL },
- { "edns-version", &cfg_type_uint32, 0, NULL },
- { "keys", &cfg_type_server_key_kludge, 0, NULL },
- { "max-udp-size", &cfg_type_uint32, 0, NULL },
- { "notify-source", &cfg_type_sockaddr4wild, 0, NULL },
- { "notify-source-v6", &cfg_type_sockaddr6wild, 0, NULL },
- { "padding", &cfg_type_uint32, 0, NULL },
- { "provide-ixfr", &cfg_type_boolean, 0, NULL },
- { "query-source", &cfg_type_server_querysource4, 0, NULL },
- { "query-source-v6", &cfg_type_server_querysource6, 0, NULL },
- { "request-expire", &cfg_type_boolean, 0, NULL },
- { "request-ixfr", &cfg_type_boolean, 0, NULL },
- { "request-ixfr-max-diffs", &cfg_type_uint32, 0, NULL },
- { "request-nsid", &cfg_type_boolean, 0, NULL },
- { "request-zoneversion", &cfg_type_boolean, 0, NULL },
- { "request-sit", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "require-cookie", &cfg_type_boolean, 0, NULL },
- { "send-cookie", &cfg_type_boolean, 0, NULL },
- { "support-ixfr", NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
- { "tcp-keepalive", &cfg_type_boolean, 0, NULL },
- { "tcp-only", &cfg_type_boolean, 0, NULL },
- { "transfer-format", &cfg_type_transferformat, 0, NULL },
- { "transfer-source", &cfg_type_sockaddr4wild, 0, NULL },
- { "transfer-source-v6", &cfg_type_sockaddr6wild, 0, NULL },
- { "transfers", &cfg_type_uint32, 0, NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_BOGUS, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_EDNS, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_EDNS_UDP_SIZE, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_EDNS_VERSION, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_KEYS, &cfg_type_server_key_kludge, 0, NULL },
+ { CFG_CLAUSE_MAX_UDP_SIZE, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_NOTIFY_SOURCE, &cfg_type_sockaddr4wild, 0, NULL },
+ { CFG_CLAUSE_NOTIFY_SOURCE_V6, &cfg_type_sockaddr6wild, 0, NULL },
+ { CFG_CLAUSE_PADDING, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_PROVIDE_IXFR, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_QUERY_SOURCE, &cfg_type_server_querysource4, 0, NULL },
+ { CFG_CLAUSE_QUERY_SOURCE_V6, &cfg_type_server_querysource6, 0, NULL },
+ { CFG_CLAUSE_REQUEST_EXPIRE, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_REQUEST_IXFR, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_REQUEST_IXFR_MAX_DIFFS, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_REQUEST_NSID, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_REQUEST_ZONEVERSION, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_REQUEST_SIT, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_REQUIRE_COOKIE, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_SEND_COOKIE, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_SUPPORT_IXFR, NULL, CFG_CLAUSEFLAG_ANCIENT, NULL },
+ { CFG_CLAUSE_TCP_KEEPALIVE, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_TCP_ONLY, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_TRANSFER_FORMAT, &cfg_type_transferformat, 0, NULL },
+ { CFG_CLAUSE_TRANSFER_SOURCE, &cfg_type_sockaddr4wild, 0, NULL },
+ { CFG_CLAUSE_TRANSFER_SOURCE_V6, &cfg_type_sockaddr6wild, 0, NULL },
+ { CFG_CLAUSE_TRANSFERS, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
static cfg_clausedef_t *server_clausesets[] = { server_clauses, NULL };
static cfg_type_t cfg_type_server = { "server", cfg_parse_netprefix_map,
@@ -3077,17 +3118,17 @@ static cfg_type_t cfg_type_printtime = { "printtime", parse_printtime,
static cfg_clausedef_t channel_clauses[] = {
/* Destinations. We no longer require these to be first. */
- { "file", &cfg_type_logfile, 0, NULL },
- { "syslog", &cfg_type_optional_facility, 0, NULL },
- { "null", &cfg_type_void, 0, NULL },
- { "stderr", &cfg_type_void, 0, NULL },
+ { CFG_CLAUSE_FILE, &cfg_type_logfile, 0, NULL },
+ { CFG_CLAUSE_SYSLOG, &cfg_type_optional_facility, 0, NULL },
+ { CFG_CLAUSE_NULL, &cfg_type_void, 0, NULL },
+ { CFG_CLAUSE_STDERR, &cfg_type_void, 0, NULL },
/* Options. We now accept these for the null channel, too. */
- { "severity", &cfg_type_logseverity, 0, NULL },
- { "print-time", &cfg_type_printtime, 0, NULL },
- { "print-severity", &cfg_type_boolean, 0, NULL },
- { "print-category", &cfg_type_boolean, 0, NULL },
- { "buffered", &cfg_type_boolean, 0, NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_SEVERITY, &cfg_type_logseverity, 0, NULL },
+ { CFG_CLAUSE_PRINT_TIME, &cfg_type_printtime, 0, NULL },
+ { CFG_CLAUSE_PRINT_SEVERITY, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_PRINT_CATEGORY, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_BUFFERED, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
static cfg_clausedef_t *channel_clausesets[] = { channel_clauses, NULL };
static cfg_type_t cfg_type_channel = { "channel", cfg_parse_named_map,
@@ -3106,9 +3147,9 @@ static cfg_type_t cfg_type_destinationlist = { "destinationlist",
* Clauses that can be found in a 'logging' statement.
*/
static cfg_clausedef_t logging_clauses[] = {
- { "channel", &cfg_type_channel, CFG_CLAUSEFLAG_MULTI, NULL },
- { "category", &cfg_type_category, CFG_CLAUSEFLAG_MULTI, NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_CHANNEL, &cfg_type_channel, CFG_CLAUSEFLAG_MULTI, NULL },
+ { CFG_CLAUSE_CATEGORY, &cfg_type_category, CFG_CLAUSEFLAG_MULTI, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
static cfg_clausedef_t *logging_clausesets[] = { logging_clauses, NULL };
static cfg_type_t cfg_type_logging = { "logging", cfg_parse_map,
@@ -3129,9 +3170,10 @@ static cfg_type_t cfg_type_addzone = { "zone", cfg_parse_tuple,
cfg_print_tuple, cfg_doc_tuple,
&cfg_rep_tuple, addzone_fields };
-static cfg_clausedef_t addzoneconf_clauses[] = { { "zone", &cfg_type_addzone,
- CFG_CLAUSEFLAG_MULTI, NULL },
- { NULL, NULL, 0, NULL } };
+static cfg_clausedef_t addzoneconf_clauses[] = {
+ { CFG_CLAUSE_ZONE, &cfg_type_addzone, CFG_CLAUSEFLAG_MULTI, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
+};
static cfg_clausedef_t *addzoneconf_clausesets[] = { addzoneconf_clauses,
NULL };
@@ -3441,13 +3483,13 @@ static cfg_type_t cfg_type_notifytype = {
* Generalized DNS Notifications.
*/
static cfg_clausedef_t notify_clauses[] = {
- { "notify", &cfg_type_boolean, 0, NULL }, /* this limits the options for
- NOTIFY(SOA) */
- { "notify-defer", &cfg_type_uint32, 0, NULL },
- { "notify-delay", &cfg_type_uint32, 0, NULL },
- { "notify-source", &cfg_type_sockaddr4wild, 0, NULL },
- { "notify-source-v6", &cfg_type_sockaddr6wild, 0, NULL },
- { NULL, NULL, 0, NULL },
+ { CFG_CLAUSE_NOTIFY, &cfg_type_boolean, 0, NULL }, /* this limits the
+ options for NOTIFY(SOA) */
+ { CFG_CLAUSE_NOTIFY_DEFER, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_NOTIFY_DELAY, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_NOTIFY_SOURCE, &cfg_type_sockaddr4wild, 0, NULL },
+ { CFG_CLAUSE_NOTIFY_SOURCE_V6, &cfg_type_sockaddr6wild, 0, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL },
};
static cfg_clausedef_t *notify_clausesets[] = { notify_clauses, NULL };
@@ -3579,9 +3621,9 @@ static cfg_type_t cfg_type_unixcontrol = {
};
static cfg_clausedef_t controls_clauses[] = {
- { "inet", &cfg_type_inetcontrol, CFG_CLAUSEFLAG_MULTI, NULL },
- { "unix", &cfg_type_unixcontrol, CFG_CLAUSEFLAG_MULTI, NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_INET, &cfg_type_inetcontrol, CFG_CLAUSEFLAG_MULTI, NULL },
+ { CFG_CLAUSE_UNIX, &cfg_type_unixcontrol, CFG_CLAUSEFLAG_MULTI, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
static cfg_clausedef_t *controls_clausesets[] = { controls_clauses, NULL };
@@ -3621,8 +3663,8 @@ static cfg_type_t cfg_type_statschannel = {
};
static cfg_clausedef_t statservers_clauses[] = {
- { "inet", &cfg_type_statschannel, CFG_CLAUSEFLAG_MULTI, NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_INET, &cfg_type_statschannel, CFG_CLAUSEFLAG_MULTI, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
static cfg_clausedef_t *statservers_clausesets[] = { statservers_clauses,
@@ -4058,12 +4100,13 @@ static cfg_type_t cfg_type_optional_sourceaddr6 = {
*/
static cfg_clausedef_t rndcconf_options_clauses[] = {
- { "default-key", &cfg_type_astring, 0, NULL },
- { "default-port", &cfg_type_uint32, 0, NULL },
- { "default-server", &cfg_type_astring, 0, NULL },
- { "default-source-address", &cfg_type_netaddr4wild, 0, NULL },
- { "default-source-address-v6", &cfg_type_netaddr6wild, 0, NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_DEFAULT_KEY, &cfg_type_astring, 0, NULL },
+ { CFG_CLAUSE_DEFAULT_PORT, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_DEFAULT_SERVER, &cfg_type_astring, 0, NULL },
+ { CFG_CLAUSE_DEFAULT_SOURCE_ADDRESS, &cfg_type_netaddr4wild, 0, NULL },
+ { CFG_CLAUSE_DEFAULT_SOURCE_ADDRESS_V6, &cfg_type_netaddr6wild, 0,
+ NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
static cfg_clausedef_t *rndcconf_options_clausesets[] = {
@@ -4076,12 +4119,13 @@ static cfg_type_t cfg_type_rndcconf_options = {
};
static cfg_clausedef_t rndcconf_server_clauses[] = {
- { "key", &cfg_type_astring, 0, NULL },
- { "port", &cfg_type_uint32, 0, NULL },
- { "source-address", &cfg_type_netaddr4wild, 0, NULL },
- { "source-address-v6", &cfg_type_netaddr6wild, 0, NULL },
- { "addresses", &cfg_type_bracketed_sockaddrnameportlist, 0, NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_KEY, &cfg_type_astring, 0, NULL },
+ { CFG_CLAUSE_PORT, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_SOURCE_ADDRESS, &cfg_type_netaddr4wild, 0, NULL },
+ { CFG_CLAUSE_SOURCE_ADDRESS_V6, &cfg_type_netaddr6wild, 0, NULL },
+ { CFG_CLAUSE_ADDRESSES, &cfg_type_bracketed_sockaddrnameportlist, 0,
+ NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
static cfg_clausedef_t *rndcconf_server_clausesets[] = {
@@ -4094,10 +4138,11 @@ static cfg_type_t cfg_type_rndcconf_server = {
};
static cfg_clausedef_t rndcconf_clauses[] = {
- { "key", &cfg_type_key, CFG_CLAUSEFLAG_MULTI, NULL },
- { "server", &cfg_type_rndcconf_server, CFG_CLAUSEFLAG_MULTI, NULL },
- { "options", &cfg_type_rndcconf_options, 0, NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_KEY, &cfg_type_key, CFG_CLAUSEFLAG_MULTI, NULL },
+ { CFG_CLAUSE_SERVER, &cfg_type_rndcconf_server, CFG_CLAUSEFLAG_MULTI,
+ NULL },
+ { CFG_CLAUSE_OPTIONS, &cfg_type_rndcconf_options, 0, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
static cfg_clausedef_t *rndcconf_clausesets[] = { rndcconf_clauses, NULL };
@@ -4106,8 +4151,10 @@ cfg_type_t cfg_type_rndcconf = { "rndcconf", cfg_parse_mapbody,
cfg_print_mapbody, cfg_doc_mapbody,
&cfg_rep_map, rndcconf_clausesets };
-static cfg_clausedef_t rndckey_clauses[] = { { "key", &cfg_type_key, 0, NULL },
- { NULL, NULL, 0, NULL } };
+static cfg_clausedef_t rndckey_clauses[] = {
+ { CFG_CLAUSE_KEY, &cfg_type_key, 0, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
+};
static cfg_clausedef_t *rndckey_clausesets[] = { rndckey_clauses, NULL };
@@ -4269,34 +4316,34 @@ static int
cmp_clause(const void *ap, const void *bp) {
const cfg_clausedef_t *a = (const cfg_clausedef_t *)ap;
const cfg_clausedef_t *b = (const cfg_clausedef_t *)bp;
- return strcmp(a->name, b->name);
+ return strcmp(cfg_clause_as_string[a->name],
+ cfg_clause_as_string[b->name]);
}
bool
-cfg_clause_validforzone(const char *name, unsigned int ztype) {
+cfg_clause_validforzone(enum cfg_clause name, unsigned int ztype) {
const cfg_clausedef_t *clause;
bool valid = false;
- for (clause = zone_clauses; clause->name != NULL; clause++) {
- if ((clause->flags & ztype) == 0 ||
- strcmp(clause->name, name) != 0)
- {
+ for (clause = zone_clauses; clause->name != CFG_CLAUSE__NONE; clause++)
+ {
+ if ((clause->flags & ztype) == 0 || clause->name != name) {
continue;
}
valid = true;
}
- for (clause = zone_only_clauses; clause->name != NULL; clause++) {
- if ((clause->flags & ztype) == 0 ||
- strcmp(clause->name, name) != 0)
- {
+ for (clause = zone_only_clauses; clause->name != CFG_CLAUSE__NONE;
+ clause++)
+ {
+ if ((clause->flags & ztype) == 0 || clause->name != name) {
continue;
}
valid = true;
}
- for (clause = non_template_clauses; clause->name != NULL; clause++) {
- if ((clause->flags & ztype) == 0 ||
- strcmp(clause->name, name) != 0)
- {
+ for (clause = non_template_clauses; clause->name != CFG_CLAUSE__NONE;
+ clause++)
+ {
+ if ((clause->flags & ztype) == 0 || clause->name != name) {
continue;
}
valid = true;
@@ -4373,7 +4420,7 @@ cfg_print_zonegrammar(const unsigned int zonetype, unsigned int flags,
UNREACHABLE();
}
- for (clause = clauses; clause->name != NULL; clause++) {
+ for (clause = clauses; clause->name != CFG_CLAUSE__NONE; clause++) {
if (((pctx.flags & CFG_PRINTER_ACTIVEONLY) != 0) &&
(((clause->flags & CFG_CLAUSEFLAG_OBSOLETE) != 0) ||
((clause->flags & CFG_CLAUSEFLAG_TESTONLY) != 0)))
@@ -4387,12 +4434,12 @@ cfg_print_zonegrammar(const unsigned int zonetype, unsigned int flags,
}
if ((clause->flags & zonetype) == 0 ||
- strcasecmp(clause->name, "type") == 0)
+ clause->name == CFG_CLAUSE_TYPE)
{
continue;
}
cfg_print_indent(&pctx);
- cfg_print_cstr(&pctx, clause->name);
+ cfg_print_cstr(&pctx, cfg_clause_as_string[clause->name]);
cfg_print_cstr(&pctx, " ");
cfg_doc_obj(&pctx, clause->type);
cfg_print_cstr(&pctx, ";");
@@ -4415,17 +4462,17 @@ static cfg_type_t cfg_type_tlsprotos = { "tls_protocols",
&cfg_type_astring };
static cfg_clausedef_t tls_clauses[] = {
- { "key-file", &cfg_type_qstring, 0, NULL },
- { "cert-file", &cfg_type_qstring, 0, NULL },
- { "ca-file", &cfg_type_qstring, 0, NULL },
- { "remote-hostname", &cfg_type_qstring, 0, NULL },
- { "dhparam-file", &cfg_type_qstring, 0, NULL },
- { "protocols", &cfg_type_tlsprotos, 0, NULL },
- { "ciphers", &cfg_type_astring, 0, NULL },
- { "cipher-suites", &cfg_type_astring, 0, NULL },
- { "prefer-server-ciphers", &cfg_type_boolean, 0, NULL },
- { "session-tickets", &cfg_type_boolean, 0, NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_KEY_FILE, &cfg_type_qstring, 0, NULL },
+ { CFG_CLAUSE_CERT_FILE, &cfg_type_qstring, 0, NULL },
+ { CFG_CLAUSE_CA_FILE, &cfg_type_qstring, 0, NULL },
+ { CFG_CLAUSE_REMOTE_HOSTNAME, &cfg_type_qstring, 0, NULL },
+ { CFG_CLAUSE_DHPARAM_FILE, &cfg_type_qstring, 0, NULL },
+ { CFG_CLAUSE_PROTOCOLS, &cfg_type_tlsprotos, 0, NULL },
+ { CFG_CLAUSE_CIPHERS, &cfg_type_astring, 0, NULL },
+ { CFG_CLAUSE_CIPHER_SUITES, &cfg_type_astring, 0, NULL },
+ { CFG_CLAUSE_PREFER_SERVER_CIPHERS, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE_SESSION_TICKETS, &cfg_type_boolean, 0, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
static cfg_clausedef_t *tls_clausesets[] = { tls_clauses, NULL };
@@ -4451,10 +4498,11 @@ static cfg_type_t cfg_type_bracketed_http_endpoint_list = {
};
static cfg_clausedef_t cfg_http_description_clauses[] = {
- { "endpoints", &cfg_type_bracketed_http_endpoint_list, 0, NULL },
- { "listener-clients", &cfg_type_uint32, 0, NULL },
- { "streams-per-connection", &cfg_type_uint32, 0, NULL },
- { NULL, NULL, 0, NULL }
+ { CFG_CLAUSE_ENDPOINTS, &cfg_type_bracketed_http_endpoint_list, 0,
+ NULL },
+ { CFG_CLAUSE_LISTENER_CLIENTS, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE_STREAMS_PER_CONNECTION, &cfg_type_uint32, 0, NULL },
+ { CFG_CLAUSE__NONE, NULL, 0, NULL }
};
static cfg_clausedef_t *http_description_clausesets[] = {
diff --git a/lib/isccfg/parser.c b/lib/isccfg/parser.c
index 79101e351d..e34d5e36d0 100644
--- a/lib/isccfg/parser.c
+++ b/lib/isccfg/parser.c
@@ -66,6 +66,7 @@
#include <dns/ttl.h>
#include <isccfg/cfg.h>
+#include <isccfg/clause.h>
#include <isccfg/grammar.h>
#include <isccfg/tokens.h>
@@ -81,10 +82,6 @@ static_assert(sizeof(struct cfg_obj) <= 40,
#define CAT CFG_LOGCATEGORY_CONFIG
#define MOD CFG_LOGMODULE_PARSER
-/* isc_symtab_t takes both a string and an int as input, but we don't need
- * the int, so we define a "dummy" value to use instead. */
-#define SYMTAB_DUMMY_TYPE 1
-
#define TOKEN_STRING(pctx) (pctx->token.value.as_textregion.base)
/* cfg_obj_t magic number */
@@ -2633,18 +2630,20 @@ cfg_parse_mapbody(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
clause = NULL;
for (clauseset = clausesets; *clauseset != NULL; clauseset++) {
- for (clause = *clauseset; clause->name != NULL;
- clause++)
+ for (clause = *clauseset;
+ clause->name != CFG_CLAUSE__NONE; clause++)
{
- if (strcasecmp(TOKEN_STRING(pctx),
- clause->name) == 0)
+ if (strcasecmp(
+ TOKEN_STRING(pctx),
+ cfg_clause_as_string[clause->name]) ==
+ 0)
{
goto done;
}
}
}
done:
- if (clause == NULL || clause->name == NULL) {
+ if (clause == NULL || clause->name == CFG_CLAUSE__NONE) {
cfg_parser_error(pctx, CFG_LOG_NOPREP,
"unknown option");
/*
@@ -2664,7 +2663,7 @@ cfg_parse_mapbody(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
if ((clause->flags & CFG_CLAUSEFLAG_ANCIENT) != 0) {
cfg_parser_error(pctx, 0,
"option '%s' no longer exists",
- clause->name);
+ cfg_clause_as_string[clause->name]);
CLEANUP(ISC_R_FAILURE);
}
if ((pctx->flags & CFG_PCTX_ALLCONFIGS) == 0 &&
@@ -2673,7 +2672,7 @@ cfg_parse_mapbody(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
cfg_parser_error(pctx, 0,
"option '%s' was not "
"enabled at compile time",
- clause->name);
+ cfg_clause_as_string[clause->name]);
CLEANUP(ISC_R_FAILURE);
}
if ((pctx->flags & CFG_PCTX_BUILTIN) == 0 &&
@@ -2682,7 +2681,7 @@ cfg_parse_mapbody(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
cfg_parser_error(pctx, 0,
"option '%s' is allowed in the "
"builtin configuration only",
- clause->name);
+ cfg_clause_as_string[clause->name]);
CHECK(ISC_R_FAILURE);
}
@@ -2691,7 +2690,7 @@ cfg_parse_mapbody(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
(clause->flags & CFG_CLAUSEFLAG_DEPRECATED) != 0)
{
cfg_parser_warning(pctx, 0, "option '%s' is deprecated",
- clause->name);
+ cfg_clause_as_string[clause->name]);
}
if ((pctx->flags & CFG_PCTX_NOOBSOLETE) == 0 &&
(clause->flags & CFG_CLAUSEFLAG_OBSOLETE) != 0)
@@ -2699,7 +2698,7 @@ cfg_parse_mapbody(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
cfg_parser_warning(pctx, 0,
"option '%s' is obsolete and "
"should be removed ",
- clause->name);
+ cfg_clause_as_string[clause->name]);
}
if ((pctx->flags & CFG_PCTX_NOEXPERIMENTAL) == 0 &&
(clause->flags & CFG_CLAUSEFLAG_EXPERIMENTAL) != 0)
@@ -2707,7 +2706,7 @@ cfg_parse_mapbody(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
cfg_parser_warning(pctx, 0,
"option '%s' is experimental and "
"subject to change in the future",
- clause->name);
+ cfg_clause_as_string[clause->name]);
}
/* See if the clause already has a value; if not create one. */
@@ -2720,9 +2719,8 @@ cfg_parse_mapbody(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
&cfg_type_implicitlist, &listobj);
symval.as_pointer = listobj;
result = isc_symtab_define_and_return(
- obj->value.map->symtab, clause->name,
- SYMTAB_DUMMY_TYPE, symval, isc_symexists_reject,
- &symval);
+ obj->value.map->symtab, "", clause->name,
+ symval, isc_symexists_reject, &symval);
if (result == ISC_R_EXISTS) {
CLEANUP_OBJ(listobj);
listobj = symval.as_pointer;
@@ -2737,9 +2735,9 @@ cfg_parse_mapbody(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
result = parse_symtab_elt(pctx, clause,
obj->value.map->symtab);
if (result == ISC_R_EXISTS) {
- cfg_parser_error(pctx, CFG_LOG_NEAR,
- "'%s' redefined",
- clause->name);
+ cfg_parser_error(
+ pctx, CFG_LOG_NEAR, "'%s' redefined",
+ cfg_clause_as_string[clause->name]);
CHECK(result);
} else if (result != ISC_R_SUCCESS) {
cfg_parser_error(pctx, CFG_LOG_NEAR,
@@ -2806,7 +2804,7 @@ parse_symtab_elt(cfg_parser_t *pctx, const cfg_clausedef_t *clause,
}
symval.as_pointer = obj;
- CHECK(isc_symtab_define(symtab, clause->name, SYMTAB_DUMMY_TYPE, symval,
+ CHECK(isc_symtab_define(symtab, "", clause->name, symval,
isc_symexists_reject));
return ISC_R_SUCCESS;
@@ -2919,29 +2917,31 @@ cfg_print_mapbody(cfg_printer_t *pctx, const cfg_obj_t *obj) {
isc_symvalue_t symval;
const cfg_clausedef_t *clause;
- for (clause = *clauseset; clause->name != NULL; clause++) {
+ for (clause = *clauseset; clause->name != CFG_CLAUSE__NONE;
+ clause++)
+ {
isc_result_t result;
if ((clause->flags & CFG_CLAUSEFLAG_BUILTINONLY) != 0) {
continue;
}
- result = isc_symtab_lookup(obj->value.map->symtab,
- clause->name,
- SYMTAB_DUMMY_TYPE, &symval);
+ result = isc_symtab_lookup(obj->value.map->symtab, "",
+ clause->name, &symval);
if (result == ISC_R_SUCCESS) {
cfg_obj_t *symobj = symval.as_pointer;
+ const char *namestr =
+ cfg_clause_as_string[clause->name];
if (symobj->type == &cfg_type_implicitlist) {
/* Multivalued. */
cfg_list_t *list = symobj->value.list;
ISC_LIST_FOREACH(*list, elt, link) {
- print_symval(pctx, clause->name,
+ print_symval(pctx, namestr,
elt->obj);
}
} else {
/* Single-valued. */
- print_symval(pctx, clause->name,
- symobj);
+ print_symval(pctx, namestr, symobj);
}
} else if (result == ISC_R_NOTFOUND) {
/* do nothing */
@@ -2993,7 +2993,9 @@ cfg_doc_mapbody(cfg_printer_t *pctx, const cfg_type_t *type) {
REQUIRE(type != NULL);
for (clauseset = type->of; *clauseset != NULL; clauseset++) {
- for (clause = *clauseset; clause->name != NULL; clause++) {
+ for (clause = *clauseset; clause->name != CFG_CLAUSE__NONE;
+ clause++)
+ {
if (((pctx->flags & CFG_PRINTER_ACTIVEONLY) != 0) &&
(((clause->flags & CFG_CLAUSEFLAG_OBSOLETE) != 0) ||
((clause->flags & CFG_CLAUSEFLAG_TESTONLY) != 0)))
@@ -3005,7 +3007,8 @@ cfg_doc_mapbody(cfg_printer_t *pctx, const cfg_type_t *type) {
{
continue;
}
- cfg_print_cstr(pctx, clause->name);
+ cfg_print_cstr(pctx,
+ cfg_clause_as_string[clause->name]);
cfg_print_cstr(pctx, " ");
cfg_doc_obj(pctx, clause->type);
cfg_print_cstr(pctx, ";");
@@ -3051,7 +3054,9 @@ cfg_doc_map(cfg_printer_t *pctx, const cfg_type_t *type) {
print_open(pctx);
for (clauseset = type->of; *clauseset != NULL; clauseset++) {
- for (clause = *clauseset; clause->name != NULL; clause++) {
+ for (clause = *clauseset; clause->name != CFG_CLAUSE__NONE;
+ clause++)
+ {
if (((pctx->flags & CFG_PRINTER_ACTIVEONLY) != 0) &&
(((clause->flags & CFG_CLAUSEFLAG_OBSOLETE) != 0) ||
((clause->flags & CFG_CLAUSEFLAG_TESTONLY) != 0)))
@@ -3064,7 +3069,8 @@ cfg_doc_map(cfg_printer_t *pctx, const cfg_type_t *type) {
continue;
}
cfg_print_indent(pctx);
- cfg_print_cstr(pctx, clause->name);
+ cfg_print_cstr(pctx,
+ cfg_clause_as_string[clause->name]);
if (clause->type->print != cfg_print_void) {
cfg_print_cstr(pctx, " ");
}
@@ -3084,17 +3090,18 @@ cfg_obj_ismap(const cfg_obj_t *obj) {
}
isc_result_t
-cfg_map_get(const cfg_obj_t *mapobj, const char *name, const cfg_obj_t **obj) {
+cfg_map_get(const cfg_obj_t *mapobj, enum cfg_clause name,
+ const cfg_obj_t **obj) {
isc_symvalue_t val;
const cfg_map_t *map;
REQUIRE(mapobj != NULL && mapobj->type->rep == &cfg_rep_map);
- REQUIRE(name != NULL);
+ REQUIRE(name != CFG_CLAUSE__NONE);
REQUIRE(obj != NULL && *obj == NULL);
map = mapobj->value.map;
- RETERR(isc_symtab_lookup(map->symtab, name, SYMTAB_DUMMY_TYPE, &val));
+ RETERR(isc_symtab_lookup(map->symtab, "", name, &val));
*obj = val.as_pointer;
return ISC_R_SUCCESS;
}
@@ -3132,7 +3139,7 @@ cfg_map_firstclause(const cfg_type_t *map, const void **clauses,
}
*clauses = *clauseset;
*idx = 0;
- while ((*clauseset)[*idx].name == NULL) {
+ while ((*clauseset)[*idx].name == CFG_CLAUSE__NONE) {
*clauses = (*++clauseset);
if (*clauses == NULL) {
return NULL;
@@ -3156,7 +3163,7 @@ cfg_map_nextclause(const cfg_type_t *map, const void **clauses,
}
INSIST(*clauseset == *clauses);
(*idx)++;
- while ((*clauseset)[*idx].name == NULL) {
+ while ((*clauseset)[*idx].name == CFG_CLAUSE__NONE) {
*idx = 0;
*clauses = (*++clauseset);
if (*clauses == NULL) {
@@ -3167,16 +3174,16 @@ cfg_map_nextclause(const cfg_type_t *map, const void **clauses,
}
const cfg_clausedef_t *
-cfg_map_findclause(const cfg_type_t *map, const char *name) {
+cfg_map_findclause(const cfg_type_t *map, enum cfg_clause name) {
const cfg_clausedef_t *found = NULL;
const void *clauses = NULL;
unsigned int idx;
REQUIRE(map != NULL && map->rep == &cfg_rep_map);
- REQUIRE(name != NULL);
+ REQUIRE(name != CFG_CLAUSE__NONE);
found = cfg_map_firstclause(map, &clauses, &idx);
- while (found != NULL && name != NULL && strcasecmp(name, found->name)) {
+ while (found != NULL && found->name != name) {
found = cfg_map_nextclause(map, &clauses, &idx);
}
@@ -4252,8 +4259,7 @@ map_define(cfg_obj_t *mapobj, cfg_obj_t *obj, const cfg_clausedef_t *clause) {
isc_symvalue_t symval;
map = mapobj->value.map;
- result = isc_symtab_lookup(map->symtab, clause->name, SYMTAB_DUMMY_TYPE,
- &symval);
+ result = isc_symtab_lookup(map->symtab, "", clause->name, &symval);
if (result == ISC_R_NOTFOUND) {
if ((clause->flags & CFG_CLAUSEFLAG_MULTI) != 0) {
cfg_obj_t *destobj = NULL;
@@ -4269,9 +4275,8 @@ map_define(cfg_obj_t *mapobj, cfg_obj_t *obj, const cfg_clausedef_t *clause) {
symval.as_pointer = obj;
}
- result = isc_symtab_define(map->symtab, clause->name,
- SYMTAB_DUMMY_TYPE, symval,
- isc_symexists_reject);
+ result = isc_symtab_define(map->symtab, "", clause->name,
+ symval, isc_symexists_reject);
INSIST(result == ISC_R_SUCCESS);
} else {
cfg_obj_t *destobj = symval.as_pointer;
@@ -4292,15 +4297,15 @@ map_define(cfg_obj_t *mapobj, cfg_obj_t *obj, const cfg_clausedef_t *clause) {
}
isc_result_t
-cfg_map_add(cfg_obj_t *map, const cfg_obj_t *obj,
- const cfg_clausedef_t *clause) {
+cfg_map_addclone(cfg_obj_t *map, const cfg_obj_t *obj,
+ const cfg_clausedef_t *clause) {
isc_result_t result = ISC_R_SUCCESS;
cfg_obj_t *clone = NULL;
REQUIRE(VALID_CFGOBJ(obj));
REQUIRE(VALID_CFGOBJ(map));
REQUIRE(map->type->rep == &cfg_rep_map);
- REQUIRE(clause != NULL && clause->name != NULL);
+ REQUIRE(clause != NULL && clause->name != CFG_CLAUSE__NONE);
/*
* Repeatable clauses aren't explicitly defined as cfg_list types,
diff --git a/tests/isccfg/duration_test.c b/tests/isccfg/duration_test.c
index 6407b3f2fd..1c366d4c7e 100644
--- a/tests/isccfg/duration_test.c
+++ b/tests/isccfg/duration_test.c
@@ -33,6 +33,7 @@
#include <isc/util.h>
#include <isccfg/cfg.h>
+#include <isccfg/clause.h>
#include <isccfg/grammar.h>
#include <isccfg/namedconf.h>
@@ -151,7 +152,7 @@ ISC_RUN_TEST_IMPL(duration) {
}
assert_int_equal(result, ISC_R_SUCCESS);
- (void)cfg_map_get(c1, "dnssec-policy", &kasps);
+ (void)cfg_map_get(c1, CFG_CLAUSE_DNSSEC_POLICY, &kasps);
assert_non_null(kasps);
CFG_LIST_FOREACH(kasps, element) {
const cfg_listelt_t *key_element;
@@ -165,7 +166,7 @@ ISC_RUN_TEST_IMPL(duration) {
assert_non_null(kconf);
kopts = cfg_tuple_get(kconf, "options");
- result = cfg_map_get(kopts, "keys", &keys);
+ result = cfg_map_get(kopts, CFG_CLAUSE_KEYS, &keys);
assert_int_equal(result, ISC_R_SUCCESS);
key_element = cfg_list_first(keys);
diff --git a/tests/isccfg/grammar_test.c b/tests/isccfg/grammar_test.c
index ad524dcbdd..13520248a8 100644
--- a/tests/isccfg/grammar_test.c
+++ b/tests/isccfg/grammar_test.c
@@ -34,6 +34,7 @@
#include <isc/util.h>
#include <isccfg/cfg.h>
+#include <isccfg/clause.h>
#include <isccfg/grammar.h>
#include <isccfg/namedconf.h>
@@ -73,7 +74,7 @@ assert_text(const char *text) {
}
static void
-test__querysource(const char *clause_name, const char *name,
+test__querysource(enum cfg_clause clause_name, enum cfg_clause name,
const char *expected) {
const cfg_clausedef_t *options_clause = NULL;
options_clause = cfg_map_findclause(&cfg_type_namedconf, clause_name);
@@ -87,22 +88,22 @@ test__querysource(const char *clause_name, const char *name,
}
ISC_RUN_TEST_IMPL(query_source) {
- test__querysource("options", "query-source",
+ test__querysource(CFG_CLAUSE_OPTIONS, CFG_CLAUSE_QUERY_SOURCE,
"[ address ] ( <ipv4_address> | * | none )");
}
ISC_RUN_TEST_IMPL(query_source_v6) {
- test__querysource("options", "query-source-v6",
+ test__querysource(CFG_CLAUSE_OPTIONS, CFG_CLAUSE_QUERY_SOURCE_V6,
"[ address ] ( <ipv6_address> | * | none )");
}
ISC_RUN_TEST_IMPL(server_query_source) {
- test__querysource("server", "query-source",
+ test__querysource(CFG_CLAUSE_SERVER, CFG_CLAUSE_QUERY_SOURCE,
"[ address ] ( <ipv4_address> | * )");
}
ISC_RUN_TEST_IMPL(server_query_source_v6) {
- test__querysource("server", "query-source-v6",
+ test__querysource(CFG_CLAUSE_SERVER, CFG_CLAUSE_QUERY_SOURCE_V6,
"[ address ] ( <ipv6_address> | * )");
}
diff --git a/tests/isccfg/kaspconf_test.c b/tests/isccfg/kaspconf_test.c
index f3d1f99a18..678607300c 100644
--- a/tests/isccfg/kaspconf_test.c
+++ b/tests/isccfg/kaspconf_test.c
@@ -74,7 +74,7 @@ kasp_fromtext(const char *conftext) {
&config);
assert_int_equal(result, ISC_R_SUCCESS);
- result = cfg_map_get(config, "dnssec-policy", &kasps);
+ result = cfg_map_get(config, CFG_CLAUSE_DNSSEC_POLICY, &kasps);
assert_int_equal(result, ISC_R_SUCCESS);
result = cfg_kasp_fromconfig(cfg_listelt_value(cfg_list_first(kasps)),
diff --git a/tests/isccfg/parser_test.c b/tests/isccfg/parser_test.c
index 41066d38a8..6cb845153c 100644
--- a/tests/isccfg/parser_test.c
+++ b/tests/isccfg/parser_test.c
@@ -34,6 +34,7 @@
#include <isc/util.h>
#include <isccfg/cfg.h>
+#include <isccfg/clause.h>
#include <isccfg/grammar.h>
#include <isccfg/namedconf.h>
#include <isccfg/tokens.h>
@@ -372,7 +373,7 @@ ISC_RUN_TEST_IMPL(addzoneconf) {
* Mimic calling nzf_append() from bin/named/server.c
* and check that the output matches the input.
*/
- result = cfg_map_get(conf, "zone", &zlist);
+ result = cfg_map_get(conf, CFG_CLAUSE_ZONE, &zlist);
assert_int_equal(result, ISC_R_SUCCESS);
obj = cfg_listelt_value(cfg_list_first(zlist));
@@ -634,7 +635,7 @@ static cfg_type_t cfg_type_empty_map = {
ISC_RUN_TEST_IMPL(cfg_map_findclause_empty) {
const cfg_clausedef_t *result = cfg_map_findclause(&cfg_type_empty_map,
- "anything");
+ CFG_CLAUSE_ZONE);
assert_null(result);
}