From: Bert Hubert Date: Tue, 18 Nov 2008 12:48:42 +0000 (+0000) Subject: make it possible to read 'fancy records' using the zoneparser-tng, which in turn... X-Git-Tag: rec-3.2~224 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=afbb76cd841ec0caa404645e0b3e4f5732a39dfc;p=thirdparty%2Fpdns.git make it possible to read 'fancy records' using the zoneparser-tng, which in turn makes it possible to run regression tests on it git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1298 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/backends/bind/zone2sql.cc b/pdns/backends/bind/zone2sql.cc index a3f3eec2a6..bfaa0ae0d2 100644 --- a/pdns/backends/bind/zone2sql.cc +++ b/pdns/backends/bind/zone2sql.cc @@ -168,6 +168,7 @@ int main(int argc, char **argv) { try { reportAllTypes(); + reportFancyTypes(); #if __GNUC__ >= 3 ios_base::sync_with_stdio(false); #endif diff --git a/pdns/dnsrecords.cc b/pdns/dnsrecords.cc index 0588c0af27..ed58468860 100644 --- a/pdns/dnsrecords.cc +++ b/pdns/dnsrecords.cc @@ -342,6 +342,9 @@ boilerplate_conv(DNSKEY, 48, conv.xfrBlob(d_key); ) +boilerplate_conv(URL, 256, + conv.xfrLabel(d_url); + ) bool getEDNSOpts(const MOADNSParser& mdp, EDNSOpts* eo) { @@ -403,6 +406,11 @@ void reportOtherTypes() OPTRecordContent::report(); } +void reportFancyTypes() +{ + URLRecordContent::report(); +} + void reportAllTypes() { reportBasicTypes(); diff --git a/pdns/dnsrecords.hh b/pdns/dnsrecords.hh index 96c0bb07e8..35f70d6c33 100644 --- a/pdns/dnsrecords.hh +++ b/pdns/dnsrecords.hh @@ -364,6 +364,14 @@ public: private: }; +class URLRecordContent : public DNSRecordContent // Fake, 'fancy record' with type 256 +{ +public: + includeboilerplate(URL) +private: + string d_url; +}; + #define boilerplate(RNAME, RTYPE) \ RNAME##RecordContent::DNSRecordContent* RNAME##RecordContent::make(const DNSRecord& dr, PacketReader& pr) \ { \ @@ -438,5 +446,6 @@ bool getEDNSOpts(const MOADNSParser& mdp, EDNSOpts* eo); void reportBasicTypes(); void reportOtherTypes(); void reportAllTypes(); +void reportFancyTypes(); #endif diff --git a/regression-tests/test.com b/regression-tests/test.com index debd8fd34b..dfc9530538 100644 --- a/regression-tests/test.com +++ b/regression-tests/test.com @@ -23,3 +23,4 @@ _double._tcp.dc IN SRV 0 100 389 server1 _double._tcp.dc IN SRV 1 100 389 server1 blah IN NS blah blah IN A 9.9.9.9 +images IN URL "http://www.ds9a.nl"