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 SURICATA_DETECT_FLOWINT_H
25#define SURICATA_DETECT_FLOWINT_H
26
27/** Flowint operations allowed */
28enum {
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 already declared */
49enum {
53};
54
55/** If the target is another var, get the name and the idx */
56typedef struct TargetVar_ {
57 char *name;
59
60/** Context data for flowint vars */
61typedef struct DetectFlowintData_ {
62 /* This is the main var we are going to use
63 * against the target */
64 char *name;
65 /* Internal id of the var */
66 uint32_t idx;
67
68 /* The modifier/operation/condition we are
69 * going to execute */
70 uint8_t modifier;
71 uint8_t targettype;
72
73 union {
74 /* the target value */
75 uint32_t value;
76 /* or the target var */
80
81/* prototypes */
82void DetectFlowintRegister (void);
83
84#endif /* SURICATA_DETECT_FLOWINT_H */
struct TargetVar_ TargetVar
@ FLOWINT_TARGET_SELF
@ FLOWINT_TARGET_VAR
@ FLOWINT_TARGET_VAL
struct DetectFlowintData_ DetectFlowintData
void DetectFlowintRegister(void)
@ FLOWINT_MODIFIER_GE
@ FLOWINT_MODIFIER_LT
@ FLOWINT_MODIFIER_UNKNOWN
@ FLOWINT_MODIFIER_SUB
@ FLOWINT_MODIFIER_GT
@ FLOWINT_MODIFIER_ADD
@ FLOWINT_MODIFIER_ISSET
@ FLOWINT_MODIFIER_ISNOTSET
@ FLOWINT_MODIFIER_NE
@ FLOWINT_MODIFIER_EQ
@ FLOWINT_MODIFIER_LE
@ FLOWINT_MODIFIER_SET
union DetectFlowintData_::@76 target