From 7ad9e1f8ad4ba637be841d0573bdfdcf397f0815 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Mon, 4 Jan 2016 20:53:43 +0100 Subject: ct: add support for directional keys A few keys in the ct expression are directional, i.e. we need to tell kernel if it should fetch REPLY or ORIGINAL direction. Split ct_keys into ct_keys & ct_keys_dir, the latter are those keys that the kernel rejects unless also given a direction. During postprocessing we also need to invoke ct_expr_update_type, problem is that e.g. ct saddr can be any family (ip, ipv6) so we need to update the expected data type based on the network base. Signed-off-by: Florian Westphal --- include/ct.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/ct.h') diff --git a/include/ct.h b/include/ct.h index 64366ab7..945fcc4d 100644 --- a/include/ct.h +++ b/include/ct.h @@ -24,7 +24,9 @@ struct ct_template { } extern struct expr *ct_expr_alloc(const struct location *loc, - enum nft_ct_keys key); + enum nft_ct_keys key, int8_t direction); extern void ct_expr_update_type(struct proto_ctx *ctx, struct expr *expr); +extern struct error_record *ct_dir_parse(const struct location *loc, + const char *str, int8_t *dir); #endif /* NFTABLES_CT_H */ -- cgit v1.2.3