From ffe4a302a1c61ff0e868e9ab3f2d5683cb4a24c8 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sat, 30 Nov 2013 13:06:44 +0100 Subject: [PATCH] vars: optimize layout to reduce size requirements of flowbits and other vars --- src/flow-bit.h | 2 +- src/flow-var.h | 2 +- src/util-var-name.c | 2 +- src/util-var.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/flow-bit.h b/src/flow-bit.h index 3bd2ebb33c..633b5ee3d9 100644 --- a/src/flow-bit.h +++ b/src/flow-bit.h @@ -29,10 +29,10 @@ 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 *); diff --git a/src/flow-var.h b/src/flow-var.h index cd3e42cdb0..e45d803043 100644 --- a/src/flow-var.h +++ b/src/flow-var.h @@ -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; diff --git a/src/util-var-name.c b/src/util-var-name.c index d14938237e..c7057815db 100644 --- a/src/util-var-name.c +++ b/src/util-var-name.c @@ -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) { diff --git a/src/util-var.h b/src/util-var.h index 7adc1e6e77..5d28cc7cc1 100644 --- a/src/util-var.h +++ b/src/util-var.h @@ -26,8 +26,8 @@ typedef struct GenericVar_ { uint8_t type; - struct GenericVar_ *next; uint16_t idx; + struct GenericVar_ *next; } GenericVar; void GenericVarFree(GenericVar *);