suricata
detect-lua.h
Go to the documentation of this file.
1 /* Copyright (C) 2007-2021 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 __DETECT_LUA_H__
25 #define __DETECT_LUA_H__
26 
27 #ifdef HAVE_LUA
28 
29 #include "util-lua.h"
30 
31 typedef struct DetectLuaThreadData {
32  lua_State *luastate;
33  uint32_t flags;
34  int alproto;
35 } DetectLuaThreadData;
36 
37 #define DETECT_LUAJIT_MAX_FLOWVARS 15
38 #define DETECT_LUAJIT_MAX_FLOWINTS 15
39 
40 typedef struct DetectLuaData {
41  int thread_ctx_id;
42  int negated;
43  char *filename;
44  uint32_t flags;
45  AppProto alproto;
46  char *buffername; /* buffer name in case of a single buffer */
47  uint32_t flowint[DETECT_LUAJIT_MAX_FLOWINTS];
48  uint16_t flowints;
49  uint16_t flowvars;
50  uint32_t flowvar[DETECT_LUAJIT_MAX_FLOWVARS];
51  uint32_t sid;
52  uint32_t rev;
53  uint32_t gid;
54 } DetectLuaData;
55 
56 #endif /* HAVE_LUA */
57 
58 /* prototypes */
59 void DetectLuaRegister (void);
61  const Signature *s, const SigMatchData *smd,
62  const uint8_t *buffer, uint32_t buffer_len, uint32_t offset,
63  Flow *f);
64 
66 
67 #endif /* __DETECT_LUA_H__ */
lua_State
void lua_State
Definition: util-lua.h:31
offset
uint64_t offset
Definition: util-streaming-buffer.h:0
util-lua.h
AppProto
uint16_t AppProto
Definition: app-layer-protos.h:80
Flow_
Flow data structure.
Definition: flow.h:356
DetectLuaPostSetup
void DetectLuaPostSetup(Signature *s)
SigMatchData_
Data needed for Match()
Definition: detect.h:332
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)
DetectEngineThreadCtx_
Definition: detect.h:1043
flags
uint8_t flags
Definition: decode-gre.h:0
Signature_
Signature container.
Definition: detect.h:549
DetectLuaRegister
void DetectLuaRegister(void)
Registration function for keyword: lua.
Definition: detect-lua.c:75