|
|
|
|
@ -48,7 +48,11 @@
|
|
|
|
|
#include "util-var.h"
|
|
|
|
|
|
|
|
|
|
/* prototypes */
|
|
|
|
|
void DetectAddressPrint(DetectAddress *);
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
|
static void DetectAddressPrint(DetectAddress *);
|
|
|
|
|
#else
|
|
|
|
|
#define DetectAddressPrint(...)
|
|
|
|
|
#endif
|
|
|
|
|
static int DetectAddressCutNot(DetectAddress *, DetectAddress **);
|
|
|
|
|
static int DetectAddressCut(DetectEngineCtx *, DetectAddress *, DetectAddress *,
|
|
|
|
|
DetectAddress **);
|
|
|
|
|
@ -62,11 +66,9 @@ int DetectAddressMergeNot(DetectAddressHead *gh, DetectAddressHead *ghn);
|
|
|
|
|
*/
|
|
|
|
|
DetectAddress *DetectAddressInit(void)
|
|
|
|
|
{
|
|
|
|
|
DetectAddress *ag = SCMalloc(sizeof(DetectAddress));
|
|
|
|
|
DetectAddress *ag = SCCalloc(1, sizeof(DetectAddress));
|
|
|
|
|
if (unlikely(ag == NULL))
|
|
|
|
|
return NULL;
|
|
|
|
|
memset(ag, 0, sizeof(DetectAddress));
|
|
|
|
|
|
|
|
|
|
return ag;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -86,8 +88,35 @@ void DetectAddressFree(DetectAddress *ag)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Copies the contents of one Address group in DetectAddress and returns
|
|
|
|
|
* a new instance of the DetectAddress that contains the copied address.
|
|
|
|
|
* \internal
|
|
|
|
|
* \brief Returns a new instance of DetectAddressHead.
|
|
|
|
|
*
|
|
|
|
|
* \retval gh Pointer to the new instance of DetectAddressHead.
|
|
|
|
|
*/
|
|
|
|
|
static DetectAddressHead *DetectAddressHeadInit(void)
|
|
|
|
|
{
|
|
|
|
|
DetectAddressHead *gh = SCCalloc(1, sizeof(DetectAddressHead));
|
|
|
|
|
if (unlikely(gh == NULL))
|
|
|
|
|
return NULL;
|
|
|
|
|
return gh;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \internal
|
|
|
|
|
* \brief Frees a DetectAddressHead instance.
|
|
|
|
|
*
|
|
|
|
|
* \param gh Pointer to the DetectAddressHead instance to be freed.
|
|
|
|
|
*/
|
|
|
|
|
static void DetectAddressHeadFree(DetectAddressHead *gh)
|
|
|
|
|
{
|
|
|
|
|
if (gh != NULL) {
|
|
|
|
|
DetectAddressHeadCleanup(gh);
|
|
|
|
|
SCFree(gh);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief copy a DetectAddress
|
|
|
|
|
*
|
|
|
|
|
* \param orig Pointer to the instance of DetectAddress that contains the
|
|
|
|
|
* address data to be copied to the new instance.
|
|
|
|
|
@ -95,47 +124,19 @@ void DetectAddressFree(DetectAddress *ag)
|
|
|
|
|
* \retval ag Pointer to the new instance of DetectAddress that contains the
|
|
|
|
|
* copied address.
|
|
|
|
|
*/
|
|
|
|
|
DetectAddress *DetectAddressCopy(DetectAddress *orig)
|
|
|
|
|
static DetectAddress *DetectAddressCopy(DetectAddress *orig)
|
|
|
|
|
{
|
|
|
|
|
DetectAddress *ag = DetectAddressInit();
|
|
|
|
|
if (ag == NULL)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
ag->flags = orig->flags;
|
|
|
|
|
|
|
|
|
|
COPY_ADDRESS(&orig->ip, &ag->ip);
|
|
|
|
|
COPY_ADDRESS(&orig->ip2, &ag->ip2);
|
|
|
|
|
|
|
|
|
|
return ag;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief 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.
|
|
|
|
|
*
|
|
|
|
|
* \param head Pointer to the DetectAddress list.
|
|
|
|
|
* \param ad Pointer to the DetectAddress that has to be checked for in
|
|
|
|
|
* the DetectAddress list.
|
|
|
|
|
*
|
|
|
|
|
* \retval cur Returns a pointer to the DetectAddress on a match; NULL if
|
|
|
|
|
* no match.
|
|
|
|
|
*/
|
|
|
|
|
DetectAddress *DetectAddressLookupInList(DetectAddress *head, DetectAddress *gr)
|
|
|
|
|
{
|
|
|
|
|
DetectAddress *cur;
|
|
|
|
|
|
|
|
|
|
if (head != NULL) {
|
|
|
|
|
for (cur = head; cur != NULL; cur = cur->next) {
|
|
|
|
|
if (DetectAddressCmp(cur, gr) == ADDRESS_EQ)
|
|
|
|
|
return cur;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
|
/**
|
|
|
|
|
* \brief Prints the address data information for all the DetectAddress
|
|
|
|
|
* instances in the DetectAddress list sent as the argument.
|
|
|
|
|
@ -144,86 +145,28 @@ DetectAddress *DetectAddressLookupInList(DetectAddress *head, DetectAddress *gr)
|
|
|
|
|
*/
|
|
|
|
|
void DetectAddressPrintList(DetectAddress *head)
|
|
|
|
|
{
|
|
|
|
|
DetectAddress *cur;
|
|
|
|
|
|
|
|
|
|
SCLogInfo("list:");
|
|
|
|
|
if (head != NULL) {
|
|
|
|
|
for (cur = head; cur != NULL; cur = cur->next) {
|
|
|
|
|
DetectAddressPrint(cur);
|
|
|
|
|
}
|
|
|
|
|
for (DetectAddress *cur = head; cur != NULL; cur = cur->next) {
|
|
|
|
|
DetectAddressPrint(cur);
|
|
|
|
|
}
|
|
|
|
|
SCLogInfo("endlist");
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \internal
|
|
|
|
|
* \brief Frees a list of DetectAddress instances.
|
|
|
|
|
*
|
|
|
|
|
* \param head Pointer to a list of DetectAddress instances to be freed.
|
|
|
|
|
*/
|
|
|
|
|
void DetectAddressCleanupList(DetectAddress *head)
|
|
|
|
|
static void DetectAddressCleanupList(DetectAddress *head)
|
|
|
|
|
{
|
|
|
|
|
DetectAddress *cur, *next;
|
|
|
|
|
|
|
|
|
|
if (head == NULL)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
for (cur = head; cur != NULL; ) {
|
|
|
|
|
next = cur->next;
|
|
|
|
|
for (DetectAddress *cur = head; cur != NULL; ) {
|
|
|
|
|
DetectAddress *next = cur->next;
|
|
|
|
|
cur->next = NULL;
|
|
|
|
|
DetectAddressFree(cur);
|
|
|
|
|
cur = next;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Do a sorted insert, where the top of the list should be the biggest
|
|
|
|
|
* network/range.
|
|
|
|
|
*
|
|
|
|
|
* XXX current sorting only works for overlapping nets
|
|
|
|
|
*
|
|
|
|
|
* \param head Pointer to the list of DetectAddress.
|
|
|
|
|
* \param ag Pointer to the DetectAddress that has to be added to the
|
|
|
|
|
* above list.
|
|
|
|
|
*
|
|
|
|
|
* \retval 0 On successfully inserting the DetectAddress.
|
|
|
|
|
* \retval -1 On failure.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
int DetectAddressAdd(DetectAddress **head, DetectAddress *ag)
|
|
|
|
|
{
|
|
|
|
|
DetectAddress *cur, *prev_cur = NULL;
|
|
|
|
|
int r = 0;
|
|
|
|
|
|
|
|
|
|
if (*head != NULL) {
|
|
|
|
|
for (cur = *head; cur != NULL; cur = cur->next) {
|
|
|
|
|
prev_cur = cur;
|
|
|
|
|
r = DetectAddressCmp(ag, cur);
|
|
|
|
|
if (r == ADDRESS_EB) {
|
|
|
|
|
/* insert here */
|
|
|
|
|
ag->prev = cur->prev;
|
|
|
|
|
ag->next = cur;
|
|
|
|
|
|
|
|
|
|
cur->prev = ag;
|
|
|
|
|
if (*head == cur)
|
|
|
|
|
*head = ag;
|
|
|
|
|
else
|
|
|
|
|
ag->prev->next = ag;
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ag->prev = prev_cur;
|
|
|
|
|
if (prev_cur != NULL)
|
|
|
|
|
prev_cur->next = ag;
|
|
|
|
|
} else {
|
|
|
|
|
*head = ag;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -276,9 +219,8 @@ static DetectAddress *GetHeadPtr(DetectAddressHead *gh, DetectAddress *new)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Same as DetectAddressInsert, but then for inserting a address group
|
|
|
|
|
* object. This also makes sure SigGroupContainer lists are handled
|
|
|
|
|
* correctly.
|
|
|
|
|
* \internal
|
|
|
|
|
* \brief insert DetectAddress into a DetectAddressHead
|
|
|
|
|
*
|
|
|
|
|
* \param de_ctx Pointer to the detection engine context.
|
|
|
|
|
* \param gh Pointer to the DetectAddressHead list to which it has to
|
|
|
|
|
@ -289,7 +231,7 @@ static DetectAddress *GetHeadPtr(DetectAddressHead *gh, DetectAddress *new)
|
|
|
|
|
* \retval -1 On error.
|
|
|
|
|
* \retval 0 Not inserted, memory of new is freed.
|
|
|
|
|
*/
|
|
|
|
|
int DetectAddressInsert(DetectEngineCtx *de_ctx, DetectAddressHead *gh,
|
|
|
|
|
static int DetectAddressInsert(DetectEngineCtx *de_ctx, DetectAddressHead *gh,
|
|
|
|
|
DetectAddress *new)
|
|
|
|
|
{
|
|
|
|
|
DetectAddress *head = NULL;
|
|
|
|
|
@ -412,33 +354,6 @@ error:
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Join two addresses groups together.
|
|
|
|
|
*
|
|
|
|
|
* \param de_ctx Pointer to the detection engine context.
|
|
|
|
|
* \param target Pointer to the target address group.
|
|
|
|
|
* \param source Pointer to the source address group.
|
|
|
|
|
*
|
|
|
|
|
* \retval 0 On success.
|
|
|
|
|
* \retval -1 On failure.
|
|
|
|
|
*/
|
|
|
|
|
int DetectAddressJoin(DetectEngineCtx *de_ctx, DetectAddress *target,
|
|
|
|
|
DetectAddress *source)
|
|
|
|
|
{
|
|
|
|
|
if (target == NULL || source == NULL)
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
if (target->ip.family != source->ip.family)
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
if (target->ip.family == AF_INET)
|
|
|
|
|
return DetectAddressJoinIPv4(de_ctx, target, source);
|
|
|
|
|
else if (target->ip.family == AF_INET6)
|
|
|
|
|
return DetectAddressJoinIPv6(de_ctx, target, source);
|
|
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Checks if two address group lists are equal.
|
|
|
|
|
*
|
|
|
|
|
@ -521,7 +436,7 @@ static void DetectAddressParseIPv6CIDR(int cidr, struct in6_addr *in6)
|
|
|
|
|
* \retval 0 On successfully parsing the address string.
|
|
|
|
|
* \retval -1 On failure.
|
|
|
|
|
*/
|
|
|
|
|
int DetectAddressParseString(DetectAddress *dd, const char *str)
|
|
|
|
|
static int DetectAddressParseString(DetectAddress *dd, const char *str)
|
|
|
|
|
{
|
|
|
|
|
char *ip = NULL;
|
|
|
|
|
char *ip2 = NULL;
|
|
|
|
|
@ -701,25 +616,19 @@ error:
|
|
|
|
|
*/
|
|
|
|
|
static DetectAddress *DetectAddressParseSingle(const char *str)
|
|
|
|
|
{
|
|
|
|
|
DetectAddress *dd;
|
|
|
|
|
|
|
|
|
|
SCLogDebug("str %s", str);
|
|
|
|
|
|
|
|
|
|
dd = DetectAddressInit();
|
|
|
|
|
DetectAddress *dd = DetectAddressInit();
|
|
|
|
|
if (dd == NULL)
|
|
|
|
|
goto error;
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
if (DetectAddressParseString(dd, str) < 0) {
|
|
|
|
|
SCLogDebug("AddressParse failed");
|
|
|
|
|
goto error;
|
|
|
|
|
DetectAddressFree(dd);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return dd;
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
if (dd != NULL)
|
|
|
|
|
DetectAddressFree(dd);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -1492,26 +1401,24 @@ static const DetectAddressMap *DetectAddressMapLookup(DetectEngineCtx *de_ctx,
|
|
|
|
|
int DetectAddressParse(const DetectEngineCtx *de_ctx,
|
|
|
|
|
DetectAddressHead *gh, const char *str)
|
|
|
|
|
{
|
|
|
|
|
int r;
|
|
|
|
|
DetectAddressHead *ghn = NULL;
|
|
|
|
|
|
|
|
|
|
SCLogDebug("gh %p, str %s", gh, str);
|
|
|
|
|
|
|
|
|
|
if (str == NULL) {
|
|
|
|
|
SCLogDebug("DetectAddressParse can not be run with NULL address");
|
|
|
|
|
goto error;
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ghn = DetectAddressHeadInit();
|
|
|
|
|
DetectAddressHead *ghn = DetectAddressHeadInit();
|
|
|
|
|
if (ghn == NULL) {
|
|
|
|
|
SCLogDebug("DetectAddressHeadInit for ghn failed");
|
|
|
|
|
goto error;
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
r = DetectAddressParse2(de_ctx, gh, ghn, str, /* start with negate no */0, NULL);
|
|
|
|
|
int r = DetectAddressParse2(de_ctx, gh, ghn, str, /* start with negate no */0, NULL);
|
|
|
|
|
if (r < 0) {
|
|
|
|
|
SCLogDebug("DetectAddressParse2 returned %d", r);
|
|
|
|
|
goto error;
|
|
|
|
|
DetectAddressHeadFree(ghn);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SCLogDebug("gh->ipv4_head %p, ghn->ipv4_head %p", gh->ipv4_head,
|
|
|
|
|
@ -1522,17 +1429,13 @@ int DetectAddressParse(const DetectEngineCtx *de_ctx,
|
|
|
|
|
/* merge the 'not' address groups */
|
|
|
|
|
if (DetectAddressMergeNot(gh, ghn) < 0) {
|
|
|
|
|
SCLogDebug("DetectAddressMergeNot failed");
|
|
|
|
|
goto error;
|
|
|
|
|
DetectAddressHeadFree(ghn);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* free the temp negate head */
|
|
|
|
|
DetectAddressHeadFree(ghn);
|
|
|
|
|
return contains_negation ? 1 : 0;
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
if (ghn != NULL)
|
|
|
|
|
DetectAddressHeadFree(ghn);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const DetectAddressHead *DetectParseAddress(DetectEngineCtx *de_ctx,
|
|
|
|
|
@ -1566,21 +1469,6 @@ const DetectAddressHead *DetectParseAddress(DetectEngineCtx *de_ctx,
|
|
|
|
|
return head;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Returns a new instance of DetectAddressHead.
|
|
|
|
|
*
|
|
|
|
|
* \retval gh Pointer to the new instance of DetectAddressHead.
|
|
|
|
|
*/
|
|
|
|
|
DetectAddressHead *DetectAddressHeadInit(void)
|
|
|
|
|
{
|
|
|
|
|
DetectAddressHead *gh = SCMalloc(sizeof(DetectAddressHead));
|
|
|
|
|
if (unlikely(gh == NULL))
|
|
|
|
|
return NULL;
|
|
|
|
|
memset(gh, 0, sizeof(DetectAddressHead));
|
|
|
|
|
|
|
|
|
|
return gh;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Cleans a DetectAddressHead. The functions frees the address
|
|
|
|
|
* group heads(ipv4 and ipv6) inside the DetectAddressHead
|
|
|
|
|
@ -1605,21 +1493,6 @@ void DetectAddressHeadCleanup(DetectAddressHead *gh)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Frees a DetectAddressHead instance.
|
|
|
|
|
*
|
|
|
|
|
* \param gh Pointer to the DetectAddressHead instance to be freed.
|
|
|
|
|
*/
|
|
|
|
|
void DetectAddressHeadFree(DetectAddressHead *gh)
|
|
|
|
|
{
|
|
|
|
|
if (gh != NULL) {
|
|
|
|
|
DetectAddressHeadCleanup(gh);
|
|
|
|
|
SCFree(gh);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Dispatcher function that calls the ipv4 and ipv6 address cut functions.
|
|
|
|
|
* Have a look at DetectAddressCutIPv4() and DetectAddressCutIPv6() for
|
|
|
|
|
@ -1728,8 +1601,7 @@ int DetectAddressMatchIPv4(const DetectMatchAddressIPv4 *addrs,
|
|
|
|
|
SCReturnInt(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint16_t idx;
|
|
|
|
|
for (idx = 0; idx < addrs_cnt; idx++) {
|
|
|
|
|
for (uint16_t idx = 0; idx < addrs_cnt; idx++) {
|
|
|
|
|
if (SCNtohl(a->addr_data32[0]) >= addrs[idx].ip &&
|
|
|
|
|
SCNtohl(a->addr_data32[0]) <= addrs[idx].ip2)
|
|
|
|
|
{
|
|
|
|
|
@ -1763,15 +1635,11 @@ int DetectAddressMatchIPv6(const DetectMatchAddressIPv6 *addrs,
|
|
|
|
|
SCReturnInt(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint16_t idx;
|
|
|
|
|
int i = 0;
|
|
|
|
|
uint16_t result1, result2;
|
|
|
|
|
|
|
|
|
|
/* See if the packet address is within the range of any entry in the
|
|
|
|
|
* signature's address match array.
|
|
|
|
|
*/
|
|
|
|
|
for (idx = 0; idx < addrs_cnt; idx++) {
|
|
|
|
|
result1 = result2 = 0;
|
|
|
|
|
for (uint16_t idx = 0; idx < addrs_cnt; idx++) {
|
|
|
|
|
uint16_t result1 = 0, result2 = 0;
|
|
|
|
|
|
|
|
|
|
/* See if packet address equals either limit. Return 1 if true. */
|
|
|
|
|
if (SCNtohl(a->addr_data32[0]) == addrs[idx].ip[0] &&
|
|
|
|
|
@ -1792,7 +1660,7 @@ int DetectAddressMatchIPv6(const DetectMatchAddressIPv6 *addrs,
|
|
|
|
|
/* See if packet address is greater than lower limit
|
|
|
|
|
* of the current signature address match pair.
|
|
|
|
|
*/
|
|
|
|
|
for (i = 0; i < 4; i++) {
|
|
|
|
|
for (int i = 0; i < 4; i++) {
|
|
|
|
|
if (SCNtohl(a->addr_data32[i]) > addrs[idx].ip[i]) {
|
|
|
|
|
result1 = 1;
|
|
|
|
|
break;
|
|
|
|
|
@ -1810,7 +1678,7 @@ int DetectAddressMatchIPv6(const DetectMatchAddressIPv6 *addrs,
|
|
|
|
|
/* See if packet address is less than upper limit
|
|
|
|
|
* of the current signature address match pair.
|
|
|
|
|
*/
|
|
|
|
|
for (i = 0; i < 4; i++) {
|
|
|
|
|
for (int i = 0; i < 4; i++) {
|
|
|
|
|
if (SCNtohl(a->addr_data32[i]) < addrs[idx].ip2[i]) {
|
|
|
|
|
result2 = 1;
|
|
|
|
|
break;
|
|
|
|
|
@ -1844,7 +1712,7 @@ int DetectAddressMatchIPv6(const DetectMatchAddressIPv6 *addrs,
|
|
|
|
|
* \param 1 On a match.
|
|
|
|
|
* \param 0 On no match.
|
|
|
|
|
*/
|
|
|
|
|
int DetectAddressMatch(DetectAddress *dd, Address *a)
|
|
|
|
|
static int DetectAddressMatch(DetectAddress *dd, Address *a)
|
|
|
|
|
{
|
|
|
|
|
SCEnter();
|
|
|
|
|
|
|
|
|
|
@ -1887,6 +1755,7 @@ int DetectAddressMatch(DetectAddress *dd, Address *a)
|
|
|
|
|
SCReturnInt(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
|
/**
|
|
|
|
|
* \brief Prints the address data held by the DetectAddress. If the address
|
|
|
|
|
* data family is IPv4, we print the the ipv4 address and mask, and
|
|
|
|
|
@ -1895,7 +1764,7 @@ int DetectAddressMatch(DetectAddress *dd, Address *a)
|
|
|
|
|
*
|
|
|
|
|
* \param ad Pointer to the DetectAddress instance to be printed.
|
|
|
|
|
*/
|
|
|
|
|
void DetectAddressPrint(DetectAddress *gr)
|
|
|
|
|
static void DetectAddressPrint(DetectAddress *gr)
|
|
|
|
|
{
|
|
|
|
|
if (gr == NULL)
|
|
|
|
|
return;
|
|
|
|
|
@ -1926,6 +1795,7 @@ void DetectAddressPrint(DetectAddress *gr)
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Find the group matching address in a group head.
|
|
|
|
|
|