MEDIUM: cli: implement 'mode cli' proxy analyzers

This patch implements analysers for parsing the CLI and extra features
for the master's CLI.

For each command (sent alone, or separated by ; or \n) the request
analyser will determine to which server it should send the request.

The 'mode cli' proxy is able to parse a prefix for each command which is
used to select the apropriate server. The prefix start by @ and is
followed by "master", the PID preceded by ! or the relative PID. (e.g.
@master, @1, @!1234). The servers are not round-robined anymore.

The command is sent with a SHUTW which force the server to close the
connection after sending its response. However the proxy allows a
keepalive connection on the client side and does not close.

The response analyser does not do much stuff, it only reinits the
connection when it received a close from the server, and forward the
response. It does not analyze the response data.
The only guarantee of the end of the response is the close of the
server, we can't rely on the double \n since it's not send by every
command.

This could be reimplemented later as a filter.
diff --git a/include/types/channel.h b/include/types/channel.h
index f7ddd1a..e4f2824 100644
--- a/include/types/channel.h
+++ b/include/types/channel.h
@@ -180,6 +180,9 @@
 #define AN_RES_FLT_XFER_DATA    0x04000000
 #define AN_RES_FLT_END          0x08000000
 
+#define AN_REQ_WAIT_CLI         0x10000000
+#define AN_RES_WAIT_CLI         0x20000000
+
 /* Magic value to forward infinite size (TCP, ...), used with ->to_forward */
 #define CHN_INFINITE_FORWARD    MAX_RANGE(unsigned int)
 
diff --git a/include/types/proxy.h b/include/types/proxy.h
index da09848..b7c9038 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -65,6 +65,7 @@
 	PR_MODE_TCP = 0,
 	PR_MODE_HTTP,
 	PR_MODE_HEALTH,
+	PR_MODE_CLI,
 } __attribute__((packed));
 
 enum PR_SRV_STATE_FILE {
diff --git a/include/types/stream.h b/include/types/stream.h
index feeb56b..87bdf46 100644
--- a/include/types/stream.h
+++ b/include/types/stream.h
@@ -162,6 +162,7 @@
 	void (*srv_error)(struct stream *s,     /* the function to call upon unrecoverable server errors (or NULL) */
 			  struct stream_interface *si);
 
+	int pcli_next_pid;                      /* next target PID to use for the CLI proxy */
 	char *unique_id;                        /* custom unique ID */
 
 	/* These two pointers are used to resume the execution of the rule lists. */