Inheritance diagram for IcmpStub:
Collaboration diagram for IcmpStub:

Public Member Functions

 IcmpStub ()
 
 ~IcmpStub () override
 
int Open () override
 Start pinger helper and initiate control channel. More...
 
void Close () override
 Shutdown pinger helper and control channel. More...
 
void SendEcho (Ip::Address &, int, const char *, int) override
 Construct ECHO request. More...
 
void Recv (void) override
 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 21 of file testIcmp.cc.

Constructor & Destructor Documentation

◆ IcmpStub()

IcmpStub::IcmpStub ( )
inline

Definition at line 24 of file testIcmp.cc.

◆ ~IcmpStub()

IcmpStub::~IcmpStub ( )
inlineoverride

Definition at line 25 of file testIcmp.cc.

Member Function Documentation

◆ CheckSum()

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

Definition at line 38 of file Icmp.cc.

References size.

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

◆ Close()

void IcmpStub::Close ( void  )
inlineoverridevirtual

Reimplemented from Icmp.

Definition at line 27 of file testIcmp.cc.

◆ ipHops()

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

XXX: BUG? ttl<0 can produce high hop values XXX: BUG? ttl>255 can produce zero or negative hop values

Definition at line 67 of file Icmp.cc.

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

◆ Log()

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 Icmp4::Recv(), Icmp6::Recv(), Icmp4::SendEcho(), and Icmp6::SendEcho().

◆ Open()

int IcmpStub::Open ( )
inlineoverridevirtual

Implements Icmp.

Definition at line 26 of file testIcmp.cc.

◆ Recv()

void IcmpStub::Recv ( void  )
inlineoverridevirtual

Implements Icmp.

Definition at line 33 of file testIcmp.cc.

◆ SendEcho()

void IcmpStub::SendEcho ( Ip::Address ,
int  ,
const char *  ,
int   
)
inlineoverridevirtual

Implements Icmp.

Definition at line 30 of file testIcmp.cc.

◆ testChecksum()

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

Definition at line 36 of file testIcmp.cc.

References Icmp::CheckSum(), and size.

Referenced by TestIcmp::testChecksum().

◆ testHops()

int IcmpStub::testHops ( int  ttl)
inline

Definition at line 37 of file testIcmp.cc.

References Icmp::ipHops().

Referenced by TestIcmp::testHops().

Member Data Documentation

◆ icmp_ident

int Icmp::icmp_ident
protectedinherited

◆ icmp_sock


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors