From abe42160ca92b0f140bf0fba80120e583319bc5c Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sun, 19 May 2019 12:54:19 +0200 Subject: nft: add struct nft_cache Add new structure that encloses the cache and update the code to use it. Signed-off-by: Pablo Neira Ayuso --- iptables/nft.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'iptables/nft.h') diff --git a/iptables/nft.h b/iptables/nft.h index 23bd2b79..8292a292 100644 --- a/iptables/nft.h +++ b/iptables/nft.h @@ -27,6 +27,13 @@ struct builtin_table { struct builtin_chain chains[NF_INET_NUMHOOKS]; }; +struct nft_cache { + struct { + struct nftnl_chain_list *chains; + bool initialized; + } table[NFT_TABLE_MAX]; +}; + struct nft_handle { int family; struct mnl_socket *nl; @@ -40,10 +47,8 @@ struct nft_handle { struct list_head err_list; struct nft_family_ops *ops; const struct builtin_table *tables; - struct { - struct nftnl_chain_list *chain_cache; - bool initialized; - } table[NFT_TABLE_MAX]; + struct nft_cache __cache; + struct nft_cache *cache; bool have_cache; bool restore; bool noflush; -- cgit v1.2.3