suricata
|
#include "suricata-common.h"
#include "output.h"
#include "output-filedata.h"
#include "app-layer-parser.h"
#include "detect-filemagic.h"
#include "conf.h"
#include "util-profiling.h"
#include "util-validate.h"
#include "util-magic.h"
#include "util-path.h"
Go to the source code of this file.
Data Structures | |
struct | OutputFiledataLogger_ |
Typedefs | |
typedef struct OutputFiledataLogger_ | OutputFiledataLogger |
Functions | |
int | SCOutputRegisterFiledataLogger (LoggerId id, const char *name, SCFiledataLogger LogFunc, void *initdata, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit) |
Register a file-data logger. | |
SC_ATOMIC_DECLARE (unsigned int, g_file_store_id) | |
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) |
TmEcode | OutputFiledataLogThreadInit (ThreadVars *tv, OutputFiledataLoggerThreadData **data) |
thread init for the filedata logger This will run the thread init functions for the individual registered loggers | |
TmEcode | OutputFiledataLogThreadDeinit (ThreadVars *tv, OutputFiledataLoggerThreadData *op_thread_data) |
void | OutputFiledataLoggerRegister (void) |
void | OutputFiledataShutdown (void) |
Variables | |
bool | g_filedata_logger_enabled = false |
AppLayer Filedata Logger Output registration functions
Definition in file output-filedata.c.
typedef struct OutputFiledataLogger_ OutputFiledataLogger |
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 | ||
) |
Definition at line 122 of file output-filedata.c.
References File_::content_stored, FILE_STATE_CLOSED, FILE_STORE, File_::file_store_id, FILE_STORED, FILE_TRUNCATED, FileApplyTxFlags(), FileCloseFilePtr(), FileDataSize(), FileForceMagic(), FilePrintFlags, File_::flags, Packet_::flow, File_::next, OUTPUT_FILEDATA_FLAG_CLOSE, OUTPUT_FILEDATA_FLAG_OPEN, File_::sb, SC_ATOMIC_ADD, SCLogDebug, File_::state, OutputFiledataLoggerThreadData_::store, StreamingBufferGetDataAtOffset(), and tv.
void OutputFiledataLoggerRegister | ( | void | ) |
Definition at line 269 of file output-filedata.c.
References SC_ATOMIC_INIT, and SC_ATOMIC_SET.
Referenced by OutputRegisterRootLoggers().
TmEcode OutputFiledataLogThreadDeinit | ( | ThreadVars * | tv, |
OutputFiledataLoggerThreadData * | op_thread_data | ||
) |
Definition at line 244 of file output-filedata.c.
References OutputFiledataLogger_::next, OutputLoggerThreadStore_::next, SCFree, OutputFiledataLoggerThreadData_::store, OutputLoggerThreadStore_::thread_data, OutputFiledataLogger_::ThreadDeinit, TM_ECODE_OK, and tv.
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 198 of file output-filedata.c.
References BUG_ON, OutputFiledataLogger_::initdata, OutputFiledataLogger_::name, OutputFiledataLogger_::next, OutputLoggerThreadStore_::next, SCCalloc, SCFree, SCLogDebug, OutputFiledataLoggerThreadData_::store, OutputFiledataLogger_::ThreadInit, TM_ECODE_FAILED, TM_ECODE_OK, ts, and tv.
void OutputFiledataShutdown | ( | void | ) |
Definition at line 275 of file output-filedata.c.
References OutputFiledataLogger_::next, and SCFree.
Referenced by RunModeShutDown().
SC_ATOMIC_DECLARE | ( | unsigned int | , |
g_file_store_id | |||
) |
int SCOutputRegisterFiledataLogger | ( | LoggerId | id, |
const char * | name, | ||
SCFiledataLogger | LogFunc, | ||
void * | initdata, | ||
ThreadInitFunc | ThreadInit, | ||
ThreadDeinitFunc | ThreadDeinit | ||
) |
Register a file-data logger.
logger_id | An ID used to distinguish this logger from others while profiling. |
name | An informational name for this logger. Used only for debugging. |
LogFunc | A function that will be called to log each file-data. |
initdata | Initialization data that will pass to the ThreadInitFunc. |
ThreadInitFunc | Thread initialization function. |
ThreadDeinitFunc | Thread de-initialization function. |
0 | on success, -1 on failure. |
Definition at line 54 of file output-filedata.c.
References g_filedata_logger_enabled, id, OutputFiledataLogger_::initdata, OutputFiledataLogger_::LogFunc, OutputFiledataLogger_::logger_id, OutputFiledataLogger_::name, name, OutputFiledataLogger_::next, SCCalloc, SCLogDebug, OutputFiledataLogger_::ThreadDeinit, and OutputFiledataLogger_::ThreadInit.
bool g_filedata_logger_enabled = false |
Definition at line 37 of file output-filedata.c.
Referenced by AppLayerParserTransactionsCleanup(), RunModeInitializeOutputs(), and SCOutputRegisterFiledataLogger().