• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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(
7     target_os = "android",
8     target_os = "linux",
9     target_os = "haiku"
10 )))]
11 const LOOPBACK: &[u8] = b"lo0";
12 
13 #[cfg(target_os = "haiku")]
14 const LOOPBACK: &[u8] = b"loop";
15 
16 #[test]
test_if_nametoindex()17 fn test_if_nametoindex() {
18     if_nametoindex(LOOPBACK).expect("assertion failed");
19 }
20