Lines Matching refs:ifr
61 struct ifreq ifr; in sys_tun_open() local
71 bzero(&ifr, sizeof(ifr)); in sys_tun_open()
74 ifr.ifr_flags = IFF_TAP; in sys_tun_open()
77 ifr.ifr_flags = IFF_TUN; in sys_tun_open()
80 ifr.ifr_flags |= IFF_NO_PI; in sys_tun_open()
88 snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), name, tun); in sys_tun_open()
91 if (ioctl(fd, TUNSETIFF, &ifr) == -1) { in sys_tun_open()
100 debug("%s: %s mode %d fd %d", __func__, ifr.ifr_name, mode, fd); in sys_tun_open()
121 struct ifreq ifr; in sys_tun_open() local
171 snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s%d", tunbase, tun); in sys_tun_open()
175 if (ioctl(sock, SIOCGIFFLAGS, &ifr) == -1) in sys_tun_open()
177 if ((ifr.ifr_flags & IFF_UP) == 0) { in sys_tun_open()
178 ifr.ifr_flags |= IFF_UP; in sys_tun_open()
179 if (ioctl(sock, SIOCSIFFLAGS, &ifr) == -1) in sys_tun_open()