From 59f03bf14835fe5764b016491ce50715df5711c2 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 21 Aug 2025 11:13:00 +0200 Subject: tunnel: add geneve support This patch extends the tunnel metadata object to define geneve 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 geneve { class 0x1010 opt-type 0x1 data "0x12345678" class 0x1020 opt-type 0x2 data "0x87654321" class 0x2020 opt-type 0x3 data "0x87654321abcdeffe" } } } Signed-off-by: Fernando Fernandez Mancera Signed-off-by: Pablo Neira Ayuso --- include/rule.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/rule.h') diff --git a/include/rule.h b/include/rule.h index c52af2c4..498a88bf 100644 --- a/include/rule.h +++ b/include/rule.h @@ -496,6 +496,15 @@ enum tunnel_type { TUNNEL_UNSPEC = 0, TUNNEL_ERSPAN, TUNNEL_VXLAN, + TUNNEL_GENEVE, +}; + +struct tunnel_geneve { + struct list_head list; + uint16_t geneve_class; + uint8_t type; + uint8_t data[NFTNL_TUNNEL_GENEVE_DATA_MAXLEN]; + uint32_t data_len; }; struct tunnel { @@ -521,9 +530,14 @@ struct tunnel { struct { uint32_t gbp; } vxlan; + struct list_head geneve_opts; }; }; +int tunnel_geneve_data_str2array(const char *hexstr, + uint8_t *out_data, + uint32_t *out_len); + /** * struct obj - nftables stateful object statement * -- cgit v1.2.3