/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/bt/btif/src/ |
D | btif_pan.cc | 283 struct ifreq ifr; in tap_if_up() local 290 memset(&ifr, 0, sizeof(ifr)); in tap_if_up() 291 strlcpy(ifr.ifr_name, devname, IFNAMSIZ); in tap_if_up() 292 err = ioctl(sk, SIOCGIFHWADDR, &ifr); in tap_if_up() 301 strlcpy(ifr.ifr_name, devname, IFNAMSIZ); in tap_if_up() 302 memcpy(ifr.ifr_hwaddr.sa_data, addr->address, 6); in tap_if_up() 312 if (ifr.ifr_hwaddr.sa_data[0] & 0x01) { in tap_if_up() 315 ifr.ifr_hwaddr.sa_data[0] &= ~0x01; in tap_if_up() 318 err = ioctl(sk, SIOCSIFHWADDR, (caddr_t)&ifr); in tap_if_up() 328 memset(&ifr, 0, sizeof(ifr)); in tap_if_up() [all …]
|
/system/netd/server/ |
D | InterfaceController.cpp | 476 struct ifreq ifr = { in setCfg() local 479 strlcpy(ifr.ifr_name, cfg.ifName.c_str(), IFNAMSIZ); in setCfg() 483 RETURN_IF_NOT_OK(sys.ioctl(fd, SIOCSIFADDR, &ifr)); in setCfg() 486 RETURN_IF_NOT_OK(sys.ioctl(fd, SIOCGIFFLAGS, &ifr)); in setCfg() 487 uint16_t flags = ifr.ifr_flags; in setCfg() 491 ifr.ifr_flags = ifr.ifr_flags | IFF_UP; in setCfg() 493 ifr.ifr_flags = (ifr.ifr_flags & (~IFF_UP)); in setCfg() 497 if (ifr.ifr_flags != flags) { in setCfg() 498 RETURN_IF_NOT_OK(sys.ioctl(fd, SIOCSIFFLAGS, &ifr)); in setCfg() 519 struct ifreq ifr = {}; in getCfg() local [all …]
|
D | OffloadUtils.cpp | 50 struct ifreq ifr = {}; in hardwareAddressType() local 57 strncpy(ifr.ifr_name, interface.c_str(), sizeof(ifr.ifr_name)); in hardwareAddressType() 59 if (ioctl(ufd, SIOCGIFHWADDR, &ifr, sizeof(ifr))) return -errno; in hardwareAddressType() 61 return ifr.ifr_hwaddr.sa_family; in hardwareAddressType()
|
D | ClatdController.cpp | 498 struct ifreq ifr = { in startClatd() local 501 strlcpy(ifr.ifr_name, v4interface.c_str(), sizeof(ifr.ifr_name)); in startClatd() 503 res = ioctl(tmpTunFd, TUNSETIFF, &ifr, sizeof(ifr)); in startClatd()
|
/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 | 2626 struct ifreq ifr = {}; in ioctlByIfName() local 2627 strlcpy(ifr.ifr_name, ifName.c_str(), IFNAMSIZ); in ioctlByIfName() 2629 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/netd/libnetdutils/ |
D | Syscalls.cpp | 102 StatusOr<ifreq> ioctl(Fd sock, unsigned long request, ifreq* ifr) const override { in ioctl() 103 auto rv = ::ioctl(sock.get(), request, ifr); in ioctl() 107 return *ifr; in ioctl()
|
/system/netd/libnetdutils/include/netdutils/ |
D | MockSyscalls.h | 47 MOCK_CONST_METHOD3(ioctl, StatusOr<ifreq>(Fd sock, unsigned long request, ifreq* ifr));
|
D | Syscalls.h | 62 virtual StatusOr<ifreq> ioctl(Fd sock, unsigned long request, ifreq* ifr) const = 0;
|
/system/core/init/ |
D | builtins.cpp | 302 struct ifreq ifr; in do_ifup() local 304 strlcpy(ifr.ifr_name, args[1].c_str(), IFNAMSIZ); in do_ifup() 309 if (ioctl(s, SIOCGIFFLAGS, &ifr) < 0) { in do_ifup() 313 ifr.ifr_flags |= IFF_UP; in do_ifup() 315 if (ioctl(s, SIOCSIFFLAGS, &ifr) < 0) { in do_ifup()
|