41 lua_pushnil(luastate);
42 lua_pushstring(luastate, msg);
49 if (!lua_isstring(luastate, idx))
51 const char *
str = lua_tostring(luastate, idx);
61 lua_pushstring(luastate, key);
62 lua_pushnumber(luastate, value);
63 lua_settable(luastate, -3);
68 lua_pushstring(luastate, key);
69 lua_pushboolean(luastate, value);
70 lua_settable(luastate, -3);
79 lua_pushstring(luastate, key);
80 lua_pushstring(luastate, value ? value :
"(null)");
81 lua_settable(luastate, -3);
87 lua_State *luastate,
const char *key,
const char *value,
size_t len)
89 lua_pushstring(luastate, key);
90 lua_pushlstring(luastate, value,
len);
91 lua_settable(luastate, -3);
95 lua_State *luastate,
const char *key,
const uint8_t *value,
size_t len)
97 lua_pushstring(luastate, key);
99 lua_settable(luastate, -3);
111 return (alproto == flow_alproto);
AppProto alproto
application level protocol
struct lua_State lua_State
void LuaPushTableKeyValueArray(lua_State *luastate, const char *key, const uint8_t *value, size_t len)
void LuaPushTableKeyValueString(lua_State *luastate, const char *key, const char *value)
Push a key plus string value to the stack.
void LuaPushTableKeyValueInt(lua_State *luastate, const char *key, int value)
int LuaStateNeedProto(lua_State *luastate, AppProto alproto)
void LuaPushTableKeyValueLString(lua_State *luastate, const char *key, const char *value, size_t len)
Push a key plus string value with length to the stack.
const char * LuaGetStringArgument(lua_State *luastate, int idx)
int LuaCallbackError(lua_State *luastate, const char *msg)
void LuaPushTableKeyValueBoolean(lua_State *luastate, const char *key, bool value)
int LuaPushStringBuffer(lua_State *luastate, const uint8_t *input, size_t input_len)
Flow * LuaStateGetFlow(lua_State *luastate)
get flow pointer from lua state