pub struct NetworkPortEntry {
pub instance: u32,
pub network_type: u32,
pub network_number: u32,
pub mac: MacAddr,
pub ip: [u8; 4],
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, VIRTUAL=7 for SC/loopback).
network_number: u32BACnet network number for this port.
mac: MacAddrPort MAC (B/IP 6-byte IP+port, 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 for SC/loopback.
udp_port: u16UDP port for B/IP; 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 std::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);