]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
lua: Use SC prefix for Lua functions
authorJeff Lucovsky <jeff@lucovsky.org>
Tue, 12 Jan 2021 15:14:54 +0000 (10:14 -0500)
committerShivani Bhardwaj <shivanib134@gmail.com>
Fri, 29 Jan 2021 09:56:56 +0000 (15:26 +0530)
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.

(cherry picked from commit 431018d6f7d81ec603d29ba990ef22e51d797139)

src/detect-lua-extensions.c

index e298d71a498123a068ef69c82ae7297c9390b357..d615d0feec444dc78433343d964fc968ece4a5c6 100644 (file)
@@ -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);