From: Jason Ish Date: Fri, 27 May 2016 07:18:22 +0000 (-0600) Subject: logging: convert json tls output to non-thread module X-Git-Tag: suricata-3.2beta1~383 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aaa65f3d16174bf149ccffa98f23569de6c91039;p=thirdparty%2Fsuricata.git logging: convert json tls output to non-thread module --- diff --git a/src/output-json-tls.c b/src/output-json-tls.c index 4b0f2a0463..52237ba934 100644 --- a/src/output-json-tls.c +++ b/src/output-json-tls.c @@ -310,36 +310,23 @@ OutputCtx *OutputTlsLogInitSub(ConfNode *conf, OutputCtx *parent_ctx) void TmModuleJsonTlsLogRegister (void) { - tmm_modules[TMM_JSONTLSLOG].name = "JsonTlsLog"; - tmm_modules[TMM_JSONTLSLOG].ThreadInit = JsonTlsLogThreadInit; - tmm_modules[TMM_JSONTLSLOG].ThreadDeinit = JsonTlsLogThreadDeinit; - tmm_modules[TMM_JSONTLSLOG].RegisterTests = NULL; - tmm_modules[TMM_JSONTLSLOG].cap_flags = 0; - tmm_modules[TMM_JSONTLSLOG].flags = TM_FLAG_LOGAPI_TM; - /* register as separate module */ OutputRegisterTxModuleWithProgress("JsonTlsLog", "tls-json-log", - OutputTlsLogInit, ALPROTO_TLS, JsonTlsLogger, TLS_HANDSHAKE_DONE, - TLS_HANDSHAKE_DONE, NULL, NULL, NULL); + OutputTlsLogInit, ALPROTO_TLS, JsonTlsLogger, TLS_HANDSHAKE_DONE, + TLS_HANDSHAKE_DONE, JsonTlsLogThreadInit, JsonTlsLogThreadDeinit, NULL); /* also register as child of eve-log */ OutputRegisterTxSubModuleWithProgress("eve-log", "JsonTlsLog", - "eve-log.tls", OutputTlsLogInitSub, ALPROTO_TLS, JsonTlsLogger, - TLS_HANDSHAKE_DONE, TLS_HANDSHAKE_DONE, NULL, NULL, NULL); + "eve-log.tls", OutputTlsLogInitSub, ALPROTO_TLS, JsonTlsLogger, + TLS_HANDSHAKE_DONE, TLS_HANDSHAKE_DONE, JsonTlsLogThreadInit, + JsonTlsLogThreadDeinit, NULL); } #else -static TmEcode OutputJsonThreadInit(ThreadVars *t, void *initdata, void **data) -{ - SCLogInfo("Can't init JSON output - JSON support was disabled during build."); - return TM_ECODE_FAILED; -} - void TmModuleJsonTlsLogRegister (void) { - tmm_modules[TMM_JSONTLSLOG].name = "JsonTlsLog"; - tmm_modules[TMM_JSONTLSLOG].ThreadInit = OutputJsonThreadInit; + SCLogInfo("Can't register JSON output - JSON support was disabled during build."); } #endif diff --git a/src/output.h b/src/output.h index 58f488c6c4..cfa01ae9a0 100644 --- a/src/output.h +++ b/src/output.h @@ -101,10 +101,11 @@ void OutputRegisterTxSubModuleWithCondition(const char *parent_name, TxLoggerCondition TxLogCondition); void OutputRegisterTxModuleWithProgress(const char *name, const char *conf_name, - OutputCtx *(*InitFunc)(ConfNode *), AppProto alproto, TxLogger TxLogFunc, - int tc_log_progress, int ts_log_progress, ThreadInitFunc ThreadInit, - ThreadDeinitFunc ThreadDeinit, + OutputCtx *(*InitFunc)(ConfNode *), AppProto alproto, + TxLogger TxLogFunc, int tc_log_progress, int ts_log_progress, + ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats); + void OutputRegisterTxSubModuleWithProgress(const char *parent_name, const char *name, const char *conf_name, OutputCtx *(*InitFunc)(ConfNode *, OutputCtx *parent_ctx), diff --git a/src/tm-modules.c b/src/tm-modules.c index d4d167158c..834a46a2c2 100644 --- a/src/tm-modules.c +++ b/src/tm-modules.c @@ -250,7 +250,6 @@ const char * TmModuleTmmIdToString(TmmId id) CASE_CODE (TMM_JSONSMTPLOG); CASE_CODE (TMM_JSONSSHLOG); CASE_CODE (TMM_JSONSTATSLOG); - CASE_CODE (TMM_JSONTLSLOG); CASE_CODE (TMM_OUTPUTJSON); CASE_CODE (TMM_FLOWMANAGER); CASE_CODE (TMM_FLOWRECYCLER); diff --git a/src/tm-threads-common.h b/src/tm-threads-common.h index 7288b92ebd..370c5a1cff 100644 --- a/src/tm-threads-common.h +++ b/src/tm-threads-common.h @@ -80,7 +80,6 @@ typedef enum { TMM_JSONSMTPLOG, TMM_JSONSSHLOG, TMM_JSONSTATSLOG, - TMM_JSONTLSLOG, TMM_JSONFILELOG, TMM_RECEIVENFLOG, TMM_DECODENFLOG,