From d933d551f8db99f2e5f8b6ddcb3a8d9a7a68eeb0 Mon Sep 17 00:00:00 2001 From: Fernando Fernandez Mancera Date: Thu, 21 Aug 2025 11:12:59 +0200 Subject: tunnel: add vxlan support This patch extends the tunnel metadata object to define vxlan tunnel specific configurations: table netdev x { tunnel y { id 10 ip saddr 192.168.2.10 ip daddr 192.168.2.11 sport 10 dport 20 ttl 10 vxlan { gbp 200 } } } Signed-off-by: Fernando Fernandez Mancera Signed-off-by: Pablo Neira Ayuso --- src/parser_bison.y | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'src/parser_bison.y') diff --git a/src/parser_bison.y b/src/parser_bison.y index 08d75dbb..ca93a658 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -612,6 +612,7 @@ int nft_lex(void *, void *, void *); %token ERSPAN "erspan" %token EGRESS "egress" %token INGRESS "ingress" +%token GBP "gbp" %token COUNTERS "counters" %token QUOTAS "quotas" @@ -770,7 +771,7 @@ int nft_lex(void *, void *, void *); %type flowtable_block_alloc flowtable_block %destructor { flowtable_free($$); } flowtable_block_alloc -%type obj_block_alloc counter_block quota_block ct_helper_block ct_timeout_block ct_expect_block limit_block secmark_block synproxy_block tunnel_block erspan_block erspan_block_alloc +%type obj_block_alloc counter_block quota_block ct_helper_block ct_timeout_block ct_expect_block limit_block secmark_block synproxy_block tunnel_block erspan_block erspan_block_alloc vxlan_block vxlan_block_alloc %destructor { obj_free($$); } obj_block_alloc %type stmt_list stateful_stmt_list set_elem_stmt_list @@ -5011,6 +5012,27 @@ erspan_config : HDRVERSION NUM } ; +vxlan_block : /* empty */ { $$ = $-1; } + | vxlan_block common_block + | vxlan_block stmt_separator + | vxlan_block vxlan_config stmt_separator + { + $$ = $1; + } + ; + +vxlan_block_alloc : /* empty */ + { + $$ = $-1; + } + ; + +vxlan_config : GBP NUM + { + $0->tunnel.vxlan.gbp = $2; + } + ; + tunnel_config : ID NUM { $0->tunnel.id = $2; @@ -5055,6 +5077,10 @@ tunnel_config : ID NUM { $0->tunnel.type = TUNNEL_ERSPAN; } + | VXLAN vxlan_block_alloc '{' vxlan_block '}' + { + $0->tunnel.type = TUNNEL_VXLAN; + } ; tunnel_block : /* empty */ { $$ = $-1; } -- cgit v1.2.3