From 1694df2de79f39c5037f82601e02226022b2e38f Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 14 Oct 2022 23:19:22 +0200 Subject: Implement 'reset rule' and 'reset rules' commands Reset rule counters and quotas in kernel, i.e. without having to reload them. Requires respective kernel patch to support NFT_MSG_GETRULE_RESET message type. Signed-off-by: Phil Sutter --- include/cache.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/cache.h') diff --git a/include/cache.h b/include/cache.h index 575381ef..5bf78fe0 100644 --- a/include/cache.h +++ b/include/cache.h @@ -3,6 +3,8 @@ #include +struct handle; + enum cache_level_bits { NFT_CACHE_TABLE_BIT = (1 << 0), NFT_CACHE_CHAIN_BIT = (1 << 1), @@ -55,6 +57,7 @@ struct nft_cache_filter { const char *chain; const char *set; const char *ft; + uint64_t rule_handle; } list; struct { @@ -138,4 +141,8 @@ struct nft_cache { void nft_chain_cache_update(struct netlink_ctx *ctx, struct table *table, const char *chain); +int rule_cache_dump(struct netlink_ctx *ctx, const struct handle *h, + const struct nft_cache_filter *filter, + bool dump, bool reset); + #endif /* _NFT_CACHE_H_ */ -- cgit v1.2.3