]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: session: move the stick counters declarations to stick_table.h
authorWilly Tarreau <w@1wt.eu>
Wed, 25 Jun 2014 16:30:01 +0000 (18:30 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Jul 2014 15:26:40 +0000 (17:26 +0200)
They're really not appropriate in session.h as they always require a
stick table, and I'm having a hard time finding them each time I need
to.

include/types/session.h
include/types/stick_table.h

index 02772a86d75132ca9e06b334d8e7ecc342bee021..f17aff423a2230d4a19f83041271a5f7e2ec1d7b 100644 (file)
 #define SN_COMP_READY   0x00100000     /* the compression is initialized */
 #define SN_SRV_REUSED   0x00200000     /* the server-side connection was reused */
 
-/* WARNING: if new fields are added, they must be initialized in session_accept()
- * and freed in session_free() !
- */
-
-#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 {
-       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) */
-};
-
 /*
  * Note: some session flags have dependencies :
  *  - SN_DIRECT cannot exist without SN_ASSIGNED, because a server is
@@ -171,16 +157,6 @@ struct session {
        char *unique_id;                        /* custom unique ID */
 };
 
-/* parameters to configure tracked counters */
-struct track_ctr_prm {
-       struct sample_expr *expr;               /* expression used as the key */
-       union {
-               struct stktable *t;             /* a pointer to the table */
-               char *n;                        /* or its name during parsing. */
-       } table;
-};
-
-
 #endif /* _TYPES_SESSION_H */
 
 /*
index 6fdc58e65342cde0882c6806c6196cd2bcef9ca0..0cda104846fa72ae90aa715e242e914caff4c2b5 100644 (file)
@@ -193,4 +193,27 @@ struct stktable_key {
        union stktable_key_data data;   /* data, must always be last */
 };
 
+/* WARNING: if new fields are added, they must be initialized in session_accept()
+ * and freed in session_free() !
+ */
+#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 {
+       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) */
+};
+
+/* parameters to configure tracked counters */
+struct track_ctr_prm {
+       struct sample_expr *expr;               /* expression used as the key */
+       union {
+               struct stktable *t;             /* a pointer to the table */
+               char *n;                        /* or its name during parsing. */
+       } table;
+};
+
 #endif /* _TYPES_STICK_TABLE_H */