From f9d3e2e15b7ad968f30643ca6da55b75f03686fd Mon Sep 17 00:00:00 2001 From: "Pablo M. Bermudo Garay" Date: Fri, 23 Jun 2017 18:38:24 +0200 Subject: src: add new generic context structure nft_ctx The new structure nft_ctx is meant to be used as a generic container of context information. This is a preparatory patch. So at the moment the struct just carry output_ctx on his path through main.c and cli.c. Based on original idea from Eric Leblond. Signed-off-by: Pablo M. Bermudo Garay Signed-off-by: Pablo Neira Ayuso --- include/nftables.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include/nftables.h') diff --git a/include/nftables.h b/include/nftables.h index 9e10be07..dbd46377 100644 --- a/include/nftables.h +++ b/include/nftables.h @@ -31,6 +31,10 @@ struct output_ctx { unsigned int handle; }; +struct nft_ctx { + struct output_ctx output; +}; + extern unsigned int max_errors; extern unsigned int debug_level; extern const char *include_paths[INCLUDE_PATHS_MAX]; @@ -110,7 +114,7 @@ struct input_descriptor { struct parser_state; -int nft_run(void *scanner, struct parser_state *state, struct list_head *msgs, - struct output_ctx *octx); +int nft_run(struct nft_ctx *nft, void *scanner, struct parser_state *state, + struct list_head *msgs); #endif /* NFTABLES_NFTABLES_H */ -- cgit v1.2.3