From e0146fa254496dc12187053cd0cd6e5d20eb6a43 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sat, 8 Jul 2017 05:07:23 +0530 Subject: include: Pass nf_sock where needed as parameter This socket should not be global, it is also hidden in many layers of code. Expose it as function parameters to decouple the netlink socket handling logic from the command parsing, evaluation and bytecode generation. Joint work with Varsha Rao. Signed-off-by: Varsha Rao Signed-off-by: Pablo Neira Ayuso --- include/cli.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/cli.h') diff --git a/include/cli.h b/include/cli.h index 6894f9d0..21052e32 100644 --- a/include/cli.h +++ b/include/cli.h @@ -5,9 +5,11 @@ struct parser_state; #ifdef HAVE_LIBREADLINE -extern int cli_init(struct nft_ctx *nft, struct parser_state *state); +extern int cli_init(struct nft_ctx *nft, struct mnl_socket *nf_sock, + struct parser_state *state); #else -static inline int cli_init(struct nft_ctx *nft, struct parser_state *state) +static inline int cli_init(struct nft_ctx *nft, struct mnl_socket *nf_sock, + struct parser_state *state) { return -1; } -- cgit v1.2.3