Go to the documentation of this file.
98 const bool file_close,
const bool file_trunc, uint8_t dir)
100 if (ffc->
head == NULL)
103 SCLogDebug(
"ffc %p ffc->head %p file_close %d file_trunc %d dir %s", ffc,
104 ffc ? ffc->
head : NULL, file_close, file_trunc, dir == STREAM_TOSERVER ?
"ts" :
"tc");
106 for (ff = ffc->
head; ff != NULL; ff = ff->
next) {
116 SCLogDebug(
"file_trunc %d ff->state %u => FILE_STATE_TRUNCATED", file_trunc, ff->
state);
121 SCLogDebug(
"file_close %d ff->state %u => FILE_STATE_TRUNCATED", file_close, ff->
state);
129 bool file_logged =
false;
132 FilemagicThreadLookup(&op_thread_data->magic_ctx, ff);
137 while (logger && store) {
147 logger = logger->
next;
155 CloseFile(p, p->
flow, txd, ff);
172 td->magic_ctx = MagicInitContext();
173 if (td->magic_ctx == NULL) {
179 SCLogDebug(
"OutputFileLogThreadInit happy (*data %p)", *data);
190 ts->thread_data = retptr;
192 if (td->
store == NULL) {
196 while (tmp->
next != NULL)
205 logger = logger->
next;
216 while (logger && store) {
224 logger = logger->
next;
228 MagicDeinitContext(op_thread_data->magic_ctx);
245 logger = next_logger;
void OutputFileLoggerRegister(void)
struct OutputFileLogger_ OutputFileLogger
int(* SCFileLogger)(ThreadVars *, void *thread_data, const Packet *, const File *, void *tx, const uint64_t tx_id, uint8_t direction)
struct OutputFileLogger_ * next
struct OutputLoggerThreadStore_ * next
void FileApplyTxFlags(const AppLayerTxData *txd, const uint8_t direction, File *file)
TmEcode OutputFileLogThreadDeinit(ThreadVars *tv, OutputFileLoggerThreadData *op_thread_data)
Per thread variable structure.
TmEcode(* ThreadInitFunc)(ThreadVars *, const void *, void **)
void OutputFileShutdown(void)
int SCOutputRegisterFileLogger(LoggerId id, const char *name, SCFileLogger LogFunc, void *initdata, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a file logger.
#define PACKET_PROFILING_LOGGER_END(p, id)
struct AppLayerTxData AppLayerTxData
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 *)