suricata
flow-worker.c File Reference
#include "suricata-common.h"
#include "suricata.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 "util-validate.h"
#include "flow-util.h"
#include "flow-manager.h"
#include "flow-timeout.h"
#include "flow-spare-pool.h"
Include dependency graph for flow-worker.c:

Go to the source code of this file.

Data Structures

struct  FlowTimeoutCounters
 
struct  FlowWorkerThreadData_
 

Typedefs

typedef DetectEngineThreadCtxDetectEngineThreadCtxPtr
 
typedef struct FlowTimeoutCounters FlowTimeoutCounters
 
typedef struct FlowWorkerThreadData_ FlowWorkerThreadData
 

Functions

PacketFlowForceReassemblyPseudoPacketGet (int direction, Flow *f, TcpSession *ssn)
 
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)
 

Detailed Description

Author
Victor Julien victo.nosp@m.r@in.nosp@m.linia.nosp@m.c.ne.nosp@m.t

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 52 of file flow-worker.c.

◆ FlowTimeoutCounters

◆ FlowWorkerThreadData

Function Documentation

◆ Detect()

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

Detection engine thread wrapper.

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

Definition at line 1620 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.

◆ FlowForceReassemblyPseudoPacketGet()

Packet* FlowForceReassemblyPseudoPacketGet ( int  direction,
Flow f,
TcpSession ssn 
)

Definition at line 271 of file flow-timeout.c.

References PACKET_PROFILING_START, PacketPoolGetPacket(), and PacketPoolWait().

Here is the call graph for this function:

◆ FlowWorkerGetDetectCtxPtr()

void* FlowWorkerGetDetectCtxPtr ( void *  flow_worker)

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

References SC_ATOMIC_GET.

◆ FlowWorkerReplaceDetectCtx()

void FlowWorkerReplaceDetectCtx ( void *  flow_worker,
void *  detect_ctx 
)

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

References SC_ATOMIC_SET.

◆ ProfileFlowWorkerIdToString()

◆ StreamTcp()

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

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

◆ TmModuleFlowWorkerRegister()

void TmModuleFlowWorkerRegister ( void  )

Definition at line 621 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: