From fba6769fcd649dd7ca82db0456162d563c3dd8b2 Mon Sep 17 00:00:00 2001 From: Kees Monshouwer Date: Thu, 29 Oct 2015 15:02:15 +0100 Subject: [PATCH] remove 'reverse backend' from core. the logic in this class was backend specific and doe not belong here. --- pdns/dnsbackend.cc | 146 --------------------------------------------- pdns/dnsbackend.hh | 31 ---------- 2 files changed, 177 deletions(-) diff --git a/pdns/dnsbackend.cc b/pdns/dnsbackend.cc index fa4f270bf..3e96807a0 100644 --- a/pdns/dnsbackend.cc +++ b/pdns/dnsbackend.cc @@ -332,152 +332,6 @@ bool DNSBackend::calculateSOASerial(const DNSName& domain, const SOAData& sd, ti return true; } -/* This is a subclass of DNSBackend that, assuming you have your zones reversed - * and stored in an ordered fashion, will be able to look up SOA's much quicker - * than the DNSBackend code. The normal case for a SOA that exists is 1 backend - * query no matter how much the depth (although if there are sub-SOA's then - * this could require one or two more queries). The normal case for an SOA that - * does not exist is 2 or 3 queries depending on the system, although this will - * be reduced if the negative cache is active. - * - * The subclass MUST implement bool getAuthZone(string &reversed_zone_name) - * which, given a reversed zone name will return false if there was some sort - * of error (eg no record found as top of database was hit, lookup issues), - * otherwise returns true and sets reversed_zone_name to be the exact entry - * found, otherwise the entry directly preceding where it would be. - * - * The subclass MUST implement getAuthData( const string &rev_zone_name, SOAData *soa ) - * which is basically the same as getSOA() but is called with the reversed zone name - */ -enum { - GET_AUTH_NEG_DONTCACHE, // not found but don't cache this fact - GET_AUTH_NEG_CACHE, // not found and negcache this - GET_AUTH_SUCCESS, // entry found -}; - -#undef PC -extern PacketCache PC; - -#if 0 -#undef DLOG -#define DLOG(x) x -#endif - -// XXX DNSName pain, should be DNSName native. -static bool add_to_negcache( const string &zone ) { - static int negqueryttl=::arg().asNum("negquery-cache-ttl"); - // add the zone to the negative query cache and return false - if(negqueryttl) { - DLOG(L<= (int)querykey.length() ) { - DLOG(L<= (int) foundkey.length() ) { - DLOG(L<qname = DNSName(inZone.substr( inZone.length() - foundkey.length(), string::npos )); - - DLOG(L<qname<qname does not need to be set. Return false if - * there is a problem getting the data. - * */ - virtual bool getAuthData( SOAData &soa, DNSPacket *p=0) { return false; }; // Must be overridden - - virtual bool getAuth(DNSPacket *p, SOAData *soa, const DNSName &inZone, const int best_match_len) override; - inline int _getAuth(DNSPacket *p, SOAData *soa, const string &inZone, const string &querykey, const int best_match_len); - - /* Only called for stuff like signing or AXFR transfers */ - bool _getSOA(const string &rev_zone, SOAData &soa, DNSPacket *p); - virtual bool getSOA(const DNSName &inZone, SOAData &soa, DNSPacket *p) override; -}; - class BackendFactory { public: -- 2.40.0