]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/resolve/dns-type.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 Copyright © 2014 Zbigniew Jędrzejewski-Szmek
10 /* DNS record types, taken from
11 * http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml.
55 DNS_TYPE_OPT
, /* EDNS0 option */
97 _DNS_TYPE_INVALID
= -1
100 assert_cc(DNS_TYPE_SSHFP
== 44);
101 assert_cc(DNS_TYPE_TLSA
== 52);
102 assert_cc(DNS_TYPE_ANY
== 255);
104 /* DNS record classes, see RFC 1035 */
107 DNS_CLASS_ANY
= 0xFF,
110 _DNS_CLASS_INVALID
= -1
113 #define _DNS_CLASS_STRING_MAX (sizeof "CLASS" + DECIMAL_STR_MAX(uint16_t))
114 #define _DNS_TYPE_STRING_MAX (sizeof "CLASS" + DECIMAL_STR_MAX(uint16_t))
116 bool dns_type_is_pseudo(uint16_t type
);
117 bool dns_type_is_valid_query(uint16_t type
);
118 bool dns_type_is_valid_rr(uint16_t type
);
119 bool dns_type_may_redirect(uint16_t type
);
120 bool dns_type_is_dnssec(uint16_t type
);
121 bool dns_type_is_obsolete(uint16_t type
);
122 bool dns_type_may_wildcard(uint16_t type
);
123 bool dns_type_apex_only(uint16_t type
);
124 bool dns_type_needs_authentication(uint16_t type
);
125 bool dns_type_is_zone_transer(uint16_t type
);
126 int dns_type_to_af(uint16_t type
);
128 bool dns_class_is_pseudo(uint16_t class);
129 bool dns_class_is_valid_rr(uint16_t class);
131 /* TYPE?? follows http://tools.ietf.org/html/rfc3597#section-5 */
132 const char *dns_type_to_string(int type
);
133 int dns_type_from_string(const char *s
);
135 const char *dns_class_to_string(uint16_t class);
136 int dns_class_from_string(const char *name
);
138 /* https://tools.ietf.org/html/draft-ietf-dane-protocol-23#section-7.2 */
139 const char *tlsa_cert_usage_to_string(uint8_t cert_usage
);
141 /* https://tools.ietf.org/html/draft-ietf-dane-protocol-23#section-7.3 */
142 const char *tlsa_selector_to_string(uint8_t selector
);
144 /* https://tools.ietf.org/html/draft-ietf-dane-protocol-23#section-7.4 */
145 const char *tlsa_matching_type_to_string(uint8_t selector
);
147 /* https://tools.ietf.org/html/rfc6844#section-5.1 */
148 #define CAA_FLAG_CRITICAL (1u << 7)