suricata
output-flow.c File Reference
#include "suricata-common.h"
#include "output.h"
#include "output-flow.h"
#include "util-profiling.h"
#include "util-validate.h"
Include dependency graph for output-flow.c:

Go to the source code of this file.

Data Structures

struct  OutputFlowLoggerThreadData_
 
struct  OutputFlowLogger_
 

Typedefs

typedef struct OutputFlowLoggerThreadData_ OutputFlowLoggerThreadData
 
typedef struct OutputFlowLogger_ OutputFlowLogger
 

Functions

int SCOutputRegisterFlowLogger (const char *name, FlowLogger LogFunc, void *initdata, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
 Register a flow logger.
 
TmEcode OutputFlowLog (ThreadVars *tv, void *thread_data, Flow *f)
 Run flow logger(s)
 
TmEcode OutputFlowLogThreadInit (ThreadVars *tv, void **data)
 thread init for the flow logger This will run the thread init functions for the individual registered loggers
 
TmEcode OutputFlowLogThreadDeinit (ThreadVars *tv, void *thread_data)
 
void OutputFlowShutdown (void)
 

Detailed Description

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

Flow Logger Output registration functions

Definition in file output-flow.c.

Typedef Documentation

◆ OutputFlowLogger

◆ OutputFlowLoggerThreadData

per thread data for this module, contains a list of per thread data for the packet loggers.

Function Documentation

◆ OutputFlowLog()

TmEcode OutputFlowLog ( ThreadVars tv,
void *  thread_data,
Flow f 
)

◆ OutputFlowLogThreadDeinit()

TmEcode OutputFlowLogThreadDeinit ( ThreadVars tv,
void *  thread_data 
)

Internal function: private API.

Definition at line 163 of file output-flow.c.

References OutputFlowLogger_::next, OutputLoggerThreadStore_::next, SCFree, OutputFlowLoggerThreadData_::store, OutputLoggerThreadStore_::thread_data, OutputFlowLogger_::ThreadDeinit, TM_ECODE_OK, and tv.

Referenced by DecodeThreadVarsFree().

Here is the caller graph for this function:

◆ OutputFlowLogThreadInit()

TmEcode OutputFlowLogThreadInit ( ThreadVars tv,
void **  data 
)

thread init for the flow logger This will run the thread init functions for the individual registered loggers

Internal function: private API.

Definition at line 123 of file output-flow.c.

References BUG_ON, OutputFlowLogger_::initdata, OutputFlowLogger_::name, OutputFlowLogger_::next, OutputLoggerThreadStore_::next, SCCalloc, SCLogDebug, OutputFlowLoggerThreadData_::store, OutputFlowLogger_::ThreadInit, TM_ECODE_FAILED, TM_ECODE_OK, ts, and tv.

Referenced by DecodeThreadVarsAlloc().

Here is the caller graph for this function:

◆ OutputFlowShutdown()

void OutputFlowShutdown ( void  )

Internal function: private API.

Definition at line 187 of file output-flow.c.

References OutputFlowLogger_::next, and SCFree.

Referenced by RunModeShutDown().

Here is the caller graph for this function:

◆ SCOutputRegisterFlowLogger()

int SCOutputRegisterFlowLogger ( const char *  name,
FlowLogger  LogFunc,
void *  initdata,
ThreadInitFunc  ThreadInit,
ThreadDeinitFunc  ThreadDeinit 
)

Register a flow logger.

Parameters
nameAn informational name for this logger. Used only for debugging.
LogFuncA function that will be called to log each flow.
initdataA pointer to initialization data that will be passed the ThreadInit.
ThreadInitThread initialization callback.
ThreadDeinitThread de-initialization callback.
Return values
0on success, -1 on failure.

Definition at line 58 of file output-flow.c.

References OutputFlowLogger_::initdata, OutputFlowLogger_::LogFunc, OutputFlowLogger_::name, name, OutputFlowLogger_::next, SCCalloc, SCLogDebug, OutputFlowLogger_::ThreadDeinit, and OutputFlowLogger_::ThreadInit.