xbit: move to util-var

We can reuse the type for hostbits and flowbits as well.
pull/1422/head
Victor Julien 10 years ago
parent 61cb2abc8d
commit a716dded04

@ -156,14 +156,6 @@ int IPPairBitIsnotset(IPPair *h, uint16_t idx)
return r;
}
void XBitFree(XBit *fb)
{
if (fb == NULL)
return;
SCFree(fb);
}
/* TESTS */
#ifdef UNITTESTS

@ -27,18 +27,7 @@
#include "ippair.h"
#include "util-var.h"
typedef struct XBit_ {
uint8_t type; /* type, DETECT_XBITS in this case */
uint16_t idx; /* name idx */
GenericVar *next; /* right now just implement this as a list,
* in the long run we have think of something
* faster. */
} XBit;
void XBitFree(XBit *fb);
void IPPairBitInitCtx(void);
void IPPairBitFree(XBit *);
void IPPairBitRegisterTests(void);
int IPPairHasIPPairBits(IPPair *host);

@ -36,6 +36,14 @@
#include "util-debug.h"
static void XBitFree(XBit *fb)
{
if (fb == NULL)
return;
SCFree(fb);
}
void GenericVarFree(GenericVar *gv)
{
if (gv == NULL)

@ -30,6 +30,12 @@ typedef struct GenericVar_ {
struct GenericVar_ *next;
} GenericVar;
typedef struct XBit_ {
uint8_t type; /* type, DETECT_XBITS in this case */
uint16_t idx; /* name idx */
GenericVar *next;
} XBit;
void GenericVarFree(GenericVar *);
void GenericVarAppend(GenericVar **, GenericVar *);
void GenericVarRemove(GenericVar **, GenericVar *);

Loading…
Cancel
Save