suricata
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_
 

Typedefs

typedef DetectEngineThreadCtxDetectEngineThreadCtxPtr
 
typedef struct FlowTimeoutCounters FlowTimeoutCounters
 
typedef struct FlowWorkerThreadData_ FlowWorkerThreadData
 

Functions

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 59 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 1871 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 715 of file flow-worker.c.

References SC_ATOMIC_GET.

◆ FlowWorkerReplaceDetectCtx()

void FlowWorkerReplaceDetectCtx ( void *  flow_worker,
void *  detect_ctx 
)

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

References SC_ATOMIC_SET.

◆ ProfileFlowWorkerIdToString()

◆ StreamTcp()

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

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

◆ TmModuleFlowWorkerRegister()

void TmModuleFlowWorkerRegister ( void  )

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