]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
xbit: move to util-var
authorVictor Julien <victor@inliniac.net>
Sat, 20 Dec 2014 09:00:24 +0000 (10:00 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 16 Apr 2015 08:11:24 +0000 (10:11 +0200)
We can reuse the type for hostbits and flowbits as well.

src/ippair-bit.c
src/ippair-bit.h
src/util-var.c
src/util-var.h

index 0a38568786d5fa4b13aff7bd109ccb5aaa471496..5a72288867f11fa66d6e70fbe469c16d34e4943a 100644 (file)
@@ -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
index 43019c920e1246f9cf4bf2082479ca359794a9a1..e44c0320a90d026cb9ebf1d7df004ce1dda20067 100644 (file)
 #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);
index fb0b1f4a99f36364fdadbb7657fb15d4f46d85d7..0ba93deb45010b8cac42fb6f4caf4bd1ce18d5fc 100644 (file)
 
 #include "util-debug.h"
 
+static void XBitFree(XBit *fb)
+{
+    if (fb == NULL)
+        return;
+
+    SCFree(fb);
+}
+
 void GenericVarFree(GenericVar *gv)
 {
     if (gv == NULL)
index 5d28cc7cc11f6a1f54868ffcc0de7968ee831067..21907227962e7dbd26a4fb72df75cfc2e9e81c01 100644 (file)
@@ -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 *);