From: Jason Ish Date: Mon, 26 Aug 2024 21:48:32 +0000 (-0600) Subject: output-flow: remove ThreadExitPrintStats callback X-Git-Tag: suricata-8.0.0-beta1~928 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d16ce2af4ad115ed2077cdfc4122bae4a17c6af;p=thirdparty%2Fsuricata.git output-flow: remove ThreadExitPrintStats callback The callback, ThreadExitPrintStats is not used in the flow loggers. Ticket: #7227 --- diff --git a/src/output-flow.c b/src/output-flow.c index 5d7a08c883..ae309777ab 100644 --- a/src/output-flow.c +++ b/src/output-flow.c @@ -51,7 +51,6 @@ typedef struct OutputFlowLogger_ { TmEcode (*ThreadInit)(ThreadVars *, const void *, void **); TmEcode (*ThreadDeinit)(ThreadVars *, void *); - void (*ThreadExitPrintStats)(ThreadVars *, void *); } OutputFlowLogger; static OutputFlowLogger *list = NULL; @@ -65,8 +64,7 @@ static OutputFlowLogger *list = NULL; * \retval 0 on success, -1 on failure. */ int OutputRegisterFlowLogger(const char *name, FlowLogger LogFunc, void *initdata, - ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, - ThreadExitPrintStatsFunc ThreadExitPrintStats) + ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit) { OutputFlowLogger *op = SCCalloc(1, sizeof(*op)); if (op == NULL) @@ -77,7 +75,6 @@ int OutputRegisterFlowLogger(const char *name, FlowLogger LogFunc, void *initdat op->name = name; op->ThreadInit = ThreadInit; op->ThreadDeinit = ThreadDeinit; - op->ThreadExitPrintStats = ThreadExitPrintStats; if (list == NULL) list = op; diff --git a/src/output-flow.h b/src/output-flow.h index c3dd3335cb..fc6ba5b39e 100644 --- a/src/output-flow.h +++ b/src/output-flow.h @@ -32,8 +32,7 @@ typedef int (*FlowLogger)(ThreadVars *, void *thread_data, Flow *f); int OutputRegisterFlowLogger(const char *name, FlowLogger LogFunc, void *initdata, - ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, - ThreadExitPrintStatsFunc ThreadExitPrintStats); + ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit); void OutputFlowShutdown(void); diff --git a/src/output-json-flow.c b/src/output-json-flow.c index 487185f2ed..e1d500067b 100644 --- a/src/output-json-flow.c +++ b/src/output-json-flow.c @@ -349,5 +349,5 @@ void JsonFlowLogRegister (void) { /* register as child of eve-log */ OutputRegisterFlowSubModule(LOGGER_JSON_FLOW, "eve-log", "JsonFlowLog", "eve-log.flow", - OutputJsonLogInitSub, JsonFlowLogger, JsonLogThreadInit, JsonLogThreadDeinit, NULL); + OutputJsonLogInitSub, JsonFlowLogger, JsonLogThreadInit, JsonLogThreadDeinit); } diff --git a/src/output-json-netflow.c b/src/output-json-netflow.c index 98873e5f06..ef0937b854 100644 --- a/src/output-json-netflow.c +++ b/src/output-json-netflow.c @@ -296,5 +296,5 @@ void JsonNetFlowLogRegister(void) { /* register as child of eve-log */ OutputRegisterFlowSubModule(LOGGER_JSON_NETFLOW, "eve-log", "JsonNetFlowLog", "eve-log.netflow", - OutputJsonLogInitSub, JsonNetFlowLogger, JsonLogThreadInit, JsonLogThreadDeinit, NULL); + OutputJsonLogInitSub, JsonNetFlowLogger, JsonLogThreadInit, JsonLogThreadDeinit); } diff --git a/src/output.c b/src/output.c index b18832afa5..a6ca3e1ae0 100644 --- a/src/output.c +++ b/src/output.c @@ -500,11 +500,9 @@ error: * * \retval Returns 0 on success, -1 on failure. */ -void OutputRegisterFlowSubModule(LoggerId id, const char *parent_name, - const char *name, const char *conf_name, OutputInitSubFunc InitFunc, - FlowLogger FlowLogFunc, ThreadInitFunc ThreadInit, - ThreadDeinitFunc ThreadDeinit, - ThreadExitPrintStatsFunc ThreadExitPrintStats) +void OutputRegisterFlowSubModule(LoggerId id, const char *parent_name, const char *name, + const char *conf_name, OutputInitSubFunc InitFunc, FlowLogger FlowLogFunc, + ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit) { if (unlikely(FlowLogFunc == NULL)) { goto error; @@ -523,7 +521,6 @@ void OutputRegisterFlowSubModule(LoggerId id, const char *parent_name, module->FlowLogFunc = FlowLogFunc; module->ThreadInit = ThreadInit; module->ThreadDeinit = ThreadDeinit; - module->ThreadExitPrintStats = ThreadExitPrintStats; TAILQ_INSERT_TAIL(&output_modules, module, entries); SCLogDebug("Flow logger \"%s\" registered.", name); diff --git a/src/output.h b/src/output.h index 074d20bf5b..bedb34b031 100644 --- a/src/output.h +++ b/src/output.h @@ -142,11 +142,9 @@ void OutputRegisterFiledataModule(LoggerId id, const char *name, const char *con OutputInitFunc InitFunc, FiledataLogger FiledataLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats); -void OutputRegisterFlowSubModule(LoggerId id, const char *parent_name, - const char *name, const char *conf_name, OutputInitSubFunc InitFunc, - FlowLogger FlowLogFunc, ThreadInitFunc ThreadInit, - ThreadDeinitFunc ThreadDeinit, - ThreadExitPrintStatsFunc ThreadExitPrintStats); +void OutputRegisterFlowSubModule(LoggerId id, const char *parent_name, const char *name, + const char *conf_name, OutputInitSubFunc InitFunc, FlowLogger FlowLogFunc, + ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit); void OutputRegisterStreamingModule(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, StreamingLogger StreamingLogFunc, diff --git a/src/runmodes.c b/src/runmodes.c index 0fc8285eb4..c702184e59 100644 --- a/src/runmodes.c +++ b/src/runmodes.c @@ -600,9 +600,8 @@ static void SetupOutput( { /* flow logger doesn't run in the packet path */ if (module->FlowLogFunc) { - OutputRegisterFlowLogger(module->name, module->FlowLogFunc, - output_ctx, module->ThreadInit, module->ThreadDeinit, - module->ThreadExitPrintStats); + OutputRegisterFlowLogger(module->name, module->FlowLogFunc, output_ctx, module->ThreadInit, + module->ThreadDeinit); return; } /* stats logger doesn't run in the packet path */