Go to the documentation of this file.
74 memset(op, 0x00,
sizeof(*op));
98 SCLogDebug(
"OutputRegisterStreamingLogger happy");
110 static int Streamer(
void *cbdata,
Flow *f,
const uint8_t *data, uint32_t data_len, uint64_t tx_id, uint8_t
flags)
118 Packet *p = streamer_cbdata->
p;
123 while (logger && store) {
126 if (logger->
type == streamer_cbdata->
type) {
133 logger = logger->
next;
152 static int HttpBodyIterator(
Flow *f,
int close,
void *cbdata, uint8_t iflags)
154 SCLogDebug(
"called with %p, %d, %p, %02x", f, close, cbdata, iflags);
157 if (s == NULL || s->
conn == NULL) {
161 const int tx_progress_done_value_ts =
163 const int tx_progress_done_value_tc =
168 for (tx_id = 0; tx_id < total_txs; tx_id++) {
178 if (tx_progress_ts >= tx_progress_done_value_ts) {
181 if (tx_progress_tc >= tx_progress_done_value_tc) {
200 if (body->
first == NULL) {
211 for ( ; chunk != NULL; chunk = chunk->
next) {
218 if (chunk->
sbseg.stream_offset == 0)
222 if ((tx_done || close) && chunk->
next == NULL) {
226 const uint8_t *data = NULL;
227 uint32_t data_len = 0;
231 Streamer(cbdata, f, data, data_len, tx_id,
flags);
241 if (tx_logged == 0 && (close||tx_done)) {
242 Streamer(cbdata, f, NULL, 0, tx_id,
256 static int StreamLogFunc(
257 void *cb_data,
const uint8_t *data,
const uint32_t data_len,
const uint64_t _offset)
272 uint8_t
flags = iflags;
280 StreamLogFunc, &log_data,
281 progress, &progress, eof);
341 SCLogDebug(
"close ? %s", close ?
"yes" :
"no");
356 SCLogDebug(
"close ? %s", close ?
"yes" :
"no");
368 static TmEcode OutputStreamingLogThreadInit(
ThreadVars *
tv,
const void *initdata,
void **data) {
372 memset(td, 0x00,
sizeof(*td));
376 SCLogDebug(
"OutputStreamingLogThreadInit happy (*data %p)", *data);
385 memset(
ts, 0x00,
sizeof(*
ts));
388 ts->thread_data = retptr;
390 if (td->
store == NULL) {
394 while (tmp->
next != NULL)
405 logger = logger->
next;
417 while (logger && store) {
424 logger = logger->
next;
432 static void OutputStreamingLogExitPrintStats(
ThreadVars *
tv,
void *thread_data) {
438 while (logger && store) {
443 logger = logger->
next;
448 static uint32_t OutputStreamingLoggerGetActiveCount(
void)
459 OutputStreamingLogThreadDeinit, OutputStreamingLogExitPrintStats,
460 OutputStreamingLog, OutputStreamingLoggerGetActiveCount);
469 logger = next_logger;
#define PKT_IS_TOCLIENT(p)
int OutputRegisterStreamingLogger(LoggerId id, const char *name, StreamingLogger LogFunc, OutputCtx *output_ctx, enum OutputStreamingType type, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
void OutputStreamingShutdown(void)
struct OutputLoggerThreadStore_ * next
ThreadExitPrintStatsFunc ThreadExitPrintStats
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 StreamTcpInlineMode(void)
See if stream engine is operating in inline mode.
OutputStreamingLogger * logger
int(* StreamingLogger)(ThreadVars *, void *thread_data, const Flow *f, const uint8_t *data, uint32_t data_len, uint64_t tx_id, uint8_t flags)
struct StreamerCallbackData_ StreamerCallbackData
OutputLoggerThreadStore * store
int AppLayerParserGetStateProgressCompletionStatus(AppProto alproto, uint8_t direction)
TcpStreamCnf stream_config
#define OUTPUT_STREAMING_FLAG_TRANSACTION
ThreadInitFunc ThreadInit
enum OutputStreamingType type
#define STREAM_LOG_PROGRESS(stream)
void OutputStreamingLoggerRegister(void)
#define PKT_IS_TOSERVER(p)
#define PKT_PSEUDO_STREAM_END
int StreamReassembleLog(TcpSession *ssn, TcpStream *stream, StreamReassembleRawFunc Callback, void *cb_data, uint64_t progress_in, uint64_t *progress_out, bool eof)
Per thread variable structure.
TmEcode(* ThreadInitFunc)(ThreadVars *, const void *, void **)
enum OutputStreamingType type
struct OutputStreamingLogger_ OutputStreamingLogger
#define SCLogInfo(...)
Macro used to log INFORMATIONAL messages.
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
void(* ThreadExitPrintStatsFunc)(ThreadVars *, void *)
struct HtpBodyChunk_ * next
#define OUTPUT_STREAMING_FLAG_TOSERVER
OutputLoggerThreadStore * store
#define PACKET_PROFILING_LOGGER_START(p, id)
void OutputRegisterRootLogger(ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats, OutputLogFunc LogFunc, OutputGetActiveCountFunc ActiveCntFunc)
#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
uint64_t AppLayerParserGetTxCnt(const Flow *f, void *alstate)
StreamingBufferSegment sbseg
#define DEBUG_VALIDATE_BUG_ON(exp)
TmEcode(* ThreadDeinitFunc)(ThreadVars *, void *)