From 2b8f691bd43db5ee120d3d73b1bac6643773b7dc Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 13 Apr 2018 16:52:35 +0200 Subject: parser_bison: Pass struct nft_ctx to parser_init() Signature of parser_init() got quite huge, so simply pass the whole context pointer to it - most of the parameters are just taken from there anyway. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- src/parser_bison.y | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/parser_bison.y') diff --git a/src/parser_bison.y b/src/parser_bison.y index 1ca5d404..e2440be1 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -36,21 +36,19 @@ #include "parser_bison.h" -void parser_init(struct mnl_socket *nf_sock, struct nft_cache *cache, - struct parser_state *state, struct list_head *msgs, - struct list_head *cmds, unsigned int debug_mask, - struct output_ctx *octx) +void parser_init(struct nft_ctx *nft, struct parser_state *state, + struct list_head *msgs, struct list_head *cmds) { memset(state, 0, sizeof(*state)); init_list_head(&state->top_scope.symbols); state->msgs = msgs; state->cmds = cmds; state->scopes[0] = scope_init(&state->top_scope, NULL); - state->ectx.cache = cache; + state->ectx.cache = &nft->cache; state->ectx.msgs = msgs; - state->ectx.nf_sock = nf_sock; - state->ectx.debug_mask = debug_mask; - state->ectx.octx = octx; + state->ectx.nf_sock = nft->nf_sock; + state->ectx.debug_mask = nft->debug_mask; + state->ectx.octx = &nft->output; } static void yyerror(struct location *loc, struct nft_ctx *nft, void *scanner, -- cgit v1.2.3