Go to the documentation of this file.
65 memset(op, 0x00,
sizeof(*op));
103 const bool file_close,
const bool file_trunc, uint8_t dir)
105 if (ffc->
head == NULL)
108 SCLogDebug(
"ffc %p ffc->head %p file_close %d file_trunc %d dir %s", ffc,
109 ffc ? ffc->
head : NULL, file_close, file_trunc, dir == STREAM_TOSERVER ?
"ts" :
"tc");
111 for (ff = ffc->
head; ff != NULL; ff = ff->
next) {
121 SCLogDebug(
"file_trunc %d ff->state %u => FILE_STATE_TRUNCATED", file_trunc, ff->
state);
126 SCLogDebug(
"file_close %d ff->state %u => FILE_STATE_TRUNCATED", file_close, ff->
state);
134 bool file_logged =
false;
137 FilemagicThreadLookup(&op_thread_data->magic_ctx, ff);
142 while (logger && store) {
152 logger = logger->
next;
160 CloseFile(p, p->
flow, txd, ff);
177 td->magic_ctx = MagicInitContext();
178 if (td->magic_ctx == NULL) {
184 SCLogDebug(
"OutputFileLogThreadInit happy (*data %p)", *data);
193 memset(
ts, 0x00,
sizeof(*
ts));
196 ts->thread_data = retptr;
198 if (td->
store == NULL) {
202 while (tmp->
next != NULL)
211 logger = logger->
next;
222 while (logger && store) {
230 logger = logger->
next;
234 MagicDeinitContext(op_thread_data->magic_ctx);
251 logger = next_logger;
void OutputFileLoggerRegister(void)
int OutputRegisterFileLogger(LoggerId id, const char *name, FileLogger LogFunc, OutputCtx *output_ctx, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
struct OutputFileLogger_ OutputFileLogger
struct OutputFileLogger_ * next
struct OutputLoggerThreadStore_ * next
void FileApplyTxFlags(const AppLayerTxData *txd, const uint8_t direction, File *file)
int(* FileLogger)(ThreadVars *, void *thread_data, const Packet *, const File *, void *tx, const uint64_t tx_id, uint8_t direction)
TmEcode OutputFileLogThreadDeinit(ThreadVars *tv, OutputFileLoggerThreadData *op_thread_data)
Per thread variable structure.
TmEcode(* ThreadInitFunc)(ThreadVars *, const void *, void **)
ThreadExitPrintStatsFunc ThreadExitPrintStats
void OutputFileShutdown(void)
#define PACKET_PROFILING_LOGGER_END(p, id)
struct AppLayerTxData AppLayerTxData
void(* ThreadExitPrintStatsFunc)(ThreadVars *, void *)
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)
ThreadDeinitFunc ThreadDeinit
TmEcode OutputFileLogThreadInit(ThreadVars *tv, OutputFileLoggerThreadData **data)
thread init for the file logger This will run the thread init functions for the individual registered...
#define PACKET_PROFILING_LOGGER_START(p, id)
bool g_file_logger_enabled
AppProto alproto
application level protocol
#define DEBUG_VALIDATE_BUG_ON(exp)
ThreadInitFunc ThreadInit
OutputLoggerThreadStore * store
TmEcode(* ThreadDeinitFunc)(ThreadVars *, void *)