@@ -5,7 +5,8 @@ use std::net::{Ipv4Addr, Ipv6Addr};
5
5
use crate :: {
6
6
link:: LinkMessageBuilder ,
7
7
packet_route:: link:: {
8
- BondArpValidate , BondMode , InfoBond , InfoData , InfoKind ,
8
+ BondArpAllTargets , BondArpValidate , BondFailOverMac , BondMode ,
9
+ BondPrimaryReselect , BondXmitHashPolicy , InfoBond , InfoData , InfoKind ,
9
10
} ,
10
11
} ;
11
12
@@ -125,7 +126,7 @@ impl LinkMessageBuilder<LinkBond> {
125
126
/// Adds the `arp_all_targets` attribute to the bond
126
127
/// This is equivalent to `ip link add name NAME type bond arp_all_targets
127
128
/// ARP_ALL_TARGETS`
128
- pub fn arp_all_targets ( self , arp_all_targets : u32 ) -> Self {
129
+ pub fn arp_all_targets ( self , arp_all_targets : BondArpAllTargets ) -> Self {
129
130
self . append_info_data ( InfoBond :: ArpAllTargets ( arp_all_targets) )
130
131
}
131
132
@@ -140,21 +141,27 @@ impl LinkMessageBuilder<LinkBond> {
140
141
/// Adds the `primary_reselect` attribute to the bond
141
142
/// This is equivalent to `ip link add name NAME type bond primary_reselect
142
143
/// PRIMARY_RESELECT`.
143
- pub fn primary_reselect ( self , primary_reselect : u8 ) -> Self {
144
+ pub fn primary_reselect (
145
+ self ,
146
+ primary_reselect : BondPrimaryReselect ,
147
+ ) -> Self {
144
148
self . append_info_data ( InfoBond :: PrimaryReselect ( primary_reselect) )
145
149
}
146
150
147
151
/// Adds the `fail_over_mac` attribute to the bond
148
152
/// This is equivalent to `ip link add name NAME type bond fail_over_mac
149
153
/// FAIL_OVER_MAC`.
150
- pub fn fail_over_mac ( self , fail_over_mac : u8 ) -> Self {
154
+ pub fn fail_over_mac ( self , fail_over_mac : BondFailOverMac ) -> Self {
151
155
self . append_info_data ( InfoBond :: FailOverMac ( fail_over_mac) )
152
156
}
153
157
154
158
/// Adds the `xmit_hash_policy` attribute to the bond
155
159
/// This is equivalent to `ip link add name NAME type bond xmit_hash_policy
156
160
/// XMIT_HASH_POLICY`.
157
- pub fn xmit_hash_policy ( self , xmit_hash_policy : u8 ) -> Self {
161
+ pub fn xmit_hash_policy (
162
+ self ,
163
+ xmit_hash_policy : BondXmitHashPolicy ,
164
+ ) -> Self {
158
165
self . append_info_data ( InfoBond :: XmitHashPolicy ( xmit_hash_policy) )
159
166
}
160
167
0 commit comments