|
suricata
|
#include "suricata-common.h"#include "detect.h"#include "pkt-var.h"#include "conf.h"#include "threads.h"#include "threadvars.h"#include "tm-threads.h"#include "util-print.h"#include "util-debug.h"#include "output.h"#include "app-layer-htp.h"#include "app-layer.h"#include "app-layer-parser.h"#include "util-privs.h"#include "util-buffer.h"#include "util-proto-name.h"#include "util-logopenfile.h"#include "lua.h"#include "lualib.h"#include "lauxlib.h"#include "util-lua.h"#include "util-lua-sandbox.h"#include "detect-lua-extensions.h"
Go to the source code of this file.
Data Structures | |
| struct | SCLuaRegValue_ |
Typedefs | |
| typedef struct SCLuaRegValue_ | SCLuaRegValue |
Functions | |
| lua_State * | LuaGetState (void) |
| void | LuaReturnState (lua_State *s) |
| ThreadVars * | LuaStateGetThreadVars (lua_State *luastate) |
| get tv pointer from the lua state More... | |
| void | LuaStateSetThreadVars (lua_State *luastate, ThreadVars *tv) |
| void | LuaStateSetInvocationGen (lua_State *luastate, uint64_t *gen) |
| publish the state's invocation counter (once, at state init) More... | |
| uint64_t | LuaStateGetInvocationGen (lua_State *luastate) |
| get the current invocation generation for this state More... | |
| Packet * | LuaStateGetPacket (lua_State *luastate) |
| get packet pointer from the lua state More... | |
| void | LuaStateSetPacket (lua_State *luastate, Packet *p) |
| void * | LuaStateGetTX (lua_State *luastate) |
| get tx pointer from the lua state More... | |
| uint64_t | LuaStateGetTxId (lua_State *luastate) |
| get tx id from the lua state More... | |
| void | LuaStateSetTX (lua_State *luastate, void *txptr, const uint64_t tx_id) |
| Flow * | LuaStateGetFlow (lua_State *luastate) |
| get flow pointer from lua state More... | |
| void | LuaStateSetFlow (lua_State *luastate, Flow *f) |
| set a flow pointer in the lua state More... | |
| PacketAlert * | LuaStateGetPacketAlert (lua_State *luastate) |
| get packet alert pointer from the lua state More... | |
| void | LuaStateSetPacketAlert (lua_State *luastate, PacketAlert *pa) |
| Signature * | LuaStateGetSignature (lua_State *luastate) |
| get signature pointer from the lua state More... | |
| void | LuaStateSetSignature (lua_State *luastate, const Signature *s) |
| File * | LuaStateGetFile (lua_State *luastate) |
| get file pointer from the lua state More... | |
| void | LuaStateSetFile (lua_State *luastate, File *file) |
| DetectEngineThreadCtx * | LuaStateGetDetCtx (lua_State *luastate) |
| get DetectEngineThreadCtx pointer from the lua state More... | |
| void | LuaStateSetDetCtx (lua_State *luastate, DetectEngineThreadCtx *det_ctx) |
| DetectLuaData * | LuaStateGetDetectLuaData (lua_State *luastate) |
| get the per-rule DetectLuaData More... | |
| void | LuaStateSetDetectLuaData (lua_State *luastate, DetectLuaData *ld) |
| int | LuaStateGetDirection (lua_State *luastate) |
| get packet pointer from the lua state More... | |
| void | LuaStateSetDirection (lua_State *luastate, int direction) |
| void | LuaPrintStack (lua_State *state) |
| dump stack from lua state to screen More... | |
| int | LuaPushStringBuffer (lua_State *luastate, const uint8_t *input, size_t input_len) |
| int | LuaPushInteger (lua_State *luastate, lua_Integer n) |
Variables | |
| const char | lua_ext_key_tv [] = "suricata:lua:tv:ptr" |
| const char | lua_ext_key_invocation_gen [] = "suricata:lua:invocation:gen" |
| const char | lua_ext_key_tx [] = "suricata:lua:tx:ptr" |
| const char | lua_ext_key_tx_id [] = "suricata:lua:tx_id" |
| const char | lua_ext_key_p [] = "suricata:lua:pkt:ptr" |
| const char | lua_ext_key_flow [] = "suricata:lua:flow:ptr" |
| const char | lua_ext_key_direction [] = "suricata:lua:direction" |
| const char | lua_ext_key_pa [] = "suricata:lua:pkt:alert:ptr" |
| const char | lua_ext_key_s [] = "suricata:lua:signature:ptr" |
| const char | lua_ext_key_file [] = "suricata:lua:file:ptr" |
| const char | lua_ext_key_det_ctx [] = "suricata:lua:det_ctx:ptr" |
Common function for Lua
Definition in file util-lua.c.
| typedef struct SCLuaRegValue_ SCLuaRegValue |
| anonymous enum |
Definition at line 110 of file util-lua.c.
| lua_State* LuaGetState | ( | void | ) |
Definition at line 56 of file util-lua.c.
| void LuaPrintStack | ( | lua_State * | state | ) |
| int LuaPushInteger | ( | lua_State * | luastate, |
| lua_Integer | n | ||
| ) |
Definition at line 393 of file util-lua.c.
| int LuaPushStringBuffer | ( | lua_State * | luastate, |
| const uint8_t * | input, | ||
| size_t | input_len | ||
| ) |
Definition at line 380 of file util-lua.c.
Referenced by DetectLuaMatchBuffer(), DNP3PushPoint(), and LuaPushTableKeyValueArray().

| void LuaReturnState | ( | lua_State * | s | ) |
Definition at line 63 of file util-lua.c.
| DetectEngineThreadCtx* LuaStateGetDetCtx | ( | lua_State * | luastate | ) |
get DetectEngineThreadCtx pointer from the lua state
get detect engine thread context pointer from the lua state
Definition at line 307 of file util-lua.c.
| DetectLuaData* LuaStateGetDetectLuaData | ( | lua_State * | luastate | ) |
get the per-rule DetectLuaData
get the per-rule DetectLuaData, NULL when the state has none (output/transform states)
Definition at line 319 of file util-lua.c.
| int LuaStateGetDirection | ( | lua_State * | luastate | ) |
get packet pointer from the lua state
Definition at line 330 of file util-lua.c.
References lua_ext_key_direction.
get file pointer from the lua state
Definition at line 296 of file util-lua.c.
get flow pointer from lua state
| f | flow pointer or NULL if it was not set |
Definition at line 260 of file util-lua.c.
References f.
Referenced by LuaStateNeedProto(), SCLuaTxRefInit(), and SCLuaTxRefResolve().

| uint64_t LuaStateGetInvocationGen | ( | lua_State * | luastate | ) |
get the current invocation generation for this state
current invocation generation; 0 when the state has none
Definition at line 216 of file util-lua.c.
get packet pointer from the lua state
Definition at line 223 of file util-lua.c.
| PacketAlert* LuaStateGetPacketAlert | ( | lua_State * | luastate | ) |
get packet alert pointer from the lua state
Definition at line 274 of file util-lua.c.
get signature pointer from the lua state
Definition at line 285 of file util-lua.c.
| ThreadVars* LuaStateGetThreadVars | ( | lua_State * | luastate | ) |
get tv pointer from the lua state
Definition at line 188 of file util-lua.c.
| void* LuaStateGetTX | ( | lua_State * | luastate | ) |
get tx pointer from the lua state
Definition at line 234 of file util-lua.c.
| uint64_t LuaStateGetTxId | ( | lua_State * | luastate | ) |
get tx id from the lua state
Definition at line 240 of file util-lua.c.
References lua_ext_key_tx_id.
| void LuaStateSetDetCtx | ( | lua_State * | luastate, |
| DetectEngineThreadCtx * | det_ctx | ||
| ) |
Definition at line 313 of file util-lua.c.
Referenced by LuaExtensionsMatchSetup().

| void LuaStateSetDetectLuaData | ( | lua_State * | luastate, |
| DetectLuaData * | ld | ||
| ) |
Definition at line 324 of file util-lua.c.
| void LuaStateSetDirection | ( | lua_State * | luastate, |
| int | direction | ||
| ) |
Definition at line 339 of file util-lua.c.
References lua_ext_key_direction.
Referenced by LuaExtensionsMatchSetup().

Definition at line 301 of file util-lua.c.
set a flow pointer in the lua state
| f | flow pointer |
Definition at line 267 of file util-lua.c.
Referenced by LuaExtensionsMatchSetup().

| void LuaStateSetInvocationGen | ( | lua_State * | luastate, |
| uint64_t * | gen | ||
| ) |
publish the state's invocation counter (once, at state init)
Definition at line 210 of file util-lua.c.
Definition at line 228 of file util-lua.c.
Referenced by LuaExtensionsMatchSetup().

| void LuaStateSetPacketAlert | ( | lua_State * | luastate, |
| PacketAlert * | pa | ||
| ) |
Definition at line 279 of file util-lua.c.
Definition at line 290 of file util-lua.c.
Referenced by LuaExtensionsMatchSetup().

| void LuaStateSetThreadVars | ( | lua_State * | luastate, |
| ThreadVars * | tv | ||
| ) |
Definition at line 193 of file util-lua.c.
Referenced by LuaExtensionsMatchSetup().

| void LuaStateSetTX | ( | lua_State * | luastate, |
| void * | txptr, | ||
| const uint64_t | tx_id | ||
| ) |
Definition at line 248 of file util-lua.c.
Referenced by LuaExtensionsMatchSetup().

| const char lua_ext_key_det_ctx[] = "suricata:lua:det_ctx:ptr" |
Definition at line 96 of file util-lua.c.
| const char lua_ext_key_direction[] = "suricata:lua:direction" |
Definition at line 87 of file util-lua.c.
Referenced by LuaStateGetDirection(), and LuaStateSetDirection().
| const char lua_ext_key_file[] = "suricata:lua:file:ptr" |
Definition at line 94 of file util-lua.c.
| const char lua_ext_key_flow[] = "suricata:lua:flow:ptr" |
Definition at line 85 of file util-lua.c.
| const char lua_ext_key_invocation_gen[] = "suricata:lua:invocation:gen" |
Definition at line 77 of file util-lua.c.
| const char lua_ext_key_p[] = "suricata:lua:pkt:ptr" |
Definition at line 83 of file util-lua.c.
| const char lua_ext_key_pa[] = "suricata:lua:pkt:alert:ptr" |
Definition at line 90 of file util-lua.c.
| const char lua_ext_key_s[] = "suricata:lua:signature:ptr" |
Definition at line 92 of file util-lua.c.
| const char lua_ext_key_tv[] = "suricata:lua:tv:ptr" |
Definition at line 75 of file util-lua.c.
| const char lua_ext_key_tx[] = "suricata:lua:tx:ptr" |
Definition at line 79 of file util-lua.c.
| const char lua_ext_key_tx_id[] = "suricata:lua:tx_id" |
Definition at line 81 of file util-lua.c.
Referenced by LuaStateGetTxId().