* log module (e.g. http.log) with different output ctx'. */
typedef struct OutputFlowLogger_ {
FlowLogger LogFunc;
- OutputCtx *output_ctx;
+
+ /** Data that will be passed to the ThreadInit callback. */
+ void *initdata;
+
struct OutputFlowLogger_ *next;
/** A name for this logger, used for debugging only. */
*
* \retval 0 on success, -1 on failure.
*/
-int OutputRegisterFlowLogger(const char *name, FlowLogger LogFunc,
- OutputCtx *output_ctx, ThreadInitFunc ThreadInit,
- ThreadDeinitFunc ThreadDeinit,
- ThreadExitPrintStatsFunc ThreadExitPrintStats)
+int OutputRegisterFlowLogger(const char *name, FlowLogger LogFunc, void *initdata,
+ ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
+ ThreadExitPrintStatsFunc ThreadExitPrintStats)
{
OutputFlowLogger *op = SCCalloc(1, sizeof(*op));
if (op == NULL)
return -1;
op->LogFunc = LogFunc;
- op->output_ctx = output_ctx;
+ op->initdata = initdata;
op->name = name;
op->ThreadInit = ThreadInit;
op->ThreadDeinit = ThreadDeinit;
while (logger) {
if (logger->ThreadInit) {
void *retptr = NULL;
- if (logger->ThreadInit(tv, (void *)logger->output_ctx, &retptr) == TM_ECODE_OK) {
+ if (logger->ThreadInit(tv, (void *)logger->initdata, &retptr) == TM_ECODE_OK) {
OutputLoggerThreadStore *ts = SCCalloc(1, sizeof(*ts));
/* todo */ BUG_ON(ts == NULL);
/** flow logger function pointer type */
typedef int (*FlowLogger)(ThreadVars *, void *thread_data, Flow *f);
-int OutputRegisterFlowLogger(const char *name, FlowLogger LogFunc,
- OutputCtx *, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
- ThreadExitPrintStatsFunc ThreadExitPrintStats);
+int OutputRegisterFlowLogger(const char *name, FlowLogger LogFunc, void *initdata,
+ ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
+ ThreadExitPrintStatsFunc ThreadExitPrintStats);
void OutputFlowShutdown(void);