Renamed variable, most significant noun first
authorGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Sun, 6 Nov 2011 21:38:10 +0000 (19:38 -0200)
committerGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Sun, 6 Nov 2011 21:38:10 +0000 (19:38 -0200)
src/icmp/icmppinger.cpp
src/icmp/icmppinger.h

index 5d64b33..d0fa09a 100644 (file)
@@ -38,6 +38,9 @@ using I2n::Logger::GlobalLogger;
 // IcmpPinger
 //-----------------------------------------------------------------------------
 
+/**
+ * @brief Parameterized constructor.
+ */
 IcmpPinger::IcmpPinger(
         io_service &io_serv,
         const string &source_network_interface,
@@ -52,7 +55,7 @@ IcmpPinger::IcmpPinger(
     SequenceNumber( 0 ),
     TimeSent( microsec_clock::universal_time() ),
     ReplyBuffer(),
-    ReceivedReply( false ),
+    ReplyReceived( false ),
     EchoReplyTimeoutInSec( echo_reply_timeout_in_sec ),
     PingerStatus( PingStatus_NotSent ),
     PingDoneCallback()
@@ -71,6 +74,9 @@ IcmpPinger::IcmpPinger(
     memcpy( &Identifier, random_tag.data, sizeof(Identifier) );
 }
 
+/**
+ * @brief Destructor.
+ */
 IcmpPinger::~IcmpPinger()
 {
 }
@@ -157,7 +163,7 @@ void IcmpPinger::send_echo_request( const IcmpPacketItem icmp_packet )
 void IcmpPinger::schedule_timeout_echo_reply()
 {
     // Wait up to N seconds for a reply.
-    ReceivedReply = false;
+    ReplyReceived = false;
     (void) IcmpPacketReceiveTimer.expires_at(
             TimeSent + seconds( EchoReplyTimeoutInSec )
     );
@@ -173,9 +179,9 @@ void IcmpPinger::schedule_timeout_echo_reply()
  **/
 void IcmpPinger::handle_ping_done()
 {
-    // Check ReceivedReply as the timer handler
+    // Check ReplyReceived as the timer handler
     // is also called by Timer.cancel();
-    if ( ReceivedReply == false )
+    if ( ReplyReceived == false )
     {
         GlobalLogger.info() << "Request timed out" << endl;
 
@@ -243,7 +249,7 @@ void IcmpPinger::handle_receive_icmp_packet( const size_t &bytes_transferred )
                                 Identifier, SequenceNumber,
                                 DestinationEndpoint.address() ) )
         {
-            ReceivedReply = true;
+            ReplyReceived = true;
 
             icmp_packet->print_echo_reply( bytes_transferred, TimeSent );
 
@@ -255,7 +261,7 @@ void IcmpPinger::handle_receive_icmp_packet( const size_t &bytes_transferred )
                                      Identifier, SequenceNumber,
                                      DestinationEndpoint.address() ) )
         {
-            ReceivedReply = true;
+            ReplyReceived = true;
 
             icmp_packet->print_destination_unreachable();
 
index c811f3f..4fdbcca 100644 (file)
@@ -75,8 +75,7 @@ private:
     /// The buffer where the data received will be placed
     boost::asio::streambuf ReplyBuffer;
     /// Flag to indicate if we got a reply or not
-    /// number of replies to the ICMP echo request
-    bool ReceivedReply;
+    bool ReplyReceived;
     /// The amount of time to wait for the reply
     int EchoReplyTimeoutInSec;
     /// The status of the pinger