summaryrefslogtreecommitdiff
path: root/test/test_net.rs
blob: acdaf47a86cdad10f1b1c3d41ddaf0d4e83f0ecb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
use nix::net::if_::*;

#[cfg(target_os = "linux")]
const LOOPBACK: &'static [u8] = b"lo";

#[cfg(not(target_os = "linux"))]
const LOOPBACK: &'static [u8] = b"lo0";

#[test]
fn test_if_nametoindex() {
    assert!(if_nametoindex(&LOOPBACK[..]).is_ok());
}