]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
vars: optimize layout to reduce size requirements of flowbits and other vars
authorVictor Julien <victor@inliniac.net>
Sat, 30 Nov 2013 12:06:44 +0000 (13:06 +0100)
committerVictor Julien <victor@inliniac.net>
Sat, 30 Nov 2013 12:06:44 +0000 (13:06 +0100)
src/flow-bit.h
src/flow-var.h
src/util-var-name.c
src/util-var.h

index 3bd2ebb33c4dea1a7964df55c4afceeaaf2139a2..633b5ee3d9a9b160c2ef41cc95e94fa42465909e 100644 (file)
 
 typedef struct FlowBit_ {
     uint8_t type; /* type, DETECT_FLOWBITS 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. */
-    uint16_t idx; /* name idx */
 } FlowBit;
 
 void FlowBitFree(FlowBit *);
index cd3e42cdb079189b2cdf4b6fc2f838083455f31b..e45d803043a7ac57ab4df12753f0d69c66cf5a11 100644 (file)
@@ -47,10 +47,10 @@ typedef struct FlowVarTypeInt_ {
 /** Generic Flowvar Structure */
 typedef struct FlowVar_ {
     uint8_t type;       /* type, DETECT_FLOWVAR 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. */
-    uint16_t idx;       /* name idx */
     uint8_t datatype;
     union {
         FlowVarTypeStr fv_str;
index d14938237e42d8fd56d9dd924a09b528939c785d..c7057815dbdc5275cfcf9789df58c963260168c3 100644 (file)
@@ -31,8 +31,8 @@
 typedef struct VariableName_ {
     char *name;
     uint8_t type; /* flowbit, pktvar, etc */
-    uint16_t idx;
     uint8_t flags;
+    uint16_t idx;
 } VariableName;
 
 static uint32_t VariableNameHash(HashListTable *ht, void *buf, uint16_t buflen) {
index 7adc1e6e77870c6b72356f164d3f61c0cb8ca952..5d28cc7cc11f6a1f54868ffcc0de7968ee831067 100644 (file)
@@ -26,8 +26,8 @@
 
 typedef struct GenericVar_ {
     uint8_t type;
-    struct GenericVar_ *next;
     uint16_t idx;
+    struct GenericVar_ *next;
 } GenericVar;
 
 void GenericVarFree(GenericVar *);