From cb4b07d0b62836ab860e11e1f50c98656eeb4f9f Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 30 Nov 2021 20:06:09 +0100 Subject: cache: Support filtering for a specific flowtable Extend nft_cache_filter to hold a flowtable name so 'list flowtable' command causes fetching the requested flowtable only. Dump flowtables just once instead of for each table, merely assign fetched data to tables inside the loop. Signed-off-by: Phil Sutter --- include/cache.h | 1 + include/mnl.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/cache.h b/include/cache.h index 3a9a5e81..d185f3cf 100644 --- a/include/cache.h +++ b/include/cache.h @@ -54,6 +54,7 @@ struct nft_cache_filter { const char *table; const char *chain; const char *set; + const char *ft; } list; struct { diff --git a/include/mnl.h b/include/mnl.h index 8659879c..b006192c 100644 --- a/include/mnl.h +++ b/include/mnl.h @@ -77,7 +77,8 @@ int mnl_nft_obj_add(struct netlink_ctx *ctx, struct cmd *cmd, int mnl_nft_obj_del(struct netlink_ctx *ctx, struct cmd *cmd, int type); struct nftnl_flowtable_list * -mnl_nft_flowtable_dump(struct netlink_ctx *ctx, int family, const char *table); +mnl_nft_flowtable_dump(struct netlink_ctx *ctx, int family, + const char *table, const char *ft); int mnl_nft_flowtable_add(struct netlink_ctx *ctx, struct cmd *cmd, unsigned int flags); -- cgit v1.2.3