libbgp  0.6
A C++ BGP Library.
Public Member Functions | Public Attributes | List of all members
libbgp::BgpRibEntry< T > Class Template Reference

The base of BGP RIB entry. More...

#include <bgp-rib.h>

Public Member Functions

 BgpRibEntry ()
 Construct a new BgpRibEntry. More...
 
bool operator> (const T &other) const
 Test if this entry has greater weight then anoter entry. Please note that weight are only calculated based on path attribues. (i.e., you need to compare route prefix first) More...
 

Public Attributes

uint32_t src_router_id
 The originating BGP speaker's ID of this entry. (network bytes order)
 
uint64_t update_id
 The update ID. More...
 
int32_t weight
 Weight of this entry. More...
 
std::vector< std::shared_ptr< BgpPathAttrib > > attribs
 Path attributes for this entry.
 
BgpRouteSource src
 Source of this entry. More...
 
BgpRouteStatus status
 Status of this entry. More...
 
uint32_t ibgp_peer_asn
 ASN of the IBGP peer. (Valid iff src == SRC_IBGP) More...
 

Detailed Description

template<typename T>
class libbgp::BgpRibEntry< T >

The base of BGP RIB entry.

Template Parameters
TType of BgpRibEntry

Definition at line 35 of file bgp-rib.h.

Constructor & Destructor Documentation

◆ BgpRibEntry()

template<typename T>
libbgp::BgpRibEntry< T >::BgpRibEntry ( )
inline

Construct a new BgpRibEntry.

source default to SRC_EBGP

Definition at line 43 of file bgp-rib.h.

Member Function Documentation

◆ operator>()

template<typename T>
bool libbgp::BgpRibEntry< T >::operator> ( const T &  other) const
inline

Test if this entry has greater weight then anoter entry. Please note that weight are only calculated based on path attribues. (i.e., you need to compare route prefix first)

Parameters
otherThe other entry.
Returns
true This entry has higher weight.
false This entry has lower or equals weight.

Definition at line 111 of file bgp-rib.h.

Member Data Documentation

◆ ibgp_peer_asn

template<typename T>
uint32_t libbgp::BgpRibEntry< T >::ibgp_peer_asn

ASN of the IBGP peer. (Valid iff src == SRC_IBGP)

The ibgp_peer_asn field can be used to identify which IBGP session does this route belongs to. This is needed since a BGP speaker can have multiple IBGP sessions with different ASNS.

Definition at line 100 of file bgp-rib.h.

Referenced by libbgp::BgpRib4::BgpRib4(), and libbgp::BgpRib6::BgpRib6().

◆ src

template<typename T>
BgpRouteSource libbgp::BgpRibEntry< T >::src

Source of this entry.

If the route is from an IBGP peer, the nexthop might not be reachable directly. You may need recursive nexthop or info from other routing protocols.

Definition at line 83 of file bgp-rib.h.

Referenced by libbgp::BgpRib4::BgpRib4(), libbgp::BgpRib6::BgpRib6(), and libbgp::BgpRibEntry< BgpRib6Entry >::BgpRibEntry().

◆ status

template<typename T>
BgpRouteStatus libbgp::BgpRibEntry< T >::status

Status of this entry.

Active routes are routes currently picked as best routes.

Definition at line 91 of file bgp-rib.h.

Referenced by libbgp::BgpRib4::BgpRib4(), libbgp::BgpRib6::BgpRib6(), libbgp::BgpRibEntry< BgpRib6Entry >::BgpRibEntry(), libbgp::BgpRib4::withdraw(), and libbgp::BgpRib6::withdraw().

◆ update_id

template<typename T>
uint64_t libbgp::BgpRibEntry< T >::update_id

The update ID.

BgpRib4Entry with same update ID are received from the same update and their path attributes are therefore same. Note that entries with different update_id may still have same path attributes.

Definition at line 59 of file bgp-rib.h.

Referenced by libbgp::BgpRib4::BgpRib4(), and libbgp::BgpRib6::BgpRib6().

◆ weight

template<typename T>
int32_t libbgp::BgpRibEntry< T >::weight

Weight of this entry.

Entry with higher weight will be prefered. Weight is only compared when selecting entry with equal routes.

Definition at line 68 of file bgp-rib.h.

Referenced by libbgp::BgpRib4::BgpRib4(), and libbgp::BgpRib6::BgpRib6().


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