Skip to content

Commit 4899829

Browse files
Erich HeineRileyGirlie
Erich Heine
authored andcommitted
Upate dependencies: netlink-packet-route = 0.16
Fixes for the new version: * Change names -> Slave to Port where InfoBond is being used. * Deprecate functions with `slave` in the name, and point to new functions using the `port` terminology instead. * update docs for all cases
1 parent 9a25c16 commit 4899829

File tree

2 files changed

+46
-16
lines changed

2 files changed

+46
-16
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ log = "0.4.8"
2222
thiserror = "1"
2323
netlink-sys = { version = "0.8" }
2424
netlink-packet-utils = { version = "0.5" }
25-
netlink-packet-route = { version = "0.15" }
25+
netlink-packet-route = { version = "0.16" }
2626
netlink-packet-core = { version = "0.5" }
2727
netlink-proto = { default-features = false, version = "0.11" }
2828
nix = { version = "0.26.1", default-features = false, features = ["fs", "mount", "sched", "signal"] }

src/link/add.rs

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,22 @@ impl BondAddRequest {
4646
self
4747
}
4848

49-
/// Adds the `active_slave` attribute to the bond, where `active_slave`
49+
/// Adds the `active_port` attribute to the bond, where `active_port`
5050
/// is the ifindex of an interface attached to the bond.
51-
/// This is equivalent to `ip link add name NAME type bond active_slave
52-
/// ACTIVE_SLAVE_NAME`.
53-
pub fn active_slave(mut self, active_slave: u32) -> Self {
54-
self.info_data.push(InfoBond::ActiveSlave(active_slave));
51+
/// This is equivalent to `ip link add name NAME type bond active_port
52+
/// ACTIVE_PORT_NAME`.
53+
pub fn active_port(mut self, active_port: u32) -> Self {
54+
self.info_data.push(InfoBond::ActivePort(active_port));
55+
self
56+
}
57+
58+
/// Adds the `active_port` attribute to the bond, where `active_port`
59+
/// is the ifindex of an interface attached to the bond.
60+
/// This is equivalent to `ip link add name NAME type bond active_port
61+
/// ACTIVE_PORT_NAME`.
62+
#[deprecated(since = "0.13.0", note = "please use `active_port` instead")]
63+
pub fn active_slave(mut self, active_port: u32) -> Self {
64+
self.info_data.push(InfoBond::ActivePort(active_port));
5565
self
5666
}
5767

@@ -161,12 +171,22 @@ impl BondAddRequest {
161171
self
162172
}
163173

164-
/// Adds the `all_slaves_active` attribute to the bond
165-
/// This is equivalent to `ip link add name NAME type bond all_slaves_active
166-
/// ALL_SLAVES_ACTIVE`.
167-
pub fn all_slaves_active(mut self, all_slaves_active: u8) -> Self {
174+
/// Adds the `all_ports_active` attribute to the bond
175+
/// This is equivalent to `ip link add name NAME type bond all_ports_active
176+
/// ALL_PORTS_ACTIVE`.
177+
pub fn all_ports_active(mut self, all_ports_active: u8) -> Self {
178+
self.info_data
179+
.push(InfoBond::AllPortsActive(all_ports_active));
180+
self
181+
}
182+
///
183+
/// Adds the `all_ports_active` attribute to the bond
184+
/// This is equivalent to `ip link add name NAME type bond all_ports_active
185+
/// ALL_PORTS_ACTIVE`.
186+
#[deprecated(since = "0.13.0", note = "use `all_ports_active` instead")]
187+
pub fn all_slaves_active(mut self, all_ports_active: u8) -> Self {
168188
self.info_data
169-
.push(InfoBond::AllSlavesActive(all_slaves_active));
189+
.push(InfoBond::AllPortsActive(all_ports_active));
170190
self
171191
}
172192

@@ -186,12 +206,22 @@ impl BondAddRequest {
186206
self
187207
}
188208

189-
/// Adds the `packets_per_slave` attribute to the bond
190-
/// This is equivalent to `ip link add name NAME type bond packets_per_slave
191-
/// PACKETS_PER_SLAVE`.
192-
pub fn packets_per_slave(mut self, packets_per_slave: u32) -> Self {
209+
/// Adds the `packets_per_port` attribute to the bond
210+
/// This is equivalent to `ip link add name NAME type bond packets_per_port
211+
/// PACKETS_PER_PORT`.
212+
pub fn packets_per_port(mut self, packets_per_port: u32) -> Self {
213+
self.info_data
214+
.push(InfoBond::PacketsPerPort(packets_per_port));
215+
self
216+
}
217+
218+
/// Adds the `packets_per_port` attribute to the bond
219+
/// This is equivalent to `ip link add name NAME type bond packets_per_port
220+
/// PACKETS_PER_PORT`.
221+
#[deprecated(since = "0.13.0", note = "use `packets_per_port` instead")]
222+
pub fn packets_per_slave(mut self, packets_per_port: u32) -> Self {
193223
self.info_data
194-
.push(InfoBond::PacketsPerSlave(packets_per_slave));
224+
.push(InfoBond::PacketsPerPort(packets_per_port));
195225
self
196226
}
197227

0 commit comments

Comments
 (0)