diff options
author | Phil Sutter <phil@nwl.cc> | 2018-04-13 16:52:35 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-04-14 13:53:02 +0200 |
commit | 2b8f691bd43db5ee120d3d73b1bac6643773b7dc (patch) | |
tree | 37c5cbcbb3e05862bf1a9075fc74356b3624f386 /src/libnftables.c | |
parent | 778de37d82e7bc90b4ba2abdfb0ebc8ddb2e7302 (diff) |
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 <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/libnftables.c')
-rw-r--r-- | src/libnftables.c | 6 |
1 files changed, 2 insertions, 4 deletions
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; |