From: Willy Tarreau Date: Wed, 25 Jun 2014 16:30:01 +0000 (+0200) Subject: CLEANUP: session: move the stick counters declarations to stick_table.h X-Git-Tag: v1.6-dev1~349 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ed1bbfc75a70e0c4d4ed544c3c23e91b5a19edf;p=thirdparty%2Fhaproxy.git CLEANUP: session: move the stick counters declarations to stick_table.h 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. --- diff --git a/include/types/session.h b/include/types/session.h index 02772a86d7..f17aff423a 100644 --- a/include/types/session.h +++ b/include/types/session.h @@ -91,20 +91,6 @@ #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 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 */ /* diff --git a/include/types/stick_table.h b/include/types/stick_table.h index 6fdc58e653..0cda104846 100644 --- a/include/types/stick_table.h +++ b/include/types/stick_table.h @@ -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 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 */