1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 This file is part of systemd.
5 Copyright 2016 Lennart Poettering
8 #include "conf-parser.h"
9 #include "resolve-util.h"
10 #include "string-table.h"
12 DEFINE_CONFIG_PARSE_ENUM(config_parse_resolve_support
, resolve_support
, ResolveSupport
, "Failed to parse resolve support setting");
13 DEFINE_CONFIG_PARSE_ENUM(config_parse_dnssec_mode
, dnssec_mode
, DnssecMode
, "Failed to parse DNSSEC mode setting");
14 DEFINE_CONFIG_PARSE_ENUM(config_parse_private_dns_mode
, private_dns_mode
, PrivateDnsMode
, "Failed to parse private DNS mode setting");
16 static const char* const resolve_support_table
[_RESOLVE_SUPPORT_MAX
] = {
17 [RESOLVE_SUPPORT_NO
] = "no",
18 [RESOLVE_SUPPORT_YES
] = "yes",
19 [RESOLVE_SUPPORT_RESOLVE
] = "resolve",
21 DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(resolve_support
, ResolveSupport
, RESOLVE_SUPPORT_YES
);
23 static const char* const dnssec_mode_table
[_DNSSEC_MODE_MAX
] = {
25 [DNSSEC_ALLOW_DOWNGRADE
] = "allow-downgrade",
28 DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(dnssec_mode
, DnssecMode
, DNSSEC_YES
);
30 static const char* const private_dns_mode_table
[_PRIVATE_DNS_MODE_MAX
] = {
31 [PRIVATE_DNS_NO
] = "no",
32 [PRIVATE_DNS_OPPORTUNISTIC
] = "opportunistic",
34 DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(private_dns_mode
, PrivateDnsMode
, PRIVATE_DNS_OPPORTUNISTIC
);