|
Squid Web Cache master
|
#include <Icmp6.h>
Public Member Functions | |
| Icmp6 () | |
| ~Icmp6 () override | |
| int | Open () override |
| Start pinger helper and initiate control channel. | |
| void | SendEcho (Ip::Address &, int, const char *, int) override |
| void | Recv (void) override |
| virtual void | Close () |
| Shutdown pinger helper and control channel. | |
Protected Member Functions | |
| int | CheckSum (unsigned short *ptr, int size) |
| Calculate a packet checksum. | |
| 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. | |
Protected Attributes | |
| int | icmp_sock |
| int | icmp_ident |
Class partially implementing RFC 4443 - ICMPv6 for IP version 6. Provides ECHO-REQUEST, ECHO-REPLY (section 4)
|
override |
Definition at line 94 of file Icmp6.cc.
References Icmp::Close().
Definition at line 39 of file Icmp.cc.
References size.
Referenced by Icmp4::SendEcho(), SendEcho(), and IcmpStub::testChecksum().
|
virtualinherited |
Reimplemented in IcmpPinger, IcmpSquid, and IcmpStub.
Definition at line 26 of file Icmp.cc.
References Icmp::icmp_ident, Icmp::icmp_sock, and xclose().
Referenced by Icmp4::~Icmp4(), ~Icmp6(), IcmpPinger::Close(), and main().
Translate TTL to a hop distance
| 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 68 of file Icmp.cc.
Referenced by Icmp4::Recv(), and IcmpStub::testHops().
|
protectedinherited |
Definition at line 89 of file Icmp.cc.
References current_time, and debugs.
|
overridevirtual |
Implements Icmp.
Definition at line 100 of file Icmp6.cc.
References DBG_CRITICAL, DBG_IMPORTANT, debugs, Icmp::icmp_ident, Icmp::icmp_sock, IPPROTO_ICMPV6, MYNAME, xsocket(), and xstrerr().
Referenced by main().
|
overridevirtual |
Reads an RFC 4443 Icmp6 ECHO-REPLY Packet from the network.
Implements Icmp.
Definition at line 200 of file Icmp6.cc.
References assert, control, DBG_CRITICAL, debugs, Ip::Address::FreeAddr(), Icmp::icmp_ident, Icmp::icmp_sock, IcmpPacketType(), Ip::Address::InitAddr(), MAX_PAYLOAD, MAX_PKT6_SZ, icmpEchoData::opcode, icmpEchoData::payload, PINGER_PAYLOAD_SZ, IcmpPinger::SendResult(), icmpEchoData::tv, tvSubMsec(), xmalloc, and xrecvfrom().
Referenced by main().
|
overridevirtual |
Generates an RFC 4443 Icmp6 ECHO Packet and sends into the network.
Implements Icmp.
Definition at line 120 of file Icmp6.cc.
References assert, Assure, Icmp::CheckSum(), current_time, DBG_IMPORTANT, debugs, Ip::Address::FreeAddr(), Ip::Address::getAddrInfo(), Icmp::icmp_ident, icmp_pkts_sent, Icmp::icmp_sock, LOCAL_ARRAY, MAX_PAYLOAD, MAX_PKT6_SZ, icmpEchoData::opcode, icmpEchoData::payload, icmpEchoData::tv, xsendto(), and xstrerr().
Referenced by IcmpPinger::Recv().
|
protectedinherited |
Definition at line 122 of file Icmp.h.
Referenced by Icmp::Icmp(), Icmp::Close(), Icmp4::Open(), Open(), Icmp4::Recv(), Recv(), Icmp4::SendEcho(), and SendEcho().
|
protectedinherited |
Definition at line 121 of file Icmp.h.
Referenced by Icmp::Icmp(), Icmp::Close(), IcmpPinger::Close(), IcmpSquid::Close(), Icmp4::Open(), Open(), IcmpPinger::Open(), IcmpSquid::Open(), Icmp4::Recv(), Recv(), IcmpSquid::Recv(), Icmp4::SendEcho(), SendEcho(), and IcmpSquid::SendEcho().