continue implementation; first tests with recursion returned IPs but then added cance...
[pingcheck] / src / dns / dnsmaster.cpp
index 5fa5139..0346fc5 100644 (file)
@@ -109,7 +109,7 @@ ResolverItem& DnsMaster::get_resolver_for( const std::string &hostname,
 
 
 ResolverItem& DnsMaster::get_resolver_for(const std::string &hostname,
-                                    const DnsIpProtocol &protocol)
+                                          const DnsIpProtocol &protocol)
 {
     DnsMasterItem master = get_instance();
 
@@ -212,5 +212,16 @@ int DnsMaster::get_max_address_resolution_attempts() const
     return MaxAddressResolutionAttempts;
 }
 
+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;
+    }
+}
 // (created using vim -- the world's best text editor)