diff options
Diffstat (limited to 'util/config_file.c')
-rw-r--r-- | util/config_file.c | 98 |
1 files changed, 94 insertions, 4 deletions
diff --git a/util/config_file.c b/util/config_file.c index af176929dc352..d0fdb2daaa258 100644 --- a/util/config_file.c +++ b/util/config_file.c @@ -178,6 +178,7 @@ config_create(void) cfg->forwards = NULL; #ifdef CLIENT_SUBNET cfg->client_subnet = NULL; + cfg->client_subnet_zone = NULL; cfg->client_subnet_opcode = LDNS_EDNS_CLIENT_SUBNET; cfg->client_subnet_always_forward = 0; cfg->max_client_subnet_ipv4 = 24; @@ -206,6 +207,7 @@ config_create(void) cfg->trust_anchor_file_list = NULL; cfg->trust_anchor_list = NULL; cfg->trusted_keys_file_list = NULL; + cfg->trust_anchor_signaling = 0; cfg->dlv_anchor_file = NULL; cfg->dlv_anchor_list = NULL; cfg->domain_insecure = NULL; @@ -227,6 +229,7 @@ config_create(void) cfg->neg_cache_size = 1 * 1024 * 1024; cfg->local_zones = NULL; cfg->local_zones_nodefault = NULL; + cfg->local_zones_disable_default = 0; cfg->local_data = NULL; cfg->local_zone_overrides = NULL; cfg->unblock_lan_zones = 0; @@ -279,6 +282,14 @@ config_create(void) cfg->dnscrypt_provider = NULL; cfg->dnscrypt_provider_cert = NULL; cfg->dnscrypt_secret_key = NULL; +#ifdef USE_IPSECMOD + cfg->ipsecmod_enabled = 1; + cfg->ipsecmod_ignore_bogus = 0; + cfg->ipsecmod_hook = NULL; + cfg->ipsecmod_max_ttl = 3600; + cfg->ipsecmod_whitelist = NULL; + cfg->ipsecmod_strict = 0; +#endif return cfg; error_exit: config_delete(cfg); @@ -480,6 +491,7 @@ int config_set_option(struct config_file* cfg, const char* opt, else S_STRLIST("trust-anchor-file:", trust_anchor_file_list) else S_STRLIST("trust-anchor:", trust_anchor_list) else S_STRLIST("trusted-keys-file:", trusted_keys_file_list) + else S_YNO("trust-anchor-signaling:", trust_anchor_signaling) else S_STR("dlv-anchor-file:", dlv_anchor_file) else S_STRLIST("dlv-anchor:", dlv_anchor_list) else S_STRLIST("domain-insecure:", domain_insecure) @@ -523,6 +535,33 @@ int config_set_option(struct config_file* cfg, const char* opt, /* No client-subnet-always-forward here, module registration depends on * this option. */ #endif +#ifdef USE_DNSTAP + else S_YNO("dnstap-enable:", dnstap) + else S_STR("dnstap-socket-path:", dnstap_socket_path) + else S_YNO("dnstap-send-identity:", dnstap_send_identity) + else S_YNO("dnstap-send-version:", dnstap_send_version) + else S_STR("dnstap-identity:", dnstap_identity) + else S_STR("dnstap-version:", dnstap_version) + else S_YNO("dnstap-log-resolver-query-messages:", + dnstap_log_resolver_query_messages) + else S_YNO("dnstap-log-resolver-response-messages:", + dnstap_log_resolver_response_messages) + else S_YNO("dnstap-log-client-query-messages:", + dnstap_log_client_query_messages) + else S_YNO("dnstap-log-client-response-messages:", + dnstap_log_client_response_messages) + else S_YNO("dnstap-log-forwarder-query-messages:", + dnstap_log_forwarder_query_messages) + else S_YNO("dnstap-log-forwarder-response-messages:", + dnstap_log_forwarder_response_messages) +#endif +#ifdef USE_DNSCRYPT + else S_YNO("dnscrypt-enable:", dnscrypt) + else S_NUMBER_NONZERO("dnscrypt-port:", dnscrypt_port) + else S_STR("dnscrypt-provider:", dnscrypt_provider) + else S_STRLIST("dnscrypt-provider-cert:", dnscrypt_provider_cert) + else S_STRLIST("dnscrypt-secret-key:", dnscrypt_secret_key) +#endif else if(strcmp(opt, "ip-ratelimit:") == 0) { IS_NUMBER_OR_ZERO; cfg->ip_ratelimit = atoi(val); infra_ip_ratelimit=cfg->ip_ratelimit; @@ -539,6 +578,13 @@ int config_set_option(struct config_file* cfg, const char* opt, else S_NUMBER_OR_ZERO("ratelimit-factor:", ratelimit_factor) else S_YNO("qname-minimisation:", qname_minimisation) else S_YNO("qname-minimisation-strict:", qname_minimisation_strict) +#ifdef USE_IPSECMOD + else S_YNO("ipsecmod-enabled:", ipsecmod_enabled) + else S_YNO("ipsecmod-ignore-bogus:", ipsecmod_ignore_bogus) + else if(strcmp(opt, "ipsecmod-max-ttl:") == 0) + { IS_NUMBER_OR_ZERO; cfg->ipsecmod_max_ttl = atoi(val); } + else S_YNO("ipsecmod-strict:", ipsecmod_strict) +#endif else if(strcmp(opt, "define-tag:") ==0) { return config_add_tag(cfg, val); /* val_sig_skew_min and max are copied into val_env during init, @@ -560,15 +606,16 @@ int config_set_option(struct config_file* cfg, const char* opt, cfg->out_ifs = oi; } else { /* unknown or unsupported (from the set_option interface): - * interface, outgoing-interface, access-control, + * interface, outgoing-interface, access-control, * stub-zone, name, stub-addr, stub-host, stub-prime * forward-first, stub-first, forward-ssl-upstream, * stub-ssl-upstream, forward-zone, * name, forward-addr, forward-host, * ratelimit-for-domain, ratelimit-below-domain, - * local-zone-tag, access-control-view - * send-client-subnet client-subnet-always-forward - * max-client-subnet-ipv4 max-client-subnet-ipv6 */ + * local-zone-tag, access-control-view, + * send-client-subnet, client-subnet-always-forward, + * max-client-subnet-ipv4, max-client-subnet-ipv6, ipsecmod_hook, + * ipsecmod_whitelist. */ return 0; } return 1; @@ -834,6 +881,7 @@ config_get_option(struct config_file* cfg, const char* opt, else O_LST(opt, "trust-anchor-file", trust_anchor_file_list) else O_LST(opt, "trust-anchor", trust_anchor_list) else O_LST(opt, "trusted-keys-file", trusted_keys_file_list) + else O_YNO(opt, "trust-anchor-signaling", trust_anchor_signaling) else O_LST(opt, "dlv-anchor", dlv_anchor_list) else O_LST(opt, "control-interface", control_ifs) else O_LST(opt, "domain-insecure", domain_insecure) @@ -842,11 +890,39 @@ config_get_option(struct config_file* cfg, const char* opt, else O_YNO(opt, "rrset-roundrobin", rrset_roundrobin) #ifdef CLIENT_SUBNET else O_LST(opt, "send-client-subnet", client_subnet) + else O_LST(opt, "client-subnet-zone", client_subnet_zone) else O_DEC(opt, "max-client-subnet-ipv4", max_client_subnet_ipv4) else O_DEC(opt, "max-client-subnet-ipv6", max_client_subnet_ipv6) else O_YNO(opt, "client-subnet-always-forward:", client_subnet_always_forward) #endif +#ifdef USE_DNSTAP + else O_YNO(opt, "dnstap-enable", dnstap) + else O_STR(opt, "dnstap-socket-path", dnstap_socket_path) + else O_YNO(opt, "dnstap-send-identity", dnstap_send_identity) + else O_YNO(opt, "dnstap-send-version", dnstap_send_version) + else O_STR(opt, "dnstap-identity", dnstap_identity) + else O_STR(opt, "dnstap-version", dnstap_version) + else O_YNO(opt, "dnstap-log-resolver-query-messages", + dnstap_log_resolver_query_messages) + else O_YNO(opt, "dnstap-log-resolver-response-messages", + dnstap_log_resolver_response_messages) + else O_YNO(opt, "dnstap-log-client-query-messages", + dnstap_log_client_query_messages) + else O_YNO(opt, "dnstap-log-client-response-messages", + dnstap_log_client_response_messages) + else O_YNO(opt, "dnstap-log-forwarder-query-messages", + dnstap_log_forwarder_query_messages) + else O_YNO(opt, "dnstap-log-forwarder-response-messages", + dnstap_log_forwarder_response_messages) +#endif +#ifdef USE_DNSCRYPT + else O_YNO(opt, "dnscrypt-enable", dnscrypt) + else O_DEC(opt, "dnscrypt-port", dnscrypt_port) + else O_STR(opt, "dnscrypt-provider", dnscrypt_provider) + else O_LST(opt, "dnscrypt-provider-cert", dnscrypt_provider_cert) + else O_LST(opt, "dnscrypt-secret-key", dnscrypt_secret_key) +#endif else O_YNO(opt, "unblock-lan-zones", unblock_lan_zones) else O_YNO(opt, "insecure-lan-zones", insecure_lan_zones) else O_DEC(opt, "max-udp-size", max_udp_size) @@ -874,6 +950,14 @@ config_get_option(struct config_file* cfg, const char* opt, else O_LS3(opt, "access-control-tag-action", acl_tag_actions) else O_LS3(opt, "access-control-tag-data", acl_tag_datas) else O_LS2(opt, "access-control-view", acl_view) +#ifdef USE_IPSECMOD + else O_YNO(opt, "ipsecmod-enabled", ipsecmod_enabled) + else O_YNO(opt, "ipsecmod-ignore-bogus", ipsecmod_ignore_bogus) + else O_STR(opt, "ipsecmod-hook", ipsecmod_hook) + else O_DEC(opt, "ipsecmod-max-ttl", ipsecmod_max_ttl) + else O_LST(opt, "ipsecmod-whitelist", ipsecmod_whitelist) + else O_YNO(opt, "ipsecmod-strict", ipsecmod_strict) +#endif /* not here: * outgoing-permit, outgoing-avoid - have list of ports * local-zone - zones and nodefault variables @@ -1131,11 +1215,13 @@ config_delete(struct config_file* cfg) config_delstrlist(cfg->root_hints); #ifdef CLIENT_SUBNET config_delstrlist(cfg->client_subnet); + config_delstrlist(cfg->client_subnet_zone); #endif free(cfg->identity); free(cfg->version); free(cfg->module_conf); free(cfg->outgoing_avail_ports); + free(cfg->python_script); config_delstrlist(cfg->caps_whitelist); config_delstrlist(cfg->private_address); config_delstrlist(cfg->private_domain); @@ -1169,6 +1255,10 @@ config_delete(struct config_file* cfg) free(cfg->dnstap_version); config_deldblstrlist(cfg->ratelimit_for_domain); config_deldblstrlist(cfg->ratelimit_below_domain); +#ifdef USE_IPSECMOD + free(cfg->ipsecmod_hook); + config_delstrlist(cfg->ipsecmod_whitelist); +#endif free(cfg); } |