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

This class holds Evpn state for a particular <S,G> at any given time. More...

#include <bgp_evpn.h>

Collaboration diagram for EvpnState:

Classes

struct  SG
 Simple structure to hold <S,G>. Source as "0.0.0.0" can be used to encode <*,G> as well. More...
 

Public Types

typedef std::set< EvpnRoute * > RoutesSet
 
typedef std::map< EvpnRoute
*, BgpAttrPtr
RoutesMap
 
typedef std::map< SG, EvpnState * > StatesMap
 

Public Member Functions

 EvpnState (const SG &sg, StatesMap *states, EvpnManager *manager)
 A global MVPN state for a given <S.G> within a EvpnProjectManager. More...
 
virtual ~EvpnState ()
 
const SGsg () const
 
ErmVpnRouteglobal_ermvpn_tree_rt ()
 
const ErmVpnRouteglobal_ermvpn_tree_rt () const
 
void set_global_ermvpn_tree_rt (ErmVpnRoute *global_ermvpn_tree_rt)
 
RoutesSetsmet_routes ()
 
const RoutesSetsmet_routes () const
 
const StatesMapstates () const
 
StatesMapstates ()
 
EvpnManagermanager ()
 
const EvpnManagermanager () const
 
int refcount () const
 

Private Member Functions

const ErmVpnTabletable () const
 
 DISALLOW_COPY_AND_ASSIGN (EvpnState)
 

Private Attributes

SG sg_
 
ErmVpnRouteglobal_ermvpn_tree_rt_
 
RoutesSet smet_routes_
 
StatesMapstates_
 
EvpnManagermanager_
 
tbb::atomic< int > refcount_
 

Friends

class EvpnMcastNode
 
class EvpnManagerPartition
 
void intrusive_ptr_add_ref (EvpnState *evpn_state)
 Increment refcont atomically. More...
 
void intrusive_ptr_release (EvpnState *evpn_state)
 Decrement refcount of an evpn_state. If the refcount falls to 1, it implies that there is no more reference to this particular state from any other data structure. Hence, it can be deleted from the container map and destroyed as well. More...
 

Detailed Description

This class holds Evpn state for a particular <S,G> at any given time.

In Evpn state machinery, different types of routes are sent and received at different phases of processing. This class holds all relevant information associated with an <S,G>.

This is a refcounted class which is referred by DB States of different routes. When the refcount reaches 0, (last referring db state is deleted), this object is deleted from the container map and then destroyed.

global_ermvpn_tree_rt_ This is a reference to GlobalErmVpnRoute associated with the ErmVpnTree used in the data plane for this <S,G>. This route is created/updated when ErmVpn notifies changes to ermvpn routes.

states_ This is the parent map that holds 'this' EvpnState pointer as the value for the associated SG key. When the refcount reaches zero, it indicates that there is no reference to this state from of the DB States associated with any Evpn route. Hence at that time, this state is removed this map states_ and destroyed. This map actually sits inside the associated EvpnProjectManagerParitition object.

Definition at line 347 of file bgp_evpn.h.

Member Typedef Documentation

Definition at line 350 of file bgp_evpn.h.

typedef std::set<EvpnRoute *> EvpnState::RoutesSet

Definition at line 349 of file bgp_evpn.h.

typedef std::map<SG, EvpnState *> EvpnState::StatesMap

Definition at line 365 of file bgp_evpn.h.

Constructor & Destructor Documentation

EvpnState::EvpnState ( const SG sg,
StatesMap states,
EvpnManager manager 
)

A global MVPN state for a given <S.G> within a EvpnProjectManager.

Definition at line 34 of file bgp_evpn.cc.

EvpnState::~EvpnState ( )
virtual

Definition at line 40 of file bgp_evpn.cc.

Member Function Documentation

EvpnState::DISALLOW_COPY_AND_ASSIGN ( EvpnState  )
private
ErmVpnRoute * EvpnState::global_ermvpn_tree_rt ( )

Definition at line 1759 of file bgp_evpn.cc.

const ErmVpnRoute * EvpnState::global_ermvpn_tree_rt ( ) const

Definition at line 1763 of file bgp_evpn.cc.

EvpnManager* EvpnState::manager ( )
inline

Definition at line 379 of file bgp_evpn.h.

const EvpnManager* EvpnState::manager ( ) const
inline

Definition at line 380 of file bgp_evpn.h.

int EvpnState::refcount ( ) const
inline

Definition at line 381 of file bgp_evpn.h.

void EvpnState::set_global_ermvpn_tree_rt ( ErmVpnRoute global_ermvpn_tree_rt)

Definition at line 1755 of file bgp_evpn.cc.

Here is the call graph for this function:

const EvpnState::SG & EvpnState::sg ( ) const

Definition at line 1751 of file bgp_evpn.cc.

RoutesSet& EvpnState::smet_routes ( )
inline

Definition at line 375 of file bgp_evpn.h.

const RoutesSet& EvpnState::smet_routes ( ) const
inline

Definition at line 376 of file bgp_evpn.h.

const StatesMap* EvpnState::states ( ) const
inline

Definition at line 377 of file bgp_evpn.h.

StatesMap* EvpnState::states ( )
inline

Definition at line 378 of file bgp_evpn.h.

const ErmVpnTable * EvpnState::table ( ) const
private

Definition at line 45 of file bgp_evpn.cc.

Here is the call graph for this function:

Friends And Related Function Documentation

friend class EvpnManagerPartition
friend

Definition at line 385 of file bgp_evpn.h.

friend class EvpnMcastNode
friend

Definition at line 384 of file bgp_evpn.h.

void intrusive_ptr_add_ref ( EvpnState evpn_state)
friend

Increment refcont atomically.

Definition at line 759 of file bgp_evpn.h.

void intrusive_ptr_release ( EvpnState evpn_state)
friend

Decrement refcount of an evpn_state. If the refcount falls to 1, it implies that there is no more reference to this particular state from any other data structure. Hence, it can be deleted from the container map and destroyed as well.

Definition at line 767 of file bgp_evpn.h.

Member Data Documentation

ErmVpnRoute* EvpnState::global_ermvpn_tree_rt_
private

Definition at line 399 of file bgp_evpn.h.

EvpnManager* EvpnState::manager_
private

Definition at line 402 of file bgp_evpn.h.

tbb::atomic<int> EvpnState::refcount_
private

Definition at line 403 of file bgp_evpn.h.

SG EvpnState::sg_
private

Definition at line 398 of file bgp_evpn.h.

RoutesSet EvpnState::smet_routes_
private

Definition at line 400 of file bgp_evpn.h.

StatesMap* EvpnState::states_
private

Definition at line 401 of file bgp_evpn.h.


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