Skip to content
This repository was archived by the owner on Oct 26, 2022. It is now read-only.

Commit 8d3db04

Browse files
authored
Merge pull request #213 from flouthoc/extend_bridge_vlan_info
2 parents 3acc78f + 5287cb5 commit 8d3db04

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

netlink-packet-route/src/rtnl/constants.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,13 @@ pub const IFLA_BRIDGE_FLAGS: u16 = 47;
399399
pub const BRIDGE_FLAGS_MASTER: u16 = 1; /* Bridge command to/from master */
400400
pub const BRIDGE_FLAGS_SELF: u16 = 2; /* Bridge command to/from lowerdev */
401401

402+
pub const IFLA_BRIDGE_VLAN_INFO: u16 = 48;
403+
pub const BRIDGE_VLAN_INFO_MASTER: u16 = 1;
404+
pub const BRIDGE_VLAN_INFO_PVID: u16 = 4;
405+
pub const BRIDGE_VLAN_INFO_UNTAGGED: u16 = 8;
406+
pub const BRIDGE_VLAN_INFO_RANGE_BEGIN: u16 = 16;
407+
pub const BRIDGE_VLAN_INFO_RANGE_END: u16 = 32;
408+
402409
pub const IFLA_BR_UNSPEC: u16 = 0;
403410
pub const IFLA_BR_FORWARD_DELAY: u16 = 1;
404411
pub const IFLA_BR_HELLO_TIME: u16 = 2;

netlink-packet-route/src/rtnl/link/nlas/link_infos.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,7 @@ pub enum InfoBridge {
835835
RootPort(u16),
836836
VlanDefaultPvid(u16),
837837
VlanFiltering(u8),
838+
VlanInfo(u16),
838839
TopologyChange(u8),
839840
TopologyChangeDetected(u8),
840841
MulticastRouter(u8),
@@ -885,6 +886,7 @@ impl Nla for InfoBridge {
885886
| RootPathCost(_)
886887
=> 4,
887888
Priority(_)
889+
| VlanInfo(_)
888890
| VlanProtocol(_)
889891
| GroupFwdMask(_)
890892
| RootPort(_)
@@ -925,6 +927,7 @@ impl Nla for InfoBridge {
925927
use self::InfoBridge::*;
926928
match self {
927929
Flags(value) => NativeEndian::write_u16(buffer, *value),
930+
VlanInfo(value) => NativeEndian::write_u16(buffer, *value),
928931
Unspec(ref bytes)
929932
| FdbFlush(ref bytes)
930933
| Pad(ref bytes)
@@ -1031,6 +1034,7 @@ impl Nla for InfoBridge {
10311034
RootPort(_) => IFLA_BR_ROOT_PORT,
10321035
VlanDefaultPvid(_) => IFLA_BR_VLAN_DEFAULT_PVID,
10331036
VlanFiltering(_) => IFLA_BR_VLAN_FILTERING,
1037+
VlanInfo(_) => IFLA_BRIDGE_VLAN_INFO,
10341038
TopologyChange(_) => IFLA_BR_TOPOLOGY_CHANGE,
10351039
TopologyChangeDetected(_) => IFLA_BR_TOPOLOGY_CHANGE_DETECTED,
10361040
MulticastRouter(_) => IFLA_BR_MCAST_ROUTER,
@@ -1062,6 +1066,9 @@ impl<'a, T: AsRef<[u8]> + ?Sized> Parseable<NlaBuffer<&'a T>> for InfoBridge {
10621066
IFLA_BR_HELLO_TIMER => {
10631067
HelloTimer(parse_u64(payload).context("invalid IFLA_BR_HELLO_TIMER value")?)
10641068
}
1069+
IFLA_BRIDGE_VLAN_INFO => {
1070+
VlanInfo(parse_u16(payload).context("invalid IFLA_BRIDGE_VLAN_INFO value")?)
1071+
}
10651072
IFLA_BR_TCN_TIMER => {
10661073
TcnTimer(parse_u64(payload).context("invalid IFLA_BR_TCN_TIMER value")?)
10671074
}

0 commit comments

Comments
 (0)