suricata
output-filedata.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  OutputFiledataLoggerThreadData_
 

Macros

#define OUTPUT_FILEDATA_FLAG_OPEN   0x01
 
#define OUTPUT_FILEDATA_FLAG_CLOSE   0x02
 

Typedefs

typedef struct OutputFiledataLoggerThreadData_ OutputFiledataLoggerThreadData
 
typedef int(* SCFiledataLogger) (ThreadVars *, void *thread_data, const Packet *, File *, void *tx, const uint64_t tx_id, const uint8_t *, uint32_t, uint8_t, uint8_t dir)
 File-data logger function pointer type. More...
 

Functions

TmEcode OutputFiledataLogThreadInit (ThreadVars *tv, OutputFiledataLoggerThreadData **data)
 thread init for the filedata logger This will run the thread init functions for the individual registered loggers More...
 
TmEcode OutputFiledataLogThreadDeinit (ThreadVars *tv, OutputFiledataLoggerThreadData *thread_data)
 
void OutputFiledataLogFfc (ThreadVars *tv, OutputFiledataLoggerThreadData *td, Packet *p, AppLayerGetFileState files, void *txv, const uint64_t tx_id, AppLayerTxData *txd, const uint8_t call_flags, const bool file_close, const bool file_trunc, const uint8_t dir)
 
int SCOutputRegisterFiledataLogger (LoggerId id, const char *name, SCFiledataLogger LogFunc, void *initdata, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
 Register a file-data logger. More...
 
void OutputFiledataLoggerRegister (void)
 
void OutputFiledataShutdown (void)
 

Detailed Description

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

AppLayer Filedata Logger Output registration functions

Definition in file output-filedata.h.

Macro Definition Documentation

◆ OUTPUT_FILEDATA_FLAG_CLOSE

#define OUTPUT_FILEDATA_FLAG_CLOSE   0x02

Definition at line 31 of file output-filedata.h.

◆ OUTPUT_FILEDATA_FLAG_OPEN

#define OUTPUT_FILEDATA_FLAG_OPEN   0x01

Definition at line 30 of file output-filedata.h.

Typedef Documentation

◆ OutputFiledataLoggerThreadData

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

◆ SCFiledataLogger

typedef int(* SCFiledataLogger) (ThreadVars *, void *thread_data, const Packet *, File *, void *tx, const uint64_t tx_id, const uint8_t *, uint32_t, uint8_t, uint8_t dir)

File-data logger function pointer type.

Definition at line 51 of file output-filedata.h.

Function Documentation

◆ OutputFiledataLogFfc()

void OutputFiledataLogFfc ( ThreadVars tv,
OutputFiledataLoggerThreadData td,
Packet p,
AppLayerGetFileState  files,
void *  txv,
const uint64_t  tx_id,
AppLayerTxData txd,
const uint8_t  call_flags,
const bool  file_close,
const bool  file_trunc,
const uint8_t  dir 
)

◆ OutputFiledataLoggerRegister()

void OutputFiledataLoggerRegister ( void  )

Definition at line 271 of file output-filedata.c.

References SC_ATOMIC_INIT, and SC_ATOMIC_SET.

◆ OutputFiledataLogThreadDeinit()

TmEcode OutputFiledataLogThreadDeinit ( ThreadVars tv,
OutputFiledataLoggerThreadData thread_data 
)

Definition at line 246 of file output-filedata.c.

References OutputFiledataLoggerThreadData_::store.

◆ OutputFiledataLogThreadInit()

TmEcode OutputFiledataLogThreadInit ( ThreadVars tv,
OutputFiledataLoggerThreadData **  data 
)

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

Definition at line 200 of file output-filedata.c.

References SCCalloc, SCFree, SCLogDebug, and TM_ECODE_FAILED.

◆ OutputFiledataShutdown()

void OutputFiledataShutdown ( void  )

Definition at line 277 of file output-filedata.c.

◆ SCOutputRegisterFiledataLogger()

int SCOutputRegisterFiledataLogger ( LoggerId  id,
const char *  name,
SCFiledataLogger  LogFunc,
void *  initdata,
ThreadInitFunc  ThreadInit,
ThreadDeinitFunc  ThreadDeinit 
)

Register a file-data logger.

Parameters
logger_idAn ID used to distinguish this logger from others while profiling.
nameAn informational name for this logger. Used only for debugging.
LogFuncA function that will be called to log each file-data.
initdataInitialization data that will pass to the ThreadInitFunc.
ThreadInitFuncThread initialization function.
ThreadDeinitFuncThread de-initialization function.
Return values
0on success, -1 on failure.

Definition at line 54 of file output-filedata.c.