MEDIUM: proto_tcp: remove any dependence on stream_interface

The last uses of the stream interfaces were in tcp_connect_server() and
could easily and more appropriately be moved to its callers, si_connect()
and connect_server(), making a lot more sense.

Now the function should theorically be usable for health checks.

It also appears more obvious that the file is split into two distinct
parts :
  - the protocol layer used at the connection level
  - the tcp analysers executing tcp-* rules and their samples/acls.
diff --git a/include/proto/stream_interface.h b/include/proto/stream_interface.h
index 8cd4a31..05a3210 100644
--- a/include/proto/stream_interface.h
+++ b/include/proto/stream_interface.h
@@ -27,6 +27,7 @@
 #include <common/config.h>
 #include <types/session.h>
 #include <types/stream_interface.h>
+#include <proto/channel.h>
 #include <proto/connection.h>
 
 
@@ -128,9 +129,30 @@
 /* Calls chk_snd on the connection using the ctrl layer */
 static inline int si_connect(struct stream_interface *si)
 {
+	int ret;
+
 	if (unlikely(!si_ctrl(si) || !si_ctrl(si)->connect))
 		return SN_ERR_INTERNAL;
-	return si_ctrl(si)->connect(si);
+
+	ret = si_ctrl(si)->connect(&si->conn, !channel_is_empty(si->ob));
+	if (ret != SN_ERR_NONE)
+		return ret;
+
+	/* needs src ip/port for logging */
+	if (si->flags & SI_FL_SRC_ADDR)
+		conn_get_from_addr(&si->conn);
+
+	/* Prepare to send a few handshakes related to the on-wire protocol. */
+	if (si->send_proxy_ofs)
+		si->conn.flags |= CO_FL_SI_SEND_PROXY;
+
+	/* we need to be notified about connection establishment */
+	si->conn.flags |= CO_FL_NOTIFY_SI;
+
+	/* we're in the process of establishing a connection */
+	si->state = SI_ST_CON;
+
+	return ret;
 }
 
 #endif /* _PROTO_STREAM_INTERFACE_H */