From: Victor Julien Date: Tue, 5 Jul 2016 14:09:32 +0000 (+0200) Subject: lua: support smtp tx logging X-Git-Tag: suricata-3.1.1~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff3baeee90f7f2ea778d06be62bd236f85ed99eb;p=thirdparty%2Fsuricata.git lua: support smtp tx logging --- diff --git a/src/output-lua.c b/src/output-lua.c index eb32911337..77a7811f0d 100644 --- a/src/output-lua.c +++ b/src/output-lua.c @@ -605,6 +605,8 @@ static int LuaScriptInit(const char *filename, LogLuaScriptOptions *options) { options->alproto = ALPROTO_TLS; else if (strcmp(k,"protocol") == 0 && strcmp(v, "ssh") == 0) options->alproto = ALPROTO_SSH; + else if (strcmp(k,"protocol") == 0 && strcmp(v, "smtp") == 0) + options->alproto = ALPROTO_SMTP; else if (strcmp(k, "type") == 0 && strcmp(v, "packet") == 0) options->packet = 1; else if (strcmp(k, "filter") == 0 && strcmp(v, "alerts") == 0) @@ -877,6 +879,10 @@ static OutputCtx *OutputLuaLogInit(ConfNode *conf) } else if (opts.alproto == ALPROTO_SSH) { om->PacketLogFunc = LuaPacketLoggerSsh; om->PacketConditionFunc = LuaPacketConditionSsh; + } else if (opts.alproto == ALPROTO_SMTP) { + om->TxLogFunc = LuaTxLogger; + om->alproto = ALPROTO_SMTP; + AppLayerParserRegisterLogger(IPPROTO_TCP, ALPROTO_SMTP); } else if (opts.packet && opts.alerts) { om->PacketLogFunc = LuaPacketLoggerAlerts; om->PacketConditionFunc = LuaPacketConditionAlerts;