From b119428c934c7d356023828fed6a83b12bbcaa1f Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 24 Mar 2020 18:38:51 +0100 Subject: src: add support for flowtable counter Allow users to enable flow counters via control plane toggle, e.g. table ip x { flowtable y { hook ingress priority 0; counter; } chain z { type filter hook ingress priority filter; flow add @z } } Signed-off-by: Pablo Neira Ayuso --- src/rule.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/rule.c') diff --git a/src/rule.c b/src/rule.c index ab99bbd2..92fa129b 100644 --- a/src/rule.c +++ b/src/rule.c @@ -2247,6 +2247,10 @@ static void flowtable_print_declaration(const struct flowtable *flowtable, nft_print(octx, ", "); } nft_print(octx, " }%s", opts->stmt_separator); + + if (flowtable->flags & NFT_FLOWTABLE_COUNTER) + nft_print(octx, "%s%scounter%s", opts->tab, opts->tab, + opts->stmt_separator); } static void do_flowtable_print(const struct flowtable *flowtable, -- cgit v1.2.3