flow-worker.c File Reference
#include "suricata-common.h"
#include "suricata.h"
#include "action-globals.h"
#include "packet.h"
#include "decode.h"
#include "detect.h"
#include "stream-tcp.h"
#include "app-layer.h"
#include "detect-engine.h"
#include "output.h"
#include "app-layer-parser.h"
#include "app-layer-frames.h"
#include "util-profiling.h"
#include "util-validate.h"
#include "util-time.h"
#include "tmqh-packetpool.h"
#include "flow-util.h"
#include "flow-manager.h"
#include "flow-timeout.h"
#include "flow-spare-pool.h"
#include "flow-worker.h"
Include dependency graph for flow-worker.c:

Go to the source code of this file.

Data Structures

struct  FlowTimeoutCounters
struct  FlowWorkerThreadData_


typedef DetectEngineThreadCtxDetectEngineThreadCtxPtr
typedef struct FlowTimeoutCounters FlowTimeoutCounters
typedef struct FlowWorkerThreadData_ FlowWorkerThreadData


TmEcode Detect (ThreadVars *tv, Packet *p, void *data)
 Detection engine thread wrapper. More...
TmEcode StreamTcp (ThreadVars *, Packet *, void *, PacketQueueNoLock *pq)
void FlowWorkerReplaceDetectCtx (void *flow_worker, void *detect_ctx)
void * FlowWorkerGetDetectCtxPtr (void *flow_worker)
const char * ProfileFlowWorkerIdToString (enum ProfileFlowWorkerId fwi)
void TmModuleFlowWorkerRegister (void)


uint32_t flow_spare_pool_block_size

Detailed Description

Victor Julien

Flow Workers are single thread modules taking care of (almost) everything related to packets with flows:

  • Lookup/creation
  • Stream tracking, reassembly
  • Applayer update
  • Detection

This all while holding the flow lock.

Definition in file flow-worker.c.

Typedef Documentation

◆ DetectEngineThreadCtxPtr

Definition at line 59 of file flow-worker.c.

◆ FlowTimeoutCounters

◆ FlowWorkerThreadData

Function Documentation

◆ Detect()

TmEcode Detect ( ThreadVars tv,
Packet p,
void *  data 

Detection engine thread wrapper.

tvthread vars
ppacket to inspect
datathread specific data
pqpacket queue
Return values

Definition at line 1805 of file detect.c.

References de_ctx, DEBUG_VALIDATE_PACKET, DetectEngineThreadCtx_::mt_det_ctxs_cnt, SC_ATOMIC_GET, SC_ATOMIC_SET, SCLogDebug, Packet_::tenant_id, DetectEngineThreadCtx_::TenantGetId, and unlikely.

◆ FlowWorkerGetDetectCtxPtr()

void* FlowWorkerGetDetectCtxPtr ( void *  flow_worker)

Definition at line 691 of file flow-worker.c.

References SC_ATOMIC_GET.

◆ FlowWorkerReplaceDetectCtx()

void FlowWorkerReplaceDetectCtx ( void *  flow_worker,
void *  detect_ctx 

Definition at line 684 of file flow-worker.c.

References SC_ATOMIC_SET.

◆ ProfileFlowWorkerIdToString()

◆ StreamTcp()

TmEcode StreamTcp ( ThreadVars ,
Packet ,
void *  ,
PacketQueueNoLock pq 

Definition at line 5865 of file stream-tcp.c.

◆ TmModuleFlowWorkerRegister()

void TmModuleFlowWorkerRegister ( void  )

Definition at line 747 of file flow-worker.c.

References TmModule_::name, TmModule_::ThreadInit, TMM_FLOWWORKER, and tmm_modules.

Referenced by RegisterAllModules().

Here is the caller graph for this function:

Variable Documentation

◆ flow_spare_pool_block_size

uint32_t flow_spare_pool_block_size

Definition at line 43 of file flow-spare-pool.c.

Referenced by FlowSparePoolUpdate().