| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include <linux/if_link.h> |
| 5 |
|
| 6 |
#include "in-addr-util.h" |
| 7 |
#include "netdev.h" |
| 8 |
|
| 9 |
#define VXLAN_VID_MAX (1u << 24) - 1 |
| 10 |
#define VXLAN_FLOW_LABEL_MAX_MASK 0xFFFFFU |
| 11 |
|
| 12 |
typedef enum VxLanDF { |
| 13 |
NETDEV_VXLAN_DF_NO = VXLAN_DF_UNSET, |
| 14 |
NETDEV_VXLAN_DF_YES = VXLAN_DF_SET, |
| 15 |
NETDEV_VXLAN_DF_INHERIT = VXLAN_DF_INHERIT, |
| 16 |
_NETDEV_VXLAN_DF_MAX, |
| 17 |
_NETDEV_VXLAN_DF_INVALID = -EINVAL, |
| 18 |
} VxLanDF; |
| 19 |
|
| 20 |
typedef struct VxLan { |
| 21 |
NetDev meta; |
| 22 |
|
| 23 |
uint32_t vni; |
| 24 |
|
| 25 |
int remote_family; |
| 26 |
int local_family; |
| 27 |
int group_family; |
| 28 |
|
| 29 |
VxLanDF df; |
| 30 |
|
| 31 |
NetDevLocalAddressType local_type; |
| 32 |
union in_addr_union local; |
| 33 |
union in_addr_union remote; |
| 34 |
union in_addr_union group; |
| 35 |
|
| 36 |
unsigned tos; |
| 37 |
unsigned ttl; |
| 38 |
unsigned max_fdb; |
| 39 |
unsigned flow_label; |
| 40 |
|
| 41 |
uint16_t dest_port; |
| 42 |
|
| 43 |
usec_t fdb_ageing; |
| 44 |
|
| 45 |
bool learning; |
| 46 |
bool arp_proxy; |
| 47 |
bool route_short_circuit; |
| 48 |
bool l2miss; |
| 49 |
bool l3miss; |
| 50 |
bool udpcsum; |
| 51 |
bool udp6zerocsumtx; |
| 52 |
bool udp6zerocsumrx; |
| 53 |
bool remote_csum_tx; |
| 54 |
bool remote_csum_rx; |
| 55 |
bool group_policy; |
| 56 |
bool generic_protocol_extension; |
| 57 |
bool inherit; |
| 58 |
bool independent; |
| 59 |
bool external; /* a.k.a collect metadata mode */ |
| 60 |
bool vnifilter; |
| 61 |
|
| 62 |
struct ifla_vxlan_port_range port_range; |
| 63 |
} VxLan; |
| 64 |
|
| 65 |
DEFINE_NETDEV_CAST(VXLAN, VxLan); |
| 66 |
extern const NetDevVTable vxlan_vtable; |
| 67 |
|
| 68 |
DECLARE_STRING_TABLE_LOOKUP(df, VxLanDF); |
| 69 |
|
| 70 |
CONFIG_PARSER_PROTOTYPE(config_parse_vxlan_address); |
| 71 |
CONFIG_PARSER_PROTOTYPE(config_parse_port_range); |
| 72 |
CONFIG_PARSER_PROTOTYPE(config_parse_flow_label); |
| 73 |
CONFIG_PARSER_PROTOTYPE(config_parse_df); |
| 74 |
CONFIG_PARSER_PROTOTYPE(config_parse_vxlan_ttl); |