From 1fe6089ddd87ee7869d24c0f8849951220cc9b85 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 11 Mar 2020 13:00:01 +0100 Subject: src: support for restoring element counters This patch allows you to restore counters in dynamic sets: table ip test { set test { type ipv4_addr size 65535 flags dynamic,timeout timeout 30d gc-interval 1d elements = { 192.168.10.13 expires 19d23h52m27s576ms counter packets 51 bytes 17265 } } chain output { type filter hook output priority 0; update @test { ip saddr } } } You can also add counters to elements from the control place, ie. table ip test { set test { type ipv4_addr size 65535 elements = { 192.168.2.1 counter packets 75 bytes 19043 } } chain output { type filter hook output priority filter; policy accept; ip daddr @test } } Signed-off-by: Pablo Neira Ayuso --- src/netlink_linearize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/netlink_linearize.c') diff --git a/src/netlink_linearize.c b/src/netlink_linearize.c index 5b3c43c6..e70e63b3 100644 --- a/src/netlink_linearize.c +++ b/src/netlink_linearize.c @@ -880,7 +880,7 @@ static struct nftnl_expr *netlink_gen_quota_stmt(const struct stmt *stmt) return nle; } -static struct nftnl_expr *netlink_gen_stmt_stateful(const struct stmt *stmt) +struct nftnl_expr *netlink_gen_stmt_stateful(const struct stmt *stmt) { switch (stmt->ops->type) { case STMT_CONNLIMIT: -- cgit v1.2.3