MEDIUM: log: Unique ID

The Unique ID, is an ID generated with several informations. You can use
a log-format string to customize it, with the "unique-id-format" keyword,
and insert it in the request header, with the "unique-id-header" keyword.
diff --git a/include/proto/log.h b/include/proto/log.h
index 0e41eca..5adf674 100644
--- a/include/proto/log.h
+++ b/include/proto/log.h
@@ -33,6 +33,7 @@
 #include <types/session.h>
 
 extern struct pool_head *pool2_requri;
+extern struct pool_head *pool2_uniqueid;
 
 extern char *log_format;
 extern char default_tcp_log_format[];
diff --git a/include/types/log.h b/include/types/log.h
index ad96e9a..269fb46 100644
--- a/include/types/log.h
+++ b/include/types/log.h
@@ -31,6 +31,8 @@
 #define NB_LOG_FACILITIES       24
 #define NB_LOG_LEVELS           8
 #define SYSLOG_PORT             514
+#define UNIQUEID_LEN            128
+
 
 /* lists of fields that can be logged */
 enum {
@@ -86,6 +88,7 @@
 	LOG_FMT_HDRRESPONSLIST,
 	LOG_FMT_REQ,
 	LOG_FMT_HOSTNAME,
+	LOG_FMT_UNIQUEID,
 };
 
 /* enum for parse_logformat */
diff --git a/include/types/proxy.h b/include/types/proxy.h
index d69a914..aa6cec8 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -290,6 +290,8 @@
 	struct proxy *next;
 	struct list logsrvs;
 	struct list logformat; 			/* log_format linked list */
+	char *header_unique_id; 		/* unique-id header */
+	struct list format_unique_id;		/* unique-id format */
 	int to_log;				/* things to be logged (LW_*) */
 	int stop_time;                          /* date to stop listening, when stopping != 0 (int ticks) */
 	struct hdr_exp *req_exp;		/* regular expressions for request headers */
diff --git a/include/types/session.h b/include/types/session.h
index 5678e5c..7539c0c 100644
--- a/include/types/session.h
+++ b/include/types/session.h
@@ -207,6 +207,7 @@
 	void (*srv_error)(struct session *s,	/* the function to call upon unrecoverable server errors (or NULL) */
 			  struct stream_interface *si);
 	unsigned int uniq_id;			/* unique ID used for the traces */
+	char *unique_id;			/* custom unique ID */
 };
 
 /* parameters to configure tracked counters */