]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
lua: remove internal references to luajit
authorJo Johnson <pyrojoe314@gmail.com>
Fri, 26 Jan 2024 18:09:00 +0000 (10:09 -0800)
committerJason Ish <jason.ish@oisf.net>
Mon, 27 May 2024 22:00:17 +0000 (16:00 -0600)
src/detect-lua-extensions.c
src/detect-lua.c
src/detect-lua.h

index 9a0850b9e9196d2e617a2e5016656449ec21a424..da4ec8b5835a0dd635971492773b008c82aae79d 100644 (file)
@@ -124,7 +124,7 @@ static int GetFlowVarById(lua_State *luastate, Flow *f,
         LUA_ERROR("flowvar id not a number");
     }
     int id = lua_tonumber(luastate, 1);
-    if (id < 0 || id >= DETECT_LUAJIT_MAX_FLOWVARS) {
+    if (id < 0 || id >= DETECT_LUA_MAX_FLOWVARS) {
         LUA_ERROR("flowvar id out of range");
     }
     uint32_t idx = ld->flowvar[id];
@@ -185,7 +185,7 @@ static int GetFlowIntById(lua_State *luastate, Flow *f,
         LUA_ERROR("flowvar id not a number");
     }
     int id = lua_tonumber(luastate, 1);
-    if (id < 0 || id >= DETECT_LUAJIT_MAX_FLOWVARS) {
+    if (id < 0 || id >= DETECT_LUA_MAX_FLOWVARS) {
         LUA_ERROR("flowvar id out of range");
     }
     uint32_t idx = ld->flowint[id];
@@ -391,7 +391,7 @@ static int LuaSetFlowint(lua_State *luastate)
         LUA_ERROR("1st arg not a number");
     }
     int id = lua_tonumber(luastate, 1);
-    if (id < 0 || id >= DETECT_LUAJIT_MAX_FLOWVARS) {
+    if (id < 0 || id >= DETECT_LUA_MAX_FLOWVARS) {
         LUA_ERROR("flowint id out of range");
     }
 
@@ -496,7 +496,7 @@ static int LuaGetByteVar(lua_State *luastate)
         LUA_ERROR("bytevar id not a number");
     }
     int id = lua_tonumber(luastate, 1);
-    if (id < 0 || id >= DETECT_LUAJIT_MAX_BYTEVARS) {
+    if (id < 0 || id >= DETECT_LUA_MAX_BYTEVARS) {
         LUA_ERROR("bytevar id out of range");
     }
     uint32_t idx = ld->bytevar[id];
index a6d334537dd8a3f0d8335011b64ad39b71e1ddd9..a88f7e79a86ac0eba8c20bd38f55337fc76c1413 100644 (file)
@@ -60,7 +60,7 @@
 
 static int DetectLuaSetupNoSupport (DetectEngineCtx *a, Signature *b, const char *c)
 {
-    SCLogError("no Lua support built in, needed for lua/luajit keyword");
+    SCLogError("no Lua support built in, needed for lua keyword");
     return -1;
 }
 
@@ -70,7 +70,6 @@ static int DetectLuaSetupNoSupport (DetectEngineCtx *a, Signature *b, const char
 void DetectLuaRegister(void)
 {
     sigmatch_table[DETECT_LUA].name = "lua";
-    sigmatch_table[DETECT_LUA].alias = "luajit";
     sigmatch_table[DETECT_LUA].desc = "support for lua scripting";
     sigmatch_table[DETECT_LUA].url = "/rules/rule-lua-scripting.html";
     sigmatch_table[DETECT_LUA].Setup = DetectLuaSetupNoSupport;
@@ -104,7 +103,6 @@ static int g_smtp_generic_list_id = 0;
 void DetectLuaRegister(void)
 {
     sigmatch_table[DETECT_LUA].name = "lua";
-    sigmatch_table[DETECT_LUA].alias = "luajit";
     sigmatch_table[DETECT_LUA].desc = "match via a lua script";
     sigmatch_table[DETECT_LUA].url = "/rules/rule-lua-scripting.html";
     sigmatch_table[DETECT_LUA].Match = DetectLuaMatch;
@@ -662,7 +660,7 @@ static int DetectLuaSetupPrime(DetectEngineCtx *de_ctx, DetectLuaData *ld, const
                     /* removes 'value'; keeps 'key' for next iteration */
                     lua_pop(luastate, 1);
 
-                    if (ld->flowvars == DETECT_LUAJIT_MAX_FLOWVARS) {
+                    if (ld->flowvars == DETECT_LUA_MAX_FLOWVARS) {
                         SCLogError("too many flowvars registered");
                         goto error;
                     }
@@ -684,7 +682,7 @@ static int DetectLuaSetupPrime(DetectEngineCtx *de_ctx, DetectLuaData *ld, const
                     /* removes 'value'; keeps 'key' for next iteration */
                     lua_pop(luastate, 1);
 
-                    if (ld->flowints == DETECT_LUAJIT_MAX_FLOWINTS) {
+                    if (ld->flowints == DETECT_LUA_MAX_FLOWINTS) {
                         SCLogError("too many flowints registered");
                         goto error;
                     }
@@ -706,7 +704,7 @@ static int DetectLuaSetupPrime(DetectEngineCtx *de_ctx, DetectLuaData *ld, const
                     /* removes 'value'; keeps 'key' for next iteration */
                     lua_pop(luastate, 1);
 
-                    if (ld->bytevars == DETECT_LUAJIT_MAX_BYTEVARS) {
+                    if (ld->bytevars == DETECT_LUA_MAX_BYTEVARS) {
                         SCLogError("too many bytevars registered");
                         goto error;
                     }
index ae38b026ca1e6aa99cc24e8f51fde82ec71a17b8..4f3834087f17ed89a14d5ee94cff984c253ba371 100644 (file)
@@ -34,9 +34,9 @@ typedef struct DetectLuaThreadData {
     int alproto;
 } DetectLuaThreadData;
 
-#define DETECT_LUAJIT_MAX_FLOWVARS  15
-#define DETECT_LUAJIT_MAX_FLOWINTS  15
-#define DETECT_LUAJIT_MAX_BYTEVARS  15
+#define DETECT_LUA_MAX_FLOWVARS 15
+#define DETECT_LUA_MAX_FLOWINTS 15
+#define DETECT_LUA_MAX_BYTEVARS 15
 
 typedef struct DetectLuaData {
     int thread_ctx_id;
@@ -45,12 +45,12 @@ typedef struct DetectLuaData {
     uint32_t flags;
     AppProto alproto;
     char *buffername; /* buffer name in case of a single buffer */
-    uint32_t flowint[DETECT_LUAJIT_MAX_FLOWINTS];
+    uint32_t flowint[DETECT_LUA_MAX_FLOWINTS];
     uint16_t flowints;
     uint16_t flowvars;
-    uint32_t flowvar[DETECT_LUAJIT_MAX_FLOWVARS];
+    uint32_t flowvar[DETECT_LUA_MAX_FLOWVARS];
     uint16_t bytevars;
-    uint32_t bytevar[DETECT_LUAJIT_MAX_BYTEVARS];
+    uint32_t bytevar[DETECT_LUA_MAX_BYTEVARS];
     uint32_t sid;
     uint32_t rev;
     uint32_t gid;