Go to the documentation of this file.
102 const bool file_close,
const bool file_trunc, uint8_t dir)
104 if (ffc->
head == NULL)
107 SCLogDebug(
"ffc %p ffc->head %p file_close %d file_trunc %d dir %s", ffc,
108 ffc ? ffc->
head : NULL, file_close, file_trunc, dir == STREAM_TOSERVER ?
"ts" :
"tc");
110 for (ff = ffc->
head; ff != NULL; ff = ff->
next) {
120 SCLogDebug(
"file_trunc %d ff->state %u => FILE_STATE_TRUNCATED", file_trunc, ff->
state);
125 SCLogDebug(
"file_close %d ff->state %u => FILE_STATE_TRUNCATED", file_close, ff->
state);
133 bool file_logged =
false;
136 FilemagicThreadLookup(&op_thread_data->magic_ctx, ff);
141 while (logger && store) {
151 logger = logger->
next;
159 CloseFile(p, p->
flow, txd, ff);
176 td->magic_ctx = MagicInitContext();
177 if (td->magic_ctx == NULL) {
183 SCLogDebug(
"OutputFileLogThreadInit happy (*data %p)", *data);
194 ts->thread_data = retptr;
196 if (td->
store == NULL) {
200 while (tmp->
next != NULL)
209 logger = logger->
next;
220 while (logger && store) {
228 logger = logger->
next;
232 MagicDeinitContext(op_thread_data->magic_ctx);
249 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 *)