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