suricata
util-var.h
Go to the documentation of this file.
1/* Copyright (C) 2007-2024 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_UTIL_VAR_H
25#define SURICATA_UTIL_VAR_H
26
27/** variable types: these are used to track variable names */
52
53typedef struct GenericVar_ {
54 uint16_t type; /**< variable type, uses detection sm_type */
55 uint8_t pad[2];
56 uint32_t idx;
59
60typedef struct XBit_ {
61 uint16_t type; /* type, DETECT_XBITS in this case */
62 uint8_t pad[2];
63 uint32_t idx; /* name idx */
67
68void XBitFree(XBit *);
69
70// A list of variables we try to resolve while parsing configuration file.
71// Helps to detect recursive declarations.
76
77typedef TAILQ_HEAD(, ResolvedVariable_) ResolvedVariablesList;
78
82
83int AddVariableToResolveList(ResolvedVariablesList *list, const char *var);
84void CleanVariableResolveList(ResolvedVariablesList *var_list);
85
86#endif /* SURICATA_UTIL_VAR_H */
struct HtpBodyChunk_ * next
#define TAILQ_HEAD(name, type)
Definition queue.h:230
uint8_t pad[2]
Definition util-var.h:55
uint16_t type
Definition util-var.h:54
uint32_t idx
Definition util-var.h:56
struct GenericVar_ * next
Definition util-var.h:57
TAILQ_ENTRY(ResolvedVariable_) next
char var_name[256]
Definition util-var.h:73
uint16_t type
Definition util-var.h:61
uint8_t pad[2]
Definition util-var.h:62
GenericVar * next
Definition util-var.h:64
SCTime_t expire
Definition util-var.h:65
uint32_t idx
Definition util-var.h:63
void GenericVarAppend(GenericVar **, GenericVar *)
Definition util-var.c:98
VarTypes
Definition util-var.h:28
@ VAR_TYPE_IPPAIR_BIT
Definition util-var.h:45
@ VAR_TYPE_FLOW_FLOAT
Definition util-var.h:38
@ VAR_TYPE_ALERT_VAR
Definition util-var.h:50
@ VAR_TYPE_NOT_SET
Definition util-var.h:29
@ VAR_TYPE_FLOW_BIT
Definition util-var.h:36
@ VAR_TYPE_HOST_VAR
Definition util-var.h:43
@ VAR_TYPE_FLOW_VAR
Definition util-var.h:39
@ VAR_TYPE_PKT_VAR_KV
Definition util-var.h:34
@ VAR_TYPE_IPPAIR_INT
Definition util-var.h:46
@ VAR_TYPE_TX_BIT
Definition util-var.h:49
@ VAR_TYPE_HOST_INT
Definition util-var.h:42
@ VAR_TYPE_PKT_BIT
Definition util-var.h:31
@ VAR_TYPE_PKT_VAR
Definition util-var.h:33
@ VAR_TYPE_HOST_BIT
Definition util-var.h:41
@ VAR_TYPE_IPPAIR_VAR
Definition util-var.h:47
@ VAR_TYPE_PKT_INT
Definition util-var.h:32
@ VAR_TYPE_FLOW_INT
Definition util-var.h:37
struct XBit_ XBit
struct GenericVar_ GenericVar
void XBitFree(XBit *)
Definition util-var.c:40
struct ResolvedVariable_ ResolvedVariable
void GenericVarRemove(GenericVar **, GenericVar *)
Definition util-var.c:117
void GenericVarFree(GenericVar *)
Definition util-var.c:48
void CleanVariableResolveList(ResolvedVariablesList *var_list)
Definition util-var.c:168
int AddVariableToResolveList(ResolvedVariablesList *list, const char *var)
Definition util-var.c:139