From: Victor Julien Date: Mon, 4 Aug 2014 15:47:47 +0000 (+0200) Subject: lua: move output http funcs to generic util file X-Git-Tag: suricata-2.1beta2~120 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e0d544fb86095f95083d20434e46bf35693cdd1c;p=thirdparty%2Fsuricata.git lua: move output http funcs to generic util file Move output Http functions to util-lua-http.c so that detect can use it later. --- diff --git a/src/Makefile.am b/src/Makefile.am index 609fb718e6..2e126f5616 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -228,7 +228,6 @@ output-json-ssh.c output-json-ssh.h \ output-json-tls.c output-json-tls.h \ output-lua.c output-lua.h \ output-lua-common.c output-lua-common.h \ -output-lua-http.c output-lua-http.h \ output-packet.c output-packet.h \ output-streaming.c output-streaming.h \ output-tx.c output-tx.h \ @@ -321,6 +320,7 @@ util-ip.h util-ip.c \ util-logopenfile.h util-logopenfile.c \ util-logopenfile-tile.h util-logopenfile-tile.c \ util-lua.c util-lua.h \ +util-lua-http.c util-lua-http.h \ util-magic.c util-magic.h \ util-memcmp.c util-memcmp.h \ util-memcpy.h \ diff --git a/src/output-lua.c b/src/output-lua.c index 364cecdd8e..76b89ce3f2 100644 --- a/src/output-lua.c +++ b/src/output-lua.c @@ -55,7 +55,7 @@ #include "util-lua.h" #include "output-lua-common.h" -#include "output-lua-http.h" +#include "util-lua-http.h" #define MODULE_NAME "LuaLog" @@ -546,7 +546,7 @@ static lua_State *LuaScriptSetup(const char *filename) LogLuaRegisterFunctions(luastate); /* unconditionally register http function. They will only work * if the tx is registered in the state at runtime though. */ - LogLuaRegisterHttpFunctions(luastate); + LuaRegisterHttpFunctions(luastate); if (lua_pcall(luastate, 0, 0, 0) != 0) { SCLogError(SC_ERR_LUA_ERROR, "couldn't run script 'setup' function: %s", lua_tostring(luastate, -1)); diff --git a/src/output-lua-http.c b/src/util-lua-http.c similarity index 99% rename from src/output-lua-http.c rename to src/util-lua-http.c index 15960e31b8..2405fa2358 100644 --- a/src/output-lua-http.c +++ b/src/util-lua-http.c @@ -332,7 +332,7 @@ static int HttpGetResponseBody(lua_State *luastate) } /** \brief register http lua extensions in a luastate */ -int LogLuaRegisterHttpFunctions(lua_State *luastate) +int LuaRegisterHttpFunctions(lua_State *luastate) { /* registration of the callbacks */ lua_pushcfunction(luastate, HttpGetRequestHeader); diff --git a/src/output-lua-http.h b/src/util-lua-http.h similarity index 84% rename from src/output-lua-http.h rename to src/util-lua-http.h index 5778476bb8..8a75ec53e7 100644 --- a/src/output-lua-http.h +++ b/src/util-lua-http.h @@ -21,13 +21,13 @@ * \author Victor Julien */ -#ifndef __OUTPUT_LUA_HTTP_H__ -#define __OUTPUT_LUA_HTTP_H__ +#ifndef __UTIL_LUA_HTTP_H__ +#define __UTIL_LUA_HTTP_H__ #ifdef HAVE_LUA -int LogLuaRegisterHttpFunctions(lua_State *luastate); +int LuaRegisterHttpFunctions(lua_State *luastate); #endif /* HAVE_LUA */ -#endif /* __OUTPUT_LUA_HTTP_H__ */ +#endif /* __UTIL_LUA_HTTP_H__ */