]> granicus.if.org Git - pdns/commitdiff
move auth-only bit away from resolver.cc to communicator.hh where it belongs
authorbert hubert <bert.hubert@powerdns.com>
Sun, 25 Oct 2015 16:27:21 +0000 (17:27 +0100)
committerbert hubert <bert.hubert@powerdns.com>
Sun, 25 Oct 2015 16:27:21 +0000 (17:27 +0100)
pdns/communicator.hh
pdns/resolver.cc
pdns/resolver.hh

index 7b7df830758235c1e28758bce04025883a05e3ab..99e3b125a4a2d8cb66d54215deda35455050ab8b 100644 (file)
@@ -210,4 +210,62 @@ private:
   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
index 99d0b17fe515281a7eadaf3cea23908193a97665..2cc07b0a7414fcdf8134f6510acf49871070f07c 100644 (file)
@@ -22,7 +22,6 @@
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
-#include "packetcache.hh"
 #include "utility.hh"
 #include "resolver.hh"
 #include <pthread.h>
@@ -39,9 +38,8 @@
 #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"
@@ -49,7 +47,8 @@
 
 #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)
index fd416f05d0f876cbb17454446cabb6619db20d71..1a234c682787f251cb47a38ff46ed506f57ccb48 100644 (file)
@@ -39,8 +39,8 @@
 #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
 {
@@ -112,61 +112,5 @@ class AXFRRetriever : public boost::noncopyable
     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 */