#include <sys/socket.h>
#include <sys/types.h>
-#include "icmpbody.h"
+#include "icmpdata.h"
#include "icmpchecksumcalculator.h"
#include "icmpheader.h"
#include "ipv4header.h"
void BoostPinger::start_send()
{
- IcmpBody body( "ping message" );
+ IcmpData data( "ping message" );
// Create an ICMP header for an echo request.
SequenceNumber++;
IcmpHeader::IcmpType type = IcmpHeader::EchoRequest;
uint8_t code = 0;
uint16_t identifier = get_identifier();
- IcmpChecksumCalculator calculator( body.begin(), body.end() );
+ IcmpChecksumCalculator calculator( data.begin(), data.end() );
uint16_t checksum = calculator.compute( type, code, identifier, SequenceNumber );
IcmpHeader echo_request( type, code, checksum, identifier, SequenceNumber );
// Encode the request packet.
boost::asio::streambuf request_buffer;
std::ostream os( &request_buffer );
- os << echo_request << body;
+ os << echo_request << data;
int ping_times = SequenceNumber;
if ( ping_times < 4 )
if ( NumReplies == 0 )
Timer.cancel();
- NumReplies++;
+ ++NumReplies;
// Print out some information about the reply packet.
posix_time::ptime now = posix_time::microsec_clock::universal_time();
#define ICMPCHECKSUMCALCULATOR_H
#include "checksumcalculator.h"
-#include "icmpbody.h"
+#include "icmpdata.h"
//-----------------------------------------------------------------------------
// IcmpChecksumCalculator
//-----------------------------------------------------------------------------
-typedef ChecksumCalculator<IcmpBody::iterator> IcmpChecksumCalculator;
+typedef ChecksumCalculator<IcmpData::iterator> IcmpChecksumCalculator;
#endif /* ICMPCHECKSUMCALCULATOR_H */
-#ifndef ICMPBODY_H
-#define ICMPBODY_H
+#ifndef ICMPDATA_H
+#define ICMPDATA_H
#include <string>
//-----------------------------------------------------------------------------
-// IcmpBody
+// IcmpData
//-----------------------------------------------------------------------------
-typedef std::string IcmpBody;
+typedef std::string IcmpData;
-#endif /* ICMPBODY_H */
+#endif /* ICMPDATA_H */