[MEDIUM] stick_table: add room for extra data types

The stick_tables will now be able to store extra data for a same key.
A limited set of extra data types will be defined and for each of them
an offset in the sticky session will be assigned at startup time. All
of this information will be stored in the stick table.

The extra data types will have to be specified after the new "store"
keyword of the "stick-table" directive, which will reserve some space
for them.
diff --git a/include/types/stick_table.h b/include/types/stick_table.h
index de23610..dda9edb 100644
--- a/include/types/stick_table.h
+++ b/include/types/stick_table.h
@@ -3,6 +3,7 @@
  * Macros, variables and structures for stick tables management.
  *
  * Copyright (C) 2009-2010 EXCELIANCE, Emeric Brun <ebrun@exceliance.fr>
+ * Copyright (C) 2010 Willy Tarreau <w@1wt.eu>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -38,6 +39,24 @@
 	STKTABLE_TYPES            /* Number of types, must always be last */
 };
 
+/* The types of extra data we can store in a stick table */
+enum {
+	STKTABLE_DATA_TYPES       /* Number of data types, must always be last */
+};
+
+/* stick_table extra data. This is mainly used for casting or size computation */
+union stktable_data {
+};
+
+#define stktable_data_size(type) (sizeof(((union stktable_data*)0)->type))
+#define stktable_data_cast(ptr, type) ((union stktable_data*)(ptr))->type
+
+/* known data types */
+struct stktable_data_type {
+	const char *name; /* name of the data type */
+	int data_length;  /* length of this type, or 0 if variable (eg: string) */
+};
+
 /* stick table key type flags */
 #define STK_F_CUSTOM_KEYSIZE      0x00000001   /* this table's key size is configurable */
 
@@ -75,9 +94,10 @@
 	int exp_next;             /* next expiration date (ticks) */
 	int expire;               /* time to live for sticky sessions (milliseconds) */
 	int data_size;            /* the size of the data that is prepended *before* stksess */
+	int data_ofs[STKTABLE_DATA_TYPES]; /* negative offsets of present data types, or 0 if absent */
 };
 
-/*** The definitions below should probably be better placed in pattern.h ***/
+struct stktable_data_type stktable_data_types[STKTABLE_DATA_TYPES];
 
 /* stick table key data */
 union stktable_key_data {