diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-04-29 20:29:09 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-05-02 23:30:35 +0200 |
commit | 1f4b36a18d945fced71bdfc0a2e369c44b8d8fe3 (patch) | |
tree | 174dcd1856388e126ac7ee893f8ef56a97e513d6 /src/libnftables.c | |
parent | 797b4f343fe248ca7a516b68d93895121e574c15 (diff) |
src: consolidate nft_cache infrastructure
- prepend nft_ prefix to nft_cache API and internal functions
- move declarations to cache.h (and remove redundant declarations)
- move struct nft_cache definition to cache.h
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/libnftables.c')
-rw-r--r-- | src/libnftables.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libnftables.c b/src/libnftables.c index 04436591..56c51a61 100644 --- a/src/libnftables.c +++ b/src/libnftables.c @@ -303,7 +303,7 @@ void nft_ctx_free(struct nft_ctx *ctx) exit_cookie(&ctx->output.output_cookie); exit_cookie(&ctx->output.error_cookie); iface_cache_release(); - cache_release(&ctx->cache); + nft_cache_release(&ctx->cache); nft_ctx_clear_include_paths(ctx); scope_free(ctx->top_scope); xfree(ctx->state); @@ -416,8 +416,8 @@ static int nft_evaluate(struct nft_ctx *nft, struct list_head *msgs, unsigned int flags; struct cmd *cmd; - flags = cache_evaluate(nft, cmds); - if (cache_update(nft, flags, msgs) < 0) + flags = nft_cache_evaluate(nft, cmds); + if (nft_cache_update(nft, flags, msgs) < 0) return -1; list_for_each_entry(cmd, cmds, list) { @@ -496,7 +496,7 @@ err: nft_output_echo(&nft->output)) json_print_echo(nft); if (rc) - cache_release(&nft->cache); + nft_cache_release(&nft->cache); return rc; } @@ -547,6 +547,6 @@ err: nft_output_echo(&nft->output)) json_print_echo(nft); if (rc) - cache_release(&nft->cache); + nft_cache_release(&nft->cache); return rc; } |