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

#include <arp_proto.h>

Inheritance diagram for ArpProto:
Collaboration diagram for ArpProto:

Classes

struct  ArpIpc
 
struct  ArpStats
 
struct  InterfaceArpInfo
 

Public Types

enum  ArpMsgType {
  ARP_RESOLVE, ARP_DELETE, ARP_SEND_GRATUITOUS, RETRY_TIMER_EXPIRED,
  AGING_TIMER_EXPIRED, GRATUITOUS_TIMER_EXPIRED
}
 
typedef std::map< ArpKey,
ArpEntry * > 
ArpCache
 
typedef std::pair< ArpKey,
ArpEntry * > 
ArpCachePair
 
typedef std::map< ArpKey,
ArpEntry * >::iterator 
ArpIterator
 
typedef std::set< ArpKeyArpKeySet
 
typedef std::set< ArpEntry * > ArpEntrySet
 
typedef std::map< ArpKey,
ArpEntrySet
GratuitousArpCache
 
typedef std::pair< ArpKey,
ArpEntrySet
GratuitousArpCachePair
 
typedef std::map< ArpKey,
ArpEntrySet >::iterator 
GratuitousArpIterator
 
typedef std::map< uint32_t,
InterfaceArpInfo
InterfaceArpMap
 
typedef std::pair< uint32_t,
InterfaceArpInfo
InterfaceArpPair
 
- Public Types inherited from Proto
typedef WorkQueue
< boost::shared_ptr< PktInfo > > 
ProtoWorkQueue
 

Public Member Functions

void Shutdown ()
 
 ArpProto (Agent *agent, boost::asio::io_context &io, bool run_with_vrouter)
 
virtual ~ArpProto ()
 
ProtoHandlerAllocProtoHandler (boost::shared_ptr< PktInfo > info, boost::asio::io_context &io)
 
bool TimerExpiry (ArpKey &key, uint32_t timer_type, const Interface *itf)
 
bool AddArpEntry (ArpEntry *entry)
 
bool DeleteArpEntry (ArpEntry *entry)
 
ArpEntryFindArpEntry (const ArpKey &key)
 
std::size_t GetArpCacheSize ()
 
const ArpCachearp_cache ()
 
const GratuitousArpCachegratuitous_arp_cache ()
 
const InterfaceArpMapinterface_arp_map ()
 
Interfaceip_fabric_interface () const
 
uint32_t ip_fabric_interface_index () const
 
const MacAddressip_fabric_interface_mac () const
 
void set_ip_fabric_interface (Interface *itf)
 
void set_ip_fabric_interface_index (uint32_t ind)
 
void set_ip_fabric_interface_mac (const MacAddress &mac)
 
void AddGratuitousArpEntry (ArpKey &key)
 
void DeleteGratuitousArpEntry (ArpEntry *entry)
 
ArpEntryGratuitousArpEntry (const ArpKey &key, const Interface *intf)
 
ArpProto::GratuitousArpIterator GratuitousArpEntryIterator (const ArpKey &key, bool *key_valid)
 
void IncrementStatsArpReq ()
 
void IncrementStatsArpReplies ()
 
void IncrementStatsGratuitous ()
 
void IncrementStatsResolved ()
 
void IncrementStatsMaxRetries ()
 
void IncrementStatsErrors ()
 
void IncrementStatsVmGarpReq ()
 
void IncrementStatsVmArpReq ()
 
void IncrementStatsInvalidPackets ()
 
void IncrementStatsInvalidInterface ()
 
void IncrementStatsInvalidVrf ()
 
void IncrementStatsInvalidAddress ()
 
void IncrementStatsIPFabricNotInst ()
 
const ArpStatsGetStats () const
 
void ClearStats ()
 
void IncrementStatsArpRequest (uint32_t idx)
 
void IncrementStatsArpReply (uint32_t idx)
 
void IncrementStatsResolved (uint32_t idx)
 
InterfaceArpInfoArpMapIndexToEntry (uint32_t idx)
 
uint32_t ArpRequestStatsCounter (uint32_t idx)
 
uint32_t ArpReplyStatsCounter (uint32_t idx)
 
uint32_t ArpResolvedStatsCounter (uint32_t idx)
 
void ClearInterfaceArpStats (uint32_t idx)
 
uint16_t max_retries () const
 
uint32_t retry_timeout () const
 
uint32_t aging_timeout () const
 
void set_max_retries (uint16_t retries)
 
void set_retry_timeout (uint32_t timeout)
 
void set_aging_timeout (uint32_t timeout)
 
void SendArpIpc (ArpProto::ArpMsgType type, in_addr_t ip, const VrfEntry *vrf, InterfaceConstRef itf)
 
bool ValidateAndClearVrfState (VrfEntry *vrf, const ArpVrfState *vrf_state)
 
ArpIterator FindUpperBoundArpEntry (const ArpKey &key)
 
ArpIterator FindLowerBoundArpEntry (const ArpKey &key)
 
void HandlePathPreferenceArpReply (const VrfEntry *vrf, uint32_t itf, Ip4Address sip)
 
DBTableBase::ListenerId vrf_table_listener_id () const
 
DBTableBase::ListenerId interface_table_listener_id () const
 
- Public Member Functions inherited from Proto
 Proto (Agent *agent, const char *task_name, PktHandler::PktModuleName mod, boost::asio::io_context &io)
 
virtual ~Proto ()
 
virtual bool Validate (PktInfo *msg)
 
virtual bool Enqueue (boost::shared_ptr< PktInfo > msg)
 
virtual void ProcessStats (PktStatsType::Type type)
 
void FreeBuffer (PktInfo *msg)
 
bool ProcessProto (boost::shared_ptr< PktInfo > msg_info)
 
bool RunProtoHandler (ProtoHandler *handler)
 
void set_trace (bool val)
 
void set_free_buffer (bool val)
 
boost::asio::io_context & get_io_service () const
 
Agentagent () const
 
const ProtoWorkQueuework_queue () const
 
virtual void TokenAvailable (TokenPool *pool)
 

Static Public Attributes

static const uint16_t kGratRetries = 2
 
static const uint16_t kMaxFailures = 3
 
static const uint32_t kGratRetryTimeout = 2000
 
static const uint16_t kMaxRetries = 8
 
static const uint32_t kRetryTimeout = 2000
 
static const uint32_t kAgingTimeout = (5 * 60 * 1000)
 

Private Member Functions

void VrfNotify (DBTablePartBase *part, DBEntryBase *entry)
 
void NextHopNotify (DBEntryBase *entry)
 
void InterfaceNotify (DBEntryBase *entry)
 
void SendArpIpc (ArpProto::ArpMsgType type, ArpKey &key, InterfaceConstRef itf)
 
ArpProto::ArpIterator DeleteArpEntry (ArpProto::ArpIterator iter)
 
 DISALLOW_COPY_AND_ASSIGN (ArpProto)
 

Private Attributes

ArpCache arp_cache_
 
ArpStats arp_stats_
 
GratuitousArpCache gratuitous_arp_cache_
 
bool run_with_vrouter_
 
uint32_t ip_fabric_interface_index_
 
MacAddress ip_fabric_interface_mac_
 
Interfaceip_fabric_interface_
 
DBTableBase::ListenerId vrf_table_listener_id_
 
DBTableBase::ListenerId interface_table_listener_id_
 
DBTableBase::ListenerId nexthop_table_listener_id_
 
InterfaceArpMap interface_arp_map_
 
uint16_t max_retries_
 
uint32_t retry_timeout_
 
uint32_t aging_timeout_
 

Additional Inherited Members

- Protected Attributes inherited from Proto
Agentagent_
 
PktHandler::PktModuleName module_
 
bool trace_
 
bool free_buffer_
 
boost::asio::io_context & io_
 
ProtoWorkQueue work_queue_
 

Detailed Description

Definition at line 19 of file arp_proto.h.

Member Typedef Documentation

typedef std::map<ArpKey, ArpEntry *> ArpProto::ArpCache

Definition at line 28 of file arp_proto.h.

typedef std::pair<ArpKey, ArpEntry *> ArpProto::ArpCachePair

Definition at line 29 of file arp_proto.h.

typedef std::set<ArpEntry *> ArpProto::ArpEntrySet

Definition at line 32 of file arp_proto.h.

typedef std::map<ArpKey, ArpEntry *>::iterator ArpProto::ArpIterator

Definition at line 30 of file arp_proto.h.

typedef std::set<ArpKey> ArpProto::ArpKeySet

Definition at line 31 of file arp_proto.h.

Definition at line 33 of file arp_proto.h.

Definition at line 34 of file arp_proto.h.

typedef std::map<ArpKey, ArpEntrySet>::iterator ArpProto::GratuitousArpIterator

Definition at line 35 of file arp_proto.h.

typedef std::map<uint32_t, InterfaceArpInfo> ArpProto::InterfaceArpMap

Definition at line 88 of file arp_proto.h.

typedef std::pair<uint32_t, InterfaceArpInfo> ArpProto::InterfaceArpPair

Definition at line 89 of file arp_proto.h.

Member Enumeration Documentation

Enumerator
ARP_RESOLVE 
ARP_DELETE 
ARP_SEND_GRATUITOUS 
RETRY_TIMER_EXPIRED 
AGING_TIMER_EXPIRED 
GRATUITOUS_TIMER_EXPIRED 

Definition at line 37 of file arp_proto.h.

Constructor & Destructor Documentation

ArpProto::ArpProto ( Agent agent,
boost::asio::io_context &  io,
bool  run_with_vrouter 
)

Definition at line 19 of file arp_proto.cc.

Here is the call graph for this function:

ArpProto::~ArpProto ( )
virtual

Definition at line 38 of file arp_proto.cc.

Member Function Documentation

bool ArpProto::AddArpEntry ( ArpEntry entry)

Definition at line 838 of file arp_proto.cc.

Here is the call graph for this function:

void ArpProto::AddGratuitousArpEntry ( ArpKey key)

Definition at line 771 of file arp_proto.cc.

uint32_t ArpProto::aging_timeout ( ) const
inline

Definition at line 168 of file arp_proto.h.

ProtoHandler * ArpProto::AllocProtoHandler ( boost::shared_ptr< PktInfo info,
boost::asio::io_context &  io 
)
virtual

Implements Proto.

Definition at line 62 of file arp_proto.cc.

Here is the call graph for this function:

const ArpCache& ArpProto::arp_cache ( )
inline

Definition at line 103 of file arp_proto.h.

ArpProto::InterfaceArpInfo & ArpProto::ArpMapIndexToEntry ( uint32_t  idx)

Definition at line 692 of file arp_proto.cc.

uint32_t ArpProto::ArpReplyStatsCounter ( uint32_t  idx)

Definition at line 724 of file arp_proto.cc.

Here is the call graph for this function:

uint32_t ArpProto::ArpRequestStatsCounter ( uint32_t  idx)

Definition at line 719 of file arp_proto.cc.

Here is the call graph for this function:

uint32_t ArpProto::ArpResolvedStatsCounter ( uint32_t  idx)

Definition at line 729 of file arp_proto.cc.

Here is the call graph for this function:

void ArpProto::ClearInterfaceArpStats ( uint32_t  idx)

Definition at line 734 of file arp_proto.cc.

Here is the call graph for this function:

void ArpProto::ClearStats ( )
inline

Definition at line 155 of file arp_proto.h.

Here is the call graph for this function:

bool ArpProto::DeleteArpEntry ( ArpEntry entry)

Definition at line 864 of file arp_proto.cc.

Here is the call graph for this function:

ArpProto::ArpIterator ArpProto::DeleteArpEntry ( ArpProto::ArpIterator  iter)
private

Definition at line 878 of file arp_proto.cc.

void ArpProto::DeleteGratuitousArpEntry ( ArpEntry entry)

Definition at line 776 of file arp_proto.cc.

Here is the call graph for this function:

ArpProto::DISALLOW_COPY_AND_ASSIGN ( ArpProto  )
private
ArpEntry * ArpProto::FindArpEntry ( const ArpKey key)

Definition at line 885 of file arp_proto.cc.

ArpProto::ArpIterator ArpProto::FindLowerBoundArpEntry ( const ArpKey key)

Definition at line 931 of file arp_proto.cc.

ArpProto::ArpIterator ArpProto::FindUpperBoundArpEntry ( const ArpKey key)

Definition at line 926 of file arp_proto.cc.

std::size_t ArpProto::GetArpCacheSize ( )
inline

Definition at line 102 of file arp_proto.h.

const ArpStats& ArpProto::GetStats ( ) const
inline

Definition at line 154 of file arp_proto.h.

const GratuitousArpCache& ArpProto::gratuitous_arp_cache ( )
inline

Definition at line 104 of file arp_proto.h.

ArpEntry * ArpProto::GratuitousArpEntry ( const ArpKey key,
const Interface intf 
)

Definition at line 793 of file arp_proto.cc.

Here is the call graph for this function:

ArpProto::GratuitousArpIterator ArpProto::GratuitousArpEntryIterator ( const ArpKey key,
bool *  key_valid 
)

Definition at line 809 of file arp_proto.cc.

Here is the call graph for this function:

void ArpProto::HandlePathPreferenceArpReply ( const VrfEntry vrf,
uint32_t  itf,
Ip4Address  sip 
)

Definition at line 954 of file arp_proto.cc.

Here is the call graph for this function:

void ArpProto::IncrementStatsArpReplies ( )
inline

Definition at line 128 of file arp_proto.h.

void ArpProto::IncrementStatsArpReply ( uint32_t  idx)

Definition at line 709 of file arp_proto.cc.

Here is the call graph for this function:

void ArpProto::IncrementStatsArpReq ( )
inline

Definition at line 127 of file arp_proto.h.

void ArpProto::IncrementStatsArpRequest ( uint32_t  idx)

Definition at line 704 of file arp_proto.cc.

Here is the call graph for this function:

void ArpProto::IncrementStatsErrors ( )
inline

Definition at line 132 of file arp_proto.h.

void ArpProto::IncrementStatsGratuitous ( )
inline

Definition at line 129 of file arp_proto.h.

void ArpProto::IncrementStatsInvalidAddress ( )
inline

Definition at line 147 of file arp_proto.h.

Here is the call graph for this function:

void ArpProto::IncrementStatsInvalidInterface ( )
inline

Definition at line 139 of file arp_proto.h.

Here is the call graph for this function:

void ArpProto::IncrementStatsInvalidPackets ( )
inline

Definition at line 135 of file arp_proto.h.

Here is the call graph for this function:

void ArpProto::IncrementStatsInvalidVrf ( )
inline

Definition at line 143 of file arp_proto.h.

Here is the call graph for this function:

void ArpProto::IncrementStatsIPFabricNotInst ( )
inline

Definition at line 152 of file arp_proto.h.

void ArpProto::IncrementStatsMaxRetries ( )
inline

Definition at line 131 of file arp_proto.h.

void ArpProto::IncrementStatsResolved ( )
inline

Definition at line 130 of file arp_proto.h.

void ArpProto::IncrementStatsResolved ( uint32_t  idx)

Definition at line 714 of file arp_proto.cc.

Here is the call graph for this function:

void ArpProto::IncrementStatsVmArpReq ( )
inline

Definition at line 134 of file arp_proto.h.

void ArpProto::IncrementStatsVmGarpReq ( )
inline

Definition at line 133 of file arp_proto.h.

const InterfaceArpMap& ArpProto::interface_arp_map ( )
inline

Definition at line 105 of file arp_proto.h.

DBTableBase::ListenerId ArpProto::interface_table_listener_id ( ) const
inline

Definition at line 183 of file arp_proto.h.

void ArpProto::InterfaceNotify ( DBEntryBase entry)
private

Definition at line 599 of file arp_proto.cc.

Here is the call graph for this function:

Interface* ArpProto::ip_fabric_interface ( ) const
inline

Definition at line 107 of file arp_proto.h.

uint32_t ArpProto::ip_fabric_interface_index ( ) const
inline

Definition at line 108 of file arp_proto.h.

const MacAddress& ArpProto::ip_fabric_interface_mac ( ) const
inline

Definition at line 111 of file arp_proto.h.

uint16_t ArpProto::max_retries ( ) const
inline

Definition at line 166 of file arp_proto.h.

void ArpProto::NextHopNotify ( DBEntryBase entry)
private

Definition at line 739 of file arp_proto.cc.

Here is the call graph for this function:

uint32_t ArpProto::retry_timeout ( ) const
inline

Definition at line 167 of file arp_proto.h.

void ArpProto::SendArpIpc ( ArpProto::ArpMsgType  type,
in_addr_t  ip,
const VrfEntry vrf,
InterfaceConstRef  itf 
)

Definition at line 826 of file arp_proto.cc.

Here is the call graph for this function:

void ArpProto::SendArpIpc ( ArpProto::ArpMsgType  type,
ArpKey key,
InterfaceConstRef  itf 
)
private

Definition at line 832 of file arp_proto.cc.

Here is the call graph for this function:

void ArpProto::set_aging_timeout ( uint32_t  timeout)
inline

Definition at line 171 of file arp_proto.h.

void ArpProto::set_ip_fabric_interface ( Interface itf)
inline

Definition at line 114 of file arp_proto.h.

void ArpProto::set_ip_fabric_interface_index ( uint32_t  ind)
inline

Definition at line 115 of file arp_proto.h.

void ArpProto::set_ip_fabric_interface_mac ( const MacAddress mac)
inline

Definition at line 118 of file arp_proto.h.

void ArpProto::set_max_retries ( uint16_t  retries)
inline

Definition at line 169 of file arp_proto.h.

void ArpProto::set_retry_timeout ( uint32_t  timeout)
inline

Definition at line 170 of file arp_proto.h.

void ArpProto::Shutdown ( )

Definition at line 41 of file arp_proto.cc.

Here is the call graph for this function:

bool ArpProto::TimerExpiry ( ArpKey key,
uint32_t  timer_type,
const Interface itf 
)

Definition at line 760 of file arp_proto.cc.

Here is the call graph for this function:

bool ArpProto::ValidateAndClearVrfState ( VrfEntry vrf,
const ArpVrfState vrf_state 
)

Definition at line 892 of file arp_proto.cc.

Here is the call graph for this function:

DBTableBase::ListenerId ArpProto::vrf_table_listener_id ( ) const
inline

Definition at line 180 of file arp_proto.h.

void ArpProto::VrfNotify ( DBTablePartBase part,
DBEntryBase entry 
)
private

Definition at line 67 of file arp_proto.cc.

Here is the call graph for this function:

Member Data Documentation

uint32_t ArpProto::aging_timeout_
private

Definition at line 208 of file arp_proto.h.

ArpCache ArpProto::arp_cache_
private

Definition at line 194 of file arp_proto.h.

ArpStats ArpProto::arp_stats_
private

Definition at line 195 of file arp_proto.h.

GratuitousArpCache ArpProto::gratuitous_arp_cache_
private

Definition at line 196 of file arp_proto.h.

InterfaceArpMap ArpProto::interface_arp_map_
private

Definition at line 204 of file arp_proto.h.

DBTableBase::ListenerId ArpProto::interface_table_listener_id_
private

Definition at line 202 of file arp_proto.h.

Interface* ArpProto::ip_fabric_interface_
private

Definition at line 200 of file arp_proto.h.

uint32_t ArpProto::ip_fabric_interface_index_
private

Definition at line 198 of file arp_proto.h.

MacAddress ArpProto::ip_fabric_interface_mac_
private

Definition at line 199 of file arp_proto.h.

const uint32_t ArpProto::kAgingTimeout = (5 * 60 * 1000)
static

Definition at line 26 of file arp_proto.h.

const uint16_t ArpProto::kGratRetries = 2
static

Definition at line 21 of file arp_proto.h.

const uint32_t ArpProto::kGratRetryTimeout = 2000
static

Definition at line 23 of file arp_proto.h.

const uint16_t ArpProto::kMaxFailures = 3
static

Definition at line 22 of file arp_proto.h.

const uint16_t ArpProto::kMaxRetries = 8
static

Definition at line 24 of file arp_proto.h.

const uint32_t ArpProto::kRetryTimeout = 2000
static

Definition at line 25 of file arp_proto.h.

uint16_t ArpProto::max_retries_
private

Definition at line 206 of file arp_proto.h.

DBTableBase::ListenerId ArpProto::nexthop_table_listener_id_
private

Definition at line 203 of file arp_proto.h.

uint32_t ArpProto::retry_timeout_
private

Definition at line 207 of file arp_proto.h.

bool ArpProto::run_with_vrouter_
private

Definition at line 197 of file arp_proto.h.

DBTableBase::ListenerId ArpProto::vrf_table_listener_id_
private

Definition at line 201 of file arp_proto.h.


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