/bionic/libc/bionic/ |
if_nametoindex.c | 44 struct ifreq ifr; local 46 memset(&ifr, 0, sizeof(struct ifreq)); 47 strncpy(ifr.ifr_name, ifname, IFNAMSIZ); 48 ifr.ifr_name[IFNAMSIZ - 1] = 0; 52 if (ioctl(ctl_sock, SIOCGIFINDEX, &ifr) >= 0) { 53 index = ifr.ifr_ifindex;
|
if_indextoname.c | 46 struct ifreq ifr; local 49 memset(&ifr, 0, sizeof(struct ifreq)); 50 ifr.ifr_ifindex = ifindex; 53 if (ioctl(ctl_sock, SIOCGIFNAME, &ifr) >= 0) { 54 ret = strncpy (ifname, ifr.ifr_name, IFNAMSIZ);
|
/external/libppp/src/ |
tun.c | 87 struct ifreq ifr; local 97 sprintf(ifr.ifr_name, "tun%d", bundle->unit); 98 ifr.ifr_mtu = bundle->iface->mtu; 99 if (ioctl(s, SIOCSIFMTU, &ifr) < 0)
|
/external/iproute2/ip/ |
tunnel.c | 68 struct ifreq ifr; local 72 strncpy(ifr.ifr_name, dev, IFNAMSIZ); 74 err = ioctl(fd, SIOCGIFINDEX, &ifr); 80 return ifr.ifr_ifindex; 85 struct ifreq ifr; local 89 strncpy(ifr.ifr_name, dev, IFNAMSIZ); 91 err = ioctl(fd, SIOCGIFHWADDR, &ifr); 97 return ifr.ifr_addr.sa_family; 103 static struct ifreq ifr; local 107 ifr.ifr_ifindex = idx 120 struct ifreq ifr; local 136 struct ifreq ifr; local 155 struct ifreq ifr; local 174 struct ifreq ifr; local [all...] |
ipmaddr.c | 277 struct ifreq ifr; local 280 memset(&ifr, 0, sizeof(ifr)); 290 if (ifr.ifr_name[0]) 292 strncpy(ifr.ifr_name, *argv, IFNAMSIZ); 299 if (ifr.ifr_hwaddr.sa_data[0]) 301 if (ll_addr_a2n(ifr.ifr_hwaddr.sa_data, 309 if (ifr.ifr_name[0] == 0) { 319 if (ioctl(fd, cmd, (char*)&ifr) != 0) {
|
iptuntap.c | 48 static int tap_add_ioctl(struct ifreq *ifr, uid_t uid, gid_t gid) 54 ifr->ifr_flags |= IFF_TUN_EXCL; 62 if (ioctl(fd, TUNSETIFF, ifr)) { 84 static int tap_del_ioctl(struct ifreq *ifr) 93 if (ioctl(fd, TUNSETIFF, ifr)) { 107 static int parse_args(int argc, char **argv, struct ifreq *ifr, uid_t *uid, gid_t *gid) 111 memset(ifr, 0, sizeof(*ifr)); 113 ifr->ifr_flags |= IFF_NO_PI; 119 if (ifr->ifr_flags & IFF_TAP) 193 struct ifreq ifr; local 209 struct ifreq ifr; local [all...] |
/external/openssh/openbsd-compat/ |
port-tun.c | 60 struct ifreq ifr; local 70 bzero(&ifr, sizeof(ifr)); 73 ifr.ifr_flags = IFF_TAP; 76 ifr.ifr_flags = IFF_TUN; 79 ifr.ifr_flags |= IFF_NO_PI; 87 snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), name, tun); 90 if (ioctl(fd, TUNSETIFF, &ifr) == -1) { 99 debug("%s: %s mode %d fd %d", __func__, ifr.ifr_name, mode, fd) 120 struct ifreq ifr; local [all...] |
/external/strace/ |
sock.c | 71 print_addr(tcp, addr, ifr) 74 struct ifreq *ifr; 76 if (ifr->ifr_addr.sa_family == AF_INET) { 78 sinp = (struct sockaddr_in *) &ifr->ifr_addr; 81 printstr(tcp, addr, sizeof(ifr->ifr_addr.sa_data)); 87 struct ifreq ifr; local 159 if (umove(tcp, tcp->u_arg[2], &ifr) < 0) 163 tprintf(", {ifr_index=%d, ifr_name=???}", ifr.ifr_ifindex); 165 tprintf(", {ifr_name=\"%s\", ???}", ifr.ifr_name); 168 ifr.ifr_ifindex, ifr.ifr_name) [all...] |
/external/wpa_supplicant_8/src/drivers/ |
driver_openbsd.c | 33 struct ifreq ifr; local 35 os_memset(&ifr, 0, sizeof(ifr)); 36 os_strlcpy(ifr.ifr_name, drv->ifname, sizeof(ifr.ifr_name)); 37 ifr.ifr_data = (void *)&nwid; 38 if (ioctl(drv->sock, SIOCG80211NWID, &ifr) < 0 ||
|
linux_ioctl.c | 20 struct ifreq ifr; local 26 os_memset(&ifr, 0, sizeof(ifr)); 27 os_strlcpy(ifr.ifr_name, ifname, IFNAMSIZ); 29 if (ioctl(sock, SIOCGIFFLAGS, &ifr) != 0) { 37 if (ifr.ifr_flags & IFF_UP) 39 ifr.ifr_flags |= IFF_UP; 41 if (!(ifr.ifr_flags & IFF_UP)) 43 ifr.ifr_flags &= ~IFF_UP; 46 if (ioctl(sock, SIOCSIFFLAGS, &ifr) != 0) 60 struct ifreq ifr; local 82 struct ifreq ifr; local 105 struct ifreq ifr; local 162 struct ifreq ifr; local 184 struct ifreq ifr; local [all...] |
/frameworks/native/cmds/ip-up-vpn/ |
ip-up-vpn.c | 89 struct ifreq ifr; local 92 memset(&ifr, 0, sizeof(ifr)); 113 ifr.ifr_flags = IFF_UP; 114 strncpy(ifr.ifr_name, interface, IFNAMSIZ); 115 if (ioctl(s, SIOCSIFFLAGS, &ifr)) { 121 if (!set_address(&ifr.ifr_addr, address) || 122 ioctl(s, SIOCSIFADDR, &ifr)) { 128 if (set_address(&ifr.ifr_netmask, env("INTERNAL_NETMASK4"))) { 129 if (ioctl(s, SIOCSIFNETMASK, &ifr)) { [all...] |
/development/samples/ToyVpn/server/linux/ |
ToyVpnServer.cpp | 65 ifreq ifr; local 66 memset(&ifr, 0, sizeof(ifr)); 67 ifr.ifr_flags = IFF_TUN | IFF_NO_PI; 68 strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); 70 if (ioctl(interface, TUNSETIFF, &ifr)) {
|