All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
CARPProxy Class Reference

Sirius ARP IPV4 class. More...

#include <arp-proxy.h>

Collaboration diagram for CARPProxy:
Collaboration graph

Classes

struct  TARPEvent
 Define the event events the ARP class generates when calling the ARP callback function void (*PTCallBack)(TARPEvent *, void *) More...
 
struct  TIPVLAN
 

Public Types

enum  EARPEvent { TIMEOUT, ARPCONFLICT, INVALIDMAC }
 Enumerate the different event types the ARP class generates when calling the ARP callback function void (*PTCallBack)(TARPEvent *, void *) More...
 
typedef void(* PTCallBack )(TARPEvent *, void *)
 

Public Member Functions

 CARPProxy ()
 
void InitARP (uint32_t ui32PortNr, uint16_t ui16NrOfArpEntries, uint16_t m_ui16NrOfVlans, CCoremask *pcCoremask, PTCallBack pCallBack=NULL, void *pArg=NULL, bool bUseATOMIC_LOCK=false)
 
void ShutdownARP (void)
 
uint64_t GetARP (uint32_t ui32DestIP, uint32_t ui32SrcIP, bool bSendARPRequest, uint16_t &ui16VLAN, int *piIndex=NULL)
 
uint64_t GetARP (uint32_t ui32DestIP, uint32_t ui32SrcIP, int &iEntryIndex, bool bSendARPRequest, uint16_t &ui16VLAN, bool bPersistent=false)
 
uint64_t GetMAC (void)
 
bool PacketInput (cvmx_wqe_t *ptWQE)
 
bool ARPTiming (void)
 
bool LastQueryTimeUpdate (int iIndex)
 
bool AddIPAddress (uint32_t ui32IP, uint32_t ui32GateWay, uint32_t ui32NetMask, uint16_t ui16VLAN)
 
bool GetIPAddress (int iIndex, TIPVLAN *ptIpVlan)
 
bool RemoveIPAddress (uint32_t ui32IP, uint16_t ui16VLAN)
 
uint32_t SearchForIPInVLAN (uint16_t ui16VLAN, uint32_t ui32IP)
 
bool SearchForVLANInIP (uint32_t ui32IP, uint16_t *pui16VLAN, uint32_t *pui32Netmask, uint32_t *pui32Gateway)
 
bool SearchForBestMatchInIP (uint32_t ui32IP, uint16_t *pui16VLAN, uint32_t *pui32IP, uint32_t *pui32Netmask, uint32_t *pui32Gateway)
 
void ResetARPTable ()
 
void ModifyArpTimeout (uint16_t ui16InUseSeconds, uint16_t ui16UnusedSeconds)
 
void RemoveAllIPAddresses ()
 
int GetPortNr ()
 
int GetAndAddNrOfHashEntries (int iIncrement)
 
void DisplayArpStats (void)
 

Static Public Member Functions

static const charARPEventToString (EARPEvent eARPEvent)
 
static uint16_t ip_sum_calc (uint16_t len_ip_header, unsigned char *buff, uint16_t ui16ChecksumPos=10)
 

Detailed Description

Sirius ARP IPV4 class.

This class contains functions for handling ARP on all ports

Definition at line 21 of file arp-proxy.h.

Member Typedef Documentation

typedef void(* CARPProxy::PTCallBack)(TARPEvent *, void *)

Definition at line 64 of file arp-proxy.h.

Member Enumeration Documentation

Enumerate the different event types the ARP class generates when calling the ARP callback function void (*PTCallBack)(TARPEvent *, void *)

Enumerator
TIMEOUT 

No reply op ARP Request.

ARPCONFLICT 

our ip address is in use by somebody else

INVALIDMAC 

Received an ARP Reply with dest mac that is not our own.

Definition at line 25 of file arp-proxy.h.

Constructor & Destructor Documentation

CARPProxy::CARPProxy ( )

Member Function Documentation

bool CARPProxy::AddIPAddress ( uint32_t  ui32IP,
uint32_t  ui32GateWay,
uint32_t  ui32NetMask,
uint16_t  ui16VLAN 
)
static const char* CARPProxy::ARPEventToString ( EARPEvent  eARPEvent)
inlinestatic

Definition at line 32 of file arp-proxy.h.

bool CARPProxy::ARPTiming ( void  )
void CARPProxy::DisplayArpStats ( void  )
int CARPProxy::GetAndAddNrOfHashEntries ( int  iIncrement)
uint64_t CARPProxy::GetARP ( uint32_t  ui32DestIP,
uint32_t  ui32SrcIP,
bool  bSendARPRequest,
uint16_t &  ui16VLAN,
int *  piIndex = NULL 
)
uint64_t CARPProxy::GetARP ( uint32_t  ui32DestIP,
uint32_t  ui32SrcIP,
int &  iEntryIndex,
bool  bSendARPRequest,
uint16_t &  ui16VLAN,
bool  bPersistent = false 
)
bool CARPProxy::GetIPAddress ( int  iIndex,
TIPVLAN ptIpVlan 
)
uint64_t CARPProxy::GetMAC ( void  )
int CARPProxy::GetPortNr ( )
void CARPProxy::InitARP ( uint32_t  ui32PortNr,
uint16_t  ui16NrOfArpEntries,
uint16_t  m_ui16NrOfVlans,
CCoremask pcCoremask,
PTCallBack  pCallBack = NULL,
void *  pArg = NULL,
bool  bUseATOMIC_LOCK = false 
)
static uint16_t CARPProxy::ip_sum_calc ( uint16_t  len_ip_header,
unsigned char buff,
uint16_t  ui16ChecksumPos = 10 
)
static
bool CARPProxy::LastQueryTimeUpdate ( int  iIndex)
void CARPProxy::ModifyArpTimeout ( uint16_t  ui16InUseSeconds,
uint16_t  ui16UnusedSeconds 
)
bool CARPProxy::PacketInput ( cvmx_wqe_t *  ptWQE)
void CARPProxy::RemoveAllIPAddresses ( )
bool CARPProxy::RemoveIPAddress ( uint32_t  ui32IP,
uint16_t  ui16VLAN 
)
void CARPProxy::ResetARPTable ( )
bool CARPProxy::SearchForBestMatchInIP ( uint32_t  ui32IP,
uint16_t *  pui16VLAN,
uint32_t pui32IP,
uint32_t pui32Netmask,
uint32_t pui32Gateway 
)
uint32_t CARPProxy::SearchForIPInVLAN ( uint16_t  ui16VLAN,
uint32_t  ui32IP 
)
bool CARPProxy::SearchForVLANInIP ( uint32_t  ui32IP,
uint16_t *  pui16VLAN,
uint32_t pui32Netmask,
uint32_t pui32Gateway 
)
void CARPProxy::ShutdownARP ( void  )

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