MAJOR: connection: replace struct target with a pointer to an enum

Instead of storing a couple of (int, ptr) in the struct connection
and the struct session, we use a different method : we only store a
pointer to an integer which is stored inside the target object and
which contains a unique type identifier. That way, the pointer allows
us to retrieve the object type (by dereferencing it) and the object's
address (by computing the displacement in the target structure). The
NULL pointer always corresponds to OBJ_TYPE_NONE.

This reduces the size of the connection and session structs. It also
simplifies target assignment and compare.

In order to improve the generated code, we try to put the obj_type
element at the beginning of all the structs (listener, server, proxy,
si_applet), so that the original and target pointers are always equal.

A lot of code was touched by massive replaces, but the changes are not
that important.
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index 28df64b..e744c76 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -220,7 +220,7 @@
  * pointed to by conn->addr.from in case of transparent proxying. Normal source
  * bind addresses are still determined locally (due to the possible need of a
  * source port). conn->target may point either to a valid server or to a backend,
- * depending on conn->target.type. Only TARG_TYPE_PROXY and TARG_TYPE_SERVER are
+ * depending on conn->target. Only OBJ_TYPE_PROXY and OBJ_TYPE_SERVER are
  * supported. The <data> parameter is a boolean indicating whether there are data
  * waiting for being sent or not, in order to adjust data write polling and on
  * some platforms, the ability to avoid an empty initial ACK.
@@ -241,13 +241,13 @@
 	struct server *srv;
 	struct proxy *be;
 
-	switch (conn->target.type) {
-	case TARG_TYPE_PROXY:
-		be = conn->target.ptr.p;
+	switch (obj_type(conn->target)) {
+	case OBJ_TYPE_PROXY:
+		be = objt_proxy(conn->target);
 		srv = NULL;
 		break;
-	case TARG_TYPE_SERVER:
-		srv = conn->target.ptr.s;
+	case OBJ_TYPE_SERVER:
+		srv = objt_server(conn->target);
 		be = srv->proxy;
 		break;
 	default: