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

#include <bgp_table.h>

Inheritance diagram for BgpTable:
Collaboration diagram for BgpTable:

Classes

class  DeleteActor
 
struct  RequestData
 
struct  RequestKey
 

Public Types

typedef std::map
< RibExportPolicy, RibOut * > 
RibOutMap
 
typedef std::set< BgpTable * > TableSet
 
- Public Types inherited from DBTable
typedef boost::intrusive_ptr
< DBTableWalk
DBTableWalkRef
 
typedef boost::function< bool(DBTablePartBase
*, DBEntryBase *)> 
WalkFn
 
typedef boost::function< void(DBTableWalkRef,
DBTableBase *)> 
WalkCompleteFn
 
- Public Types inherited from DBTableBase
typedef boost::function< void(DBTablePartBase
*, DBEntryBase *)> 
ChangeCallback
 
typedef int ListenerId
 

Public Member Functions

 BgpTable (DB *db, const std::string &name)
 
 ~BgpTable ()
 
const RibOutMapribout_map ()
 
RibOutRibOutFind (const RibExportPolicy &policy)
 
RibOutRibOutLocate (BgpUpdateSender *sender, const RibExportPolicy &policy)
 
void RibOutDelete (const RibExportPolicy &policy)
 
virtual bool Export (RibOut *ribout, Route *route, const RibPeerSet &peerset, UpdateInfoSList &uinfo_slist)=0
 
virtual Address::Family family () const =0
 
virtual bool IsVpnTable () const
 
virtual bool IsRoutingPolicySupported () const
 
virtual bool IsRouteAggregationSupported () const
 
virtual std::unique_ptr< DBEntryAllocEntryStr (const std::string &key) const =0
 
virtual BgpRouteRouteReplicate (BgpServer *server, BgpTable *table, BgpRoute *src, const BgpPath *path, ExtCommunityPtr community)=0
 
void CheckAggregatorAttr (BgpAttr *attr) const
 
void CreateAsPath4Byte (BgpAttr *attr, as_t local_as) const
 
void CreateAsPath2Byte (BgpAttr *attr) const
 
void CreateAs4Path (BgpAttr *attr) const
 
bool Has4ByteAsn (BgpAttr *attr) const
 
void PrependAsToAsPath4Byte (BgpAttr *attr, as_t asn) const
 
void PrependAsToAsPath2Byte (BgpAttr *attr, as_t asn) const
 
void PrependAsToAsPath2Byte (BgpAttr *attr, as2_t asn) const
 
void PrependAsToAs4Path (BgpAttr *attr, as_t asn) const
 
UpdateInfoGetUpdateInfo (RibOut *ribout, BgpRoute *route, const RibPeerSet &peerset)
 
void ProcessDefaultTunnelEncapsulation (const RibOut *ribout, ExtCommunityDB *extcomm_db, BgpAttr *attr) const
 
virtual void UpdateSecondaryTablesForReplication (BgpRoute *rt, TableSet *secondary_tables)
 
void ManagedDelete ()
 
virtual void RetryDelete ()
 
void Shutdown ()
 
virtual bool MayDelete () const
 
bool IsDeleted () const
 
virtual PathResolverCreatePathResolver ()
 
void LocatePathResolver ()
 
void DestroyPathResolver ()
 
RoutingInstancerouting_instance ()
 
const RoutingInstancerouting_instance () const
 
virtual void set_routing_instance (RoutingInstance *rtinstance)
 
BgpServerserver ()
 
const BgpServerserver () const
 
PathResolverpath_resolver ()
 
const PathResolverpath_resolver () const
 
LifetimeActordeleter ()
 
const LifetimeActordeleter () const
 
size_t GetPendingRiboutsCount (size_t *markers) const
 
void UpdatePathCount (const BgpPath *path, int count)
 
const uint64_t GetPrimaryPathCount () const
 
const uint64_t GetSecondaryPathCount () const
 
const uint64_t GetInfeasiblePathCount () const
 
const uint64_t GetStalePathCount () const
 
const uint64_t GetLlgrStalePathCount () const
 
void UpdateStalePathCount (int count)
 
void UpdateLlgrStalePathCount (int count)
 
bool IsAggregateRoute (const BgpRoute *route) const
 
bool IsContributingRoute (const BgpRoute *route) const
 
bool DeletePath (DBTablePartBase *root, BgpRoute *rt, BgpPath *path)
 
virtual void Input (DBTablePartition *root, DBClient *client, DBRequest *req)
 
bool InputCommon (DBTablePartBase *root, BgpRoute *rt, BgpPath *path, const IPeer *peer, DBRequest *req, DBRequest::DBOperation oper, BgpAttrPtr attrs, uint32_t path_id, uint32_t flags, uint32_t label, uint32_t l3_label)
 
void InputCommonPostProcess (DBTablePartBase *root, BgpRoute *rt, bool notify_rt)
 
void FillRibOutStatisticsInfo (std::vector< ShowRibOutStatistics > *sros_list) const
 
virtual BgpAttrPtr GetAttributes (BgpRoute *rt, BgpAttrPtr attrp, const IPeer *peer)
 
- Public Member Functions inherited from RouteTable
 RouteTable (DB *db, const std::string &name)
 
- Public Member Functions inherited from DBTable
 DBTable (DB *db, const std::string &name)
 
virtual ~DBTable ()
 
void Init ()
 
virtual std::unique_ptr< DBEntryAllocEntry (const DBRequestKey *key) const =0
 
virtual size_t Hash (const DBEntry *entry) const
 
virtual size_t Hash (const DBRequestKey *key) const
 
virtual DBTablePartitionAllocPartition (int index)
 
virtual DBEntryAdd (const DBRequest *req)
 
virtual bool OnChange (DBEntry *entry, const DBRequest *req)
 
virtual bool Delete (DBEntry *entry, const DBRequest *req)
 
void NotifyAllEntries ()
 
DBEntryFind (const DBEntry *entry)
 
const DBEntryFind (const DBEntry *entry) const
 
DBEntryFind (const DBRequestKey *key, int id=-1)
 
const DBEntryFind (const DBRequestKey *key, int id=-1) const
 
DBEntryFindNoLock (const DBEntry *entry)
 
DBEntryFindNoLock (const DBRequestKey *key)
 
virtual DBTablePartBaseGetTablePartition (const DBRequestKey *key)
 
virtual const DBTablePartBaseGetTablePartition (const DBRequestKey *key) const
 
virtual DBTablePartBaseGetTablePartition (const DBEntryBase *entry)
 
virtual const DBTablePartBaseGetTablePartition (const DBEntryBase *entry) const
 
virtual DBTablePartBaseGetTablePartition (const int index)
 
virtual const DBTablePartBaseGetTablePartition (const int index) const
 
virtual void Change (DBEntryBase *entry)
 
virtual int PartitionCount () const
 
virtual size_t Size () const
 
DBTableWalkRef AllocWalker (WalkFn walk_fn, WalkCompleteFn walk_complete)
 
void ReleaseWalker (DBTableWalkRef &walk)
 
void WalkTable (DBTableWalkRef walk)
 
void WalkAgain (DBTableWalkRef walk)
 
void SetWalkIterationToYield (int count)
 
int GetWalkIterationToYield ()
 
void SetWalkTaskId (int task_id)
 
int GetWalkerTaskId ()
 
- Public Member Functions inherited from DBTableBase
 DBTableBase (DB *db, const std::string &name)
 
virtual ~DBTableBase ()
 
bool Enqueue (DBRequest *req)
 
void EnqueueRemove (DBEntryBase *db_entry)
 
virtual void AddRemoveCallback (const DBEntryBase *entry, bool add) const
 
ListenerId Register (ChangeCallback callback, const std::string &name="unspecified")
 
void Unregister (ListenerId listener)
 
void RunNotify (DBTablePartBase *tpart, DBEntryBase *entry)
 
void AddToDBStateCount (ListenerId listener, int count)
 
uint64_t GetDBStateCount (ListenerId listener)
 
bool empty () const
 
DBdatabase ()
 
const DBdatabase () const
 
const std::string & name () const
 
bool HasListeners () const
 
size_t GetListenerCount () const
 
void FillListeners (std::vector< ShowTableListener > *listeners) const
 
uint64_t enqueue_count () const
 
void incr_enqueue_count ()
 
void reset_enqueue_count ()
 
uint64_t input_count () const
 
void incr_input_count ()
 
void reset_input_count ()
 
uint64_t notify_count () const
 
void incr_notify_count ()
 
void reset_notify_count ()
 
bool HasWalkers () const
 
uint64_t walker_count () const
 
void incr_walker_count ()
 
uint64_t decr_walker_count ()
 
uint64_t walk_request_count () const
 
uint64_t walk_complete_count () const
 
uint64_t walk_cancel_count () const
 
uint64_t walk_again_count () const
 
uint64_t walk_count () const
 
void incr_walk_request_count ()
 
void incr_walk_complete_count ()
 
void incr_walk_cancel_count ()
 
void incr_walk_again_count ()
 
void incr_walk_count ()
 

Static Public Member Functions

static bool PathSelection (const Path &path1, const Path &path2)
 
- Static Public Member Functions inherited from DBTable
static void DBStateClear (DBTable *table, ListenerId id)
 

Private Member Functions

void PrependLocalAs (const RibOut *ribout, BgpAttr *attr, const IPeer *) const
 
void ProcessAsOverride (const RibOut *ribout, BgpAttr *attr) const
 
void ProcessRemovePrivate (const RibOut *ribout, BgpAttr *attr) const
 
void RemovePrivateAs (const RibOut *ribout, BgpAttr *attr) const
 
void RemovePrivate4ByteAs (const RibOut *ribout, BgpAttr *attr) const
 
void RemovePrivateAs4 (const RibOut *ribout, BgpAttr *attr) const
 
void ProcessLlgrState (const RibOut *ribout, const BgpPath *path, BgpAttr *attr, bool llgr_stale_comm)
 
virtual BgpRouteTableFind (DBTablePartition *rtp, const DBRequestKey *prefix)=0
 
 DISALLOW_COPY_AND_ASSIGN (BgpTable)
 

Private Attributes

RoutingInstancertinstance_
 
PathResolverpath_resolver_
 
RibOutMap ribout_map_
 
boost::scoped_ptr< DeleteActordeleter_
 
LifetimeRef< BgpTableinstance_delete_ref_
 
tbb::atomic< uint64_t > primary_path_count_
 
tbb::atomic< uint64_t > secondary_path_count_
 
tbb::atomic< uint64_t > infeasible_path_count_
 
tbb::atomic< uint64_t > stale_path_count_
 
tbb::atomic< uint64_t > llgr_stale_path_count_
 

Friends

class BgpTableTest
 

Additional Inherited Members

- Static Public Attributes inherited from DBTable
static const int kIterationToYield = 256
 
- Static Public Attributes inherited from DBTableBase
static const int kInvalidId = -1
 

Detailed Description

Definition at line 35 of file bgp_table.h.

Member Typedef Documentation

Definition at line 37 of file bgp_table.h.

typedef std::set<BgpTable *> BgpTable::TableSet

Definition at line 38 of file bgp_table.h.

Constructor & Destructor Documentation

BgpTable::BgpTable ( DB db,
const std::string &  name 
)

Definition at line 59 of file bgp_table.cc.

BgpTable::~BgpTable ( )

Definition at line 76 of file bgp_table.cc.

Here is the call graph for this function:

Member Function Documentation

virtual std::unique_ptr<DBEntry> BgpTable::AllocEntryStr ( const std::string &  key) const
pure virtual
void BgpTable::CheckAggregatorAttr ( BgpAttr attr) const

Definition at line 132 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::CreateAs4Path ( BgpAttr attr) const

Definition at line 428 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::CreateAsPath2Byte ( BgpAttr attr) const

Definition at line 462 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::CreateAsPath4Byte ( BgpAttr attr,
as_t  local_as 
) const

Definition at line 503 of file bgp_table.cc.

Here is the call graph for this function:

PathResolver * BgpTable::CreatePathResolver ( )
virtual

Reimplemented in MvpnTable, EvpnTable, InetTable, and Inet6Table.

Definition at line 1070 of file bgp_table.cc.

bool BgpTable::DeletePath ( DBTablePartBase root,
BgpRoute rt,
BgpPath path 
)

Definition at line 831 of file bgp_table.cc.

Here is the call graph for this function:

LifetimeActor * BgpTable::deleter ( )

Definition at line 1108 of file bgp_table.cc.

const LifetimeActor * BgpTable::deleter ( ) const

Definition at line 1112 of file bgp_table.cc.

void BgpTable::DestroyPathResolver ( )

Definition at line 1081 of file bgp_table.cc.

BgpTable::DISALLOW_COPY_AND_ASSIGN ( BgpTable  )
private
virtual bool BgpTable::Export ( RibOut ribout,
Route route,
const RibPeerSet peerset,
UpdateInfoSList uinfo_slist 
)
pure virtual
virtual Address::Family BgpTable::family ( ) const
pure virtual
void BgpTable::FillRibOutStatisticsInfo ( std::vector< ShowRibOutStatistics > *  sros_list) const

Definition at line 1146 of file bgp_table.cc.

Here is the call graph for this function:

virtual BgpAttrPtr BgpTable::GetAttributes ( BgpRoute rt,
BgpAttrPtr  attrp,
const IPeer peer 
)
inlinevirtual

Reimplemented in InetTable.

Definition at line 197 of file bgp_table.h.

const uint64_t BgpTable::GetInfeasiblePathCount ( ) const
inline

Definition at line 165 of file bgp_table.h.

const uint64_t BgpTable::GetLlgrStalePathCount ( ) const
inline

Definition at line 169 of file bgp_table.h.

size_t BgpTable::GetPendingRiboutsCount ( size_t *  markers) const

Definition at line 1088 of file bgp_table.cc.

Here is the call graph for this function:

const uint64_t BgpTable::GetPrimaryPathCount ( ) const
inline

Definition at line 161 of file bgp_table.h.

const uint64_t BgpTable::GetSecondaryPathCount ( ) const
inline

Definition at line 162 of file bgp_table.h.

const uint64_t BgpTable::GetStalePathCount ( ) const
inline

Definition at line 168 of file bgp_table.h.

UpdateInfo * BgpTable::GetUpdateInfo ( RibOut ribout,
BgpRoute route,
const RibPeerSet peerset 
)

Definition at line 578 of file bgp_table.cc.

bool BgpTable::Has4ByteAsn ( BgpAttr attr) const

Definition at line 447 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::Input ( DBTablePartition root,
DBClient client,
DBRequest req 
)
virtual

Reimplemented from DBTable.

Definition at line 934 of file bgp_table.cc.

Here is the call graph for this function:

bool BgpTable::InputCommon ( DBTablePartBase root,
BgpRoute rt,
BgpPath path,
const IPeer peer,
DBRequest req,
DBRequest::DBOperation  oper,
BgpAttrPtr  attrs,
uint32_t  path_id,
uint32_t  flags,
uint32_t  label,
uint32_t  l3_label 
)

Definition at line 836 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::InputCommonPostProcess ( DBTablePartBase root,
BgpRoute rt,
bool  notify_rt 
)

Definition at line 1006 of file bgp_table.cc.

Here is the call graph for this function:

bool BgpTable::IsAggregateRoute ( const BgpRoute route) const

Definition at line 1137 of file bgp_table.cc.

Here is the call graph for this function:

bool BgpTable::IsContributingRoute ( const BgpRoute route) const

Definition at line 1142 of file bgp_table.cc.

Here is the call graph for this function:

bool BgpTable::IsDeleted ( ) const
inline

Definition at line 143 of file bgp_table.h.

Here is the call graph for this function:

virtual bool BgpTable::IsRouteAggregationSupported ( ) const
inlinevirtual

Reimplemented in InetTable, and Inet6Table.

Definition at line 112 of file bgp_table.h.

virtual bool BgpTable::IsRoutingPolicySupported ( ) const
inlinevirtual

Reimplemented in InetTable, and Inet6Table.

Definition at line 111 of file bgp_table.h.

virtual bool BgpTable::IsVpnTable ( ) const
inlinevirtual

Reimplemented in MvpnTable, ErmVpnTable, EvpnTable, InetVpnTable, and Inet6VpnTable.

Definition at line 110 of file bgp_table.h.

void BgpTable::LocatePathResolver ( )

Definition at line 1074 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::ManagedDelete ( )

Definition at line 1055 of file bgp_table.cc.

bool BgpTable::MayDelete ( ) const
virtual

Reimplemented from DBTableBase.

Definition at line 1017 of file bgp_table.cc.

Here is the call graph for this function:

PathResolver* BgpTable::path_resolver ( )
inline

Definition at line 153 of file bgp_table.h.

const PathResolver* BgpTable::path_resolver ( ) const
inline

Definition at line 154 of file bgp_table.h.

bool BgpTable::PathSelection ( const Path path1,
const Path path2 
)
static

Definition at line 821 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::PrependAsToAs4Path ( BgpAttr attr,
as_t  asn 
) const

Definition at line 413 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::PrependAsToAsPath2Byte ( BgpAttr attr,
as_t  asn 
) const

Definition at line 382 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::PrependAsToAsPath2Byte ( BgpAttr attr,
as2_t  asn 
) const

Definition at line 368 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::PrependAsToAsPath4Byte ( BgpAttr attr,
as_t  asn 
) const

Definition at line 399 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::PrependLocalAs ( const RibOut ribout,
BgpAttr attr,
const IPeer peer 
) const
private

Definition at line 148 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::ProcessAsOverride ( const RibOut ribout,
BgpAttr attr 
) const
private

Definition at line 261 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::ProcessDefaultTunnelEncapsulation ( const RibOut ribout,
ExtCommunityDB extcomm_db,
BgpAttr attr 
) const

Definition at line 351 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::ProcessLlgrState ( const RibOut ribout,
const BgpPath path,
BgpAttr attr,
bool  llgr_stale_comm 
)
private

Definition at line 306 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::ProcessRemovePrivate ( const RibOut ribout,
BgpAttr attr 
) const
private

Definition at line 244 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::RemovePrivate4ByteAs ( const RibOut ribout,
BgpAttr attr 
) const
private

Definition at line 199 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::RemovePrivateAs ( const RibOut ribout,
BgpAttr attr 
) const
private

Definition at line 167 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::RemovePrivateAs4 ( const RibOut ribout,
BgpAttr attr 
) const
private

Definition at line 220 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::RetryDelete ( )
virtual

Reimplemented from DBTableBase.

Definition at line 1064 of file bgp_table.cc.

Here is the call graph for this function:

const RibOutMap& BgpTable::ribout_map ( )
inline

Definition at line 99 of file bgp_table.h.

void BgpTable::RibOutDelete ( const RibExportPolicy policy)

Definition at line 124 of file bgp_table.cc.

RibOut * BgpTable::RibOutFind ( const RibExportPolicy policy)

Definition at line 99 of file bgp_table.cc.

RibOut * BgpTable::RibOutLocate ( BgpUpdateSender sender,
const RibExportPolicy policy 
)

Definition at line 109 of file bgp_table.cc.

virtual BgpRoute* BgpTable::RouteReplicate ( BgpServer server,
BgpTable table,
BgpRoute src,
const BgpPath path,
ExtCommunityPtr  community 
)
pure virtual
RoutingInstance* BgpTable::routing_instance ( )
inline

Definition at line 148 of file bgp_table.h.

const RoutingInstance* BgpTable::routing_instance ( ) const
inline

Definition at line 149 of file bgp_table.h.

BgpServer * BgpTable::server ( )

Definition at line 88 of file bgp_table.cc.

Here is the call graph for this function:

const BgpServer * BgpTable::server ( ) const

Definition at line 92 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::set_routing_instance ( RoutingInstance rtinstance)
virtual

Reimplemented in ErmVpnTable, and EvpnTable.

Definition at line 81 of file bgp_table.cc.

Here is the call graph for this function:

void BgpTable::Shutdown ( )

Definition at line 1051 of file bgp_table.cc.

virtual BgpRoute* BgpTable::TableFind ( DBTablePartition rtp,
const DBRequestKey prefix 
)
privatepure virtual
void BgpTable::UpdateLlgrStalePathCount ( int  count)
inline

Definition at line 173 of file bgp_table.h.

void BgpTable::UpdatePathCount ( const BgpPath path,
int  count 
)

Definition at line 1116 of file bgp_table.cc.

Here is the call graph for this function:

virtual void BgpTable::UpdateSecondaryTablesForReplication ( BgpRoute rt,
TableSet secondary_tables 
)
inlinevirtual

Reimplemented in MvpnTable.

Definition at line 135 of file bgp_table.h.

void BgpTable::UpdateStalePathCount ( int  count)
inline

Definition at line 172 of file bgp_table.h.

Friends And Related Function Documentation

friend class BgpTableTest
friend

Definition at line 200 of file bgp_table.h.

Member Data Documentation

boost::scoped_ptr<DeleteActor> BgpTable::deleter_
private

Definition at line 221 of file bgp_table.h.

tbb::atomic<uint64_t> BgpTable::infeasible_path_count_
private

Definition at line 225 of file bgp_table.h.

LifetimeRef<BgpTable> BgpTable::instance_delete_ref_
private

Definition at line 222 of file bgp_table.h.

tbb::atomic<uint64_t> BgpTable::llgr_stale_path_count_
private

Definition at line 227 of file bgp_table.h.

PathResolver* BgpTable::path_resolver_
private

Definition at line 218 of file bgp_table.h.

tbb::atomic<uint64_t> BgpTable::primary_path_count_
private

Definition at line 223 of file bgp_table.h.

RibOutMap BgpTable::ribout_map_
private

Definition at line 219 of file bgp_table.h.

RoutingInstance* BgpTable::rtinstance_
private

Definition at line 217 of file bgp_table.h.

tbb::atomic<uint64_t> BgpTable::secondary_path_count_
private

Definition at line 224 of file bgp_table.h.

tbb::atomic<uint64_t> BgpTable::stale_path_count_
private

Definition at line 226 of file bgp_table.h.


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