path: root/include
diff options
authorFlorian Westphal <>2017-09-29 13:54:21 +0200
committerFlorian Westphal <>2017-09-29 13:54:21 +0200
commit0bc5399d7723d9ecab5f71c30dcaea4041366446 (patch)
tree473ae391e6e767aad9b79d7529ab3e3cf90a8ca4 /include
parent28180991740e6942adfb12650ff2472d73e89387 (diff)
src: add alternate syntax for ct saddr
current syntax is: ct original saddr $address problem is that in inet, bridge etc. we lack context to figure out if this should fetch ipv6 or ipv4 from the conntrack structure. $address might not exist, rhs could e.g. be a set reference. One way to do this is to have users manually specifiy the dependeny: ct l3proto ipv4 ct original saddr $address Thats ugly, and, moreover, only needed for table families other than ip or ipv6. Pablo suggested to instead specify ip saddr, ip6 saddr: ct original ip saddr $address and let nft handle the dependency injection. This adds the required parts to the scanner and the grammar, next commit adds code to eval step to make use of this. Signed-off-by: Florian Westphal <>
Diffstat (limited to 'include')
2 files changed, 3 insertions, 1 deletions
diff --git a/include/ct.h b/include/ct.h
index d9a11a3f..ec5d55d8 100644
--- a/include/ct.h
+++ b/include/ct.h
@@ -24,7 +24,8 @@ struct ct_template {
extern struct expr *ct_expr_alloc(const struct location *loc,
- enum nft_ct_keys key, int8_t direction);
+ enum nft_ct_keys key, int8_t direction,
+ uint8_t nfproto);
extern void ct_expr_update_type(struct proto_ctx *ctx, struct expr *expr);
extern struct stmt *notrack_stmt_alloc(const struct location *loc);
diff --git a/include/expression.h b/include/expression.h
index ce6b702a..d0afaa65 100644
--- a/include/expression.h
+++ b/include/expression.h
@@ -301,6 +301,7 @@ struct expr {
/* EXPR_CT */
enum nft_ct_keys key;
int8_t direction;
+ uint8_t nfproto;
} ct;
struct {