Go to the documentation of this file.
92 SCLogDebug(
"OutputRegisterStreamingLogger happy");
104 static int Streamer(
void *cbdata,
Flow *f,
const uint8_t *data, uint32_t data_len, uint64_t tx_id, uint8_t
flags)
112 Packet *p = streamer_cbdata->
p;
117 while (logger && store) {
120 if (logger->
type == streamer_cbdata->
type) {
127 logger = logger->
next;
146 static int HttpBodyIterator(
Flow *f,
int close,
void *cbdata, uint8_t iflags)
148 SCLogDebug(
"called with %p, %d, %p, %02x", f, close, cbdata, iflags);
151 if (s == NULL || s->
conn == NULL) {
155 const int tx_progress_done_value_ts =
157 const int tx_progress_done_value_tc =
162 for (tx_id = 0; tx_id < total_txs; tx_id++) {
172 if (tx_progress_ts >= tx_progress_done_value_ts) {
175 if (tx_progress_tc >= tx_progress_done_value_tc) {
194 if (body->
first == NULL) {
205 for ( ; chunk != NULL; chunk = chunk->
next) {
212 if (chunk->
sbseg.stream_offset == 0)
216 if ((tx_done || close) && chunk->
next == NULL) {
220 const uint8_t *data = NULL;
221 uint32_t data_len = 0;
225 Streamer(cbdata, f, data, data_len, tx_id,
flags);
235 if (tx_logged == 0 && (close||tx_done)) {
236 Streamer(cbdata, f, NULL, 0, tx_id,
250 static int StreamLogFunc(
251 void *cb_data,
const uint8_t *data,
const uint32_t data_len,
const uint64_t _offset)
266 uint8_t
flags = iflags;
274 StreamLogFunc, &log_data,
275 progress, &progress, eof);
336 SCLogDebug(
"close ? %s", close ?
"yes" :
"no");
351 SCLogDebug(
"close ? %s", close ?
"yes" :
"no");
363 static TmEcode OutputStreamingLogThreadInit(
ThreadVars *
tv,
const void *initdata,
void **data) {
370 SCLogDebug(
"OutputStreamingLogThreadInit happy (*data %p)", *data);
381 ts->thread_data = retptr;
383 if (td->
store == NULL) {
387 while (tmp->
next != NULL)
398 logger = logger->
next;
410 while (logger && store) {
417 logger = logger->
next;
425 static uint32_t OutputStreamingLoggerGetActiveCount(
void)
436 OutputStreamingLog, OutputStreamingLoggerGetActiveCount);
445 logger = next_logger;
#define PKT_IS_TOCLIENT(p)
void OutputStreamingShutdown(void)
enum SCOutputStreamingType type
bool StreamTcpInlineMode(void)
See if stream engine is operating in inline mode.
void OutputRegisterRootLogger(ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, OutputLogFunc LogFunc, OutputGetActiveCountFunc ActiveCntFunc)
uint32_t log_progress_rel
struct HtpBodyChunk_ * next
int AppLayerParserGetStateProgress(uint8_t ipproto, AppProto alproto, void *alstate, uint8_t flags)
get the progress value for a tx/protocol
int SCOutputRegisterStreamingLogger(LoggerId id, const char *name, SCStreamingLogger LogFunc, void *initdata, enum SCOutputStreamingType type, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a streaming logger.
OutputStreamingLogger * logger
struct StreamerCallbackData_ StreamerCallbackData
OutputLoggerThreadStore * store
int AppLayerParserGetStateProgressCompletionStatus(AppProto alproto, uint8_t direction)
struct OutputLoggerThreadStore_ * next
TcpStreamCnf stream_config
#define OUTPUT_STREAMING_FLAG_TRANSACTION
ThreadInitFunc ThreadInit
#define STREAM_LOG_PROGRESS(stream)
void OutputStreamingLoggerRegister(void)
#define PKT_IS_TOSERVER(p)
enum SCOutputStreamingType type
#define PKT_PSEUDO_STREAM_END
Per thread variable structure.
TmEcode(* ThreadInitFunc)(ThreadVars *, const void *, void **)
SCStreamingLogger LogFunc
struct OutputStreamingLogger_ OutputStreamingLogger
void * AppLayerParserGetTx(uint8_t ipproto, AppProto alproto, void *alstate, uint64_t tx_id)
ThreadDeinitFunc ThreadDeinit
struct OutputStreamingLoggerThreadData_ OutputStreamingLoggerThreadData
#define PACKET_PROFILING_LOGGER_END(p, id)
#define OUTPUT_STREAMING_FLAG_OPEN
struct OutputStreamingLogger_ * next
struct HtpBodyChunk_ * next
#define OUTPUT_STREAMING_FLAG_TOSERVER
OutputLoggerThreadStore * store
#define PACKET_PROFILING_LOGGER_START(p, id)
#define OUTPUT_STREAMING_FLAG_CLOSE
#define OUTPUT_STREAMING_FLAG_TOCLIENT
uint8_t FlowGetDisruptionFlags(const Flow *f, uint8_t flags)
get 'disruption' flags: GAP/DEPTH/PASS
void StreamingBufferSegmentGetData(const StreamingBuffer *sb, const StreamingBufferSegment *seg, const uint8_t **data, uint32_t *data_len)
AppProto alproto
application level protocol
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)
uint64_t AppLayerParserGetTxCnt(const Flow *f, void *alstate)
StreamingBufferSegment sbseg
#define DEBUG_VALIDATE_BUG_ON(exp)
int(* SCStreamingLogger)(ThreadVars *, void *thread_data, const Flow *f, const uint8_t *data, uint32_t data_len, uint64_t tx_id, uint8_t flags)
TmEcode(* ThreadDeinitFunc)(ThreadVars *, void *)