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/include/types/session.h b/include/types/session.h
index ae11f81..f0a5be6 100644
--- a/include/types/session.h
+++ b/include/types/session.h
@@ -34,6 +34,7 @@
 #include <types/channel.h>
 #include <types/compression.h>
 
+#include <types/obj_type.h>
 #include <types/proto_http.h>
 #include <types/proxy.h>
 #include <types/queue.h>
@@ -99,15 +100,14 @@
  *    immediately assigned when SN_DIRECT is determined. Both must be cleared
  *    when clearing SN_DIRECT (eg: redispatch).
  *  - ->srv has no meaning without SN_ASSIGNED and must not be checked without
- *    it. ->target and ->target_type may be used to check previous ->srv after
- *    a failed connection attempt.
+ *    it. ->target may be used to check previous ->srv after a failed connection attempt.
  *  - a session being processed has srv_conn set.
  *  - srv_conn might remain after SN_DIRECT has been reset, but the assigned
  *    server should eventually be released.
  */
 struct session {
 	int flags;				/* some flags describing the session */
-	struct target target;			/* target to use for this session */
+	enum obj_type *target;			/* target to use for this session */
 
 	struct channel *req;			/* request buffer */
 	struct channel *rep;			/* response buffer */