suricata
tm-modules.h File Reference
#include "tm-threads-common.h"
#include "threadvars.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_LOGAPI_TM   0x10
 
#define TM_FLAG_MANAGEMENT_TM   0x20
 
#define TM_FLAG_COMMAND_TM   0x40
 

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 TmModuleGetIdByName (const char *name)
 get the id of a module from it's name 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

#define TM_FLAG_COMMAND_TM   0x40

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

Referenced by TmModuleUnixManagerRegister().

#define TM_FLAG_DETECT_TM   0x08
#define TM_FLAG_LOGAPI_TM   0x10

TM is run by Log API

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

Referenced by SCProfilingDumpPacketStats().

#define TM_FLAG_MANAGEMENT_TM   0x20
#define TM_FLAG_STREAM_TM   0x04

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

Referenced by TmModuleFlowWorkerRegister().

Typedef Documentation

typedef struct OutputCtx_ OutputCtx

Structure that output modules use to maintain private data.

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

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

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

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

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

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

typedef struct TmModule_ TmModule

Function Documentation

void TmModuleDebugList ( void  )

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

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

Referenced by RegisterAllModules().

Here is the caller graph for this function:

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 88 of file tm-modules.c.

References ThreadVars_::id, SC_ERR_TM_MODULES_ERROR, SCLogError, tmm_modules, and TMM_SIZE.

Referenced by DetectEngineInspectPktBufferGeneric(), TmThreadCountThreadsByTmmFlags(), TmThreadDisableReceiveThreads(), and TmThreadGetFirstTmSlotForPartialPattern().

Here is the caller graph for this function:

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 51 of file tm-modules.c.

References TmModule_::name, ThreadVars_::t, tmm_modules, and TMM_SIZE.

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

Here is the caller graph for this function:

int TmModuleGetIdByName ( const char *  name)

get the id of a module from it's name

Parameters
nameregistered name of the module
Return values
idthe id or -1 in case of error

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

References TmModuleGetByName(), and TmModuleGetIDForTM().

Here is the call graph for this function:

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 107 of file tm-modules.c.

References TmModule_::name, ThreadVars_::t, tmm_modules, and TMM_SIZE.

Referenced by TmModuleGetIdByName(), and TmSlotSetFuncAppend().

Here is the caller graph for this function:

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

register all unittests for the tm modules

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

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

void TmModuleRunDeInit ( void  )

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

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

Referenced by GlobalsInitPreConfig().

Here is the caller graph for this function:

void TmModuleRunInit ( void  )

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

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

Referenced by PostRunDeinit().

Here is the caller graph for this function:

Variable Documentation

TmModule tmm_modules[TMM_SIZE]