suricata
util-lua.h File Reference
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
#include "threadvars.h"
#include "detect.h"
Include dependency graph for util-lua.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  LuaStreamingBuffer_
 

Typedefs

typedef struct LuaStreamingBuffer_ LuaStreamingBuffer
 

Functions

lua_StateLuaGetState (void)
 
void LuaReturnState (lua_State *s)
 
ThreadVarsLuaStateGetThreadVars (lua_State *luastate)
 get tv pointer from the lua state More...
 
PacketLuaStateGetPacket (lua_State *luastate)
 get packet pointer from the lua state More...
 
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...
 
FlowLuaStateGetFlow (lua_State *luastate)
 get flow pointer from lua state More...
 
PacketAlertLuaStateGetPacketAlert (lua_State *luastate)
 get packet alert pointer from the lua state More...
 
SignatureLuaStateGetSignature (lua_State *luastate)
 get signature pointer from the lua state More...
 
FileLuaStateGetFile (lua_State *luastate)
 get file pointer from the lua state More...
 
DetectEngineThreadCtxLuaStateGetDetCtx (lua_State *luastate)
 get detect engine thread context pointer from the lua state More...
 
LuaStreamingBufferLuaStateGetStreamingBuffer (lua_State *luastate)
 
int LuaStateGetDirection (lua_State *luastate)
 get packet pointer from the lua state More...
 
void LuaStateSetPacket (lua_State *luastate, Packet *p)
 
void LuaStateSetTX (lua_State *luastate, void *tx, const uint64_t tx_id)
 
void LuaStateSetFlow (lua_State *luastate, Flow *f)
 set a flow pointer in the lua state More...
 
void LuaStateSetPacketAlert (lua_State *luastate, PacketAlert *pa)
 
void LuaStateSetSignature (lua_State *luastate, const Signature *s)
 
void LuaStateSetFile (lua_State *luastate, File *file)
 
void LuaStateSetDetCtx (lua_State *luastate, DetectEngineThreadCtx *det_ctx)
 
void LuaStateSetThreadVars (lua_State *luastate, ThreadVars *tv)
 
void LuaStateSetStreamingBuffer (lua_State *luastate, LuaStreamingBuffer *b)
 
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)
 

Detailed Description

Author
Victor Julien victo.nosp@m.r@in.nosp@m.linia.nosp@m.c.ne.nosp@m.t

Definition in file util-lua.h.

Typedef Documentation

◆ LuaStreamingBuffer

Function Documentation

◆ LuaGetState()

lua_State* LuaGetState ( void  )

Definition at line 57 of file util-lua.c.

◆ LuaPrintStack()

void LuaPrintStack ( lua_State state)

dump stack from lua state to screen

Definition at line 286 of file util-lua.c.

References type.

◆ LuaPushInteger()

int LuaPushInteger ( lua_State luastate,
lua_Integer  n 
)

Definition at line 340 of file util-lua.c.

◆ LuaPushStringBuffer()

int LuaPushStringBuffer ( lua_State luastate,
const uint8_t *  input,
size_t  input_len 
)

Definition at line 319 of file util-lua.c.

Referenced by DetectLuaMatchBuffer(), DNP3PushPoint(), and LuaPushTableKeyValueArray().

Here is the caller graph for this function:

◆ LuaReturnState()

void LuaReturnState ( lua_State s)

Definition at line 64 of file util-lua.c.

◆ LuaStateGetDetCtx()

DetectEngineThreadCtx* LuaStateGetDetCtx ( lua_State luastate)

get detect engine thread context pointer from the lua state

get detect engine thread context pointer from the lua state

Definition at line 239 of file util-lua.c.

References lua_ext_key_det_ctx.

◆ LuaStateGetDirection()

int LuaStateGetDirection ( lua_State luastate)

get packet pointer from the lua state

Definition at line 270 of file util-lua.c.

References lua_ext_key_direction.

◆ LuaStateGetFile()

File* LuaStateGetFile ( lua_State luastate)

get file pointer from the lua state

Definition at line 223 of file util-lua.c.

References lua_ext_key_file.

◆ LuaStateGetFlow()

Flow* LuaStateGetFlow ( lua_State luastate)

get flow pointer from lua state

Return values
fflow pointer or NULL if it was not set

Definition at line 161 of file util-lua.c.

References lua_ext_key_flow, and lua_ext_key_flow_lock_hint.

Referenced by LuaStateNeedProto().

Here is the caller graph for this function:

◆ LuaStateGetPacket()

Packet* LuaStateGetPacket ( lua_State luastate)

get packet pointer from the lua state

Definition at line 118 of file util-lua.c.

References lua_ext_key_p.

◆ LuaStateGetPacketAlert()

PacketAlert* LuaStateGetPacketAlert ( lua_State luastate)

get packet alert pointer from the lua state

Definition at line 191 of file util-lua.c.

References lua_ext_key_pa.

◆ LuaStateGetSignature()

Signature* LuaStateGetSignature ( lua_State luastate)

get signature pointer from the lua state

Definition at line 207 of file util-lua.c.

References lua_ext_key_s.

◆ LuaStateGetStreamingBuffer()

LuaStreamingBuffer* LuaStateGetStreamingBuffer ( lua_State luastate)

Definition at line 254 of file util-lua.c.

References lua_ext_key_streaming_buffer.

◆ LuaStateGetThreadVars()

ThreadVars* LuaStateGetThreadVars ( lua_State luastate)

get tv pointer from the lua state

Definition at line 102 of file util-lua.c.

References lua_ext_key_tv, and tv.

◆ LuaStateGetTX()

void* LuaStateGetTX ( lua_State luastate)

get tx pointer from the lua state

Definition at line 134 of file util-lua.c.

References lua_ext_key_tx.

◆ LuaStateGetTxId()

uint64_t LuaStateGetTxId ( lua_State luastate)

get tx id from the lua state

Definition at line 143 of file util-lua.c.

References lua_ext_key_tx_id.

◆ LuaStateSetDetCtx()

void LuaStateSetDetCtx ( lua_State luastate,
DetectEngineThreadCtx det_ctx 
)

Definition at line 247 of file util-lua.c.

References lua_ext_key_det_ctx.

◆ LuaStateSetDirection()

void LuaStateSetDirection ( lua_State luastate,
int  direction 
)

Definition at line 278 of file util-lua.c.

References lua_ext_key_direction.

◆ LuaStateSetFile()

void LuaStateSetFile ( lua_State luastate,
File file 
)

Definition at line 231 of file util-lua.c.

References lua_ext_key_file.

◆ LuaStateSetFlow()

void LuaStateSetFlow ( lua_State luastate,
Flow f 
)

set a flow pointer in the lua state

Parameters
fflow pointer

Definition at line 176 of file util-lua.c.

References lua_ext_key_flow, and lua_ext_key_flow_lock_hint.

◆ LuaStateSetPacket()

void LuaStateSetPacket ( lua_State luastate,
Packet p 
)

Definition at line 126 of file util-lua.c.

References lua_ext_key_p.

◆ LuaStateSetPacketAlert()

void LuaStateSetPacketAlert ( lua_State luastate,
PacketAlert pa 
)

Definition at line 199 of file util-lua.c.

References lua_ext_key_pa.

◆ LuaStateSetSignature()

void LuaStateSetSignature ( lua_State luastate,
const Signature s 
)

Definition at line 215 of file util-lua.c.

References lua_ext_key_s.

◆ LuaStateSetStreamingBuffer()

void LuaStateSetStreamingBuffer ( lua_State luastate,
LuaStreamingBuffer b 
)

Definition at line 262 of file util-lua.c.

References lua_ext_key_streaming_buffer.

◆ LuaStateSetThreadVars()

void LuaStateSetThreadVars ( lua_State luastate,
ThreadVars tv 
)

Definition at line 110 of file util-lua.c.

References lua_ext_key_tv, and tv.

◆ LuaStateSetTX()

void LuaStateSetTX ( lua_State luastate,
void *  tx,
const uint64_t  tx_id 
)

Definition at line 150 of file util-lua.c.

References lua_ext_key_tx, and lua_ext_key_tx_id.