[MEDIUM] move connection establishment from backend to the SI.

The connection establishment was completely handled by backend.c which
normally just handles LB algos. Since it's purely TCP, it must move to
proto_tcp.c. Also, instead of calling it directly, we now call it via
the stream interface, which will later help us unify session handling.
diff --git a/include/proto/proto_tcp.h b/include/proto/proto_tcp.h
index 2cf3be1..b93b371 100644
--- a/include/proto/proto_tcp.h
+++ b/include/proto/proto_tcp.h
@@ -24,7 +24,6 @@
 
 #include <common/config.h>
 #include <types/proto_tcp.h>
-#include <types/session.h>
 #include <types/task.h>
 
 int tcp_event_accept(int fd);
@@ -32,6 +31,9 @@
 void tcpv4_add_listener(struct listener *listener);
 void tcpv6_add_listener(struct listener *listener);
 int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen);
+int tcpv4_connect_server(struct stream_interface *si,
+			 struct proxy *be, struct server *srv,
+			 struct sockaddr *srv_addr, struct sockaddr *cli_addr);
 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);
diff --git a/include/types/fd.h b/include/types/fd.h
index 0c631b1..a50d076 100644
--- a/include/types/fd.h
+++ b/include/types/fd.h
@@ -29,7 +29,6 @@
 
 #include <common/config.h>
 #include <types/task.h>
-#include <types/buffers.h>
 #include <types/protocols.h>
 
 /* different possible states for the fd */
diff --git a/include/types/stream_interface.h b/include/types/stream_interface.h
index f97aa62..7789323 100644
--- a/include/types/stream_interface.h
+++ b/include/types/stream_interface.h
@@ -72,6 +72,9 @@
 
 #define SI_FL_CAP_SPLICE (SI_FL_CAP_SPLTCP)
 
+struct server;
+struct proxy;
+
 struct stream_interface {
 	unsigned int state;     /* SI_ST* */
 	unsigned int prev_state;/* SI_ST*, copy of previous state */
@@ -79,6 +82,8 @@
 	int fd;                 /* file descriptor for a stream driver when known */
 	unsigned int flags;
 	unsigned int exp;       /* wake up time for connect, queue, turn-around, ... */
+	int (*connect)(struct stream_interface *, struct proxy *, struct server *,
+		       struct sockaddr *, struct sockaddr *); /* connect function if any */
 	void (*shutr)(struct stream_interface *);  /* shutr function */
 	void (*shutw)(struct stream_interface *);  /* shutw function */
 	void (*chk_rcv)(struct stream_interface *);/* chk_rcv function */