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

#include <dhcp_handler_base.h>

Inheritance diagram for DhcpHandlerBase:
Collaboration diagram for DhcpHandlerBase:

Classes

struct  ConfigRecord
 
struct  DhcpOptionHandler
 

Public Types

enum  DhcpOptionCategory {
  None, NoData, Bool, Byte,
  ByteArray, ByteString, ByteOneIPPlus, String,
  Int32bit, Uint32bit, Uint16bit, Uint16bitArray,
  OneIPv4, ZeroIPv4Plus, OneIPv4Plus, TwoIPv4Plus,
  OneIPv6, OneIPv6Plus, ClasslessRoute, NameCompression,
  NameCompressionArray, ByteNameCompression
}
 
enum  DhcpOptionLevel { Invalid, InterfaceLevel, SubnetLevel, IpamLevel }
 

Public Member Functions

 DhcpHandlerBase (Agent *agent, boost::shared_ptr< PktInfo > info, boost::asio::io_context &io)
 
virtual ~DhcpHandlerBase ()
 
- Public Member Functions inherited from ProtoHandler
 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 Member Functions

uint16_t AddNoDataOption (uint32_t option, uint16_t opt_len)
 
uint16_t AddByteOption (uint32_t option, uint16_t opt_len, const std::string &input)
 
uint16_t AddByteArrayOption (uint32_t option, uint16_t opt_len, const std::string &input)
 
uint16_t AddByteStringOption (uint32_t option, uint16_t opt_len, const std::string &input)
 
uint16_t AddByteIPOption (uint32_t option, uint16_t opt_len, const std::string &input)
 
uint16_t AddStringOption (uint32_t option, uint16_t opt_len, const std::string &input)
 
uint16_t AddIntegerOption (uint32_t option, uint16_t opt_len, const std::string &input)
 
uint16_t AddShortArrayOption (uint32_t option, uint16_t opt_len, const std::string &input, bool array)
 
bool IsValidIpOption (uint32_t option, const std::string &ipstr, bool is_v4)
 
bool IsValidDnsOption (uint32_t option, const std::string &ipstr)
 
uint16_t AddIpv4Option (uint32_t option, uint16_t opt_len, const std::string &input, uint8_t min_count, uint8_t max_count, uint8_t multiples)
 
uint16_t AddIpv6Option (uint32_t option, uint16_t opt_len, const std::string &input, bool list)
 
virtual uint16_t AddIP (uint16_t opt_len, const std::string &input)=0
 
uint16_t AddCompressedNameOption (uint32_t option, uint16_t opt_len, const std::string &input, bool list)
 
uint16_t AddByteCompressedNameOption (uint32_t option, uint16_t opt_len, const std::string &input)
 
uint16_t AddCompressedName (uint16_t opt_len, const std::string &input)
 
uint16_t AddDnsServers (uint16_t opt_len)
 
void ReadClasslessRoute (uint32_t option, uint16_t opt_len, const std::string &input)
 
uint16_t AddClasslessRouteOption (uint16_t opt_len)
 
uint16_t AddConfigDhcpOptions (uint16_t opt_len, bool is_v6)
 
uint16_t AddDhcpOptions (uint16_t opt_len, std::vector< autogen::DhcpOptionType > &options, DhcpOptionLevel level)
 
void FindDomainName (const IpAddress &vm_addr)
 
bool CanOverrideWithBytes (DhcpOptionCategory category)
 
virtual void DhcpTrace (const std::string &msg) const =0
 
virtual DhcpOptionCategory OptionCategory (uint32_t option) const =0
 
virtual uint32_t OptionCode (const std::string &option) const =0
 
bool is_flag_set (uint8_t flag) const
 
void set_flag (uint8_t flag)
 
bool is_dns_enabled () const
 
 DISALLOW_COPY_AND_ASSIGN (DhcpHandlerBase)
 

Protected Attributes

VmInterfacevm_itf_
 
uint32_t vm_itf_index_
 
ConfigRecord config_
 
boost::scoped_ptr
< DhcpOptionHandler
option_
 
std::bitset< 256 > flags_
 
bool dns_enable_
 
std::string routers_
 
std::vector
< OperDhcpOptions::HostRoute
host_routes_
 
DhcpOptionLevel host_routes_level_
 
std::string ipam_name_
 
autogen::IpamType ipam_type_
 
autogen::VirtualDnsType vdns_type_
 
uint32_t siaddr_tftp_
 
- Protected Attributes inherited from ProtoHandler
Agentagent_
 
boost::shared_ptr< PktInfopkt_info_
 
boost::asio::io_context & io_
 

Detailed Description

Definition at line 20 of file dhcp_handler_base.h.

Member Enumeration Documentation

Enumerator
None 
NoData 
Bool 
Byte 
ByteArray 
ByteString 
ByteOneIPPlus 
String 
Int32bit 
Uint32bit 
Uint16bit 
Uint16bitArray 
OneIPv4 
ZeroIPv4Plus 
OneIPv4Plus 
TwoIPv4Plus 
OneIPv6 
OneIPv6Plus 
ClasslessRoute 
NameCompression 
NameCompressionArray 
ByteNameCompression 

Definition at line 22 of file dhcp_handler_base.h.

Enumerator
Invalid 
InterfaceLevel 
SubnetLevel 
IpamLevel 

Definition at line 47 of file dhcp_handler_base.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file dhcp_handler_base.cc.

DhcpHandlerBase::~DhcpHandlerBase ( )
virtual

Definition at line 32 of file dhcp_handler_base.cc.

Member Function Documentation

uint16_t DhcpHandlerBase::AddByteArrayOption ( uint32_t  option,
uint16_t  opt_len,
const std::string &  input 
)
protected

Definition at line 58 of file dhcp_handler_base.cc.

uint16_t DhcpHandlerBase::AddByteCompressedNameOption ( uint32_t  option,
uint16_t  opt_len,
const std::string &  input 
)
protected

Definition at line 330 of file dhcp_handler_base.cc.

Here is the call graph for this function:

uint16_t DhcpHandlerBase::AddByteIPOption ( uint32_t  option,
uint16_t  opt_len,
const std::string &  input 
)
protected

Definition at line 106 of file dhcp_handler_base.cc.

Here is the call graph for this function:

uint16_t DhcpHandlerBase::AddByteOption ( uint32_t  option,
uint16_t  opt_len,
const std::string &  input 
)
protected

Definition at line 42 of file dhcp_handler_base.cc.

uint16_t DhcpHandlerBase::AddByteStringOption ( uint32_t  option,
uint16_t  opt_len,
const std::string &  input 
)
protected

Definition at line 85 of file dhcp_handler_base.cc.

uint16_t DhcpHandlerBase::AddClasslessRouteOption ( uint16_t  opt_len)
protected

Definition at line 421 of file dhcp_handler_base.cc.

Here is the call graph for this function:

uint16_t DhcpHandlerBase::AddCompressedName ( uint16_t  opt_len,
const std::string &  input 
)
protected

Definition at line 357 of file dhcp_handler_base.cc.

Here is the call graph for this function:

uint16_t DhcpHandlerBase::AddCompressedNameOption ( uint32_t  option,
uint16_t  opt_len,
const std::string &  input,
bool  list 
)
protected

Definition at line 305 of file dhcp_handler_base.cc.

Here is the call graph for this function:

uint16_t DhcpHandlerBase::AddConfigDhcpOptions ( uint16_t  opt_len,
bool  is_v6 
)
protected

Definition at line 682 of file dhcp_handler_base.cc.

Here is the call graph for this function:

uint16_t DhcpHandlerBase::AddDhcpOptions ( uint16_t  opt_len,
std::vector< autogen::DhcpOptionType > &  options,
DhcpOptionLevel  level 
)
protected

Definition at line 506 of file dhcp_handler_base.cc.

Here is the call graph for this function:

uint16_t DhcpHandlerBase::AddDnsServers ( uint16_t  opt_len)
protected

Definition at line 368 of file dhcp_handler_base.cc.

Here is the call graph for this function:

uint16_t DhcpHandlerBase::AddIntegerOption ( uint32_t  option,
uint16_t  opt_len,
const std::string &  input 
)
protected

Definition at line 144 of file dhcp_handler_base.cc.

virtual uint16_t DhcpHandlerBase::AddIP ( uint16_t  opt_len,
const std::string &  input 
)
protectedpure virtual

Implemented in DhcpHandler, and Dhcpv6Handler.

uint16_t DhcpHandlerBase::AddIpv4Option ( uint32_t  option,
uint16_t  opt_len,
const std::string &  input,
uint8_t  min_count,
uint8_t  max_count,
uint8_t  multiples 
)
protected

Definition at line 232 of file dhcp_handler_base.cc.

Here is the call graph for this function:

uint16_t DhcpHandlerBase::AddIpv6Option ( uint32_t  option,
uint16_t  opt_len,
const std::string &  input,
bool  list 
)
protected

Definition at line 280 of file dhcp_handler_base.cc.

Here is the call graph for this function:

uint16_t DhcpHandlerBase::AddNoDataOption ( uint32_t  option,
uint16_t  opt_len 
)
protected

Definition at line 36 of file dhcp_handler_base.cc.

uint16_t DhcpHandlerBase::AddShortArrayOption ( uint32_t  option,
uint16_t  opt_len,
const std::string &  input,
bool  array 
)
protected

Definition at line 160 of file dhcp_handler_base.cc.

uint16_t DhcpHandlerBase::AddStringOption ( uint32_t  option,
uint16_t  opt_len,
const std::string &  input 
)
protected

Definition at line 137 of file dhcp_handler_base.cc.

bool DhcpHandlerBase::CanOverrideWithBytes ( DhcpOptionCategory  category)
protected

Definition at line 734 of file dhcp_handler_base.cc.

virtual void DhcpHandlerBase::DhcpTrace ( const std::string &  msg) const
protectedpure virtual

Implemented in DhcpHandler, and Dhcpv6Handler.

DhcpHandlerBase::DISALLOW_COPY_AND_ASSIGN ( DhcpHandlerBase  )
protected
void DhcpHandlerBase::FindDomainName ( const IpAddress vm_addr)
protected

Definition at line 696 of file dhcp_handler_base.cc.

Here is the call graph for this function:

bool DhcpHandlerBase::is_dns_enabled ( ) const
inlineprotected

Definition at line 139 of file dhcp_handler_base.h.

bool DhcpHandlerBase::is_flag_set ( uint8_t  flag) const
inlineprotected

Definition at line 137 of file dhcp_handler_base.h.

bool DhcpHandlerBase::IsValidDnsOption ( uint32_t  option,
const std::string &  ipstr 
)
protected

Definition at line 212 of file dhcp_handler_base.cc.

Here is the call graph for this function:

bool DhcpHandlerBase::IsValidIpOption ( uint32_t  option,
const std::string &  ipstr,
bool  is_v4 
)
protected

Definition at line 185 of file dhcp_handler_base.cc.

Here is the call graph for this function:

virtual DhcpOptionCategory DhcpHandlerBase::OptionCategory ( uint32_t  option) const
protectedpure virtual

Implemented in DhcpHandler, and Dhcpv6Handler.

virtual uint32_t DhcpHandlerBase::OptionCode ( const std::string &  option) const
protectedpure virtual

Implemented in DhcpHandler, and Dhcpv6Handler.

void DhcpHandlerBase::ReadClasslessRoute ( uint32_t  option,
uint16_t  opt_len,
const std::string &  input 
)
protected

Definition at line 388 of file dhcp_handler_base.cc.

Here is the call graph for this function:

void DhcpHandlerBase::set_flag ( uint8_t  flag)
inlineprotected

Definition at line 138 of file dhcp_handler_base.h.

Member Data Documentation

ConfigRecord DhcpHandlerBase::config_
protected

Definition at line 143 of file dhcp_handler_base.h.

bool DhcpHandlerBase::dns_enable_
protected

Definition at line 149 of file dhcp_handler_base.h.

std::bitset<256> DhcpHandlerBase::flags_
protected

Definition at line 147 of file dhcp_handler_base.h.

std::vector<OperDhcpOptions::HostRoute> DhcpHandlerBase::host_routes_
protected

Definition at line 155 of file dhcp_handler_base.h.

DhcpOptionLevel DhcpHandlerBase::host_routes_level_
protected

Definition at line 156 of file dhcp_handler_base.h.

std::string DhcpHandlerBase::ipam_name_
protected

Definition at line 158 of file dhcp_handler_base.h.

autogen::IpamType DhcpHandlerBase::ipam_type_
protected

Definition at line 159 of file dhcp_handler_base.h.

boost::scoped_ptr<DhcpOptionHandler> DhcpHandlerBase::option_
protected

Definition at line 144 of file dhcp_handler_base.h.

std::string DhcpHandlerBase::routers_
protected

Definition at line 152 of file dhcp_handler_base.h.

uint32_t DhcpHandlerBase::siaddr_tftp_
protected

Definition at line 163 of file dhcp_handler_base.h.

autogen::VirtualDnsType DhcpHandlerBase::vdns_type_
protected

Definition at line 160 of file dhcp_handler_base.h.

VmInterface* DhcpHandlerBase::vm_itf_
protected

Definition at line 141 of file dhcp_handler_base.h.

uint32_t DhcpHandlerBase::vm_itf_index_
protected

Definition at line 142 of file dhcp_handler_base.h.


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