suricata
util-port-interval-tree.h
Go to the documentation of this file.
1
/* Copyright (C) 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 Shivani Bhardwaj <shivani@oisf.net>
22
*/
23
24
#ifndef SURICATA_UTIL_PORT_INTERVAL_TREE_H
25
#define SURICATA_UTIL_PORT_INTERVAL_TREE_H
26
27
#include "
detect-engine-port.h
"
28
29
typedef
struct
SCPortIntervalTree_
{
30
struct
PI
tree
;
31
SCPortIntervalNode
*
head
;
32
}
SCPortIntervalTree
;
33
34
SCPortIntervalTree
*
SCPortIntervalTreeInit
(
void
);
35
void
SCPortIntervalTreeFree
(
DetectEngineCtx
*,
SCPortIntervalTree
*);
36
int
SCPortIntervalInsert
(
DetectEngineCtx
*,
SCPortIntervalTree
*,
const
DetectPort
*);
37
void
SCPortIntervalFindOverlappingRanges
(
38
DetectEngineCtx
*,
const
uint16_t,
const
uint16_t,
const
struct
PI *,
DetectPort
**);
39
40
#endif
/* SURICATA_UTIL_PORT_INTERVAL_TREE_H */
SCPortIntervalTreeInit
SCPortIntervalTree * SCPortIntervalTreeInit(void)
Function to initialize the interval tree.
Definition:
util-port-interval-tree.c:58
SCPortIntervalTreeFree
void SCPortIntervalTreeFree(DetectEngineCtx *, SCPortIntervalTree *)
Function to free an entire interval tree.
Definition:
util-port-interval-tree.c:92
DetectEngineCtx_
main detection engine ctx
Definition:
detect.h:843
SCPortIntervalNode
Definition:
detect-engine-port.h:30
detect-engine-port.h
DetectPort_
Port structure for detection engine.
Definition:
detect.h:217
SCPortIntervalTree_::tree
struct PI tree
Definition:
util-port-interval-tree.h:30
SCPortIntervalInsert
int SCPortIntervalInsert(DetectEngineCtx *, SCPortIntervalTree *, const DetectPort *)
Function to insert a node in the interval tree.
Definition:
util-port-interval-tree.c:109
SCPortIntervalFindOverlappingRanges
void SCPortIntervalFindOverlappingRanges(DetectEngineCtx *, const uint16_t, const uint16_t, const struct PI *, DetectPort **)
Callee function to find all overlapping port ranges as asked by the detection engine during Stage 2 o...
Definition:
util-port-interval-tree.c:315
SCPortIntervalTree_
Definition:
util-port-interval-tree.h:29
SCPortIntervalTree
struct SCPortIntervalTree_ SCPortIntervalTree
SCPortIntervalTree_::head
SCPortIntervalNode * head
Definition:
util-port-interval-tree.h:31
src
util-port-interval-tree.h
Generated on Sat Dec 21 2024 23:30:38 for suricata by
1.8.18