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 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_
 
std::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 162 of file flow_table.h.

Member Typedef Documentation

◆ FlowEntryCb

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

Definition at line 169 of file flow_table.h.

◆ FlowEntryMap

Definition at line 167 of file flow_table.h.

◆ FlowEntryMapPair

Definition at line 168 of file flow_table.h.

◆ FlowIndexTree

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

Definition at line 170 of file flow_table.h.

◆ LinkLocalFlowInfoMap

Definition at line 180 of file flow_table.h.

◆ LinkLocalFlowInfoPair

Definition at line 181 of file flow_table.h.

Constructor & Destructor Documentation

◆ FlowTable()

FlowTable::FlowTable ( Agent agent,
uint16_t  table_index 
)

Definition at line 59 of file flow_table.cc.

◆ ~FlowTable()

FlowTable::~FlowTable ( )
virtual

Definition at line 73 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 160 of file flow_table.cc.

Here is the call graph for this function:

◆ AddFlowInfo()

void FlowTable::AddFlowInfo ( FlowEntry fe)
private

Definition at line 488 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 186 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 746 of file flow_table.cc.

◆ agent()

Agent* FlowTable::agent ( ) const
inline

Definition at line 207 of file flow_table.h.

◆ begin()

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

Definition at line 210 of file flow_table.h.

◆ ConcurrencyCheck() [1/2]

bool FlowTable::ConcurrencyCheck ( int  task_id)

Definition at line 113 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 96 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 133 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 405 of file flow_table.cc.

Here is the call graph for this function:

◆ DeleteAll()

void FlowTable::DeleteAll ( )

Definition at line 414 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 492 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 327 of file flow_table.cc.

Here is the call graph for this function:

◆ DeleteFlowUveInfo()

void FlowTable::DeleteFlowUveInfo ( FlowEntry fe)
private

Definition at line 481 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 308 of file flow_table.cc.

Here is the call graph for this function:

◆ DeleteKSync()

void FlowTable::DeleteKSync ( FlowEntry flow)

Definition at line 722 of file flow_table.cc.

Here is the call graph for this function:

◆ DeleteMessage()

void FlowTable::DeleteMessage ( FlowEntry flow)

Definition at line 519 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 377 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 397 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 759 of file flow_table.cc.

◆ DisableKSyncSend()

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

Definition at line 738 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 213 of file flow_table.h.

◆ EvictFlow()

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

Definition at line 532 of file flow_table.cc.

Here is the call graph for this function:

◆ Find()

FlowEntry * FlowTable::Find ( const FlowKey key)

Definition at line 121 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 264 of file flow_table.h.

◆ flow_ksync_task_id()

int FlowTable::flow_ksync_task_id ( ) const
inline

Definition at line 265 of file flow_table.h.

◆ flow_logging_task_id()

int FlowTable::flow_logging_task_id ( ) const
inline

Definition at line 266 of file flow_table.h.

◆ flow_task_id()

int FlowTable::flow_task_id ( ) const
inline

Definition at line 262 of file flow_table.h.

◆ flow_update_task_id()

int FlowTable::flow_update_task_id ( ) const
inline

Definition at line 263 of file flow_table.h.

◆ free_list()

FlowEntryFreeList* FlowTable::free_list ( )
inline

Definition at line 249 of file flow_table.h.

◆ GetFlowSandeshActionParams()

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

Definition at line 937 of file flow_table.cc.

Here is the call graph for this function:

◆ GrowFreeList()

void FlowTable::GrowFreeList ( )

Definition at line 953 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 634 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 544 of file flow_table.cc.

Here is the call graph for this function:

◆ Init()

void FlowTable::Init ( )

Definition at line 77 of file flow_table.cc.

Here is the call graph for this function:

◆ InitDone()

void FlowTable::InitDone ( )

Definition at line 87 of file flow_table.cc.

◆ IsEvictedFlow()

bool FlowTable::IsEvictedFlow ( const FlowKey key)
private

◆ ksync_object()

FlowTableKSyncObject* FlowTable::ksync_object ( ) const
inline

Definition at line 192 of file flow_table.h.

◆ linklocal_flow_info_map()

const LinkLocalFlowInfoMap& FlowTable::linklocal_flow_info_map ( )
inline

Definition at line 217 of file flow_table.h.

◆ Locate()

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

Definition at line 147 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 353 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 835 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 769 of file flow_table.cc.

Here is the call graph for this function:

◆ rand_gen()

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

Definition at line 499 of file flow_table.cc.

◆ RecomputeFlow()

void FlowTable::RecomputeFlow ( FlowEntry flow)

Definition at line 504 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 523 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 191 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 90 of file flow_table.cc.

◆ Size()

size_t FlowTable::Size ( )
inline

Definition at line 209 of file flow_table.h.

◆ table_index()

uint16_t FlowTable::table_index ( ) const
inline

Definition at line 208 of file flow_table.h.

◆ TaskName()

static const char* FlowTable::TaskName ( )
inlinestatic

Definition at line 224 of file flow_table.h.

◆ Update()

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

Definition at line 169 of file flow_table.cc.

Here is the call graph for this function:

◆ UpdateKSync()

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

Definition at line 727 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 432 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 273 of file flow_table.h.

◆ FlowStatsCollector

friend class FlowStatsCollector
friend

Definition at line 270 of file flow_table.h.

◆ intrusive_ptr_release

void intrusive_ptr_release ( FlowEntry fe)
friend

Definition at line 571 of file flow_entry.cc.

◆ PktFlowInfo

friend class PktFlowInfo
friend

Definition at line 274 of file flow_table.h.

◆ PktSandeshFlow

friend class PktSandeshFlow
friend

Definition at line 271 of file flow_table.h.

◆ PktSandeshFlowStats

friend class PktSandeshFlowStats
friend

Definition at line 272 of file flow_table.h.

Member Data Documentation

◆ agent_

Agent* FlowTable::agent_
private

Definition at line 301 of file flow_table.h.

◆ flow_delete_task_id_

int FlowTable::flow_delete_task_id_
private

Definition at line 314 of file flow_table.h.

◆ flow_entry_map_

FlowEntryMap FlowTable::flow_entry_map_
private

Definition at line 305 of file flow_table.h.

◆ flow_index_tree_

FlowIndexTree FlowTable::flow_index_tree_
private

Definition at line 307 of file flow_table.h.

◆ flow_ksync_task_id_

int FlowTable::flow_ksync_task_id_
private

Definition at line 315 of file flow_table.h.

◆ flow_logging_task_id_

int FlowTable::flow_logging_task_id_
private

Definition at line 316 of file flow_table.h.

◆ flow_task_id_

int FlowTable::flow_task_id_
private

Definition at line 312 of file flow_table.h.

◆ flow_update_task_id_

int FlowTable::flow_update_task_id_
private

Definition at line 313 of file flow_table.h.

◆ free_list_

FlowEntryFreeList FlowTable::free_list_
private

Definition at line 310 of file flow_table.h.

◆ kInvalidFlowTableInstance

const uint32_t FlowTable::kInvalidFlowTableInstance = 0xFF
static

Definition at line 165 of file flow_table.h.

◆ kPortNatFlowTableInstance

const uint32_t FlowTable::kPortNatFlowTableInstance = 0
static

Definition at line 164 of file flow_table.h.

◆ ksync_object_

FlowTableKSyncObject* FlowTable::ksync_object_
private

Definition at line 304 of file flow_table.h.

◆ linklocal_flow_info_map_

LinkLocalFlowInfoMap FlowTable::linklocal_flow_info_map_
private

Definition at line 309 of file flow_table.h.

◆ mutex_

std::mutex FlowTable::mutex_
private

Definition at line 311 of file flow_table.h.

◆ rand_gen_

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

Definition at line 302 of file flow_table.h.

◆ table_index_

uint16_t FlowTable::table_index_
private

Definition at line 303 of file flow_table.h.


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