From: Pieter Lexis Date: Thu, 8 Jan 2026 11:44:16 +0000 (+0100) Subject: chore(dnsrecords): Add RESINFO DNS Record (RFC 9606) X-Git-Tag: rec-5.4.0-beta1~44^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85cd503624f7aa16f1b405b7487281769567ee49;p=thirdparty%2Fpdns.git chore(dnsrecords): Add RESINFO DNS Record (RFC 9606) --- diff --git a/pdns/dnsrecords.cc b/pdns/dnsrecords.cc index f55804686b..503b34fa8f 100644 --- a/pdns/dnsrecords.cc +++ b/pdns/dnsrecords.cc @@ -888,6 +888,8 @@ boilerplate_conv(CAA, conv.xfrUnquotedText(d_tag, true); conv.xfrText(d_value, true, false); /* no lenField */ ) + +boilerplate_conv(RESINFO, conv.xfrText(d_text, true)); //NOLINTEND static uint16_t makeTag(const std::string& data) @@ -1007,6 +1009,7 @@ static void reportOtherTypes(const ReportIsOnlyCallableByReportAllTypes& guard) MINFORecordContent::report(guard); URIRecordContent::report(guard); CAARecordContent::report(guard); + RESINFORecordContent::report(guard); APLRecordContent::report(guard); IPSECKEYRecordContent::report(guard); CSYNCRecordContent::report(guard); diff --git a/pdns/dnsrecords.hh b/pdns/dnsrecords.hh index f1bd7a9610..cc467b5a43 100644 --- a/pdns/dnsrecords.hh +++ b/pdns/dnsrecords.hh @@ -1253,6 +1253,19 @@ private: string d_tag, d_value; }; +class RESINFORecordContent : public DNSRecordContent +{ +public: + includeboilerplate(RESINFO) + + [[nodiscard]] size_t sizeEstimate() const override + { + return sizeof(*this) + d_text.size(); + } + + string d_text; +}; + #define boilerplate(RNAME) \ std::shared_ptr RNAME##RecordContent::make(const DNSRecord& dr, PacketReader& pr) \ { \ diff --git a/pdns/qtype.cc b/pdns/qtype.cc index c5eb47c855..b3e0c85f42 100644 --- a/pdns/qtype.cc +++ b/pdns/qtype.cc @@ -94,6 +94,7 @@ const map QType::names = { {"ANY", 255}, {"URI", 256}, {"CAA", 257}, + {"RESINFO", 261}, {"DLV", 32769}, {"ADDR", 65400}, #if !defined(RECURSOR) diff --git a/pdns/qtype.hh b/pdns/qtype.hh index 4f9c633771..adfd879fff 100644 --- a/pdns/qtype.hh +++ b/pdns/qtype.hh @@ -141,6 +141,7 @@ public: ANY = 255, URI = 256, CAA = 257, + RESINFO = 261, DLV = 32769, ADDR = 65400, #if !defined(RECURSOR) diff --git a/pdns/test-dnsrecords_cc.cc b/pdns/test-dnsrecords_cc.cc index 65204bff1a..b11de1be3a 100644 --- a/pdns/test-dnsrecords_cc.cc +++ b/pdns/test-dnsrecords_cc.cc @@ -292,6 +292,7 @@ BOOST_AUTO_TEST_CASE(test_record_types) { (CASE_S(QType::CAA, "0 issue \"aa\"", "\x00\x05\x69\x73\x73\x75\x65\x61\x61")) (CASE_S(QType::CAA, "0 issue \"aaaaaaa\"", "\x00\x05\x69\x73\x73\x75\x65\x61\x61\x61\x61\x61\x61\x61")) (CASE_S(QType::CAA, "0 issue \"aaaaaaa.aaa\"", "\x00\x05\x69\x73\x73\x75\x65\x61\x61\x61\x61\x61\x61\x61\x2e\x61\x61\x61")) + (CASE_S(QType::RESINFO, "\"qnamemin exterr=15-17\"", "\x15qnamemin exterr=15-17")) (CASE_S(QType::DLV, "20642 8 2 04443abe7e94c3985196beae5d548c727b044dda5151e60d7cd76a9fd931d00e", "\x50\xa2\x08\x02\x04\x44\x3a\xbe\x7e\x94\xc3\x98\x51\x96\xbe\xae\x5d\x54\x8c\x72\x7b\x04\x4d\xda\x51\x51\xe6\x0d\x7c\xd7\x6a\x9f\xd9\x31\xd0\x0e")) (CASE_S((QType::typeenum)65226,"\\# 3 414243","\x41\x42\x43"))