Go to the documentation of this file.
72 memset(op, 0x00,
sizeof(*op));
112 FileContainer *ffc,
const bool file_close,
const bool file_trunc, uint8_t dir)
117 for (ff = ffc->
head; ff != NULL; ff = ff->
next) {
132 bool file_logged =
false;
135 FilemagicThreadLookup(&op_thread_data->magic_ctx, ff);
140 while (logger && store) {
149 logger = logger->
next;
157 CloseFile(p, p->
flow, ff);
177 if (f == NULL || f->
alstate == NULL) {
181 if (p->
proto == IPPROTO_TCP) {
187 tv, op_thread_data, p, ffc_ts, file_close_ts, file_trunc, STREAM_TOSERVER);
192 tv, op_thread_data, p, ffc_tc, file_close_tc, file_trunc, STREAM_TOCLIENT);
194 }
else if (p->
proto == IPPROTO_UDP) {
196 OutputFileLogFfc(
tv, op_thread_data, p, ffc_ts,
false,
false, STREAM_TOSERVER);
198 OutputFileLogFfc(
tv, op_thread_data, p, ffc_tc,
false,
false, STREAM_TOCLIENT);
211 memset(td, 0x00,
sizeof(*td));
216 td->magic_ctx = MagicInitContext();
217 if (td->magic_ctx == NULL) {
223 SCLogDebug(
"OutputFileLogThreadInit happy (*data %p)", *data);
232 memset(
ts, 0x00,
sizeof(*
ts));
235 ts->thread_data = retptr;
237 if (td->
store == NULL) {
241 while (tmp->
next != NULL)
250 logger = logger->
next;
262 while (logger && store) {
270 logger = logger->
next;
274 MagicDeinitContext(op_thread_data->magic_ctx);
281 static void OutputFileLogExitPrintStats(
ThreadVars *
tv,
void *thread_data)
287 while (logger && store) {
292 logger = logger->
next;
297 static uint32_t OutputFileLoggerGetActiveCount(
void)
309 OutputFileLogThreadDeinit, OutputFileLogExitPrintStats,
310 OutputFileLog, OutputFileLoggerGetActiveCount);
319 logger = next_logger;
struct OutputLoggerThreadStore_ * next
int StreamTcpReassembleDepthReached(Packet *p)
check if stream in pkt direction has depth reached
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
#define FLOW_PKT_TOSERVER
FileContainer * AppLayerParserGetFiles(const Flow *f, const uint8_t direction)
struct OutputFileLoggerThreadData_ OutputFileLoggerThreadData
#define PKT_PSEUDO_STREAM_END
Per thread variable structure.
TmEcode(* ThreadInitFunc)(ThreadVars *, const void *, void **)
ThreadExitPrintStatsFunc ThreadExitPrintStats
void OutputFileShutdown(void)
void * AppLayerParserGetTx(uint8_t ipproto, AppProto alproto, void *alstate, uint64_t tx_id)
#define PACKET_PROFILING_LOGGER_END(p, id)
void(* ThreadExitPrintStatsFunc)(ThreadVars *, void *)
ThreadDeinitFunc ThreadDeinit
int(* FileLogger)(ThreadVars *, void *thread_data, const Packet *, const File *, uint8_t direction)
AppLayerTxData * AppLayerParserGetTxData(uint8_t ipproto, AppProto alproto, void *tx)
#define PACKET_PROFILING_LOGGER_START(p, id)
void OutputRegisterRootLogger(ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats, OutputLogFunc LogFunc, OutputGetActiveCountFunc ActiveCntFunc)
bool g_file_logger_enabled
AppProto alproto
application level protocol
#define DEBUG_VALIDATE_BUG_ON(exp)
ThreadInitFunc ThreadInit
OutputLoggerThreadStore * store
TmEcode(* ThreadDeinitFunc)(ThreadVars *, void *)