OpenSDN source code
|
#include <bgp_table.h>
Classes | |
class | DeleteActor |
struct | RequestData |
struct | RequestKey |
Public Types | |
typedef std::map < RibExportPolicy, RibOut * > | RibOutMap |
typedef std::set< BgpTable * > | TableSet |
![]() | |
typedef boost::intrusive_ptr < DBTableWalk > | DBTableWalkRef |
typedef boost::function< bool(DBTablePartBase *, DBEntryBase *)> | WalkFn |
typedef boost::function< void(DBTableWalkRef, DBTableBase *)> | WalkCompleteFn |
![]() | |
typedef boost::function< void(DBTablePartBase *, DBEntryBase *)> | ChangeCallback |
typedef int | ListenerId |
Public Member Functions | |
BgpTable (DB *db, const std::string &name) | |
~BgpTable () | |
const RibOutMap & | ribout_map () |
RibOut * | RibOutFind (const RibExportPolicy &policy) |
RibOut * | RibOutLocate (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< DBEntry > | AllocEntryStr (const std::string &key) const =0 |
virtual BgpRoute * | RouteReplicate (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 |
UpdateInfo * | GetUpdateInfo (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 PathResolver * | CreatePathResolver () |
void | LocatePathResolver () |
void | DestroyPathResolver () |
RoutingInstance * | routing_instance () |
const RoutingInstance * | routing_instance () const |
virtual void | set_routing_instance (RoutingInstance *rtinstance) |
BgpServer * | server () |
const BgpServer * | server () const |
PathResolver * | path_resolver () |
const PathResolver * | path_resolver () const |
LifetimeActor * | deleter () |
const LifetimeActor * | deleter () 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) |
![]() | |
RouteTable (DB *db, const std::string &name) | |
![]() | |
DBTable (DB *db, const std::string &name) | |
virtual | ~DBTable () |
void | Init () |
virtual std::unique_ptr< DBEntry > | AllocEntry (const DBRequestKey *key) const =0 |
virtual size_t | Hash (const DBEntry *entry) const |
virtual size_t | Hash (const DBRequestKey *key) const |
virtual DBTablePartition * | AllocPartition (int index) |
virtual DBEntry * | Add (const DBRequest *req) |
virtual bool | OnChange (DBEntry *entry, const DBRequest *req) |
virtual bool | Delete (DBEntry *entry, const DBRequest *req) |
void | NotifyAllEntries () |
DBEntry * | Find (const DBEntry *entry) |
const DBEntry * | Find (const DBEntry *entry) const |
DBEntry * | Find (const DBRequestKey *key, int id=-1) |
const DBEntry * | Find (const DBRequestKey *key, int id=-1) const |
DBEntry * | FindNoLock (const DBEntry *entry) |
DBEntry * | FindNoLock (const DBRequestKey *key) |
virtual DBTablePartBase * | GetTablePartition (const DBRequestKey *key) |
virtual const DBTablePartBase * | GetTablePartition (const DBRequestKey *key) const |
virtual DBTablePartBase * | GetTablePartition (const DBEntryBase *entry) |
virtual const DBTablePartBase * | GetTablePartition (const DBEntryBase *entry) const |
virtual DBTablePartBase * | GetTablePartition (const int index) |
virtual const DBTablePartBase * | GetTablePartition (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 () |
![]() | |
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 |
DB * | database () |
const DB * | database () 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 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 BgpRoute * | TableFind (DBTablePartition *rtp, const DBRequestKey *prefix)=0 |
DISALLOW_COPY_AND_ASSIGN (BgpTable) | |
Private Attributes | |
RoutingInstance * | rtinstance_ |
PathResolver * | path_resolver_ |
RibOutMap | ribout_map_ |
boost::scoped_ptr< DeleteActor > | deleter_ |
LifetimeRef< BgpTable > | instance_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 const int | kIterationToYield = 256 |
![]() | |
static const int | kInvalidId = -1 |
Definition at line 35 of file bgp_table.h.
typedef std::map<RibExportPolicy, RibOut *> BgpTable::RibOutMap |
Definition at line 37 of file bgp_table.h.
typedef std::set<BgpTable *> BgpTable::TableSet |
Definition at line 38 of file bgp_table.h.
BgpTable::BgpTable | ( | DB * | db, |
const std::string & | name | ||
) |
Definition at line 59 of file bgp_table.cc.
BgpTable::~BgpTable | ( | ) |
|
pure virtual |
Implemented in MvpnTable, ErmVpnTable, InetTable, Inet6Table, InetVpnTable, RTargetTable, EvpnTable, and Inet6VpnTable.
void BgpTable::CheckAggregatorAttr | ( | BgpAttr * | attr | ) | const |
void BgpTable::CreateAs4Path | ( | BgpAttr * | attr | ) | const |
void BgpTable::CreateAsPath2Byte | ( | BgpAttr * | attr | ) | const |
|
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 | ||
) |
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.
|
private |
|
pure virtual |
Implemented in MvpnTable, ErmVpnTable, EvpnTable, InetVpnTable, Inet6VpnTable, RTargetTable, InetTable, and Inet6Table.
|
pure virtual |
Implemented in MvpnTable, ErmVpnTable, InetTable, Inet6Table, EvpnTable, InetVpnTable, RTargetTable, and Inet6VpnTable.
void BgpTable::FillRibOutStatisticsInfo | ( | std::vector< ShowRibOutStatistics > * | sros_list | ) | const |
|
inlinevirtual |
Reimplemented in InetTable.
Definition at line 197 of file bgp_table.h.
|
inline |
Definition at line 165 of file bgp_table.h.
|
inline |
Definition at line 169 of file bgp_table.h.
size_t BgpTable::GetPendingRiboutsCount | ( | size_t * | markers | ) | const |
|
inline |
Definition at line 161 of file bgp_table.h.
|
inline |
Definition at line 162 of file bgp_table.h.
|
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 |
|
virtual |
Reimplemented from DBTable.
Definition at line 934 of file bgp_table.cc.
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 | ||
) |
void BgpTable::InputCommonPostProcess | ( | DBTablePartBase * | root, |
BgpRoute * | rt, | ||
bool | notify_rt | ||
) |
bool BgpTable::IsAggregateRoute | ( | const BgpRoute * | route | ) | const |
bool BgpTable::IsContributingRoute | ( | const BgpRoute * | route | ) | const |
|
inline |
|
inlinevirtual |
Reimplemented in InetTable, and Inet6Table.
Definition at line 112 of file bgp_table.h.
|
inlinevirtual |
Reimplemented in InetTable, and Inet6Table.
Definition at line 111 of file bgp_table.h.
|
inlinevirtual |
Reimplemented in MvpnTable, ErmVpnTable, EvpnTable, InetVpnTable, and Inet6VpnTable.
Definition at line 110 of file bgp_table.h.
void BgpTable::LocatePathResolver | ( | ) |
void BgpTable::ManagedDelete | ( | ) |
Definition at line 1055 of file bgp_table.cc.
|
virtual |
Reimplemented from DBTableBase.
Definition at line 1017 of file bgp_table.cc.
|
inline |
Definition at line 153 of file bgp_table.h.
|
inline |
Definition at line 154 of file bgp_table.h.
void BgpTable::ProcessDefaultTunnelEncapsulation | ( | const RibOut * | ribout, |
ExtCommunityDB * | extcomm_db, | ||
BgpAttr * | attr | ||
) | const |
|
virtual |
Reimplemented from DBTableBase.
Definition at line 1064 of file bgp_table.cc.
|
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.
|
pure virtual |
Implemented in MvpnTable, InetTable, Inet6Table, ErmVpnTable, EvpnTable, InetVpnTable, Inet6VpnTable, and RTargetTable.
|
inline |
Definition at line 148 of file bgp_table.h.
|
inline |
Definition at line 149 of file bgp_table.h.
BgpServer * BgpTable::server | ( | ) |
const BgpServer * BgpTable::server | ( | ) | const |
|
virtual |
Reimplemented in ErmVpnTable, and EvpnTable.
Definition at line 81 of file bgp_table.cc.
void BgpTable::Shutdown | ( | ) |
Definition at line 1051 of file bgp_table.cc.
|
privatepure virtual |
Implemented in MvpnTable, ErmVpnTable, EvpnTable, InetTable, Inet6Table, RTargetTable, Inet6VpnTable, and InetVpnTable.
|
inline |
Definition at line 173 of file bgp_table.h.
void BgpTable::UpdatePathCount | ( | const BgpPath * | path, |
int | count | ||
) |
|
inlinevirtual |
Reimplemented in MvpnTable.
Definition at line 135 of file bgp_table.h.
|
inline |
Definition at line 172 of file bgp_table.h.
|
friend |
Definition at line 200 of file bgp_table.h.
|
private |
Definition at line 221 of file bgp_table.h.
|
private |
Definition at line 225 of file bgp_table.h.
|
private |
Definition at line 222 of file bgp_table.h.
|
private |
Definition at line 227 of file bgp_table.h.
|
private |
Definition at line 218 of file bgp_table.h.
|
private |
Definition at line 223 of file bgp_table.h.
|
private |
Definition at line 219 of file bgp_table.h.
|
private |
Definition at line 217 of file bgp_table.h.
|
private |
Definition at line 224 of file bgp_table.h.
|
private |
Definition at line 226 of file bgp_table.h.