pub fn name_to_index(fd: impl AsFd, if_name: &str) -> Result<u32>
ioctl(fd, SIOCGIFINDEX, ifreq)—Returns the interface index for a given name.
ioctl(fd, SIOCGIFINDEX, ifreq)
See the module-level documentation for information about fd usage.
fd