#include <testIcmp.h>


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 &, int, const char *, int) |
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()
|
inline |
Definition at line 21 of file testIcmp.h.
◆ ~stubIcmp()
|
inlinevirtual |
Definition at line 22 of file testIcmp.h.
Member Function Documentation
◆ CheckSum()
Definition at line 38 of file Icmp.cc.
References size.
Referenced by Icmp4::SendEcho(), Icmp6::SendEcho(), and testChecksum().
◆ Close()
|
inlinevirtual |
Reimplemented from Icmp.
Definition at line 24 of file testIcmp.h.
◆ ipHops()
Translate TTL to a hop distance
- Parameters
-
ttl negative : n > 33 ttl n(0...32) : 32 >= n >= 1 ttl n(33...62) : 32 >= n >= 1 ttl n(63...64) : 2 >= n >= 1 ttl n(65...128) : 64 >= n >= 1 ttl n(129...192) : 64 >= n >= 1 ttl n(193...) : n < 255
- Bug:
- BUG? ttl<0 can produce high hop values
- Bug:
- 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()
|
protectedinherited |
Definition at line 88 of file Icmp.cc.
References current_time, debugs, and type.
Referenced by Icmp4::Recv(), Icmp6::Recv(), Icmp4::SendEcho(), and Icmp6::SendEcho().
◆ Open()
|
inlinevirtual |
Implements Icmp.
Definition at line 23 of file testIcmp.h.
◆ Recv()
|
inlinevirtual |
Implements Icmp.
Definition at line 30 of file testIcmp.h.
◆ SendEcho()
|
inlinevirtual |
Implements Icmp.
Definition at line 27 of file testIcmp.h.
◆ testChecksum()
Definition at line 33 of file testIcmp.h.
References Icmp::CheckSum(), and size.
Referenced by testIcmp::testChecksum().
◆ testHops()
Definition at line 34 of file testIcmp.h.
References Icmp::ipHops().
Referenced by testIcmp::testHops().
Member Data Documentation
◆ icmp_ident
|
protectedinherited |
Definition at line 122 of file Icmp.h.
Referenced by Icmp::Icmp(), Icmp::Close(), Icmp4::Open(), Icmp6::Open(), Icmp4::Recv(), Icmp6::Recv(), Icmp4::SendEcho(), and Icmp6::SendEcho().
◆ icmp_sock
|
protectedinherited |
Definition at line 121 of file Icmp.h.
Referenced by Icmp::Icmp(), Icmp::Close(), IcmpPinger::Close(), IcmpSquid::Close(), Icmp4::Open(), Icmp6::Open(), IcmpPinger::Open(), IcmpSquid::Open(), Icmp4::Recv(), Icmp6::Recv(), IcmpSquid::Recv(), Icmp4::SendEcho(), Icmp6::SendEcho(), and IcmpSquid::SendEcho().
The documentation for this class was generated from the following file:
- src/tests/testIcmp.h