suricata
tm-modules.h File Reference
#include "tm-threads-common.h"
#include "threadvars.h"
#include "decode.h"
Include dependency graph for tm-modules.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  TmModule_
 
struct  OutputCtx_
 

Macros

#define TM_FLAG_RECEIVE_TM   0x01
 
#define TM_FLAG_DECODE_TM   0x02
 
#define TM_FLAG_STREAM_TM   0x04
 
#define TM_FLAG_DETECT_TM   0x08
 
#define TM_FLAG_MANAGEMENT_TM   0x10
 
#define TM_FLAG_COMMAND_TM   0x20
 

Typedefs

typedef TmEcode(* ThreadInitFunc) (ThreadVars *, const void *, void **)
 
typedef TmEcode(* ThreadDeinitFunc) (ThreadVars *, void *)
 
typedef void(* ThreadExitPrintStatsFunc) (ThreadVars *, void *)
 
typedef struct TmModule_ TmModule
 
typedef struct OutputCtx_ OutputCtx
 

Functions

TmModuleTmModuleGetByName (const char *name)
 get a tm module ptr by name More...
 
TmModuleTmModuleGetById (int id)
 Returns a TM Module by its id. More...
 
int TmModuleGetIDForTM (TmModule *tm)
 Given a TM Module, returns its id. More...
 
TmEcode TmModuleRegister (char *name, int(*module_func)(ThreadVars *, Packet *, void *))
 
void TmModuleDebugList (void)
 
void TmModuleRegisterTests (void)
 register all unittests for the tm modules More...
 
const char * TmModuleTmmIdToString (TmmId id)
 Maps the TmmId, to its string equivalent. More...
 
void TmModuleRunInit (void)
 
void TmModuleRunDeInit (void)
 

Variables

TmModule tmm_modules [TMM_SIZE]
 

Detailed Description

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

Definition in file tm-modules.h.

Macro Definition Documentation

◆ TM_FLAG_COMMAND_TM

#define TM_FLAG_COMMAND_TM   0x20

Definition at line 38 of file tm-modules.h.

◆ TM_FLAG_DECODE_TM

#define TM_FLAG_DECODE_TM   0x02

Definition at line 34 of file tm-modules.h.

◆ TM_FLAG_DETECT_TM

#define TM_FLAG_DETECT_TM   0x08

Definition at line 36 of file tm-modules.h.

◆ TM_FLAG_MANAGEMENT_TM

#define TM_FLAG_MANAGEMENT_TM   0x10

Definition at line 37 of file tm-modules.h.

◆ TM_FLAG_RECEIVE_TM

#define TM_FLAG_RECEIVE_TM   0x01

Definition at line 33 of file tm-modules.h.

◆ TM_FLAG_STREAM_TM

#define TM_FLAG_STREAM_TM   0x04

Definition at line 35 of file tm-modules.h.

Typedef Documentation

◆ OutputCtx

typedef struct OutputCtx_ OutputCtx

Structure that output modules use to maintain private data.

◆ ThreadDeinitFunc

typedef TmEcode(* ThreadDeinitFunc) (ThreadVars *, void *)

Definition at line 40 of file tm-modules.h.

◆ ThreadExitPrintStatsFunc

typedef void(* ThreadExitPrintStatsFunc) (ThreadVars *, void *)

Definition at line 41 of file tm-modules.h.

◆ ThreadInitFunc

typedef TmEcode(* ThreadInitFunc) (ThreadVars *, const void *, void **)

Definition at line 39 of file tm-modules.h.

◆ TmModule

typedef struct TmModule_ TmModule

Function Documentation

◆ TmModuleDebugList()

void TmModuleDebugList ( void  )

Definition at line 31 of file tm-modules.c.

References TmModule_::Func, TmModule_::name, SCLogDebug, tmm_modules, and TMM_SIZE.

Referenced by RegisterAllModules().

Here is the caller graph for this function:

◆ TmModuleGetById()

TmModule* TmModuleGetById ( int  id)

Returns a TM Module by its id.

Parameters
idId of the TM Module to return.
Return values
Pointerof the module to be returned if available; NULL if unavailable.

Definition at line 69 of file tm-modules.c.

References SCLogError, tmm_modules, and TMM_SIZE.

Referenced by TmThreadDisableReceiveThreads().

Here is the caller graph for this function:

◆ TmModuleGetByName()

TmModule* TmModuleGetByName ( const char *  name)

get a tm module ptr by name

Parameters
namename string
Return values
ptrto the module or NULL

Definition at line 46 of file tm-modules.c.

References TmModule_::name, tmm_modules, and TMM_SIZE.

Referenced by RunModeErfFileAutoFp(), RunModeErfFileSingle(), RunModeFilePcapAutoFp(), RunModeFilePcapSingle(), RunModeSetIPSAutoFp(), RunModeSetIPSWorker(), RunModeSetLiveCaptureAutoFp(), TmThreadCreateCmdThreadByName(), and TmThreadCreateMgmtThreadByName().

Here is the caller graph for this function:

◆ TmModuleGetIDForTM()

int TmModuleGetIDForTM ( TmModule tm)

Given a TM Module, returns its id.

Parameters
tmPointer to the TM Module.
Return values
idof the TM Module if available; -1 if unavailable.

Definition at line 88 of file tm-modules.c.

References TmModule_::name, tmm_modules, and TMM_SIZE.

Referenced by TmSlotSetFuncAppend().

Here is the caller graph for this function:

◆ TmModuleRegister()

TmEcode TmModuleRegister ( char *  name,
int(*)(ThreadVars *, Packet *, void *)  module_func 
)

◆ TmModuleRegisterTests()

void TmModuleRegisterTests ( void  )

register all unittests for the tm modules

Definition at line 135 of file tm-modules.c.

References coverage_unittests, g_ut_covered, g_ut_modules, TmModule_::name, TmModule_::RegisterTests, SCLogWarning, tmm_modules, and TMM_SIZE.

◆ TmModuleRunDeInit()

void TmModuleRunDeInit ( void  )

Definition at line 119 of file tm-modules.c.

References TmModule_::DeInit, TmModule_::name, tmm_modules, and TMM_SIZE.

Referenced by GlobalsDestroy().

Here is the caller graph for this function:

◆ TmModuleRunInit()

void TmModuleRunInit ( void  )

Definition at line 104 of file tm-modules.c.

References TmModule_::Init, TmModule_::name, tmm_modules, and TMM_SIZE.

◆ TmModuleTmmIdToString()

Variable Documentation

◆ tmm_modules