suricata
detect-engine-uint.h
Go to the documentation of this file.
1 /* Copyright (C) 2020 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 Philippe Antoine <p.antoine@catenacyber.fr>
22  */
23 
24 #ifndef __DETECT_ENGINE_UINT_H
25 #define __DETECT_ENGINE_UINT_H
26 
28 
29 typedef enum {
37 
38 typedef struct DetectU32Data_ {
39  uint32_t arg1; /**< first arg value in the signature*/
40  uint32_t arg2; /**< second arg value in the signature, in case of range
41  operator*/
42  DetectUintMode mode; /**< operator used in the signature */
44 
45 int DetectU32Match(const uint32_t parg, const DetectU32Data *du32);
46 DetectU32Data *DetectU32Parse (const char *u32str);
49 
50 void DetectUintRegister(void);
51 
52 typedef struct DetectU8Data_ {
53  uint8_t arg1; /**< first arg value in the signature*/
54  uint8_t arg2; /**< second arg value in the signature, in case of range
55  operator*/
56  DetectUintMode mode; /**< operator used in the signature */
58 
59 int DetectU8Match(const uint8_t parg, const DetectU8Data *du8);
60 DetectU8Data *DetectU8Parse (const char *u8str);
61 
62 #endif /* __DETECT_UTIL_UINT_H */
PrefilterPacketU32Set
void PrefilterPacketU32Set(PrefilterPacketHeaderValue *v, void *smctx)
Definition: detect-engine-uint.c:263
DetectU8Data_::arg1
uint8_t arg1
Definition: detect-engine-uint.h:53
DetectU32Data
struct DetectU32Data_ DetectU32Data
DETECT_UINT_LTE
@ DETECT_UINT_LTE
Definition: detect-engine-uint.h:34
PREFILTER_U8HASH_MODE_RA
#define PREFILTER_U8HASH_MODE_RA
Definition: detect-engine-prefilter-common.h:57
DetectU8Data_::mode
DetectUintMode mode
Definition: detect-engine-uint.h:56
DetectU8Data_
Definition: detect-engine-uint.h:52
DetectU32Parse
DetectU32Data * DetectU32Parse(const char *u32str)
This function is used to parse u32 options passed via some u32 keyword.
Definition: detect-engine-uint.c:115
DETECT_UINT_GTE
@ DETECT_UINT_GTE
Definition: detect-engine-uint.h:35
DetectU8Match
int DetectU8Match(const uint8_t parg, const DetectU8Data *du8)
Definition: detect-engine-uint.c:294
DETECT_UINT_EQ
@ DETECT_UINT_EQ
Definition: detect-engine-uint.h:31
DetectUintMode
DetectUintMode
Definition: detect-engine-uint.h:29
DETECT_UINT_LT
@ DETECT_UINT_LT
Definition: detect-engine-uint.h:30
DetectU8Data
struct DetectU8Data_ DetectU8Data
DetectU32Match
int DetectU32Match(const uint32_t parg, const DetectU32Data *du32)
Definition: detect-engine-uint.c:39
PrefilterPacketU32Compare
bool PrefilterPacketU32Compare(PrefilterPacketHeaderValue v, void *smctx)
Definition: detect-engine-uint.c:272
PREFILTER_U8HASH_MODE_EQ
#define PREFILTER_U8HASH_MODE_EQ
Definition: detect-engine-prefilter-common.h:54
DetectU32Data_::arg2
uint32_t arg2
Definition: detect-engine-uint.h:40
DetectU32Data_::mode
DetectUintMode mode
Definition: detect-engine-uint.h:42
DetectU8Data_::arg2
uint8_t arg2
Definition: detect-engine-uint.h:54
DetectUintRegister
void DetectUintRegister(void)
Definition: detect-engine-uint.c:284
DetectU32Data_
Definition: detect-engine-uint.h:38
DETECT_UINT_GT
@ DETECT_UINT_GT
Definition: detect-engine-uint.h:32
PREFILTER_U8HASH_MODE_GT
#define PREFILTER_U8HASH_MODE_GT
Definition: detect-engine-prefilter-common.h:56
DETECT_UINT_RA
@ DETECT_UINT_RA
Definition: detect-engine-uint.h:33
PrefilterPacketHeaderValue
Definition: detect-engine-prefilter-common.h:21
detect-engine-prefilter-common.h
DetectU32Data_::arg1
uint32_t arg1
Definition: detect-engine-uint.h:39
DetectU8Parse
DetectU8Data * DetectU8Parse(const char *u8str)
This function is used to parse u8 options passed via some u8 keyword.
Definition: detect-engine-uint.c:370
PREFILTER_U8HASH_MODE_LT
#define PREFILTER_U8HASH_MODE_LT
Definition: detect-engine-prefilter-common.h:55