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

#include <proto_handler.h>

Inheritance diagram for ProtoHandler:
Collaboration diagram for ProtoHandler:

Public Member Functions

 ProtoHandler (Agent *agent, boost::shared_ptr< PktInfo > info, boost::asio::io_context &io)
 
virtual ~ProtoHandler ()
 
virtual bool Run ()=0
 
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
 

Protected Attributes

Agentagent_
 
boost::shared_ptr< PktInfopkt_info_
 
boost::asio::io_context & io_
 

Private Member Functions

void FillUdpHdr (udphdr *udp, uint16_t len, uint16_t src_port, uint16_t dest_port)
 
 DISALLOW_COPY_AND_ASSIGN (ProtoHandler)
 

Detailed Description

Definition at line 28 of file proto_handler.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file proto_handler.cc.

ProtoHandler::~ProtoHandler ( )
virtual

Definition at line 18 of file proto_handler.cc.

Member Function Documentation

Agent* ProtoHandler::agent ( ) const
inline

Definition at line 80 of file proto_handler.h.

uint16_t ProtoHandler::Csum ( uint16_t *  ptr,
std::size_t  len,
uint32_t  sum 
) const

Definition at line 236 of file proto_handler.cc.

Here is the call graph for this function:

ProtoHandler::DISALLOW_COPY_AND_ASSIGN ( ProtoHandler  )
private
uint32_t ProtoHandler::EncapHeaderLen ( ) const

Definition at line 21 of file proto_handler.cc.

Here is the call graph for this function:

int ProtoHandler::EthHdr ( const MacAddress src,
const MacAddress dest,
const uint16_t  proto 
)

Definition at line 72 of file proto_handler.cc.

int ProtoHandler::EthHdr ( char *  buff,
uint16_t  len,
const MacAddress src,
const MacAddress dest,
const uint16_t  proto,
uint16_t  vlan_id 
)

Definition at line 43 of file proto_handler.cc.

Here is the call graph for this function:

int ProtoHandler::EthHdr ( char *  buff,
uint16_t  len,
const Interface interface,
const MacAddress src,
const MacAddress dest,
const uint16_t  proto 
)

Definition at line 78 of file proto_handler.cc.

Here is the call graph for this function:

int ProtoHandler::EthHdr ( char *  buff,
uint16_t  len,
uint32_t  ifindex,
const MacAddress src,
const MacAddress dest,
const uint16_t  proto 
)

Definition at line 90 of file proto_handler.cc.

Here is the call graph for this function:

void ProtoHandler::FillUdpHdr ( udphdr *  udp,
uint16_t  len,
uint16_t  src_port,
uint16_t  dest_port 
)
private

Definition at line 146 of file proto_handler.cc.

uint32_t ProtoHandler::GetCmdParam ( ) const
inline

Definition at line 86 of file proto_handler.h.

uint32_t ProtoHandler::GetInterfaceIndex ( ) const
inline

Definition at line 82 of file proto_handler.h.

uint16_t ProtoHandler::GetLength ( ) const
inline

Definition at line 85 of file proto_handler.h.

uint32_t ProtoHandler::GetVrfIndex ( ) const
inline

Definition at line 81 of file proto_handler.h.

void ProtoHandler::IcmpChecksum ( char *  buff,
uint16_t  buf_len 
)

Definition at line 196 of file proto_handler.cc.

Here is the call graph for this function:

uint16_t ProtoHandler::IcmpHdr ( char *  buff,
uint16_t  buf_len,
uint8_t  type,
uint8_t  code,
uint16_t  word1,
uint16_t  word2 
)

Definition at line 174 of file proto_handler.cc.

Here is the call graph for this function:

uint16_t ProtoHandler::Icmpv6Csum ( const uint8_t *  src,
const uint8_t *  dest,
icmp6_hdr *  icmp,
uint16_t  plen 
) const

Definition at line 267 of file proto_handler.cc.

Here is the call graph for this function:

void ProtoHandler::IgmpChecksum ( char *  buff,
uint16_t  buf_len 
)

Definition at line 201 of file proto_handler.cc.

Here is the call graph for this function:

void ProtoHandler::Ip6Hdr ( ip6_hdr *  ip,
uint16_t  plen,
uint8_t  next_header,
uint8_t  hlim,
uint8_t *  src,
uint8_t *  dest 
)

Definition at line 136 of file proto_handler.cc.

void ProtoHandler::IpHdr ( uint16_t  len,
in_addr_t  src,
in_addr_t  dest,
uint8_t  protocol,
uint16_t  id,
uint8_t  ttl 
)

Definition at line 129 of file proto_handler.cc.

uint16_t ProtoHandler::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 
)

Definition at line 106 of file proto_handler.cc.

Here is the call graph for this function:

uint16_t ProtoHandler::Ipv6Csum ( const uint8_t *  src,
const uint8_t *  dest,
uint16_t  plen,
uint8_t  next_hdr,
uint16_t *  hdr 
) const

Definition at line 253 of file proto_handler.cc.

Here is the call graph for this function:

PktInfo* ProtoHandler::pkt_info ( ) const
inline

Definition at line 88 of file proto_handler.h.

void ProtoHandler::Send ( uint32_t  itf,
uint32_t  vrf,
uint16_t  cmd,
PktHandler::PktModuleName  mod 
)

Definition at line 26 of file proto_handler.cc.

void ProtoHandler::Send ( uint32_t  itf,
uint32_t  vrf,
uint16_t  cmd,
uint32_t  param1,
uint32_t  param2,
PktHandler::PktModuleName  mod 
)

Definition at line 31 of file proto_handler.cc.

Here is the call graph for this function:

uint32_t ProtoHandler::Sum ( uint16_t *  ptr,
std::size_t  len,
uint32_t  sum 
) const

Definition at line 222 of file proto_handler.cc.

uint16_t ProtoHandler::UdpCsum ( in_addr_t  src,
in_addr_t  dest,
std::size_t  len,
udphdr *  udp 
) const

Definition at line 245 of file proto_handler.cc.

Here is the call graph for this function:

void ProtoHandler::UdpHdr ( uint16_t  len,
in_addr_t  src,
uint16_t  src_port,
in_addr_t  dest,
uint16_t  dest_port 
)

Definition at line 168 of file proto_handler.cc.

void ProtoHandler::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 
)

Definition at line 206 of file proto_handler.cc.

Here is the call graph for this function:

void ProtoHandler::UdpHdr ( uint16_t  len,
const uint8_t *  src,
uint16_t  src_port,
const uint8_t *  dest,
uint16_t  dest_port,
uint8_t  next_hdr 
)

Definition at line 214 of file proto_handler.cc.

Here is the call graph for this function:

uint16_t ProtoHandler::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 
)

Definition at line 154 of file proto_handler.cc.

Here is the call graph for this function:

void ProtoHandler::VlanHdr ( uint8_t *  ptr,
uint16_t  tci 
)

Definition at line 97 of file proto_handler.cc.

Member Data Documentation

Agent* ProtoHandler::agent_
protected

Definition at line 91 of file proto_handler.h.

boost::asio::io_context& ProtoHandler::io_
protected

Definition at line 93 of file proto_handler.h.

boost::shared_ptr<PktInfo> ProtoHandler::pkt_info_
protected

Definition at line 92 of file proto_handler.h.


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