suricata
output-streaming.c
Go to the documentation of this file.
1 /* Copyright (C) 2007-2022 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  * Logger for streaming data
24  */
25 
26 #include "suricata-common.h"
27 #include "output.h"
28 #include "output-streaming.h"
29 #include "app-layer.h"
30 #include "app-layer-parser.h"
31 #include "app-layer-htp.h"
32 #include "util-print.h"
33 #include "conf.h"
34 #include "util-profiling.h"
35 #include "stream-tcp.h"
36 #include "stream-tcp-inline.h"
37 #include "stream-tcp-reassemble.h"
38 #include "util-validate.h"
39 
40 /** per thread data for this module, contains a list of per thread
41  * data for the packet loggers. */
44  uint32_t loggers;
46 
47 /* logger instance, a module + a output ctx,
48  * it's perfectly valid that have multiple instances of the same
49  * log module (e.g. http.log) with different output ctx'. */
50 typedef struct OutputStreamingLogger_ {
54  const char *name;
61 
62 static OutputStreamingLogger *list = NULL;
63 
69 {
70  OutputStreamingLogger *op = SCMalloc(sizeof(*op));
71  if (op == NULL)
72  return -1;
73  memset(op, 0x00, sizeof(*op));
74 
75  op->LogFunc = LogFunc;
76  op->output_ctx = output_ctx;
77  op->name = name;
78  op->logger_id = id;
79  op->type = type;
80  op->ThreadInit = ThreadInit;
83 
84  if (list == NULL)
85  list = op;
86  else {
87  OutputStreamingLogger *t = list;
88  while (t->next)
89  t = t->next;
90  t->next = op;
91  }
92 
93  if (op->type == STREAMING_TCP_DATA) {
95  }
96 
97  SCLogDebug("OutputRegisterStreamingLogger happy");
98  return 0;
99 }
100 
101 typedef struct StreamerCallbackData_ {
108 
109 static int Streamer(void *cbdata, Flow *f, const uint8_t *data, uint32_t data_len, uint64_t tx_id, uint8_t flags)
110 {
111  StreamerCallbackData *streamer_cbdata = (StreamerCallbackData *)cbdata;
112  DEBUG_VALIDATE_BUG_ON(streamer_cbdata == NULL);
113  OutputStreamingLogger *logger = streamer_cbdata->logger;
114  OutputLoggerThreadStore *store = streamer_cbdata->store;
115  ThreadVars *tv = streamer_cbdata->tv;
116 #ifdef PROFILING
117  Packet *p = streamer_cbdata->p;
118 #endif
119  DEBUG_VALIDATE_BUG_ON(logger == NULL);
120  DEBUG_VALIDATE_BUG_ON(store == NULL);
121 
122  while (logger && store) {
123  DEBUG_VALIDATE_BUG_ON(logger->LogFunc == NULL);
124 
125  if (logger->type == streamer_cbdata->type) {
126  SCLogDebug("logger %p", logger);
128  logger->LogFunc(tv, store->thread_data, (const Flow *)f, data, data_len, tx_id, flags);
130  }
131 
132  logger = logger->next;
133  store = store->next;
134 
135  DEBUG_VALIDATE_BUG_ON(logger == NULL && store != NULL);
136  DEBUG_VALIDATE_BUG_ON(logger != NULL && store == NULL);
137  }
138 
139  return 0;
140 }
141 
142 /** \brief Http Body Iterator for logging
143  *
144  * Global logic:
145  *
146  * - For each tx
147  * - For each body chunk
148  * - Invoke Streamer
149  */
150 
151 static int HttpBodyIterator(Flow *f, int close, void *cbdata, uint8_t iflags)
152 {
153  SCLogDebug("called with %p, %d, %p, %02x", f, close, cbdata, iflags);
154 
155  HtpState *s = f->alstate;
156  if (s == NULL || s->conn == NULL) {
157  return 0;
158  }
159 
160  const int tx_progress_done_value_ts =
162  const int tx_progress_done_value_tc =
164  const uint64_t total_txs = AppLayerParserGetTxCnt(f, f->alstate);
165 
166  uint64_t tx_id = 0;
167  for (tx_id = 0; tx_id < total_txs; tx_id++) { // TODO optimization store log tx
168  htp_tx_t *tx = AppLayerParserGetTx(f->proto, f->alproto, f->alstate, tx_id);
169  if (tx == NULL) {
170  continue;
171  }
172 
173  int tx_done = 0;
174  int tx_logged = 0;
175  int tx_progress_ts = AppLayerParserGetStateProgress(
176  IPPROTO_TCP, ALPROTO_HTTP1, tx, FlowGetDisruptionFlags(f, STREAM_TOSERVER));
177  if (tx_progress_ts >= tx_progress_done_value_ts) {
178  int tx_progress_tc = AppLayerParserGetStateProgress(
179  IPPROTO_TCP, ALPROTO_HTTP1, tx, FlowGetDisruptionFlags(f, STREAM_TOCLIENT));
180  if (tx_progress_tc >= tx_progress_done_value_tc) {
181  tx_done = 1;
182  }
183  }
184 
185  SCLogDebug("tx %p", tx);
186  HtpTxUserData *htud = (HtpTxUserData *) htp_tx_get_user_data(tx);
187  if (htud != NULL) {
188  SCLogDebug("htud %p", htud);
189  HtpBody *body = NULL;
190  if (iflags & OUTPUT_STREAMING_FLAG_TOSERVER)
191  body = &htud->request_body;
192  else if (iflags & OUTPUT_STREAMING_FLAG_TOCLIENT)
193  body = &htud->response_body;
194 
195  if (body == NULL) {
196  SCLogDebug("no body");
197  goto next;
198  }
199  if (body->first == NULL) {
200  SCLogDebug("no body chunks");
201  goto next;
202  }
203  if (body->last->logged == 1) {
204  SCLogDebug("all logged already");
205  goto next;
206  }
207 
208  // for each chunk
209  HtpBodyChunk *chunk = body->first;
210  for ( ; chunk != NULL; chunk = chunk->next) {
211  if (chunk->logged) {
212  SCLogDebug("logged %d", chunk->logged);
213  continue;
214  }
215 
216  uint8_t flags = iflags | OUTPUT_STREAMING_FLAG_TRANSACTION;
217  if (chunk->sbseg.stream_offset == 0)
219  /* if we need to close and we're at the last segment in the list
220  * we add the 'close' flag so the logger can close up. */
221  if ((tx_done || close) && chunk->next == NULL) {
223  }
224 
225  const uint8_t *data = NULL;
226  uint32_t data_len = 0;
227  StreamingBufferSegmentGetData(body->sb, &chunk->sbseg, &data, &data_len);
228 
229  // invoke Streamer
230  Streamer(cbdata, f, data, data_len, tx_id, flags);
231  //PrintRawDataFp(stdout, data, data_len);
232  chunk->logged = 1;
233  tx_logged = 1;
234  }
235 
236  next:
237  /* if we need to close we need to invoke the Streamer for sure. If we
238  * logged no chunks, we call the Streamer with NULL data so it can
239  * close up. */
240  if (tx_logged == 0 && (close||tx_done)) {
241  Streamer(cbdata, f, NULL, 0, tx_id,
243  }
244  }
245  }
246  return 0;
247 }
248 
250  uint8_t flags;
252  Flow *f;
253 };
254 
255 static int StreamLogFunc(
256  void *cb_data, const uint8_t *data, const uint32_t data_len, const uint64_t _offset)
257 {
258  struct StreamLogData *log = cb_data;
259 
260  Streamer(log->streamer_cbdata, log->f, data, data_len, 0, log->flags);
261 
262  /* hack: unset open flag after first run */
264 
265  return 0;
266 }
267 
268 static int TcpDataLogger (Flow *f, TcpSession *ssn, TcpStream *stream,
269  bool eof, uint8_t iflags, void *streamer_cbdata)
270 {
271  uint8_t flags = iflags;
272  uint64_t progress = STREAM_LOG_PROGRESS(stream);
273 
274  if (progress == 0)
276 
277  struct StreamLogData log_data = { flags, streamer_cbdata, f };
278  StreamReassembleLog(ssn, stream,
279  StreamLogFunc, &log_data,
280  progress, &progress, eof);
281 
282  if (progress > STREAM_LOG_PROGRESS(stream)) {
283  uint32_t slide = progress - STREAM_LOG_PROGRESS(stream);
284  stream->log_progress_rel += slide;
285  }
286 
287  if (eof) {
288  Streamer(streamer_cbdata, f, NULL, 0, 0, flags|OUTPUT_STREAMING_FLAG_CLOSE);
289  }
290  return 0;
291 }
292 
293 static TmEcode OutputStreamingLog(ThreadVars *tv, Packet *p, void *thread_data)
294 {
295  DEBUG_VALIDATE_BUG_ON(thread_data == NULL);
296 
297  if (list == NULL) {
298  /* No child loggers. */
299  return TM_ECODE_OK;
300  }
301 
302  OutputStreamingLoggerThreadData *op_thread_data =
303  (OutputStreamingLoggerThreadData *)thread_data;
304  OutputStreamingLogger *logger = list;
305  OutputLoggerThreadStore *store = op_thread_data->store;
306 
307  StreamerCallbackData streamer_cbdata = { logger, store, tv, p , 0};
308 
309  DEBUG_VALIDATE_BUG_ON(logger == NULL && store != NULL);
310  DEBUG_VALIDATE_BUG_ON(logger != NULL && store == NULL);
311  DEBUG_VALIDATE_BUG_ON(logger == NULL && store == NULL);
312 
313  uint8_t flags = 0;
314  Flow * const f = p->flow;
315 
316  /* no flow, no streaming */
317  if (f == NULL) {
319  }
320 
321  if (!(StreamTcpInlineMode())) {
322  if (PKT_IS_TOCLIENT(p)) {
324  } else {
326  }
327  } else {
328  if (PKT_IS_TOSERVER(p)) {
330  } else {
332  }
333  }
334 
335  if (op_thread_data->loggers & (1<<STREAMING_TCP_DATA)) {
336  TcpSession *ssn = f->protoctx;
337  if (ssn) {
338  int close = (ssn->state >= TCP_CLOSED);
339  close |= ((p->flags & PKT_PSEUDO_STREAM_END) ? 1 : 0);
340  SCLogDebug("close ? %s", close ? "yes" : "no");
341 
342  TcpStream *stream = flags & OUTPUT_STREAMING_FLAG_TOSERVER ? &ssn->client : &ssn->server;
344  TcpDataLogger(f, ssn, stream, close, flags, (void *)&streamer_cbdata);
345  }
346  }
347  if (op_thread_data->loggers & (1<<STREAMING_HTTP_BODIES)) {
348  if (f->alproto == ALPROTO_HTTP1 && f->alstate != NULL) {
349  int close = 0;
350  TcpSession *ssn = f->protoctx;
351  if (ssn) {
352  close = (ssn->state >= TCP_CLOSED);
353  close |= ((p->flags & PKT_PSEUDO_STREAM_END) ? 1 : 0);
354  }
355  SCLogDebug("close ? %s", close ? "yes" : "no");
357  HttpBodyIterator(f, close, (void *)&streamer_cbdata, flags);
358  }
359  }
360 
361  return TM_ECODE_OK;
362 }
363 
364 /** \brief thread init for the tx logger
365  * This will run the thread init functions for the individual registered
366  * loggers */
367 static TmEcode OutputStreamingLogThreadInit(ThreadVars *tv, const void *initdata, void **data) {
368  OutputStreamingLoggerThreadData *td = SCMalloc(sizeof(*td));
369  if (td == NULL)
370  return TM_ECODE_FAILED;
371  memset(td, 0x00, sizeof(*td));
372 
373  *data = (void *)td;
374 
375  SCLogDebug("OutputStreamingLogThreadInit happy (*data %p)", *data);
376 
377  OutputStreamingLogger *logger = list;
378  while (logger) {
379  if (logger->ThreadInit) {
380  void *retptr = NULL;
381  if (logger->ThreadInit(tv, (void *)logger->output_ctx, &retptr) == TM_ECODE_OK) {
382  OutputLoggerThreadStore *ts = SCMalloc(sizeof(*ts));
383 /* todo */ BUG_ON(ts == NULL);
384  memset(ts, 0x00, sizeof(*ts));
385 
386  /* store thread handle */
387  ts->thread_data = retptr;
388 
389  if (td->store == NULL) {
390  td->store = ts;
391  } else {
392  OutputLoggerThreadStore *tmp = td->store;
393  while (tmp->next != NULL)
394  tmp = tmp->next;
395  tmp->next = ts;
396  }
397 
398  SCLogInfo("%s is now set up", logger->name);
399  }
400  }
401 
402  td->loggers |= (1<<logger->type);
403 
404  logger = logger->next;
405  }
406 
407  return TM_ECODE_OK;
408 }
409 
410 static TmEcode OutputStreamingLogThreadDeinit(ThreadVars *tv, void *thread_data) {
411  OutputStreamingLoggerThreadData *op_thread_data =
412  (OutputStreamingLoggerThreadData *)thread_data;
413  OutputLoggerThreadStore *store = op_thread_data->store;
414  OutputStreamingLogger *logger = list;
415 
416  while (logger && store) {
417  if (logger->ThreadDeinit) {
418  logger->ThreadDeinit(tv, store->thread_data);
419  }
420 
421  OutputLoggerThreadStore *next_store = store->next;
422  SCFree(store);
423  logger = logger->next;
424  store = next_store;
425  }
426 
427  SCFree(op_thread_data);
428  return TM_ECODE_OK;
429 }
430 
431 static void OutputStreamingLogExitPrintStats(ThreadVars *tv, void *thread_data) {
432  OutputStreamingLoggerThreadData *op_thread_data =
433  (OutputStreamingLoggerThreadData *)thread_data;
434  OutputLoggerThreadStore *store = op_thread_data->store;
435  OutputStreamingLogger *logger = list;
436 
437  while (logger && store) {
438  if (logger->ThreadExitPrintStats) {
439  logger->ThreadExitPrintStats(tv, store->thread_data);
440  }
441 
442  logger = logger->next;
443  store = store->next;
444  }
445 }
446 
447 static uint32_t OutputStreamingLoggerGetActiveCount(void)
448 {
449  uint32_t cnt = 0;
450  for (OutputStreamingLogger *p = list; p != NULL; p = p->next) {
451  cnt++;
452  }
453  return cnt;
454 }
455 
457  OutputRegisterRootLogger(OutputStreamingLogThreadInit,
458  OutputStreamingLogThreadDeinit, OutputStreamingLogExitPrintStats,
459  OutputStreamingLog, OutputStreamingLoggerGetActiveCount);
460 }
461 
463 {
464  OutputStreamingLogger *logger = list;
465  while (logger) {
466  OutputStreamingLogger *next_logger = logger->next;
467  SCFree(logger);
468  logger = next_logger;
469  }
470  list = NULL;
471 }
PKT_IS_TOCLIENT
#define PKT_IS_TOCLIENT(p)
Definition: decode.h:252
OutputRegisterStreamingLogger
int OutputRegisterStreamingLogger(LoggerId id, const char *name, StreamingLogger LogFunc, OutputCtx *output_ctx, enum OutputStreamingType type, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Definition: output-streaming.c:64
TcpStream_
Definition: stream-tcp-private.h:106
ts
uint64_t ts
Definition: source-erf-file.c:55
OutputLoggerThreadStore_
Definition: output.h:33
OutputStreamingShutdown
void OutputStreamingShutdown(void)
Definition: output-streaming.c:462
stream-tcp-inline.h
stream-tcp.h
HtpBody_::sb
StreamingBuffer * sb
Definition: app-layer-htp.h:189
OutputStreamingLogger_::ThreadExitPrintStats
ThreadExitPrintStatsFunc ThreadExitPrintStats
Definition: output-streaming.c:59
OutputStreamingLogger_::output_ctx
OutputCtx * output_ctx
Definition: output-streaming.c:52
TcpStream_::log_progress_rel
uint32_t log_progress_rel
Definition: stream-tcp-private.h:128
SCLogDebug
#define SCLogDebug(...)
Definition: util-debug.h:296
next
struct HtpBodyChunk_ * next
Definition: app-layer-htp.h:0
Flow_::proto
uint8_t proto
Definition: flow.h:378
AppLayerParserGetStateProgress
int AppLayerParserGetStateProgress(uint8_t ipproto, AppProto alproto, void *alstate, uint8_t flags)
get the progress value for a tx/protocol
Definition: app-layer-parser.c:1125
StreamTcpInlineMode
int StreamTcpInlineMode(void)
See if stream engine is operating in inline mode.
Definition: stream-tcp.c:6576
output-streaming.h
Packet_::flags
uint32_t flags
Definition: decode.h:463
Flow_
Flow data structure.
Definition: flow.h:356
StreamerCallbackData_::logger
OutputStreamingLogger * logger
Definition: output-streaming.c:102
StreamingLogger
int(* StreamingLogger)(ThreadVars *, void *thread_data, const Flow *f, const uint8_t *data, uint32_t data_len, uint64_t tx_id, uint8_t flags)
Definition: output-streaming.h:42
StreamerCallbackData
struct StreamerCallbackData_ StreamerCallbackData
LoggerId
LoggerId
Definition: suricata-common.h:449
StreamerCallbackData_::store
OutputLoggerThreadStore * store
Definition: output-streaming.c:103
AppLayerParserGetStateProgressCompletionStatus
int AppLayerParserGetStateProgressCompletionStatus(AppProto alproto, uint8_t direction)
Definition: app-layer-parser.c:1153
OutputLoggerThreadStore_::next
struct OutputLoggerThreadStore_ * next
Definition: output.h:35
HtpBody_::last
HtpBodyChunk * last
Definition: app-layer-htp.h:187
HtpTxUserData_::request_body
HtpBody request_body
Definition: app-layer-htp.h:223
StreamLogData::streamer_cbdata
void * streamer_cbdata
Definition: output-streaming.c:251
stream-tcp-reassemble.h
TcpStreamCnf_::streaming_log_api
bool streaming_log_api
Definition: stream-tcp.h:66
stream_config
TcpStreamCnf stream_config
Definition: stream-tcp.c:115
TM_ECODE_FAILED
@ TM_ECODE_FAILED
Definition: tm-threads-common.h:85
Flow_::protoctx
void * protoctx
Definition: flow.h:454
OUTPUT_STREAMING_FLAG_TRANSACTION
#define OUTPUT_STREAMING_FLAG_TRANSACTION
Definition: output-streaming.h:34
HtpBody_::first
HtpBodyChunk * first
Definition: app-layer-htp.h:186
HtpState_
Definition: app-layer-htp.h:245
OutputStreamingLoggerThreadData_
Definition: output-streaming.c:42
OutputStreamingLogger_::ThreadInit
ThreadInitFunc ThreadInit
Definition: output-streaming.c:57
OutputStreamingLogger_::type
enum OutputStreamingType type
Definition: output-streaming.c:56
TM_ECODE_OK
@ TM_ECODE_OK
Definition: tm-threads-common.h:84
STREAM_LOG_PROGRESS
#define STREAM_LOG_PROGRESS(stream)
Definition: stream-tcp-private.h:146
OutputCtx_
Definition: tm-modules.h:78
OutputLoggerThreadStore_::thread_data
void * thread_data
Definition: output.h:34
app-layer-htp.h
OutputStreamingLogger_::name
const char * name
Definition: output-streaming.c:54
type
uint8_t type
Definition: decode-icmpv4.h:0
OutputStreamingLoggerRegister
void OutputStreamingLoggerRegister(void)
Definition: output-streaming.c:456
StreamerCallbackData_::tv
ThreadVars * tv
Definition: output-streaming.c:104
PKT_IS_TOSERVER
#define PKT_IS_TOSERVER(p)
Definition: decode.h:251
PKT_PSEUDO_STREAM_END
#define PKT_PSEUDO_STREAM_END
Definition: decode.h:1004
OutputStreamingLogger_::LogFunc
StreamingLogger LogFunc
Definition: output-streaming.c:51
StreamerCallbackData_
Definition: output-streaming.c:101
StreamReassembleLog
int StreamReassembleLog(TcpSession *ssn, TcpStream *stream, StreamReassembleRawFunc Callback, void *cb_data, uint64_t progress_in, uint64_t *progress_out, bool eof)
Definition: stream-tcp-reassemble.c:1894
util-print.h
ThreadVars_
Per thread variable structure.
Definition: threadvars.h:57
HtpState_::conn
htp_conn_t * conn
Definition: app-layer-htp.h:249
OutputStreamingLogger_::logger_id
LoggerId logger_id
Definition: output-streaming.c:55
ThreadInitFunc
TmEcode(* ThreadInitFunc)(ThreadVars *, const void *, void **)
Definition: tm-modules.h:39
TcpSession_::state
uint8_t state
Definition: stream-tcp-private.h:274
app-layer-parser.h
BUG_ON
#define BUG_ON(x)
Definition: suricata-common.h:289
util-profiling.h
Packet_
Definition: decode.h:428
conf.h
TmEcode
TmEcode
Definition: tm-threads-common.h:83
StreamerCallbackData_::type
enum OutputStreamingType type
Definition: output-streaming.c:106
OutputStreamingLogger
struct OutputStreamingLogger_ OutputStreamingLogger
HtpTxUserData_::response_body
HtpBody response_body
Definition: app-layer-htp.h:224
SCLogInfo
#define SCLogInfo(...)
Macro used to log INFORMATIONAL messages.
Definition: util-debug.h:215
HtpBodyChunk_::logged
int logged
Definition: app-layer-htp.h:179
AppLayerParserGetTx
void * AppLayerParserGetTx(uint8_t ipproto, AppProto alproto, void *alstate, uint64_t tx_id)
Definition: app-layer-parser.c:1146
OutputStreamingLogger_::ThreadDeinit
ThreadDeinitFunc ThreadDeinit
Definition: output-streaming.c:58
OutputStreamingLoggerThreadData
struct OutputStreamingLoggerThreadData_ OutputStreamingLoggerThreadData
TCP_CLOSED
@ TCP_CLOSED
Definition: stream-tcp-private.h:161
PACKET_PROFILING_LOGGER_END
#define PACKET_PROFILING_LOGGER_END(p, id)
Definition: util-profiling.h:261
Packet_::flow
struct Flow_ * flow
Definition: decode.h:465
StreamLogData::f
Flow * f
Definition: output-streaming.c:252
HtpBody_
Definition: app-layer-htp.h:185
flags
uint8_t flags
Definition: decode-gre.h:0
suricata-common.h
OUTPUT_STREAMING_FLAG_OPEN
#define OUTPUT_STREAMING_FLAG_OPEN
Definition: output-streaming.h:30
STREAMING_HTTP_BODIES
@ STREAMING_HTTP_BODIES
Definition: output-streaming.h:38
HtpBodyChunk_
Definition: app-layer-htp.h:177
ALPROTO_HTTP1
@ ALPROTO_HTTP1
Definition: app-layer-protos.h:30
OutputStreamingLogger_::next
struct OutputStreamingLogger_ * next
Definition: output-streaming.c:53
ThreadExitPrintStatsFunc
void(* ThreadExitPrintStatsFunc)(ThreadVars *, void *)
Definition: tm-modules.h:41
TcpSession_::client
TcpStream client
Definition: stream-tcp-private.h:285
HtpTxUserData_
Definition: app-layer-htp.h:208
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:32
util-validate.h
SCMalloc
#define SCMalloc(sz)
Definition: util-mem.h:47
Packet_::next
struct Packet_ * next
Definition: decode.h:603
TcpSession_::server
TcpStream server
Definition: stream-tcp-private.h:284
HtpBodyChunk_::next
struct HtpBodyChunk_ * next
Definition: app-layer-htp.h:178
OutputStreamingType
OutputStreamingType
Definition: output-streaming.h:36
OUTPUT_STREAMING_FLAG_TOSERVER
#define OUTPUT_STREAMING_FLAG_TOSERVER
Definition: output-streaming.h:32
SCFree
#define SCFree(p)
Definition: util-mem.h:61
OutputStreamingLoggerThreadData_::store
OutputLoggerThreadStore * store
Definition: output-streaming.c:43
Flow_::alstate
void * alstate
Definition: flow.h:489
OutputStreamingLogger_
Definition: output-streaming.c:50
StreamLogData::flags
uint8_t flags
Definition: output-streaming.c:250
StreamLogData
Definition: output-streaming.c:249
StreamerCallbackData_::p
Packet * p
Definition: output-streaming.c:105
PACKET_PROFILING_LOGGER_START
#define PACKET_PROFILING_LOGGER_START(p, id)
Definition: util-profiling.h:254
OutputRegisterRootLogger
void OutputRegisterRootLogger(ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats, OutputLogFunc LogFunc, OutputGetActiveCountFunc ActiveCntFunc)
Definition: output.c:963
OUTPUT_STREAMING_FLAG_CLOSE
#define OUTPUT_STREAMING_FLAG_CLOSE
Definition: output-streaming.h:31
OUTPUT_STREAMING_FLAG_TOCLIENT
#define OUTPUT_STREAMING_FLAG_TOCLIENT
Definition: output-streaming.h:33
OutputStreamingLoggerThreadData_::loggers
uint32_t loggers
Definition: output-streaming.c:44
STREAMING_TCP_DATA
@ STREAMING_TCP_DATA
Definition: output-streaming.h:37
FlowGetDisruptionFlags
uint8_t FlowGetDisruptionFlags(const Flow *f, uint8_t flags)
get 'disruption' flags: GAP/DEPTH/PASS
Definition: flow.c:1160
TcpSession_
Definition: stream-tcp-private.h:272
StreamingBufferSegmentGetData
void StreamingBufferSegmentGetData(const StreamingBuffer *sb, const StreamingBufferSegment *seg, const uint8_t **data, uint32_t *data_len)
Definition: util-streaming-buffer.c:810
Flow_::alproto
AppProto alproto
application level protocol
Definition: flow.h:463
SCReturnInt
#define SCReturnInt(x)
Definition: util-debug.h:302
AppLayerParserGetTxCnt
uint64_t AppLayerParserGetTxCnt(const Flow *f, void *alstate)
Definition: app-layer-parser.c:1139
HtpBodyChunk_::sbseg
StreamingBufferSegment sbseg
Definition: app-layer-htp.h:180
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