suricata
detect-engine-port.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 __DETECT_PORT_H__
25 #define __DETECT_PORT_H__
26 
27 /* prototypes */
28 int DetectPortParse(const DetectEngineCtx *, DetectPort **head, const char *str);
29 
33 
34 DetectPort *DetectPortLookupGroup(DetectPort *dp, uint16_t port);
35 
36 bool DetectPortListsAreEqual(DetectPort *list1, DetectPort *list2);
37 
41 void DetectPortFree(const DetectEngineCtx *de_ctx, DetectPort *);
42 
43 int DetectPortTestConfVars(void);
44 
49 
50 #ifdef UNITTESTS
51 void DetectPortTests(void);
52 #endif
53 
54 #endif /* __DETECT_PORT_H__ */
55 
int DetectPortParse(const DetectEngineCtx *, DetectPort **head, const char *str)
Function for parsing port strings.
void DetectPortFree(const DetectEngineCtx *de_ctx, DetectPort *)
Free a DetectPort and its members.
DetectPort * DetectPortHashLookup(DetectEngineCtx *de_ctx, DetectPort *dp)
Used to lookup a DetectPort hash from the detection engine context DetectPort hash table...
int DetectPortInsert(DetectEngineCtx *, DetectPort **, DetectPort *)
function for inserting a port group object. This also makes sure SigGroupContainer lists are handled ...
int DetectPortHashAdd(DetectEngineCtx *de_ctx, DetectPort *dp)
Adds a DetectPort to the detection engine context DetectPort hash table.
Flow * head
Definition: flow-hash.h:102
main detection engine ctx
Definition: detect.h:761
#define str(s)
void DetectPortHashFree(DetectEngineCtx *de_ctx)
Frees the hash table - DetectEngineCtx->sgh_hash_table, allocated by DetectPortInit() function...
void DetectPortTests(void)
int DetectPortHashInit(DetectEngineCtx *de_ctx)
Initializes the hash table in the detection engine context to hold the DetectPort hash...
void DetectPortPrint(DetectPort *)
Helper function that print the DetectPort info.
void DetectPortCleanupList(const DetectEngineCtx *de_ctx, DetectPort *head)
Free a DetectPort list and each of its members.
int DetectPortTestConfVars(void)
DetectPort * DetectPortLookupGroup(DetectPort *dp, uint16_t port)
Function that find the group matching address in a group head.
int DetectPortCmp(DetectPort *, DetectPort *)
Function that compare port groups.
bool DetectPortListsAreEqual(DetectPort *list1, DetectPort *list2)
Checks if two port group lists are equal.
void DetectPortPrintList(DetectPort *head)
Helper function used to print the list of ports present in this DetectPort list.
DetectPort * DetectPortCopySingle(DetectEngineCtx *, DetectPort *)
Function that return a copy of DetectPort src sigs.
Port structure for detection engine.
Definition: detect.h:191