diff options
author | Phil Sutter <phil@nwl.cc> | 2017-08-22 14:40:04 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-08-23 23:42:33 +0200 |
commit | 7c43dc46179a6f85406eb861e970cbb06bac05d2 (patch) | |
tree | dbc85c4fcb760060dfda381b3c6205d079ba8151 /include | |
parent | c06413211e6f5f8720fa75909f84b6c0b8c17d68 (diff) |
src: Keep cache in struct nft_ctx
This is preliminary work for Eric's libnftables patchset.
Cc: Eric Leblond <eric@regit.org>
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'include')
-rw-r--r-- | include/cli.h | 4 | ||||
-rw-r--r-- | include/nftables.h | 13 |
2 files changed, 9 insertions, 8 deletions
diff --git a/include/cli.h b/include/cli.h index 40fc63ea..3ae1c459 100644 --- a/include/cli.h +++ b/include/cli.h @@ -6,10 +6,10 @@ struct parser_state; #ifdef HAVE_LIBREADLINE extern int cli_init(struct nft_ctx *nft, struct mnl_socket *nf_sock, - struct nft_cache *cache, struct parser_state *state); + struct parser_state *state); #else static inline int cli_init(struct nft_ctx *nft, struct mnl_socket *nf_sock, - struct nft_cache *cache, struct parser_state *state) + struct parser_state *state) { return -1; } diff --git a/include/nftables.h b/include/nftables.h index a457aba6..994b5111 100644 --- a/include/nftables.h +++ b/include/nftables.h @@ -32,17 +32,18 @@ struct output_ctx { unsigned int echo; }; -struct nft_ctx { - struct output_ctx output; - bool check; -}; - struct nft_cache { bool initialized; struct list_head list; uint32_t seqnum; }; +struct nft_ctx { + struct output_ctx output; + bool check; + struct nft_cache cache; +}; + extern unsigned int max_errors; extern unsigned int debug_level; extern const char *include_paths[INCLUDE_PATHS_MAX]; @@ -124,7 +125,7 @@ struct parser_state; struct mnl_socket; int nft_run(struct nft_ctx *nft, struct mnl_socket *nf_sock, - struct nft_cache *cache, void *scanner, struct parser_state *state, + void *scanner, struct parser_state *state, struct list_head *msgs); void ct_label_table_init(void); |