]> granicus.if.org Git - pdns/commitdiff
helper to extract the right DNSResourceRecord type.
authorbert hubert <bert.hubert@netherlabs.nl>
Thu, 5 Nov 2015 08:20:13 +0000 (09:20 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Thu, 5 Nov 2015 08:20:13 +0000 (09:20 +0100)
pdns/dnsparser.hh

index 0834c3b7a102aa5fc8a1710fd9769b19ee3fd5f9..f08aa0cc855531553b145017cbbc270a81e1009d 100644 (file)
@@ -358,4 +358,11 @@ private:
 string simpleCompress(const string& label, const string& root="");
 void simpleExpandTo(const string& label, unsigned int frompos, string& ret);
 void ageDNSPacket(std::string& packet, uint32_t seconds);
+
+template<typename T>
+std::shared_ptr<T> getRR(const DNSRecord& dr)
+{
+  return std::dynamic_pointer_cast<T>(dr.d_content);
+}
+
 #endif