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

This class represents a remote EVPN segment that has 2 or more PEs that are multi-homed to it. An EvpnSegment is created when we see a MAC route with a non-NULL ESI or when we see an AD route for the ESI in question. More...

#include <bgp_evpn.h>

Inheritance diagram for EvpnSegment:
Collaboration diagram for EvpnSegment:

Classes

class  RemotePe
 

Public Types

typedef std::list< RemotePeRemotePeList
 
typedef
RemotePeList::const_iterator 
const_iterator
 

Public Member Functions

 EvpnSegment (EvpnManager *evpn_manager, const EthernetSegmentId &esi)
 
 ~EvpnSegment ()
 
const_iterator begin () const
 
const_iterator end () const
 
void AddMacRoute (size_t part_id, EvpnRoute *route)
 Add the given MAC route as a dependent of this EvpnSegment. More...
 
void DeleteMacRoute (size_t part_id, EvpnRoute *route)
 Delete the given MAC route as a dependent of this EvpnSegment. Trigger deletion of the EvpnSegment if there are no dependent routes in the partition. More...
 
void TriggerMacRouteUpdate ()
 Trigger an update of all dependent MAC routes for this EvpnSegment. Note that the bgp::EvpnSegment task is mutually exclusive with the db::DBTable task. More...
 
bool UpdatePeList ()
 Update the PE list for this EvpnSegment. This should be called when the AutoDisocvery route is updated. Return true if there's a change in the PE list i.e. if an entry is added, deleted or updated. More...
 
bool MayDelete () const
 Return true if it's safe to delete this EvpnSegment. More...
 
const EthernetSegmentIdesi () const
 
EvpnRouteesi_ad_route ()
 
void set_esi_ad_route (EvpnRoute *esi_ad_route)
 
void clear_esi_ad_route ()
 
bool single_active () const
 
- Public Member Functions inherited from DBState
virtual ~DBState ()
 

Private Types

typedef std::set< EvpnRoute * > RouteList
 
typedef std::vector< RouteListRouteListVector
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (EvpnSegment)
 

Private Attributes

EvpnManagerevpn_manager_
 
EthernetSegmentId esi_
 
EvpnRouteesi_ad_route_
 
bool single_active_
 
RouteListVector route_lists_
 
RemotePeList pe_list_
 

Detailed Description

This class represents a remote EVPN segment that has 2 or more PEs that are multi-homed to it. An EvpnSegment is created when we see a MAC route with a non-NULL ESI or when we see an AD route for the ESI in question.

An EvpnSegment contains a vector of lists of MAC routes that are dependent on it. There's a list entry in the vector for each DB partition. All the MAC routes in a given partition that are associated with the EvpnSegment are in inserted in the list for that partition. The lists are updated as and when the EvpnSegment for MAC routes is updated.

An EvpnSegment contains a list of Remote PEs that have advertised per-ESI AD routes for the EVPN segment in question. The list is updated when paths are added/deleted from the AD route. A change in the contents of the list triggers an update of all dependent MAC routes, so that their aliased paths can be updated. The single-active state of the EvpnSegment is also updated when the PE list is updated. The PE list is updated from the context of the bgp::EvpnSegment task.

Definition at line 202 of file bgp_evpn.h.

Member Typedef Documentation

typedef RemotePeList::const_iterator EvpnSegment::const_iterator

Definition at line 225 of file bgp_evpn.h.

typedef std::list<RemotePe> EvpnSegment::RemotePeList

Definition at line 224 of file bgp_evpn.h.

typedef std::set<EvpnRoute *> EvpnSegment::RouteList
private

Definition at line 261 of file bgp_evpn.h.

typedef std::vector<RouteList> EvpnSegment::RouteListVector
private

Definition at line 262 of file bgp_evpn.h.

Constructor & Destructor Documentation

EvpnSegment::EvpnSegment ( EvpnManager evpn_manager,
const EthernetSegmentId esi 
)

Definition at line 400 of file bgp_evpn.cc.

EvpnSegment::~EvpnSegment ( )

Definition at line 411 of file bgp_evpn.cc.

Member Function Documentation

void EvpnSegment::AddMacRoute ( size_t  part_id,
EvpnRoute route 
)

Add the given MAC route as a dependent of this EvpnSegment.

Definition at line 419 of file bgp_evpn.cc.

const_iterator EvpnSegment::begin ( ) const
inline

Definition at line 227 of file bgp_evpn.h.

void EvpnSegment::clear_esi_ad_route ( )
inline

Definition at line 257 of file bgp_evpn.h.

void EvpnSegment::DeleteMacRoute ( size_t  part_id,
EvpnRoute route 
)

Delete the given MAC route as a dependent of this EvpnSegment. Trigger deletion of the EvpnSegment if there are no dependent routes in the partition.

Definition at line 429 of file bgp_evpn.cc.

Here is the call graph for this function:

EvpnSegment::DISALLOW_COPY_AND_ASSIGN ( EvpnSegment  )
private
const_iterator EvpnSegment::end ( ) const
inline

Definition at line 228 of file bgp_evpn.h.

const EthernetSegmentId& EvpnSegment::esi ( ) const
inline

Definition at line 252 of file bgp_evpn.h.

EvpnRoute* EvpnSegment::esi_ad_route ( )
inline

Definition at line 253 of file bgp_evpn.h.

bool EvpnSegment::MayDelete ( ) const

Return true if it's safe to delete this EvpnSegment.

Definition at line 540 of file bgp_evpn.cc.

void EvpnSegment::set_esi_ad_route ( EvpnRoute esi_ad_route)
inline

Definition at line 254 of file bgp_evpn.h.

Here is the call graph for this function:

bool EvpnSegment::single_active ( ) const
inline

Definition at line 258 of file bgp_evpn.h.

void EvpnSegment::TriggerMacRouteUpdate ( )

Trigger an update of all dependent MAC routes for this EvpnSegment. Note that the bgp::EvpnSegment task is mutually exclusive with the db::DBTable task.

Definition at line 441 of file bgp_evpn.cc.

Here is the call graph for this function:

bool EvpnSegment::UpdatePeList ( )

Update the PE list for this EvpnSegment. This should be called when the AutoDisocvery route is updated. Return true if there's a change in the PE list i.e. if an entry is added, deleted or updated.

Definition at line 458 of file bgp_evpn.cc.

Here is the call graph for this function:

Member Data Documentation

EthernetSegmentId EvpnSegment::esi_
private

Definition at line 265 of file bgp_evpn.h.

EvpnRoute* EvpnSegment::esi_ad_route_
private

Definition at line 266 of file bgp_evpn.h.

EvpnManager* EvpnSegment::evpn_manager_
private

Definition at line 264 of file bgp_evpn.h.

RemotePeList EvpnSegment::pe_list_
private

Definition at line 269 of file bgp_evpn.h.

RouteListVector EvpnSegment::route_lists_
private

Definition at line 268 of file bgp_evpn.h.

bool EvpnSegment::single_active_
private

Definition at line 267 of file bgp_evpn.h.


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