|
suricata
|
#include "app-layer-protos.h"

Go to the source code of this file.
Data Structures | |
| struct | SCLuaUserDataHeader_ |
| struct | SCLuaTxRef_ |
Macros | |
| #define | DEFAULT_LUA_ALLOC_LIMIT 500000 |
| #define | DEFAULT_LUA_INSTRUCTION_LIMIT 500000 |
| #define | SCLUA_UD_MAGIC 0x534C5541u /* "SLUA" */ |
| #define | SCLUA_RESOLVE_TX(L, refp, txvar) |
| #define | LUA_ERROR(msg) |
Typedefs | |
| typedef struct SCLuaUserDataHeader_ | SCLuaUserDataHeader |
| typedef struct SCLuaTxRef_ | SCLuaTxRef |
Functions | |
| void | SCLuaTxRefInit (lua_State *L, SCLuaTxRef *ref, uint64_t tx_id) |
| int | SCLuaTxRefResolve (lua_State *L, const SCLuaTxRef *ref, void **tx) |
| 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 * | 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 * | SCLuaTestUserData (lua_State *L, int idx, const char *mt, uint32_t type_id) |
| int | LuaCallbackError (lua_State *luastate, const char *msg) |
| const char * | LuaGetStringArgument (lua_State *luastate, int argc) |
| 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) |
Definition in file util-lua-common.h.
| #define DEFAULT_LUA_ALLOC_LIMIT 500000 |
Definition at line 30 of file util-lua-common.h.
| #define DEFAULT_LUA_INSTRUCTION_LIMIT 500000 |
Definition at line 31 of file util-lua-common.h.
| #define LUA_ERROR | ( | msg | ) |
Definition at line 196 of file util-lua-common.h.
| #define SCLUA_RESOLVE_TX | ( | L, | |
| refp, | |||
| txvar | |||
| ) |
Definition at line 129 of file util-lua-common.h.
| #define SCLUA_UD_MAGIC 0x534C5541u /* "SLUA" */ |
Definition at line 42 of file util-lua-common.h.
| typedef struct SCLuaTxRef_ SCLuaTxRef |
| typedef struct SCLuaUserDataHeader_ SCLuaUserDataHeader |
| enum SCLuaUserDataTypes |
Definition at line 48 of file util-lua-common.h.
| 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 | argc | ||
| ) |
Definition at line 225 of file util-lua-common.c.
| 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.
