[MEDIUM] Create new protected pattern types CONSTSTRING and CONSTDATA to force memcpy if data from protected areas need to be manipulated.

Enhance pattern convs and fetch argument parsing, now fetchs and convs callbacks used typed args.
Add more details on error messages on parsing pattern expression function.
Update existing pattern convs and fetchs to new proto.
Create stick table key type "binary".
Manage Truncation and padding if pattern's fetch-converted result don't match table key size.
diff --git a/include/types/pattern.h b/include/types/pattern.h
index d9346d9..78614bc 100644
--- a/include/types/pattern.h
+++ b/include/types/pattern.h
@@ -31,18 +31,43 @@
 	PATTERN_TYPE_IP = 0,      /* ipv4 type */
 	PATTERN_TYPE_INTEGER,     /* unsigned 32bits integer type */
 	PATTERN_TYPE_STRING,      /* char string type */
+	PATTERN_TYPE_DATA,        /* buffer type */
+	PATTERN_TYPE_CONSTSTRING, /* constant char string type, data need dup before conversion */
+	PATTERN_TYPE_CONSTDATA,   /* constant buffer type, data need dup before conversion */
 	PATTERN_TYPES             /* number of types, must always be last */
 };
 
+
+/* pattern arg types */
+enum {
+	PATTERN_ARG_TYPE_IP = 0,      /* ipv4 type */
+	PATTERN_ARG_TYPE_INTEGER,     /* unsigned 32bits integer type */
+	PATTERN_ARG_TYPE_SINTEGER,    /* signed 32bits integer type */
+	PATTERN_ARG_TYPE_STRING       /* string type */
+};
+
 /* pattern fetch direction */
 #define PATTERN_FETCH_REQ	1
 #define PATTERN_FETCH_RTR	2
 
+
+union pattern_arg_data {
+	struct in_addr ip;        /* used for ipv4 type */
+	uint32_t integer;         /* used for unsigned 32bits integer type */
+	int32_t sinteger;         /* used for signed 32bits integer type */
+	struct chunk str;
+};
+
+struct pattern_arg {
+	int type;                    /* type of arg */
+	union pattern_arg_data data; /* data */
+};
+
 /* pattern result data */
 union pattern_data {
 	struct in_addr ip;        /* used for ipv4 type */
 	uint32_t integer;         /* used for unsigned 32bits integer type */
-	struct chunk str;         /* used for char string type */
+	struct chunk str;         /* used for char string type or buffers*/
 };
 
 /* pattern result */
@@ -54,22 +79,22 @@
 /* pattern conversion */
 struct pattern_conv {
 	const char *kw;                           /* configuration keyword  */
-	int (*process)(const void *arg_p,
+	int (*process)(const struct pattern_arg *arg_p,
 	               int arg_i,
 	               union pattern_data *data); /* process function */
-	unsigned int in_type;                     /* input needed pattern type */
-	unsigned int out_type;                    /* output pattern type */
 	int (*parse_args)(const char *arg_str,
-			  void **arg_p,
+			  struct pattern_arg **arg_p,
 			  int *arg_i);            /* argument parser. Can be NULL. */
+	unsigned int in_type;                     /* input needed pattern type */
+	unsigned int out_type;                    /* output pattern type */
 };
 
 /* pattern conversion expression */
 struct pattern_conv_expr {
 	struct list list;                         /* member of a pattern expression */
 	struct pattern_conv *conv;                /* pattern conversion */
-	void *arg_p;                              /* pointer arg, most often a string argument */
-	int arg_i;                                /* int arg, most often the argument's length */
+	struct pattern_arg *arg_p;                /* pointer on args */
+	int arg_i;                                /* number of args */
 };
 
 /* pattern fetch */
@@ -78,9 +103,12 @@
 	int (*process)(struct proxy *px,
 	               struct session *l4,
 	               void *l7,
-	               int dir, const char *arg,
-	               int arg_len,
+	               int dir, const struct pattern_arg *arg_p,
+	               int arg_i,
 	               union pattern_data *data); /* fetch processing function */
+	int (*parse_args)(const char *arg_str,
+			  struct pattern_arg **arg_p,
+			  int *arg_i);            /* argument parser. Can be NULL. */
 	unsigned long out_type;                   /* output pattern type */
 	int dir;                                  /* usable directions */
 };
@@ -89,8 +117,8 @@
 struct pattern_expr {
 	struct list list;                         /* member of list of pattern, currently not used */
 	struct pattern_fetch *fetch;              /* pattern fetch */
-	char *arg;                                /* configured keyword argument */
-	int arg_len;                              /* configured keyword argument length */
+	struct pattern_arg *arg_p;                /* pointer on args */
+	int arg_i;                                /* number of args */
 	struct list conv_exprs;                   /* list of conversion expression to apply */
 };
 
diff --git a/include/types/stick_table.h b/include/types/stick_table.h
index 4338e59..b835066 100644
--- a/include/types/stick_table.h
+++ b/include/types/stick_table.h
@@ -37,6 +37,7 @@
 	STKTABLE_TYPE_IP = 0,     /* table key is ipv4 */
 	STKTABLE_TYPE_INTEGER,    /* table key is unsigned 32bit integer */
 	STKTABLE_TYPE_STRING,     /* table key is a null terminated string */
+	STKTABLE_TYPE_BINARY,     /* table key is a buffer of data  */
 	STKTABLE_TYPES            /* Number of types, must always be last */
 };
 
@@ -118,6 +119,8 @@
 	size_t default_size;      /* default key size */
 };
 
+extern struct stktable_type stktable_types[];
+
 /* Sticky session.
  * Any additional data related to the stuck session is installed *before*
  * stksess (with negative offsets). This allows us to run variable-sized
@@ -159,7 +162,7 @@
 union stktable_key_data {
 	struct in_addr ip;        /* used to store an ip key */
 	uint32_t integer;         /* used to store an integer key */
-	char buf[BUFSIZE];        /* used to store a null terminated string key */
+	char buf[BUFSIZE];        /* used to store a null terminated string key or a buffer of data */
 };
 
 /* stick table key */