From: bert hubert Date: Thu, 5 Nov 2015 08:20:13 +0000 (+0100) Subject: helper to extract the right DNSResourceRecord type. X-Git-Tag: dnsdist-1.0.0-alpha1~187^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1d0d0e6e6bba2c7c2ea8050d62baba8332dcee0;p=thirdparty%2Fpdns.git helper to extract the right DNSResourceRecord type. --- diff --git a/pdns/dnsparser.hh b/pdns/dnsparser.hh index 0834c3b7a1..f08aa0cc85 100644 --- a/pdns/dnsparser.hh +++ b/pdns/dnsparser.hh @@ -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 +std::shared_ptr getRR(const DNSRecord& dr) +{ + return std::dynamic_pointer_cast(dr.d_content); +} + #endif