OpenSDN source code
|
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>
Classes | |
class | RemotePe |
Public Types | |
typedef std::list< RemotePe > | RemotePeList |
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 EthernetSegmentId & | esi () const |
EvpnRoute * | esi_ad_route () |
void | set_esi_ad_route (EvpnRoute *esi_ad_route) |
void | clear_esi_ad_route () |
bool | single_active () const |
![]() | |
virtual | ~DBState () |
Private Types | |
typedef std::set< EvpnRoute * > | RouteList |
typedef std::vector< RouteList > | RouteListVector |
Private Member Functions | |
DISALLOW_COPY_AND_ASSIGN (EvpnSegment) | |
Private Attributes | |
EvpnManager * | evpn_manager_ |
EthernetSegmentId | esi_ |
EvpnRoute * | esi_ad_route_ |
bool | single_active_ |
RouteListVector | route_lists_ |
RemotePeList | pe_list_ |
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.
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.
|
private |
Definition at line 261 of file bgp_evpn.h.
|
private |
Definition at line 262 of file bgp_evpn.h.
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.
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.
|
inline |
Definition at line 227 of file bgp_evpn.h.
|
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.
|
private |
|
inline |
Definition at line 228 of file bgp_evpn.h.
|
inline |
Definition at line 252 of file bgp_evpn.h.
|
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.
|
inline |
|
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.
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.
|
private |
Definition at line 265 of file bgp_evpn.h.
|
private |
Definition at line 266 of file bgp_evpn.h.
|
private |
Definition at line 264 of file bgp_evpn.h.
|
private |
Definition at line 269 of file bgp_evpn.h.
|
private |
Definition at line 268 of file bgp_evpn.h.
|
private |
Definition at line 267 of file bgp_evpn.h.