2020-11-09 05:23:58 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
2016-02-16 20:05:15 +01:00
|
|
|
#pragma once
|
|
|
|
|
2014-07-16 13:17:10 +02:00
|
|
|
typedef struct VxLan VxLan;
|
|
|
|
|
2019-05-08 19:01:08 +02:00
|
|
|
#include <linux/if_link.h>
|
|
|
|
|
2014-07-16 13:17:10 +02:00
|
|
|
#include "in-addr-util.h"
|
2019-10-30 09:02:15 +01:00
|
|
|
#include "netdev.h"
|
2014-07-16 13:17:10 +02:00
|
|
|
|
2014-07-06 14:07:34 +02:00
|
|
|
#define VXLAN_VID_MAX (1u << 24) - 1
|
2017-03-08 14:11:03 +01:00
|
|
|
#define VXLAN_FLOW_LABEL_MAX_MASK 0xFFFFFU
|
2014-07-06 14:07:34 +02:00
|
|
|
|
2019-05-08 19:01:08 +02:00
|
|
|
typedef enum VxLanDF {
|
|
|
|
NETDEV_VXLAN_DF_NO = VXLAN_DF_UNSET,
|
|
|
|
NETDEV_VXLAN_DF_YES = VXLAN_DF_SET,
|
|
|
|
NETDEV_VXLAN_DF_INHERIT = VXLAN_DF_INHERIT,
|
|
|
|
_NETDEV_VXLAN_DF_MAX,
|
|
|
|
_NETDEV_VXLAN_DF_INVALID = -1
|
|
|
|
} VxLanDF;
|
|
|
|
|
2014-07-16 13:17:10 +02:00
|
|
|
struct VxLan {
|
|
|
|
NetDev meta;
|
|
|
|
|
2019-05-07 11:15:30 +02:00
|
|
|
uint32_t vni;
|
2014-11-15 03:54:59 +01:00
|
|
|
|
2017-02-24 20:01:47 +01:00
|
|
|
int remote_family;
|
|
|
|
int local_family;
|
2019-05-07 07:14:06 +02:00
|
|
|
int group_family;
|
2017-02-24 20:01:47 +01:00
|
|
|
|
2019-05-08 19:01:08 +02:00
|
|
|
VxLanDF df;
|
|
|
|
|
2017-02-24 20:01:47 +01:00
|
|
|
union in_addr_union remote;
|
|
|
|
union in_addr_union local;
|
2019-05-07 07:14:06 +02:00
|
|
|
union in_addr_union group;
|
2014-11-15 03:54:59 +01:00
|
|
|
|
2014-07-16 13:17:10 +02:00
|
|
|
unsigned tos;
|
|
|
|
unsigned ttl;
|
2015-10-21 09:05:33 +02:00
|
|
|
unsigned max_fdb;
|
2017-03-08 14:11:03 +01:00
|
|
|
unsigned flow_label;
|
2014-11-15 03:54:59 +01:00
|
|
|
|
2015-11-28 03:35:28 +01:00
|
|
|
uint16_t dest_port;
|
|
|
|
|
2014-11-15 03:54:59 +01:00
|
|
|
usec_t fdb_ageing;
|
|
|
|
|
2014-07-16 13:17:10 +02:00
|
|
|
bool learning;
|
2014-11-15 03:54:59 +01:00
|
|
|
bool arp_proxy;
|
|
|
|
bool route_short_circuit;
|
|
|
|
bool l2miss;
|
|
|
|
bool l3miss;
|
2015-03-05 17:32:47 +01:00
|
|
|
bool udpcsum;
|
|
|
|
bool udp6zerocsumtx;
|
|
|
|
bool udp6zerocsumrx;
|
2016-10-07 15:46:18 +02:00
|
|
|
bool remote_csum_tx;
|
|
|
|
bool remote_csum_rx;
|
2015-07-29 10:35:34 +02:00
|
|
|
bool group_policy;
|
2019-05-06 21:10:57 +02:00
|
|
|
bool generic_protocol_extension;
|
2019-05-10 14:05:24 +02:00
|
|
|
bool inherit;
|
2020-09-16 03:03:30 +02:00
|
|
|
bool independent;
|
2015-11-28 03:35:28 +01:00
|
|
|
|
|
|
|
struct ifla_vxlan_port_range port_range;
|
2014-07-16 13:17:10 +02:00
|
|
|
};
|
|
|
|
|
2016-04-29 04:52:04 +02:00
|
|
|
DEFINE_NETDEV_CAST(VXLAN, VxLan);
|
2014-07-06 14:07:34 +02:00
|
|
|
extern const NetDevVTable vxlan_vtable;
|
2015-07-16 16:44:05 +02:00
|
|
|
|
2019-05-08 19:01:08 +02:00
|
|
|
const char *df_to_string(VxLanDF d) _const_;
|
|
|
|
VxLanDF df_from_string(const char *d) _pure_;
|
|
|
|
|
2018-11-12 08:45:04 +01:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_vxlan_address);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_port_range);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_flow_label);
|
2019-05-08 19:01:08 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_df);
|
2019-05-10 14:05:24 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_vxlan_ttl);
|