]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/resolve/dns-type.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
6 /* DNS record types, taken from
7 * http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml.
51 DNS_TYPE_OPT
, /* EDNS0 option */
93 _DNS_TYPE_INVALID
= -1
96 assert_cc(DNS_TYPE_SSHFP
== 44);
97 assert_cc(DNS_TYPE_TLSA
== 52);
98 assert_cc(DNS_TYPE_ANY
== 255);
100 /* DNS record classes, see RFC 1035 */
103 DNS_CLASS_ANY
= 0xFF,
106 _DNS_CLASS_INVALID
= -1
109 #define _DNS_CLASS_STRING_MAX (sizeof "CLASS" + DECIMAL_STR_MAX(uint16_t))
110 #define _DNS_TYPE_STRING_MAX (sizeof "CLASS" + DECIMAL_STR_MAX(uint16_t))
112 bool dns_type_is_pseudo(uint16_t type
);
113 bool dns_type_is_valid_query(uint16_t type
);
114 bool dns_type_is_valid_rr(uint16_t type
);
115 bool dns_type_may_redirect(uint16_t type
);
116 bool dns_type_is_dnssec(uint16_t type
);
117 bool dns_type_is_obsolete(uint16_t type
);
118 bool dns_type_may_wildcard(uint16_t type
);
119 bool dns_type_apex_only(uint16_t type
);
120 bool dns_type_needs_authentication(uint16_t type
);
121 bool dns_type_is_zone_transer(uint16_t type
);
122 int dns_type_to_af(uint16_t type
);
124 bool dns_class_is_pseudo(uint16_t class);
125 bool dns_class_is_valid_rr(uint16_t class);
127 /* TYPE?? follows http://tools.ietf.org/html/rfc3597#section-5 */
128 const char *dns_type_to_string(int type
);
129 int dns_type_from_string(const char *s
);
131 const char *dns_class_to_string(uint16_t class);
132 int dns_class_from_string(const char *name
);
134 /* https://tools.ietf.org/html/draft-ietf-dane-protocol-23#section-7.2 */
135 const char *tlsa_cert_usage_to_string(uint8_t cert_usage
);
137 /* https://tools.ietf.org/html/draft-ietf-dane-protocol-23#section-7.3 */
138 const char *tlsa_selector_to_string(uint8_t selector
);
140 /* https://tools.ietf.org/html/draft-ietf-dane-protocol-23#section-7.4 */
141 const char *tlsa_matching_type_to_string(uint8_t selector
);
143 /* https://tools.ietf.org/html/rfc6844#section-5.1 */
144 #define CAA_FLAG_CRITICAL (1u << 7)