Home
last modified time | relevance | path

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

/system/core/libnetutils/
Difc_utils.c165 static void ifc_init_ifr(const char *name, struct ifreq *ifr) in ifc_init_ifr() argument
167 memset(ifr, 0, sizeof(struct ifreq)); in ifc_init_ifr()
168 strncpy(ifr->ifr_name, name, IFNAMSIZ); in ifc_init_ifr()
169 ifr->ifr_name[IFNAMSIZ - 1] = 0; in ifc_init_ifr()
175 struct ifreq ifr; in ifc_get_hwaddr() local
176 ifc_init_ifr(name, &ifr); in ifc_get_hwaddr()
178 r = ioctl(ifc_ctl_sock, SIOCGIFHWADDR, &ifr); in ifc_get_hwaddr()
181 memcpy(ptr, &ifr.ifr_hwaddr.sa_data, ETH_ALEN); in ifc_get_hwaddr()
188 struct ifreq ifr; in ifc_get_ifindex() local
189 ifc_init_ifr(name, &ifr); in ifc_get_ifindex()
[all …]
/system/extras/tests/net_test/
Dnet_test.py145 ifr = struct.pack("16si", ifname, 0)
146 ifr = fcntl.ioctl(s, scapy.SIOCGIFINDEX, ifr)
147 return struct.unpack("16si", ifr)[1]
156 ifr = struct.pack("16sH6s", ifname, scapy.ARPHDR_ETHER, hwaddr)
157 fcntl.ioctl(s, SIOCSIFHWADDR, ifr)
162 ifr = struct.pack("16sH", ifname, 0)
163 ifr = fcntl.ioctl(s, scapy.SIOCGIFFLAGS, ifr)
164 _, flags = struct.unpack("16sH", ifr)
169 ifr = struct.pack("16sH", ifname, flags)
170 ifr = fcntl.ioctl(s, scapy.SIOCSIFFLAGS, ifr)
Dmultinetwork_base.py212 ifr = struct.pack("16sH", iface, IFF_TAP | IFF_NO_PI)
213 ifr += "\x00" * (40 - len(ifr))
214 fcntl.ioctl(f, TUNSETIFF, ifr)
/system/bt/btif/src/
Dbtif_pan.c305 struct ifreq ifr; in tap_if_up() local
313 memset(&ifr, 0, sizeof(ifr)); in tap_if_up()
314 strncpy(ifr.ifr_name, devname, IFNAMSIZ - 1); in tap_if_up()
315 err = TEMP_FAILURE_RETRY(ioctl(sk, SIOCGIFHWADDR, &ifr)); in tap_if_up()
323 strncpy(ifr.ifr_name, devname, IFNAMSIZ - 1); in tap_if_up()
324 memcpy(ifr.ifr_hwaddr.sa_data, addr->address, 6); in tap_if_up()
331 if (ifr.ifr_hwaddr.sa_data[0] & 0x01) { in tap_if_up()
333 ifr.ifr_hwaddr.sa_data[0] &= ~0x01; in tap_if_up()
336 err = TEMP_FAILURE_RETRY(ioctl(sk, SIOCSIFHWADDR, (caddr_t)&ifr)); in tap_if_up()
345 memset(&ifr, 0, sizeof(ifr)); in tap_if_up()
[all …]
/system/core/toolbox/
Diftop.c72 struct ifreq ifr; in get_mtu() local
81 memset(&ifr, 0, sizeof(struct ifreq)); in get_mtu()
82 ifr.ifr_addr.sa_family = AF_INET; in get_mtu()
83 strcpy(ifr.ifr_name, if_name); in get_mtu()
85 ret = ioctl(s, SIOCGIFMTU, &ifr); in get_mtu()
97 return ifr.ifr_mtu; in get_mtu()
/system/core/init/
Dbuiltins.cpp77 struct ifreq ifr; in __ifupdown() local
80 strlcpy(ifr.ifr_name, interface, IFNAMSIZ); in __ifupdown()
86 ret = ioctl(s, SIOCGIFFLAGS, &ifr); in __ifupdown()
92 ifr.ifr_flags |= IFF_UP; in __ifupdown()
94 ifr.ifr_flags &= ~IFF_UP; in __ifupdown()
96 ret = ioctl(s, SIOCSIFFLAGS, &ifr); in __ifupdown()