[MEDIUM] add support for RDP cookie persistence

The new statement "persist rdp-cookie" enables RDP cookie
persistence. The RDP cookie is then extracted from the RDP
protocol, and compared against available servers. If a server
matches the RDP cookie, then it gets the connection.
diff --git a/include/proto/proto_tcp.h b/include/proto/proto_tcp.h
index c188c27..2cf3be1 100644
--- a/include/proto/proto_tcp.h
+++ b/include/proto/proto_tcp.h
@@ -35,6 +35,7 @@
 int tcp_inspect_request(struct session *s, struct buffer *req, int an_bit);
 int acl_fetch_rdp_cookie(struct proxy *px, struct session *l4, void *l7, int dir,
                          struct acl_expr *expr, struct acl_test *test);
+int tcp_persist_rdp_cookie(struct session *s, struct buffer *req, int an_bit);
 
 #endif /* _PROTO_PROTO_TCP_H */
 
diff --git a/include/types/buffers.h b/include/types/buffers.h
index 234020f..0553116 100644
--- a/include/types/buffers.h
+++ b/include/types/buffers.h
@@ -116,6 +116,7 @@
 #define AN_REQ_UNIX_STATS       0x00000100  /* process unix stats socket request */
 
 #define AN_RTR_HTTP_HDR         0x00000200  /* inspect HTTP response headers */
+#define AN_REQ_PRST_RDP_COOKIE  0x00000400  /* persistence on rdp cookie */
 
 /* describes a chunk of string */
 struct chunk {
diff --git a/include/types/proxy.h b/include/types/proxy.h
index 41dd3e1..43f31a6 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -119,6 +119,7 @@
 #define PR_O2_LOGERRORS	0x00000040      /* log errors and retries at level LOG_ERR */
 #define PR_O2_SMARTACC 	0x00000080      /* don't immediately ACK request after accept */
 #define PR_O2_SMARTCON 	0x00000100      /* don't immediately send empty ACK after connect */
+#define PR_O2_RDPC_PRST	0x00000200      /* Actvate rdp cookie analyser */
 
 /* This structure is used to apply fast weighted round robin on a server group */
 struct fwrr_group {
@@ -197,6 +198,8 @@
 	char *cookie_domain;			/* domain used to insert the cookie */
 	char *cookie_name;			/* name of the cookie to look for */
 	int  cookie_len;			/* strlen(cookie_name), computed only once */
+	char *rdp_cookie_name;			/* name of the RDP cookie to look for */
+	int  rdp_cookie_len;			/* strlen(rdp_cookie_name), computed only once */
 	char *url_param_name;			/* name of the URL parameter used for hashing */
 	int  url_param_len;			/* strlen(url_param_name), computed only once */
 	unsigned url_param_post_limit;		/* if checking POST body for URI parameter, max body to wait for */