suricata
detect-engine-tag.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 detect-engine-tag.h
20 *
21 * \author Pablo Rincon Crespo <pablo.rincon.crespo@gmail.com>
22 *
23 * Implements a global context to store data related to hosts flagged
24 * tag keyword
25 */
26
27#ifndef SURICATA_DETECT_ENGINE_TAG_H
28#define SURICATA_DETECT_ENGINE_TAG_H
29
30#include "host.h"
31#include "detect.h"
32#include "detect-tag.h"
33
34/* This limit should be overwritten/predefined at the config file
35 * to limit the options to prevent possible DOS situations. We should also
36 * create a limit for bytes and a limit for number of packets */
37#define TAG_MAX_LAST_TIME_SEEN 600
38
39/* Used for tagged data (sid and gid of the packets that
40 * follow the one that triggered the rule with tag option) */
41#define TAG_SIG_GEN 2
42#define TAG_SIG_ID 1
43
46
48
49void TagInitCtx(void);
50void TagDestroyCtx(void);
51
53
54int TagHostHasTag(Host *host);
55
57
58#endif /* SURICATA_DETECT_ENGINE_TAG_H */
int TagHashAddTag(DetectTagDataEntry *, Packet *)
Add a tag entry for a host. If it already exist, update it.
int TagTimeoutCheck(Host *, SCTime_t)
Removes the entries exceeding the max timeout value.
void TagDestroyCtx(void)
Destroy tag context hash tables.
void DetectEngineTagRegisterTests(void)
this function registers unit tests for DetectTag
void TagHandlePacket(const DetectEngineCtx *, DetectEngineThreadCtx *, Packet *)
Search tags for src and dst. Update entries of the tag, remove if necessary.
void TagInitCtx(void)
int TagHostHasTag(Host *host)
int TagFlowAdd(Packet *, DetectTagDataEntry *)
This function is used to add a tag to a session (type session) or update it if it's already installed...
main detection engine ctx
Definition detect.h:932
Definition host.h:58