2020-11-09 05:23:58 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
2015-08-27 13:59:06 +02:00
|
|
|
#pragma once
|
|
|
|
|
2019-05-09 02:33:45 +02:00
|
|
|
#include <netinet/in.h>
|
2019-04-12 06:29:46 +02:00
|
|
|
#include <linux/if_bonding.h>
|
|
|
|
|
2020-05-17 06:14:49 +02:00
|
|
|
#include "bond-util.h"
|
|
|
|
#include "macro.h"
|
2019-04-12 06:29:46 +02:00
|
|
|
#include "netdev.h"
|
2019-04-12 07:14:19 +02:00
|
|
|
#include "ordered-set.h"
|
2014-07-06 14:07:34 +02:00
|
|
|
|
2016-04-29 04:52:04 +02:00
|
|
|
typedef struct Bond {
|
2014-07-16 13:17:10 +02:00
|
|
|
NetDev meta;
|
|
|
|
|
|
|
|
BondMode mode;
|
2014-07-21 15:07:05 +02:00
|
|
|
BondXmitHashPolicy xmit_hash_policy;
|
2014-07-21 15:22:14 +02:00
|
|
|
BondLacpRate lacp_rate;
|
2015-03-09 10:58:29 +01:00
|
|
|
BondAdSelect ad_select;
|
|
|
|
BondFailOverMac fail_over_mac;
|
|
|
|
BondArpValidate arp_validate;
|
|
|
|
BondArpAllTargets arp_all_targets;
|
|
|
|
BondPrimaryReselect primary_reselect;
|
|
|
|
|
2018-12-13 10:23:07 +01:00
|
|
|
int tlb_dynamic_lb;
|
|
|
|
|
2015-03-09 10:58:29 +01:00
|
|
|
bool all_slaves_active;
|
|
|
|
|
|
|
|
unsigned resend_igmp;
|
|
|
|
unsigned packets_per_slave;
|
|
|
|
unsigned num_grat_arp;
|
|
|
|
unsigned min_links;
|
2014-07-21 15:44:48 +02:00
|
|
|
|
2018-11-02 02:31:20 +01:00
|
|
|
uint16_t ad_actor_sys_prio;
|
|
|
|
uint16_t ad_user_port_key;
|
2019-04-12 06:37:02 +02:00
|
|
|
struct ether_addr ad_actor_system;
|
2018-11-02 02:31:20 +01:00
|
|
|
|
2014-07-21 15:44:48 +02:00
|
|
|
usec_t miimon;
|
|
|
|
usec_t updelay;
|
|
|
|
usec_t downdelay;
|
2015-03-09 10:58:29 +01:00
|
|
|
usec_t arp_interval;
|
|
|
|
usec_t lp_interval;
|
|
|
|
|
2019-04-12 07:14:19 +02:00
|
|
|
OrderedSet *arp_ip_targets;
|
2016-04-29 04:52:04 +02:00
|
|
|
} Bond;
|
2014-07-16 13:17:10 +02:00
|
|
|
|
2016-04-29 04:52:04 +02:00
|
|
|
DEFINE_NETDEV_CAST(BOND, Bond);
|
2014-07-16 13:17:10 +02:00
|
|
|
extern const NetDevVTable bond_vtable;
|
|
|
|
|
2019-05-10 16:29:07 +02:00
|
|
|
int link_set_bond(Link *link);
|
|
|
|
|
2018-11-12 08:45:04 +01:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_bond_mode);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_bond_xmit_hash_policy);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_bond_lacp_rate);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_bond_ad_select);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_bond_fail_over_mac);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_bond_arp_validate);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_bond_arp_all_targets);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_bond_primary_reselect);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_arp_ip_target_address);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_ad_actor_sys_prio);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_ad_user_port_key);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_ad_actor_system);
|