suricata
detect-flowint.h
Go to the documentation of this file.
1 /* Copyright (C) 2007-2014 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 Pablo Rincon <pablo.rincon.crespo@gmail.com>
22  */
23 
24 #ifndef __DETECT_FLOWINT_H__
25 #define __DETECT_FLOWINT_H__
26 
27 /** Flowint operations allowed */
28 enum {
29  /** Changing integer values */
33 
34  /** Comparing integer values */
41  /** Checking if a var is set (keyword isset/notset)*/
44 
46 };
47 
48 /** The target can be a value, or another variable arleady declared */
49 enum {
54 };
55 
56 /** If the target is another var, get the name and the idx */
57 typedef struct TargetVar_ {
58  char *name;
59 } TargetVar;
60 
61 /** Context data for flowint vars */
62 typedef struct DetectFlowintData_ {
63  /* This is the main var we are going to use
64  * against the target */
65  char *name;
66  /* Internal id of the var */
67  uint32_t idx;
68 
69  /* The modifier/operation/condition we are
70  * going to execute */
71  uint8_t modifier;
72  uint8_t targettype;
73 
74  union {
75  /* the target value */
76  uint32_t value;
77  /* or the target var */
79  } target;
81 
82 /* prototypes */
83 void DetectFlowintRegister (void);
84 
85 #endif /* __DETECT_FLOWINT_H__ */
86 
FLOWINT_MODIFIER_LT
@ FLOWINT_MODIFIER_LT
Definition: detect-flowint.h:35
FLOWINT_TARGET_VAL
@ FLOWINT_TARGET_VAL
Definition: detect-flowint.h:50
DetectFlowintData_::targettype
uint8_t targettype
Definition: detect-flowint.h:72
FLOWINT_MODIFIER_GE
@ FLOWINT_MODIFIER_GE
Definition: detect-flowint.h:39
DetectFlowintData_
Definition: detect-flowint.h:62
FLOWINT_TARGET_SELF
@ FLOWINT_TARGET_SELF
Definition: detect-flowint.h:52
DetectFlowintData_::idx
uint32_t idx
Definition: detect-flowint.h:67
DetectFlowintData_::target
union DetectFlowintData_::@79 target
FLOWINT_MODIFIER_EQ
@ FLOWINT_MODIFIER_EQ
Definition: detect-flowint.h:37
FLOWINT_MODIFIER_LE
@ FLOWINT_MODIFIER_LE
Definition: detect-flowint.h:36
FLOWINT_MODIFIER_NE
@ FLOWINT_MODIFIER_NE
Definition: detect-flowint.h:38
FLOWINT_MODIFIER_SUB
@ FLOWINT_MODIFIER_SUB
Definition: detect-flowint.h:32
FLOWINT_MODIFIER_UNKNOWN
@ FLOWINT_MODIFIER_UNKNOWN
Definition: detect-flowint.h:45
DetectFlowintData_::modifier
uint8_t modifier
Definition: detect-flowint.h:71
FLOWINT_MODIFIER_ISSET
@ FLOWINT_MODIFIER_ISSET
Definition: detect-flowint.h:42
FLOWINT_MODIFIER_GT
@ FLOWINT_MODIFIER_GT
Definition: detect-flowint.h:40
DetectFlowintData
struct DetectFlowintData_ DetectFlowintData
FLOWINT_TARGET_VAR
@ FLOWINT_TARGET_VAR
Definition: detect-flowint.h:51
FLOWINT_MODIFIER_NOTSET
@ FLOWINT_MODIFIER_NOTSET
Definition: detect-flowint.h:43
TargetVar
struct TargetVar_ TargetVar
DetectFlowintData_::tvar
TargetVar tvar
Definition: detect-flowint.h:78
DetectFlowintRegister
void DetectFlowintRegister(void)
Definition: detect-flowint.c:61
TargetVar_::name
char * name
Definition: detect-flowint.h:58
FLOWINT_TARGET_UNKNOWN
@ FLOWINT_TARGET_UNKNOWN
Definition: detect-flowint.h:53
FLOWINT_MODIFIER_SET
@ FLOWINT_MODIFIER_SET
Definition: detect-flowint.h:30
DetectFlowintData_::name
char * name
Definition: detect-flowint.h:65
TargetVar_
Definition: detect-flowint.h:57
DetectFlowintData_::value
uint32_t value
Definition: detect-flowint.h:76
FLOWINT_MODIFIER_ADD
@ FLOWINT_MODIFIER_ADD
Definition: detect-flowint.h:31