|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
/* Copyright (C) 2007-2022 Open Information Security Foundation
|
|
|
|
|
/* Copyright (C) 2007-2024 Open Information Security Foundation
|
|
|
|
|
*
|
|
|
|
|
* You can copy, redistribute or modify this Program under the terms of
|
|
|
|
|
* the GNU General Public License version 2 as published by the Free
|
|
|
|
@ -32,22 +32,41 @@
|
|
|
|
|
#define OUTPUT_STREAMING_FLAG_TOCLIENT 0x08
|
|
|
|
|
#define OUTPUT_STREAMING_FLAG_TRANSACTION 0x10
|
|
|
|
|
|
|
|
|
|
enum OutputStreamingType {
|
|
|
|
|
enum SCOutputStreamingType {
|
|
|
|
|
STREAMING_TCP_DATA,
|
|
|
|
|
STREAMING_HTTP_BODIES,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** streaming logger function pointer type */
|
|
|
|
|
typedef int (*StreamingLogger)(ThreadVars *, void *thread_data,
|
|
|
|
|
const Flow *f, const uint8_t *data, uint32_t data_len,
|
|
|
|
|
uint64_t tx_id, uint8_t flags);
|
|
|
|
|
typedef int (*SCStreamingLogger)(ThreadVars *, void *thread_data, const Flow *f,
|
|
|
|
|
const uint8_t *data, uint32_t data_len, uint64_t tx_id, uint8_t flags);
|
|
|
|
|
|
|
|
|
|
int OutputRegisterStreamingLogger(LoggerId id, const char *name, StreamingLogger LogFunc,
|
|
|
|
|
void *initdata, enum OutputStreamingType, ThreadInitFunc ThreadInit,
|
|
|
|
|
/** \brief Register a streaming logger.
|
|
|
|
|
*
|
|
|
|
|
* \param logger_id An ID to uniquely identify this logger.
|
|
|
|
|
*
|
|
|
|
|
* \param name An informational name for this logger.
|
|
|
|
|
*
|
|
|
|
|
* \param LogFunc Pointer to logging function.
|
|
|
|
|
*
|
|
|
|
|
* \param initdata Initialization data that will be passed the
|
|
|
|
|
* ThreadInit.
|
|
|
|
|
*
|
|
|
|
|
* \param stream_type Type of stream to log, see
|
|
|
|
|
* SCOutputStreamingType.
|
|
|
|
|
*
|
|
|
|
|
* \param ThreadInit Pointer to thread initialization function.
|
|
|
|
|
*
|
|
|
|
|
* \param ThreadDeinit Pointer to thread de-initialization function.
|
|
|
|
|
*/
|
|
|
|
|
int SCOutputRegisterStreamingLogger(LoggerId logger_id, const char *name, SCStreamingLogger LogFunc,
|
|
|
|
|
void *initdata, enum SCOutputStreamingType stream_type, ThreadInitFunc ThreadInit,
|
|
|
|
|
ThreadDeinitFunc ThreadDeinit);
|
|
|
|
|
|
|
|
|
|
/** Internal function: private API. */
|
|
|
|
|
void OutputStreamingLoggerRegister (void);
|
|
|
|
|
|
|
|
|
|
/** Internal function: private API. */
|
|
|
|
|
void OutputStreamingShutdown(void);
|
|
|
|
|
|
|
|
|
|
#endif /* SURICATA_OUTPUT_STREAMING_H */
|
|
|
|
|