From: Guilherme Maciel Ferreira Date: Wed, 28 Mar 2012 02:19:15 +0000 (-0300) Subject: The application now recognizes the ICMPv4, TCP_IPv4, TCPv4 and TCPv6 ping protocols... X-Git-Tag: v1.6~4 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=0a670586c7c89fffa916f5b2d0ab54a74be527b5;p=pingcheck The application now recognizes the ICMPv4, TCP_IPv4, TCPv4 and TCPv6 ping protocols strings. --- diff --git a/src/host/pingprotocol.cpp b/src/host/pingprotocol.cpp index e1bd46f..ea7e66b 100644 --- a/src/host/pingprotocol.cpp +++ b/src/host/pingprotocol.cpp @@ -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 ]; diff --git a/test/test_configurationoptions.cpp b/test/test_configurationoptions.cpp index dfd668c..f26d86d 100644 --- a/test/test_configurationoptions.cpp +++ b/test/test_configurationoptions.cpp @@ -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" );