From: Jeff Lucovsky Date: Tue, 12 Jan 2021 15:14:54 +0000 (-0500) Subject: lua: Use SC prefix for Lua functions X-Git-Tag: suricata-7.0.0-beta1~1872 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=431018d6f7d81ec603d29ba990ef22e51d797139;p=thirdparty%2Fsuricata.git lua: Use SC prefix for Lua functions This commit adds additional Lua API interfaces to bring consistency to functions such that the `SC` prefix is available consistently across flow int and flow var functions. --- diff --git a/src/detect-lua-extensions.c b/src/detect-lua-extensions.c index e298d71a49..d615d0feec 100644 --- a/src/detect-lua-extensions.c +++ b/src/detect-lua-extensions.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2007-2013 Open Information Security Foundation +/* Copyright (C) 2007-2021 Open Information Security Foundation * * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 as published by the Free @@ -516,21 +516,39 @@ int LuaRegisterExtensions(lua_State *lua_state) lua_pushcfunction(lua_state, LuaGetFlowvar); lua_setglobal(lua_state, "ScFlowvarGet"); + lua_pushcfunction(lua_state, LuaGetFlowvar); + lua_setglobal(lua_state, "SCFlowvarGet"); + lua_pushcfunction(lua_state, LuaSetFlowvar); lua_setglobal(lua_state, "ScFlowvarSet"); + lua_pushcfunction(lua_state, LuaSetFlowvar); + lua_setglobal(lua_state, "SCFlowvarSet"); + lua_pushcfunction(lua_state, LuaGetFlowint); lua_setglobal(lua_state, "ScFlowintGet"); + lua_pushcfunction(lua_state, LuaGetFlowint); + lua_setglobal(lua_state, "SCFlowintGet"); + lua_pushcfunction(lua_state, LuaSetFlowint); lua_setglobal(lua_state, "ScFlowintSet"); + lua_pushcfunction(lua_state, LuaSetFlowint); + lua_setglobal(lua_state, "SCFlowintSet"); + lua_pushcfunction(lua_state, LuaIncrFlowint); lua_setglobal(lua_state, "ScFlowintIncr"); + lua_pushcfunction(lua_state, LuaIncrFlowint); + lua_setglobal(lua_state, "SCFlowintIncr"); + lua_pushcfunction(lua_state, LuaDecrFlowint); lua_setglobal(lua_state, "ScFlowintDecr"); + lua_pushcfunction(lua_state, LuaDecrFlowint); + lua_setglobal(lua_state, "SCFlowintDecr"); + LuaRegisterFunctions(lua_state); LuaRegisterHttpFunctions(lua_state); LuaRegisterDnsFunctions(lua_state);