//! Network configuration and local-address discovery helpers.
use crateNetError;
use Ipv4Addr;
pub use crate;
/// Enumerate the local interfaces and pick the LAN IPv4 address most suitable
/// to advertise to LAN peers.
///
/// Replaces the old `connect(8.8.8.8)` route probe: under a VPN / Clash
/// global TUN setup that probe resolves to a virtual adapter address (e.g.
/// `198.18.x.x`), which LAN peers cannot reach. Enumerating interfaces plus
/// the curated subnet/name filters avoids virtual adapters by construction.
///
/// Returns `None` when no usable LAN address exists (the caller should then
/// refrain from advertising an address at all, rather than pretending with a
/// fallback like `127.0.0.1`).