]>
Commit | Line | Data |
---|---|---|
db9ecf05 | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
53cb501a SS |
2 | #pragma once |
3 | ||
9aa5d8ba | 4 | #include <netinet/in.h> |
53cb501a | 5 | #include <linux/fou.h> |
53cb501a SS |
6 | |
7 | #include "in-addr-util.h" | |
737f1405 | 8 | #include "netdev.h" |
53cb501a SS |
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, | |
2d93c20e | 15 | _NETDEV_FOO_OVER_UDP_ENCAP_INVALID = -EINVAL, |
53cb501a SS |
16 | } FooOverUDPEncapType; |
17 | ||
18 | typedef struct FouTunnel { | |
19 | NetDev meta; | |
20 | ||
21 | uint8_t fou_protocol; | |
22 | ||
23 | uint16_t port; | |
8f02c9b0 | 24 | uint16_t peer_port; |
53cb501a | 25 | |
4502a61c SS |
26 | int local_family; |
27 | int peer_family; | |
28 | ||
53cb501a | 29 | FooOverUDPEncapType fou_encap_type; |
4502a61c SS |
30 | union in_addr_union local; |
31 | union in_addr_union peer; | |
53cb501a SS |
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 | ||
538f15cf | 40 | CONFIG_PARSER_PROTOTYPE(config_parse_fou_encap_type); |
7df5c6ba | 41 | CONFIG_PARSER_PROTOTYPE(config_parse_ip_protocol); |
4502a61c | 42 | CONFIG_PARSER_PROTOTYPE(config_parse_fou_tunnel_address); |