summaryrefslogtreecommitdiffstats
path: root/src/rule.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2020-03-24 18:38:51 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2020-03-26 15:10:26 +0100
commitb119428c934c7d356023828fed6a83b12bbcaa1f (patch)
tree78fd4c408ab47ac158059672f961b82c9c8688ab /src/rule.c
parent15a62af1868efa5df504f68afe50300fa7667f82 (diff)
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 <pablo@netfilter.org>
Diffstat (limited to 'src/rule.c')
-rw-r--r--src/rule.c4
1 files changed, 4 insertions, 0 deletions
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,