]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output-tx: remove ThreadExitPrintStats callback
authorJason Ish <jason.ish@oisf.net>
Thu, 29 Aug 2024 20:49:53 +0000 (14:49 -0600)
committerVictor Julien <victor@inliniac.net>
Sat, 31 Aug 2024 08:53:59 +0000 (10:53 +0200)
After removing the exit stats function from log-tlslog, this callback
is no longer used.

Ticket: #7227

21 files changed:
src/log-httplog.c
src/log-tlslog.c
src/log-tlsstore.c
src/output-json-anomaly.c
src/output-json-dcerpc.c
src/output-json-dhcp.c
src/output-json-dnp3.c
src/output-json-dns.c
src/output-json-http.c
src/output-json-ike.c
src/output-json-mqtt.c
src/output-json-nfs.c
src/output-json-pgsql.c
src/output-json-smb.c
src/output-json-smtp.c
src/output-json-tls.c
src/output-tx.c
src/output-tx.h
src/output.c
src/output.h
src/runmodes.c

index 87848100724af20ae3e6c167397dd26116ed1bd9..ae9e7df54a938ed3afc888d576189b5b219916a8 100644 (file)
@@ -65,7 +65,7 @@ int LogHttpLogger(ThreadVars *tv, void *thread_data, const Packet *, Flow *f, vo
 void LogHttpLogRegister (void)
 {
     OutputRegisterTxModule(LOGGER_HTTP, MODULE_NAME, "http-log", LogHttpLogInitCtx, ALPROTO_HTTP1,
-            LogHttpLogger, LogHttpLogThreadInit, LogHttpLogThreadDeinit, NULL);
+            LogHttpLogger, LogHttpLogThreadInit, LogHttpLogThreadDeinit);
 }
 
 #define LOG_HTTP_CF_REQUEST_HOST 'h'
index b442932bc471d24268ad5fe78994a538be20f5ea..8d88047e993166dc17a90e1abb6b850a161fa550 100644 (file)
@@ -501,5 +501,5 @@ void LogTlsLogRegister(void)
 {
     OutputRegisterTxModuleWithProgress(LOGGER_TLS, MODULE_NAME, "tls-log", LogTlsLogInitCtx,
             ALPROTO_TLS, LogTlsLogger, TLS_HANDSHAKE_DONE, TLS_HANDSHAKE_DONE, LogTlsLogThreadInit,
-            LogTlsLogThreadDeinit, NULL);
+            LogTlsLogThreadDeinit);
 }
index 4e7ed98b772403f2f336f6b1d2cbcb06c7e85236..ad94fb3d19a0273820133499fbb30cfe56a37de3 100644 (file)
@@ -437,11 +437,11 @@ void LogTlsStoreRegister (void)
 {
     OutputRegisterTxModuleWithCondition(LOGGER_TLS_STORE, MODULE_NAME, "tls-store",
             LogTlsStoreLogInitCtx, ALPROTO_TLS, LogTlsStoreLogger, LogTlsStoreCondition,
-            LogTlsStoreLogThreadInit, LogTlsStoreLogThreadDeinit, NULL);
+            LogTlsStoreLogThreadInit, LogTlsStoreLogThreadDeinit);
 
     OutputRegisterTxModuleWithCondition(LOGGER_TLS_STORE_CLIENT, MODULE_NAME, "tls-store",
             LogTlsStoreLogInitCtx, ALPROTO_TLS, LogTlsStoreLoggerClient, LogTlsStoreConditionClient,
-            LogTlsStoreLogThreadInit, LogTlsStoreLogThreadDeinit, NULL);
+            LogTlsStoreLogThreadInit, LogTlsStoreLogThreadDeinit);
 
     SC_ATOMIC_INIT(cert_id);
     SC_ATOMIC_SET(cert_id, 1);
index 1680530280c6d1585c99da602b39ff15fba1d4fb..241cb974a7588b63620013f73f388b5d233ee9d9 100644 (file)
@@ -454,8 +454,7 @@ void JsonAnomalyLogRegister (void)
             JsonAnomalyLogInitCtxSub, JsonAnomalyLogger, JsonAnomalyLogCondition,
             JsonAnomalyLogThreadInit, JsonAnomalyLogThreadDeinit);
 
-    OutputRegisterTxSubModule(LOGGER_JSON_ANOMALY, "eve-log", MODULE_NAME,
-        "eve-log.anomaly", JsonAnomalyLogInitCtxHelper, ALPROTO_UNKNOWN,
-        JsonAnomalyTxLogger, JsonAnomalyLogThreadInit,
-        JsonAnomalyLogThreadDeinit, NULL);
+    OutputRegisterTxSubModule(LOGGER_JSON_ANOMALY, "eve-log", MODULE_NAME, "eve-log.anomaly",
+            JsonAnomalyLogInitCtxHelper, ALPROTO_UNKNOWN, JsonAnomalyTxLogger,
+            JsonAnomalyLogThreadInit, JsonAnomalyLogThreadDeinit);
 }
index 6ec19a0b849c8d993d17711d9ed570220bb3ebfc..17e0199ed727b421cc7f70f764b863105657f926 100644 (file)
@@ -69,7 +69,7 @@ void JsonDCERPCLogRegister(void)
     /* Register as an eve sub-module. */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonDCERPCLog", "eve-log.dcerpc",
             DCERPCLogInitSub, ALPROTO_DCERPC, JsonDCERPCLogger, JsonLogThreadInit,
-            JsonLogThreadDeinit, NULL);
+            JsonLogThreadDeinit);
 
     SCLogDebug("DCERPC JSON logger registered.");
 }
index d6a2111291aaa3d30a9368244757f90e64b6f898..9c7d9dff9230cba9046c77dcc7b7bd13f6ec9a5d 100644 (file)
@@ -148,5 +148,5 @@ void JsonDHCPLogRegister(void)
     /* Register as an eve sub-module. */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonDHCPLog", "eve-log.dhcp",
             OutputDHCPLogInitSub, ALPROTO_DHCP, JsonDHCPLogger, JsonDHCPLogThreadInit,
-            JsonDHCPLogThreadDeinit, NULL);
+            JsonDHCPLogThreadDeinit);
 }
index 7bf4ecc8602ee50ae17e3fc40dd525ae9f48f0ba..53cecd78a1aabfe8832e1a573e5dc74aa61b9976 100644 (file)
@@ -365,5 +365,5 @@ void JsonDNP3LogRegister(void)
 {
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonDNP3Log", "eve-log.dnp3",
             OutputDNP3LogInitSub, ALPROTO_DNP3, JsonDNP3Logger, JsonDNP3LogThreadInit,
-            JsonDNP3LogThreadDeinit, NULL);
+            JsonDNP3LogThreadDeinit);
 }
index 3a72cb7c586e4c232d65d985460ee214e5911c30..3954da2336dcfbd73cefb99c5c1bd14c7cbf5fd1 100644 (file)
@@ -672,12 +672,12 @@ void JsonDnsLogRegister (void)
 {
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", MODULE_NAME, "eve-log.dns",
             JsonDnsLogInitCtxSub, ALPROTO_DNS, JsonDnsLogger, LogDnsLogThreadInit,
-            LogDnsLogThreadDeinit, NULL);
+            LogDnsLogThreadDeinit);
 }
 
 void JsonDoh2LogRegister(void)
 {
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonDoH2Log", "eve-log.doh2",
             JsonDnsLogInitCtxSub, ALPROTO_DOH2, JsonDoh2Logger, LogDnsLogThreadInit,
-            LogDnsLogThreadDeinit, NULL);
+            LogDnsLogThreadDeinit);
 }
index abbeaf07edb68e8e8f2d80b156f5ab7f10249f8d..3588a0e355be509d7fee22667cacd15b012d0348 100644 (file)
@@ -654,5 +654,5 @@ void JsonHttpLogRegister (void)
     /* register as child of eve-log */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonHttpLog", "eve-log.http",
             OutputHttpLogInitSub, ALPROTO_HTTP1, JsonHttpLogger, JsonHttpLogThreadInit,
-            JsonHttpLogThreadDeinit, NULL);
+            JsonHttpLogThreadDeinit);
 }
index e238a72e4f8ff4eb858febb29353191c3d493751..470026fde13bb8d46f1182804a7effb83a787c61 100644 (file)
@@ -184,5 +184,5 @@ void JsonIKELogRegister(void)
     /* Register as an eve sub-module. */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonIKELog", "eve-log.ike",
             OutputIKELogInitSub, ALPROTO_IKE, JsonIKELogger, JsonIKELogThreadInit,
-            JsonIKELogThreadDeinit, NULL);
+            JsonIKELogThreadDeinit);
 }
index 777107f3e9c6a53f593c38a2c1b3632cea217a46..66cf67a0334b48c97a646baddce8a3fe74a334ae 100644 (file)
@@ -194,5 +194,5 @@ void JsonMQTTLogRegister(void)
 {
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonMQTTLog", "eve-log.mqtt",
             OutputMQTTLogInitSub, ALPROTO_MQTT, JsonMQTTLogger, JsonMQTTLogThreadInit,
-            JsonMQTTLogThreadDeinit, NULL);
+            JsonMQTTLogThreadDeinit);
 }
index 946f85cdbbd5d39b3ad5345d4e6a228b43cf6ef0..72274a6b7865028bcb089e1aa8fc2b1fc4736bd0 100644 (file)
@@ -111,7 +111,7 @@ void JsonNFSLogRegister(void)
 {
     /* Register as an eve sub-module. */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonNFSLog", "eve-log.nfs", NFSLogInitSub,
-            ALPROTO_NFS, JsonNFSLogger, JsonLogThreadInit, JsonLogThreadDeinit, NULL);
+            ALPROTO_NFS, JsonNFSLogger, JsonLogThreadInit, JsonLogThreadDeinit);
 
     SCLogDebug("NFS JSON logger registered.");
 }
index d82602e351a7e19e37a1d7ada1845a612db3ca4f..14ed46f094a804e101fe12a682399c0accccbb05 100644 (file)
@@ -192,7 +192,7 @@ void JsonPgsqlLogRegister(void)
     /* Register as an eve sub-module. */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonPgsqlLog", "eve-log.pgsql",
             OutputPgsqlLogInitSub, ALPROTO_PGSQL, JsonPgsqlLogger, JsonPgsqlLogThreadInit,
-            JsonPgsqlLogThreadDeinit, NULL);
+            JsonPgsqlLogThreadDeinit);
 
     SCLogDebug("PostgreSQL JSON logger registered.");
 }
index 492c50fe27a1c112c6b676a3c86e2eed71dc364e..279ee772e8f0e84c837e908819afb3dc211213f7 100644 (file)
@@ -80,7 +80,7 @@ void JsonSMBLogRegister(void)
 {
     /* Register as an eve sub-module. */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonSMBLog", "eve-log.smb", SMBLogInitSub,
-            ALPROTO_SMB, JsonSMBLogger, JsonLogThreadInit, JsonLogThreadDeinit, NULL);
+            ALPROTO_SMB, JsonSMBLogger, JsonLogThreadInit, JsonLogThreadDeinit);
 
     SCLogDebug("SMB JSON logger registered.");
 }
index f7674687c5c403a3d1d5cdb5cd3dbe0941bd3b3f..bddbc4a9fcc4ea9dcefa0fabf46a216bb47c636b 100644 (file)
@@ -193,5 +193,5 @@ void JsonSmtpLogRegister (void) {
     /* register as child of eve-log */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonSmtpLog", "eve-log.smtp",
             OutputSmtpLogInitSub, ALPROTO_SMTP, JsonSmtpLogger, JsonSmtpLogThreadInit,
-            JsonSmtpLogThreadDeinit, NULL);
+            JsonSmtpLogThreadDeinit);
 }
index 406f6aca01c8b1bdc4c23432316466450869b11f..40c15bd7fcd983dab1181102eea57d598a13fa53 100644 (file)
@@ -718,5 +718,5 @@ void JsonTlsLogRegister (void)
     /* register as child of eve-log */
     OutputRegisterTxSubModuleWithProgress(LOGGER_JSON_TX, "eve-log", "JsonTlsLog", "eve-log.tls",
             OutputTlsLogInitSub, ALPROTO_TLS, JsonTlsLogger, TLS_HANDSHAKE_DONE, TLS_HANDSHAKE_DONE,
-            JsonTlsLogThreadInit, JsonTlsLogThreadDeinit, NULL);
+            JsonTlsLogThreadInit, JsonTlsLogThreadDeinit);
 }
index ca1e55441c6850cab6b1f5a2108cc74fd9883d03..30fee3c37061c5b9e169cbf379980d5c9b9c522f 100644 (file)
@@ -58,15 +58,13 @@ typedef struct OutputTxLogger_ {
     int ts_log_progress;
     TmEcode (*ThreadInit)(ThreadVars *, const void *, void **);
     TmEcode (*ThreadDeinit)(ThreadVars *, void *);
-    void (*ThreadExitPrintStats)(ThreadVars *, void *);
 } OutputTxLogger;
 
 static OutputTxLogger **list = NULL;
 
 int OutputRegisterTxLogger(LoggerId id, const char *name, AppProto alproto, TxLogger LogFunc,
         void *initdata, int tc_log_progress, int ts_log_progress, TxLoggerCondition LogCondition,
-        ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
-        void (*ThreadExitPrintStats)(ThreadVars *, void *))
+        ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
 {
     if (list == NULL) {
         list = SCCalloc(ALPROTO_MAX, sizeof(OutputTxLogger *));
@@ -93,7 +91,6 @@ int OutputRegisterTxLogger(LoggerId id, const char *name, AppProto alproto, TxLo
     op->logger_id = id;
     op->ThreadInit = ThreadInit;
     op->ThreadDeinit = ThreadDeinit;
-    op->ThreadExitPrintStats = ThreadExitPrintStats;
 
     if (alproto == ALPROTO_UNKNOWN) {
         op->tc_log_progress = 0;
@@ -628,25 +625,6 @@ static TmEcode OutputTxLogThreadDeinit(ThreadVars *tv, void *thread_data)
     return TM_ECODE_OK;
 }
 
-static void OutputTxLogExitPrintStats(ThreadVars *tv, void *thread_data)
-{
-    OutputTxLoggerThreadData *op_thread_data = (OutputTxLoggerThreadData *)thread_data;
-
-    for (AppProto alproto = 0; alproto < ALPROTO_MAX; alproto++) {
-        OutputLoggerThreadStore *store = op_thread_data->store[alproto];
-        OutputTxLogger *logger = list[alproto];
-
-        while (logger && store) {
-            if (logger->ThreadExitPrintStats) {
-                logger->ThreadExitPrintStats(tv, store->thread_data);
-            }
-
-            logger = logger->next;
-            store = store->next;
-        }
-    }
-}
-
 static uint32_t OutputTxLoggerGetActiveCount(void)
 {
     uint32_t cnt = 0;
@@ -676,8 +654,8 @@ void OutputTxLoggerRegister (void)
     if (unlikely(list == NULL)) {
         FatalError("Failed to allocate OutputTx list");
     }
-    OutputRegisterRootLogger(OutputTxLogThreadInit, OutputTxLogThreadDeinit,
-        OutputTxLogExitPrintStats, OutputTxLog, OutputTxLoggerGetActiveCount);
+    OutputRegisterRootLogger(OutputTxLogThreadInit, OutputTxLogThreadDeinit, NULL, OutputTxLog,
+            OutputTxLoggerGetActiveCount);
 }
 
 void OutputTxShutdown(void)
index 85c2f229de72956b9a70a44be32853f4f3f1ed54..c733c7c35aef27788bd0d2b658dc1e2bb119995e 100644 (file)
@@ -40,7 +40,7 @@ typedef bool (*TxLoggerCondition)(
 
 int OutputRegisterTxLogger(LoggerId id, const char *name, AppProto alproto, TxLogger LogFunc,
         void *, int tc_log_progress, int ts_log_progress, TxLoggerCondition LogCondition,
-        ThreadInitFunc, ThreadDeinitFunc, void (*ThreadExitPrintStats)(ThreadVars *, void *));
+        ThreadInitFunc, ThreadDeinitFunc);
 
 void OutputTxLoggerRegister (void);
 
index 7b010fe6fbcff24c2085310571e85c1170fbe3f2..f941be7d01480e88fef216c52ced94513dcfd0a3 100644 (file)
@@ -243,12 +243,10 @@ error:
  *
  * \retval Returns 0 on success, -1 on failure.
  */
-static void OutputRegisterTxModuleWrapper(LoggerId id, const char *name,
-    const char *conf_name, OutputInitFunc InitFunc, AppProto alproto,
-    TxLogger TxLogFunc, int tc_log_progress, int ts_log_progress,
-    TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit,
-    ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats)
+static void OutputRegisterTxModuleWrapper(LoggerId id, const char *name, const char *conf_name,
+        OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, int tc_log_progress,
+        int ts_log_progress, TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit,
+        ThreadDeinitFunc ThreadDeinit)
 {
     if (unlikely(TxLogFunc == NULL)) {
         goto error;
@@ -270,7 +268,6 @@ static void OutputRegisterTxModuleWrapper(LoggerId id, const char *name,
     module->ts_log_progress = ts_log_progress;
     module->ThreadInit = ThreadInit;
     module->ThreadDeinit = ThreadDeinit;
-    module->ThreadExitPrintStats = ThreadExitPrintStats;
     TAILQ_INSERT_TAIL(&output_modules, module, entries);
 
     SCLogDebug("Tx logger \"%s\" registered.", name);
@@ -279,12 +276,10 @@ error:
     FatalError("Fatal error encountered. Exiting...");
 }
 
-static void OutputRegisterTxSubModuleWrapper(LoggerId id, const char *parent_name,
-    const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
-    AppProto alproto, TxLogger TxLogFunc, int tc_log_progress,
-    int ts_log_progress, TxLoggerCondition TxLogCondition,
-    ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats)
+static void OutputRegisterTxSubModuleWrapper(LoggerId id, const char *parent_name, const char *name,
+        const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
+        int tc_log_progress, int ts_log_progress, TxLoggerCondition TxLogCondition,
+        ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
 {
     if (unlikely(TxLogFunc == NULL)) {
         goto error;
@@ -307,7 +302,6 @@ static void OutputRegisterTxSubModuleWrapper(LoggerId id, const char *parent_nam
     module->ts_log_progress = ts_log_progress;
     module->ThreadInit = ThreadInit;
     module->ThreadDeinit = ThreadDeinit;
-    module->ThreadExitPrintStats = ThreadExitPrintStats;
     TAILQ_INSERT_TAIL(&output_modules, module, entries);
 
     SCLogDebug("Tx logger for alproto %d \"%s\" registered.", alproto, name);
@@ -324,27 +318,20 @@ error:
  *
  * \retval Returns 0 on success, -1 on failure.
  */
-void OutputRegisterTxModuleWithCondition(LoggerId id, const char *name,
-    const char *conf_name, OutputInitFunc InitFunc, AppProto alproto,
-    TxLogger TxLogFunc, TxLoggerCondition TxLogCondition,
-    ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats)
+void OutputRegisterTxModuleWithCondition(LoggerId id, const char *name, const char *conf_name,
+        OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
+        TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
 {
-    OutputRegisterTxModuleWrapper(id, name, conf_name, InitFunc, alproto,
-        TxLogFunc, -1, -1, TxLogCondition, ThreadInit, ThreadDeinit,
-        ThreadExitPrintStats);
+    OutputRegisterTxModuleWrapper(id, name, conf_name, InitFunc, alproto, TxLogFunc, -1, -1,
+            TxLogCondition, ThreadInit, ThreadDeinit);
 }
 
-void OutputRegisterTxSubModuleWithCondition(LoggerId id,
-    const char *parent_name, const char *name, const char *conf_name,
-    OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
-    TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit,
-    ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats)
+void OutputRegisterTxSubModuleWithCondition(LoggerId id, const char *parent_name, const char *name,
+        const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
+        TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
 {
-    OutputRegisterTxSubModuleWrapper(id, parent_name, name, conf_name, InitFunc,
-        alproto, TxLogFunc, -1, -1, TxLogCondition, ThreadInit, ThreadDeinit,
-        ThreadExitPrintStats);
+    OutputRegisterTxSubModuleWrapper(id, parent_name, name, conf_name, InitFunc, alproto, TxLogFunc,
+            -1, -1, TxLogCondition, ThreadInit, ThreadDeinit);
 }
 
 /**
@@ -355,27 +342,21 @@ void OutputRegisterTxSubModuleWithCondition(LoggerId id,
  *
  * \retval Returns 0 on success, -1 on failure.
  */
-void OutputRegisterTxModuleWithProgress(LoggerId id, const char *name,
-    const char *conf_name, OutputInitFunc InitFunc, AppProto alproto,
-    TxLogger TxLogFunc, int tc_log_progress, int ts_log_progress,
-    ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats)
+void OutputRegisterTxModuleWithProgress(LoggerId id, const char *name, const char *conf_name,
+        OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, int tc_log_progress,
+        int ts_log_progress, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
 {
-    OutputRegisterTxModuleWrapper(id, name, conf_name, InitFunc, alproto,
-        TxLogFunc, tc_log_progress, ts_log_progress, NULL, ThreadInit,
-        ThreadDeinit, ThreadExitPrintStats);
+    OutputRegisterTxModuleWrapper(id, name, conf_name, InitFunc, alproto, TxLogFunc,
+            tc_log_progress, ts_log_progress, NULL, ThreadInit, ThreadDeinit);
 }
 
-void OutputRegisterTxSubModuleWithProgress(LoggerId id, const char *parent_name,
-    const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
-    AppProto alproto, TxLogger TxLogFunc, int tc_log_progress,
-    int ts_log_progress, ThreadInitFunc ThreadInit,
-    ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats)
+void OutputRegisterTxSubModuleWithProgress(LoggerId id, const char *parent_name, const char *name,
+        const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
+        int tc_log_progress, int ts_log_progress, ThreadInitFunc ThreadInit,
+        ThreadDeinitFunc ThreadDeinit)
 {
-    OutputRegisterTxSubModuleWrapper(id, parent_name, name, conf_name, InitFunc,
-        alproto, TxLogFunc, tc_log_progress, ts_log_progress, NULL, ThreadInit,
-        ThreadDeinit, ThreadExitPrintStats);
+    OutputRegisterTxSubModuleWrapper(id, parent_name, name, conf_name, InitFunc, alproto, TxLogFunc,
+            tc_log_progress, ts_log_progress, NULL, ThreadInit, ThreadDeinit);
 }
 
 /**
@@ -386,26 +367,20 @@ void OutputRegisterTxSubModuleWithProgress(LoggerId id, const char *parent_name,
  *
  * \retval Returns 0 on success, -1 on failure.
  */
-void OutputRegisterTxModule(LoggerId id, const char *name,
-    const char *conf_name, OutputInitFunc InitFunc, AppProto alproto,
-    TxLogger TxLogFunc, ThreadInitFunc ThreadInit,
-    ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats)
+void OutputRegisterTxModule(LoggerId id, const char *name, const char *conf_name,
+        OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, ThreadInitFunc ThreadInit,
+        ThreadDeinitFunc ThreadDeinit)
 {
-    OutputRegisterTxModuleWrapper(id, name, conf_name, InitFunc, alproto,
-        TxLogFunc, -1, -1, NULL, ThreadInit, ThreadDeinit,
-        ThreadExitPrintStats);
+    OutputRegisterTxModuleWrapper(id, name, conf_name, InitFunc, alproto, TxLogFunc, -1, -1, NULL,
+            ThreadInit, ThreadDeinit);
 }
 
-void OutputRegisterTxSubModule(LoggerId id, const char *parent_name,
-    const char *name, const char *conf_name,
-    OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
-    ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats)
+void OutputRegisterTxSubModule(LoggerId id, const char *parent_name, const char *name,
+        const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
+        ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
 {
-    OutputRegisterTxSubModuleWrapper(id, parent_name, name, conf_name,
-        InitFunc, alproto, TxLogFunc, -1, -1, NULL, ThreadInit, ThreadDeinit,
-        ThreadExitPrintStats);
+    OutputRegisterTxSubModuleWrapper(id, parent_name, name, conf_name, InitFunc, alproto, TxLogFunc,
+            -1, -1, NULL, ThreadInit, ThreadDeinit);
 }
 
 /**
@@ -1033,7 +1008,7 @@ void OutputRegisterLoggers(void)
     JsonHttpLogRegister();
     OutputRegisterTxSubModuleWithProgress(LOGGER_JSON_TX, "eve-log", "LogHttp2Log", "eve-log.http2",
             OutputJsonLogInitSub, ALPROTO_HTTP2, JsonGenericDirFlowLogger, HTTP2StateClosed,
-            HTTP2StateClosed, JsonLogThreadInit, JsonLogThreadDeinit, NULL);
+            HTTP2StateClosed, JsonLogThreadInit, JsonLogThreadDeinit);
     /* tls log */
     LogTlsLogRegister();
     JsonTlsLogRegister();
@@ -1041,7 +1016,7 @@ void OutputRegisterLoggers(void)
     /* ssh */
     OutputRegisterTxSubModuleWithCondition(LOGGER_JSON_TX, "eve-log", "JsonSshLog", "eve-log.ssh",
             OutputJsonLogInitSub, ALPROTO_SSH, JsonGenericDirFlowLogger, SSHTxLogCondition,
-            JsonLogThreadInit, JsonLogThreadDeinit, NULL);
+            JsonLogThreadInit, JsonLogThreadDeinit);
     /* pcap log */
     PcapLogRegister();
     /* file log */
@@ -1052,7 +1027,7 @@ void OutputRegisterLoggers(void)
     /* modbus */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonModbusLog", "eve-log.modbus",
             OutputJsonLogInitSub, ALPROTO_MODBUS, JsonGenericDirFlowLogger, JsonLogThreadInit,
-            JsonLogThreadDeinit, NULL);
+            JsonLogThreadDeinit);
 
     SCLogDebug("modbus json logger registered.");
     /* tcp streaming data */
@@ -1077,16 +1052,16 @@ void OutputRegisterLoggers(void)
     /* TFTP JSON logger. */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonTFTPLog", "eve-log.tftp",
             OutputJsonLogInitSub, ALPROTO_TFTP, JsonGenericDirPacketLogger, JsonLogThreadInit,
-            JsonLogThreadDeinit, NULL);
+            JsonLogThreadDeinit);
 
     SCLogDebug("TFTP JSON logger registered.");
     /* FTP and FTP-DATA JSON loggers. */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonFTPLog", "eve-log.ftp",
             OutputJsonLogInitSub, ALPROTO_FTP, JsonGenericDirFlowLogger, JsonLogThreadInit,
-            JsonLogThreadDeinit, NULL);
+            JsonLogThreadDeinit);
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonFTPLog", "eve-log.ftp",
             OutputJsonLogInitSub, ALPROTO_FTPDATA, JsonGenericDirFlowLogger, JsonLogThreadInit,
-            JsonLogThreadDeinit, NULL);
+            JsonLogThreadDeinit);
     SCLogDebug("FTP JSON logger registered.");
 
     /* SMB JSON logger. */
@@ -1096,13 +1071,13 @@ void OutputRegisterLoggers(void)
     /* KRB5 JSON logger. */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonKRB5Log", "eve-log.krb5",
             OutputJsonLogInitSub, ALPROTO_KRB5, JsonGenericDirPacketLogger, JsonLogThreadInit,
-            JsonLogThreadDeinit, NULL);
+            JsonLogThreadDeinit);
 
     SCLogDebug("KRB5 JSON logger registered.");
     /* QUIC JSON logger. */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonQuicLog", "eve-log.quic",
             OutputJsonLogInitSub, ALPROTO_QUIC, JsonGenericDirPacketLogger, JsonLogThreadInit,
-            JsonLogThreadDeinit, NULL);
+            JsonLogThreadDeinit);
 
     SCLogDebug("quic json logger registered.");
     /* DHCP JSON logger. */
@@ -1110,19 +1085,19 @@ void OutputRegisterLoggers(void)
     /* SNMP JSON logger. */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonSNMPLog", "eve-log.snmp",
             OutputJsonLogInitSub, ALPROTO_SNMP, JsonGenericDirPacketLogger, JsonLogThreadInit,
-            JsonLogThreadDeinit, NULL);
+            JsonLogThreadDeinit);
 
     SCLogDebug("SNMP JSON logger registered.");
     /* SIP JSON logger. */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonSIPLog", "eve-log.sip",
             OutputJsonLogInitSub, ALPROTO_SIP, JsonGenericDirPacketLogger, JsonLogThreadInit,
-            JsonLogThreadDeinit, NULL);
+            JsonLogThreadDeinit);
 
     SCLogDebug("SIP JSON logger registered.");
     /* RFB JSON logger. */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonRFBLog", "eve-log.rfb",
             OutputJsonLogInitSub, ALPROTO_RFB, JsonGenericDirPacketLogger, JsonLogThreadInit,
-            JsonLogThreadDeinit, NULL);
+            JsonLogThreadDeinit);
     /* MQTT JSON logger. */
     JsonMQTTLogRegister();
     /* Pgsql JSON logger. */
@@ -1130,25 +1105,25 @@ void OutputRegisterLoggers(void)
     /* WebSocket JSON logger. */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonWebSocketLog", "eve-log.websocket",
             OutputJsonLogInitSub, ALPROTO_WEBSOCKET, JsonGenericDirPacketLogger, JsonLogThreadInit,
-            JsonLogThreadDeinit, NULL);
+            JsonLogThreadDeinit);
     /* Enip JSON logger. */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonEnipLog", "eve-log.enip",
             OutputJsonLogInitSub, ALPROTO_ENIP, JsonGenericDirFlowLogger, JsonLogThreadInit,
-            JsonLogThreadDeinit, NULL);
+            JsonLogThreadDeinit);
     /* Ldap JSON logger. */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonLdapLog", "eve-log.ldap",
             OutputJsonLogInitSub, ALPROTO_LDAP, JsonGenericDirFlowLogger, JsonLogThreadInit,
-            JsonLogThreadDeinit, NULL);
+            JsonLogThreadDeinit);
     /* DoH2 JSON logger. */
     JsonDoh2LogRegister();
     /* Template JSON logger. */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonTemplateLog", "eve-log.template",
             OutputJsonLogInitSub, ALPROTO_TEMPLATE, JsonGenericDirPacketLogger, JsonLogThreadInit,
-            JsonLogThreadDeinit, NULL);
+            JsonLogThreadDeinit);
     /* RDP JSON logger. */
     OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonRdpLog", "eve-log.rdp",
             OutputJsonLogInitSub, ALPROTO_RDP, JsonGenericDirPacketLogger, JsonLogThreadInit,
-            JsonLogThreadDeinit, NULL);
+            JsonLogThreadDeinit);
     SCLogDebug("rdp json logger registered.");
     /* DCERPC JSON logger. */
     JsonDCERPCLogRegister();
@@ -1159,7 +1134,7 @@ void OutputRegisterLoggers(void)
         /* Register as an eve sub-module. */
         OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonBitTorrentDHTLog",
                 "eve-log.bittorrent-dht", OutputJsonLogInitSub, ALPROTO_BITTORRENT_DHT,
-                JsonGenericDirPacketLogger, JsonLogThreadInit, JsonLogThreadDeinit, NULL);
+                JsonGenericDirPacketLogger, JsonLogThreadInit, JsonLogThreadDeinit);
     }
     /* ARP JSON logger */
     JsonArpLogRegister();
index 4abb529961ff8bf5ed9101337c7b63f807972e6f..f85fcfd874b726105a296aaa8ef700a1fdeb32be 100644 (file)
@@ -94,40 +94,27 @@ void OutputRegisterPacketSubModule(LoggerId id, const char *parent_name, const c
         const char *conf_name, OutputInitSubFunc InitFunc, PacketLogger LogFunc,
         PacketLogCondition ConditionFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit);
 
-void OutputRegisterTxModule(LoggerId id, const char *name,
-    const char *conf_name, OutputInitFunc InitFunc, AppProto alproto,
-    TxLogger TxLogFunc, ThreadInitFunc ThreadInit,
-    ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats);
-void OutputRegisterTxSubModule(LoggerId id, const char *parent_name,
-    const char *name, const char *conf_name,
-    OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
-    ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats);
-
-void OutputRegisterTxModuleWithCondition(LoggerId id, const char *name,
-    const char *conf_name, OutputInitFunc InitFunc, AppProto alproto,
-    TxLogger TxLogFunc, TxLoggerCondition TxLogCondition,
-    ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats);
-void OutputRegisterTxSubModuleWithCondition(LoggerId id,
-    const char *parent_name, const char *name, const char *conf_name,
-    OutputInitSubFunc InitFunc, AppProto alproto,
-    TxLogger TxLogFunc, TxLoggerCondition TxLogCondition,
-    ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats);
+void OutputRegisterTxModule(LoggerId id, const char *name, const char *conf_name,
+        OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, ThreadInitFunc ThreadInit,
+        ThreadDeinitFunc ThreadDeinit);
+void OutputRegisterTxSubModule(LoggerId id, const char *parent_name, const char *name,
+        const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
+        ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit);
 
-void OutputRegisterTxModuleWithProgress(LoggerId id, const char *name,
-    const char *conf_name, OutputInitFunc InitFunc, AppProto alproto,
-    TxLogger TxLogFunc, int tc_log_progress, int ts_log_progress,
-    ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats);
-void OutputRegisterTxSubModuleWithProgress(LoggerId id, const char *parent_name,
-    const char *name, const char *conf_name,
-    OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
-    int tc_log_progress, int ts_log_progress, ThreadInitFunc ThreadInit,
-    ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats);
+void OutputRegisterTxModuleWithCondition(LoggerId id, const char *name, const char *conf_name,
+        OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
+        TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit);
+void OutputRegisterTxSubModuleWithCondition(LoggerId id, const char *parent_name, const char *name,
+        const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
+        TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit);
+
+void OutputRegisterTxModuleWithProgress(LoggerId id, const char *name, const char *conf_name,
+        OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, int tc_log_progress,
+        int ts_log_progress, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit);
+void OutputRegisterTxSubModuleWithProgress(LoggerId id, const char *parent_name, const char *name,
+        const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
+        int tc_log_progress, int ts_log_progress, ThreadInitFunc ThreadInit,
+        ThreadDeinitFunc ThreadDeinit);
 
 void OutputRegisterFileSubModule(LoggerId id, const char *parent_name,
     const char *name, const char *conf_name,
index f092e4066ea0718dee191a34dfe9dfbcd2a7ccda..034e0e35a7cef68dfcce1bdb99a001bb7a5f15ab 100644 (file)
@@ -622,11 +622,9 @@ static void SetupOutput(
                 module->PacketConditionFunc, output_ctx, module->ThreadInit, module->ThreadDeinit);
     } else if (module->TxLogFunc) {
         SCLogDebug("%s is a tx logger", module->name);
-        OutputRegisterTxLogger(module->logger_id, module->name, module->alproto,
-                module->TxLogFunc, output_ctx, module->tc_log_progress,
-                module->ts_log_progress, module->TxLogCondition,
-                module->ThreadInit, module->ThreadDeinit,
-                module->ThreadExitPrintStats);
+        OutputRegisterTxLogger(module->logger_id, module->name, module->alproto, module->TxLogFunc,
+                output_ctx, module->tc_log_progress, module->ts_log_progress,
+                module->TxLogCondition, module->ThreadInit, module->ThreadDeinit);
         /* Not used with wild card loggers */
         if (module->alproto != ALPROTO_UNKNOWN) {
             logger_bits[module->alproto] |= BIT_U32(module->logger_id);