Home
last modified time | relevance | path

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

/system/netd/server/
DInterfaceControllerTest.cpp184 struct ifaddrs *ifaddr, *ifa; in TEST_F() local
185 EXPECT_EQ(0, getifaddrs(&ifaddr)); in TEST_F()
186 for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { in TEST_F()
191 freeifaddrs(ifaddr); in TEST_F()
197 struct ifaddrs *ifaddr, *ifa; in TEST_F() local
198 EXPECT_EQ(0, getifaddrs(&ifaddr)); in TEST_F()
199 for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { in TEST_F()
205 freeifaddrs(ifaddr); in TEST_F()
/system/netd/tests/
Dtun_interface.cpp172 ifaddrmsg* ifaddr = reinterpret_cast<ifaddrmsg*>(NLMSG_DATA(nlmsg)); in addAddress() local
173 if (ifaddr->ifa_family != family) continue; in addAddress()
174 if (ifaddr->ifa_prefixlen != prefixlen) continue; in addAddress()
175 if (ifaddr->ifa_index != static_cast<uint32_t>(mIfIndex)) continue; in addAddress()
178 for (rtattr* rta = IFA_RTA(ifaddr); RTA_OK(rta, ifalen); rta = RTA_NEXT(rta, ifalen)) { in addAddress()
/system/core/libsysutils/src/
DNetlinkEvent.cpp179 struct ifaddrmsg *ifaddr = (struct ifaddrmsg *) NLMSG_DATA(nh); in parseIfAddrMessage() local
185 if (!checkRtNetlinkLength(nh, sizeof(*ifaddr))) in parseIfAddrMessage()
198 flags = ifaddr->ifa_flags; in parseIfAddrMessage()
202 for (rta = IFA_RTA(ifaddr); RTA_OK(rta, len); rta = RTA_NEXT(rta, len)) { in parseIfAddrMessage()
210 if (ifaddr->ifa_family == AF_INET) { in parseIfAddrMessage()
218 } else if (ifaddr->ifa_family == AF_INET6) { in parseIfAddrMessage()
227 SLOGE("Unknown address family %d\n", ifaddr->ifa_family); in parseIfAddrMessage()
232 if (!if_indextoname(ifaddr->ifa_index, ifname)) { in parseIfAddrMessage()
233 SLOGD("Unknown ifindex %d in %s", ifaddr->ifa_index, msgtype); in parseIfAddrMessage()
263 asprintf(&mParams[0], "ADDRESS=%s/%d", addrstr, ifaddr->ifa_prefixlen); in parseIfAddrMessage()
[all …]