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

#include <diag_pkt_handler.h>

Inheritance diagram for DiagPktHandler:
Collaboration diagram for DiagPktHandler:

Public Member Functions

 DiagPktHandler (Agent *agent, boost::shared_ptr< PktInfo > info, boost::asio::io_context &io)
 
virtual bool Run ()
 
void SetReply ()
 
void SetDiagChkSum ()
 
void SetDiagChkSumV6 ()
 
void Reply ()
 
void SendOverlayResponse ()
 
const std::string & GetAddress () const
 
uint8_t * GetData ()
 
bool IsDone () const
 
void set_done (bool done)
 
void TcpHdr (in_addr_t, uint16_t, in_addr_t, uint16_t, bool, uint32_t, uint16_t)
 
void TcpHdr (uint16_t len, const uint8_t *src, uint16_t sport, const uint8_t *dest, uint16_t dport, bool is_syn, uint32_t seq_no, uint8_t next_hdr)
 
- 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 uint8_t icmp_payload_len = 128
 

Private Member Functions

bool IsTraceRoutePacket ()
 
bool IsOverlayPingPacket ()
 
void SetReturnCode (OverlayOamPktData *oamdata)
 
bool HandleTraceRoutePacket ()
 
void SendTimeExceededPacket ()
 
void SendTimeExceededV6Packet ()
 
bool HandleTraceRouteResponse ()
 
bool ParseIcmpData (const uint8_t *data, uint16_t data_len, uint16_t *key, bool is_v4)
 
uint16_t TcpCsum (in_addr_t, in_addr_t, uint16_t, tcphdr *)
 
void Swap ()
 
void TunnelHdrSwap ()
 
void SwapL4 ()
 
void Swapv6L4 ()
 
void SwapIpHdr ()
 
void SwapIp6Hdr ()
 
void SwapEthHdr ()
 
void BuildReply ()
 
void SegmentHealthCheckReply ()
 

Private Attributes

bool done_
 
DiagTablediag_table_
 
std::string address_
 

Additional Inherited Members

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

Detailed Description

Definition at line 30 of file diag_pkt_handler.h.

Constructor & Destructor Documentation

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

Definition at line 33 of file diag_pkt_handler.h.

Member Function Documentation

void DiagPktHandler::BuildReply ( )
private

Definition at line 59 of file diag_pkt_handler.cc.

const std::string& DiagPktHandler::GetAddress ( ) const
inline

Definition at line 43 of file diag_pkt_handler.h.

uint8_t* DiagPktHandler::GetData ( )
inline

Definition at line 44 of file diag_pkt_handler.h.

bool DiagPktHandler::HandleTraceRoutePacket ( )
private

Definition at line 95 of file diag_pkt_handler.cc.

bool DiagPktHandler::HandleTraceRouteResponse ( )
private

Definition at line 248 of file diag_pkt_handler.cc.

Here is the call graph for this function:

bool DiagPktHandler::IsDone ( ) const
inline

Definition at line 47 of file diag_pkt_handler.h.

bool DiagPktHandler::IsOverlayPingPacket ( )
private

Definition at line 89 of file diag_pkt_handler.cc.

bool DiagPktHandler::IsTraceRoutePacket ( )
private

Definition at line 81 of file diag_pkt_handler.cc.

bool DiagPktHandler::ParseIcmpData ( const uint8_t *  data,
uint16_t  data_len,
uint16_t *  key,
bool  is_v4 
)
private

Definition at line 283 of file diag_pkt_handler.cc.

void DiagPktHandler::Reply ( )

Definition at line 65 of file diag_pkt_handler.cc.

bool DiagPktHandler::Run ( void  )
virtual

Implements ProtoHandler.

Definition at line 361 of file diag_pkt_handler.cc.

Here is the call graph for this function:

void DiagPktHandler::SegmentHealthCheckReply ( )
private

Definition at line 71 of file diag_pkt_handler.cc.

void DiagPktHandler::SendOverlayResponse ( )

Definition at line 636 of file diag_pkt_handler.cc.

Here is the call graph for this function:

void DiagPktHandler::SendTimeExceededPacket ( )
private

Definition at line 128 of file diag_pkt_handler.cc.

Here is the call graph for this function:

void DiagPktHandler::SendTimeExceededV6Packet ( )
private

Definition at line 187 of file diag_pkt_handler.cc.

Here is the call graph for this function:

void DiagPktHandler::set_done ( bool  done)
inline

Definition at line 48 of file diag_pkt_handler.h.

void DiagPktHandler::SetDiagChkSum ( )

Definition at line 31 of file diag_pkt_handler.cc.

void DiagPktHandler::SetDiagChkSumV6 ( )
void DiagPktHandler::SetReply ( )

Definition at line 26 of file diag_pkt_handler.cc.

void DiagPktHandler::SetReturnCode ( OverlayOamPktData oamdata)
private

Definition at line 563 of file diag_pkt_handler.cc.

Here is the call graph for this function:

void DiagPktHandler::Swap ( )
private

Definition at line 552 of file diag_pkt_handler.cc.

void DiagPktHandler::SwapEthHdr ( )
private

Definition at line 547 of file diag_pkt_handler.cc.

void DiagPktHandler::SwapIp6Hdr ( )
private

Definition at line 538 of file diag_pkt_handler.cc.

void DiagPktHandler::SwapIpHdr ( )
private

Definition at line 531 of file diag_pkt_handler.cc.

void DiagPktHandler::SwapL4 ( )
private

Definition at line 493 of file diag_pkt_handler.cc.

void DiagPktHandler::Swapv6L4 ( )
private

Definition at line 516 of file diag_pkt_handler.cc.

uint16_t DiagPktHandler::TcpCsum ( in_addr_t  src,
in_addr_t  dest,
uint16_t  len,
tcphdr *  tcp 
)
private

Definition at line 485 of file diag_pkt_handler.cc.

void DiagPktHandler::TcpHdr ( in_addr_t  src,
uint16_t  sport,
in_addr_t  dst,
uint16_t  dport,
bool  is_syn,
uint32_t  seq_no,
uint16_t  len 
)

Definition at line 439 of file diag_pkt_handler.cc.

void DiagPktHandler::TcpHdr ( uint16_t  len,
const uint8_t *  src,
uint16_t  sport,
const uint8_t *  dest,
uint16_t  dport,
bool  is_syn,
uint32_t  seq_no,
uint8_t  next_hdr 
)

Definition at line 462 of file diag_pkt_handler.cc.

void DiagPktHandler::TunnelHdrSwap ( )
private

Definition at line 626 of file diag_pkt_handler.cc.

Member Data Documentation

std::string DiagPktHandler::address_
private

Definition at line 76 of file diag_pkt_handler.h.

DiagTable* DiagPktHandler::diag_table_
private

Definition at line 75 of file diag_pkt_handler.h.

bool DiagPktHandler::done_
private

Definition at line 74 of file diag_pkt_handler.h.

const uint8_t DiagPktHandler::icmp_payload_len = 128
static

Definition at line 32 of file diag_pkt_handler.h.


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