]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
flowvar: shrink flowvar type by using padded space
authorVictor Julien <victor@inliniac.net>
Thu, 15 Dec 2016 16:40:28 +0000 (17:40 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 16 Feb 2017 09:35:44 +0000 (10:35 +0100)
src/flow-bit.h
src/flow-var.h
src/util-var.h

index e6161606fc42bbc9e3f1ab007e18b046188b5cb4..2362d5180795e881786d6d9ecd65ffd40b343630 100644 (file)
@@ -29,6 +29,7 @@
 
 typedef struct FlowBit_ {
     uint8_t type; /* type, DETECT_FLOWBITS in this case */
+    uint8_t pad[3];
     uint32_t idx; /* name idx */
     GenericVar *next; /* right now just implement this as a list,
                        * in the long run we have think of something
index 7d0d4edb8720aa053d2b12b30505b1e71ec289ee..f0bcf3c0c3f61ee45385c2267ad66c2aeca5ef94 100644 (file)
@@ -47,17 +47,17 @@ typedef struct FlowVarTypeInt_ {
 /** Generic Flowvar Structure */
 typedef struct FlowVar_ {
     uint8_t type;       /* type, DETECT_FLOWVAR in this case */
+    uint8_t datatype;
+    uint16_t keylen;
     uint32_t idx;       /* name idx */
     GenericVar *next;   /* right now just implement this as a list,
                          * in the long run we have think of something
                          * faster. */
-    uint8_t datatype;
     union {
         FlowVarTypeStr fv_str;
         FlowVarTypeInt fv_int;
     } data;
     uint8_t *key;
-    uint16_t keylen;
 } FlowVar;
 
 /** Flowvar Interface API */
index ac9de2d3fb478740913d53320cf9044330aea122..ce491ecdcd82d56683dc38fbec8cf5a04978f6fc 100644 (file)
@@ -47,12 +47,14 @@ enum VarTypes {
 
 typedef struct GenericVar_ {
     uint8_t type;
+    uint8_t pad[3];
     uint32_t idx;
     struct GenericVar_ *next;
 } GenericVar;
 
 typedef struct XBit_ {
     uint8_t type;       /* type, DETECT_XBITS in this case */
+    uint8_t pad[3];
     uint32_t idx;       /* name idx */
     GenericVar *next;
     uint32_t expire;