1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
6 /* DNS record types, taken from
7 * http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml.
51 DNS_TYPE_OPT
, /* EDNS0 option */
63 DNS_TYPE_SMIMEA
, /* RFC 8162 */
64 /* 0x36 (54) is not assigned */
74 DNS_TYPE_SVCB
, /* RFC 9460 */
75 DNS_TYPE_HTTPS
, /* RFC 9460 */
76 /* 0x42…0x62 (66…98) are not assigned */
88 /* 0x6e…0xf8 (110…248) are not assigned */
102 /* 0x106…0x7fff (262…32767) are not assigned */
103 DNS_TYPE_TA
= 0x8000,
105 /* 32770…65279 are not assigned */
106 /* 65280…65534 are for private use */
107 /* 65535 is reserved */
109 _DNS_TYPE_INVALID
= -EINVAL
,
112 assert_cc(DNS_TYPE_SMIMEA
== 53);
113 assert_cc(DNS_TYPE_HTTPS
== 65);
114 assert_cc(DNS_TYPE_EUI64
== 109);
115 assert_cc(DNS_TYPE_RESINFO
== 261);
116 assert_cc(DNS_TYPE_ANY
== 255);
118 /* DNS record classes, see RFC 1035 */
121 DNS_CLASS_ANY
= 0xFF,
124 _DNS_CLASS_INVALID
= -EINVAL
,
127 #define _DNS_CLASS_STRING_MAX (sizeof "CLASS" + DECIMAL_STR_MAX(uint16_t))
128 #define _DNS_TYPE_STRING_MAX (sizeof "CLASS" + DECIMAL_STR_MAX(uint16_t))
130 bool dns_type_is_pseudo(uint16_t type
);
131 bool dns_type_is_valid_query(uint16_t type
);
132 bool dns_type_is_valid_rr(uint16_t type
);
133 bool dns_type_may_redirect(uint16_t type
);
134 bool dns_type_is_dnssec(uint16_t type
);
135 bool dns_type_is_obsolete(uint16_t type
);
136 bool dns_type_may_wildcard(uint16_t type
);
137 bool dns_type_apex_only(uint16_t type
);
138 bool dns_type_needs_authentication(uint16_t type
);
139 bool dns_type_is_zone_transer(uint16_t type
);
140 int dns_type_to_af(uint16_t type
);
142 bool dns_class_is_pseudo(uint16_t class);
143 bool dns_class_is_valid_rr(uint16_t class);
145 /* TYPE?? follows http://tools.ietf.org/html/rfc3597#section-5 */
146 const char *dns_type_to_string(int type
);
147 int dns_type_from_string(const char *s
);
149 const char *dns_class_to_string(uint16_t class);
150 int dns_class_from_string(const char *name
);
152 /* https://tools.ietf.org/html/draft-ietf-dane-protocol-23#section-7.2 */
153 const char *tlsa_cert_usage_to_string(uint8_t cert_usage
);
155 /* https://tools.ietf.org/html/draft-ietf-dane-protocol-23#section-7.3 */
156 const char *tlsa_selector_to_string(uint8_t selector
);
158 /* https://tools.ietf.org/html/draft-ietf-dane-protocol-23#section-7.4 */
159 const char *tlsa_matching_type_to_string(uint8_t selector
);
161 /* https://tools.ietf.org/html/rfc6844#section-5.1 */
162 #define CAA_FLAG_CRITICAL (1u << 7)