OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Icmpv6Handler Class Reference

#include <icmpv6_handler.h>

Inheritance diagram for Icmpv6Handler:
Collaboration diagram for Icmpv6Handler:

Public Member Functions

 Icmpv6Handler (Agent *agent, boost::shared_ptr< PktInfo > info, boost::asio::io_context &io)
 
virtual ~Icmpv6Handler ()
 
bool Run ()
 
bool RouterAdvertisement (Icmpv6Proto *proto)
 
void SendNeighborAdvert (const Ip6Address &sip, const Ip6Address &dip, const MacAddress &smac, const MacAddress &dmac, uint32_t itf, uint32_t vrf, bool solicited)
 
void SendNeighborSolicit (const Ip6Address &sip, const Ip6Address &dip, const VmInterface *vmi, uint32_t vrf, bool send_unicast=false)
 
- Public Member Functions inherited from ProtoHandler
 ProtoHandler (Agent *agent, boost::shared_ptr< PktInfo > info, boost::asio::io_context &io)
 
virtual ~ProtoHandler ()
 
void Send (uint32_t itf, uint32_t vrf, uint16_t, PktHandler::PktModuleName)
 
void Send (uint32_t itf, uint32_t vrf, uint16_t cmd, uint32_t param1, uint32_t param2, PktHandler::PktModuleName mod)
 
int EthHdr (const MacAddress &src, const MacAddress &dest, const uint16_t proto)
 
int EthHdr (char *buff, uint16_t len, const MacAddress &src, const MacAddress &dest, const uint16_t proto, uint16_t vlan_id)
 
int EthHdr (char *buff, uint16_t len, const Interface *interface, const MacAddress &src, const MacAddress &dest, const uint16_t proto)
 
int EthHdr (char *buff, uint16_t len, uint32_t ifindex, const MacAddress &src, const MacAddress &dest, const uint16_t proto)
 
void VlanHdr (uint8_t *ptr, uint16_t tci)
 
void IpHdr (uint16_t len, in_addr_t src, in_addr_t dest, uint8_t protocol, uint16_t id, uint8_t ttl)
 
uint16_t IpHdr (char *buff, uint16_t buf_len, uint16_t len, in_addr_t src, in_addr_t dest, uint8_t protocol, uint16_t id, uint8_t ttl)
 
void Ip6Hdr (ip6_hdr *ip, uint16_t plen, uint8_t next_header, uint8_t hlim, uint8_t *src, uint8_t *dest)
 
void UdpHdr (uint16_t len, in_addr_t src, uint16_t src_port, in_addr_t dest, uint16_t dest_port)
 
void UdpHdr (udphdr *hdr, uint16_t len, const uint8_t *src, uint16_t src_port, const uint8_t *dest, uint16_t dest_port, uint8_t next_hdr)
 
void UdpHdr (uint16_t len, const uint8_t *src, uint16_t src_port, const uint8_t *dest, uint16_t dest_port, uint8_t next_hdr)
 
uint16_t UdpHdr (udphdr *udp, uint16_t buf_len, uint16_t len, in_addr_t src, uint16_t src_port, in_addr_t dest, uint16_t dest_port)
 
uint16_t IcmpHdr (char *buff, uint16_t buf_len, uint8_t type, uint8_t code, uint16_t word1, uint16_t word2)
 
void IcmpChecksum (char *buff, uint16_t buf_len)
 
void IgmpChecksum (char *buff, uint16_t buf_len)
 
uint32_t Sum (uint16_t *, std::size_t, uint32_t) const
 
uint16_t Csum (uint16_t *, std::size_t, uint32_t) const
 
uint16_t UdpCsum (in_addr_t, in_addr_t, std::size_t, udphdr *) const
 
uint16_t Ipv6Csum (const uint8_t *src, const uint8_t *dest, uint16_t plen, uint8_t next_hdr, uint16_t *hdr) const
 
uint16_t Icmpv6Csum (const uint8_t *src, const uint8_t *dest, icmp6_hdr *icmp, uint16_t plen) const
 
Agentagent () const
 
uint32_t GetVrfIndex () const
 
uint32_t GetInterfaceIndex () const
 
uint16_t GetLength () const
 
uint32_t GetCmdParam () const
 
PktInfopkt_info () const
 
uint32_t EncapHeaderLen () const
 

Static Public Attributes

static const Ip6Address::bytes_type kPrefix
 
static const Ip6Address::bytes_type kSuffix
 
static const Ip6Address kSolicitedNodeIpPrefix
 
static const Ip6Address kSolicitedNodeIpSuffixMask
 
static const uint8_t kIPv6AddrUnspecifiedBytes [IPV6_ADDR_SIZE_BYTES] = { 0 }
 

Private Member Functions

bool CheckPacket ()
 
bool HandlePacket ()
 
bool HandleMessage ()
 
void EntryDelete (NdpKey &key)
 
uint16_t FillRouterAdvertisement (uint8_t *buf, uint32_t ifindex, uint8_t *src, uint8_t *dest, const Ip6Address &prefix, uint8_t plen)
 
uint16_t FillNeighborAdvertisement (uint8_t *buf, uint8_t *dip, uint8_t *sip, const Ip6Address &target, const MacAddress &dmac, bool solicited)
 
void SendRAResponse (uint32_t ifindex, uint32_t vrfindex, uint8_t *src_ip, uint8_t *dest_ip, const MacAddress &dest_mac, const Ip6Address &prefix, uint8_t plen)
 
void SendPingResponse ()
 
void SendIcmpv6Response (uint32_t ifindex, uint32_t vrfindex, uint8_t *src_ip, uint8_t *dest_ip, const MacAddress &dest_mac, uint16_t len)
 
void SolicitedMulticastIpAndMac (const Ip6Address &dip, uint8_t *ip, MacAddress &mac)
 
uint16_t FillNeighborSolicit (uint8_t *buf, const Ip6Address &target, uint8_t *sip, uint8_t *dip)
 
void Ipv6Lower24BitsExtract (uint8_t *dst, uint8_t *src)
 
void Ipv6AddressBitwiseOr (uint8_t *dst, uint8_t *src)
 
bool IsDefaultGatewayConfigured (uint32_t ifindex, const Ip6Address &addr)
 
bool IsIPv6AddrUnspecifiedBytes (const uint8_t *ip)
 
 DISALLOW_COPY_AND_ASSIGN (Icmpv6Handler)
 

Private Attributes

icmp6_hdr * icmp_
 
uint16_t icmp_len_
 
tbb::atomic< uint32_t > refcount_
 

Friends

void intrusive_ptr_add_ref (const Icmpv6Handler *p)
 
void intrusive_ptr_release (const Icmpv6Handler *p)
 

Additional Inherited Members

- Protected Attributes inherited from ProtoHandler
Agentagent_
 
boost::shared_ptr< PktInfopkt_info_
 
boost::asio::io_context & io_
 

Detailed Description

Definition at line 17 of file icmpv6_handler.h.

Constructor & Destructor Documentation

Icmpv6Handler::Icmpv6Handler ( Agent agent,
boost::shared_ptr< PktInfo info,
boost::asio::io_context &  io 
)

Definition at line 29 of file icmpv6_handler.cc.

Icmpv6Handler::~Icmpv6Handler ( )
virtual

Definition at line 41 of file icmpv6_handler.cc.

Member Function Documentation

bool Icmpv6Handler::CheckPacket ( )
private

Definition at line 348 of file icmpv6_handler.cc.

Here is the call graph for this function:

Icmpv6Handler::DISALLOW_COPY_AND_ASSIGN ( Icmpv6Handler  )
private
void Icmpv6Handler::EntryDelete ( NdpKey key)
private

Definition at line 290 of file icmpv6_handler.cc.

Here is the call graph for this function:

uint16_t Icmpv6Handler::FillNeighborAdvertisement ( uint8_t *  buf,
uint8_t *  dip,
uint8_t *  sip,
const Ip6Address target,
const MacAddress dmac,
bool  solicited 
)
private

Definition at line 490 of file icmpv6_handler.cc.

Here is the call graph for this function:

uint16_t Icmpv6Handler::FillNeighborSolicit ( uint8_t *  buf,
const Ip6Address target,
uint8_t *  sip,
uint8_t *  dip 
)
private

Definition at line 464 of file icmpv6_handler.cc.

Here is the call graph for this function:

uint16_t Icmpv6Handler::FillRouterAdvertisement ( uint8_t *  buf,
uint32_t  ifindex,
uint8_t *  src,
uint8_t *  dest,
const Ip6Address prefix,
uint8_t  plen 
)
private

Definition at line 363 of file icmpv6_handler.cc.

Here is the call graph for this function:

bool Icmpv6Handler::HandleMessage ( )
private

Definition at line 215 of file icmpv6_handler.cc.

Here is the call graph for this function:

bool Icmpv6Handler::HandlePacket ( )
private

Definition at line 57 of file icmpv6_handler.cc.

Here is the call graph for this function:

void Icmpv6Handler::Ipv6AddressBitwiseOr ( uint8_t *  dst,
uint8_t *  src 
)
private

Definition at line 524 of file icmpv6_handler.cc.

void Icmpv6Handler::Ipv6Lower24BitsExtract ( uint8_t *  dst,
uint8_t *  src 
)
private

Definition at line 518 of file icmpv6_handler.cc.

bool Icmpv6Handler::IsDefaultGatewayConfigured ( uint32_t  ifindex,
const Ip6Address addr 
)
private

Definition at line 620 of file icmpv6_handler.cc.

Here is the call graph for this function:

bool Icmpv6Handler::IsIPv6AddrUnspecifiedBytes ( const uint8_t *  ip)
private

Definition at line 460 of file icmpv6_handler.cc.

bool Icmpv6Handler::RouterAdvertisement ( Icmpv6Proto proto)

Definition at line 299 of file icmpv6_handler.cc.

Here is the call graph for this function:

bool Icmpv6Handler::Run ( void  )
virtual

Implements ProtoHandler.

Definition at line 44 of file icmpv6_handler.cc.

Here is the call graph for this function:

void Icmpv6Handler::SendIcmpv6Response ( uint32_t  ifindex,
uint32_t  vrfindex,
uint8_t *  src_ip,
uint8_t *  dest_ip,
const MacAddress dest_mac,
uint16_t  len 
)
private

Definition at line 438 of file icmpv6_handler.cc.

Here is the call graph for this function:

void Icmpv6Handler::SendNeighborAdvert ( const Ip6Address sip,
const Ip6Address dip,
const MacAddress smac,
const MacAddress dmac,
uint32_t  itf,
uint32_t  vrf,
bool  solicited 
)

Definition at line 559 of file icmpv6_handler.cc.

Here is the call graph for this function:

void Icmpv6Handler::SendNeighborSolicit ( const Ip6Address sip,
const Ip6Address dip,
const VmInterface vmi,
uint32_t  vrf,
bool  send_unicast = false 
)

Definition at line 588 of file icmpv6_handler.cc.

Here is the call graph for this function:

void Icmpv6Handler::SendPingResponse ( )
private

Definition at line 421 of file icmpv6_handler.cc.

Here is the call graph for this function:

void Icmpv6Handler::SendRAResponse ( uint32_t  ifindex,
uint32_t  vrfindex,
uint8_t *  src_ip,
uint8_t *  dest_ip,
const MacAddress dest_mac,
const Ip6Address prefix,
uint8_t  plen 
)
private

Definition at line 411 of file icmpv6_handler.cc.

Here is the call graph for this function:

void Icmpv6Handler::SolicitedMulticastIpAndMac ( const Ip6Address dip,
uint8_t *  ip,
MacAddress mac 
)
private

Definition at line 530 of file icmpv6_handler.cc.

Here is the call graph for this function:

Friends And Related Function Documentation

void intrusive_ptr_add_ref ( const Icmpv6Handler p)
friend

Definition at line 637 of file icmpv6_handler.cc.

void intrusive_ptr_release ( const Icmpv6Handler p)
friend

Definition at line 641 of file icmpv6_handler.cc.

Member Data Documentation

icmp6_hdr* Icmpv6Handler::icmp_
private

Definition at line 67 of file icmpv6_handler.h.

uint16_t Icmpv6Handler::icmp_len_
private

Definition at line 68 of file icmpv6_handler.h.

const uint8_t Icmpv6Handler::kIPv6AddrUnspecifiedBytes = { 0 }
static

Definition at line 23 of file icmpv6_handler.h.

const Ip6Address::bytes_type Icmpv6Handler::kPrefix
static
Initial value:
=
{ {0xFF, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0xFF, 0, 0, 0} }

Definition at line 19 of file icmpv6_handler.h.

const Ip6Address Icmpv6Handler::kSolicitedNodeIpPrefix
static

Definition at line 21 of file icmpv6_handler.h.

const Ip6Address Icmpv6Handler::kSolicitedNodeIpSuffixMask
static

Definition at line 22 of file icmpv6_handler.h.

const Ip6Address::bytes_type Icmpv6Handler::kSuffix
static
Initial value:
=
{ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0xFF} }

Definition at line 20 of file icmpv6_handler.h.

tbb::atomic<uint32_t> Icmpv6Handler::refcount_
mutableprivate

Definition at line 69 of file icmpv6_handler.h.


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