diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-05-19 12:54:19 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-05-19 18:55:45 +0200 |
commit | abe42160ca92b0f140bf0fba80120e583319bc5c (patch) | |
tree | ba2b0f25985e829884347b024cbd57cc338735bf /iptables/nft.h | |
parent | bceb483ea90842f2801e06906f833d222158a312 (diff) |
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 <pablo@netfilter.org>
Diffstat (limited to 'iptables/nft.h')
-rw-r--r-- | iptables/nft.h | 13 |
1 files changed, 9 insertions, 4 deletions
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; |