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

#include <vnswif_listener.h>

Inheritance diagram for VnswInterfaceListenerLinux:
Collaboration diagram for VnswInterfaceListenerLinux:

Public Member Functions

 VnswInterfaceListenerLinux (Agent *agent)
 
virtual ~VnswInterfaceListenerLinux ()
 
- Public Member Functions inherited from VnswInterfaceListenerBaseNix
 VnswInterfaceListenerBaseNix (Agent *agent)
 
virtual ~VnswInterfaceListenerBaseNix ()
 
void Init ()
 
void Shutdown ()
 
virtual void UpdateLinkLocalRouteAndCount (const Ip4Address &addr, uint8_t plen, bool del_rt)
 
- Public Member Functions inherited from VnswInterfaceListenerBase
bool AddIpam (const Ip4Address &ip, uint8_t plen)
 
bool DelIpam (const Ip4Address &ip, uint8_t plen)
 
Agentagent ()
 
 VnswInterfaceListenerBase (Agent *agent)
 
virtual ~VnswInterfaceListenerBase ()
 
void Init ()
 
void Shutdown ()
 
bool IsValidLinkLocalAddress (const Ip4Address &addr) const
 
void Enqueue (Event *event)
 
uint32_t GetHostInterfaceCount () const
 
HostInterfaceEntryGetHostInterfaceEntry (const std::string &name)
 
uint32_t vhost_update_count () const
 
uint32_t ll_add_count () const
 
uint32_t ll_del_count () const
 
bool IsHostLinkStateUp (const std::string &name) const
 

Private Member Functions

int CreateSocket ()
 
virtual void SyncCurrentState ()
 
virtual void RegisterAsyncReadHandler ()
 
void ReadHandler (const boost::system::error_code &, std::size_t length)
 
void UpdateLinkLocalRoute (const Ip4Address &addr, uint8_t plen, bool del_rt)
 
void InitNetlinkScan (uint32_t type, uint32_t seqno)
 
int NlMsgDecode (struct nlmsghdr *nl, std::size_t len, uint32_t seq_no)
 
bool ProcessEvent (Event *re)
 
int AddAttr (uint8_t *, int, void *, int)
 
string NetlinkTypeToString (uint32_t)
 
EventHandleNetlinkRouteMsg (struct nlmsghdr *)
 
EventHandleNetlinkIntfMsg (struct nlmsghdr *)
 
EventHandleNetlinkAddrMsg (struct nlmsghdr *)
 
 DISALLOW_COPY_AND_ASSIGN (VnswInterfaceListenerLinux)
 

Friends

class TestVnswIf
 

Additional Inherited Members

- Public Types inherited from VnswInterfaceListenerBase
enum  bond_intf_type { VR_FABRIC = 1, VR_BOND_SLAVES }
 
- Static Public Attributes inherited from VnswInterfaceListenerBase
static const int kVnswRtmProto = 109
 
static const uint32_t kMaxBufferSize = 4096
 
- Protected Types inherited from VnswInterfaceListenerBase
typedef std::map< std::string,
HostInterfaceEntry * > 
HostInterfaceTable
 
typedef std::set< Ip4AddressLinkLocalAddressTable
 
typedef std::map< IpSubnet,
uint32_t > 
IpamSubnetMap
 
- Protected Member Functions inherited from VnswInterfaceListenerBase
void InterfaceNotify (DBTablePartBase *part, DBEntryBase *e)
 
void FabricRouteNotify (DBTablePartBase *part, DBEntryBase *e)
 
void VnNotify (DBTablePartBase *part, DBEntryBase *e)
 
bool ProcessEvent (Event *re)
 
void LinkLocalRouteFromLinkLocalEvent (Event *event)
 
void LinkLocalRouteFromRouteEvent (Event *event)
 
void AddLinkLocalRoutes ()
 
void DelLinkLocalRoutes ()
 
void AddIpamRoutes ()
 
void SetSeen (const std::string &name, bool oper, uint32_t oper_idx)
 
void ResetSeen (const std::string &name, bool oper)
 
void Activate (const std::string &name, const HostInterfaceEntry *entry)
 
void DeActivate (const std::string &name, const HostInterfaceEntry *entry)
 
void SetLinkState (const std::string &name, bool link_up)
 
bool IsInterfaceActive (const HostInterfaceEntry *entry)
 
void HandleInterfaceEvent (const Event *event)
 
void SetAddress (const Event *event)
 
void ResetAddress (const Event *event)
 
void HandleAddressEvent (const Event *event)
 
 DISALLOW_COPY_AND_ASSIGN (VnswInterfaceListenerBase)
 
- Protected Attributes inherited from VnswInterfaceListenerBaseNix
int sock_fd_
 
local::datagram_protocol::socket sock_
 
- Protected Attributes inherited from VnswInterfaceListenerBase
Agentagent_
 
uint8_t * read_buf_
 
uint8_t tx_buf_ [kMaxBufferSize]
 
DBTableBase::ListenerId intf_listener_id_
 
DBTableBase::ListenerId fabric_listener_id_
 
DBTableBase::ListenerId vn_listener_id_
 
int seqno_
 
bool vhost_intf_up_
 
LinkLocalAddressTable ll_addr_table_
 
HostInterfaceTable host_interface_table_
 
WorkQueue< Event * > * revent_queue_
 
uint32_t vhost_update_count_
 
uint32_t ll_add_count_
 
uint32_t ll_del_count_
 
IpamSubnetMap ipam_subnet_
 

Detailed Description

Definition at line 16 of file vnswif_listener.h.

Constructor & Destructor Documentation

VnswInterfaceListenerLinux::VnswInterfaceListenerLinux ( Agent agent)

Definition at line 23 of file vnswif_listener.cc.

VnswInterfaceListenerLinux::~VnswInterfaceListenerLinux ( )
virtual

Definition at line 27 of file vnswif_listener.cc.

Member Function Documentation

int VnswInterfaceListenerLinux::AddAttr ( uint8_t *  buff,
int  type,
void *  data,
int  alen 
)
private

Definition at line 140 of file vnswif_listener.cc.

int VnswInterfaceListenerLinux::CreateSocket ( )
privatevirtual

Implements VnswInterfaceListenerBaseNix.

Definition at line 29 of file vnswif_listener.cc.

Here is the call graph for this function:

VnswInterfaceListenerLinux::DISALLOW_COPY_AND_ASSIGN ( VnswInterfaceListenerLinux  )
private
VnswInterfaceListenerBase::Event * VnswInterfaceListenerLinux::HandleNetlinkAddrMsg ( struct nlmsghdr *  nlh)
private

Definition at line 316 of file vnswif_listener.cc.

Here is the call graph for this function:

VnswInterfaceListenerBase::Event * VnswInterfaceListenerLinux::HandleNetlinkIntfMsg ( struct nlmsghdr *  nlh)
private

Definition at line 286 of file vnswif_listener.cc.

Here is the call graph for this function:

VnswInterfaceListenerBase::Event * VnswInterfaceListenerLinux::HandleNetlinkRouteMsg ( struct nlmsghdr *  nlh)
private

Definition at line 225 of file vnswif_listener.cc.

Here is the call graph for this function:

void VnswInterfaceListenerLinux::InitNetlinkScan ( uint32_t  type,
uint32_t  seqno 
)
private

Definition at line 69 of file vnswif_listener.cc.

Here is the call graph for this function:

string VnswInterfaceListenerLinux::NetlinkTypeToString ( uint32_t  type)
private

Definition at line 200 of file vnswif_listener.cc.

int VnswInterfaceListenerLinux::NlMsgDecode ( struct nlmsghdr *  nl,
std::size_t  len,
uint32_t  seq_no 
)
private

Definition at line 351 of file vnswif_listener.cc.

Here is the call graph for this function:

bool VnswInterfaceListenerLinux::ProcessEvent ( Event re)
private
void VnswInterfaceListenerLinux::ReadHandler ( const boost::system::error_code &  error,
std::size_t  length 
)
private

Definition at line 117 of file vnswif_listener.cc.

Here is the call graph for this function:

void VnswInterfaceListenerLinux::RegisterAsyncReadHandler ( )
privatevirtual

Implements VnswInterfaceListenerBaseNix.

Definition at line 108 of file vnswif_listener.cc.

Here is the call graph for this function:

void VnswInterfaceListenerLinux::SyncCurrentState ( )
privatevirtual

Implements VnswInterfaceListenerBaseNix.

Definition at line 54 of file vnswif_listener.cc.

Here is the call graph for this function:

void VnswInterfaceListenerLinux::UpdateLinkLocalRoute ( const Ip4Address addr,
uint8_t  plen,
bool  del_rt 
)
privatevirtual

Implements VnswInterfaceListenerBaseNix.

Definition at line 155 of file vnswif_listener.cc.

Here is the call graph for this function:

Friends And Related Function Documentation

friend class TestVnswIf
friend

Definition at line 23 of file vnswif_listener.h.


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