Searched refs:ifr (Results 1 – 2 of 2) sorted by relevance
/bionic/libc/bionic/ |
D | net_if.cpp | 51 struct ifreq ifr; in if_indextoname() local 52 memset(&ifr, 0, sizeof(ifr)); in if_indextoname() 53 ifr.ifr_ifindex = ifindex; in if_indextoname() 55 int rc = ioctl(s, SIOCGIFNAME, &ifr); in if_indextoname() 58 return (rc == -1) ? nullptr : strncpy(ifname, ifr.ifr_name, IFNAMSIZ); in if_indextoname() 65 struct ifreq ifr; in if_nametoindex() local 66 memset(&ifr, 0, sizeof(ifr)); in if_nametoindex() 67 strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); in if_nametoindex() 68 ifr.ifr_name[IFNAMSIZ - 1] = 0; in if_nametoindex() 70 int rc = ioctl(s, SIOCGIFINDEX, &ifr); in if_nametoindex() [all …]
|
/bionic/tests/ |
D | ifaddrs_test.cpp | 112 ifreq ifr; in CheckAddressIsInSet() local 113 memset(&ifr, 0, sizeof(ifr)); in CheckAddressIsInSet() 114 ifr.ifr_addr.sa_family = AF_INET; in CheckAddressIsInSet() 115 if_name.copy(ifr.ifr_name, IFNAMSIZ - 1); in CheckAddressIsInSet() 123 ASSERT_EQ(0, ioctl(fd, SIOCGIFFLAGS, &ifr)) << if_name << ' ' << strerror(errno); in CheckAddressIsInSet() 124 request = ((ifr.ifr_flags & IFF_BROADCAST) != 0) ? SIOCGIFBRDADDR : SIOCGIFDSTADDR; in CheckAddressIsInSet() 127 ASSERT_EQ(0, ioctl(fd, request, &ifr)) << if_name << ' ' << strerror(errno); in CheckAddressIsInSet() 130 sockaddr_in* sock = reinterpret_cast<sockaddr_in*>(&ifr.ifr_addr); in CheckAddressIsInSet()
|