From 1f3974ce5c77fb66bc0be94a2e03286f73ac0b5b Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 24 Feb 2020 13:28:34 +0100 Subject: src: nat concatenation support with anonymous maps This patch extends the parser to define the mapping datatypes, eg. ... dnat ip addr . port to ip saddr map { 1.1.1.1 : 2.2.2.2 . 30 } ... dnat ip addr . port to ip saddr map @y Signed-off-by: Pablo Neira Ayuso --- src/parser_bison.y | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/parser_bison.y') diff --git a/src/parser_bison.y b/src/parser_bison.y index fd00b40a..4c27fcc6 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -373,6 +373,7 @@ int nft_lex(void *, void *, void *); %token FLAGS "flags" %token CPI "cpi" +%token PORT "port" %token UDP "udp" %token SPORT "sport" %token DPORT "dport" @@ -3141,6 +3142,12 @@ nat_stmt_args : stmt_expr { $0->nat.flags = $2; } + | nf_key_proto ADDR DOT PORT TO stmt_expr + { + $0->nat.family = $1; + $0->nat.addr = $6; + $0->nat.ipportmap = true; + } ; masq_stmt : masq_stmt_alloc masq_stmt_args -- cgit v1.2.3