Skip to main content

parse_interface_state_files

Function parse_interface_state_files 

Source
pub async fn parse_interface_state_files(
    states_path: &PathBuf,
    maybe_network_int_to_name: Option<HashMap<i32, String>>,
    sysfs_root: &Path,
    maybe_dbus: Option<(&Arc<OnceCell<Connection>>, u64)>,
) -> Result<NetworkdState, MonitordNetworkdError>
Expand description

Parse interface state files in directory supplied.

The ifindex-to-name map comes from maybe_network_int_to_name when the caller has one; otherwise it is read from sysfs (sysfs_root, normally /sys) — kernel truth, no IPC. The D-Bus ListLinks lookup remains only as a last resort for environments where sysfs is restricted but the bus is reachable.