]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
chore(dnsrecords): Add RESINFO DNS Record (RFC 9606) 16711/head
authorPieter Lexis <pieter.lexis@powerdns.com>
Thu, 8 Jan 2026 11:44:16 +0000 (12:44 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Thu, 8 Jan 2026 11:44:16 +0000 (12:44 +0100)
pdns/dnsrecords.cc
pdns/dnsrecords.hh
pdns/qtype.cc
pdns/qtype.hh
pdns/test-dnsrecords_cc.cc

index f55804686b28431101439b7e86f2f51b04efb682..503b34fa8f9bdc6b24bb8e32832ae5d23a0a31ce 100644 (file)
@@ -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);
index f1bd7a961015db7c3560d6f31946168cd6bac551..cc467b5a43bd9696c684a0ffc2eac523531e253c 100644 (file)
@@ -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::DNSRecordContent> RNAME##RecordContent::make(const DNSRecord& dr, PacketReader& pr) \
 {                                                                                                  \
index c5eb47c855da701c9088cfca16a0dd7cc41263c9..b3e0c85f42d9112de2369435253b0d292c4a1380 100644 (file)
@@ -94,6 +94,7 @@ const map<const string, uint16_t> QType::names = {
   {"ANY", 255},
   {"URI", 256},
   {"CAA", 257},
+  {"RESINFO", 261},
   {"DLV", 32769},
   {"ADDR", 65400},
 #if !defined(RECURSOR)
index 4f9c633771a596755c2b1dfd7a2f626b4e6ab4cb..adfd879fff358a40f74bb11cbd84caada3342cef 100644 (file)
@@ -141,6 +141,7 @@ public:
     ANY = 255,
     URI = 256,
     CAA = 257,
+    RESINFO = 261,
     DLV = 32769,
     ADDR = 65400,
 #if !defined(RECURSOR)
index 65204bff1a47f2ffa0d03c0e4ab6965cb906774b..b11de1be3a1bcf9c7bf7f182c7450e26caf4b815 100644 (file)
@@ -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"))