From cf8c90ea9985c9019b002037629ee362b5c50343 Mon Sep 17 00:00:00 2001 From: Arturo Borrero Date: Mon, 6 Oct 2014 21:51:24 +0200 Subject: src: add masquerade support This patch adds masquerade support for nft. The syntax is: % nft add rule nat postrouting masquerade [flags] Currently, flags are: random, random-fully, persistent Example: % nft add rule nat postrouting masquerade random,persistent Signed-off-by: Arturo Borrero Gonzalez Signed-off-by: Pablo Neira Ayuso --- include/statement.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/statement.h b/include/statement.h index e5232542..35c1b7ae 100644 --- a/include/statement.h +++ b/include/statement.h @@ -73,6 +73,12 @@ struct nat_stmt { extern struct stmt *nat_stmt_alloc(const struct location *loc); +struct masq_stmt { + uint32_t flags; +}; + +extern struct stmt *masq_stmt_alloc(const struct location *loc); + struct queue_stmt { struct expr *queue; uint16_t flags; @@ -103,6 +109,7 @@ extern struct stmt *ct_stmt_alloc(const struct location *loc, * @STMT_LOG: log statement * @STMT_REJECT: REJECT statement * @STMT_NAT: NAT statement + * @STMT_MASQ: masquerade statement * @STMT_QUEUE: QUEUE statement * @STMT_CT: conntrack statement */ @@ -116,6 +123,7 @@ enum stmt_types { STMT_LOG, STMT_REJECT, STMT_NAT, + STMT_MASQ, STMT_QUEUE, STMT_CT, }; @@ -163,6 +171,7 @@ struct stmt { struct limit_stmt limit; struct reject_stmt reject; struct nat_stmt nat; + struct masq_stmt masq; struct queue_stmt queue; struct ct_stmt ct; }; -- cgit v1.2.3