From 702b226dff0dc83b1d678f83f92ca39d4e4c2b74 Mon Sep 17 00:00:00 2001 From: Bert Hubert Date: Sun, 18 Apr 2010 12:24:37 +0000 Subject: [PATCH] teach core of powerdns that data can be auth or nonauth intrinsically git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1554 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- pdns/dns.hh | 3 +++ pdns/dnsbackend.cc | 1 + pdns/dnsbackend.hh | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/pdns/dns.hh b/pdns/dns.hh index 061b5b4f5..d37edc09e 100644 --- a/pdns/dns.hh +++ b/pdns/dns.hh @@ -74,6 +74,7 @@ public: QType qtype; //!< qtype of this record, ie A, CNAME, MX etc uint16_t qclass; //!< class of this record string qname; //!< the name of this record, for example: www.powerdns.com + string wildcardname; string content; //!< what this record points to. Example: 10.1.2.3 uint16_t priority; //!< For qtype's that support a priority or preference. Currently only MX uint32_t ttl; //!< Time To Live of this record @@ -82,6 +83,8 @@ public: enum Place {QUESTION=0, ANSWER=1, AUTHORITY=2, ADDITIONAL=3}; //!< Type describing the positioning of a DNSResourceRecord within, say, a DNSPacket Place d_place; //!< This specifies where a record goes within the packet + bool auth; + bool operator<(const DNSResourceRecord &b) const { if(qname < b.qname) diff --git a/pdns/dnsbackend.cc b/pdns/dnsbackend.cc index 1e3c363bc..5b54f1fe7 100644 --- a/pdns/dnsbackend.cc +++ b/pdns/dnsbackend.cc @@ -208,6 +208,7 @@ bool DNSBackend::getSOA(const string &domain, SOAData &sd, DNSPacket *p) this->lookup(QType(QType::SOA),domain,p); DNSResourceRecord rr; + rr.auth = true; int hits=0; diff --git a/pdns/dnsbackend.hh b/pdns/dnsbackend.hh index 5e04ff578..53d712f10 100644 --- a/pdns/dnsbackend.hh +++ b/pdns/dnsbackend.hh @@ -28,6 +28,7 @@ class DNSPacket; #include #include "ahuexception.hh" #include +#include #ifndef WIN32 # include @@ -72,6 +73,13 @@ public: //! lookup() initiates a lookup. A lookup without results should not throw! virtual void lookup(const QType &qtype, const string &qdomain, DNSPacket *pkt_p=0, int zoneId=-1)=0; virtual bool get(DNSResourceRecord &)=0; //!< retrieves one DNSResource record, returns false if no more were available + + virtual bool getBeforeAndAfterNames(uint32_t id, const std::string qname, std::string& before, std::string& after) + { + std::cerr<<"Default beforeAndAfter called!"<