vars: optimize layout to reduce size requirements of flowbits and other vars

pull/669/head
Victor Julien 12 years ago
parent 3e604b8703
commit ffe4a302a1

@ -29,10 +29,10 @@
typedef struct FlowBit_ { typedef struct FlowBit_ {
uint8_t type; /* type, DETECT_FLOWBITS in this case */ uint8_t type; /* type, DETECT_FLOWBITS in this case */
uint16_t idx; /* name idx */
GenericVar *next; /* right now just implement this as a list, GenericVar *next; /* right now just implement this as a list,
* in the long run we have think of something * in the long run we have think of something
* faster. */ * faster. */
uint16_t idx; /* name idx */
} FlowBit; } FlowBit;
void FlowBitFree(FlowBit *); void FlowBitFree(FlowBit *);

@ -47,10 +47,10 @@ typedef struct FlowVarTypeInt_ {
/** Generic Flowvar Structure */ /** Generic Flowvar Structure */
typedef struct FlowVar_ { typedef struct FlowVar_ {
uint8_t type; /* type, DETECT_FLOWVAR in this case */ uint8_t type; /* type, DETECT_FLOWVAR in this case */
uint16_t idx; /* name idx */
GenericVar *next; /* right now just implement this as a list, GenericVar *next; /* right now just implement this as a list,
* in the long run we have think of something * in the long run we have think of something
* faster. */ * faster. */
uint16_t idx; /* name idx */
uint8_t datatype; uint8_t datatype;
union { union {
FlowVarTypeStr fv_str; FlowVarTypeStr fv_str;

@ -31,8 +31,8 @@
typedef struct VariableName_ { typedef struct VariableName_ {
char *name; char *name;
uint8_t type; /* flowbit, pktvar, etc */ uint8_t type; /* flowbit, pktvar, etc */
uint16_t idx;
uint8_t flags; uint8_t flags;
uint16_t idx;
} VariableName; } VariableName;
static uint32_t VariableNameHash(HashListTable *ht, void *buf, uint16_t buflen) { static uint32_t VariableNameHash(HashListTable *ht, void *buf, uint16_t buflen) {

@ -26,8 +26,8 @@
typedef struct GenericVar_ { typedef struct GenericVar_ {
uint8_t type; uint8_t type;
struct GenericVar_ *next;
uint16_t idx; uint16_t idx;
struct GenericVar_ *next;
} GenericVar; } GenericVar;
void GenericVarFree(GenericVar *); void GenericVarFree(GenericVar *);

Loading…
Cancel
Save