suricata
output-filedata.c
Go to the documentation of this file.
1 /* Copyright (C) 2007-2014 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * \file
20  *
21  * \author Victor Julien <victor@inliniac.net>
22  *
23  * AppLayer Filedata Logger Output registration functions
24  */
25 
26 #include "suricata-common.h"
27 #include "tm-modules.h"
28 #include "output.h"
29 #include "output-filedata.h"
30 #include "app-layer.h"
31 #include "app-layer-parser.h"
32 #include "detect-filemagic.h"
33 #include "conf.h"
34 #include "util-profiling.h"
35 #include "util-validate.h"
36 #include "util-magic.h"
37 
38 typedef struct OutputLoggerThreadStore_ {
39  void *thread_data;
42 
43 /** per thread data for this module, contains a list of per thread
44  * data for the packet loggers. */
45 typedef struct OutputLoggerThreadData_ {
47 #ifdef HAVE_MAGIC
48  magic_t magic_ctx;
49 #endif
51 
52 /* logger instance, a module + a output ctx,
53  * it's perfectly valid that have multiple instances of the same
54  * log module (e.g. http.log) with different output ctx'. */
55 typedef struct OutputFiledataLogger_ {
59  const char *name;
65 
66 static OutputFiledataLogger *list = NULL;
67 static char g_waldo[PATH_MAX] = "";
68 static SCMutex g_waldo_mutex = SCMUTEX_INITIALIZER;
69 static int g_waldo_init = 0;
70 static int g_waldo_deinit = 0;
71 
76 {
77  OutputFiledataLogger *op = SCMalloc(sizeof(*op));
78  if (op == NULL)
79  return -1;
80  memset(op, 0x00, sizeof(*op));
81 
82  op->LogFunc = LogFunc;
83  op->output_ctx = output_ctx;
84  op->name = name;
85  op->logger_id = id;
86  op->ThreadInit = ThreadInit;
89 
90  if (list == NULL)
91  list = op;
92  else {
93  OutputFiledataLogger *t = list;
94  while (t->next)
95  t = t->next;
96  t->next = op;
97  }
98 
99  SCLogDebug("OutputRegisterFiledataLogger happy");
100  return 0;
101 }
102 
103 SC_ATOMIC_DECLARE(unsigned int, g_file_store_id);
104 
105 static int CallLoggers(ThreadVars *tv, OutputLoggerThreadStore *store_list,
106  Packet *p, File *ff,
107  const uint8_t *data, uint32_t data_len, uint8_t flags, uint8_t dir)
108 {
109  OutputFiledataLogger *logger = list;
110  OutputLoggerThreadStore *store = store_list;
111  int file_logged = 0;
112 
113  while (logger && store) {
114  DEBUG_VALIDATE_BUG_ON(logger->LogFunc == NULL);
115 
116  SCLogDebug("logger %p", logger);
118  logger->LogFunc(tv, store->thread_data, (const Packet *)p, ff, data, data_len, flags, dir);
120 
121  file_logged = 1;
122 
123  logger = logger->next;
124  store = store->next;
125 
126  DEBUG_VALIDATE_BUG_ON(logger == NULL && store != NULL);
127  DEBUG_VALIDATE_BUG_ON(logger != NULL && store == NULL);
128  }
129  return file_logged;
130 }
131 
132 static void OutputFiledataLogFfc(ThreadVars *tv, OutputLoggerThreadData *td,
133  Packet *p, FileContainer *ffc, const uint8_t call_flags,
134  const bool file_close, const bool file_trunc, const uint8_t dir)
135 {
136  if (ffc != NULL) {
137  OutputLoggerThreadStore *store = td->store;
138  File *ff;
139  for (ff = ffc->head; ff != NULL; ff = ff->next) {
140  uint8_t file_flags = call_flags;
141 #ifdef HAVE_MAGIC
142  if (FileForceMagic() && ff->magic == NULL) {
143  FilemagicThreadLookup(&td->magic_ctx, ff);
144  }
145 #endif
146  SCLogDebug("ff %p", ff);
147  if (ff->flags & FILE_STORED) {
148  SCLogDebug("stored flag set");
149  continue;
150  }
151 
152  if (!(ff->flags & FILE_STORE)) {
153  SCLogDebug("ff FILE_STORE not set");
154  continue;
155  }
156 
157  /* if we have no data chunks left to log, we should still
158  * close the logger(s) */
159  if (FileDataSize(ff) == ff->content_stored &&
160  (file_trunc || file_close)) {
161  if (ff->state < FILE_STATE_CLOSED) {
162  FileCloseFilePtr(ff, NULL, 0, FILE_TRUNCATED);
163  }
164  CallLoggers(tv, store, p, ff, NULL, 0, OUTPUT_FILEDATA_FLAG_CLOSE, dir);
165  ff->flags |= FILE_STORED;
166  continue;
167  }
168 
169  /* store */
170 
171  /* if file_store_id == 0, this is the first store of this file */
172  if (ff->file_store_id == 0) {
173  /* new file */
174  ff->file_store_id = SC_ATOMIC_ADD(g_file_store_id, 1);
175  file_flags |= OUTPUT_FILEDATA_FLAG_OPEN;
176  } else {
177  /* existing file */
178  }
179 
180  /* if file needs to be closed or truncated, inform
181  * loggers */
182  if ((file_close || file_trunc) && ff->state < FILE_STATE_CLOSED) {
183  FileCloseFilePtr(ff, NULL, 0, FILE_TRUNCATED);
184  }
185 
186  /* tell the logger we're closing up */
187  if (ff->state >= FILE_STATE_CLOSED)
188  file_flags |= OUTPUT_FILEDATA_FLAG_CLOSE;
189 
190  /* do the actual logging */
191  const uint8_t *data = NULL;
192  uint32_t data_len = 0;
193 
195  &data, &data_len,
196  ff->content_stored);
197 
198  const int file_logged = CallLoggers(tv, store, p, ff, data, data_len, file_flags, dir);
199  if (file_logged) {
200  ff->content_stored += data_len;
201 
202  /* all done */
203  if (file_flags & OUTPUT_FILEDATA_FLAG_CLOSE) {
204  ff->flags |= FILE_STORED;
205  }
206  }
207  }
208  }
209 }
210 
211 static TmEcode OutputFiledataLog(ThreadVars *tv, Packet *p, void *thread_data)
212 {
213  DEBUG_VALIDATE_BUG_ON(thread_data == NULL);
214 
215  if (list == NULL) {
216  /* No child loggers. */
217  return TM_ECODE_OK;
218  }
219 
220  OutputLoggerThreadData *op_thread_data = (OutputLoggerThreadData *)thread_data;
221 
222  /* no flow, no files */
223  Flow * const f = p->flow;
224  if (f == NULL || f->alstate == NULL) {
226  }
227 
228  const bool file_close_ts = ((p->flags & PKT_PSEUDO_STREAM_END) &&
230  const bool file_close_tc = ((p->flags & PKT_PSEUDO_STREAM_END) &&
232  const bool file_trunc = StreamTcpReassembleDepthReached(p);
233 
236  SCLogDebug("ffc_ts %p", ffc_ts);
237  OutputFiledataLogFfc(tv, op_thread_data, p, ffc_ts, STREAM_TOSERVER, file_close_ts, file_trunc, STREAM_TOSERVER);
238  SCLogDebug("ffc_tc %p", ffc_tc);
239  OutputFiledataLogFfc(tv, op_thread_data, p, ffc_tc, STREAM_TOCLIENT, file_close_tc, file_trunc, STREAM_TOCLIENT);
240 
241  return TM_ECODE_OK;
242 }
243 
244 /**
245  * \internal
246  *
247  * \brief Open the waldo file (if available) and load the file_id
248  *
249  * \param path full path for the waldo file
250  */
251 static void LogFiledataLogLoadWaldo(const char *path)
252 {
253  char line[16] = "";
254  unsigned int id = 0;
255 
256  FILE *fp = fopen(path, "r");
257  if (fp == NULL) {
258  SCLogInfo("couldn't open waldo: %s", strerror(errno));
259  SCReturn;
260  }
261 
262  if (fgets(line, (int)sizeof(line), fp) != NULL) {
263  if (sscanf(line, "%10u", &id) == 1) {
264  SCLogInfo("id %u", id);
265  SC_ATOMIC_SET(g_file_store_id, id);
266  }
267  }
268  fclose(fp);
269 }
270 
271 /**
272  * \internal
273  *
274  * \brief Store the waldo file based on the file_id
275  *
276  * \param path full path for the waldo file
277  */
278 static void LogFiledataLogStoreWaldo(const char *path)
279 {
280  char line[16] = "";
281 
282  if (SC_ATOMIC_GET(g_file_store_id) == 1) {
283  SCReturn;
284  }
285 
286  FILE *fp = fopen(path, "w");
287  if (fp == NULL) {
288  SCLogInfo("couldn't open waldo: %s", strerror(errno));
289  SCReturn;
290  }
291 
292  snprintf(line, sizeof(line), "%u\n", SC_ATOMIC_GET(g_file_store_id));
293  if (fwrite(line, strlen(line), 1, fp) != 1) {
294  SCLogError(SC_ERR_FWRITE, "fwrite failed: %s", strerror(errno));
295  }
296  fclose(fp);
297 }
298 
299 /** \brief thread init for the tx logger
300  * This will run the thread init functions for the individual registered
301  * loggers */
302 static TmEcode OutputFiledataLogThreadInit(ThreadVars *tv, const void *initdata, void **data)
303 {
304  OutputLoggerThreadData *td = SCMalloc(sizeof(*td));
305  if (td == NULL)
306  return TM_ECODE_FAILED;
307  memset(td, 0x00, sizeof(*td));
308 
309  *data = (void *)td;
310 
311 #ifdef HAVE_MAGIC
312  td->magic_ctx = MagicInitContext();
313  if (td->magic_ctx == NULL) {
314  SCFree(td);
315  return TM_ECODE_FAILED;
316  }
317 #endif
318 
319  SCLogDebug("OutputFiledataLogThreadInit happy (*data %p)", *data);
320 
321  OutputFiledataLogger *logger = list;
322  while (logger) {
323  if (logger->ThreadInit) {
324  void *retptr = NULL;
325  if (logger->ThreadInit(tv, (void *)logger->output_ctx, &retptr) == TM_ECODE_OK) {
326  OutputLoggerThreadStore *ts = SCMalloc(sizeof(*ts));
327 /* todo */ BUG_ON(ts == NULL);
328  memset(ts, 0x00, sizeof(*ts));
329 
330  /* store thread handle */
331  ts->thread_data = retptr;
332 
333  if (td->store == NULL) {
334  td->store = ts;
335  } else {
336  OutputLoggerThreadStore *tmp = td->store;
337  while (tmp->next != NULL)
338  tmp = tmp->next;
339  tmp->next = ts;
340  }
341 
342  SCLogDebug("%s is now set up", logger->name);
343  }
344  }
345 
346  logger = logger->next;
347  }
348 
349  SCMutexLock(&g_waldo_mutex);
350  if (g_waldo_init == 0) {
351  ConfNode *node = ConfGetNode("file-store-waldo");
352  if (node == NULL) {
353  ConfNode *outputs = ConfGetNode("outputs");
354  if (outputs) {
355  ConfNode *output;
356  TAILQ_FOREACH(output, &outputs->head, next) {
357  /* we only care about file and file-store */
358  if (!(strcmp(output->val, "file") == 0 || strcmp(output->val, "file-store") == 0))
359  continue;
360 
361  ConfNode *file = ConfNodeLookupChild(output, output->val);
362  BUG_ON(file == NULL);
363  if (file == NULL) {
364  SCLogDebug("file-store failed, lets try 'file'");
365  file = ConfNodeLookupChild(outputs, "file");
366  if (file == NULL)
367  SCLogDebug("file failed as well, giving up");
368  }
369 
370  if (file != NULL) {
371  node = ConfNodeLookupChild(file, "waldo");
372  if (node == NULL)
373  SCLogDebug("no waldo node");
374  }
375  }
376  }
377  }
378  if (node != NULL) {
379  const char *s_default_log_dir = NULL;
380  s_default_log_dir = ConfigGetLogDirectory();
381 
382  const char *waldo = node->val;
383  SCLogDebug("loading waldo %s", waldo);
384  if (waldo != NULL && strlen(waldo) > 0) {
385  if (PathIsAbsolute(waldo)) {
386  snprintf(g_waldo, sizeof(g_waldo), "%s", waldo);
387  } else {
388  snprintf(g_waldo, sizeof(g_waldo), "%s/%s", s_default_log_dir, waldo);
389  }
390 
391  SCLogDebug("loading waldo file %s", g_waldo);
392  LogFiledataLogLoadWaldo(g_waldo);
393  }
394  }
395  g_waldo_init = 1;
396  }
397  SCMutexUnlock(&g_waldo_mutex);
398  return TM_ECODE_OK;
399 }
400 
401 static TmEcode OutputFiledataLogThreadDeinit(ThreadVars *tv, void *thread_data)
402 {
403  OutputLoggerThreadData *op_thread_data = (OutputLoggerThreadData *)thread_data;
404  OutputLoggerThreadStore *store = op_thread_data->store;
405  OutputFiledataLogger *logger = list;
406 
407  while (logger && store) {
408  if (logger->ThreadDeinit) {
409  logger->ThreadDeinit(tv, store->thread_data);
410  }
411 
412  OutputLoggerThreadStore *next_store = store->next;
413  SCFree(store);
414  store = next_store;
415  logger = logger->next;
416  }
417 
418  SCMutexLock(&g_waldo_mutex);
419  if (g_waldo_deinit == 0) {
420  if (strlen(g_waldo) > 0) {
421  SCLogDebug("we have a waldo at %s", g_waldo);
422  LogFiledataLogStoreWaldo(g_waldo);
423  }
424  g_waldo_deinit = 1;
425  }
426  SCMutexUnlock(&g_waldo_mutex);
427 
428 #ifdef HAVE_MAGIC
429  MagicDeinitContext(op_thread_data->magic_ctx);
430 #endif
431 
432  SCFree(op_thread_data);
433  return TM_ECODE_OK;
434 }
435 
436 static void OutputFiledataLogExitPrintStats(ThreadVars *tv, void *thread_data)
437 {
438  OutputLoggerThreadData *op_thread_data = (OutputLoggerThreadData *)thread_data;
439  OutputLoggerThreadStore *store = op_thread_data->store;
440  OutputFiledataLogger *logger = list;
441 
442  while (logger && store) {
443  if (logger->ThreadExitPrintStats) {
444  logger->ThreadExitPrintStats(tv, store->thread_data);
445  }
446 
447  logger = logger->next;
448  store = store->next;
449  }
450 }
451 
452 static uint32_t OutputFiledataLoggerGetActiveCount(void)
453 {
454  uint32_t cnt = 0;
455  for (OutputFiledataLogger *p = list; p != NULL; p = p->next) {
456  cnt++;
457  }
458  return cnt;
459 }
460 
462 {
463  OutputRegisterRootLogger(OutputFiledataLogThreadInit,
464  OutputFiledataLogThreadDeinit, OutputFiledataLogExitPrintStats,
465  OutputFiledataLog, OutputFiledataLoggerGetActiveCount);
466  SC_ATOMIC_INIT(g_file_store_id);
467  SC_ATOMIC_SET(g_file_store_id, 1);
468 }
469 
471 {
472  OutputFiledataLogger *logger = list;
473  while (logger) {
474  OutputFiledataLogger *next_logger = logger->next;
475  SCFree(logger);
476  logger = next_logger;
477  }
478 
479  list = NULL;
480 }
SC_ERR_FWRITE
@ SC_ERR_FWRITE
Definition: util-error.h:129
FILE_TRUNCATED
#define FILE_TRUNCATED
Definition: util-file.h:36
FileContainer_
Definition: util-file.h:100
ts
uint64_t ts
Definition: source-erf-file.c:54
OutputLoggerThreadStore_
Definition: output-file.c:37
OutputFiledataLogger_::name
const char * name
Definition: output-filedata.c:59
OutputLoggerThreadStore_::next
struct OutputLoggerThreadStore_ * next
Definition: output-file.c:39
SC_ATOMIC_INIT
#define SC_ATOMIC_INIT(name)
wrapper for initializing an atomic variable.
Definition: util-atomic.h:315
ConfNode_::val
char * val
Definition: conf.h:34
SC_ATOMIC_SET
#define SC_ATOMIC_SET(name, val)
Set the value for the atomic variable.
Definition: util-atomic.h:387
output-filedata.h
OutputFiledataLogger_::ThreadDeinit
ThreadDeinitFunc ThreadDeinit
Definition: output-filedata.c:62
StreamTcpReassembleDepthReached
int StreamTcpReassembleDepthReached(Packet *p)
check if stream in pkt direction has depth reached
Definition: stream-tcp-reassemble.c:493
OutputFiledataLogger_::logger_id
LoggerId logger_id
Definition: output-filedata.c:60
SCLogDebug
#define SCLogDebug(...)
Definition: util-debug.h:298
next
struct HtpBodyChunk_ * next
Definition: app-layer-htp.h:0
Packet_::flags
uint32_t flags
Definition: decode.h:449
ConfGetNode
ConfNode * ConfGetNode(const char *name)
Get a ConfNode by name.
Definition: conf.c:175
Flow_
Flow data structure.
Definition: flow.h:347
File_::state
FileState state
Definition: util-file.h:66
OutputFiledataLogger_::output_ctx
OutputCtx * output_ctx
Definition: output-filedata.c:57
LoggerId
LoggerId
Definition: suricata-common.h:439
SC_ATOMIC_ADD
#define SC_ATOMIC_ADD(name, val)
add a value to our atomic variable
Definition: util-atomic.h:333
OutputFiledataShutdown
void OutputFiledataShutdown(void)
Definition: output-filedata.c:470
FILE_STORE
#define FILE_STORE
Definition: util-file.h:46
File_::file_store_id
uint32_t file_store_id
Definition: util-file.h:70
TAILQ_FOREACH
#define TAILQ_FOREACH(var, head, field)
Definition: queue.h:350
SCMutexLock
#define SCMutexLock(mut)
Definition: threads-debug.h:117
FLOW_PKT_TOSERVER
#define FLOW_PKT_TOSERVER
Definition: flow.h:219
tm-modules.h
OutputFiledataLogger_::next
struct OutputFiledataLogger_ * next
Definition: output-filedata.c:58
AppLayerParserGetFiles
FileContainer * AppLayerParserGetFiles(const Flow *f, const uint8_t direction)
Definition: app-layer-parser.c:858
SCMUTEX_INITIALIZER
#define SCMUTEX_INITIALIZER
Definition: threads-debug.h:121
FiledataLogger
int(* FiledataLogger)(ThreadVars *, void *thread_data, const Packet *, File *, const uint8_t *, uint32_t, uint8_t, uint8_t dir)
Definition: output-filedata.h:36
StreamingBufferGetDataAtOffset
int StreamingBufferGetDataAtOffset(const StreamingBuffer *sb, const uint8_t **data, uint32_t *data_len, uint64_t offset)
Definition: util-streaming-buffer.c:866
Packet_::flowflags
uint8_t flowflags
Definition: decode.h:445
TM_ECODE_FAILED
@ TM_ECODE_FAILED
Definition: tm-threads-common.h:81
OUTPUT_FILEDATA_FLAG_CLOSE
#define OUTPUT_FILEDATA_FLAG_CLOSE
Definition: output-filedata.h:33
TM_ECODE_OK
@ TM_ECODE_OK
Definition: tm-threads-common.h:80
OutputLoggerThreadStore_::thread_data
void * thread_data
Definition: output-file.c:38
OutputCtx_
Definition: tm-modules.h:78
File_::sb
StreamingBuffer * sb
Definition: util-file.h:67
OutputRegisterFiledataLogger
int OutputRegisterFiledataLogger(LoggerId id, const char *name, FiledataLogger LogFunc, OutputCtx *output_ctx, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Definition: output-filedata.c:72
SC_ATOMIC_DECLARE
SC_ATOMIC_DECLARE(unsigned int, g_file_store_id)
FileCloseFilePtr
int FileCloseFilePtr(File *ff, const uint8_t *data, uint32_t data_len, uint16_t flags)
Definition: util-file.c:945
OutputLoggerThreadData_
Definition: output-file.c:44
FileForceMagic
int FileForceMagic(void)
Definition: util-file.c:143
SCMutexUnlock
#define SCMutexUnlock(mut)
Definition: threads-debug.h:119
OutputLoggerThreadData
struct OutputLoggerThreadData_ OutputLoggerThreadData
PKT_PSEUDO_STREAM_END
#define PKT_PSEUDO_STREAM_END
Definition: decode.h:1110
STREAM_TOSERVER
#define STREAM_TOSERVER
Definition: stream.h:31
detect-filemagic.h
FileContainer_::head
File * head
Definition: util-file.h:101
ThreadVars_
Per thread variable structure.
Definition: threadvars.h:58
ThreadInitFunc
TmEcode(* ThreadInitFunc)(ThreadVars *, const void *, void **)
Definition: tm-modules.h:39
app-layer-parser.h
BUG_ON
#define BUG_ON(x)
Definition: suricata-common.h:282
util-profiling.h
SCReturn
#define SCReturn
Definition: util-debug.h:302
Packet_
Definition: decode.h:414
OutputFiledataLogger_::LogFunc
FiledataLogger LogFunc
Definition: output-filedata.c:56
OutputLoggerThreadData_::store
OutputLoggerThreadStore * store
Definition: output-file.c:45
OutputFiledataLogger_
Definition: output-filedata.c:55
conf.h
util-magic.h
TmEcode
TmEcode
Definition: tm-threads-common.h:79
FLOW_PKT_TOCLIENT
#define FLOW_PKT_TOCLIENT
Definition: flow.h:220
SCLogInfo
#define SCLogInfo(...)
Macro used to log INFORMATIONAL messages.
Definition: util-debug.h:217
FileDataSize
uint64_t FileDataSize(const File *file)
get the size of the file data
Definition: util-file.c:291
ConfNodeLookupChild
ConfNode * ConfNodeLookupChild(const ConfNode *node, const char *name)
Lookup a child configuration node by name.
Definition: conf.c:814
File_::flags
uint16_t flags
Definition: util-file.h:64
PACKET_PROFILING_LOGGER_END
#define PACKET_PROFILING_LOGGER_END(p, id)
Definition: util-profiling.h:260
FILE_STATE_CLOSED
@ FILE_STATE_CLOSED
Definition: util-file.h:55
File_
Definition: util-file.h:63
File_::content_stored
uint64_t content_stored
Definition: util-file.h:88
Packet_::flow
struct Flow_ * flow
Definition: decode.h:451
flags
uint8_t flags
Definition: decode-gre.h:0
suricata-common.h
OutputFiledataLogger
struct OutputFiledataLogger_ OutputFiledataLogger
FILE_STORED
#define FILE_STORED
Definition: util-file.h:47
ThreadExitPrintStatsFunc
void(* ThreadExitPrintStatsFunc)(ThreadVars *, void *)
Definition: tm-modules.h:41
OUTPUT_FILEDATA_FLAG_OPEN
#define OUTPUT_FILEDATA_FLAG_OPEN
Definition: output-filedata.h:32
File_::next
struct File_ * next
Definition: util-file.h:77
STREAM_TOCLIENT
#define STREAM_TOCLIENT
Definition: stream.h:32
PathIsAbsolute
int PathIsAbsolute(const char *path)
Check if a path is absolute.
Definition: util-path.c:45
SCLogError
#define SCLogError(err_code,...)
Macro used to log ERROR messages.
Definition: util-debug.h:257
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:29
OutputFiledataLogger_::ThreadExitPrintStats
ThreadExitPrintStatsFunc ThreadExitPrintStats
Definition: output-filedata.c:63
util-validate.h
SCMalloc
#define SCMalloc(sz)
Definition: util-mem.h:47
Packet_::next
struct Packet_ * next
Definition: decode.h:579
ConfigGetLogDirectory
const char * ConfigGetLogDirectory()
Definition: util-conf.c:35
SCFree
#define SCFree(p)
Definition: util-mem.h:61
ConfNode_
Definition: conf.h:32
Flow_::alstate
void * alstate
Definition: flow.h:476
PACKET_PROFILING_LOGGER_START
#define PACKET_PROFILING_LOGGER_START(p, id)
Definition: util-profiling.h:253
OutputRegisterRootLogger
void OutputRegisterRootLogger(ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats, OutputLogFunc LogFunc, OutputGetActiveCountFunc ActiveCntFunc)
Definition: output.c:962
OutputFiledataLogger_::ThreadInit
ThreadInitFunc ThreadInit
Definition: output-filedata.c:61
SC_ATOMIC_GET
#define SC_ATOMIC_GET(name)
Get the value from the atomic variable.
Definition: util-atomic.h:376
SCReturnInt
#define SCReturnInt(x)
Definition: util-debug.h:304
OutputFiledataLoggerRegister
void OutputFiledataLoggerRegister(void)
Definition: output-filedata.c:461
SCMutex
#define SCMutex
Definition: threads-debug.h:114
DEBUG_VALIDATE_BUG_ON
#define DEBUG_VALIDATE_BUG_ON(exp)
Definition: util-validate.h:111
output.h
ThreadDeinitFunc
TmEcode(* ThreadDeinitFunc)(ThreadVars *, void *)
Definition: tm-modules.h:40
app-layer.h
OutputLoggerThreadStore
struct OutputLoggerThreadStore_ OutputLoggerThreadStore