/external/toybox/toys/net/ |
tunctl.c | 40 struct ifreq *ifr = (void *)toybuf; local 45 ifr->ifr_flags = ((toys.optflags&FLAG_T) ? IFF_TUN : IFF_TAP)|IFF_NO_PI; 46 strncpy(ifr->ifr_name, *toys.optargs, sizeof(ifr->ifr_name));
|
/external/wpa_supplicant_8/src/ap/ |
vlan_ifconfig.c | 22 struct ifreq ifr; local 30 os_memset(&ifr, 0, sizeof(ifr)); 31 os_strlcpy(ifr.ifr_name, if_name, IFNAMSIZ); 33 if (ioctl(fd, SIOCGIFFLAGS, &ifr) != 0) { 42 ifr.ifr_flags |= IFF_UP; 44 ifr.ifr_flags &= ~IFF_UP; 46 if (ioctl(fd, SIOCSIFFLAGS, &ifr) != 0) {
|
/external/autotest/client/deps/fakemodem/src/ |
fakenet.c | 26 struct ifreq ifr; local 34 memset (&ifr, 0, sizeof (ifr)); 41 ifr.ifr_flags = IFF_TAP; 43 strncpy (ifr.ifr_name, dev, IFNAMSIZ); 45 if ((err = ioctl (fd, TUNSETIFF, (void *) &ifr)) < 0) { 50 strncpy (dev, ifr.ifr_name, IFNAMSIZ);
|
/external/android-clat/ |
tun.c | 48 struct ifreq ifr; local 51 memset(&ifr, 0, sizeof(ifr)); 53 ifr.ifr_flags = IFF_TUN; 55 strncpy(ifr.ifr_name, dev, IFNAMSIZ); 56 ifr.ifr_name[IFNAMSIZ-1] = '\0'; 59 if( (err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ){ 63 strcpy(dev, ifr.ifr_name);
|
/external/autotest/client/profilers/powertop/src/ |
ethernet.c | 55 struct ifreq ifr; local 59 memset(&ifr, 0, sizeof(struct ifreq)); 65 strcpy(ifr.ifr_name, "eth0"); 68 ret = ioctl(sock, SIOCGIFFLAGS, &ifr); 74 if (ifr.ifr_flags & (IFF_UP | IFF_RUNNING)) { 82 ifr.ifr_data = (caddr_t)&wol; 83 ioctl(sock, SIOCETHTOOL, &ifr); 86 ioctl(sock, SIOCETHTOOL, &ifr); 96 struct ifreq ifr; local 100 memset(&ifr, 0, sizeof(struct ifreq)) [all...] |
/frameworks/opt/net/wifi/libwifi_system_iface/ |
interface_tool.cpp | 34 bool GetIfState(const char* if_name, int sock, struct ifreq* ifr) { 35 memset(ifr, 0, sizeof(*ifr)); 36 if (strlcpy(ifr->ifr_name, if_name, sizeof(ifr->ifr_name)) >= 37 sizeof(ifr->ifr_name)) { 42 if (TEMP_FAILURE_RETRY(ioctl(sock, SIOCGIFFLAGS, ifr)) != 0) { 61 struct ifreq ifr; local 62 if (!GetIfState(if_name, sock.get(), &ifr)) { 66 return ifr.ifr_flags & IFF_UP 77 struct ifreq ifr; local [all...] |
/external/linux-kselftest/tools/testing/selftests/networking/timestamping/ |
hwtstamp_config.c | 87 struct ifreq ifr; local 113 strcpy(ifr.ifr_name, argv[1]); 114 ifr.ifr_data = (caddr_t)&config; 116 if (ioctl(sock, (argc == 2) ? SIOCGHWTSTAMP : SIOCSHWTSTAMP, &ifr)) {
|
/external/ltp/testcases/kernel/containers/share/ |
ns_ifmove.c | 51 struct ifreq ifr; local 54 memset(&ifr, 0, sizeof(ifr)); 55 strncpy(ifr.ifr_name, intf_name, sizeof(ifr.ifr_name) - 1); 56 ifr.ifr_name[sizeof(ifr.ifr_name)-1] = '\0'; 65 if (ioctl(sock_fd, SIOCGIFINDEX, &ifr) == -1) { 72 return ifr.ifr_ifindex;
|
/external/ltp/testcases/network/can/filter-tests/ |
can_rcv_own_msgs.c | 154 struct ifreq ifr; local 174 strcpy(ifr.ifr_name, argv[1]); 175 if (ioctl(s, SIOCGIFINDEX, &ifr) < 0) { 179 addr.can_ifindex = ifr.ifr_ifindex;
|
/external/ppp/pppd/plugins/rp-pppoe/ |
if.c | 100 struct ifreq ifr; local 136 strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); 137 if (ioctl(fd, SIOCGIFHWADDR, &ifr) < 0) { 142 memcpy(hwaddr, ifr.ifr_hwaddr.sa_data, ETH_ALEN); 144 if (ifr.ifr_hwaddr.sa_family != ARPHRD_ETHER) { 155 strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); 156 if (ioctl(fd, SIOCGIFMTU, &ifr) < 0) { 158 } else if (ifr.ifr_mtu < ETH_DATA_LEN) [all...] |
/external/strace/ |
sock.c | 49 #define PRINT_IFREQ_ADDR(tcp, ifr, sockaddr) \ 52 print_sockaddr(tcp, &((ifr)->sockaddr), \ 53 sizeof((ifr)->sockaddr)); \ 64 const kernel_ulong_t arg, const struct_ifreq *const ifr) 69 PRINT_IFREQ_ADDR(tcp, ifr, ifr_addr); 73 PRINT_IFREQ_ADDR(tcp, ifr, ifr_dstaddr); 77 PRINT_IFREQ_ADDR(tcp, ifr, ifr_broadaddr); 81 PRINT_IFREQ_ADDR(tcp, ifr, ifr_netmask); 88 (unsigned char *) &ifr->ifr_hwaddr.sa_data; 97 printflags(iffflags, (unsigned short) ifr->ifr_flags, "IFF_???") 148 struct_ifreq *ifr = elem_buf; local 237 struct_ifreq ifr; local 254 struct_ifreq ifr; local [all...] |
/external/strace/tests/ |
ioctl_sock_gifconf.c | 84 struct ifreq *ifr = (struct ifreq *) (ifc->ifc_buf + i); local 86 (struct sockaddr_in *) &(ifr->ifr_addr); 92 "}", ifr->ifr_name, ntohs(sa_in->sin_port), 137 struct ifreq *ifr = tail_alloc(2 * sizeof(*ifr)); local 158 ifc->ifc_buf = (char *) (ifr + 2); 162 ifc->ifc_buf = (char *) (ifr + 1); 165 ifc->ifc_len = 1 * sizeof(*ifr); 166 ifc->ifc_buf = (char *) (ifr + 1); 169 ifc->ifc_len = 2 * sizeof(*ifr); [all...] |
/external/strace/tests-m32/ |
ioctl_sock_gifconf.c | 84 struct ifreq *ifr = (struct ifreq *) (ifc->ifc_buf + i); local 86 (struct sockaddr_in *) &(ifr->ifr_addr); 92 "}", ifr->ifr_name, ntohs(sa_in->sin_port), 137 struct ifreq *ifr = tail_alloc(2 * sizeof(*ifr)); local 158 ifc->ifc_buf = (char *) (ifr + 2); 162 ifc->ifc_buf = (char *) (ifr + 1); 165 ifc->ifc_len = 1 * sizeof(*ifr); 166 ifc->ifc_buf = (char *) (ifr + 1); 169 ifc->ifc_len = 2 * sizeof(*ifr); [all...] |
/external/strace/tests-mx32/ |
ioctl_sock_gifconf.c | 84 struct ifreq *ifr = (struct ifreq *) (ifc->ifc_buf + i); local 86 (struct sockaddr_in *) &(ifr->ifr_addr); 92 "}", ifr->ifr_name, ntohs(sa_in->sin_port), 137 struct ifreq *ifr = tail_alloc(2 * sizeof(*ifr)); local 158 ifc->ifc_buf = (char *) (ifr + 2); 162 ifc->ifc_buf = (char *) (ifr + 1); 165 ifc->ifc_len = 1 * sizeof(*ifr); 166 ifc->ifc_buf = (char *) (ifr + 1); 169 ifc->ifc_len = 2 * sizeof(*ifr); [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 ||
|
driver_nl80211_android.c | 45 struct ifreq ifr; local 50 os_memset(&ifr, 0, sizeof(ifr)); 52 os_strlcpy(ifr.ifr_name, bss->ifname, IFNAMSIZ); 60 ifr.ifr_data = &priv_cmd; 62 ret = ioctl(drv->global->ioctl_sock, SIOCDEVPRIVATE + 1, &ifr); 79 struct ifreq ifr; local 123 memset(&ifr, 0, sizeof(ifr)); 125 os_strlcpy(ifr.ifr_name, bss->ifname, IFNAMSIZ) [all...] |
driver_wired_common.c | 35 struct ifreq ifr; local 44 os_memset(&ifr, 0, sizeof(ifr)); 45 os_strlcpy(ifr.ifr_name, ifname, IFNAMSIZ); 46 if (ioctl(s, SIOCGIFFLAGS, (caddr_t) &ifr) < 0) { 53 *flags = ifr.ifr_flags & 0xffff; 60 struct ifreq ifr; local 69 os_memset(&ifr, 0, sizeof(ifr)); 70 os_strlcpy(ifr.ifr_name, ifname, IFNAMSIZ) 85 struct ifreq ifr; local [all...] |
/frameworks/native/cmds/ip-up-vpn/ |
ip-up-vpn.c | 90 struct ifreq ifr; local 91 memset(&ifr, 0, sizeof(ifr)); 94 ifr.ifr_flags = IFF_UP; 95 strncpy(ifr.ifr_name, interface, IFNAMSIZ); 96 if (ioctl(s, SIOCSIFFLAGS, &ifr)) { 102 if (!set_address(&ifr.ifr_addr, address) || 103 ioctl(s, SIOCSIFADDR, &ifr)) { 109 if (set_address(&ifr.ifr_netmask, env("INTERNAL_NETMASK4"))) { 110 if (ioctl(s, SIOCSIFNETMASK, &ifr)) { [all...] |
/system/netd/tests/ |
tun_interface.cpp | 62 struct ifreq ifr = { local 65 snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s", mIfName.c_str()); 70 int ret = ioctl(mFd, TUNSETIFF, &ifr, sizeof(ifr)); 77 if (ifc_add_address(ifr.ifr_name, srcStr, 64) || 78 ifc_add_address(ifr.ifr_name, dstStr, 64)) {
|
/test/vts-testcase/kernel/api/tun/ |
vts_kernel_tun_test.cpp | 58 struct ifreq ifr = { local 61 strncpy(ifr.ifr_name, ifr_name_.c_str(), IFNAMSIZ); 66 if (ioctl(fd, TUNSETIFF, (void *) &ifr) < 0) {
|
/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)) {
|
/external/openssh/openbsd-compat/ |
port-tun.c | 61 struct ifreq ifr; local 71 bzero(&ifr, sizeof(ifr)); 74 ifr.ifr_flags = IFF_TAP; 77 ifr.ifr_flags = IFF_TUN; 80 ifr.ifr_flags |= IFF_NO_PI; 88 snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), name, tun); 91 if (ioctl(fd, TUNSETIFF, &ifr) == -1) { 100 debug("%s: %s mode %d fd %d", __func__, ifr.ifr_name, mode, fd) 121 struct ifreq ifr; local [all...] |
/bionic/libc/bionic/ |
net_if.cpp | 51 struct ifreq ifr; local 52 memset(&ifr, 0, sizeof(ifr)); 53 ifr.ifr_ifindex = ifindex; 55 int rc = ioctl(s, SIOCGIFNAME, &ifr); 58 return (rc == -1) ? nullptr : strncpy(ifname, ifr.ifr_name, IFNAMSIZ); 65 struct ifreq ifr; local 66 memset(&ifr, 0, sizeof(ifr)); 67 strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)) [all...] |
/external/dnsmasq/src/ |
bpf.c | 34 struct ifreq *ifr; local 75 ifr = (struct ifreq *)ptr; 76 if (ifr->ifr_addr.sa_len > sizeof(ifr->ifr_ifru)) 77 len = ifr->ifr_addr.sa_len + offsetof(struct ifreq, ifr_ifru); 83 ifr = (struct ifreq *)ifreq.iov_base; 84 memcpy(ifr, ptr, len); 86 if (ifr->ifr_addr.sa_family == AF_INET && ipv4_callback) 90 addr = ((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr; 91 if (ioctl(fd, SIOCGIFNETMASK, ifr) == -1 [all...] |
/external/ipsec-tools/ |
main.c | 105 struct ifreq ifr = {.ifr_flags = IFF_TUN}; local 116 if (ioctl(tun, TUNSETIFF, &ifr)) { 120 sprintf(*envp, "INTERFACE=%s", ifr.ifr_name);
|