pub struct NetworkPortEntry {
pub instance: u32,
pub network_type: u32,
pub network_number: u32,
pub mac: MacAddr,
pub ip: [u8; 4],
pub ipv6: [u8; 16],
pub udp_port: u16,
}Expand description
One configured Network-Port entry (see module docs for the profile boundary).
Provenance: population-rule coverage is Loopback-only except the B/IP + SC entries exercised in the RB-16 real-transport proofs. Field layout follows Clause 12.56; see the module docs for per-transport semantics.
Fields§
§instance: u32Network-Port object instance (caller-stable; B/IP=1, SC=2 by convention).
network_type: u32Clause 12.56 Network_Type (IPV4=5 for B/IP, IPV6=9 for B/IPv6, VIRTUAL=7 for SC/loopback).
network_number: u32BACnet network number for this port.
mac: MacAddrPort MAC (B/IP 6-byte IP+port, B/IPv6 3-byte VMAC, SC VMAC, loopback MAC). B/IP admission rejects a MAC inconsistent with the configured IP/UDP.
ip: [u8; 4]IPv4 octets for B/IP; zeros otherwise.
ipv6: [u8; 16]IPv6 octets for B/IPv6; zeros otherwise.
udp_port: u16UDP port for B/IP and B/IPv6; 0 for SC/loopback.
Implementations§
Source§impl NetworkPortEntry
impl NetworkPortEntry
Sourcepub fn bip(
instance: u32,
network_number: u32,
ip: Ipv4Addr,
udp_port: u16,
) -> Self
pub fn bip( instance: u32, network_number: u32, ip: Ipv4Addr, udp_port: u16, ) -> Self
B/IP entry with the configured IP/UDP port (possibly unbound).
Derives the 6-byte B/IP MAC (IP octets + big-endian UDP port) from the configured socket address. Explicit endpoint registration reconciles the selected entry with its actual ephemeral port during startup.
use core::net::Ipv4Addr;
use bacnet_objects::device_identity::NetworkPortEntry;
let entry = NetworkPortEntry::bip(1, 0, Ipv4Addr::LOCALHOST, 47808);
assert_eq!(entry.instance, 1);
assert_eq!(entry.udp_port, 47808);Sourcepub fn bip6(
instance: u32,
network_number: u32,
ip: Ipv6Addr,
udp_port: u16,
) -> Self
pub fn bip6( instance: u32, network_number: u32, ip: Ipv6Addr, udp_port: u16, ) -> Self
B/IPv6 entry (Annex U) with the configured address and UDP port (possibly unbound).
The VMAC is a zero placeholder: registering the port on a started
Bip6Transport publishes the VMAC the transport uses, with its
actual UDP port.
use core::net::Ipv6Addr;
use bacnet_objects::device_identity::NetworkPortEntry;
let entry = NetworkPortEntry::bip6(1, 0, Ipv6Addr::LOCALHOST, 47808);
assert_eq!(entry.ipv6, Ipv6Addr::LOCALHOST.octets());
assert_eq!(entry.mac.as_slice(), &[0, 0, 0]);