From 4a49260897d05d219673e2282ba96ee37c09e9a8 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 15 Dec 2016 17:40:28 +0100 Subject: [PATCH] flowvar: shrink flowvar type by using padded space --- src/flow-bit.h | 1 + src/flow-var.h | 4 ++-- src/util-var.h | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/flow-bit.h b/src/flow-bit.h index e6161606fc..2362d51807 100644 --- a/src/flow-bit.h +++ b/src/flow-bit.h @@ -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 diff --git a/src/flow-var.h b/src/flow-var.h index 7d0d4edb87..f0bcf3c0c3 100644 --- a/src/flow-var.h +++ b/src/flow-var.h @@ -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 */ diff --git a/src/util-var.h b/src/util-var.h index ac9de2d3fb..ce491ecdcd 100644 --- a/src/util-var.h +++ b/src/util-var.h @@ -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;