]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/resolve/test-resolve-tables.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
4 #include "resolved-dns-dnssec.h"
5 #include "resolved-dns-packet.h"
6 #include "test-tables.h"
8 int main(int argc
, char **argv
) {
11 test_table(dns_protocol
, DNS_PROTOCOL
);
12 test_table(dnssec_result
, DNSSEC_RESULT
);
13 test_table(dnssec_verdict
, DNSSEC_VERDICT
);
15 test_table_sparse(dns_rcode
, DNS_RCODE
);
16 test_table_sparse(dns_type
, DNS_TYPE
);
18 log_info("/* DNS_TYPE */");
19 for (i
= 0; i
< _DNS_TYPE_MAX
; i
++) {
22 s
= dns_type_to_string(i
);
23 assert_se(s
== NULL
|| strlen(s
) < _DNS_TYPE_STRING_MAX
);
26 log_info("%-*s %s%s%s%s%s%s%s%s%s",
27 (int) _DNS_TYPE_STRING_MAX
- 1, s
,
28 dns_type_is_pseudo(i
) ? "pseudo " : "",
29 dns_type_is_valid_query(i
) ? "valid_query " : "",
30 dns_type_is_valid_rr(i
) ? "is_valid_rr " : "",
31 dns_type_may_redirect(i
) ? "may_redirect " : "",
32 dns_type_is_dnssec(i
) ? "dnssec " : "",
33 dns_type_is_obsolete(i
) ? "obsolete " : "",
34 dns_type_may_wildcard(i
) ? "wildcard " : "",
35 dns_type_apex_only(i
) ? "apex_only " : "",
36 dns_type_needs_authentication(i
) ? "needs_authentication" : "");
39 log_info("/* DNS_CLASS */");
40 for (i
= 0; i
< _DNS_CLASS_MAX
; i
++) {
43 s
= dns_class_to_string(i
);
44 assert_se(s
== NULL
|| strlen(s
) < _DNS_CLASS_STRING_MAX
);
48 (int) _DNS_CLASS_STRING_MAX
- 1, s
,
49 dns_class_is_pseudo(i
) ? "is_pseudo " : "",
50 dns_class_is_valid_rr(i
) ? "is_valid_rr " : "");