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

#include <flow_table.h>

Collaboration diagram for FlowTable:

Classes

struct  LinkLocalFlowInfo
 

Public Types

typedef std::map< FlowKey,
FlowEntry *, Inet4FlowKeyCmp
FlowEntryMap
 
typedef std::pair< FlowKey,
FlowEntry * > 
FlowEntryMapPair
 
typedef boost::function< bool(FlowEntry
*flow)> 
FlowEntryCb
 
typedef std::vector< FlowEntryPtrFlowIndexTree
 
typedef std::map< int,
LinkLocalFlowInfo
LinkLocalFlowInfoMap
 
typedef std::pair< int,
LinkLocalFlowInfo
LinkLocalFlowInfoPair
 

Public Member Functions

 FlowTable (Agent *agent, uint16_t table_index)
 
virtual ~FlowTable ()
 
void Init ()
 
void InitDone ()
 
void Shutdown ()
 
void set_ksync_object (FlowTableKSyncObject *obj)
 
FlowTableKSyncObjectksync_object () const
 
FlowEntryLocate (FlowEntry *flow, uint64_t t)
 
FlowEntryFind (const FlowKey &key)
 
void Add (FlowEntry *flow, FlowEntry *rflow)
 
void Update (FlowEntry *flow, FlowEntry *rflow)
 
bool Delete (const FlowKey &key, bool del_reverse_flow)
 
void DeleteAll ()
 
void DeleteFlow (const AclDBEntry *acl, const FlowKey &key, AclEntryIDList &id_list)
 
Agentagent () const
 
uint16_t table_index () const
 
size_t Size ()
 
FlowTable::FlowEntryMap::iterator begin ()
 
FlowTable::FlowEntryMap::iterator end ()
 
const LinkLocalFlowInfoMaplinklocal_flow_info_map ()
 
void AddLinkLocalFlowInfo (int fd, uint32_t index, const FlowKey &key, const uint64_t timestamp)
 
void DelLinkLocalFlowInfo (int fd)
 
void Copy (FlowEntry *lhs, FlowEntry *rhs, bool update)
 
void SetAclFlowSandeshData (const AclDBEntry *acl, AclFlowResp &data, const int last_count)
 
void SetAceSandeshData (const AclDBEntry *acl, AclFlowCountResp &data, int ace_id)
 
void RecomputeFlow (FlowEntry *flow)
 
void DeleteMessage (FlowEntry *flow)
 
void DeleteVrf (VrfEntry *vrf)
 
void HandleRevaluateDBEntry (const DBEntry *entry, FlowEntry *flow, bool active_flow, bool deleted_flow)
 
void HandleKSyncError (FlowEntry *flow, FlowTableKSyncEntry *ksync_entry, int ksync_error, uint32_t flow_handle, uint32_t gen_id)
 
boost::uuids::uuid rand_gen ()
 
void UpdateKSync (FlowEntry *flow, bool update)
 
void DeleteKSync (FlowEntry *flow)
 
void GrowFreeList ()
 
FlowEntryFreeListfree_list ()
 
void ProcessKSyncFlowEvent (const FlowEventKSync *req, FlowEntry *flow)
 
bool ProcessFlowEvent (const FlowEvent *req, FlowEntry *flow, FlowEntry *rflow)
 
void PopulateFlowEntriesUsingKey (const FlowKey &key, bool reverse_flow, FlowEntry **flow, FlowEntry **rflow)
 
bool ConcurrencyCheck (int task_id, bool check_task_instance)
 
bool ConcurrencyCheck (int task_id)
 
int flow_task_id () const
 
int flow_update_task_id () const
 
int flow_delete_task_id () const
 
int flow_ksync_task_id () const
 
int flow_logging_task_id () const
 

Static Public Member Functions

static const char * TaskName ()
 
static void GetMutexSeq (tbb::mutex &mutex1, tbb::mutex &mutex2, tbb::mutex **mutex_ptr_1, tbb::mutex **mutex_ptr_2)
 
static void GetFlowSandeshActionParams (const FlowAction &action_info, std::string &action_str)
 

Static Public Attributes

static const uint32_t kPortNatFlowTableInstance = 0
 
static const uint32_t kInvalidFlowTableInstance = 0xFF
 

Private Member Functions

void DisableKSyncSend (FlowEntry *flow, uint32_t evict_gen_id)
 
bool IsEvictedFlow (const FlowKey &key)
 
void DeleteFlowUveInfo (FlowEntry *fe)
 
void DeleteInternal (FlowEntry *fe, uint64_t t, const RevFlowDepParams &p)
 
void DeleteFlowInfo (FlowEntry *fe, const RevFlowDepParams &params)
 
void AddFlowInfo (FlowEntry *fe)
 
void UpdateReverseFlow (FlowEntry *flow, FlowEntry *rflow)
 
void UpdateUnLocked (FlowEntry *flow, FlowEntry *rflow)
 
void AddInternal (FlowEntry *flow, FlowEntry *new_flow, FlowEntry *rflow, FlowEntry *new_rflow, bool fwd_flow_update, bool rev_flow_update)
 
void Add (FlowEntry *flow, FlowEntry *new_flow, FlowEntry *rflow, FlowEntry *new_rflow, bool fwd_flow_update, bool rev_flow_update)
 
void EvictFlow (FlowEntry *flow, FlowEntry *rflow, uint32_t evict_gen_id)
 
bool DeleteFlows (FlowEntry *flow, FlowEntry *rflow)
 
bool DeleteUnLocked (const FlowKey &key, bool del_reverse_flow)
 
bool DeleteUnLocked (bool del_reverse_flow, FlowEntry *flow, FlowEntry *rflow)
 
void ReleasePort (FlowEntry *flow, bool evict)
 
 DISALLOW_COPY_AND_ASSIGN (FlowTable)
 

Private Attributes

Agentagent_
 
boost::uuids::random_generator rand_gen_
 
uint16_t table_index_
 
FlowTableKSyncObjectksync_object_
 
FlowEntryMap flow_entry_map_
 
FlowIndexTree flow_index_tree_
 
LinkLocalFlowInfoMap linklocal_flow_info_map_
 
FlowEntryFreeList free_list_
 
tbb::mutex mutex_
 
int flow_task_id_
 
int flow_update_task_id_
 
int flow_delete_task_id_
 
int flow_ksync_task_id_
 
int flow_logging_task_id_
 

Friends

class FlowStatsCollector
 
class PktSandeshFlow
 
class PktSandeshFlowStats
 
class FetchFlowRecord
 
class PktFlowInfo
 
void intrusive_ptr_release (FlowEntry *fe)
 

Detailed Description

Definition at line 152 of file flow_table.h.

Member Typedef Documentation

typedef boost::function<bool(FlowEntry *flow)> FlowTable::FlowEntryCb

Definition at line 159 of file flow_table.h.

Definition at line 157 of file flow_table.h.

Definition at line 158 of file flow_table.h.

typedef std::vector<FlowEntryPtr> FlowTable::FlowIndexTree

Definition at line 160 of file flow_table.h.

Definition at line 170 of file flow_table.h.

Definition at line 171 of file flow_table.h.

Constructor & Destructor Documentation

FlowTable::FlowTable ( Agent agent,
uint16_t  table_index 
)

Definition at line 58 of file flow_table.cc.

FlowTable::~FlowTable ( )
virtual

Definition at line 72 of file flow_table.cc.

Member Function Documentation

void FlowTable::Add ( FlowEntry flow,
FlowEntry rflow 
)

Definition at line 175 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::Add ( FlowEntry flow,
FlowEntry new_flow,
FlowEntry rflow,
FlowEntry new_rflow,
bool  fwd_flow_update,
bool  rev_flow_update 
)
private
void FlowTable::AddFlowInfo ( FlowEntry fe)
private

Definition at line 503 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::AddInternal ( FlowEntry flow,
FlowEntry new_flow,
FlowEntry rflow,
FlowEntry new_rflow,
bool  fwd_flow_update,
bool  rev_flow_update 
)
private

Definition at line 201 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::AddLinkLocalFlowInfo ( int  fd,
uint32_t  index,
const FlowKey key,
const uint64_t  timestamp 
)

Definition at line 753 of file flow_table.cc.

Agent* FlowTable::agent ( ) const
inline

Definition at line 197 of file flow_table.h.

FlowTable::FlowEntryMap::iterator FlowTable::begin ( )
inline

Definition at line 200 of file flow_table.h.

bool FlowTable::ConcurrencyCheck ( int  task_id,
bool  check_task_instance 
)

Definition at line 95 of file flow_table.cc.

Here is the call graph for this function:

bool FlowTable::ConcurrencyCheck ( int  task_id)

Definition at line 112 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::Copy ( FlowEntry lhs,
FlowEntry rhs,
bool  update 
)

Definition at line 148 of file flow_table.cc.

Here is the call graph for this function:

bool FlowTable::Delete ( const FlowKey key,
bool  del_reverse_flow 
)

Definition at line 420 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::DeleteAll ( )

Definition at line 429 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::DeleteFlow ( const AclDBEntry acl,
const FlowKey key,
AclEntryIDList id_list 
)
void FlowTable::DeleteFlowInfo ( FlowEntry fe,
const RevFlowDepParams params 
)
private

Definition at line 507 of file flow_table.cc.

Here is the call graph for this function:

bool FlowTable::DeleteFlows ( FlowEntry flow,
FlowEntry rflow 
)
private

Definition at line 342 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::DeleteFlowUveInfo ( FlowEntry fe)
private

Definition at line 496 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::DeleteInternal ( FlowEntry fe,
uint64_t  t,
const RevFlowDepParams p 
)
private

Definition at line 323 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::DeleteKSync ( FlowEntry flow)

Definition at line 729 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::DeleteMessage ( FlowEntry flow)

Definition at line 534 of file flow_table.cc.

Here is the call graph for this function:

bool FlowTable::DeleteUnLocked ( const FlowKey key,
bool  del_reverse_flow 
)
private

Definition at line 412 of file flow_table.cc.

Here is the call graph for this function:

bool FlowTable::DeleteUnLocked ( bool  del_reverse_flow,
FlowEntry flow,
FlowEntry rflow 
)
private

Definition at line 392 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::DeleteVrf ( VrfEntry vrf)
void FlowTable::DelLinkLocalFlowInfo ( int  fd)

Definition at line 766 of file flow_table.cc.

void FlowTable::DisableKSyncSend ( FlowEntry flow,
uint32_t  evict_gen_id 
)
private

Definition at line 745 of file flow_table.cc.

Here is the call graph for this function:

FlowTable::DISALLOW_COPY_AND_ASSIGN ( FlowTable  )
private
FlowTable::FlowEntryMap::iterator FlowTable::end ( )
inline

Definition at line 203 of file flow_table.h.

void FlowTable::EvictFlow ( FlowEntry flow,
FlowEntry rflow,
uint32_t  evict_gen_id 
)
private

Definition at line 547 of file flow_table.cc.

Here is the call graph for this function:

FlowEntry * FlowTable::Find ( const FlowKey key)

Definition at line 136 of file flow_table.cc.

Here is the call graph for this function:

int FlowTable::flow_delete_task_id ( ) const
inline

Definition at line 254 of file flow_table.h.

int FlowTable::flow_ksync_task_id ( ) const
inline

Definition at line 255 of file flow_table.h.

int FlowTable::flow_logging_task_id ( ) const
inline

Definition at line 256 of file flow_table.h.

int FlowTable::flow_task_id ( ) const
inline

Definition at line 252 of file flow_table.h.

int FlowTable::flow_update_task_id ( ) const
inline

Definition at line 253 of file flow_table.h.

FlowEntryFreeList* FlowTable::free_list ( )
inline

Definition at line 239 of file flow_table.h.

void FlowTable::GetFlowSandeshActionParams ( const FlowAction action_info,
std::string &  action_str 
)
static

Definition at line 944 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::GetMutexSeq ( tbb::mutex &  mutex1,
tbb::mutex &  mutex2,
tbb::mutex **  mutex_ptr_1,
tbb::mutex **  mutex_ptr_2 
)
static

Definition at line 122 of file flow_table.cc.

void FlowTable::GrowFreeList ( )

Definition at line 960 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::HandleKSyncError ( FlowEntry flow,
FlowTableKSyncEntry ksync_entry,
int  ksync_error,
uint32_t  flow_handle,
uint32_t  gen_id 
)

Definition at line 649 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::HandleRevaluateDBEntry ( const DBEntry entry,
FlowEntry flow,
bool  active_flow,
bool  deleted_flow 
)

Definition at line 559 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::Init ( )

Definition at line 76 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::InitDone ( )

Definition at line 86 of file flow_table.cc.

bool FlowTable::IsEvictedFlow ( const FlowKey key)
private
FlowTableKSyncObject* FlowTable::ksync_object ( ) const
inline

Definition at line 182 of file flow_table.h.

const LinkLocalFlowInfoMap& FlowTable::linklocal_flow_info_map ( )
inline

Definition at line 207 of file flow_table.h.

FlowEntry * FlowTable::Locate ( FlowEntry flow,
uint64_t  t 
)

Definition at line 162 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::PopulateFlowEntriesUsingKey ( const FlowKey key,
bool  reverse_flow,
FlowEntry **  flow,
FlowEntry **  rflow 
)

Definition at line 368 of file flow_table.cc.

Here is the call graph for this function:

bool FlowTable::ProcessFlowEvent ( const FlowEvent req,
FlowEntry flow,
FlowEntry rflow 
)

Definition at line 842 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::ProcessKSyncFlowEvent ( const FlowEventKSync req,
FlowEntry flow 
)

Definition at line 776 of file flow_table.cc.

Here is the call graph for this function:

boost::uuids::uuid FlowTable::rand_gen ( )

Definition at line 514 of file flow_table.cc.

void FlowTable::RecomputeFlow ( FlowEntry flow)

Definition at line 519 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::ReleasePort ( FlowEntry flow,
bool  evict 
)
private

Definition at line 538 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::set_ksync_object ( FlowTableKSyncObject obj)
inline

Definition at line 181 of file flow_table.h.

void FlowTable::SetAceSandeshData ( const AclDBEntry acl,
AclFlowCountResp &  data,
int  ace_id 
)
void FlowTable::SetAclFlowSandeshData ( const AclDBEntry acl,
AclFlowResp &  data,
const int  last_count 
)
void FlowTable::Shutdown ( )

Definition at line 89 of file flow_table.cc.

size_t FlowTable::Size ( )
inline

Definition at line 199 of file flow_table.h.

uint16_t FlowTable::table_index ( ) const
inline

Definition at line 198 of file flow_table.h.

static const char* FlowTable::TaskName ( )
inlinestatic

Definition at line 214 of file flow_table.h.

void FlowTable::Update ( FlowEntry flow,
FlowEntry rflow 
)

Definition at line 184 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::UpdateKSync ( FlowEntry flow,
bool  update 
)

Definition at line 734 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::UpdateReverseFlow ( FlowEntry flow,
FlowEntry rflow 
)
private

Definition at line 447 of file flow_table.cc.

Here is the call graph for this function:

void FlowTable::UpdateUnLocked ( FlowEntry flow,
FlowEntry rflow 
)
private

Friends And Related Function Documentation

friend class FetchFlowRecord
friend

Definition at line 265 of file flow_table.h.

friend class FlowStatsCollector
friend

Definition at line 262 of file flow_table.h.

void intrusive_ptr_release ( FlowEntry fe)
friend

Definition at line 570 of file flow_entry.cc.

friend class PktFlowInfo
friend

Definition at line 266 of file flow_table.h.

friend class PktSandeshFlow
friend

Definition at line 263 of file flow_table.h.

friend class PktSandeshFlowStats
friend

Definition at line 264 of file flow_table.h.

Member Data Documentation

Agent* FlowTable::agent_
private

Definition at line 293 of file flow_table.h.

int FlowTable::flow_delete_task_id_
private

Definition at line 306 of file flow_table.h.

FlowEntryMap FlowTable::flow_entry_map_
private

Definition at line 297 of file flow_table.h.

FlowIndexTree FlowTable::flow_index_tree_
private

Definition at line 299 of file flow_table.h.

int FlowTable::flow_ksync_task_id_
private

Definition at line 307 of file flow_table.h.

int FlowTable::flow_logging_task_id_
private

Definition at line 308 of file flow_table.h.

int FlowTable::flow_task_id_
private

Definition at line 304 of file flow_table.h.

int FlowTable::flow_update_task_id_
private

Definition at line 305 of file flow_table.h.

FlowEntryFreeList FlowTable::free_list_
private

Definition at line 302 of file flow_table.h.

const uint32_t FlowTable::kInvalidFlowTableInstance = 0xFF
static

Definition at line 155 of file flow_table.h.

const uint32_t FlowTable::kPortNatFlowTableInstance = 0
static

Definition at line 154 of file flow_table.h.

FlowTableKSyncObject* FlowTable::ksync_object_
private

Definition at line 296 of file flow_table.h.

LinkLocalFlowInfoMap FlowTable::linklocal_flow_info_map_
private

Definition at line 301 of file flow_table.h.

tbb::mutex FlowTable::mutex_
private

Definition at line 303 of file flow_table.h.

boost::uuids::random_generator FlowTable::rand_gen_
private

Definition at line 294 of file flow_table.h.

uint16_t FlowTable::table_index_
private

Definition at line 295 of file flow_table.h.


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