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
34
35#define DETECT_LUA_MAX_FLOWVARS 15
36#define DETECT_LUA_MAX_FLOWINTS 15
37#define DETECT_LUA_MAX_BYTEVARS 15
38
43
60
61/* prototypes */
62void 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
68void LuaDumpStack(lua_State *state, const char *prefix);
69
70#endif /* SURICATA_DETECT_LUA_H */
#define DETECT_LUA_MAX_FLOWINTS
Definition detect-lua.h:36
struct DetectLuaDataBytevarEntry_ DetectLuaDataBytevarEntry
#define DETECT_LUA_MAX_FLOWVARS
Definition detect-lua.h:35
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:240
void LuaDumpStack(lua_State *state, const char *prefix)
dump stack from lua state to screen
Definition detect-lua.c:127
void DetectLuaRegister(void)
Registration function for keyword: lua.
Definition detect-lua.c:83
#define DETECT_LUA_MAX_BYTEVARS
Definition detect-lua.h:37
uint32_t flags
Definition detect-lua.h:48
uint64_t alloc_limit
Definition detect-lua.h:56
uint16_t flowvars
Definition detect-lua.h:52
uint64_t instruction_limit
Definition detect-lua.h:57
uint32_t flowint[DETECT_LUA_MAX_FLOWINTS]
Definition detect-lua.h:50
int allow_restricted_functions
Definition detect-lua.h:58
uint32_t flowvar[DETECT_LUA_MAX_FLOWVARS]
Definition detect-lua.h:53
DetectLuaDataBytevarEntry bytevar[DETECT_LUA_MAX_BYTEVARS]
Definition detect-lua.h:55
char * filename
Definition detect-lua.h:47
uint16_t flowints
Definition detect-lua.h:51
char * buffername
Definition detect-lua.h:49
uint16_t bytevars
Definition detect-lua.h:54
lua_State * luastate
Definition detect-lua.h:31
Flow data structure.
Definition flow.h:356
Data needed for Match()
Definition detect.h:365
Signature container.
Definition detect.h:668
struct lua_State lua_State
uint64_t offset