Home
last modified time | relevance | path

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

/bionic/libc/bionic/
Dnet_if.cpp51 ifreq ifr = {.ifr_ifindex = static_cast<int>(ifindex)}; in if_indextoname() local
52 return (ioctl(s.get(), SIOCGIFNAME, &ifr) == -1) ? nullptr in if_indextoname()
53 : strncpy(ifname, ifr.ifr_name, IFNAMSIZ); in if_indextoname()
60 ifreq ifr = {}; in if_nametoindex() local
61 strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); in if_nametoindex()
62 ifr.ifr_name[IFNAMSIZ - 1] = 0; in if_nametoindex()
63 return (ioctl(s.get(), SIOCGIFINDEX, &ifr) == -1) ? 0 : ifr.ifr_ifindex; in if_nametoindex()
Difaddrs.cpp291 ifreq ifr = {}; in get_interface_flags_via_ioctl() local
292 strlcpy(ifr.ifr_name, addr->ifa.ifa_name, sizeof(ifr.ifr_name)); in get_interface_flags_via_ioctl()
293 if (ioctl(s.get(), SIOCGIFFLAGS, &ifr) != -1) { in get_interface_flags_via_ioctl()
294 addr->ifa.ifa_flags = ifr.ifr_flags; in get_interface_flags_via_ioctl()
/bionic/tests/
Difaddrs_test.cpp114 ifreq ifr; in CheckAddressIsInSet() local
115 memset(&ifr, 0, sizeof(ifr)); in CheckAddressIsInSet()
116 ifr.ifr_addr.sa_family = AF_INET; in CheckAddressIsInSet()
117 if_name.copy(ifr.ifr_name, IFNAMSIZ - 1); in CheckAddressIsInSet()
125 ASSERT_EQ(0, ioctl(fd, SIOCGIFFLAGS, &ifr)) << if_name << ' ' << strerror(errno); in CheckAddressIsInSet()
126 request = ((ifr.ifr_flags & IFF_BROADCAST) != 0) ? SIOCGIFBRDADDR : SIOCGIFDSTADDR; in CheckAddressIsInSet()
129 ASSERT_EQ(0, ioctl(fd, request, &ifr)) << if_name << ' ' << strerror(errno); in CheckAddressIsInSet()
132 sockaddr_in* sock = reinterpret_cast<sockaddr_in*>(&ifr.ifr_addr); in CheckAddressIsInSet()