suricata
output-file.c File Reference
#include "suricata-common.h"
#include "output.h"
#include "output-file.h"
#include "app-layer-parser.h"
#include "detect-filemagic.h"
#include "util-file.h"
#include "util-magic.h"
#include "util-profiling.h"
#include "util-validate.h"
Include dependency graph for output-file.c:

Go to the source code of this file.

Data Structures

struct  OutputFileLogger_
 

Typedefs

typedef struct OutputFileLogger_ OutputFileLogger
 

Functions

int SCOutputRegisterFileLogger (LoggerId id, const char *name, SCFileLogger LogFunc, void *initdata, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
 Register a file logger.
 
void OutputFileLogFfc (ThreadVars *tv, OutputFileLoggerThreadData *op_thread_data, Packet *p, FileContainer *ffc, void *txv, const uint64_t tx_id, AppLayerTxData *txd, const bool file_close, const bool file_trunc, uint8_t dir)
 
TmEcode OutputFileLogThreadInit (ThreadVars *tv, OutputFileLoggerThreadData **data)
 thread init for the file logger This will run the thread init functions for the individual registered loggers
 
TmEcode OutputFileLogThreadDeinit (ThreadVars *tv, OutputFileLoggerThreadData *op_thread_data)
 
void OutputFileLoggerRegister (void)
 
void OutputFileShutdown (void)
 

Variables

bool g_file_logger_enabled = false
 

Detailed Description

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

AppLayer File Logger Output registration functions

Definition in file output-file.c.

Typedef Documentation

◆ OutputFileLogger

Function Documentation

◆ OutputFileLogFfc()

◆ OutputFileLoggerRegister()

void OutputFileLoggerRegister ( void  )

Internal function: private API.

Definition at line 235 of file output-file.c.

Referenced by OutputRegisterRootLoggers().

Here is the caller graph for this function:

◆ OutputFileLogThreadDeinit()

◆ OutputFileLogThreadInit()

TmEcode OutputFileLogThreadInit ( ThreadVars tv,
OutputFileLoggerThreadData **  data 
)

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

Definition at line 164 of file output-file.c.

References BUG_ON, OutputFileLogger_::initdata, OutputFileLogger_::name, OutputFileLogger_::next, OutputLoggerThreadStore_::next, SCCalloc, SCFree, SCLogDebug, OutputFileLoggerThreadData_::store, OutputFileLogger_::ThreadInit, TM_ECODE_FAILED, TM_ECODE_OK, ts, and tv.

◆ OutputFileShutdown()

void OutputFileShutdown ( void  )

Internal function: private API.

Definition at line 239 of file output-file.c.

References OutputFileLogger_::next, and SCFree.

Referenced by RunModeShutDown().

Here is the caller graph for this function:

◆ SCOutputRegisterFileLogger()

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

Register a file 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 to be logged.
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 56 of file output-file.c.

References g_file_logger_enabled, id, OutputFileLogger_::initdata, OutputFileLogger_::LogFunc, OutputFileLogger_::logger_id, OutputFileLogger_::name, name, OutputFileLogger_::next, SCCalloc, SCLogDebug, OutputFileLogger_::ThreadDeinit, and OutputFileLogger_::ThreadInit.

Variable Documentation

◆ g_file_logger_enabled

bool g_file_logger_enabled = false