From 35f6cd327c2ec46296adf464f981cd6cddfec27b Mon Sep 17 00:00:00 2001 From: Varsha Rao Date: Fri, 16 Jun 2017 14:54:06 +0530 Subject: src: Pass stateless, numeric, ip2name and handle variables as structure members. libnftables library will be created soon. So declare numeric_output, stateless_output, ip2name_output and handle_output as members of structure output_ctx, instead of global variables. Rename these variables as following, numeric_output -> numeric stateless_output -> stateless ip2name_output -> ip2name handle_output -> handle Also add struct output_ctx *octx as member of struct netlink_ctx. Signed-off-by: Varsha Rao Signed-off-by: Pablo Neira Ayuso --- include/nftables.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'include/nftables.h') diff --git a/include/nftables.h b/include/nftables.h index 6f541557..9e10be07 100644 --- a/include/nftables.h +++ b/include/nftables.h @@ -24,11 +24,14 @@ enum debug_level { #define INCLUDE_PATHS_MAX 16 +struct output_ctx { + unsigned int numeric; + unsigned int stateless; + unsigned int ip2name; + unsigned int handle; +}; + extern unsigned int max_errors; -extern unsigned int numeric_output; -extern unsigned int stateless_output; -extern unsigned int ip2name_output; -extern unsigned int handle_output; extern unsigned int debug_level; extern const char *include_paths[INCLUDE_PATHS_MAX]; @@ -107,6 +110,7 @@ struct input_descriptor { struct parser_state; -int nft_run(void *scanner, struct parser_state *state, struct list_head *msgs); +int nft_run(void *scanner, struct parser_state *state, struct list_head *msgs, + struct output_ctx *octx); #endif /* NFTABLES_NFTABLES_H */ -- cgit v1.2.3