#include <testIcmp.h>

Inheritance diagram for stubIcmp:
Collaboration diagram for stubIcmp:

Public Member Functions

 stubIcmp ()
 
virtual ~stubIcmp ()
 
virtual int Open ()
 Start pinger helper and initiate control channel. More...
 
virtual void Close ()
 Shutdown pinger helper and control channel. More...
 
virtual void SendEcho (Ip::Address &to, int opcode, const char *payload, int len)
 Construct ECHO request. More...
 
virtual void Recv (void)
 Handle ICMP responses. More...
 
int testChecksum (unsigned short *ptr, int size)
 
int testHops (int ttl)
 

Protected Member Functions

int CheckSum (unsigned short *ptr, int size)
 Calculate a packet checksum. More...
 
int ipHops (int ttl)
 
void Log (const Ip::Address &addr, const uint8_t type, const char *pkt_str, const int rtt, const int hops)
 Log the packet. More...
 

Protected Attributes

int icmp_sock
 
int icmp_ident
 

Detailed Description

Definition at line 18 of file testIcmp.h.

Constructor & Destructor Documentation

stubIcmp::stubIcmp ( )
inline

Definition at line 21 of file testIcmp.h.

virtual stubIcmp::~stubIcmp ( )
inlinevirtual

Definition at line 22 of file testIcmp.h.

Member Function Documentation

int Icmp::CheckSum ( unsigned short *  ptr,
int  size 
)
protectedinherited

Definition at line 38 of file Icmp.cc.

Referenced by Icmp6::SendEcho(), Icmp4::SendEcho(), and testChecksum().

virtual void stubIcmp::Close ( void  )
inlinevirtual

Reimplemented from Icmp.

Definition at line 24 of file testIcmp.h.

int Icmp::ipHops ( int  ttl)
protectedinherited

Translate TTL to a hop distance

Parameters
ttlnegative : n > 33
ttln(0...32) : 32 >= n >= 1
ttln(33...62) : 32 >= n >= 1
ttln(63...64) : 2 >= n >= 1
ttln(65...128) : 64 >= n >= 1
ttln(129...192) : 64 >= n >= 1
ttln(193...) : n < 255
Bug:

BUG? ttl<0 can produce high hop values

BUG? ttl>255 can produce zero or negative hop values

Definition at line 67 of file Icmp.cc.

Referenced by Icmp4::Recv(), and testHops().

void Icmp::Log ( const Ip::Address addr,
const uint8_t  type,
const char *  pkt_str,
const int  rtt,
const int  hops 
)
protectedinherited

Definition at line 88 of file Icmp.cc.

References current_time, and debugs.

Referenced by Icmp6::Recv(), Icmp4::Recv(), Icmp6::SendEcho(), and Icmp4::SendEcho().

virtual int stubIcmp::Open ( )
inlinevirtual

Implements Icmp.

Definition at line 23 of file testIcmp.h.

virtual void stubIcmp::Recv ( void  )
inlinevirtual

Implements Icmp.

Definition at line 30 of file testIcmp.h.

virtual void stubIcmp::SendEcho ( Ip::Address to,
int  opcode,
const char *  payload,
int  len 
)
inlinevirtual

Implements Icmp.

Definition at line 27 of file testIcmp.h.

int stubIcmp::testChecksum ( unsigned short *  ptr,
int  size 
)
inline

Definition at line 33 of file testIcmp.h.

References Icmp::CheckSum().

Referenced by testIcmp::testChecksum().

int stubIcmp::testHops ( int  ttl)
inline

Definition at line 34 of file testIcmp.h.

References Icmp::ipHops().

Referenced by testIcmp::testHops().

Member Data Documentation

int Icmp::icmp_ident
protectedinherited

The documentation for this class was generated from the following file:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors