]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/resolve/test-resolve-tables.c
man: document what SIGUSR1 and SIGUSR2 do to resolved
[thirdparty/systemd.git] / src / resolve / test-resolve-tables.c
1 /***
2 This file is part of systemd
3
4 Copyright 2013 Zbigniew Jędrzejewski-Szmek
5
6 systemd is free software; you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation; either version 2.1 of the License, or
9 (at your option) any later version.
10
11 systemd is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with systemd; If not, see <http://www.gnu.org/licenses/>.
18 ***/
19
20 #include "dns-type.h"
21 #include "test-tables.h"
22
23 int main(int argc, char **argv) {
24 uint16_t i;
25
26 test_table_sparse(dns_type, DNS_TYPE);
27
28 log_info("/* DNS_TYPE */");
29 for (i = 0; i < _DNS_TYPE_MAX; i++) {
30 const char *s;
31
32 s = dns_type_to_string(i);
33 assert_se(s == NULL || strlen(s) < _DNS_TYPE_STRING_MAX);
34
35 if (s)
36 log_info("%-*s %s%s%s%s%s%s%s%s%s",
37 (int) _DNS_TYPE_STRING_MAX - 1, s,
38 dns_type_is_pseudo(i) ? "pseudo " : "",
39 dns_type_is_valid_query(i) ? "valid_query " : "",
40 dns_type_is_valid_rr(i) ? "is_valid_rr " : "",
41 dns_type_may_redirect(i) ? "may_redirect " : "",
42 dns_type_is_dnssec(i) ? "dnssec " : "",
43 dns_type_is_obsolete(i) ? "obsolete " : "",
44 dns_type_may_wildcard(i) ? "wildcard " : "",
45 dns_type_apex_only(i) ? "apex_only " : "",
46 dns_type_needs_authentication(i) ? "needs_authentication" : "");
47 }
48
49 log_info("/* DNS_CLASS */");
50 for (i = 0; i < _DNS_CLASS_MAX; i++) {
51 const char *s;
52
53 s = dns_class_to_string(i);
54 assert_se(s == NULL || strlen(s) < _DNS_CLASS_STRING_MAX);
55
56 if (s)
57 log_info("%-*s %s%s",
58 (int) _DNS_CLASS_STRING_MAX - 1, s,
59 dns_class_is_pseudo(i) ? "is_pseudo " : "",
60 dns_class_is_valid_rr(i) ? "is_valid_rr " : "");
61 }
62
63 return EXIT_SUCCESS;
64 }