summaryrefslogtreecommitdiff
path: root/src/resolve/dns-type.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-12-18 18:53:11 +0100
committerLennart Poettering <lennart@poettering.net>2015-12-18 18:53:11 +0100
commit4b548ef382007e40bd8fb3affdce9f843d0d63ac (patch)
tree99c7a85840e1b83f1aec40b6194ef7a4981182ed /src/resolve/dns-type.h
parent3e92a71901960ad9af15ced891d529b2d8ef3c90 (diff)
resolved: move DNS class utilities to dns-type.c and add more helpers
Let's make DNS class helpers more like DNS type helpers, let's move them from resolved-dns-rr.[ch] into dns-type.[ch]. This also adds two new calls dns_class_is_pseudo() and dns_class_is_valid_rr() which operate similar to dns_type_is_pseudo() and dns_type_is_valid_rr() but for classes instead of types. This should hopefully make handling of DNS classes and DNS types more alike.
Diffstat (limited to 'src/resolve/dns-type.h')
-rw-r--r--src/resolve/dns-type.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/resolve/dns-type.h b/src/resolve/dns-type.h
index 038a0d0e54..deb89e9b7e 100644
--- a/src/resolve/dns-type.h
+++ b/src/resolve/dns-type.h
@@ -122,3 +122,17 @@ enum {
assert_cc(DNS_TYPE_SSHFP == 44);
assert_cc(DNS_TYPE_TLSA == 52);
assert_cc(DNS_TYPE_ANY == 255);
+
+/* DNS record classes, see RFC 1035 */
+enum {
+ DNS_CLASS_IN = 0x01,
+ DNS_CLASS_ANY = 0xFF,
+ _DNS_CLASS_MAX,
+ _DNS_CLASS_INVALID = -1
+};
+
+bool dns_class_is_pseudo(uint16_t class);
+bool dns_class_is_valid_rr(uint16_t class);
+
+const char *dns_class_to_string(uint16_t type);
+int dns_class_from_string(const char *name);