#include <Icmp6.h>

Inheritance diagram for Icmp6:
Collaboration diagram for Icmp6:

Public Member Functions

 Icmp6 ()
 
 ~Icmp6 () override
 
int Open () override
 Start pinger helper and initiate control channel. More...
 
void SendEcho (Ip::Address &, int, const char *, int) override
 
void Recv (void) override
 
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 (section 4)

Definition at line 45 of file Icmp6.h.

Constructor & Destructor Documentation

◆ Icmp6()

Icmp6::Icmp6 ( )

Definition at line 87 of file Icmp6.cc.

◆ ~Icmp6()

Icmp6::~Icmp6 ( )
override

Definition at line 92 of file Icmp6.cc.

References Icmp::Close().

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(), SendEcho(), and IcmpStub::testChecksum().

◆ Close()

void Icmp::Close ( void  )
virtualinherited

Reimplemented in IcmpPinger, IcmpSquid, and IcmpStub.

Definition at line 25 of file Icmp.cc.

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

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

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

◆ Open()

int Icmp6::Open ( )
overridevirtual

Implements Icmp.

Definition at line 98 of file Icmp6.cc.

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

Referenced by main().

◆ Recv()

void Icmp6::Recv ( void  )
overridevirtual

◆ SendEcho()

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

Member Data Documentation

◆ icmp_ident

int Icmp::icmp_ident
protectedinherited

◆ icmp_sock


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors