1 /* SPDX-License-Identifier: LGPL-2.1-or-later */ 2 #pragma once 3 4 #include <netinet/in.h> 5 #include <linux/fou.h> 6 7 #include "in-addr-util.h" 8 #include "netdev.h" 9 10 typedef enum FooOverUDPEncapType { 11 NETDEV_FOO_OVER_UDP_ENCAP_UNSPEC = FOU_ENCAP_UNSPEC, 12 NETDEV_FOO_OVER_UDP_ENCAP_DIRECT = FOU_ENCAP_DIRECT, 13 NETDEV_FOO_OVER_UDP_ENCAP_GUE = FOU_ENCAP_GUE, 14 _NETDEV_FOO_OVER_UDP_ENCAP_MAX, 15 _NETDEV_FOO_OVER_UDP_ENCAP_INVALID = -EINVAL, 16 } FooOverUDPEncapType; 17 18 typedef struct FouTunnel { 19 NetDev meta; 20 21 uint8_t fou_protocol; 22 23 uint16_t port; 24 uint16_t peer_port; 25 26 int local_family; 27 int peer_family; 28 29 FooOverUDPEncapType fou_encap_type; 30 union in_addr_union local; 31 union in_addr_union peer; 32 } FouTunnel; 33 34 DEFINE_NETDEV_CAST(FOU, FouTunnel); 35 extern const NetDevVTable foutnl_vtable; 36 37 const char *fou_encap_type_to_string(FooOverUDPEncapType d) _const_; 38 FooOverUDPEncapType fou_encap_type_from_string(const char *d) _pure_; 39 40 CONFIG_PARSER_PROTOTYPE(config_parse_fou_encap_type); 41 CONFIG_PARSER_PROTOTYPE(config_parse_ip_protocol); 42 CONFIG_PARSER_PROTOTYPE(config_parse_fou_tunnel_address); 43