OpenSDN source code
VxlanRoutingVrfMapper Class Reference

This class is a storage for operative state of VxLAN logical routers (LRs) defined via Config logical-router element. It stores: More...

#include <vxlan_routing_manager.h>

Collaboration diagram for VxlanRoutingVrfMapper:

Classes

struct  RoutedVrfInfo
 The structure holds information about virtual networks connected to a logical router (LR) More...
 

Public Types

typedef std::map< boost::uuids::uuid, RoutedVrfInfoLrVrfInfoMap
 A typedef to store map between Logical router UUID and RoutedVrfInfo. More...
 
typedef LrVrfInfoMap::iterator LrVrfInfoMapIter
 A typedef for iterator of LrVrfInfoMap. More...
 
typedef std::map< const VnEntry *, boost::uuids::uuidVnLrSet
 A typedef to store map between pointer to VirtualNetwork (a bridge or routing virtual network connected to some LR) and the LR's UUID. More...
 
typedef VnLrSet::iterator VnLrSetIter
 A typedef for iterator of VnLrSet. More...
 
typedef std::map< const InetUnicastAgentRouteTable *, DBTable::DBTableWalkRefInetTableWalker
 A typedef for a storage of all walkers on Inet tables, if needed the walk can be restarted instead of spawning new one for a table. More...
 

Public Member Functions

 VxlanRoutingVrfMapper (VxlanRoutingManager *mgr)
 Constructs a new instance of VxlanRoutingVrfMapper using the given pointer to VxlanRoutingManager. More...
 
virtual ~VxlanRoutingVrfMapper ()
 Destroys an instance of VxlanRoutingVrfMapper(). More...
 
void BridgeInet4RouteWalkDone (DBTable::DBTableWalkRef walk_ref, DBTableBase *partition)
 Handles completion of route walk in the Inet IPv4 table of a bridge VRF instance. More...
 
void BridgeInet6RouteWalkDone (DBTable::DBTableWalkRef walk_ref, DBTableBase *partition)
 Handles completion of route walk in an Inet IPv6 table of a bridge VRF instance. More...
 
void RoutingVrfRouteWalkDone (DBTable::DBTableWalkRef walk_ref, DBTableBase *partition)
 Handles completion of route walk in the EVPN table of a routing VRF instance. More...
 
void TryDeleteLogicalRouter (LrVrfInfoMapIter &it)
 Attempts to delete the given LR. More...
 
bool IsEmpty () const
 Determines whether object is empty or not. More...
 

Private Member Functions

void WalkBridgeVrfs (const RoutedVrfInfo &routing_vrf_info)
 Walks Inet tables of all bridge VRF instances connected to a LR (given in routing_vrf_info parameter). More...
 
void WalkRoutingVrf (const boost::uuids::uuid &lr_uuid, const VnEntry *vn, bool update, bool withdraw)
 Walks the EVPN table of the routing VRF instance of a given LR. More...
 
void WalkBridgeInetTables (InetUnicastAgentRouteTable *inet4, InetUnicastAgentRouteTable *inet6)
 Walks given Inet tables (IPv4 and IPv6). More...
 
const VrfEntryGetRoutingVrfUsingVn (const VnEntry *vn)
 Find the routing VRF instance using a given virtual network. More...
 
const VrfEntryGetRoutingVrfUsingAgentRoute (const AgentRoute *rt)
 Find the routing VRF instance using a given route (AgentRoute). More...
 
const VrfEntryGetRoutingVrfUsingUuid (const boost::uuids::uuid &lr_uuid)
 Find the routing VRF instance using a given LR UUID. More...
 
const boost::uuids::uuid GetLogicalRouterUuidUsingRoute (const AgentRoute *rt)
 Find the UUID of the LR using a given route (AgentRoute). More...
 
 DISALLOW_COPY_AND_ASSIGN (VxlanRoutingVrfMapper)
 

Private Attributes

VxlanRoutingManagermgr_
 A pointer to the VxlanRoutingManager instance. More...
 
LrVrfInfoMap lr_vrf_info_map_
 The map between Logical router UUID and RoutedVrfInfo. More...
 
VnLrSet vn_lr_set_
 The map between pointer to VirtualNetwork (a bridge or routing virtual network connected to some LR) and the LR's UUID. More...
 
InetTableWalker inet4_table_walker_
 The set of walkers for Inet IPv4 tables of bridge VRF instances. More...
 
InetTableWalker inet6_table_walker_
 The set of walkers for Inet IPv6 tables of bridge VRF instances. More...
 

Friends

class VxlanRoutingManager
 Allows access to private members for VxlanRoutingManager class. More...
 

Detailed Description

This class is a storage for operative state of VxLAN logical routers (LRs) defined via Config logical-router element. It stores:

  • a map between a virtual network (VnEntry*) and an LR's UUID, vn_lr_set_;
  • a map between an LR's UUID and virtual networks and VRF tables associated with the LR, lr_vrf_info_map_. Along with these it has a walker for traversing EVPN tables due to modification of an LR or associated elements configurative or operative state. (If multiple walks get scheduled for an EVPN table then they are collapsed and only one walk is done). For more information, refer to VxlanRoutingManager class.

Definition at line 266 of file vxlan_routing_manager.h.

Member Typedef Documentation

◆ InetTableWalker

A typedef for a storage of all walkers on Inet tables, if needed the walk can be restarted instead of spawning new one for a table.

Definition at line 330 of file vxlan_routing_manager.h.

◆ LrVrfInfoMap

A typedef to store map between Logical router UUID and RoutedVrfInfo.

Definition at line 313 of file vxlan_routing_manager.h.

◆ LrVrfInfoMapIter

typedef LrVrfInfoMap::iterator VxlanRoutingVrfMapper::LrVrfInfoMapIter

A typedef for iterator of LrVrfInfoMap.

Definition at line 316 of file vxlan_routing_manager.h.

◆ VnLrSet

A typedef to store map between pointer to VirtualNetwork (a bridge or routing virtual network connected to some LR) and the LR's UUID.

Definition at line 321 of file vxlan_routing_manager.h.

◆ VnLrSetIter

typedef VnLrSet::iterator VxlanRoutingVrfMapper::VnLrSetIter

A typedef for iterator of VnLrSet.

Definition at line 324 of file vxlan_routing_manager.h.

Constructor & Destructor Documentation

◆ VxlanRoutingVrfMapper()

VxlanRoutingVrfMapper::VxlanRoutingVrfMapper ( VxlanRoutingManager mgr)

Constructs a new instance of VxlanRoutingVrfMapper using the given pointer to VxlanRoutingManager.

Definition at line 126 of file vxlan_routing_manager.cc.

◆ ~VxlanRoutingVrfMapper()

VxlanRoutingVrfMapper::~VxlanRoutingVrfMapper ( )
virtual

Destroys an instance of VxlanRoutingVrfMapper().

Definition at line 131 of file vxlan_routing_manager.cc.

Member Function Documentation

◆ BridgeInet4RouteWalkDone()

void VxlanRoutingVrfMapper::BridgeInet4RouteWalkDone ( DBTable::DBTableWalkRef  walk_ref,
DBTableBase partition 
)

Handles completion of route walk in the Inet IPv4 table of a bridge VRF instance.

Definition at line 237 of file vxlan_routing_manager.cc.

◆ BridgeInet6RouteWalkDone()

void VxlanRoutingVrfMapper::BridgeInet6RouteWalkDone ( DBTable::DBTableWalkRef  walk_ref,
DBTableBase partition 
)

Handles completion of route walk in an Inet IPv6 table of a bridge VRF instance.

Definition at line 250 of file vxlan_routing_manager.cc.

◆ DISALLOW_COPY_AND_ASSIGN()

VxlanRoutingVrfMapper::DISALLOW_COPY_AND_ASSIGN ( VxlanRoutingVrfMapper  )
private

◆ GetLogicalRouterUuidUsingRoute()

const boost::uuids::uuid VxlanRoutingVrfMapper::GetLogicalRouterUuidUsingRoute ( const AgentRoute rt)
private

Find the UUID of the LR using a given route (AgentRoute).

Definition at line 312 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

◆ GetRoutingVrfUsingAgentRoute()

const VrfEntry * VxlanRoutingVrfMapper::GetRoutingVrfUsingAgentRoute ( const AgentRoute rt)
private

Find the routing VRF instance using a given route (AgentRoute).

Definition at line 298 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

◆ GetRoutingVrfUsingUuid()

const VrfEntry * VxlanRoutingVrfMapper::GetRoutingVrfUsingUuid ( const boost::uuids::uuid lr_uuid)
private

Find the routing VRF instance using a given LR UUID.

Definition at line 303 of file vxlan_routing_manager.cc.

◆ GetRoutingVrfUsingVn()

const VrfEntry * VxlanRoutingVrfMapper::GetRoutingVrfUsingVn ( const VnEntry vn)
private

Find the routing VRF instance using a given virtual network.

Definition at line 289 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

◆ IsEmpty()

bool VxlanRoutingVrfMapper::IsEmpty ( void  ) const
inline

Determines whether object is empty or not.

Definition at line 361 of file vxlan_routing_manager.h.

◆ RoutingVrfRouteWalkDone()

void VxlanRoutingVrfMapper::RoutingVrfRouteWalkDone ( DBTable::DBTableWalkRef  walk_ref,
DBTableBase partition 
)

Handles completion of route walk in the EVPN table of a routing VRF instance.

Definition at line 231 of file vxlan_routing_manager.cc.

◆ TryDeleteLogicalRouter()

void VxlanRoutingVrfMapper::TryDeleteLogicalRouter ( LrVrfInfoMapIter it)

Attempts to delete the given LR.

Todo:
better way to release logical router from lr_vrf_info_map_ Easier way will be to add logical router in db and trigger delete of this via LR delete in same.

Definition at line 337 of file vxlan_routing_manager.cc.

◆ WalkBridgeInetTables()

void VxlanRoutingVrfMapper::WalkBridgeInetTables ( InetUnicastAgentRouteTable inet4,
InetUnicastAgentRouteTable inet6 
)
private

Walks given Inet tables (IPv4 and IPv6).

Definition at line 134 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

◆ WalkBridgeVrfs()

void VxlanRoutingVrfMapper::WalkBridgeVrfs ( const RoutedVrfInfo routing_vrf_info)
private

Walks Inet tables of all bridge VRF instances connected to a LR (given in routing_vrf_info parameter).

Definition at line 264 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

◆ WalkRoutingVrf()

void VxlanRoutingVrfMapper::WalkRoutingVrf ( const boost::uuids::uuid lr_uuid,
const VnEntry vn,
bool  update,
bool  withdraw 
)
private

Walks the EVPN table of the routing VRF instance of a given LR.

Definition at line 175 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ VxlanRoutingManager

friend class VxlanRoutingManager
friend

Allows access to private members for VxlanRoutingManager class.

Definition at line 369 of file vxlan_routing_manager.h.

Member Data Documentation

◆ inet4_table_walker_

InetTableWalker VxlanRoutingVrfMapper::inet4_table_walker_
private

The set of walkers for Inet IPv4 tables of bridge VRF instances.

Definition at line 410 of file vxlan_routing_manager.h.

◆ inet6_table_walker_

InetTableWalker VxlanRoutingVrfMapper::inet6_table_walker_
private

The set of walkers for Inet IPv6 tables of bridge VRF instances.

Definition at line 413 of file vxlan_routing_manager.h.

◆ lr_vrf_info_map_

LrVrfInfoMap VxlanRoutingVrfMapper::lr_vrf_info_map_
private

The map between Logical router UUID and RoutedVrfInfo.

Definition at line 402 of file vxlan_routing_manager.h.

◆ mgr_

VxlanRoutingManager* VxlanRoutingVrfMapper::mgr_
private

A pointer to the VxlanRoutingManager instance.

Definition at line 398 of file vxlan_routing_manager.h.

◆ vn_lr_set_

VnLrSet VxlanRoutingVrfMapper::vn_lr_set_
private

The map between pointer to VirtualNetwork (a bridge or routing virtual network connected to some LR) and the LR's UUID.

Definition at line 407 of file vxlan_routing_manager.h.


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