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

#include <flow_proto.h>

Inheritance diagram for FlowProto:
Collaboration diagram for FlowProto:

Public Member Functions

 FlowProto (Agent *agent, boost::asio::io_context &io)
 
virtual ~FlowProto ()
 
void Init ()
 
void InitDone ()
 
void Shutdown ()
 
void FlushFlows ()
 
bool Validate (PktInfo *msg)
 
FlowHandlerAllocProtoHandler (PktInfoPtr info, boost::asio::io_context &io)
 
bool Enqueue (PktInfoPtr msg)
 
FlowEntryFind (const FlowKey &key, uint32_t table_index) const
 
uint16_t FlowTableIndex (const IpAddress &sip, const IpAddress &dip, uint8_t proto, uint16_t sport, uint16_t dport, uint32_t flow_handle) const
 
uint32_t flow_table_count () const
 
FlowTableGetTable (uint16_t index) const
 
FlowTableGetFlowTable (const FlowKey &key, uint32_t flow_handle) const
 
uint32_t FlowCount () const
 
void VnFlowCounters (const VnEntry *vn, uint32_t *in_count, uint32_t *out_count)
 
void InterfaceFlowCount (const Interface *intf, uint64_t *created, uint64_t *aged, uint32_t *active_flows) const
 
bool AddFlow (FlowEntry *flow)
 
bool UpdateFlow (FlowEntry *flow)
 
void EnqueueFlowEvent (FlowEvent *event)
 
void ForceEnqueueFreeFlowReference (FlowEntryPtr &flow)
 
void DeleteFlowRequest (FlowEntry *flow)
 
void DeleteFlowRequest (const FlowKey &key)
 
void EvictFlowRequest (FlowEntry *flow, uint32_t flow_handle, uint8_t gen_id, uint8_t evict_gen_id)
 
void CreateAuditEntry (const FlowKey &key, uint32_t flow_handle, uint8_t gen_id)
 
bool FlowEventHandler (FlowEvent *req, FlowTable *table)
 
bool FlowUpdateHandler (FlowEvent *req)
 
bool FlowDeleteHandler (FlowEvent *req, FlowTable *table)
 
bool FlowKSyncMsgHandler (FlowEvent *req, FlowTable *table)
 
void GrowFreeListRequest (FlowTable *table)
 
void KSyncEventRequest (KSyncEntry *ksync_entry, KSyncEntry::KSyncEvent event, uint32_t flow_handle, uint8_t gen_id, int ksync_error, uint64_t evict_flow_bytes, uint64_t evict_flow_packets, int32_t evict_flow_oflow, uint32_t transcation_id)
 
void MessageRequest (FlowEntry *flow)
 
void DisableFlowEventQueue (uint32_t index, bool disabled)
 
void DisableFlowUpdateQueue (bool disabled)
 
void DisableFlowKSyncQueue (uint32_t index, bool disabled)
 
void DisableFlowDeleteQueue (uint32_t index, bool disabled)
 
size_t FlowUpdateQueueLength ()
 
const FlowStatsflow_stats () const
 
void SetProfileData (ProfileData *data)
 
uint32_t linklocal_flow_count () const
 
void update_linklocal_flow_count (int val)
 
bool EnqueueReentrant (boost::shared_ptr< PktInfo > msg, uint8_t table_index)
 
bool ShouldTrace (const FlowEntry *flow, const FlowEntry *rflow)
 
void EnqueueUnResolvedFlowEntry (FlowEntry *flow)
 
virtual void TokenAvailable (TokenPool *pool_base)
 
TokenPtr GetToken (FlowEvent::Event event)
 
bool TokenCheck (const FlowTokenPool *pool) const
 
PortTableManagerport_table_manager ()
 
- Public Member Functions inherited from Proto
 Proto (Agent *agent, const char *task_name, PktHandler::PktModuleName mod, boost::asio::io_context &io)
 
virtual ~Proto ()
 
virtual bool Enqueue (boost::shared_ptr< PktInfo > msg)
 
virtual void ProcessStats (PktStatsType::Type type)
 
virtual ProtoHandlerAllocProtoHandler (boost::shared_ptr< PktInfo > info, boost::asio::io_context &io)=0
 
void FreeBuffer (PktInfo *msg)
 
bool ProcessProto (boost::shared_ptr< PktInfo > msg_info)
 
bool RunProtoHandler (ProtoHandler *handler)
 
void set_trace (bool val)
 
void set_free_buffer (bool val)
 
boost::asio::io_context & get_io_service () const
 
Agentagent () const
 
const ProtoWorkQueuework_queue () const
 

Static Public Attributes

static const int kMinTableCount = 1
 
static const int kMaxTableCount = 16
 

Private Member Functions

FlowTraceFilteripv4_trace_filter ()
 
FlowTraceFilteripv6_trace_filter ()
 
bool ProcessFlowEvent (const FlowEvent &req, FlowTable *table)
 
bool FlowStatsUpdate () const
 

Private Attributes

FlowTokenPool add_tokens_
 
FlowTokenPool ksync_tokens_
 
FlowTokenPool del_tokens_
 
FlowTokenPool update_tokens_
 
std::vector< FlowEventQueue * > flow_event_queue_
 
std::vector< FlowEventQueue * > flow_tokenless_queue_
 
std::vector
< DeleteFlowEventQueue * > 
flow_delete_queue_
 
std::vector
< KSyncFlowEventQueue * > 
flow_ksync_queue_
 
std::vector< FlowTable * > flow_table_list_
 
UpdateFlowEventQueue flow_update_queue_
 
tbb::atomic< int > linklocal_flow_count_
 
bool use_vrouter_hash_
 
FlowTraceFilter ipv4_trace_filter_
 
FlowTraceFilter ipv6_trace_filter_
 
FlowStats stats_
 
PortTableManager port_table_manager_
 
Timerstats_update_timer_
 

Friends

class SandeshIPv4FlowFilterRequest
 
class SandeshIPv6FlowFilterRequest
 
class SandeshShowFlowFilterRequest
 
class FlowTraceFilterTest
 
class FlowUpdateTest
 
class FlowTest
 

Additional Inherited Members

- Public Types inherited from Proto
typedef WorkQueue
< boost::shared_ptr< PktInfo > > 
ProtoWorkQueue
 
- Protected Attributes inherited from Proto
Agentagent_
 
PktHandler::PktModuleName module_
 
bool trace_
 
bool free_buffer_
 
boost::asio::io_context & io_
 
ProtoWorkQueue work_queue_
 

Detailed Description

Definition at line 46 of file flow_proto.h.

Constructor & Destructor Documentation

FlowProto::FlowProto ( Agent agent,
boost::asio::io_context &  io 
)

Definition at line 22 of file flow_proto.cc.

Here is the call graph for this function:

FlowProto::~FlowProto ( )
virtual

Definition at line 76 of file flow_proto.cc.

Here is the call graph for this function:

Member Function Documentation

bool FlowProto::AddFlow ( FlowEntry flow)

Definition at line 292 of file flow_proto.cc.

Here is the call graph for this function:

FlowHandler * FlowProto::AllocProtoHandler ( PktInfoPtr  info,
boost::asio::io_context &  io 
)

Definition at line 188 of file flow_proto.cc.

Here is the call graph for this function:

void FlowProto::CreateAuditEntry ( const FlowKey key,
uint32_t  flow_handle,
uint8_t  gen_id 
)

Definition at line 619 of file flow_proto.cc.

Here is the call graph for this function:

void FlowProto::DeleteFlowRequest ( FlowEntry flow)

Definition at line 598 of file flow_proto.cc.

Here is the call graph for this function:

void FlowProto::DeleteFlowRequest ( const FlowKey key)

Definition at line 603 of file flow_proto.cc.

Here is the call graph for this function:

void FlowProto::DisableFlowDeleteQueue ( uint32_t  index,
bool  disabled 
)

Definition at line 248 of file flow_proto.cc.

void FlowProto::DisableFlowEventQueue ( uint32_t  index,
bool  disabled 
)

Definition at line 230 of file flow_proto.cc.

void FlowProto::DisableFlowKSyncQueue ( uint32_t  index,
bool  disabled 
)

Definition at line 240 of file flow_proto.cc.

void FlowProto::DisableFlowUpdateQueue ( bool  disabled)

Definition at line 236 of file flow_proto.cc.

Here is the call graph for this function:

bool FlowProto::Enqueue ( PktInfoPtr  msg)

Definition at line 220 of file flow_proto.cc.

Here is the call graph for this function:

void FlowProto::EnqueueFlowEvent ( FlowEvent event)

Definition at line 307 of file flow_proto.cc.

Here is the call graph for this function:

bool FlowProto::EnqueueReentrant ( boost::shared_ptr< PktInfo msg,
uint8_t  table_index 
)

Definition at line 669 of file flow_proto.cc.

Here is the call graph for this function:

void FlowProto::EnqueueUnResolvedFlowEntry ( FlowEntry flow)

Definition at line 676 of file flow_proto.cc.

Here is the call graph for this function:

void FlowProto::EvictFlowRequest ( FlowEntry flow,
uint32_t  flow_handle,
uint8_t  gen_id,
uint8_t  evict_gen_id 
)

Definition at line 611 of file flow_proto.cc.

Here is the call graph for this function:

FlowEntry * FlowProto::Find ( const FlowKey key,
uint32_t  table_index 
) const

Definition at line 288 of file flow_proto.cc.

Here is the call graph for this function:

const FlowStats* FlowProto::flow_stats ( ) const
inline

Definition at line 108 of file flow_proto.h.

uint32_t FlowProto::flow_table_count ( ) const
inline

Definition at line 68 of file flow_proto.h.

uint32_t FlowProto::FlowCount ( ) const

Definition at line 265 of file flow_proto.cc.

bool FlowProto::FlowDeleteHandler ( FlowEvent req,
FlowTable table 
)

Definition at line 571 of file flow_proto.cc.

Here is the call graph for this function:

bool FlowProto::FlowEventHandler ( FlowEvent req,
FlowTable table 
)

Definition at line 401 of file flow_proto.cc.

Here is the call graph for this function:

bool FlowProto::FlowKSyncMsgHandler ( FlowEvent req,
FlowTable table 
)

Definition at line 510 of file flow_proto.cc.

Here is the call graph for this function:

bool FlowProto::FlowStatsUpdate ( ) const
private

Definition at line 917 of file flow_proto.cc.

Here is the call graph for this function:

uint16_t FlowProto::FlowTableIndex ( const IpAddress sip,
const IpAddress dip,
uint8_t  proto,
uint16_t  sport,
uint16_t  dport,
uint32_t  flow_handle 
) const

Definition at line 161 of file flow_proto.cc.

Here is the call graph for this function:

bool FlowProto::FlowUpdateHandler ( FlowEvent req)

Definition at line 545 of file flow_proto.cc.

Here is the call graph for this function:

size_t FlowProto::FlowUpdateQueueLength ( )

Definition at line 244 of file flow_proto.cc.

Here is the call graph for this function:

void FlowProto::FlushFlows ( )

Definition at line 255 of file flow_proto.cc.

void FlowProto::ForceEnqueueFreeFlowReference ( FlowEntryPtr flow)

Definition at line 662 of file flow_proto.cc.

Here is the call graph for this function:

FlowTable * FlowProto::GetFlowTable ( const FlowKey key,
uint32_t  flow_handle 
) const

Definition at line 213 of file flow_proto.cc.

Here is the call graph for this function:

FlowTable * FlowProto::GetTable ( uint16_t  index) const

Definition at line 261 of file flow_proto.cc.

TokenPtr FlowProto::GetToken ( FlowEvent::Event  event)

Definition at line 714 of file flow_proto.cc.

Here is the call graph for this function:

void FlowProto::GrowFreeListRequest ( FlowTable table)

Definition at line 627 of file flow_proto.cc.

Here is the call graph for this function:

void FlowProto::Init ( )

Definition at line 84 of file flow_proto.cc.

Here is the call graph for this function:

void FlowProto::InitDone ( )

Definition at line 99 of file flow_proto.cc.

Here is the call graph for this function:

void FlowProto::InterfaceFlowCount ( const Interface intf,
uint64_t *  created,
uint64_t *  aged,
uint32_t *  active_flows 
) const

Definition at line 925 of file flow_proto.cc.

Here is the call graph for this function:

FlowTraceFilter* FlowProto::ipv4_trace_filter ( )
inlineprivate

Definition at line 137 of file flow_proto.h.

FlowTraceFilter* FlowProto::ipv6_trace_filter ( )
inlineprivate

Definition at line 138 of file flow_proto.h.

void FlowProto::KSyncEventRequest ( KSyncEntry ksync_entry,
KSyncEntry::KSyncEvent  event,
uint32_t  flow_handle,
uint8_t  gen_id,
int  ksync_error,
uint64_t  evict_flow_bytes,
uint64_t  evict_flow_packets,
int32_t  evict_flow_oflow,
uint32_t  transcation_id 
)

Definition at line 633 of file flow_proto.cc.

Here is the call graph for this function:

uint32_t FlowProto::linklocal_flow_count ( ) const
inline

Definition at line 111 of file flow_proto.h.

void FlowProto::MessageRequest ( FlowEntry flow)

Definition at line 646 of file flow_proto.cc.

Here is the call graph for this function:

PortTableManager* FlowProto::port_table_manager ( )
inline

Definition at line 126 of file flow_proto.h.

bool FlowProto::ProcessFlowEvent ( const FlowEvent req,
FlowTable table 
)
private
void FlowProto::SetProfileData ( ProfileData data)

Definition at line 866 of file flow_proto.cc.

Here is the call graph for this function:

bool FlowProto::ShouldTrace ( const FlowEntry flow,
const FlowEntry rflow 
)

Definition at line 683 of file flow_proto.cc.

Here is the call graph for this function:

void FlowProto::Shutdown ( )

Definition at line 107 of file flow_proto.cc.

Here is the call graph for this function:

void FlowProto::TokenAvailable ( TokenPool pool_base)
virtual

Reimplemented from Proto.

Definition at line 753 of file flow_proto.cc.

Here is the call graph for this function:

bool FlowProto::TokenCheck ( const FlowTokenPool pool) const

Definition at line 749 of file flow_proto.cc.

Here is the call graph for this function:

void FlowProto::update_linklocal_flow_count ( int  val)
inline

Definition at line 112 of file flow_proto.h.

bool FlowProto::UpdateFlow ( FlowEntry flow)

Definition at line 298 of file flow_proto.cc.

Here is the call graph for this function:

bool FlowProto::Validate ( PktInfo msg)
virtual

Reimplemented from Proto.

Definition at line 196 of file flow_proto.cc.

void FlowProto::VnFlowCounters ( const VnEntry vn,
uint32_t *  in_count,
uint32_t *  out_count 
)

Definition at line 273 of file flow_proto.cc.

Here is the call graph for this function:

Friends And Related Function Documentation

friend class FlowTest
friend

Definition at line 136 of file flow_proto.h.

friend class FlowTraceFilterTest
friend

Definition at line 134 of file flow_proto.h.

friend class FlowUpdateTest
friend

Definition at line 135 of file flow_proto.h.

friend class SandeshIPv4FlowFilterRequest
friend

Definition at line 131 of file flow_proto.h.

friend class SandeshIPv6FlowFilterRequest
friend

Definition at line 132 of file flow_proto.h.

friend class SandeshShowFlowFilterRequest
friend

Definition at line 133 of file flow_proto.h.

Member Data Documentation

FlowTokenPool FlowProto::add_tokens_
private

Definition at line 143 of file flow_proto.h.

FlowTokenPool FlowProto::del_tokens_
private

Definition at line 145 of file flow_proto.h.

std::vector<DeleteFlowEventQueue *> FlowProto::flow_delete_queue_
private

Definition at line 149 of file flow_proto.h.

std::vector<FlowEventQueue *> FlowProto::flow_event_queue_
private

Definition at line 147 of file flow_proto.h.

std::vector<KSyncFlowEventQueue *> FlowProto::flow_ksync_queue_
private

Definition at line 150 of file flow_proto.h.

std::vector<FlowTable *> FlowProto::flow_table_list_
private

Definition at line 151 of file flow_proto.h.

std::vector<FlowEventQueue *> FlowProto::flow_tokenless_queue_
private

Definition at line 148 of file flow_proto.h.

UpdateFlowEventQueue FlowProto::flow_update_queue_
private

Definition at line 152 of file flow_proto.h.

FlowTraceFilter FlowProto::ipv4_trace_filter_
private

Definition at line 155 of file flow_proto.h.

FlowTraceFilter FlowProto::ipv6_trace_filter_
private

Definition at line 156 of file flow_proto.h.

const int FlowProto::kMaxTableCount = 16
static

Definition at line 49 of file flow_proto.h.

const int FlowProto::kMinTableCount = 1
static

Definition at line 48 of file flow_proto.h.

FlowTokenPool FlowProto::ksync_tokens_
private

Definition at line 144 of file flow_proto.h.

tbb::atomic<int> FlowProto::linklocal_flow_count_
private

Definition at line 153 of file flow_proto.h.

PortTableManager FlowProto::port_table_manager_
private

Definition at line 158 of file flow_proto.h.

FlowStats FlowProto::stats_
private

Definition at line 157 of file flow_proto.h.

Timer* FlowProto::stats_update_timer_
private

Definition at line 159 of file flow_proto.h.

FlowTokenPool FlowProto::update_tokens_
private

Definition at line 146 of file flow_proto.h.

bool FlowProto::use_vrouter_hash_
private

Definition at line 154 of file flow_proto.h.


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