The application now recognizes the ICMPv4, TCP_IPv4, TCPv4 and TCPv6 ping protocols...
authorGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Wed, 28 Mar 2012 02:19:15 +0000 (23:19 -0300)
committerGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Wed, 28 Mar 2012 02:20:24 +0000 (23:20 -0300)
src/host/pingprotocol.cpp
test/test_configurationoptions.cpp

index e1bd46f..ea7e66b 100644 (file)
@@ -48,9 +48,13 @@ PingProtocol get_ping_protocol_from_string( const string & protocol_string )
 
     // TODO move to an init method
     protocol_string_map[ "ICMP" ] = PingProtocol_ICMP;
+    protocol_string_map[ "ICMPV4" ] = PingProtocol_ICMP;
     protocol_string_map[ "ICMPV6" ] = PingProtocol_ICMPv6;
     protocol_string_map[ "TCP" ] = PingProtocol_TCP;
+    protocol_string_map[ "TCP_IPV4" ] = PingProtocol_TCP;
     protocol_string_map[ "TCP_IPV6" ] = PingProtocol_TCP_IPv6;
+    protocol_string_map[ "TCPV4" ] = PingProtocol_TCP;
+    protocol_string_map[ "TCPV6" ] = PingProtocol_TCP_IPv6;
 
     PingProtocol protocol = protocol_string_map[ protocol_uppercase_string ];
 
index dfd668c..f26d86d 100644 (file)
@@ -65,7 +65,7 @@ bool option_present(
         if ( (*first)->long_name() == option_to_find ) {
             return true;
         }
-        first++;
+        ++first;
     }
     return false;
 }
@@ -212,7 +212,7 @@ BOOST_AUTO_TEST_CASE( parse_hosts_options )
     hosts_names.push_back( "www.kernel.org" );
     hosts_ports.push_back( 64 );
     hosts_source_interfaces.push_back( "eth5" );
-    hosts_ping_protocols.push_back( "TCP,ICMP" );
+    hosts_ping_protocols.push_back( "TCP_IPv4,ICMPv4" );
     hosts_intervals.push_back( 75 );
     // host 6
     hosts_names.push_back( "www.linux.com" );