/external/wpa_supplicant_8/src/drivers/ |
D | linux_ioctl.c | 20 struct ifreq ifr; in linux_set_iface_flags() local 26 os_memset(&ifr, 0, sizeof(ifr)); in linux_set_iface_flags() 27 os_strlcpy(ifr.ifr_name, ifname, IFNAMSIZ); in linux_set_iface_flags() 29 if (ioctl(sock, SIOCGIFFLAGS, &ifr) != 0) { in linux_set_iface_flags() 37 if (ifr.ifr_flags & IFF_UP) in linux_set_iface_flags() 39 ifr.ifr_flags |= IFF_UP; in linux_set_iface_flags() 41 if (!(ifr.ifr_flags & IFF_UP)) in linux_set_iface_flags() 43 ifr.ifr_flags &= ~IFF_UP; in linux_set_iface_flags() 46 if (ioctl(sock, SIOCSIFFLAGS, &ifr) != 0) { in linux_set_iface_flags() 60 struct ifreq ifr; in linux_iface_up() local [all …]
|
D | driver_wired_common.c | 35 struct ifreq ifr; in driver_wired_get_ifflags() local 44 os_memset(&ifr, 0, sizeof(ifr)); in driver_wired_get_ifflags() 45 os_strlcpy(ifr.ifr_name, ifname, IFNAMSIZ); in driver_wired_get_ifflags() 46 if (ioctl(s, SIOCGIFFLAGS, (caddr_t) &ifr) < 0) { in driver_wired_get_ifflags() 53 *flags = ifr.ifr_flags & 0xffff; in driver_wired_get_ifflags() 60 struct ifreq ifr; in driver_wired_set_ifflags() local 69 os_memset(&ifr, 0, sizeof(ifr)); in driver_wired_set_ifflags() 70 os_strlcpy(ifr.ifr_name, ifname, IFNAMSIZ); in driver_wired_set_ifflags() 71 ifr.ifr_flags = flags & 0xffff; in driver_wired_set_ifflags() 72 if (ioctl(s, SIOCSIFFLAGS, (caddr_t) &ifr) < 0) { in driver_wired_set_ifflags() [all …]
|
D | driver_wired.c | 171 struct ifreq ifr; in wired_init_sockets() local 189 os_memset(&ifr, 0, sizeof(ifr)); in wired_init_sockets() 190 os_strlcpy(ifr.ifr_name, drv->common.ifname, sizeof(ifr.ifr_name)); in wired_init_sockets() 191 if (ioctl(drv->common.sock, SIOCGIFINDEX, &ifr) != 0) { in wired_init_sockets() 199 addr.sll_ifindex = ifr.ifr_ifindex; in wired_init_sockets() 210 if (wired_multicast_membership(drv->common.sock, ifr.ifr_ifindex, in wired_init_sockets() 217 os_memset(&ifr, 0, sizeof(ifr)); in wired_init_sockets() 218 os_strlcpy(ifr.ifr_name, drv->common.ifname, sizeof(ifr.ifr_name)); in wired_init_sockets() 219 if (ioctl(drv->common.sock, SIOCGIFHWADDR, &ifr) != 0) { in wired_init_sockets() 225 if (ifr.ifr_hwaddr.sa_family != ARPHRD_ETHER) { in wired_init_sockets() [all …]
|
D | driver_nl80211_android.c | 45 struct ifreq ifr; in android_priv_cmd() local 50 os_memset(&ifr, 0, sizeof(ifr)); in android_priv_cmd() 52 os_strlcpy(ifr.ifr_name, bss->ifname, IFNAMSIZ); in android_priv_cmd() 60 ifr.ifr_data = &priv_cmd; in android_priv_cmd() 62 ret = ioctl(drv->global->ioctl_sock, SIOCDEVPRIVATE + 1, &ifr); in android_priv_cmd() 79 struct ifreq ifr; in android_pno_start() local 123 memset(&ifr, 0, sizeof(ifr)); in android_pno_start() 125 os_strlcpy(ifr.ifr_name, bss->ifname, IFNAMSIZ); in android_pno_start() 130 ifr.ifr_data = &priv_cmd; in android_pno_start() 132 ret = ioctl(drv->global->ioctl_sock, SIOCDEVPRIVATE + 1, &ifr); in android_pno_start()
|
/external/strace/ |
D | sock.c | 49 #define PRINT_IFREQ_ADDR(tcp, ifr, sockaddr) \ argument 52 print_sockaddr(tcp, &((ifr)->sockaddr), \ 53 sizeof((ifr)->sockaddr)); \ 64 const kernel_ulong_t arg, const struct_ifreq *const ifr) in print_ifreq() argument 69 PRINT_IFREQ_ADDR(tcp, ifr, ifr_addr); in print_ifreq() 73 PRINT_IFREQ_ADDR(tcp, ifr, ifr_dstaddr); in print_ifreq() 77 PRINT_IFREQ_ADDR(tcp, ifr, ifr_broadaddr); in print_ifreq() 81 PRINT_IFREQ_ADDR(tcp, ifr, ifr_netmask); in print_ifreq() 88 (unsigned char *) &ifr->ifr_hwaddr.sa_data; in print_ifreq() 97 printflags(iffflags, (unsigned short) ifr->ifr_flags, "IFF_???"); in print_ifreq() [all …]
|
/external/autotest/client/profilers/powertop/src/ |
D | ethernet.c | 55 struct ifreq ifr; in activate_WOL_suggestion() local 59 memset(&ifr, 0, sizeof(struct ifreq)); in activate_WOL_suggestion() 65 strcpy(ifr.ifr_name, "eth0"); in activate_WOL_suggestion() 68 ret = ioctl(sock, SIOCGIFFLAGS, &ifr); in activate_WOL_suggestion() 74 if (ifr.ifr_flags & (IFF_UP | IFF_RUNNING)) { in activate_WOL_suggestion() 82 ifr.ifr_data = (caddr_t)&wol; in activate_WOL_suggestion() 83 ioctl(sock, SIOCETHTOOL, &ifr); in activate_WOL_suggestion() 86 ioctl(sock, SIOCETHTOOL, &ifr); in activate_WOL_suggestion() 96 struct ifreq ifr; in suggest_WOL_off() local 100 memset(&ifr, 0, sizeof(struct ifreq)); in suggest_WOL_off() [all …]
|
/external/iproute2/ip/ |
D | iptuntap.c | 48 static int tap_add_ioctl(struct ifreq *ifr, uid_t uid, gid_t gid) in tap_add_ioctl() argument 54 ifr->ifr_flags |= IFF_TUN_EXCL; in tap_add_ioctl() 62 if (ioctl(fd, TUNSETIFF, ifr)) { in tap_add_ioctl() 84 static int tap_del_ioctl(struct ifreq *ifr) in tap_del_ioctl() argument 93 if (ioctl(fd, TUNSETIFF, ifr)) { in tap_del_ioctl() 107 static int parse_args(int argc, char **argv, struct ifreq *ifr, uid_t *uid, gid_t *gid) in parse_args() argument 111 memset(ifr, 0, sizeof(*ifr)); in parse_args() 113 ifr->ifr_flags |= IFF_NO_PI; in parse_args() 119 if (ifr->ifr_flags & IFF_TAP) { in parse_args() 123 ifr->ifr_flags |= IFF_TUN; in parse_args() [all …]
|
D | tunnel.c | 70 struct ifreq ifr; in tnl_get_ioctl() local 74 strncpy(ifr.ifr_name, basedev, IFNAMSIZ); in tnl_get_ioctl() 75 ifr.ifr_ifru.ifru_data = (void*)p; in tnl_get_ioctl() 83 err = ioctl(fd, SIOCGETTUNNEL, &ifr); in tnl_get_ioctl() 94 struct ifreq ifr; in tnl_add_ioctl() local 99 strncpy(ifr.ifr_name, name, IFNAMSIZ); in tnl_add_ioctl() 101 strncpy(ifr.ifr_name, basedev, IFNAMSIZ); in tnl_add_ioctl() 102 ifr.ifr_ifru.ifru_data = p; in tnl_add_ioctl() 110 err = ioctl(fd, cmd, &ifr); in tnl_add_ioctl() 112 fprintf(stderr, "add tunnel \"%s\" failed: %s\n", ifr.ifr_name, in tnl_add_ioctl() [all …]
|
/external/toybox/toys/pending/ |
D | brctl.c | 45 struct ifreq ifr; local 52 xstrncpy(ifr.ifr_name, bridge, IFNAMSIZ); 53 ifr.ifr_data = (char *)args; 54 xioctl(TT.sockfd, SIOCDEVPRIVATE, &ifr); 60 struct ifreq ifr; in get_br_info() local 65 xstrncpy(ifr.ifr_name, bridge, IFNAMSIZ); in get_br_info() 66 ifr.ifr_data = (char *)args; in get_br_info() 68 if (ioctl(TT.sockfd, SIOCDEVPRIVATE, &ifr) < 0) { in get_br_info() 142 struct ifreq ifr; in br_addif() local 147 ifr.ifr_ifindex = index; in br_addif() [all …]
|
/external/dnsmasq/src/ |
D | bpf.c | 34 struct ifreq *ifr; in iface_enumerate() local 75 ifr = (struct ifreq *)ptr; in iface_enumerate() 76 if (ifr->ifr_addr.sa_len > sizeof(ifr->ifr_ifru)) in iface_enumerate() 77 len = ifr->ifr_addr.sa_len + offsetof(struct ifreq, ifr_ifru); in iface_enumerate() 83 ifr = (struct ifreq *)ifreq.iov_base; in iface_enumerate() 84 memcpy(ifr, ptr, len); in iface_enumerate() 86 if (ifr->ifr_addr.sa_family == AF_INET && ipv4_callback) in iface_enumerate() 90 addr = ((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr; in iface_enumerate() 91 if (ioctl(fd, SIOCGIFNETMASK, ifr) == -1) in iface_enumerate() 93 netmask = ((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr; in iface_enumerate() [all …]
|
/external/strace/tests-mx32/ |
D | ioctl_sock_gifconf.c | 84 struct ifreq *ifr = (struct ifreq *) (ifc->ifc_buf + i); in print_ifconf() local 86 (struct sockaddr_in *) &(ifr->ifr_addr); in print_ifconf() 92 "}", ifr->ifr_name, ntohs(sa_in->sin_port), in print_ifconf() 137 struct ifreq *ifr = tail_alloc(2 * sizeof(*ifr)); in main() local 158 ifc->ifc_buf = (char *) (ifr + 2); in main() 162 ifc->ifc_buf = (char *) (ifr + 1); in main() 165 ifc->ifc_len = 1 * sizeof(*ifr); in main() 166 ifc->ifc_buf = (char *) (ifr + 1); in main() 169 ifc->ifc_len = 2 * sizeof(*ifr); in main() 170 ifc->ifc_buf = (char *) (ifr + 1); in main() [all …]
|
/external/strace/tests-m32/ |
D | ioctl_sock_gifconf.c | 84 struct ifreq *ifr = (struct ifreq *) (ifc->ifc_buf + i); in print_ifconf() local 86 (struct sockaddr_in *) &(ifr->ifr_addr); in print_ifconf() 92 "}", ifr->ifr_name, ntohs(sa_in->sin_port), in print_ifconf() 137 struct ifreq *ifr = tail_alloc(2 * sizeof(*ifr)); in main() local 158 ifc->ifc_buf = (char *) (ifr + 2); in main() 162 ifc->ifc_buf = (char *) (ifr + 1); in main() 165 ifc->ifc_len = 1 * sizeof(*ifr); in main() 166 ifc->ifc_buf = (char *) (ifr + 1); in main() 169 ifc->ifc_len = 2 * sizeof(*ifr); in main() 170 ifc->ifc_buf = (char *) (ifr + 1); in main() [all …]
|
/external/strace/tests/ |
D | ioctl_sock_gifconf.c | 84 struct ifreq *ifr = (struct ifreq *) (ifc->ifc_buf + i); in print_ifconf() local 86 (struct sockaddr_in *) &(ifr->ifr_addr); in print_ifconf() 92 "}", ifr->ifr_name, ntohs(sa_in->sin_port), in print_ifconf() 137 struct ifreq *ifr = tail_alloc(2 * sizeof(*ifr)); in main() local 158 ifc->ifc_buf = (char *) (ifr + 2); in main() 162 ifc->ifc_buf = (char *) (ifr + 1); in main() 165 ifc->ifc_len = 1 * sizeof(*ifr); in main() 166 ifc->ifc_buf = (char *) (ifr + 1); in main() 169 ifc->ifc_len = 2 * sizeof(*ifr); in main() 170 ifc->ifc_buf = (char *) (ifr + 1); in main() [all …]
|
/external/ppp/pppd/plugins/rp-pppoe/ |
D | if.c | 100 struct ifreq ifr; in openInterface() local 136 strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); in openInterface() 137 if (ioctl(fd, SIOCGIFHWADDR, &ifr) < 0) { in openInterface() 142 memcpy(hwaddr, ifr.ifr_hwaddr.sa_data, ETH_ALEN); in openInterface() 144 if (ifr.ifr_hwaddr.sa_family != ARPHRD_ETHER) { in openInterface() 155 strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); in openInterface() 156 if (ioctl(fd, SIOCGIFMTU, &ifr) < 0) { in openInterface() 158 } else if (ifr.ifr_mtu < ETH_DATA_LEN) { in openInterface() 160 ifname, ifr.ifr_mtu, ETH_DATA_LEN); in openInterface() 169 strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); in openInterface() [all …]
|
D | plugin.c | 132 struct ifreq ifr; in PPPOEConnectDevice() local 156 strncpy(ifr.ifr_name, conn->ifName, sizeof(ifr.ifr_name)); in PPPOEConnectDevice() 157 if (ioctl(s, SIOCGIFMTU, &ifr) < 0) { in PPPOEConnectDevice() 164 if (lcp_allowoptions[0].mru > ifr.ifr_mtu - TOTAL_OVERHEAD) in PPPOEConnectDevice() 165 lcp_allowoptions[0].mru = ifr.ifr_mtu - TOTAL_OVERHEAD; in PPPOEConnectDevice() 166 if (lcp_wantoptions[0].mru > ifr.ifr_mtu - TOTAL_OVERHEAD) in PPPOEConnectDevice() 167 lcp_wantoptions[0].mru = ifr.ifr_mtu - TOTAL_OVERHEAD; in PPPOEConnectDevice() 310 struct ifreq ifr; in PPPoEDevnameHook() local 329 strncpy(ifr.ifr_name, cmd, sizeof(ifr.ifr_name)); in PPPoEDevnameHook() 330 if (ioctl(fd, SIOCGIFINDEX, &ifr) < 0) { in PPPoEDevnameHook() [all …]
|
/external/ppp/pppd/ |
D | sys-linux.c | 1194 struct ifreq ifr; in netif_set_mtu() local 1196 memset (&ifr, '\0', sizeof (ifr)); in netif_set_mtu() 1197 strlcpy(ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); in netif_set_mtu() 1198 ifr.ifr_mtu = mtu; in netif_set_mtu() 1200 if (ifunit >= 0 && ioctl(sock_fd, SIOCSIFMTU, (caddr_t) &ifr) < 0) in netif_set_mtu() 1210 struct ifreq ifr; in netif_get_mtu() local 1212 memset (&ifr, '\0', sizeof (ifr)); in netif_get_mtu() 1213 strlcpy(ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); in netif_get_mtu() 1215 if (ifunit >= 0 && ioctl(sock_fd, SIOCGIFMTU, (caddr_t) &ifr) < 0) { in netif_get_mtu() 1219 return ifr.ifr_mtu; in netif_get_mtu() [all …]
|
D | sys-solaris.c | 388 struct ifreq ifr; in get_first_ethernet() local 436 memset(&ifr, 0, sizeof(ifr)); in get_first_ethernet() 437 strncpy(ifr.ifr_name, pifreq->ifr_name, sizeof(ifr.ifr_name)); in get_first_ethernet() 438 if (ioctl(fd, SIOCGIFFLAGS, &ifr) < 0) { in get_first_ethernet() 444 fl = ifr.ifr_flags; in get_first_ethernet() 457 strncpy(first_ether_name, ifr.ifr_name, sizeof(first_ether_name)); in get_first_ethernet() 576 struct ifreq ifr; in sys_init() local 701 memset(&ifr, 0, sizeof(ifr)); in sys_init() 702 sprintf(ifr.ifr_name, "%s", ifname); in sys_init() 703 ifr.ifr_ip_muxid = ipmuxid; in sys_init() [all …]
|
/external/openssh/openbsd-compat/ |
D | port-tun.c | 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() [all …]
|
/external/dhcpcd-6.8.2/ |
D | if.c | 124 struct ifreq ifr; in if_carrier() local 131 memset(&ifr, 0, sizeof(ifr)); in if_carrier() 132 strlcpy(ifr.ifr_name, iface->name, sizeof(ifr.ifr_name)); in if_carrier() 133 if (ioctl(s, SIOCGIFFLAGS, &ifr) == -1) { in if_carrier() 137 iface->flags = (unsigned int)ifr.ifr_flags; in if_carrier() 146 r = ifr.ifr_flags & IFF_RUNNING ? LINK_UP : LINK_UNKNOWN; in if_carrier() 148 r = ifr.ifr_flags & IFF_RUNNING ? LINK_UP : LINK_DOWN; in if_carrier() 157 struct ifreq ifr; in if_setflag() local 162 memset(&ifr, 0, sizeof(ifr)); in if_setflag() 163 strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); in if_setflag() [all …]
|
/external/android-clat/ |
D | tun.c | 48 struct ifreq ifr; in tun_alloc() local 51 memset(&ifr, 0, sizeof(ifr)); in tun_alloc() 53 ifr.ifr_flags = IFF_TUN; in tun_alloc() 55 strncpy(ifr.ifr_name, dev, IFNAMSIZ); in tun_alloc() 56 ifr.ifr_name[IFNAMSIZ-1] = '\0'; in tun_alloc() 59 if( (err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ){ in tun_alloc() 63 strcpy(dev, ifr.ifr_name); in tun_alloc()
|
/external/wpa_supplicant_8/src/ap/ |
D | vlan_ifconfig.c | 22 struct ifreq ifr; in ifconfig_helper() local 30 os_memset(&ifr, 0, sizeof(ifr)); in ifconfig_helper() 31 os_strlcpy(ifr.ifr_name, if_name, IFNAMSIZ); in ifconfig_helper() 33 if (ioctl(fd, SIOCGIFFLAGS, &ifr) != 0) { in ifconfig_helper() 42 ifr.ifr_flags |= IFF_UP; in ifconfig_helper() 44 ifr.ifr_flags &= ~IFF_UP; in ifconfig_helper() 46 if (ioctl(fd, SIOCSIFFLAGS, &ifr) != 0) { in ifconfig_helper()
|
/external/libpcap/ |
D | inet.c | 131 struct ifreq ifr; local 165 memset(&ifr, 0, sizeof(ifr)); 168 ifr.ifr_addr.sa_family = AF_INET; 170 (void)strlcpy(ifr.ifr_name, device, sizeof(ifr.ifr_name)); 171 if (ioctl(fd, SIOCGIFADDR, (char *)&ifr) < 0) { 183 sin4 = (struct sockaddr_in *)&ifr.ifr_addr; 185 memset(&ifr, 0, sizeof(ifr)); 188 ifr.ifr_addr.sa_family = AF_INET; 190 (void)strlcpy(ifr.ifr_name, device, sizeof(ifr.ifr_name)); 191 if (ioctl(fd, SIOCGIFNETMASK, (char *)&ifr) < 0) {
|
/external/autotest/client/deps/fakemodem/src/ |
D | fakenet.c | 26 struct ifreq ifr; in tun_alloc() local 34 memset (&ifr, 0, sizeof (ifr)); in tun_alloc() 41 ifr.ifr_flags = IFF_TAP; in tun_alloc() 43 strncpy (ifr.ifr_name, dev, IFNAMSIZ); in tun_alloc() 45 if ((err = ioctl (fd, TUNSETIFF, (void *) &ifr)) < 0) { in tun_alloc() 50 strncpy (dev, ifr.ifr_name, IFNAMSIZ); in tun_alloc()
|
/external/ltp/testcases/kernel/containers/share/ |
D | ns_ifmove.c | 51 struct ifreq ifr; in get_intf_index_from_name() local 54 memset(&ifr, 0, sizeof(ifr)); in get_intf_index_from_name() 55 strncpy(ifr.ifr_name, intf_name, sizeof(ifr.ifr_name) - 1); in get_intf_index_from_name() 56 ifr.ifr_name[sizeof(ifr.ifr_name)-1] = '\0'; in get_intf_index_from_name() 65 if (ioctl(sock_fd, SIOCGIFINDEX, &ifr) == -1) { in get_intf_index_from_name() 72 return ifr.ifr_ifindex; in get_intf_index_from_name()
|
/external/mdnsresponder/mDNSPosix/ |
D | mDNSUNP.c | 96 struct ifreq ifr; in get_ifi_info_linuxv6() local 173 strncpy(ifr.ifr_name, ifname, IFNAMSIZ); in get_ifi_info_linuxv6() 174 if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0) { in get_ifi_info_linuxv6() 190 ifi->ifi_flags = ifr.ifr_flags; in get_ifi_info_linuxv6() 231 struct ifreq *ifr, ifrcopy; in get_ifi_info() local 280 ifr = (struct ifreq *) ptr; in get_ifi_info() 283 if (sizeof(struct ifreq) > sizeof(ifr->ifr_name) + GET_SA_LEN(ifr->ifr_addr)) in get_ifi_info() 286 ptr += sizeof(ifr->ifr_name) + GET_SA_LEN(ifr->ifr_addr); in get_ifi_info() 290 if (ifr->ifr_addr.sa_family != family) in get_ifi_info() 294 if ( (cptr = strchr(ifr->ifr_name, ':')) != NULL) in get_ifi_info() [all …]
|