]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: stick-tables: Add GPT0 in the stick tables
authorThierry FOURNIER <tfournier@arpalert.org>
Tue, 28 Jul 2015 06:57:05 +0000 (08:57 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 20 Aug 2015 15:13:47 +0000 (17:13 +0200)
This patch adds GPT0 (General Purpose Tag 0). It is useful for storing
a simple state.

include/types/stick_table.h
src/stick_table.c

index 2800add11eeba6cd4b27405320384450982f21bb..cab11c1d3086c121617ac89677bda217cd0b680d 100644 (file)
@@ -36,6 +36,7 @@
 /* The types of extra data we can store in a stick table */
 enum {
        STKTABLE_DT_SERVER_ID,    /* the server ID to use with this stream if > 0 */
+       STKTABLE_DT_GPT0,         /* General Purpose Flag 0. */
        STKTABLE_DT_GPC0,         /* General Purpose Counter 0 (unsigned 32-bit integer) */
        STKTABLE_DT_GPC0_RATE,    /* General Purpose Counter 0's event rate */
        STKTABLE_DT_CONN_CNT,     /* cumulated number of connections */
@@ -83,6 +84,7 @@ union stktable_data {
 
        /* types of each storable data */
        int server_id;
+       unsigned int gpt0;
        unsigned int gpc0;
        struct freq_ctr_period gpc0_rate;
        unsigned int conn_cnt;
index 9c053bc22797fabc1892723f9a0f2e5d93d477b3..5e7a2c48f0e90dd6e601817df8615cec983423cd 100644 (file)
@@ -584,6 +584,7 @@ int stktable_compatible_sample(struct sample_expr *expr, unsigned long table_typ
  */
 struct stktable_data_type stktable_data_types[STKTABLE_DATA_TYPES] = {
        [STKTABLE_DT_SERVER_ID]     = { .name = "server_id",      .std_type = STD_T_SINT  },
+       [STKTABLE_DT_GPT0]          = { .name = "gpt0",           .std_type = STD_T_UINT  },
        [STKTABLE_DT_GPC0]          = { .name = "gpc0",           .std_type = STD_T_UINT  },
        [STKTABLE_DT_GPC0_RATE]     = { .name = "gpc0_rate",      .std_type = STD_T_FRQP, .arg_type = ARG_T_DELAY  },
        [STKTABLE_DT_CONN_CNT]      = { .name = "conn_cnt",       .std_type = STD_T_UINT  },