1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 #include "conf-parser.h"
4 #include "resolve-util.h"
5 #include "string-table.h"
7 DEFINE_CONFIG_PARSE_ENUM(config_parse_resolve_support
, resolve_support
, ResolveSupport
, "Failed to parse resolve support setting");
8 DEFINE_CONFIG_PARSE_ENUM(config_parse_dnssec_mode
, dnssec_mode
, DnssecMode
, "Failed to parse DNSSEC mode setting");
9 DEFINE_CONFIG_PARSE_ENUM(config_parse_dns_over_tls_mode
, dns_over_tls_mode
, DnsOverTlsMode
, "Failed to parse DNS-over-TLS mode setting");
11 static const char* const resolve_support_table
[_RESOLVE_SUPPORT_MAX
] = {
12 [RESOLVE_SUPPORT_NO
] = "no",
13 [RESOLVE_SUPPORT_YES
] = "yes",
14 [RESOLVE_SUPPORT_RESOLVE
] = "resolve",
16 DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(resolve_support
, ResolveSupport
, RESOLVE_SUPPORT_YES
);
18 static const char* const dnssec_mode_table
[_DNSSEC_MODE_MAX
] = {
20 [DNSSEC_ALLOW_DOWNGRADE
] = "allow-downgrade",
23 DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(dnssec_mode
, DnssecMode
, DNSSEC_YES
);
25 static const char* const dns_over_tls_mode_table
[_DNS_OVER_TLS_MODE_MAX
] = {
26 [DNS_OVER_TLS_NO
] = "no",
27 [DNS_OVER_TLS_OPPORTUNISTIC
] = "opportunistic",
29 DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(dns_over_tls_mode
, DnsOverTlsMode
, _DNS_OVER_TLS_MODE_INVALID
);