From 4496b390ed2a086c4abbaa864798f36d891fa933 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 18 Aug 2023 11:40:36 +0200 Subject: src: add input flags for nft_ctx Similar to the existing output flags, add input flags. No flags are yet implemented, that will follow. One difference to nft_ctx_output_set_flags(), is that the setter for input flags returns the previously set flags. Signed-off-by: Thomas Haller Reviewed-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- src/libnftables.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/libnftables.c') diff --git a/src/libnftables.c b/src/libnftables.c index e214abb6..17438b53 100644 --- a/src/libnftables.c +++ b/src/libnftables.c @@ -401,6 +401,22 @@ void nft_ctx_set_optimize(struct nft_ctx *ctx, uint32_t flags) ctx->optimize_flags = flags; } +EXPORT_SYMBOL(nft_ctx_input_get_flags); +unsigned int nft_ctx_input_get_flags(struct nft_ctx *ctx) +{ + return ctx->input.flags; +} + +EXPORT_SYMBOL(nft_ctx_input_set_flags); +unsigned int nft_ctx_input_set_flags(struct nft_ctx *ctx, unsigned int flags) +{ + unsigned int old_flags; + + old_flags = ctx->input.flags; + ctx->input.flags = flags; + return old_flags; +} + EXPORT_SYMBOL(nft_ctx_output_get_flags); unsigned int nft_ctx_output_get_flags(struct nft_ctx *ctx) { -- cgit v1.2.3