From 3cf1111eb30010d0e5251adcdee7c7d71f62b496 Mon Sep 17 00:00:00 2001 From: Thierry FOURNIER Date: Tue, 28 Jul 2015 08:57:05 +0200 Subject: [PATCH] MEDIUM: stick-tables: Add GPT0 in the stick tables This patch adds GPT0 (General Purpose Tag 0). It is useful for storing a simple state. --- include/types/stick_table.h | 2 ++ src/stick_table.c | 1 + 2 files changed, 3 insertions(+) diff --git a/include/types/stick_table.h b/include/types/stick_table.h index 2800add11..cab11c1d3 100644 --- a/include/types/stick_table.h +++ b/include/types/stick_table.h @@ -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; diff --git a/src/stick_table.c b/src/stick_table.c index 9c053bc22..5e7a2c48f 100644 --- a/src/stick_table.c +++ b/src/stick_table.c @@ -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 },