Lines Matching refs:ifr
49 let mut ifr: ifreq = unsafe { std::mem::zeroed() }; in create_tap_interface() localVariable
50 ifr.ifr_ifru.ifru_flags = (IFF_TAP | IFF_NO_PI | IFF_VNET_HDR) as c_short; in create_tap_interface()
51 ifr.ifr_name[..ifname.len()].copy_from_slice(ifname); in create_tap_interface()
53 unsafe { ioctl_tunsetiff(fd, &ifr) }.context("Failed to ioctl TUNSETIFF")?; in create_tap_interface()
57 unsafe { ifr.ifr_ifru.ifru_flags |= IFF_UP as c_short }; in create_tap_interface()
59 unsafe { ioctl_siocsifflags(sockfd, &ifr) }.context("Failed to ioctl SIOCSIFFLAGS")?; in create_tap_interface()
65 let ifr: ifreq = unsafe { std::mem::zeroed() }; in get_tap_ifreq() localVariable
68 unsafe { ioctl_tungetiff(fd, &ifr) }.context("Failed to ioctl TUNGETIFF")?; in get_tap_ifreq()
69 Ok(ifr) in get_tap_ifreq()
72 fn delete_tap_interface(fd: RawFd, sockfd: c_int, ifr: &mut ifreq) -> Result<()> { in delete_tap_interface()
74 unsafe { ifr.ifr_ifru.ifru_flags &= !IFF_UP as c_short }; in delete_tap_interface()
76 unsafe { ioctl_siocsifflags(sockfd, ifr) }.context("Failed to ioctl SIOCSIFFLAGS")?; in delete_tap_interface()