|
suricata
|
#include "suricata-common.h"#include "threads.h"#include "threadvars.h"#include "output.h"#include "util-conf.h"#include "flow.h"#include "app-layer-parser.h"#include "lua.h"#include "util-lua.h"#include "util-lua-common.h"#include "string.h"#include "util-unittest.h"
Go to the source code of this file.
Functions | |
| void * | SCLuaNewUserData (lua_State *L, uint32_t type_id, size_t size) |
| void * | SCLuaCheckUserData (lua_State *L, int idx, const char *mt, uint32_t type_id) |
| void * | SCLuaTestUserData (lua_State *L, int idx, const char *mt, uint32_t type_id) |
| void * | SCLuaCheckUserDataPayload (lua_State *L, int idx, const char *mt, uint32_t type_id) |
| void * | SCLuaCheckUserDataSoft (lua_State *L, int idx, const char *mt, uint32_t type_id) |
| void | SCLuaTxRefInit (lua_State *L, SCLuaTxRef *ref, uint64_t tx_id) |
| int | SCLuaTxRefResolve (lua_State *L, const SCLuaTxRef *ref, void **tx) |
| int | LuaCallbackError (lua_State *luastate, const char *msg) |
| const char * | LuaGetStringArgument (lua_State *luastate, int idx) |
| void | LuaPushTableKeyValueInt (lua_State *luastate, const char *key, int value) |
| void | LuaPushTableKeyValueBoolean (lua_State *luastate, const char *key, bool value) |
| void | LuaPushTableKeyValueString (lua_State *luastate, const char *key, const char *value) |
| Push a key plus string value to the stack. More... | |
| 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. More... | |
| void | LuaPushTableKeyValueArray (lua_State *luastate, const char *key, const uint8_t *value, size_t len) |
| int | LuaStateNeedProto (lua_State *luastate, AppProto alproto) |
| void | SCLuaCommonRegisterTests (void) |
Common function for Lua Output
Definition in file util-lua-common.c.
| int LuaCallbackError | ( | lua_State * | luastate, |
| const char * | msg | ||
| ) |
Definition at line 218 of file util-lua-common.c.
| const char* LuaGetStringArgument | ( | lua_State * | luastate, |
| int | idx | ||
| ) |
Definition at line 225 of file util-lua-common.c.
References str.
| void LuaPushTableKeyValueArray | ( | lua_State * | luastate, |
| const char * | key, | ||
| const uint8_t * | value, | ||
| size_t | len | ||
| ) |
Definition at line 273 of file util-lua-common.c.
References len, and LuaPushStringBuffer().

| void LuaPushTableKeyValueBoolean | ( | lua_State * | luastate, |
| const char * | key, | ||
| bool | value | ||
| ) |
Definition at line 245 of file util-lua-common.c.
| void LuaPushTableKeyValueInt | ( | lua_State * | luastate, |
| const char * | key, | ||
| int | value | ||
| ) |
Definition at line 238 of file util-lua-common.c.
| 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.
Definition at line 265 of file util-lua-common.c.
References len.
| void LuaPushTableKeyValueString | ( | lua_State * | luastate, |
| const char * | key, | ||
| const char * | value | ||
| ) |
Push a key plus string value to the stack.
If value is NULL, string "(null")" will be put on the stack.
Definition at line 256 of file util-lua-common.c.
Definition at line 289 of file util-lua-common.c.
References Flow_::alproto, and LuaStateGetFlow().

| void* SCLuaCheckUserData | ( | lua_State * | L, |
| int | idx, | ||
| const char * | mt, | ||
| uint32_t | type_id | ||
| ) |
Definition at line 101 of file util-lua-common.c.
References SCLuaUserDataHeader_::magic, SCLUA_UD_MAGIC, and SCLuaUserDataHeader_::type_id.
| void* SCLuaCheckUserDataPayload | ( | lua_State * | L, |
| int | idx, | ||
| const char * | mt, | ||
| uint32_t | type_id | ||
| ) |
Definition at line 137 of file util-lua-common.c.
References SCLuaUserDataHeader_::magic, SCLUA_UD_MAGIC, and SCLuaUserDataHeader_::type_id.
Referenced by SCLuaCheckUserDataSoft().

| void* SCLuaCheckUserDataSoft | ( | lua_State * | L, |
| int | idx, | ||
| const char * | mt, | ||
| uint32_t | type_id | ||
| ) |
Definition at line 151 of file util-lua-common.c.
References SCLuaCheckUserDataPayload().

| void SCLuaCommonRegisterTests | ( | void | ) |
Definition at line 504 of file util-lua-common.c.
References UtRegisterTest().

| void* SCLuaNewUserData | ( | lua_State * | L, |
| uint32_t | type_id, | ||
| size_t | size | ||
| ) |
Definition at line 42 of file util-lua-common.c.
References SCLuaUserDataHeader_::magic, SCLUA_UD_MAGIC, and SCLuaUserDataHeader_::type_id.
| void* SCLuaTestUserData | ( | lua_State * | L, |
| int | idx, | ||
| const char * | mt, | ||
| uint32_t | type_id | ||
| ) |
Definition at line 123 of file util-lua-common.c.
| void SCLuaTxRefInit | ( | lua_State * | L, |
| SCLuaTxRef * | ref, | ||
| uint64_t | tx_id | ||
| ) |
Definition at line 164 of file util-lua-common.c.
References SCLuaTxRef_::alproto, Flow_::alproto, ALPROTO_UNKNOWN, f, SCLuaTxRef_::flow, SCLuaTxRef_::flow_hash, Flow_::flow_hash, LuaStateGetFlow(), SCTIME_SECS, SCTIME_USECS, SCLuaTxRef_::start_sec, SCLuaTxRef_::start_usec, Flow_::startts, and SCLuaTxRef_::tx_id.

| int SCLuaTxRefResolve | ( | lua_State * | L, |
| const SCLuaTxRef * | ref, | ||
| void ** | tx | ||
| ) |
Definition at line 182 of file util-lua-common.c.
References SCLuaTxRef_::alproto, Flow_::alproto, ALPROTO_UNKNOWN, Flow_::alstate, AppLayerParserGetTx(), f, SCLuaTxRef_::flow, SCLuaTxRef_::flow_hash, Flow_::flow_hash, LuaStateGetFlow(), Flow_::proto, SCTIME_SECS, SCTIME_USECS, SCLuaTxRef_::start_sec, SCLuaTxRef_::start_usec, Flow_::startts, and SCLuaTxRef_::tx_id.
