| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include <linux/fou.h> |
| 5 |
|
| 6 |
#include "in-addr-util.h" |
| 7 |
#include "netdev.h" |
| 8 |
#include "shared-forward.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 |
DECLARE_STRING_TABLE_LOOKUP(fou_encap_type, FooOverUDPEncapType); |
| 38 |
|
| 39 |
CONFIG_PARSER_PROTOTYPE(config_parse_fou_encap_type); |
| 40 |
CONFIG_PARSER_PROTOTYPE(config_parse_fou_tunnel_address); |