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