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

Agent supports multiple route tables - Inet-unicast (IPv4/IPv6), Inet-multicast, bridge, EVPN (Type2/Type5). This base class contains common code for all types of route tables. More...

#include <agent_route.h>

Inheritance diagram for AgentRouteTable:
Collaboration diagram for AgentRouteTable:

Classes

class  DeleteActor
 

Public Types

typedef std::set< const
AgentRoute *, RouteComparator
UnresolvedRouteTree
 
typedef std::set< const
NextHop *, NHComparator
UnresolvedNHTree
 
- 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

 AgentRouteTable (DB *db, const std::string &name)
 
virtual ~AgentRouteTable ()
 
virtual int PartitionCount () const
 
virtual std::unique_ptr< DBEntryAllocEntry (const DBRequestKey *k) const
 
virtual size_t Hash (const DBEntry *entry) const
 
virtual size_t Hash (const DBRequestKey *key) const
 
virtual Agent::RouteTableType GetTableType () const =0
 
virtual std::string GetTableName () const =0
 
virtual void ProcessDelete (AgentRoute *rt)
 
virtual void ProcessAdd (AgentRoute *rt)
 
virtual void NotifyEntry (AgentRoute *entry)
 
virtual AgentSandeshPtr GetAgentSandesh (const AgentSandeshArguments *args, const std::string &context)
 
virtual SandeshTraceBufferPtr GetOperDBTraceBuf () const
 
UnresolvedRouteTree::const_iterator unresolved_route_begin () const
 
UnresolvedRouteTree::const_iterator unresolved_route_end () const
 
int unresolved_route_size () const
 
void AddUnresolvedNH (const NextHop *)
 
void RemoveUnresolvedNH (const NextHop *)
 
void EvaluateUnresolvedNH (void)
 
UnresolvedNHTree::const_iterator unresolved_nh_begin () const
 
UnresolvedNHTree::const_iterator unresolved_nh_end () const
 
void EvaluateUnresolvedRoutes (void)
 
void AddUnresolvedRoute (const AgentRoute *rt)
 
void RemoveUnresolvedRoute (const AgentRoute *rt)
 
Agentagent () const
 
const std::string & vrf_name () const
 
uint32_t vrf_id () const
 
VrfEntryvrf_entry () const
 
AgentRouteFindActiveEntry (const AgentRouteKey *key)
 
AgentRouteFindActiveEntryNoLock (const AgentRouteKey *key)
 
AgentRouteFindActiveEntry (const AgentRoute *key)
 
AgentRouteFindActiveEntryNoLock (const AgentRoute *key)
 
void SetVrf (VrfEntry *vrf)
 
bool DelExplicitRouteWalkerCb (DBTablePartBase *part, DBEntryBase *entry)
 
LifetimeActordeleter ()
 
void ManagedDelete ()
 
virtual void RetryDelete ()
 
void Process (DBRequest &req)
 
void AddChangeInput (DBTablePartition *part, VrfEntry *vrf, AgentRoute *rt, AgentRouteKey *key, AgentRouteData *data)
 
AgentRouteLocateRoute (DBTablePartition *part, VrfEntry *vrf, AgentRoute *rt, AgentRouteKey *key, AgentRouteData *data, bool *notify)
 
- 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 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 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
 
virtual bool MayDelete () 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 const std::string & GetSuffix (Agent::RouteTableType type)
 
- Static Public Member Functions inherited from DBTable
static void DBStateClear (DBTable *table, ListenerId id)
 

Static Public Attributes

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

Private Member Functions

void DeleteRouteDone (DBTable::DBTableWalkRef walk_ref, DBTableBase *base, RouteTableWalkerState *state)
 
void Input (DBTablePartition *part, DBClient *client, DBRequest *req)
 
 DISALLOW_COPY_AND_ASSIGN (AgentRouteTable)
 

Private Attributes

Agentagent_
 
uint32_t vrf_id_
 
VrfEntryRef vrf_entry_
 
boost::scoped_ptr< DeleteActordeleter_
 
LifetimeRef< AgentRouteTablevrf_delete_ref_
 
UnresolvedRouteTree unresolved_rt_tree_
 
UnresolvedNHTree unresolved_nh_tree_
 
SandeshTraceBufferPtr OperDBTraceBuf
 

Detailed Description

Agent supports multiple route tables - Inet-unicast (IPv4/IPv6), Inet-multicast, bridge, EVPN (Type2/Type5). This base class contains common code for all types of route tables.

Definition at line 109 of file agent_route.h.

Member Typedef Documentation

Definition at line 113 of file agent_route.h.

Definition at line 112 of file agent_route.h.

Constructor & Destructor Documentation

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

Definition at line 71 of file agent_route.cc.

Here is the call graph for this function:

AgentRouteTable::~AgentRouteTable ( )
virtual

Definition at line 78 of file agent_route.cc.

Member Function Documentation

void AgentRouteTable::AddChangeInput ( DBTablePartition part,
VrfEntry vrf,
AgentRoute rt,
AgentRouteKey key,
AgentRouteData data 
)

Definition at line 243 of file agent_route.cc.

Here is the call graph for this function:

void AgentRouteTable::AddUnresolvedNH ( const NextHop nh)

Definition at line 389 of file agent_route.cc.

void AgentRouteTable::AddUnresolvedRoute ( const AgentRoute rt)

Definition at line 408 of file agent_route.cc.

Agent* AgentRouteTable::agent ( ) const
inline

Definition at line 159 of file agent_route.h.

unique_ptr< DBEntry > AgentRouteTable::AllocEntry ( const DBRequestKey k) const
virtual

Implements DBTable.

Definition at line 82 of file agent_route.cc.

Here is the call graph for this function:

LifetimeActor * AgentRouteTable::deleter ( )

Definition at line 451 of file agent_route.cc.

void AgentRouteTable::DeleteRouteDone ( DBTable::DBTableWalkRef  walk_ref,
DBTableBase base,
RouteTableWalkerState state 
)
private

Definition at line 147 of file agent_route.cc.

Here is the call graph for this function:

bool AgentRouteTable::DelExplicitRouteWalkerCb ( DBTablePartBase part,
DBEntryBase entry 
)

Definition at line 155 of file agent_route.cc.

Here is the call graph for this function:

AgentRouteTable::DISALLOW_COPY_AND_ASSIGN ( AgentRouteTable  )
private
void AgentRouteTable::EvaluateUnresolvedNH ( void  )

Definition at line 375 of file agent_route.cc.

Here is the call graph for this function:

void AgentRouteTable::EvaluateUnresolvedRoutes ( void  )

Definition at line 399 of file agent_route.cc.

AgentRoute * AgentRouteTable::FindActiveEntry ( const AgentRouteKey key)

Definition at line 417 of file agent_route.cc.

Here is the call graph for this function:

AgentRoute * AgentRouteTable::FindActiveEntry ( const AgentRoute key)

Definition at line 434 of file agent_route.cc.

Here is the call graph for this function:

AgentRoute * AgentRouteTable::FindActiveEntryNoLock ( const AgentRouteKey key)

Definition at line 425 of file agent_route.cc.

Here is the call graph for this function:

AgentRoute * AgentRouteTable::FindActiveEntryNoLock ( const AgentRoute key)

Definition at line 442 of file agent_route.cc.

Here is the call graph for this function:

virtual AgentSandeshPtr AgentRouteTable::GetAgentSandesh ( const AgentSandeshArguments args,
const std::string &  context 
)
inlinevirtual
virtual SandeshTraceBufferPtr AgentRouteTable::GetOperDBTraceBuf ( ) const
inlinevirtual

Definition at line 134 of file agent_route.h.

const string & AgentRouteTable::GetSuffix ( Agent::RouteTableType  type)
static

Definition at line 99 of file agent_route.cc.

Here is the call graph for this function:

virtual std::string AgentRouteTable::GetTableName ( ) const
pure virtual
virtual Agent::RouteTableType AgentRouteTable::GetTableType ( ) const
pure virtual
virtual size_t AgentRouteTable::Hash ( const DBEntry entry) const
inlinevirtual

Reimplemented from DBTable.

Definition at line 120 of file agent_route.h.

virtual size_t AgentRouteTable::Hash ( const DBRequestKey key) const
inlinevirtual

Reimplemented from DBTable.

Definition at line 121 of file agent_route.h.

void AgentRouteTable::Input ( DBTablePartition part,
DBClient client,
DBRequest req 
)
privatevirtual

Reimplemented from DBTable.

Definition at line 199 of file agent_route.cc.

Here is the call graph for this function:

AgentRoute * AgentRouteTable::LocateRoute ( DBTablePartition part,
VrfEntry vrf,
AgentRoute rt,
AgentRouteKey key,
AgentRouteData data,
bool *  notify 
)

Definition at line 322 of file agent_route.cc.

Here is the call graph for this function:

void AgentRouteTable::ManagedDelete ( )

Definition at line 135 of file agent_route.cc.

Here is the call graph for this function:

void AgentRouteTable::NotifyEntry ( AgentRoute entry)
virtual

Definition at line 174 of file agent_route.cc.

Here is the call graph for this function:

virtual int AgentRouteTable::PartitionCount ( ) const
inlinevirtual

Reimplemented from DBTable.

Definition at line 118 of file agent_route.h.

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

Definition at line 93 of file agent_route.cc.

Here is the call graph for this function:

void AgentRouteTable::Process ( DBRequest req)

Definition at line 186 of file agent_route.cc.

Here is the call graph for this function:

virtual void AgentRouteTable::ProcessAdd ( AgentRoute rt)
inlinevirtual

Reimplemented in InetUnicastAgentRouteTable.

Definition at line 127 of file agent_route.h.

virtual void AgentRouteTable::ProcessDelete ( AgentRoute rt)
inlinevirtual

Reimplemented in InetUnicastAgentRouteTable.

Definition at line 126 of file agent_route.h.

void AgentRouteTable::RemoveUnresolvedNH ( const NextHop nh)

Definition at line 393 of file agent_route.cc.

void AgentRouteTable::RemoveUnresolvedRoute ( const AgentRoute rt)

Definition at line 412 of file agent_route.cc.

void AgentRouteTable::RetryDelete ( )
virtual

Reimplemented from DBTableBase.

Definition at line 164 of file agent_route.cc.

Here is the call graph for this function:

void AgentRouteTable::SetVrf ( VrfEntry vrf)

Definition at line 126 of file agent_route.cc.

Here is the call graph for this function:

UnresolvedNHTree::const_iterator AgentRouteTable::unresolved_nh_begin ( ) const
inline

Definition at line 149 of file agent_route.h.

UnresolvedNHTree::const_iterator AgentRouteTable::unresolved_nh_end ( ) const
inline

Definition at line 152 of file agent_route.h.

UnresolvedRouteTree::const_iterator AgentRouteTable::unresolved_route_begin ( ) const
inline

Definition at line 137 of file agent_route.h.

UnresolvedRouteTree::const_iterator AgentRouteTable::unresolved_route_end ( ) const
inline

Definition at line 140 of file agent_route.h.

int AgentRouteTable::unresolved_route_size ( ) const
inline

Definition at line 143 of file agent_route.h.

VrfEntry * AgentRouteTable::vrf_entry ( ) const

Definition at line 459 of file agent_route.cc.

uint32_t AgentRouteTable::vrf_id ( ) const
inline

Definition at line 161 of file agent_route.h.

const std::string & AgentRouteTable::vrf_name ( ) const

Definition at line 455 of file agent_route.cc.

Member Data Documentation

Agent* AgentRouteTable::agent_
private

Definition at line 199 of file agent_route.h.

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

Definition at line 202 of file agent_route.h.

const int AgentRouteTable::kPartitionCount = 1
static

Definition at line 111 of file agent_route.h.

SandeshTraceBufferPtr AgentRouteTable::OperDBTraceBuf
private

Definition at line 208 of file agent_route.h.

UnresolvedNHTree AgentRouteTable::unresolved_nh_tree_
private

Definition at line 205 of file agent_route.h.

UnresolvedRouteTree AgentRouteTable::unresolved_rt_tree_
private

Definition at line 204 of file agent_route.h.

LifetimeRef<AgentRouteTable> AgentRouteTable::vrf_delete_ref_
private

Definition at line 203 of file agent_route.h.

VrfEntryRef AgentRouteTable::vrf_entry_
private

Definition at line 201 of file agent_route.h.

uint32_t AgentRouteTable::vrf_id_
private

Definition at line 200 of file agent_route.h.


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