From c0950a056827ae42df70f72de184239930ca54df Mon Sep 17 00:00:00 2001 From: Guilherme Maciel Ferreira Date: Thu, 23 Jun 2011 15:26:14 -0300 Subject: [PATCH] Calling set_ping_status() in ping function and added some documentation --- src/icmp/icmppinger.cpp | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/icmp/icmppinger.cpp b/src/icmp/icmppinger.cpp index 019c726..85fb14d 100644 --- a/src/icmp/icmppinger.cpp +++ b/src/icmp/icmppinger.cpp @@ -95,7 +95,7 @@ void IcmpPinger::ping( PingDoneCallback = ping_done_callback; // Prepare ping - PingerStatus = PingStatus_NotSent; + set_ping_status( PingStatus_NotSent ); set_destination_endpoint( destination_ip ); @@ -226,7 +226,7 @@ void IcmpPinger::handle_ping_done() * In the future we might redesign the code to handle all ICMP packets * from a single raw socket. * - * @param bytes_transferred Number of bytes transferred + * @param bytes_transferred Number of bytes transferred. * @return void **/ void IcmpPinger::handle_receive_icmp_packet( const size_t &bytes_transferred ) @@ -294,6 +294,13 @@ void IcmpPinger::handle_receive_icmp_packet( const size_t &bytes_transferred ) } } +/** + * @brief Prints the ICMP echo reply messages. + * + * @param icmp_packet The IcmpPacket object containing the received echo reply data. + * @param bytes_transferred Number of bytes transferred. + * @return void + */ void IcmpPinger::print_echo_reply( const IcmpPacket &icmp_packet, const size_t &bytes_transferred @@ -319,6 +326,13 @@ void IcmpPinger::print_echo_reply( << " time=" << elapsed_time << " ms" << endl; } +/** + * @brief Prints the destination unreachable messages. + * + * @param icmp_packet The IcmpPacket object containing the received destination + * unreachable data. + * @return void + */ void IcmpPinger::print_destination_unreachable( const IcmpPacket &icmp_packet ) const -- 1.7.1