pub struct V2ipVlan {
pub flags: V2ipVlanFlag,
pub device: u16,
pub port: [u16; 3],
pub uplink: u8,
pub active_uplink: u8,
pub revert_s: u8,
}Expand description
VLAN tagging on a V2IP device’s uplink.
Only the device knows what it runs, so this is what it reported about
itself. A change written to it is applied at once and stays
PENDING until the mesh controller confirms it,
which proves the device still reaches the mesh and the mesh still reaches
it; unconfirmed, the device reverts it.
Fields§
§flags: V2ipVlanFlagThe block’s flags.
device: u16The VLAN id of the device’s own traffic, 0 for untagged.
port: [u16; 3]The VLAN id each downlink port carries, 0 to share the device’s
untagged traffic, indexed as V2IP_VLAN_PORTS orders them.
uplink: u8The port pinned as the uplink as 1 + its index, 0 to detect it.
active_uplink: u8Reported by the device: the port in use as the uplink, as 1 + its index.
revert_s: u8Reported by the device: the seconds before a pending configuration is reverted.
Implementations§
Source§impl V2ipVlan
impl V2ipVlan
Sourcepub const fn is_pending(&self) -> bool
pub const fn is_pending(&self) -> bool
Whether the device reverts this configuration unless the mesh controller confirms it.
Sourcepub const fn pinned_uplink(&self) -> Option<usize>
pub const fn pinned_uplink(&self) -> Option<usize>
The index of the port pinned as the uplink, None when the device
detects it.
Sourcepub const fn active_uplink(&self) -> Option<usize>
pub const fn active_uplink(&self) -> Option<usize>
The index of the port the device uses as its uplink, None for a
value that names no port.
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Whether every VLAN id is at most V2IP_VLAN_ID_MAX and the uplink is
detected or names a port.