]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/resolve-util.c
edcb8e05e78cf5d08ea5fcc162473ee87988fb36
[thirdparty/systemd.git] / src / shared / resolve-util.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 /***
3 This file is part of systemd.
4
5 Copyright 2016 Lennart Poettering
6
7 systemd is free software; you can redistribute it and/or modify it
8 under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation; either version 2.1 of the License, or
10 (at your option) any later version.
11
12 systemd is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public License
18 along with systemd; If not, see <http://www.gnu.org/licenses/>.
19 ***/
20
21 #include "conf-parser.h"
22 #include "resolve-util.h"
23 #include "string-table.h"
24
25 DEFINE_CONFIG_PARSE_ENUM(config_parse_resolve_support, resolve_support, ResolveSupport, "Failed to parse resolve support setting");
26 DEFINE_CONFIG_PARSE_ENUM(config_parse_dnssec_mode, dnssec_mode, DnssecMode, "Failed to parse DNSSEC mode setting");
27
28 static const char* const resolve_support_table[_RESOLVE_SUPPORT_MAX] = {
29 [RESOLVE_SUPPORT_NO] = "no",
30 [RESOLVE_SUPPORT_YES] = "yes",
31 [RESOLVE_SUPPORT_RESOLVE] = "resolve",
32 };
33 DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(resolve_support, ResolveSupport, RESOLVE_SUPPORT_YES);
34
35 static const char* const dnssec_mode_table[_DNSSEC_MODE_MAX] = {
36 [DNSSEC_NO] = "no",
37 [DNSSEC_ALLOW_DOWNGRADE] = "allow-downgrade",
38 [DNSSEC_YES] = "yes",
39 };
40 DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(dnssec_mode, DnssecMode, DNSSEC_YES);