// IcmpPinger
//-----------------------------------------------------------------------------
+/**
+ * @brief Parameterized constructor.
+ */
IcmpPinger::IcmpPinger(
io_service &io_serv,
const string &source_network_interface,
SequenceNumber( 0 ),
TimeSent( microsec_clock::universal_time() ),
ReplyBuffer(),
- ReceivedReply( false ),
+ ReplyReceived( false ),
EchoReplyTimeoutInSec( echo_reply_timeout_in_sec ),
PingerStatus( PingStatus_NotSent ),
PingDoneCallback()
memcpy( &Identifier, random_tag.data, sizeof(Identifier) );
}
+/**
+ * @brief Destructor.
+ */
IcmpPinger::~IcmpPinger()
{
}
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 )
);
**/
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;
Identifier, SequenceNumber,
DestinationEndpoint.address() ) )
{
- ReceivedReply = true;
+ ReplyReceived = true;
icmp_packet->print_echo_reply( bytes_transferred, TimeSent );
Identifier, SequenceNumber,
DestinationEndpoint.address() ) )
{
- ReceivedReply = true;
+ ReplyReceived = true;
icmp_packet->print_destination_unreachable();
/// 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