From 8ec2e8438a7c4c48c8005a5f352c8ea6cd40d2fe Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sun, 27 Nov 2016 23:42:54 +0100 Subject: src: reset internal stateful objects This patch allows you to atomically dump and reset stateful objects, eg. # nft list counters table ip filter { counter test { packets 1024 bytes 100000 } } # nft reset quotas table filter counter test { packets 1024 bytes 100000 } # nft reset quotas table filter counter test { packets 0 bytes 0 } Signed-off-by: Pablo Neira Ayuso --- include/netlink.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/netlink.h') diff --git a/include/netlink.h b/include/netlink.h index 841211c4..450aba57 100644 --- a/include/netlink.h +++ b/include/netlink.h @@ -170,11 +170,13 @@ extern int netlink_flush_setelems(struct netlink_ctx *ctx, const struct handle * const struct location *loc); extern int netlink_list_objs(struct netlink_ctx *ctx, const struct handle *h, - const struct location *loc); + const struct location *loc); +extern int netlink_reset_objs(struct netlink_ctx *ctx, const struct handle *h, + const struct location *loc, uint32_t type); extern int netlink_add_obj(struct netlink_ctx *ctx, const struct handle *h, struct obj *obj, bool excl); extern int netlink_delete_obj(struct netlink_ctx *ctx, const struct handle *h, - struct location *loc, enum stmt_types type); + struct location *loc, uint32_t type); extern void netlink_dump_table(const struct nftnl_table *nlt); extern void netlink_dump_chain(const struct nftnl_chain *nlc); -- cgit v1.2.3