summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-rr.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-08-01 19:37:16 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-08-03 22:02:32 -0400
commit7263f72499e962b3fd54cdb7c79d49ca72121ede (patch)
treed74d2593c003166d21f38945c244b6d5a1180982 /src/resolve/resolved-dns-rr.h
parentfd00a088216f6d6a6c502faf6b46c1e2ae7cbc54 (diff)
resolve: add more record types and convert to gperf table
We are unlikely to evert support most of them, but we can at least display the types properly. The list is taken from the IANA list. The table of number->name mappings is converted to a switch statement. gcc does a nice job of optimizing lookup (when optimization is enabled). systemd-resolve-host -t is now case insensitive.
Diffstat (limited to 'src/resolve/resolved-dns-rr.h')
-rw-r--r--src/resolve/resolved-dns-rr.h33
1 files changed, 1 insertions, 32 deletions
diff --git a/src/resolve/resolved-dns-rr.h b/src/resolve/resolved-dns-rr.h
index 61c00d59b2..20a344b8ca 100644
--- a/src/resolve/resolved-dns-rr.h
+++ b/src/resolve/resolved-dns-rr.h
@@ -27,6 +27,7 @@
#include "util.h"
#include "hashmap.h"
#include "in-addr-util.h"
+#include "dns-type.h"
typedef struct DnsResourceKey DnsResourceKey;
typedef struct DnsResourceRecord DnsResourceRecord;
@@ -39,35 +40,6 @@ enum {
_DNS_CLASS_INVALID = -1
};
-/* DNS record types, see RFC 1035 */
-enum {
- /* Normal records */
- DNS_TYPE_A = 0x01,
- DNS_TYPE_NS = 0x02,
- DNS_TYPE_CNAME = 0x05,
- DNS_TYPE_SOA = 0x06,
- DNS_TYPE_PTR = 0x0C,
- DNS_TYPE_HINFO = 0x0D,
- DNS_TYPE_MX = 0x0F,
- DNS_TYPE_TXT = 0x10,
- DNS_TYPE_AAAA = 0x1C,
- DNS_TYPE_LOC = 0x1D,
- DNS_TYPE_SRV = 0x21,
- DNS_TYPE_DNAME = 0x27,
- DNS_TYPE_SSHFP = 0x2C,
- DNS_TYPE_SPF = 0x63,
-
- /* Special records */
- DNS_TYPE_ANY = 0xFF,
- DNS_TYPE_OPT = 0x29, /* EDNS0 option */
- DNS_TYPE_TKEY = 0xF9,
- DNS_TYPE_TSIG = 0xFA,
- DNS_TYPE_IXFR = 0xFB,
- DNS_TYPE_AXFR = 0xFC,
- _DNS_TYPE_MAX,
- _DNS_TYPE_INVALID = -1
-};
-
struct DnsResourceKey {
unsigned n_ref;
uint16_t class, type;
@@ -178,8 +150,5 @@ int dns_resource_record_equal(const DnsResourceRecord *a, const DnsResourceRecor
int dns_resource_record_to_string(const DnsResourceRecord *rr, char **ret);
DEFINE_TRIVIAL_CLEANUP_FUNC(DnsResourceRecord*, dns_resource_record_unref);
-const char *dns_type_to_string(uint16_t type);
-int dns_type_from_string(const char *name, uint16_t *type);
-
const char *dns_class_to_string(uint16_t type);
int dns_class_from_string(const char *name, uint16_t *class);