MEDIUM: counters: stop relying on session flags at all

Till now, we had one flag per stick counter to indicate if it was
tracked in a backend or in a frontend. We just had to add another
flag per stick-counter to indicate if it relies on contents or just
connection. These flags are quite painful to maintain and tend to
easily conflict with other flags if their number is changed.

The correct solution consists in moving the flags to the stkctr struct
itself, but currently this struct is made of 2 pointers, so adding a
new entry there to store only two bits will cause at least 16 more bytes
to be eaten per counter due to alignment issues, and we definitely don't
want to waste tens to hundreds of bytes per session just for things that
most users don't use.

Since we only need to store two bits per counter, an intermediate
solution consists in replacing the entry pointer with a composite
value made of the original entry pointer and the two flags in the
2 unused lower bits. If later a need for other flags arises, we'll
have to store them in the struct.

A few inline functions have been added to abstract the retrieval
and assignment of the pointers and flags, resulting in very few
changes. That way there is no more dependence on the number of
stick-counters and their position in the session flags.
diff --git a/include/types/session.h b/include/types/session.h
index add8c32..9b5a5bf 100644
--- a/include/types/session.h
+++ b/include/types/session.h
@@ -90,27 +90,17 @@
 
 #define SN_COMP_READY   0x00100000	/* the compression is initialized */
 
-/* session tracking flags: these ones must absolutely be contiguous and cover
- * at least MAX_SESS_STKCTR flags.
- */
-#define SN_BE_TRACK_SC0 0x00200000	/* backend tracks stick-counter 0 */
-#define SN_BE_TRACK_SC1 0x00400000	/* backend tracks stick-counter 1 */
-#define SN_BE_TRACK_SC2 0x00800000	/* backend tracks stick-counter 2 */
-#define SN_BE_TRACK_ANY 0x00E00000      /* union of all SN_BE_TRACK_* above */
-
-#define SN_CT_TRACK_SC0 0x01000000      /* stick-counter 0 tracked at the content level */
-#define SN_CT_TRACK_SC1 0x02000000      /* stick-counter 1 tracked at the content level */
-#define SN_CT_TRACK_SC2 0x04000000      /* stick-counter 2 tracked at the content level */
-#define SN_CT_TRACK_ANY 0x07000000      /* union of all SN_CT_TRACK_* above */
-
-
 /* WARNING: if new fields are added, they must be initialized in session_accept()
  * and freed in session_free() !
  */
 
-/* stick counter */
+#define STKCTR_TRACK_BACKEND 1
+#define STKCTR_TRACK_CONTENT 2
+/* stick counter. The <entry> member is a composite address (caddr) made of a
+ * pointer to an stksess struct, and two flags among STKCTR_TRACK_* above.
+ */
 struct stkctr {
-	struct stksess *entry;          /* entry containing counters currently being tracked  by this session */
+	unsigned long   entry;          /* entry containing counters currently being tracked by this session  */
 	struct stktable *table;         /* table the counters above belong to (undefined if counters are null) */
 };