suricata
detect-engine-address.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_ADDRESS_H__
25 #define __DETECT_ADDRESS_H__
26 
27 /* prototypes */
28 void DetectAddressRegister (void);
29 
33 
34 int DetectAddressParseString(DetectAddress *, const char *);
35 int DetectAddressParse(const DetectEngineCtx *, DetectAddressHead *, const char *);
36 
39 
43 
46 
48 
52 
56 
57 int DetectAddressMatchIPv4(const DetectMatchAddressIPv4 *, uint16_t, const Address *);
58 int DetectAddressMatchIPv6(const DetectMatchAddressIPv6 *, uint16_t, const Address *);
59 
61 
62 void DetectAddressTests(void);
63 
67  const char *string);
68 
69 #endif /* __DETECT_ADDRESS_H__ */
void DetectAddressFree(DetectAddress *)
Frees a DetectAddress instance.
const DetectAddressHead * DetectParseAddress(DetectEngineCtx *de_ctx, const char *string)
address structure for use in the detection engine.
Definition: detect.h:143
int DetectAddressMapInit(DetectEngineCtx *de_ctx)
void DetectAddressPrint(DetectAddress *)
Prints the address data held by the DetectAddress. If the address data family is IPv4, we print the the ipv4 address and mask, and if the address data family is IPv6, we print the ipv6 address and mask.
int DetectAddressAdd(DetectAddress **, DetectAddress *)
Do a sorted insert, where the top of the list should be the biggest network/range.
main detection engine ctx
Definition: detect.h:743
DetectAddress * DetectAddressLookupInHead(const DetectAddressHead *, Address *)
Find the group matching address in a group head.
void DetectAddressMapFree(DetectEngineCtx *de_ctx)
int DetectAddressParseString(DetectAddress *, const char *)
int DetectAddressTestConfVars(void)
DetectAddress * DetectAddressLookupInList(DetectAddress *, DetectAddress *)
Used to check if a DetectAddress list contains an instance with a similar DetectAddress. 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 DetectAddressHeadCleanup(DetectAddressHead *)
Cleans a DetectAddressHead. The functions frees the address group heads(ipv4 and ipv6) inside the Det...
DetectAddress * DetectAddressInit(void)
Creates and returns a new instance of a DetectAddress.
int DetectAddressInsert(DetectEngineCtx *, DetectAddressHead *, DetectAddress *)
Same as DetectAddressInsert, but then for inserting a address group object. This also makes sure SigG...
void DetectAddressCleanupList(DetectAddress *)
Frees a list of DetectAddress instances.
int DetectAddressJoin(DetectEngineCtx *, DetectAddress *, DetectAddress *)
Join two addresses groups together.
DetectAddressHead * DetectAddressHeadInit(void)
Returns a new instance of DetectAddressHead.
bool DetectAddressListsAreEqual(DetectAddress *list1, DetectAddress *list2)
Checks if two address group lists are equal.
int DetectAddressParse(const DetectEngineCtx *, DetectAddressHead *, const char *)
Parses an address group sent as a character string and updates the DetectAddressHead sent as the argu...
void DetectAddressHeadFree(DetectAddressHead *)
Frees a DetectAddressHead instance.
void DetectAddressPrintList(DetectAddress *)
Prints the address data information for all the DetectAddress instances in the DetectAddress list sen...
int DetectAddressMatch(DetectAddress *, Address *)
Check if a particular address(ipv4 or ipv6) matches the address range in the DetectAddress instance...
void DetectAddressRegister(void)
int DetectAddressMatchIPv6(const DetectMatchAddressIPv6 *, uint16_t, const Address *)
Match a packets address against a signatures addrs array.
DetectAddress * DetectAddressCopy(DetectAddress *)
Copies the contents of one Address group in DetectAddress and returns a new instance of the DetectAdd...
void DetectAddressTests(void)
int DetectAddressCmp(DetectAddress *, DetectAddress *)
Used to compare 2 address ranges.
int DetectAddressMatchIPv4(const DetectMatchAddressIPv4 *, uint16_t, const Address *)
Match a packets address against a signatures addrs array.