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/libnftables.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/libnftables.c') diff --git a/src/libnftables.c b/src/libnftables.c index 56a98ab1..f336dbc3 100644 --- a/src/libnftables.c +++ b/src/libnftables.c @@ -408,8 +408,7 @@ int nft_run_cmd_from_buffer(struct nft_ctx *nft, char *buf, size_t buflen) nlbuf = xzalloc(nlbuflen); snprintf(nlbuf, nlbuflen, "%s\n", buf); - parser_init(nft->nf_sock, &nft->cache, &state, - &msgs, &cmds, nft->debug_mask, &nft->output); + parser_init(nft, &state, &msgs, &cmds); scanner = scanner_init(&state); scanner_push_buffer(scanner, &indesc_cmdline, nlbuf); @@ -445,8 +444,7 @@ int nft_run_cmd_from_filename(struct nft_ctx *nft, const char *filename) if (!strcmp(filename, "-")) filename = "/dev/stdin"; - parser_init(nft->nf_sock, &nft->cache, &state, - &msgs, &cmds, nft->debug_mask, &nft->output); + parser_init(nft, &state, &msgs, &cmds); scanner = scanner_init(&state); if (scanner_read_file(scanner, filename, &internal_location) < 0) { rc = -1; -- cgit v1.2.3