Searched refs:ifr (Results 1 – 6 of 6) sorted by relevance
/system/core/libnetutils/ |
D | ifc_utils.c | 173 static void ifc_init_ifr(const char *name, struct ifreq *ifr) in ifc_init_ifr() argument 175 memset(ifr, 0, sizeof(struct ifreq)); in ifc_init_ifr() 176 strncpy(ifr->ifr_name, name, IFNAMSIZ); in ifc_init_ifr() 177 ifr->ifr_name[IFNAMSIZ - 1] = 0; in ifc_init_ifr() 183 struct ifreq ifr; in ifc_get_hwaddr() local 184 ifc_init_ifr(name, &ifr); in ifc_get_hwaddr() 186 r = ioctl(ifc_ctl_sock, SIOCGIFHWADDR, &ifr); in ifc_get_hwaddr() 189 memcpy(ptr, &ifr.ifr_hwaddr.sa_data, ETH_ALEN); in ifc_get_hwaddr() 196 struct ifreq ifr; in ifc_get_ifindex() local 197 ifc_init_ifr(name, &ifr); in ifc_get_ifindex() [all …]
|
/system/netd/server/ |
D | InterfaceController.cpp | 443 struct ifreq ifr = { in setCfg() local 446 strlcpy(ifr.ifr_name, cfg.ifName.c_str(), IFNAMSIZ); in setCfg() 450 RETURN_IF_NOT_OK(sys.ioctl(fd, SIOCSIFADDR, &ifr)); in setCfg() 453 RETURN_IF_NOT_OK(sys.ioctl(fd, SIOCGIFFLAGS, &ifr)); in setCfg() 454 uint16_t flags = ifr.ifr_flags; in setCfg() 458 ifr.ifr_flags = ifr.ifr_flags | IFF_UP; in setCfg() 460 ifr.ifr_flags = (ifr.ifr_flags & (~IFF_UP)); in setCfg() 464 if (ifr.ifr_flags != flags) { in setCfg() 465 RETURN_IF_NOT_OK(sys.ioctl(fd, SIOCSIFFLAGS, &ifr)); in setCfg() 486 struct ifreq ifr = {}; in getCfg() local [all …]
|
/system/netd/tests/ |
D | tun_interface.cpp | 84 struct ifreq ifr = { in init() local 87 strlcpy(ifr.ifr_name, mIfName.c_str(), sizeof(ifr.ifr_name)); in init() 92 int ret = ioctl(mFd, TUNSETIFF, &ifr, sizeof(ifr)); in init() 99 mIfIndex = if_nametoindex(ifr.ifr_name); in init() 107 if (int ret = ifc_enable(ifr.ifr_name)) { in init()
|
D | binder_test.cpp | 3014 struct ifreq ifr = {}; in ioctlByIfName() local 3015 strlcpy(ifr.ifr_name, ifName.c_str(), IFNAMSIZ); in ioctlByIfName() 3017 return sys.ioctl(fd.value(), flag, &ifr); in ioctlByIfName()
|
/system/extras/tests/tcp_nuke_addr/ |
D | tcp_nuke_addr_test.cpp | 71 ifreq ifr; in killSockets() local 72 memset(&ifr, 0, sizeof(ifr)); in killSockets() 74 strncpy(ifr.ifr_name, "lo", strlen("lo")); in killSockets() 75 memcpy(&ifr.ifr_addr, &listenaddr, sizeof(listenaddr)); in killSockets() 81 if (ioctl(ioctlsock, SIOCKILLADDR, &ifr) != 0) { in killSockets()
|
/system/core/init/ |
D | builtins.cpp | 329 struct ifreq ifr; in do_ifup() local 331 strlcpy(ifr.ifr_name, args[1].c_str(), IFNAMSIZ); in do_ifup() 336 if (ioctl(s.get(), SIOCGIFFLAGS, &ifr) < 0) { in do_ifup() 340 ifr.ifr_flags |= IFF_UP; in do_ifup() 342 if (ioctl(s.get(), SIOCSIFFLAGS, &ifr) < 0) { in do_ifup()
|