Home
last modified time | relevance | path

Searched refs:ifr (Results 1 – 25 of 89) sorted by relevance

1234

/external/wpa_supplicant_8/src/drivers/
Dlinux_ioctl.c21 struct ifreq ifr; in linux_set_iface_flags() local
27 os_memset(&ifr, 0, sizeof(ifr)); in linux_set_iface_flags()
28 os_strlcpy(ifr.ifr_name, ifname, IFNAMSIZ); in linux_set_iface_flags()
30 if (ioctl(sock, SIOCGIFFLAGS, &ifr) != 0) { in linux_set_iface_flags()
38 if (ifr.ifr_flags & IFF_UP) in linux_set_iface_flags()
40 ifr.ifr_flags |= IFF_UP; in linux_set_iface_flags()
42 if (!(ifr.ifr_flags & IFF_UP)) in linux_set_iface_flags()
44 ifr.ifr_flags &= ~IFF_UP; in linux_set_iface_flags()
47 if (ioctl(sock, SIOCSIFFLAGS, &ifr) != 0) { in linux_set_iface_flags()
61 struct ifreq ifr; in linux_iface_up() local
[all …]
Ddriver_wired_common.c35 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 …]
Ddriver_wired.c171 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 …]
Ddriver_nl80211_android.c45 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/
Dsock.c64 const kernel_ulong_t arg, const struct_ifreq *const ifr) in print_ifreq() argument
69 PRINT_FIELD_SOCKADDR("", *ifr, ifr_addr); in print_ifreq()
73 PRINT_FIELD_SOCKADDR("", *ifr, ifr_dstaddr); in print_ifreq()
77 PRINT_FIELD_SOCKADDR("", *ifr, ifr_broadaddr); in print_ifreq()
81 PRINT_FIELD_SOCKADDR("", *ifr, ifr_netmask); in print_ifreq()
157 uint16_t proto = ifr->ifr_hwaddr.sa_family; in print_ifreq()
161 PRINT_FIELD_XVAL_SORTED_SIZED("ifr_hwaddr={", ifr->ifr_hwaddr, in print_ifreq()
165 PRINT_FIELD_MAC_SZ(", ", ifr->ifr_hwaddr, sa_data, in print_ifreq()
166 MIN(sizeof(ifr->ifr_hwaddr.sa_data), sz)); in print_ifreq()
173 printflags(iffflags, (unsigned short) ifr->ifr_flags, "IFF_???"); in print_ifreq()
[all …]
/external/autotest/client/profilers/powertop/src/
Dethernet.c55 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/
Dtunnel.c73 struct ifreq ifr; in tnl_get_ioctl() local
77 strncpy(ifr.ifr_name, basedev, IFNAMSIZ); in tnl_get_ioctl()
78 ifr.ifr_ifru.ifru_data = (void *)p; in tnl_get_ioctl()
86 err = ioctl(fd, SIOCGETTUNNEL, &ifr); in tnl_get_ioctl()
97 struct ifreq ifr; in tnl_add_ioctl() local
102 strncpy(ifr.ifr_name, name, IFNAMSIZ); in tnl_add_ioctl()
104 strncpy(ifr.ifr_name, basedev, IFNAMSIZ); in tnl_add_ioctl()
105 ifr.ifr_ifru.ifru_data = p; in tnl_add_ioctl()
113 err = ioctl(fd, cmd, &ifr); in tnl_add_ioctl()
115 fprintf(stderr, "add tunnel \"%s\" failed: %s\n", ifr.ifr_name, in tnl_add_ioctl()
[all …]
Diptuntap.c49 static int tap_add_ioctl(struct ifreq *ifr, uid_t uid, gid_t gid) in tap_add_ioctl() argument
55 ifr->ifr_flags |= IFF_TUN_EXCL; in tap_add_ioctl()
63 if (ioctl(fd, TUNSETIFF, ifr)) { in tap_add_ioctl()
85 static int tap_del_ioctl(struct ifreq *ifr) in tap_del_ioctl() argument
94 if (ioctl(fd, TUNSETIFF, ifr)) { in tap_del_ioctl()
109 struct ifreq *ifr, uid_t *uid, gid_t *gid) in parse_args() argument
113 memset(ifr, 0, sizeof(*ifr)); in parse_args()
115 ifr->ifr_flags |= IFF_NO_PI; in parse_args()
121 if (ifr->ifr_flags & IFF_TAP) { in parse_args()
125 ifr->ifr_flags |= IFF_TUN; in parse_args()
[all …]
/external/toybox/toys/pending/
Dbrctl.c45 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/strace/tests/
Dioctl_sock_gifconf.c83 struct ifreq *ifr = (struct ifreq *) (ifc->ifc_buf + i); in print_ifconf() local
85 (struct sockaddr_in *) &(ifr->ifr_addr); in print_ifconf()
91 "}", ifr->ifr_name, ntohs(sa_in->sin_port), in print_ifconf()
136 struct ifreq *ifr = tail_alloc(2 * sizeof(*ifr)); in main() local
157 ifc->ifc_buf = (char *) (ifr + 2); in main()
161 ifc->ifc_buf = (char *) (ifr + 1); in main()
164 ifc->ifc_len = 1 * sizeof(*ifr); in main()
165 ifc->ifc_buf = (char *) (ifr + 1); in main()
168 ifc->ifc_len = 2 * sizeof(*ifr); in main()
169 ifc->ifc_buf = (char *) (ifr + 1); in main()
[all …]
/external/strace/tests-mx32/
Dioctl_sock_gifconf.c83 struct ifreq *ifr = (struct ifreq *) (ifc->ifc_buf + i); in print_ifconf() local
85 (struct sockaddr_in *) &(ifr->ifr_addr); in print_ifconf()
91 "}", ifr->ifr_name, ntohs(sa_in->sin_port), in print_ifconf()
136 struct ifreq *ifr = tail_alloc(2 * sizeof(*ifr)); in main() local
157 ifc->ifc_buf = (char *) (ifr + 2); in main()
161 ifc->ifc_buf = (char *) (ifr + 1); in main()
164 ifc->ifc_len = 1 * sizeof(*ifr); in main()
165 ifc->ifc_buf = (char *) (ifr + 1); in main()
168 ifc->ifc_len = 2 * sizeof(*ifr); in main()
169 ifc->ifc_buf = (char *) (ifr + 1); in main()
[all …]
/external/strace/tests-m32/
Dioctl_sock_gifconf.c83 struct ifreq *ifr = (struct ifreq *) (ifc->ifc_buf + i); in print_ifconf() local
85 (struct sockaddr_in *) &(ifr->ifr_addr); in print_ifconf()
91 "}", ifr->ifr_name, ntohs(sa_in->sin_port), in print_ifconf()
136 struct ifreq *ifr = tail_alloc(2 * sizeof(*ifr)); in main() local
157 ifc->ifc_buf = (char *) (ifr + 2); in main()
161 ifc->ifc_buf = (char *) (ifr + 1); in main()
164 ifc->ifc_len = 1 * sizeof(*ifr); in main()
165 ifc->ifc_buf = (char *) (ifr + 1); in main()
168 ifc->ifc_len = 2 * sizeof(*ifr); in main()
169 ifc->ifc_buf = (char *) (ifr + 1); in main()
[all …]
/external/ppp/pppd/
Dsys-linux.c1194 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 …]
Dsys-solaris.c388 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/ppp/pppd/plugins/rp-pppoe/
Dif.c100 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 …]
Dplugin.c132 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/openssh/openbsd-compat/
Dport-tun.c61 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/android-clat/
Dtun.c49 struct ifreq ifr; in tun_alloc() local
52 memset(&ifr, 0, sizeof(ifr)); in tun_alloc()
54 ifr.ifr_flags = IFF_TUN; in tun_alloc()
56 strncpy(ifr.ifr_name, dev, IFNAMSIZ); in tun_alloc()
57 ifr.ifr_name[IFNAMSIZ - 1] = '\0'; in tun_alloc()
60 if ((err = ioctl(fd, TUNSETIFF, (void *)&ifr)) < 0) { in tun_alloc()
64 strlcpy(dev, ifr.ifr_name, len); in tun_alloc()
/external/wpa_supplicant_8/src/ap/
Dvlan_ifconfig.c22 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/ltp/testcases/kernel/containers/share/
Dns_ifmove.c51 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/autotest/client/deps/fakemodem/src/
Dfakenet.c26 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/network/packet/
Dfanout01.c70 struct ifreq ifr; in run() local
72 memset(&ifr, 0, sizeof(struct ifreq)); in run()
78 strcpy((char *)&ifr.ifr_name, "lo"); in run()
79 SAFE_IOCTL(fd, SIOCGIFINDEX, &ifr); in run()
80 index = ifr.ifr_ifindex; in run()
82 SAFE_IOCTL(fd, SIOCGIFFLAGS, &ifr); in run()
83 ifr.ifr_flags &= ~(short)IFF_UP; in run()
84 SAFE_IOCTL(fd, SIOCSIFFLAGS, &ifr); in run()
/external/honggfuzz/examples/linux_kernel_ip/
Dtun.c72 struct ifreq ifr; in main() local
73 memset(&ifr, '\0', sizeof(ifr)); in main()
74 ifr.ifr_flags = IFF_TUN | IFF_NO_PI | IFF_NOFILTER; in main()
75 strcpy(ifr.ifr_name, "FUZZ0"); in main()
81 if (ioctl(fd, TUNSETIFF, (void*)&ifr) != 0) { in main()
121 struct sockaddr_in* sa = (struct sockaddr_in*)(&ifr.ifr_addr); in main()
124 if (ioctl(tcp_sock, SIOCSIFADDR, &ifr) == -1) { in main()
128 if (ioctl(tcp_sock, SIOCSIFDSTADDR, &ifr) == -1) { in main()
132 if (ioctl(tcp_sock, SIOCGIFFLAGS, &ifr) == -1) { in main()
135 ifr.ifr_flags |= (IFF_UP | IFF_RUNNING); in main()
[all …]
/external/honggfuzz/libhfcommon/
Dns.c102 struct ifreq ifr; in nsIfaceUp() local
103 memset(&ifr, '\0', sizeof(ifr)); in nsIfaceUp()
104 snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", ifacename); in nsIfaceUp()
106 if (ioctl(sock, SIOCGIFFLAGS, &ifr) == -1) { in nsIfaceUp()
112 ifr.ifr_flags |= (IFF_UP | IFF_RUNNING); in nsIfaceUp()
114 if (ioctl(sock, SIOCSIFFLAGS, &ifr) == -1) { in nsIfaceUp()
/external/mdnsresponder/mDNSPosix/
DmDNSUNP.c96 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 …]

1234