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 
35 
36 DetectPort *DetectPortLookupGroup(DetectPort *dp, uint16_t port);
38 
39 int DetectPortJoin(DetectEngineCtx *,DetectPort *target, DetectPort *source);
40 
41 bool DetectPortListsAreEqual(DetectPort *list1, DetectPort *list2);
42 
46 void DetectPortFree(const DetectEngineCtx *de_ctx, DetectPort *);
47 
48 int DetectPortTestConfVars(void);
49 
54 
55 void DetectPortTests(void);
56 
57 #endif /* __DETECT_PORT_H__ */
58 
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:723
#define str(s)
DetectPort * DetectPortLookupInList(DetectPort *head, DetectPort *gr)
Used to check if a DetectPort list contains an instance with a similar DetectPort. The comparison done is not the one that checks the memory for the same instance, but one that checks that the two instances hold the same content.
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...
int DetectPortInsertCopy(DetectEngineCtx *, DetectPort **, DetectPort *)
Copy and insert the new DetectPort, with a copy list of sigs.
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.
int DetectPortJoin(DetectEngineCtx *, DetectPort *target, DetectPort *source)
Function to join the source group to the target and its members.
DetectPort * DetectPortCopy(DetectEngineCtx *, DetectPort *)
Function that return a copy of DetectPort src.
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:196