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()
|
inline |
Definition at line 24 of file testIcmp.cc.
◆ ~IcmpStub()
|
inlineoverride |
Definition at line 25 of file testIcmp.cc.
Member Function Documentation
◆ CheckSum()
Definition at line 38 of file Icmp.cc.
References size.
Referenced by Icmp4::SendEcho(), Icmp6::SendEcho(), and testChecksum().
◆ Close()
|
inlineoverridevirtual |
Reimplemented from Icmp.
Definition at line 27 of file testIcmp.cc.
◆ 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
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()
|
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()
|
inlineoverridevirtual |
Implements Icmp.
Definition at line 26 of file testIcmp.cc.
◆ Recv()
|
inlineoverridevirtual |
Implements Icmp.
Definition at line 33 of file testIcmp.cc.
◆ SendEcho()
|
inlineoverridevirtual |
Implements Icmp.
Definition at line 30 of file testIcmp.cc.
◆ testChecksum()
Definition at line 36 of file testIcmp.cc.
References Icmp::CheckSum(), and size.
Referenced by TestIcmp::testChecksum().
◆ testHops()
Definition at line 37 of file testIcmp.cc.
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.cc