suricata
detect-lua.h
Go to the documentation of this file.
1 /* Copyright (C) 2007-2022 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * \file
20  *
21  * \author Victor Julien <victor@inliniac.net>
22  */
23 
24 #ifndef SURICATA_DETECT_LUA_H
25 #define SURICATA_DETECT_LUA_H
26 
27 #include "util-lua.h"
28 #include "util-lua-sandbox.h"
29 
30 typedef struct DetectLuaThreadData {
32  uint32_t flags;
33  int alproto;
35 
36 #define DETECT_LUA_MAX_FLOWVARS 15
37 #define DETECT_LUA_MAX_FLOWINTS 15
38 #define DETECT_LUA_MAX_BYTEVARS 15
39 
40 typedef struct DetectLuaData {
42  int negated;
43  char *filename;
44  uint32_t flags;
46  char *buffername; /* buffer name in case of a single buffer */
48  uint16_t flowints;
49  uint16_t flowvars;
51  uint16_t bytevars;
53  uint32_t sid;
54  uint32_t rev;
55  uint32_t gid;
56  uint64_t alloc_limit;
60 
61 /* prototypes */
62 void DetectLuaRegister (void);
64  const Signature *s, const SigMatchData *smd,
65  const uint8_t *buffer, uint32_t buffer_len, uint32_t offset,
66  Flow *f);
67 
69 
70 #endif /* SURICATA_DETECT_LUA_H */
DetectLuaData::bytevars
uint16_t bytevars
Definition: detect-lua.h:51
DetectLuaData
Definition: detect-lua.h:40
offset
uint64_t offset
Definition: util-streaming-buffer.h:0
DetectLuaData::flags
uint32_t flags
Definition: detect-lua.h:44
util-lua.h
AppProto
uint16_t AppProto
Definition: app-layer-protos.h:81
Flow_
Flow data structure.
Definition: flow.h:356
DetectLuaData::allow_restricted_functions
int allow_restricted_functions
Definition: detect-lua.h:58
DetectLuaData::sid
uint32_t sid
Definition: detect-lua.h:53
DETECT_LUA_MAX_FLOWVARS
#define DETECT_LUA_MAX_FLOWVARS
Definition: detect-lua.h:36
DetectLuaPostSetup
void DetectLuaPostSetup(Signature *s)
post-sig parse function to set the sid,rev,gid into the ctx, as this isn't available yet during parsi...
Definition: detect-lua.c:1021
DetectLuaData
struct DetectLuaData DetectLuaData
DetectLuaData::flowvar
uint32_t flowvar[DETECT_LUA_MAX_FLOWVARS]
Definition: detect-lua.h:50
DetectLuaData::gid
uint32_t gid
Definition: detect-lua.h:55
SigMatchData_
Data needed for Match()
Definition: detect.h:358
DetectLuaThreadData::flags
uint32_t flags
Definition: detect-lua.h:32
DetectLuaThreadData::luastate
lua_State * luastate
Definition: detect-lua.h:31
lua_State
struct lua_State lua_State
Definition: suricata-common.h:506
DetectLuaMatchBuffer
int DetectLuaMatchBuffer(DetectEngineThreadCtx *det_ctx, const Signature *s, const SigMatchData *smd, const uint8_t *buffer, uint32_t buffer_len, uint32_t offset, Flow *f)
Definition: detect-lua.c:273
DetectLuaData::buffername
char * buffername
Definition: detect-lua.h:46
DetectLuaData::negated
int negated
Definition: detect-lua.h:42
DetectEngineThreadCtx_
Definition: detect.h:1093
DetectLuaData::thread_ctx_id
int thread_ctx_id
Definition: detect-lua.h:41
DetectLuaData::instruction_limit
uint64_t instruction_limit
Definition: detect-lua.h:57
DETECT_LUA_MAX_BYTEVARS
#define DETECT_LUA_MAX_BYTEVARS
Definition: detect-lua.h:38
DetectLuaData::alproto
AppProto alproto
Definition: detect-lua.h:45
DETECT_LUA_MAX_FLOWINTS
#define DETECT_LUA_MAX_FLOWINTS
Definition: detect-lua.h:37
DetectLuaData::bytevar
uint32_t bytevar[DETECT_LUA_MAX_BYTEVARS]
Definition: detect-lua.h:52
DetectLuaData::alloc_limit
uint64_t alloc_limit
Definition: detect-lua.h:56
DetectLuaData::flowints
uint16_t flowints
Definition: detect-lua.h:48
DetectLuaData::flowint
uint32_t flowint[DETECT_LUA_MAX_FLOWINTS]
Definition: detect-lua.h:47
DetectLuaThreadData
Definition: detect-lua.h:30
DetectLuaData::rev
uint32_t rev
Definition: detect-lua.h:54
util-lua-sandbox.h
DetectLuaData::flowvars
uint16_t flowvars
Definition: detect-lua.h:49
Signature_
Signature container.
Definition: detect.h:601
DetectLuaThreadData
struct DetectLuaThreadData DetectLuaThreadData
DetectLuaData::filename
char * filename
Definition: detect-lua.h:43
DetectLuaRegister
void DetectLuaRegister(void)
Registration function for keyword: lua.
Definition: detect-lua.c:78
DetectLuaThreadData::alproto
int alproto
Definition: detect-lua.h:33