suricata
util-var.h
Go to the documentation of this file.
1 /* Copyright (C) 2007-2010 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 __UTIL_VAR_H__
25 #define __UTIL_VAR_H__
26 
27 enum VarTypes {
29 
33  VAR_TYPE_PKT_VAR_KV, // key-value
34 
38 
42 
46 };
47 
48 typedef struct GenericVar_ {
49  uint8_t type;
50  uint8_t pad[3];
51  uint32_t idx;
52  struct GenericVar_ *next;
53 } GenericVar;
54 
55 typedef struct XBit_ {
56  uint8_t type; /* type, DETECT_XBITS in this case */
57  uint8_t pad[3];
58  uint32_t idx; /* name idx */
60  uint32_t expire;
61 } XBit;
62 
63 void XBitFree(XBit *);
64 
65 // A list of variables we try to resolve while parsing configuration file.
66 // Helps to detect recursive declarations.
67 typedef struct ResolvedVariable_ {
68  char var_name[256];
71 
72 typedef TAILQ_HEAD(, ResolvedVariable_) ResolvedVariablesList;
73 
77 
78 int AddVariableToResolveList(ResolvedVariablesList *list, const char *var);
79 void CleanVariableResolveList(ResolvedVariablesList *var_list);
80 
81 #endif /* __UTIL_VAR_H__ */
82 
GenericVar_::type
uint8_t type
Definition: util-var.h:49
XBit_::expire
uint32_t expire
Definition: util-var.h:60
XBit_::next
GenericVar * next
Definition: util-var.h:59
next
struct HtpBodyChunk_ * next
Definition: app-layer-htp.h:2
VAR_TYPE_IPPAIR_VAR
@ VAR_TYPE_IPPAIR_VAR
Definition: util-var.h:45
ResolvedVariable_
Definition: util-var.h:67
GenericVarFree
void GenericVarFree(GenericVar *)
Definition: util-var.c:47
GenericVarAppend
void GenericVarAppend(GenericVar **, GenericVar *)
Definition: util-var.c:92
VAR_TYPE_HOST_VAR
@ VAR_TYPE_HOST_VAR
Definition: util-var.h:41
VAR_TYPE_PKT_INT
@ VAR_TYPE_PKT_INT
Definition: util-var.h:31
VAR_TYPE_PKT_VAR_KV
@ VAR_TYPE_PKT_VAR_KV
Definition: util-var.h:33
VAR_TYPE_NOT_SET
@ VAR_TYPE_NOT_SET
Definition: util-var.h:28
GenericVar_::pad
uint8_t pad[3]
Definition: util-var.h:50
GenericVar_::next
struct GenericVar_ * next
Definition: util-var.h:52
AddVariableToResolveList
int AddVariableToResolveList(ResolvedVariablesList *list, const char *var)
Definition: util-var.c:133
TAILQ_HEAD
typedef TAILQ_HEAD(, ResolvedVariable_) ResolvedVariablesList
XBit
struct XBit_ XBit
ResolvedVariable_::var_name
char var_name[256]
Definition: util-var.h:68
GenericVar_::idx
uint32_t idx
Definition: util-var.h:51
VAR_TYPE_PKT_BIT
@ VAR_TYPE_PKT_BIT
Definition: util-var.h:30
ResolvedVariable
struct ResolvedVariable_ ResolvedVariable
XBit_::type
uint8_t type
Definition: util-var.h:56
GenericVarRemove
void GenericVarRemove(GenericVar **, GenericVar *)
Definition: util-var.c:111
VAR_TYPE_FLOW_BIT
@ VAR_TYPE_FLOW_BIT
Definition: util-var.h:35
GenericVar_
Definition: util-var.h:48
CleanVariableResolveList
void CleanVariableResolveList(ResolvedVariablesList *var_list)
Definition: util-var.c:162
ResolvedVariable_::TAILQ_ENTRY
TAILQ_ENTRY(ResolvedVariable_) next
XBitFree
void XBitFree(XBit *)
Definition: util-var.c:39
VAR_TYPE_HOST_BIT
@ VAR_TYPE_HOST_BIT
Definition: util-var.h:39
VAR_TYPE_IPPAIR_INT
@ VAR_TYPE_IPPAIR_INT
Definition: util-var.h:44
VAR_TYPE_FLOW_VAR
@ VAR_TYPE_FLOW_VAR
Definition: util-var.h:37
VAR_TYPE_FLOW_INT
@ VAR_TYPE_FLOW_INT
Definition: util-var.h:36
VarTypes
VarTypes
Definition: util-var.h:27
VAR_TYPE_HOST_INT
@ VAR_TYPE_HOST_INT
Definition: util-var.h:40
XBit_::idx
uint32_t idx
Definition: util-var.h:58
XBit_::pad
uint8_t pad[3]
Definition: util-var.h:57
GenericVar
struct GenericVar_ GenericVar
XBit_
Definition: util-var.h:55
VAR_TYPE_IPPAIR_BIT
@ VAR_TYPE_IPPAIR_BIT
Definition: util-var.h:43
VAR_TYPE_PKT_VAR
@ VAR_TYPE_PKT_VAR
Definition: util-var.h:32