#include <Icmp6.h>

Inheritance diagram for Icmp6:
Collaboration diagram for Icmp6:

Public Member Functions

 Icmp6 ()
virtual ~Icmp6 ()
virtual int Open ()
 Start pinger helper and initiate control channel. More...
virtual void SendEcho (Ip::Address &, int, const char *, int)
virtual void Recv (void)
virtual void Close ()
 Shutdown pinger helper and control channel. More...

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

Class partially implementing RFC 4443 - ICMPv6 for IP version 6. Provides ECHO-REQUEST, ECHO-REPLY (secion 4)

Definition at line 45 of file Icmp6.h.

Constructor & Destructor Documentation

Icmp6::Icmp6 ( )

Definition at line 88 of file Icmp6.cc.

Icmp6::~Icmp6 ( )

Definition at line 93 of file Icmp6.cc.

References Icmp::Close().

Member Function Documentation

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

Definition at line 38 of file Icmp.cc.

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

void Icmp::Close ( void  )

Reimplemented in IcmpSquid, IcmpPinger, and stubIcmp.

Definition at line 25 of file Icmp.cc.

References Icmp::icmp_ident, and Icmp::icmp_sock.

Referenced by IcmpPinger::Close(), main(), Icmp4::~Icmp4(), and ~Icmp6().

int Icmp::ipHops ( int  ttl)

Translate TTL to a hop distance

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? 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 stubIcmp::testHops().

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

Definition at line 88 of file Icmp.cc.

References current_time, and debugs.

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

int Icmp6::Open ( )

Implements Icmp.

Definition at line 99 of file Icmp6.cc.

References DBG_CRITICAL, DBG_IMPORTANT, debugs, Icmp::icmp_ident, Icmp::icmp_sock, IPPROTO_ICMPV6, MYNAME, and xstrerr().

Referenced by main().

void Icmp6::Recv ( void  )
void Icmp6::SendEcho ( Ip::Address to,
int  opcode,
const char *  payload,
int  len 

Member Data Documentation

int Icmp::icmp_ident

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






Web Site Translations