completed partial IPv6 compatibility in DNS; does retrieve and Cache IPv6 IPs
[pingcheck] / src / dns / dnsmaster.cpp
index b0b4049..c6bca7f 100644 (file)
@@ -158,6 +158,7 @@ ResolverItem& DnsMaster::get_resolver_for(const std::string &hostname,
                                 << ip;
             ResolverItem new_resolver( new IpPseudoResolver(IoService,
                                                             hostname,
+                                                            protocol,
                                                             Cache) );
             ResolverMap[key] = new_resolver;
         }
@@ -196,22 +197,6 @@ bool DnsMaster::is_ip(const std::string &hostname) const
 }
 
 
-DnsIpProtocol DnsMaster::ping2dns_protocol(const PingProtocol& pprot)
-{
-    switch (pprot)
-    {
-        case PingProtocol_ICMP:     return DNS_IPv4; break;
-        case PingProtocol_ICMPv6:   return DNS_IPv6; break;
-        case PingProtocol_TCP:      return DNS_IPv4; break;
-        case PingProtocol_TCP_IPv6: return DNS_IPv6; break;
-        default:
-            GlobalLogger.warning() << "DnsMaster: Unexpected ping protocol: "
-                                   << static_cast<int>(pprot);
-            return DNS_IPALL;
-            break;
-    }
-}
-
 /*boost::asio::ip::address &DnsMaster::get_name_server() const
 {
     return NameServer;
@@ -232,14 +217,3 @@ int DnsMaster::get_max_recursion_count() const
     return MaxRecursionCount;
 }
 
-std::string to_string(const DnsIpProtocol &protocol)
-{
-    switch (protocol)
-    {
-        case DNS_IPv4:  return "IPv4"; break;
-        case DNS_IPv6:  return "IPv6"; break;
-        case DNS_IPALL: return "IPv4/6"; break;
-        default: GlobalLogger.warning() << "Unexpected protocol in to_string!";
-                 return "Unexpected Protocol"; break;
-    }
-}