pingcheck
10 years agointroduce a max number of exceptions ignored in io_service main loop
Christian Herdtweck [Mon, 12 Jan 2015 14:43:38 +0000]
introduce a max number of exceptions ignored in io_service main loop

mainly for testing and debugging

10 years agoproperly initialize variables remembering original signal handlers; re-set only if...
Christian Herdtweck [Mon, 12 Jan 2015 14:42:33 +0000]
properly initialize variables remembering original signal handlers; re-set only if were set

10 years agocontinue waiting for data if receive handler received an error code
Christian Herdtweck [Mon, 12 Jan 2015 14:41:04 +0000]
continue waiting for data if receive handler received an error code

2 reasons:
* in other error cases do the same
* there is a timer running in the background which will send the next ping after some time

10 years agodo not wait for IcmpEchoReply if sending of IcmpEchoRequest has failed completely
Christian Herdtweck [Mon, 12 Jan 2015 14:37:13 +0000]
do not wait for IcmpEchoReply if sending of IcmpEchoRequest has failed completely

10 years agoupdate docu messages for io_service
Christian Herdtweck [Mon, 12 Jan 2015 14:35:48 +0000]
update docu messages for io_service

10 years agoClean up output, whitespace,
Christian Herdtweck [Mon, 12 Jan 2015 14:33:48 +0000]
Clean up output, whitespace,

* there were several cases of GlobalLogger.error() << "Error: ..." which is redundant
* there was one instance of streaming to cerr instead of GlobalLogger.error
* remove trailing whitespace

10 years agominor change in logging: avoid duplicated "Error: "
Christian Herdtweck [Tue, 30 Dec 2014 17:14:41 +0000]
minor change in logging: avoid duplicated "Error: "

10 years agonew signal handling in main; removed all thread-related vars, use same IoServiceItem...
Christian Herdtweck [Tue, 30 Dec 2014 17:14:06 +0000]
new signal handling in main; removed all thread-related vars, use same IoServiceItem instead

10 years agotemp commit before leaving, started to change signal handling and use singel io_service
Christian Herdtweck [Tue, 23 Dec 2014 17:42:23 +0000]
temp commit before leaving, started to change signal handling and use singel io_service

10 years agohotfix for problem with 0-packages
Christian Herdtweck [Tue, 23 Dec 2014 13:29:42 +0000]
hotfix for problem with 0-packages

* added flag ReceiveHandlerInPlace to icmppinger
* to be sure, also check if reply was received already in handle_receive_icmp_packet
* in handle_receive_icmp_packet also check error code
* in icmp package read, print strings for failure codes
* prepend IP to pinger log output so can trace which thread did what

10 years agochanged logic of icmp package read/write and operator>> / operator<<
Christian Herdtweck [Mon, 15 Dec 2014 14:30:51 +0000]
changed logic of icmp package read/write and operator>> / operator<<

* read and write are implemented on their own, >> and << call them
  (not the other way round as before)
* read returns not only a bool but a more informative flag
* moved operator>> and << from Icmpv4/6packet to base class IcmpPacket
  since they are identical

10 years agofixed parsing of icmp data: only parses right amount of data
Christian Herdtweck [Wed, 10 Dec 2014 14:58:52 +0000]
fixed parsing of icmp data: only parses right amount of data

10 years agofixed possible reason for broken icmp packages: restricted read of icmp payload data...
Christian Herdtweck [Tue, 9 Dec 2014 17:52:00 +0000]
fixed possible reason for broken icmp packages: restricted read of icmp payload data; also moved def of buffer size from h to cpp

10 years agofixed possible reason for broken icmp packages: restricted read of icmp payload data...
Christian Herdtweck [Tue, 9 Dec 2014 17:50:58 +0000]
fixed possible reason for broken icmp packages: restricted read of icmp payload data; also moved def of buffer size from h to cpp

10 years agoreplace magic number 64k with constant SOCKET_BUFFER_SIZE
Christian Herdtweck [Tue, 9 Dec 2014 15:02:36 +0000]
replace magic number 64k with constant SOCKET_BUFFER_SIZE

10 years agoimproved logging output (once again)
Christian Herdtweck [Tue, 9 Dec 2014 15:01:09 +0000]
improved logging output (once again)

10 years agoadded a handler for failed BOOST_ASSERT-ions; add global try-catch in main to catch...
Christian Herdtweck [Tue, 9 Dec 2014 14:59:36 +0000]
added a handler for failed BOOST_ASSERT-ions; add global try-catch in main to catch exceptions

10 years agoadded missing std::, commit before last does not compile without it ... sorry!
Christian Herdtweck [Tue, 9 Dec 2014 08:20:46 +0000]
added missing std::, commit before last does not compile without it ...  sorry!

10 years agodebug-log-message when there is unused data in buffer, which is probably reason for...
Christian Herdtweck [Mon, 8 Dec 2014 09:45:00 +0000]
debug-log-message when there is unused data in buffer, which is probably reason for frequent broken packages

10 years agoadded global try-catch to main
Christian Herdtweck [Mon, 8 Dec 2014 09:44:31 +0000]
added global try-catch to main

10 years agomade text log output slightly more informative and correct
Christian Herdtweck [Mon, 17 Nov 2014 08:36:03 +0000]
made text log output slightly more informative and correct

10 years agoadded target "dist" to CMakeLists.txt, which uses "git archive" to build source tarball
Christian Herdtweck [Wed, 12 Nov 2014 14:36:20 +0000]
added target "dist" to CMakeLists.txt, which uses "git archive" to build source tarball

10 years agomore rigorous command line option checking; ensure parser errors are printed to stderr
Christian Herdtweck [Wed, 12 Nov 2014 13:27:17 +0000]
more rigorous command line option checking; ensure parser errors are printed to stderr

10 years agowarn in case of unrecognized command line options; added more info output concerning...
Christian Herdtweck [Wed, 12 Nov 2014 10:08:26 +0000]
warn in case of unrecognized command line options; added more info output concerning log output and level

10 years agohad forgotten to remove a (rather stupid) debug test line
Christian Herdtweck [Fri, 7 Nov 2014 16:38:29 +0000]
had forgotten to remove a (rather stupid) debug test line

10 years agoconverted 3 constants into configuration variables, removing corresponding TODOs...
Christian Herdtweck [Fri, 7 Nov 2014 15:52:49 +0000]
converted 3 constants into configuration variables, removing corresponding TODOs; minor change in variable orders to make compiler happier

10 years agomake abstract base classes boost::noncopyable to avoid warnings concerning copy-assig...
Christian Herdtweck [Thu, 6 Nov 2014 16:05:59 +0000]
make abstract base classes boost::noncopyable to avoid warnings concerning copy-assignment and -constructors

10 years agouse new function name of new log level string function from libi2ncommon; had overloo...
Christian Herdtweck [Thu, 6 Nov 2014 13:21:55 +0000]
use new function name of new log level string function from libi2ncommon; had overlooked one debugging output

10 years agoadded /usr/intranator prefix to spec file
Christian Herdtweck [Wed, 5 Nov 2014 15:38:55 +0000]
added /usr/intranator prefix to spec file

10 years agoadded limit to DNS resolution attempts before pinging; report host down to hostatus...
Christian Herdtweck [Wed, 5 Nov 2014 15:27:06 +0000]
added limit to DNS resolution attempts before pinging; report host down to hostatus if exceeded; simplified pingscheduler

10 years agofixed bug in ICMP Packet Factory: do not continue with garbage packet if read from...
Christian Herdtweck [Wed, 5 Nov 2014 15:11:14 +0000]
fixed bug in ICMP Packet Factory: do not continue with garbage packet if read from istream failed!

removed commented lines that do same as shared_ptr.reset which was added in previous commit

10 years agostop creating icmp packet parts from istream if earlier part failed
Christian Herdtweck [Wed, 5 Nov 2014 15:00:20 +0000]
stop creating icmp packet parts from istream if earlier part failed

10 years agochanges in logging output: added information and changed priority
Christian Herdtweck [Wed, 5 Nov 2014 14:08:58 +0000]
changes in logging output: added information and changed priority

10 years agoFor command line options for logging output level and target, add available options...
Christian Herdtweck [Wed, 5 Nov 2014 13:57:41 +0000]
For command line options for logging output level and target, add available options to help string

11 years agoupdated Readme: added option ratio-random-hosts, mentioned range format in ping-inter...
Christian Herdtweck [Wed, 21 May 2014 13:20:02 +0000]
updated Readme: added option ratio-random-hosts, mentioned range format in ping-interval, corrected description interface behavior

11 years agochanged initial log level from Info to Notice to avoid printing of complete config...
Christian Herdtweck [Wed, 21 May 2014 13:03:28 +0000]
changed initial log level from Info to Notice to avoid printing of complete config into syslog

11 years agochanged format for interval specification in pingcheck.conf from "a...b" to "a..b"
Christian Herdtweck [Wed, 21 May 2014 12:27:06 +0000]
changed format for interval specification in pingcheck.conf from "a...b" to "a..b"

11 years agochanged escaping of shell args in status notifier command: escape each arg separately...
Christian Herdtweck [Wed, 21 May 2014 10:06:04 +0000]
changed escaping of shell args in status notifier command: escape each arg separately instead of the whole argument string at once

11 years agoadded two more options to pingchecker: use random interval per host in given range...
Christian Herdtweck [Wed, 14 May 2014 08:32:10 +0000]
added two more options to pingchecker: use random interval per host in given range, use random subset of hosts

11 years agoadded doxygen text ofr new variable FirstDelay in PingcheckScheduler constructor
Christian Herdtweck [Mon, 12 May 2014 10:02:54 +0000]
added doxygen text ofr new variable FirstDelay in PingcheckScheduler constructor

11 years agoconverted a few more BOOST_FOREACH to const reference versions in main
Christian Herdtweck [Mon, 12 May 2014 09:59:12 +0000]
converted a few more BOOST_FOREACH to const reference versions in main

11 years agoadded yEd graph with most important calls
Christian Herdtweck [Mon, 12 May 2014 09:51:31 +0000]
added yEd graph with most important calls

11 years agoUse const reference BOOST_FOREACH version
Thomas Jarosch [Mon, 12 May 2014 09:44:11 +0000]
Use const reference BOOST_FOREACH version

11 years agointroduced delays between starts of pingers, so they are evenly distributed in time...
Christian Herdtweck [Thu, 8 May 2014 14:32:58 +0000]
introduced delays between starts of pingers, so they are evenly distributed in time right away

11 years agoif DNS request at start of ping fails, re-schedule further requests; originally faile...
Christian Herdtweck [Thu, 8 May 2014 12:51:37 +0000]
if DNS request at start of ping fails, re-schedule further requests; originally failed at once and never tried again

11 years agoadd try-catch to dns resolving of name server to get more precise error
Christian Herdtweck [Fri, 25 Apr 2014 09:22:38 +0000]
add try-catch to dns resolving of name server to get more precise error

11 years agofixed a bug in status notification (first status was sent always)
Christian Herdtweck [Fri, 25 Apr 2014 07:42:12 +0000]
fixed a bug in status notification (first status was sent always)

12 years agoDocumentation: explains how to setuid the pingcheck to allow it to be ran by an unpri...
Guilherme Maciel Ferreira [Mon, 26 Nov 2012 17:32:42 +0000]
Documentation: explains how to setuid the pingcheck to allow it to be ran by an unprivileged user.

12 years agoTest: added testcase for log-output configuration option.
Guilherme Maciel Ferreira [Tue, 3 Jul 2012 01:57:48 +0000]
Test: added testcase for log-output configuration option.

12 years agoFeature: allow to choose among two log destinations, console or syslog.
Guilherme Maciel Ferreira [Tue, 3 Jul 2012 01:53:47 +0000]
Feature: allow to choose among two log destinations, console or syslog.

12 years agoFix: standardized the logfunc header inclusion.
Guilherme Maciel Ferreira [Mon, 2 Jul 2012 00:54:02 +0000]
Fix: standardized the logfunc header inclusion.

12 years agoFix: added src/config/option directory to Doxygen build path.
Guilherme Maciel Ferreira [Mon, 2 Jul 2012 00:49:20 +0000]
Fix: added src/config/option directory to Doxygen build path.

13 years agoChanges introduced in master branch. v1.6
Guilherme Maciel Ferreira [Sat, 14 Apr 2012 01:50:46 +0000]
Changes introduced in master branch.

13 years agoChanged TCP ping method.
Guilherme Maciel Ferreira [Sat, 14 Apr 2012 01:29:21 +0000]
Changed TCP ping method.
- SYN segments pass easily through firewalls and it is replied both when the
  port is open as well as when it is closed, serving better to the purpose of
  checking if the link reaches a given host. Whereas ACK segments do not get
  replied if the other end is closed or has a firewall in the middle.
- A thoroughly discussion regarding SYN x ACK is available at
  http://www.networkuptime.com/nmap/page4-4.shtml
  http://www.networkuptime.com/nmap/page4-5.shtml

13 years agoReplaced the boost::Scoped_array by std::vector as the underlying message payload...
Guilherme Maciel Ferreira [Thu, 29 Mar 2012 03:22:49 +0000]
Replaced the boost::Scoped_array by std::vector as the underlying message payload byte sequence.
- This change simplifies many operations.

13 years agoFix: the boolean logic was inverted.
Guilherme Maciel Ferreira [Thu, 29 Mar 2012 01:46:43 +0000]
Fix: the boolean logic was inverted.
- When fail() returns false, the read() and write() methods should return true;
- This avoids the annoying "Error: Could not read ICMP packet" and "Error: could not read TCP Segment." messages.

13 years agoThe application now recognizes the ICMPv4, TCP_IPv4, TCPv4 and TCPv6 ping protocols...
Guilherme Maciel Ferreira [Wed, 28 Mar 2012 02:19:15 +0000]
The application now recognizes the ICMPv4, TCP_IPv4, TCPv4 and TCPv6 ping protocols strings.

13 years agoPass the PingProtocolList by const reference, not by value.
Guilherme Maciel Ferreira [Wed, 28 Mar 2012 02:16:35 +0000]
Pass the PingProtocolList by const reference, not by value.

13 years agoChanged the network interface rules, the correct behavior is for each host
Guilherme Maciel Ferreira [Wed, 28 Mar 2012 02:11:03 +0000]
Changed the network interface rules, the correct behavior is for each host
that has its source-network-interface equal to "default"
(e.g. source-network-interface=default) is supposed to use the global
default-source-network-interface item.

13 years agoUpdate example config to current config options
Thomas Jarosch [Fri, 23 Mar 2012 09:35:23 +0000]
Update example config to current config options

13 years agoFix: src\dns\dnsresolver.cpp 272 Warning 616: control flows into case/default
Thomas Jarosch [Fri, 23 Mar 2012 09:25:43 +0000]
Fix: src\dns\dnsresolver.cpp  272  Warning 616: control flows into case/default

13 years agoMask some PC-Lint messages. Simple constification
Thomas Jarosch [Fri, 23 Mar 2012 09:24:32 +0000]
Mask some PC-Lint messages. Simple constification

13 years agoChanges introduced in the ip-version-drop branch. v1.5
Guilherme Maciel Ferreira [Thu, 22 Mar 2012 02:27:50 +0000]
Changes introduced in the ip-version-drop branch.

13 years agoMerge branch 'ip-version-drop'
Guilherme Maciel Ferreira [Wed, 21 Mar 2012 00:42:14 +0000]
Merge branch 'ip-version-drop'

Conflicts:
src/config/host.cpp
src/config/host.h
src/host/pingscheduler.h
src/main.cpp
test/test_configurationcommandline.cpp
test/test_configurationoptions.cpp

13 years agoFix: ip::address::is_unspecified() is available only in boost versions above 1.47.0.
Guilherme Maciel Ferreira [Sun, 18 Mar 2012 21:27:18 +0000]
Fix: ip::address::is_unspecified() is available only in boost versions above 1.47.0.

13 years agoFix: do not assert when the address has more than one CNAME.
Guilherme Maciel Ferreira [Sun, 18 Mar 2012 21:11:37 +0000]
Fix: do not assert when the address has more than one CNAME.

13 years agoChanges introduced in the nic-per-host branch. v1.4
Guilherme Maciel Ferreira [Wed, 14 Mar 2012 23:49:08 +0000]
Changes introduced in the nic-per-host branch.

13 years agoHandling more kinds of errors during file parsing.
Guilherme Maciel Ferreira [Wed, 14 Mar 2012 23:31:41 +0000]
Handling more kinds of errors during file parsing.

13 years agoFix: consider the network interface from each host.
Guilherme Maciel Ferreira [Wed, 14 Mar 2012 23:08:29 +0000]
Fix: consider the network interface from each host.
- It was keeping the same network interface (from the first host) for all hosts;
- Reduced the variable scope so it is assigned on every loop iteraction.

13 years agoRemoving LocalNetworkInterfaceName attribute, it is no longer used in this class.
Guilherme Maciel Ferreira [Wed, 14 Mar 2012 00:28:28 +0000]
Removing LocalNetworkInterfaceName attribute, it is no longer used in this class.

13 years agoUse the "host.source-network-interface" only if the global "default-source-network...
Guilherme Maciel Ferreira [Wed, 14 Mar 2012 00:22:02 +0000]
Use the "host.source-network-interface" only if the global "default-source-network-interface" is empty.

13 years agoTest: updating the test cases with the new network interface options.
Guilherme Maciel Ferreira [Wed, 14 Mar 2012 00:03:03 +0000]
Test: updating the test cases with the new network interface options.

13 years agoDocumentation: updating the Readme with the new network interface options.
Guilherme Maciel Ferreira [Tue, 13 Mar 2012 23:57:21 +0000]
Documentation: updating the Readme with the new network interface options.

13 years agoRenamed the global "source-network-interface" to "default-source-network-interface".
Guilherme Maciel Ferreira [Tue, 13 Mar 2012 23:54:49 +0000]
Renamed the global "source-network-interface" to "default-source-network-interface".

13 years agoAdded the host.source-network-interface configuration option.
Guilherme Maciel Ferreira [Tue, 13 Mar 2012 23:36:55 +0000]
Added the host.source-network-interface configuration option.

13 years agoPassing the protocol list by const reference.
Guilherme Maciel Ferreira [Sun, 11 Mar 2012 21:22:42 +0000]
Passing the protocol list by const reference.

13 years agoAdded a method specially to initialize the pinger object for the first time.
Guilherme Maciel Ferreira [Sun, 11 Mar 2012 21:21:01 +0000]
Added a method specially to initialize the pinger object for the first time.

13 years agoFixed misspelled include guard.
Guilherme Maciel Ferreira [Sun, 11 Mar 2012 21:18:58 +0000]
Fixed misspelled include guard.

13 years agoRevert "Configuration: added the ping protocol fallback count."
Guilherme Maciel Ferreira [Sun, 11 Mar 2012 20:26:41 +0000]
Revert "Configuration: added the ping protocol fallback count."

This reverts commit f1284dcbaa750c1ffb517ed8e2e6a0a051a36057.

13 years agoRevert "Test: updating test cases to use the ping protocol fallback feature."
Guilherme Maciel Ferreira [Sun, 11 Mar 2012 20:26:25 +0000]
Revert "Test: updating test cases to use the ping protocol fallback feature."

This reverts commit 8e693035e02c8f6cb780cf594e41862fcd71ce2b.

13 years agoRevert "Perform N pings using one protocol, then after those N pings, switch to"
Guilherme Maciel Ferreira [Sun, 11 Mar 2012 20:26:03 +0000]
Revert "Perform N pings using one protocol, then after those N pings, switch to"

This reverts commit 46531881f06af5666d62a74836b1101cdcb779d9.

13 years agoRevert "Documentation: updating Readme and TODO files."
Guilherme Maciel Ferreira [Sun, 11 Mar 2012 20:25:46 +0000]
Revert "Documentation: updating Readme and TODO files."

This reverts commit d3c172383ff9ccaff5dc510fea439284f9f28650.

13 years agoFix: cast to integer because some compilers do not provide automatic conversion.
Guilherme Maciel Ferreira [Thu, 23 Feb 2012 02:45:00 +0000]
Fix: cast to integer because some compilers do not provide automatic conversion.

13 years agoRemoving the const qualifier to link with Boost.
Guilherme Maciel Ferreira [Thu, 23 Feb 2012 02:27:32 +0000]
Removing the const qualifier to link with Boost.
- Older versions of GCC does not link with different constness.

13 years agoNot implemented according to the message:
Guilherme Maciel Ferreira [Sat, 10 Mar 2012 22:03:18 +0000]
Not implemented according to the message:

From: Thomas Jarosch <thomas.jarosch@intra2net.com>
To: guilherme.maciel.ferreira@gmail.com
Subject: Re: TODO list
Date: Wed, 7 Mar 2012 11:26:19 +0100

Guten Morgen Guilherme,

On Wednesday, 7. March 2012 11:14:28 Guilherme Maciel Ferreira wrote:
Dude, this seriously sucks. I have some good news for you:
Just completly skip the QoS stuff, we don't need it right now.
Hope your laptop wasn't in the car...

Cheers,
Thomas

13 years agoDocumentation: updating Readme and TODO files.
Guilherme Maciel Ferreira [Wed, 7 Mar 2012 10:28:13 +0000]
Documentation: updating Readme and TODO files.

13 years agoPerform N pings using one protocol, then after those N pings, switch to
Guilherme Maciel Ferreira [Wed, 7 Mar 2012 10:24:51 +0000]
Perform N pings using one protocol, then after those N pings, switch to
the second protocol, if it available.

13 years agoTest: updating test cases to use the ping protocol fallback feature.
Guilherme Maciel Ferreira [Wed, 7 Mar 2012 10:19:15 +0000]
Test: updating test cases to use the ping protocol fallback feature.

13 years agoConfiguration: added the ping protocol fallback count.
Guilherme Maciel Ferreira [Wed, 7 Mar 2012 10:14:19 +0000]
Configuration: added the ping protocol fallback count.
- This item tells how many times it must ping using one protocol before use the other.

13 years agoUsing boost::asio::ip::address class instead of std::string in the HostAddress.
Guilherme Maciel Ferreira [Tue, 6 Mar 2012 10:45:38 +0000]
Using boost::asio::ip::address class instead of std::string in the HostAddress.
- That class provides more functionality, so keep it until someone requires a string.

13 years agoAdded the protocols supported in the Readme file.
Guilherme Maciel Ferreira [Mon, 5 Mar 2012 11:47:28 +0000]
Added the protocols supported in the Readme file.

13 years agoUndoing commit e58d750735048b76721ade950d3b9e0c75d201f7.
Guilherme Maciel Ferreira [Mon, 5 Mar 2012 11:40:19 +0000]
Undoing commit e58d750735048b76721ade950d3b9e0c75d201f7.
- Using the io_service reference instead of the shared_ptr, because it caused a
double freed error, because it was a stack object in the PingScheduler
(boost::asio::io_service IoService) and a smart pointer elsewhere,
thus, the smart pointers were releasing the stack memory. And once the
PingScheduler didn't had a counter by itself, the program was dumping
in the PingScheduler destructor.
  Once the Boost.Asio library uses the reference itself (e.g.
basic_raw_socket(boost::asio::io_service& io_service, )), I decided to
keep like it was before.

13 years agoThe DNS address resolution is synchronized with the protocol change.
Guilherme Maciel Ferreira [Mon, 5 Mar 2012 11:18:46 +0000]
The DNS address resolution is synchronized with the protocol change.
- In this way, when the new protocol requires a different IP version, the DNS
resolver is called again to get the according Address Resource Record.
- Still needs some intelligence.

13 years agoRepositioning of the ping_done_handler() method according to the order in the header.
Guilherme Maciel Ferreira [Mon, 5 Mar 2012 00:11:27 +0000]
Repositioning of the ping_done_handler() method according to the order in the header.

13 years agoLog message reformatting.
Guilherme Maciel Ferreira [Mon, 5 Mar 2012 00:09:35 +0000]
Log message reformatting.

13 years agoBring aboard a factory to create DNS resolvers.
Guilherme Maciel Ferreira [Mon, 5 Mar 2012 00:03:45 +0000]
Bring aboard a factory to create DNS resolvers.

13 years agoAdded AAAA resource records in the DNS query.
Guilherme Maciel Ferreira [Sun, 4 Mar 2012 23:55:34 +0000]
Added AAAA resource records in the DNS query.
- DNS resolve to IPv6 addresses.

13 years agoMoved DnsResolver from PingScheduler to PingRotate.
Guilherme Maciel Ferreira [Wed, 29 Feb 2012 23:46:07 +0000]
Moved DnsResolver from PingScheduler to PingRotate.
- Simplify the PingScheduler class;
- Makes easier for the PingRotate to match the correct Pinger to the IP version.

13 years agoCode improvement:
Guilherme Maciel Ferreira [Wed, 29 Feb 2012 00:12:01 +0000]
Code improvement:
- Replaced io_service references by shared pointers, because
  this ensures that this object is shared.

13 years agoCode improvement:
Guilherme Maciel Ferreira [Tue, 28 Feb 2012 00:02:31 +0000]
Code improvement:
- using STL rotate algorithm;
- moved part of ping_done_handler() method to another method to improve readability.