suricata
detect-engine-address-ipv6.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int AddressIPv6Lt (Address *, Address *)
 Compares 2 ipv6 addresses and returns if the first address(a) is less than the second address(b) or not. More...
 
int AddressIPv6Gt (Address *, Address *)
 Compares 2 ipv6 addresses and returns if the first address(a) is greater than the second address(b) or not. More...
 
int AddressIPv6Eq (Address *, Address *)
 Compares 2 ipv6 addresses and returns if the addresses are equal or not. More...
 
int AddressIPv6Le (Address *, Address *)
 Compares 2 ipv6 addresses and returns if the first address(a) is less than or equal to the second address(b) or not. More...
 
int AddressIPv6Ge (Address *, Address *)
 Compares 2 ipv6 addresses and returns if the first address(a) is greater than or equal to the second address(b) or not. More...
 
int AddressIPv6LeU32 (uint32_t *a, uint32_t *b)
 
int AddressIPv6LtU32 (uint32_t *a, uint32_t *b)
 
int AddressIPv6GtU32 (uint32_t *a, uint32_t *b)
 
int AddressIPv6EqU32 (uint32_t *a, uint32_t *b)
 
int AddressIPv6GeU32 (uint32_t *a, uint32_t *b)
 
int DetectAddressCutNotIPv6 (DetectAddress *, DetectAddress **)
 Cuts and returns an address range, which is the complement of the address range that is supplied as the argument. More...
 
int DetectAddressCmpIPv6 (DetectAddress *a, DetectAddress *b)
 Compares 2 addresses(address ranges) and returns the relationship between the 2 addresses. More...
 
int DetectAddressCutIPv6 (DetectEngineCtx *, DetectAddress *, DetectAddress *, DetectAddress **)
 
int DetectAddressJoinIPv6 (DetectEngineCtx *, DetectAddress *, DetectAddress *)
 Extends a target address range if the the source address range is wider than the target address range on either sides. More...
 
void DetectAddressIPv6Tests (void)
 

Detailed Description

Function Documentation

int AddressIPv6Eq ( Address a,
Address b 
)

Compares 2 ipv6 addresses and returns if the addresses are equal or not.

Parameters
aThe first ipv6 address to be compared.
bThe second ipv6 address to be compared.
Return values
1If a == b.
0Otherwise.

Definition at line 128 of file detect-engine-address-ipv6.c.

Referenced by AddressIPv6Ge(), AddressIPv6Le(), DetectAddressCmpIPv6(), and DetectAddressCutIPv6().

Here is the caller graph for this function:

int AddressIPv6EqU32 ( uint32_t *  a,
uint32_t *  b 
)

Definition at line 140 of file detect-engine-address-ipv6.c.

Referenced by AddressIPv6GeU32(), AddressIPv6LeU32(), DetectAddressCutIPv6(), and DetectAddressJoinIPv6().

Here is the caller graph for this function:

int AddressIPv6Ge ( Address a,
Address b 
)

Compares 2 ipv6 addresses and returns if the first address(a) is greater than or equal to the second address(b) or not.

Parameters
aThe first ipv6 address to be compared.
bThe second ipv6 address to be compared.
Return values
1If a >= b.
0Otherwise, i.e. a < b.

Definition at line 194 of file detect-engine-address-ipv6.c.

References AddressIPv6Eq(), and AddressIPv6Gt().

Referenced by DetectAddressCmpIPv6(), and DetectAddressMatch().

Here is the call graph for this function:

Here is the caller graph for this function:

int AddressIPv6GeU32 ( uint32_t *  a,
uint32_t *  b 
)

Definition at line 205 of file detect-engine-address-ipv6.c.

References AddressIPv6EqU32(), and AddressIPv6GtU32().

Referenced by DetectAddressJoinIPv6().

Here is the call graph for this function:

Here is the caller graph for this function:

int AddressIPv6Gt ( Address a,
Address b 
)

Compares 2 ipv6 addresses and returns if the first address(a) is greater than the second address(b) or not.

Parameters
aThe first ipv6 address to be compared.
bThe second ipv6 address to be compared.
Return values
1If a > b.
0Otherwise, i.e. a <= b.

Definition at line 90 of file detect-engine-address-ipv6.c.

References SCNtohl.

Referenced by AddressIPv6Ge(), DetectAddressCmpIPv6(), DetectAddressJoinIPv6(), and DetectAddressParseString().

Here is the caller graph for this function:

int AddressIPv6GtU32 ( uint32_t *  a,
uint32_t *  b 
)

Definition at line 104 of file detect-engine-address-ipv6.c.

References SCNtohl.

Referenced by AddressIPv6GeU32(), and DetectAddressJoinIPv6().

Here is the caller graph for this function:

int AddressIPv6Le ( Address a,
Address b 
)

Compares 2 ipv6 addresses and returns if the first address(a) is less than or equal to the second address(b) or not.

Parameters
aThe first ipv6 address to be compared.
bThe second ipv6 address to be compared.
Return values
1If a <= b.
0Otherwise, i.e. a > b.

Definition at line 162 of file detect-engine-address-ipv6.c.

References AddressIPv6Eq(), and AddressIPv6Lt().

Referenced by DetectAddressCmpIPv6(), and DetectAddressMatch().

Here is the call graph for this function:

Here is the caller graph for this function:

int AddressIPv6LeU32 ( uint32_t *  a,
uint32_t *  b 
)

Definition at line 173 of file detect-engine-address-ipv6.c.

References AddressIPv6EqU32(), and AddressIPv6LtU32().

Referenced by DetectAddressJoinIPv6().

Here is the call graph for this function:

Here is the caller graph for this function:

int AddressIPv6Lt ( Address a,
Address b 
)

Compares 2 ipv6 addresses and returns if the first address(a) is less than the second address(b) or not.

Parameters
aThe first ipv6 address to be compared.
bThe second ipv6 address to be compared.
Return values
1If a < b.
0Otherwise, i.e. a >= b.

Definition at line 52 of file detect-engine-address-ipv6.c.

References SCNtohl.

Referenced by AddressIPv6Le(), DetectAddressCmpIPv6(), and DetectAddressJoinIPv6().

Here is the caller graph for this function:

int AddressIPv6LtU32 ( uint32_t *  a,
uint32_t *  b 
)

Definition at line 66 of file detect-engine-address-ipv6.c.

References SCNtohl.

Referenced by AddressIPv6LeU32(), and DetectAddressJoinIPv6().

Here is the caller graph for this function:

int DetectAddressCmpIPv6 ( DetectAddress a,
DetectAddress b 
)

Compares 2 addresses(address ranges) and returns the relationship between the 2 addresses.

Parameters
aPointer to the first address instance to be compared.
bPointer to the second address instance to be compared.
Return values
ADDRESS_EQIf the 2 address ranges a and b, are equal.
ADDRESS_ESb encapsulates a. b_ip1[...a_ip1...a_ip2...]b_ip2.
ADDRESS_EBa encapsulates b. a_ip1[...b_ip1....b_ip2...]a_ip2.
ADDRESS_LEa_ip1(...b_ip1==a_ip2...)b_ip2
ADDRESS_LTa_ip1(...b_ip1...a_ip2...)b_ip2
ADDRESS_GEb_ip1(...a_ip1==b_ip2...)a_ip2
ADDRESS_GTa_ip1 > b_ip2, i.e. the address range for 'a' starts only after the end of the address range for 'b'

Definition at line 232 of file detect-engine-address-ipv6.c.

References ADDRESS_EB, ADDRESS_EQ, ADDRESS_ER, ADDRESS_ES, ADDRESS_GE, ADDRESS_GT, ADDRESS_LE, ADDRESS_LT, AddressIPv6Eq(), AddressIPv6Ge(), AddressIPv6Gt(), AddressIPv6Le(), AddressIPv6Lt(), DetectAddress_::ip, DetectAddress_::ip2, and SCLogDebug.

Referenced by DetectAddressCmp(), DetectAddressCutIPv6(), and DetectAddressJoinIPv6().

Here is the call graph for this function:

Here is the caller graph for this function:

int DetectAddressCutIPv6 ( DetectEngineCtx ,
DetectAddress ,
DetectAddress ,
DetectAddress **   
)
int DetectAddressCutNotIPv6 ( DetectAddress a,
DetectAddress **  b 
)

Cuts and returns an address range, which is the complement of the address range that is supplied as the argument.

For example:

If a = ::-2000::, then a = 2000::1-FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF and b = NULL If a = 2000::1-FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF, then a = ::-2000:: and b = NULL If a = 2000::1-20FF::2, then a = ::-2000:: and b = 20FF::3-FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF

Parameters
aPointer to an address range (DetectAddress) instance whose complement has to be returned in a and b.
bPointer to DetectAddress pointer, that will be supplied back with a new DetectAddress instance, if the complement demands so.
Return values
0On success.
-1On failure.

Definition at line 723 of file detect-engine-address-ipv6.c.

References DetectAddressInit(), Address_::family, DetectAddress_::ip, DetectAddress_::ip2, and SCNtohl.

Referenced by DetectAddressHeadFree(), and DetectAddressJoinIPv6().

Here is the call graph for this function:

Here is the caller graph for this function:

void DetectAddressIPv6Tests ( void  )

Definition at line 2081 of file detect-engine-address-ipv6.c.

References UtRegisterTest().

Referenced by DetectAddressTests().

Here is the call graph for this function:

Here is the caller graph for this function:

int DetectAddressJoinIPv6 ( DetectEngineCtx de_ctx,
DetectAddress target,
DetectAddress source 
)

Extends a target address range if the the source address range is wider than the target address range on either sides.

Every address is a range, i.e. address->ip1....address->ip2. For example 2000::-2010:: if source->ip1 is smaller than target->ip1, it indicates that the source's left address limit is greater(range wise) than the target's left address limit, and hence we reassign the target's left address limit to source's left address limit. Similary if source->ip2 is greater than target->ip2, it indicates that the source's right address limit is greater(range wise) than the target's right address limit, and hence we reassign the target's right address limit to source's right address limit.

Parameters
de_ctxPointer to the detection engine context.
targetPointer to the target DetectAddress instance that has to be updated.
sourcePointer to the source DetectAddress instance that is used to decided whether we extend the target's address range.
Return values
0On success.
-1On failure.

Definition at line 796 of file detect-engine-address-ipv6.c.

References Address_::address, ADDRESS_EB, ADDRESS_EQ, ADDRESS_ES, ADDRESS_GE, ADDRESS_GT, ADDRESS_LE, ADDRESS_LT, AddressIPv6EqU32(), AddressIPv6GeU32(), AddressIPv6Gt(), AddressIPv6GtU32(), AddressIPv6LeU32(), AddressIPv6Lt(), AddressIPv6LtU32(), COPY_ADDRESS, DetectAddressCmpIPv6(), DetectAddressCutNotIPv6(), DetectAddressFree(), DetectAddressInit(), DetectAddressJoinIPv6(), DetectAddress_::ip, DetectAddress_::ip2, and SCNtohl.

Referenced by DetectAddressJoin(), and DetectAddressJoinIPv6().

Here is the call graph for this function:

Here is the caller graph for this function: