1 use nix::net::if_::*; 2 3 #[cfg(any(target_os = "android", target_os = "linux"))] 4 const LOOPBACK: &[u8] = b"lo"; 5 6 #[cfg(not(any(target_os = "android", target_os = "linux")))] 7 const LOOPBACK: &[u8] = b"lo0"; 8 9 #[test] test_if_nametoindex()10fn test_if_nametoindex() { 11 assert!(if_nametoindex(&LOOPBACK[..]).is_ok()); 12 } 13