From 98379bbd388a2d15546359c9ec1e944c2f6b4aa2 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Fri, 1 Sep 2017 16:10:56 +0200 Subject: [PATCH] Add RR type DOA Without rdata yet, just to pass unit tests --- src/const-info.c | 1 + src/getdns/getdns.h.in | 1 + src/gldns/rrdef.h | 1 + src/rr-dict.c | 9 +++++---- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/const-info.c b/src/const-info.c index d2b5a007..776e6795 100644 --- a/src/const-info.c +++ b/src/const-info.c @@ -272,6 +272,7 @@ static struct const_name_info consts_name_info[] = { { "GETDNS_RRTYPE_DLV", 32769 }, { "GETDNS_RRTYPE_DNAME", 39 }, { "GETDNS_RRTYPE_DNSKEY", 48 }, + { "GETDNS_RRTYPE_DOA", 259 }, { "GETDNS_RRTYPE_DS", 43 }, { "GETDNS_RRTYPE_EID", 31 }, { "GETDNS_RRTYPE_GID", 102 }, diff --git a/src/getdns/getdns.h.in b/src/getdns/getdns.h.in index feba62a1..4732a4a3 100644 --- a/src/getdns/getdns.h.in +++ b/src/getdns/getdns.h.in @@ -437,6 +437,7 @@ typedef enum getdns_callback_type_t { #define GETDNS_RRTYPE_URI 256 #define GETDNS_RRTYPE_CAA 257 #define GETDNS_RRTYPE_AVC 258 +#define GETDNS_RRTYPE_DOA 259 #define GETDNS_RRTYPE_TA 32768 #define GETDNS_RRTYPE_DLV 32769 /** @} diff --git a/src/gldns/rrdef.h b/src/gldns/rrdef.h index b5975aa1..3db78fe0 100644 --- a/src/gldns/rrdef.h +++ b/src/gldns/rrdef.h @@ -227,6 +227,7 @@ enum gldns_enum_rr_type GLDNS_RR_TYPE_URI = 256, /* RFC 7553 */ GLDNS_RR_TYPE_CAA = 257, /* RFC 6844 */ GLDNS_RR_TYPE_AVC = 258, + GLDNS_RR_TYPE_DOA = 259, /** DNSSEC Trust Authorities */ GLDNS_RR_TYPE_TA = 32768, diff --git a/src/rr-dict.c b/src/rr-dict.c index 1206ed53..ab0c2b82 100644 --- a/src/rr-dict.c +++ b/src/rr-dict.c @@ -920,7 +920,8 @@ static _getdns_rr_def _getdns_rr_defs[] = { { NULL, NULL, 0 }, { "URI", uri_rdata, ALEN( uri_rdata) }, /* 256 - */ { "CAA", caa_rdata, ALEN( caa_rdata) }, - { "AVC", txt_rdata, ALEN( txt_rdata) }, /* - 258 */ + { "AVC", txt_rdata, ALEN( txt_rdata) }, + { "DOA", UNKNOWN_RDATA, 0 }, /* - 259 */ { "TA", ds_rdata, ALEN( ds_rdata) }, /* 32768 */ { "DLV", dlv_rdata, ALEN( dlv_rdata) } /* 32769 */ }; @@ -928,12 +929,12 @@ static _getdns_rr_def _getdns_rr_defs[] = { const _getdns_rr_def * _getdns_rr_def_lookup(uint16_t rr_type) { - if (rr_type <= 258) + if (rr_type <= 259) return &_getdns_rr_defs[rr_type]; else if (rr_type == 32768) - return &_getdns_rr_defs[259]; - else if (rr_type == 32769) return &_getdns_rr_defs[260]; + else if (rr_type == 32769) + return &_getdns_rr_defs[261]; return _getdns_rr_defs; }