]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
c7472ce0 ZJS |
2 | /*** |
3 | This file is part of systemd | |
4 | ||
5 | Copyright 2013 Zbigniew Jędrzejewski-Szmek | |
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 "dns-type.h" | |
22 | #include "test-tables.h" | |
23 | ||
24 | int main(int argc, char **argv) { | |
5259c055 ZJS |
25 | uint16_t i; |
26 | ||
c7472ce0 ZJS |
27 | test_table_sparse(dns_type, DNS_TYPE); |
28 | ||
5259c055 ZJS |
29 | log_info("/* DNS_TYPE */"); |
30 | for (i = 0; i < _DNS_TYPE_MAX; i++) { | |
31 | const char *s; | |
32 | ||
33 | s = dns_type_to_string(i); | |
34 | assert_se(s == NULL || strlen(s) < _DNS_TYPE_STRING_MAX); | |
35 | ||
36 | if (s) | |
37 | log_info("%-*s %s%s%s%s%s%s%s%s%s", | |
38 | (int) _DNS_TYPE_STRING_MAX - 1, s, | |
39 | dns_type_is_pseudo(i) ? "pseudo " : "", | |
40 | dns_type_is_valid_query(i) ? "valid_query " : "", | |
41 | dns_type_is_valid_rr(i) ? "is_valid_rr " : "", | |
42 | dns_type_may_redirect(i) ? "may_redirect " : "", | |
43 | dns_type_is_dnssec(i) ? "dnssec " : "", | |
44 | dns_type_is_obsolete(i) ? "obsolete " : "", | |
45 | dns_type_may_wildcard(i) ? "wildcard " : "", | |
46 | dns_type_apex_only(i) ? "apex_only " : "", | |
47 | dns_type_needs_authentication(i) ? "needs_authentication" : ""); | |
48 | } | |
49 | ||
50 | log_info("/* DNS_CLASS */"); | |
51 | for (i = 0; i < _DNS_CLASS_MAX; i++) { | |
52 | const char *s; | |
53 | ||
54 | s = dns_class_to_string(i); | |
55 | assert_se(s == NULL || strlen(s) < _DNS_CLASS_STRING_MAX); | |
56 | ||
57 | if (s) | |
58 | log_info("%-*s %s%s", | |
59 | (int) _DNS_CLASS_STRING_MAX - 1, s, | |
60 | dns_class_is_pseudo(i) ? "is_pseudo " : "", | |
61 | dns_class_is_valid_rr(i) ? "is_valid_rr " : ""); | |
62 | } | |
63 | ||
c7472ce0 ZJS |
64 | return EXIT_SUCCESS; |
65 | } |