bool d_preventSelfNotification;
};
+// class that one day might be more than a function to help you get IP addresses for a nameserver
+class FindNS
+{
+public:
+ vector<string> lookup(const DNSName &name, DNSBackend *b)
+ {
+ vector<string> addresses;
+
+ this->resolve_name(&addresses, name);
+
+ b->lookup(QType(QType::ANY),name);
+ DNSResourceRecord rr;
+ while(b->get(rr))
+ if(rr.qtype.getCode() == QType::A || rr.qtype.getCode()==QType::AAAA)
+ addresses.push_back(rr.content); // SOL if you have a CNAME for an NS
+
+ return addresses;
+ }
+
+ vector<string> lookup(const DNSName &name, UeberBackend *b)
+ {
+ vector<string> addresses;
+
+ this->resolve_name(&addresses, name);
+
+ b->lookup(QType(QType::ANY),name);
+ DNSResourceRecord rr;
+ while(b->get(rr))
+ if(rr.qtype.getCode() == QType::A || rr.qtype.getCode()==QType::AAAA)
+ addresses.push_back(rr.content); // SOL if you have a CNAME for an NS
+
+ return addresses;
+ }
+
+private:
+ void resolve_name(vector<string>* addresses, const DNSName& name)
+ {
+ struct addrinfo* res;
+ struct addrinfo hints;
+ memset(&hints, 0, sizeof(hints));
+
+ for(int n = 0; n < 2; ++n) {
+ hints.ai_family = n ? AF_INET : AF_INET6;
+ ComboAddress remote;
+ remote.sin4.sin_family = AF_INET6;
+ if(!getaddrinfo(name.toString().c_str(), 0, &hints, &res)) {
+ struct addrinfo* address = res;
+ do {
+ memcpy(&remote, address->ai_addr, address->ai_addrlen);
+ addresses->push_back(remote.toString());
+ } while((address = address->ai_next));
+ freeaddrinfo(res);
+ }
+ }
+ }
+};
+
+
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include "packetcache.hh"
#include "utility.hh"
#include "resolver.hh"
#include <pthread.h>
#include <boost/algorithm/string.hpp>
#include "dns.hh"
#include "qtype.hh"
-#include "tcpreceiver.hh"
+
#include "pdnsexception.hh"
-#include "statbag.hh"
#include "arguments.hh"
#include "base64.hh"
#include "dnswriter.hh"
#include <boost/foreach.hpp>
#include "dns_random.hh"
-
+#include <sys/poll.h>
+#include "gss_context.hh"
#include "namespaces.hh"
int makeQuerySocket(const ComboAddress& local, bool udpOrTCP)
#include "pdnsexception.hh"
#include "dns.hh"
#include "namespaces.hh"
-#include "dnsbackend.hh"
-#include "ueberbackend.hh"
+#include "dnsrecords.hh"
+#include "dnssecinfra.hh"
class ResolverException : public PDNSException
{
TSIGRecordContent d_trc;
};
-// class that one day might be more than a function to help you get IP addresses for a nameserver
-class FindNS
-{
-public:
- vector<string> lookup(const DNSName &name, DNSBackend *b)
- {
- vector<string> addresses;
-
- this->resolve_name(&addresses, name);
-
- b->lookup(QType(QType::ANY),name);
- DNSResourceRecord rr;
- while(b->get(rr))
- if(rr.qtype.getCode() == QType::A || rr.qtype.getCode()==QType::AAAA)
- addresses.push_back(rr.content); // SOL if you have a CNAME for an NS
-
- return addresses;
- }
-
- vector<string> lookup(const DNSName &name, UeberBackend *b)
- {
- vector<string> addresses;
-
- this->resolve_name(&addresses, name);
-
- b->lookup(QType(QType::ANY),name);
- DNSResourceRecord rr;
- while(b->get(rr))
- if(rr.qtype.getCode() == QType::A || rr.qtype.getCode()==QType::AAAA)
- addresses.push_back(rr.content); // SOL if you have a CNAME for an NS
-
- return addresses;
- }
-
-private:
- void resolve_name(vector<string>* addresses, const DNSName& name)
- {
- struct addrinfo* res;
- struct addrinfo hints;
- memset(&hints, 0, sizeof(hints));
-
- for(int n = 0; n < 2; ++n) {
- hints.ai_family = n ? AF_INET : AF_INET6;
- ComboAddress remote;
- remote.sin4.sin_family = AF_INET6;
- if(!getaddrinfo(name.toString().c_str(), 0, &hints, &res)) {
- struct addrinfo* address = res;
- do {
- memcpy(&remote, address->ai_addr, address->ai_addrlen);
- addresses->push_back(remote.toString());
- } while((address = address->ai_next));
- freeaddrinfo(res);
- }
- }
- }
-};
#endif /* PDNS_RESOLVER_HH */