OpenSDN source code
FlowTable Class Reference

#include <flow_table.h>

Collaboration diagram for FlowTable:

Classes

struct  LinkLocalFlowInfo
 

Public Types

typedef std::map< FlowKey, FlowEntry *, Inet4FlowKeyCmpFlowEntryMap
 
typedef std::pair< FlowKey, FlowEntry * > FlowEntryMapPair
 
typedef boost::function< bool(FlowEntry *flow)> FlowEntryCb
 
typedef std::vector< FlowEntryPtrFlowIndexTree
 
typedef std::map< int, LinkLocalFlowInfoLinkLocalFlowInfoMap
 
typedef std::pair< int, LinkLocalFlowInfoLinkLocalFlowInfoPair
 

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

◆ FlowEntryCb

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

Definition at line 159 of file flow_table.h.

◆ FlowEntryMap

Definition at line 157 of file flow_table.h.

◆ FlowEntryMapPair

Definition at line 158 of file flow_table.h.

◆ FlowIndexTree

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

Definition at line 160 of file flow_table.h.

◆ LinkLocalFlowInfoMap

Definition at line 170 of file flow_table.h.

◆ LinkLocalFlowInfoPair

Definition at line 171 of file flow_table.h.

Constructor & Destructor Documentation

◆ FlowTable()

FlowTable::FlowTable ( Agent agent,
uint16_t  table_index 
)

Definition at line 58 of file flow_table.cc.

◆ ~FlowTable()

FlowTable::~FlowTable ( )
virtual

Definition at line 72 of file flow_table.cc.

Member Function Documentation

◆ Add() [1/2]

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

◆ Add() [2/2]

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

Definition at line 175 of file flow_table.cc.

Here is the call graph for this function:

◆ AddFlowInfo()

void FlowTable::AddFlowInfo ( FlowEntry fe)
private

Definition at line 503 of file flow_table.cc.

Here is the call graph for this function:

◆ AddInternal()

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:

◆ AddLinkLocalFlowInfo()

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

Definition at line 761 of file flow_table.cc.

◆ agent()

Agent* FlowTable::agent ( ) const
inline

Definition at line 197 of file flow_table.h.

◆ begin()

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

Definition at line 200 of file flow_table.h.

◆ ConcurrencyCheck() [1/2]

bool FlowTable::ConcurrencyCheck ( int  task_id)

Definition at line 112 of file flow_table.cc.

Here is the call graph for this function:

◆ ConcurrencyCheck() [2/2]

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:

◆ Copy()

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:

◆ Delete()

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:

◆ DeleteAll()

void FlowTable::DeleteAll ( )

Definition at line 429 of file flow_table.cc.

Here is the call graph for this function:

◆ DeleteFlow()

void FlowTable::DeleteFlow ( const AclDBEntry acl,
const FlowKey key,
AclEntryIDList id_list 
)

◆ DeleteFlowInfo()

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:

◆ DeleteFlows()

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:

◆ DeleteFlowUveInfo()

void FlowTable::DeleteFlowUveInfo ( FlowEntry fe)
private

Definition at line 496 of file flow_table.cc.

Here is the call graph for this function:

◆ DeleteInternal()

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:

◆ DeleteKSync()

void FlowTable::DeleteKSync ( FlowEntry flow)

Definition at line 737 of file flow_table.cc.

Here is the call graph for this function:

◆ DeleteMessage()

void FlowTable::DeleteMessage ( FlowEntry flow)

Definition at line 534 of file flow_table.cc.

Here is the call graph for this function:

◆ DeleteUnLocked() [1/2]

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:

◆ DeleteUnLocked() [2/2]

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:

◆ DeleteVrf()

void FlowTable::DeleteVrf ( VrfEntry vrf)

◆ DelLinkLocalFlowInfo()

void FlowTable::DelLinkLocalFlowInfo ( int  fd)

Definition at line 774 of file flow_table.cc.

◆ DisableKSyncSend()

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

Definition at line 753 of file flow_table.cc.

Here is the call graph for this function:

◆ DISALLOW_COPY_AND_ASSIGN()

FlowTable::DISALLOW_COPY_AND_ASSIGN ( FlowTable  )
private

◆ end()

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

Definition at line 203 of file flow_table.h.

◆ EvictFlow()

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:

◆ Find()

FlowEntry * FlowTable::Find ( const FlowKey key)

Definition at line 136 of file flow_table.cc.

Here is the call graph for this function:

◆ flow_delete_task_id()

int FlowTable::flow_delete_task_id ( ) const
inline

Definition at line 254 of file flow_table.h.

◆ flow_ksync_task_id()

int FlowTable::flow_ksync_task_id ( ) const
inline

Definition at line 255 of file flow_table.h.

◆ flow_logging_task_id()

int FlowTable::flow_logging_task_id ( ) const
inline

Definition at line 256 of file flow_table.h.

◆ flow_task_id()

int FlowTable::flow_task_id ( ) const
inline

Definition at line 252 of file flow_table.h.

◆ flow_update_task_id()

int FlowTable::flow_update_task_id ( ) const
inline

Definition at line 253 of file flow_table.h.

◆ free_list()

FlowEntryFreeList* FlowTable::free_list ( )
inline

Definition at line 239 of file flow_table.h.

◆ GetFlowSandeshActionParams()

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

Definition at line 952 of file flow_table.cc.

Here is the call graph for this function:

◆ GetMutexSeq()

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.

◆ GrowFreeList()

void FlowTable::GrowFreeList ( )

Definition at line 968 of file flow_table.cc.

Here is the call graph for this function:

◆ HandleKSyncError()

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:

◆ HandleRevaluateDBEntry()

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:

◆ Init()

void FlowTable::Init ( )

Definition at line 76 of file flow_table.cc.

Here is the call graph for this function:

◆ InitDone()

void FlowTable::InitDone ( )

Definition at line 86 of file flow_table.cc.

◆ IsEvictedFlow()

bool FlowTable::IsEvictedFlow ( const FlowKey key)
private

◆ ksync_object()

FlowTableKSyncObject* FlowTable::ksync_object ( ) const
inline

Definition at line 182 of file flow_table.h.

◆ linklocal_flow_info_map()

const LinkLocalFlowInfoMap& FlowTable::linklocal_flow_info_map ( )
inline

Definition at line 207 of file flow_table.h.

◆ Locate()

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:

◆ PopulateFlowEntriesUsingKey()

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:

◆ ProcessFlowEvent()

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

Definition at line 850 of file flow_table.cc.

Here is the call graph for this function:

◆ ProcessKSyncFlowEvent()

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

Definition at line 784 of file flow_table.cc.

Here is the call graph for this function:

◆ rand_gen()

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

Definition at line 514 of file flow_table.cc.

◆ RecomputeFlow()

void FlowTable::RecomputeFlow ( FlowEntry flow)

Definition at line 519 of file flow_table.cc.

Here is the call graph for this function:

◆ ReleasePort()

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:

◆ set_ksync_object()

void FlowTable::set_ksync_object ( FlowTableKSyncObject obj)
inline

Definition at line 181 of file flow_table.h.

◆ SetAceSandeshData()

void FlowTable::SetAceSandeshData ( const AclDBEntry acl,
AclFlowCountResp &  data,
int  ace_id 
)

◆ SetAclFlowSandeshData()

void FlowTable::SetAclFlowSandeshData ( const AclDBEntry acl,
AclFlowResp &  data,
const int  last_count 
)

◆ Shutdown()

void FlowTable::Shutdown ( )

Definition at line 89 of file flow_table.cc.

◆ Size()

size_t FlowTable::Size ( )
inline

Definition at line 199 of file flow_table.h.

◆ table_index()

uint16_t FlowTable::table_index ( ) const
inline

Definition at line 198 of file flow_table.h.

◆ TaskName()

static const char* FlowTable::TaskName ( )
inlinestatic

Definition at line 214 of file flow_table.h.

◆ Update()

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

Definition at line 184 of file flow_table.cc.

Here is the call graph for this function:

◆ UpdateKSync()

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

Definition at line 742 of file flow_table.cc.

Here is the call graph for this function:

◆ UpdateReverseFlow()

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:

◆ UpdateUnLocked()

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

Friends And Related Function Documentation

◆ FetchFlowRecord

friend class FetchFlowRecord
friend

Definition at line 265 of file flow_table.h.

◆ FlowStatsCollector

friend class FlowStatsCollector
friend

Definition at line 262 of file flow_table.h.

◆ intrusive_ptr_release

void intrusive_ptr_release ( FlowEntry fe)
friend

Definition at line 570 of file flow_entry.cc.

◆ PktFlowInfo

friend class PktFlowInfo
friend

Definition at line 266 of file flow_table.h.

◆ PktSandeshFlow

friend class PktSandeshFlow
friend

Definition at line 263 of file flow_table.h.

◆ PktSandeshFlowStats

friend class PktSandeshFlowStats
friend

Definition at line 264 of file flow_table.h.

Member Data Documentation

◆ agent_

Agent* FlowTable::agent_
private

Definition at line 293 of file flow_table.h.

◆ flow_delete_task_id_

int FlowTable::flow_delete_task_id_
private

Definition at line 306 of file flow_table.h.

◆ flow_entry_map_

FlowEntryMap FlowTable::flow_entry_map_
private

Definition at line 297 of file flow_table.h.

◆ flow_index_tree_

FlowIndexTree FlowTable::flow_index_tree_
private

Definition at line 299 of file flow_table.h.

◆ flow_ksync_task_id_

int FlowTable::flow_ksync_task_id_
private

Definition at line 307 of file flow_table.h.

◆ flow_logging_task_id_

int FlowTable::flow_logging_task_id_
private

Definition at line 308 of file flow_table.h.

◆ flow_task_id_

int FlowTable::flow_task_id_
private

Definition at line 304 of file flow_table.h.

◆ flow_update_task_id_

int FlowTable::flow_update_task_id_
private

Definition at line 305 of file flow_table.h.

◆ free_list_

FlowEntryFreeList FlowTable::free_list_
private

Definition at line 302 of file flow_table.h.

◆ kInvalidFlowTableInstance

const uint32_t FlowTable::kInvalidFlowTableInstance = 0xFF
static

Definition at line 155 of file flow_table.h.

◆ kPortNatFlowTableInstance

const uint32_t FlowTable::kPortNatFlowTableInstance = 0
static

Definition at line 154 of file flow_table.h.

◆ ksync_object_

FlowTableKSyncObject* FlowTable::ksync_object_
private

Definition at line 296 of file flow_table.h.

◆ linklocal_flow_info_map_

LinkLocalFlowInfoMap FlowTable::linklocal_flow_info_map_
private

Definition at line 301 of file flow_table.h.

◆ mutex_

tbb::mutex FlowTable::mutex_
private

Definition at line 303 of file flow_table.h.

◆ rand_gen_

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

Definition at line 294 of file flow_table.h.

◆ table_index_

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: