From a7469ab47400bf4add8269a2908965e82ceefc48 Mon Sep 17 00:00:00 2001 From: Arturo Borrero Date: Mon, 3 Nov 2014 21:20:11 +0100 Subject: src: add redirect support This patch adds redirect support for nft. The syntax is: % nft add rule nat prerouting redirect [port] [nat_flags] Signed-off-by: Arturo Borrero Gonzalez Signed-off-by: Pablo Neira Ayuso --- include/statement.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/statement.h') diff --git a/include/statement.h b/include/statement.h index 35c1b7ae..d1431215 100644 --- a/include/statement.h +++ b/include/statement.h @@ -79,6 +79,13 @@ struct masq_stmt { extern struct stmt *masq_stmt_alloc(const struct location *loc); +struct redir_stmt { + struct expr *proto; + uint32_t flags; +}; + +extern struct stmt *redir_stmt_alloc(const struct location *loc); + struct queue_stmt { struct expr *queue; uint16_t flags; @@ -110,6 +117,7 @@ extern struct stmt *ct_stmt_alloc(const struct location *loc, * @STMT_REJECT: REJECT statement * @STMT_NAT: NAT statement * @STMT_MASQ: masquerade statement + * @STMT_REDIR: redirect statement * @STMT_QUEUE: QUEUE statement * @STMT_CT: conntrack statement */ @@ -124,6 +132,7 @@ enum stmt_types { STMT_REJECT, STMT_NAT, STMT_MASQ, + STMT_REDIR, STMT_QUEUE, STMT_CT, }; @@ -172,6 +181,7 @@ struct stmt { struct reject_stmt reject; struct nat_stmt nat; struct masq_stmt masq; + struct redir_stmt redir; struct queue_stmt queue; struct ct_stmt ct; }; -- cgit v1.2.3