suricata
flow-manager.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FlowTimeoutsReset()   FlowTimeoutsInit()
 
#define FlowWakeupFlowManagerThread()   SCCtrlCondSignal(&flow_manager_ctrl_cond)
 
#define FlowWakeupFlowRecyclerThread()   SCCtrlCondSignal(&flow_recycler_ctrl_cond)
 

Functions

void FlowTimeoutsInit (void)
 
void FlowTimeoutsEmergency (void)
 
void FlowManagerThreadSpawn (void)
 spawn the flow manager thread More...
 
void FlowDisableFlowManagerThread (void)
 Used to disable flow manager thread(s). More...
 
void FlowMgrRegisterTests (void)
 Function to register the Flow Unitests. More...
 
void FlowRecyclerThreadSpawn (void)
 spawn the flow recycler thread More...
 
void FlowDisableFlowRecyclerThread (void)
 Used to disable flow recycler thread(s). More...
 
void TmModuleFlowManagerRegister (void)
 
void TmModuleFlowRecyclerRegister (void)
 

Variables

SCCtrlCondT flow_manager_ctrl_cond
 
SCCtrlMutex flow_manager_ctrl_mutex
 
SCCtrlCondT flow_recycler_ctrl_cond
 
SCCtrlMutex flow_recycler_ctrl_mutex
 

Detailed Description

Macro Definition Documentation

#define FlowTimeoutsReset ( )    FlowTimeoutsInit()

Definition at line 27 of file flow-manager.h.

#define FlowWakeupFlowManagerThread ( )    SCCtrlCondSignal(&flow_manager_ctrl_cond)

Definition at line 34 of file flow-manager.h.

Referenced by FlowSetupPacket(), and PcapFileGlobalInit().

#define FlowWakeupFlowRecyclerThread ( )    SCCtrlCondSignal(&flow_recycler_ctrl_cond)

Definition at line 43 of file flow-manager.h.

Function Documentation

void FlowDisableFlowManagerThread ( void  )

Used to disable flow manager thread(s).

Todo:
Kinda hackish since it uses the tv name to identify flow manager thread. We need an all weather identification scheme.

Definition at line 133 of file flow-manager.c.

References BUG_ON, FlowTimeoutCounters_::byp, FlowProtoTimeout_::bypassed_timeout, FlowTimeoutCounters_::clo, FlowProtoTimeout_::closed_timeout, FlowTimeoutCounters_::est, FlowProtoTimeout_::est_timeout, Flow_::fb, FBLOCK_LOCK, FBLOCK_TRYLOCK, FBLOCK_UNLOCK, Flow_::flags, FLOW_BYPASSED_TIMEOUT, flow_config, FLOW_EMERGENCY, FLOW_END_FLAG_EMERGENCY, FLOW_END_FLAG_SHUTDOWN, FLOW_END_FLAG_STATE_BYPASSED, FLOW_END_FLAG_STATE_CLOSED, FLOW_END_FLAG_STATE_ESTABLISHED, FLOW_END_FLAG_STATE_NEW, FLOW_END_FLAG_TIMEOUT, Flow_::flow_end_flags, flow_hash, flow_manager_ctrl_cond, flow_recycle_q, FLOW_STATE_CAPTURE_BYPASSED, FLOW_STATE_CLOSED, FLOW_STATE_ESTABLISHED, FLOW_STATE_LOCAL_BYPASSED, FLOW_STATE_NEW, FLOW_TCP_REUSED, FLOW_TIMEOUT_REASSEMBLY_DONE, FlowEnqueue(), FlowForceReassemblyForFlow(), FlowForceReassemblyNeedReassembly(), FLOWLOCK_UNLOCK, FLOWLOCK_WRLOCK, FlowTimeoutCounters_::flows_checked, FlowTimeoutCounters_::flows_notimeout, FlowTimeoutCounters_::flows_removed, FlowTimeoutCounters_::flows_timeout, FlowTimeoutCounters_::flows_timeout_inuse, g_detect_disabled, FlowCnf_::hash_size, FlowBucket_::head, Flow_::hnext, Flow_::hprev, Flow_::lastts, ThreadVars_::name, FlowTimeoutCounters_::new, FlowProtoTimeout_::new_timeout, ThreadVars_::next, next, PacketPoolWaitForN(), Flow_::protomap, FlowTimeoutCounters_::rows_busy, FlowTimeoutCounters_::rows_checked, FlowTimeoutCounters_::rows_empty, FlowTimeoutCounters_::rows_maxlen, FlowTimeoutCounters_::rows_skipped, SC_ATOMIC_GET, SC_ATOMIC_SET, SC_ERR_FATAL, SCCtrlCondSignal, SCLogError, SCMutexLock, SCMutexUnlock, FlowBucket_::tail, FlowTimeoutCounters_::tcp_reuse, THREAD_KILL_MAX_WAIT_TIME, thread_name_flow_mgr, THV_KILL, THV_RUNNING_DONE, TmThreadsCheckFlag(), TmThreadsSetFlag(), ts, tv_root, tv_root_lock, TVT_MGMT, and WAIT_TIME.

Referenced by PostRunDeinit().

Here is the call graph for this function:

Here is the caller graph for this function:

void FlowDisableFlowRecyclerThread ( void  )

Used to disable flow recycler thread(s).

Note
this should only be called when the flow manager is already gone
Todo:
Kinda hackish since it uses the tv name to identify flow recycler thread. We need an all weather identification scheme.

Definition at line 1018 of file flow-manager.c.

References flow_recycler_ctrl_cond, ThreadVars_::name, ThreadVars_::next, SC_ATOMIC_SET, SC_ERR_FATAL, SCCtrlCondSignal, SCLogError, SCMutexLock, SCMutexUnlock, THREAD_KILL_MAX_WAIT_TIME, thread_name_flow_rec, THV_KILL, THV_RUNNING_DONE, TmThreadsCheckFlag(), TmThreadsSetFlag(), tv_root, tv_root_lock, TVT_MGMT, and WAIT_TIME.

Referenced by PostRunDeinit().

Here is the call graph for this function:

Here is the caller graph for this function:

void FlowManagerThreadSpawn ( void  )

spawn the flow manager thread

Definition at line 804 of file flow-manager.c.

References BUG_ON, ConfGetInt(), flow_manager_ctrl_cond, flow_manager_ctrl_mutex, FlowGetMemuse(), SC_ERR_INVALID_ARGUMENTS, SCCtrlCondInit, SCCtrlMutexInit, SCLogError, StatsRegisterGlobalCounter(), thread_name_flow_mgr, TM_ECODE_OK, TM_THREAD_NAME_MAX, TmThreadCreateMgmtThreadByName(), and TmThreadSpawn().

Referenced by RunModeDispatch().

Here is the call graph for this function:

Here is the caller graph for this function:

void FlowMgrRegisterTests ( void  )

Function to register the Flow Unitests.

Definition at line 1391 of file flow-manager.c.

References UtRegisterTest().

Referenced by FlowRegisterTests().

Here is the call graph for this function:

Here is the caller graph for this function:

void FlowRecyclerThreadSpawn ( void  )

spawn the flow recycler thread

Definition at line 965 of file flow-manager.c.

References BUG_ON, ConfGetInt(), flow_recycler_ctrl_cond, flow_recycler_ctrl_mutex, SC_ERR_INVALID_ARGUMENTS, SCCtrlCondInit, SCCtrlMutexInit, SCLogError, thread_name_flow_rec, TM_ECODE_OK, TM_THREAD_NAME_MAX, TmThreadCreateMgmtThreadByName(), and TmThreadSpawn().

Referenced by RunModeDispatch().

Here is the call graph for this function:

Here is the caller graph for this function:

void FlowTimeoutsEmergency ( void  )

Definition at line 94 of file flow-manager.c.

References flow_timeouts_emerg, and SC_ATOMIC_SET.

Referenced by FlowSetupPacket().

Here is the caller graph for this function:

void FlowTimeoutsInit ( void  )

Definition at line 89 of file flow-manager.c.

References flow_timeouts_normal, and SC_ATOMIC_SET.

Referenced by FlowInitFlowProto().

Here is the caller graph for this function:

void TmModuleFlowManagerRegister ( void  )

Variable Documentation

SCCtrlCondT flow_manager_ctrl_cond

flow manager scheduling condition

Definition at line 32 of file flow-manager.h.

Referenced by FlowDisableFlowManagerThread(), and FlowManagerThreadSpawn().

SCCtrlMutex flow_manager_ctrl_mutex

Definition at line 33 of file flow-manager.h.

Referenced by FlowManagerThreadSpawn().

SCCtrlCondT flow_recycler_ctrl_cond

flow recycler scheduling condition

Definition at line 41 of file flow-manager.h.

Referenced by FlowDisableFlowRecyclerThread(), and FlowRecyclerThreadSpawn().

SCCtrlMutex flow_recycler_ctrl_mutex

Definition at line 42 of file flow-manager.h.

Referenced by FlowRecyclerThreadSpawn().