pub struct IfaceInfo {
pub index: u32,
pub name: String,
pub ip: Ipv4Addr,
pub netmask: Ipv4Addr,
pub broadcast: Option<Ipv4Addr>,
pub up_non_loopback: bool,
}Expand description
Snapshot of one IPv4 interface.
Fields§
§index: u32Kernel interface index (if_nametoindex). 0 means “let the
kernel pick” — useful as a sentinel when the platform did
not surface an index.
name: StringInterface name (eth0, en0, Wi-Fi, …).
ip: Ipv4AddrIPv4 address bound on this interface.
netmask: Ipv4AddrIPv4 netmask.
broadcast: Option<Ipv4Addr>Subnet broadcast address (when reported by the OS), e.g.
10.0.0.255. None for point-to-point links.
up_non_loopback: booltrue when the interface carries the OS IFF_UP flag and
is not loopback — the eligibility test for SEARCH/beacon
fanout. C parity: osiSockDiscoverBroadcastAddresses
(osdNetIfConf.c:170-181) skips !(IFF_UP) and IFF_LOOPBACK
interfaces. On Linux (where the crate links libc) this
consults the live kernel flags via getifaddrs; on other
targets it falls back to !is_loopback() because the
platform’s enumerator already excludes operationally-down
adapters.