From ffc40b38d58d3f754d20c0e586981b2f442a247e Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 21 Aug 2025 11:12:57 +0200 Subject: tunnel: add erspan support This patch extends the tunnel metadata object to define erspan 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 erspan { version 1 index 2 } } } Joint work with Fernando. Signed-off-by: Fernando Fernandez Mancera Signed-off-by: Pablo Neira Ayuso --- include/rule.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include/rule.h') diff --git a/include/rule.h b/include/rule.h index 0fa87b52..71e9a07e 100644 --- a/include/rule.h +++ b/include/rule.h @@ -492,6 +492,11 @@ struct secmark { char ctx[NFT_SECMARK_CTX_MAXLEN]; }; +enum tunnel_type { + TUNNEL_UNSPEC = 0, + TUNNEL_ERSPAN, +}; + struct tunnel { uint32_t id; struct expr *src; @@ -500,6 +505,19 @@ struct tunnel { uint16_t dport; uint8_t tos; uint8_t ttl; + enum tunnel_type type; + union { + struct { + uint32_t version; + struct { + uint32_t index; + } v1; + struct { + uint8_t direction; + uint8_t hwid; + } v2; + } erspan; + }; }; /** -- cgit v1.2.3