]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] stick_table: add support for "conn_cum" data type.
authorWilly Tarreau <w@1wt.eu>
Sun, 6 Jun 2010 12:30:13 +0000 (14:30 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 14 Jun 2010 13:10:24 +0000 (15:10 +0200)
This one can be parsed on the "stick-table" after with the "store"
keyword. It will hold the number of connections matching the entry,
for use with ACLs or anything else.

doc/configuration.txt
include/types/stick_table.h
src/stick_table.c

index ad4a3ceb05dd7d9bd7c962353d24a982e5d2b1c3..fb2f48d82f2b72c80c96bff165adae79597ddb77 100644 (file)
@@ -5053,7 +5053,9 @@ stick-table type {ip | integer | string [len <length>] } size <size>
                may be used by ACLs in order to control various criteria related
                to the activity of the client matching the stick-table. For each
                item specified here, the size of each entry will be inflated so
-               that the additional data can fit.
+               that the additional data can fit. At the moment, only "conn_cum"
+               is supported, which can be used to store and retrieve the total
+               number of connections matching the entry since it was created.
 
   The is only one stick-table per backend. At the moment of writing this doc,
   it does not seem useful to have multiple tables per backend. If this happens
index dda9edbc011912876d54df06b90d6802434e953c..a43c1101367aff3f56f693adae827ec50a35a143 100644 (file)
@@ -41,11 +41,13 @@ enum {
 
 /* The types of extra data we can store in a stick table */
 enum {
+       STKTABLE_DT_CONN_CUM,     /* cumulated number of connections */
        STKTABLE_DATA_TYPES       /* Number of data types, must always be last */
 };
 
 /* stick_table extra data. This is mainly used for casting or size computation */
 union stktable_data {
+       unsigned int conn_cum;
 };
 
 #define stktable_data_size(type) (sizeof(((union stktable_data*)0)->type))
index 158056e1ccb72b6bfa34ae841f3929e98b93af1b..4cd6c75962c16f486ec1ab791356bccbdd4662ce 100644 (file)
@@ -477,6 +477,7 @@ int stktable_compatible_pattern(struct pattern_expr *expr, unsigned long table_t
 
 /* Extra data types processing */
 struct stktable_data_type stktable_data_types[STKTABLE_DATA_TYPES] = {
+       [STKTABLE_DT_CONN_CUM] = { .name = "conn_cum", .data_length = stktable_data_size(conn_cum) },
 };
 
 /*