1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3 
4 #include <netinet/in.h>
5 #include <linux/if_bonding.h>
6 
7 #include "bond-util.h"
8 #include "macro.h"
9 #include "netdev.h"
10 #include "ordered-set.h"
11 
12 typedef struct Bond {
13         NetDev meta;
14 
15         BondMode mode;
16         BondXmitHashPolicy xmit_hash_policy;
17         BondLacpRate lacp_rate;
18         BondAdSelect ad_select;
19         BondFailOverMac fail_over_mac;
20         BondArpValidate arp_validate;
21         BondArpAllTargets arp_all_targets;
22         BondPrimaryReselect primary_reselect;
23 
24         int tlb_dynamic_lb;
25 
26         bool all_slaves_active;
27 
28         unsigned resend_igmp;
29         unsigned packets_per_slave;
30         unsigned num_grat_arp;
31         unsigned min_links;
32 
33         uint16_t ad_actor_sys_prio;
34         uint16_t ad_user_port_key;
35         struct ether_addr ad_actor_system;
36 
37         usec_t miimon;
38         usec_t updelay;
39         usec_t downdelay;
40         usec_t arp_interval;
41         usec_t lp_interval;
42 
43         OrderedSet *arp_ip_targets;
44 } Bond;
45 
46 DEFINE_NETDEV_CAST(BOND, Bond);
47 extern const NetDevVTable bond_vtable;
48 
49 CONFIG_PARSER_PROTOTYPE(config_parse_bond_mode);
50 CONFIG_PARSER_PROTOTYPE(config_parse_bond_xmit_hash_policy);
51 CONFIG_PARSER_PROTOTYPE(config_parse_bond_lacp_rate);
52 CONFIG_PARSER_PROTOTYPE(config_parse_bond_ad_select);
53 CONFIG_PARSER_PROTOTYPE(config_parse_bond_fail_over_mac);
54 CONFIG_PARSER_PROTOTYPE(config_parse_bond_arp_validate);
55 CONFIG_PARSER_PROTOTYPE(config_parse_bond_arp_all_targets);
56 CONFIG_PARSER_PROTOTYPE(config_parse_bond_primary_reselect);
57 CONFIG_PARSER_PROTOTYPE(config_parse_arp_ip_target_address);
58 CONFIG_PARSER_PROTOTYPE(config_parse_ad_actor_sys_prio);
59 CONFIG_PARSER_PROTOTYPE(config_parse_ad_user_port_key);
60 CONFIG_PARSER_PROTOTYPE(config_parse_ad_actor_system);
61