From: Jason Ish Date: Fri, 27 May 2016 08:01:52 +0000 (-0600) Subject: logging: convert json smtp output to non-thread module X-Git-Tag: suricata-3.2beta1~378 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38354479b7b18ddde3d905c106eb33097aa841c0;p=thirdparty%2Fsuricata.git logging: convert json smtp output to non-thread module --- diff --git a/src/output-json-smtp.c b/src/output-json-smtp.c index 1a9a46fbde..8bf94d2604 100644 --- a/src/output-json-smtp.c +++ b/src/output-json-smtp.c @@ -258,34 +258,22 @@ static TmEcode JsonSmtpLogThreadDeinit(ThreadVars *t, void *data) } void TmModuleJsonSmtpLogRegister (void) { - tmm_modules[TMM_JSONSMTPLOG].name = "JsonSmtpLog"; - tmm_modules[TMM_JSONSMTPLOG].ThreadInit = JsonSmtpLogThreadInit; - tmm_modules[TMM_JSONSMTPLOG].ThreadDeinit = JsonSmtpLogThreadDeinit; - tmm_modules[TMM_JSONSMTPLOG].RegisterTests = NULL; - tmm_modules[TMM_JSONSMTPLOG].cap_flags = 0; - tmm_modules[TMM_JSONSMTPLOG].flags = TM_FLAG_LOGAPI_TM; - /* register as separate module */ OutputRegisterTxModule("JsonSmtpLog", "smtp-json-log", OutputSmtpLogInit, - ALPROTO_SMTP, JsonSmtpLogger, NULL, NULL, NULL); + ALPROTO_SMTP, JsonSmtpLogger, JsonSmtpLogThreadInit, + JsonSmtpLogThreadDeinit, NULL); /* also register as child of eve-log */ OutputRegisterTxSubModule("eve-log", "JsonSmtpLog", "eve-log.smtp", - OutputSmtpLogInitSub, ALPROTO_SMTP, JsonSmtpLogger, NULL, NULL, NULL); + OutputSmtpLogInitSub, ALPROTO_SMTP, JsonSmtpLogger, + JsonSmtpLogThreadInit, JsonSmtpLogThreadDeinit, 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 TmModuleJsonSmtpLogRegister (void) { - tmm_modules[TMM_JSONSMTPLOG].name = "JsonSmtpLog"; - tmm_modules[TMM_JSONSMTPLOG].ThreadInit = OutputJsonThreadInit; + SCLogInfo("Can't register JSON output - JSON support was disabled during build."); } #endif diff --git a/src/tm-modules.c b/src/tm-modules.c index dc4605e45f..dc5527cd5f 100644 --- a/src/tm-modules.c +++ b/src/tm-modules.c @@ -244,7 +244,6 @@ const char * TmModuleTmmIdToString(TmmId id) CASE_CODE (TMM_STREAMINGLOGGER); CASE_CODE (TMM_JSONDROPLOG); CASE_CODE (TMM_JSONFILELOG); - CASE_CODE (TMM_JSONSMTPLOG); CASE_CODE (TMM_JSONSTATSLOG); CASE_CODE (TMM_OUTPUTJSON); CASE_CODE (TMM_FLOWMANAGER); diff --git a/src/tm-threads-common.h b/src/tm-threads-common.h index 17c531e085..736eb99871 100644 --- a/src/tm-threads-common.h +++ b/src/tm-threads-common.h @@ -76,7 +76,6 @@ typedef enum { TMM_FILEDATALOGGER, TMM_STREAMINGLOGGER, TMM_JSONDROPLOG, - TMM_JSONSMTPLOG, TMM_JSONSTATSLOG, TMM_JSONFILELOG, TMM_RECEIVENFLOG,