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.cpp168 ifaddrmsg* ifaddr = reinterpret_cast<ifaddrmsg*>(NLMSG_DATA(nlmsg)); in addAddress() local
169 if (ifaddr->ifa_family != family) continue; in addAddress()
170 if (ifaddr->ifa_prefixlen != prefixlen) continue; in addAddress()
171 if (ifaddr->ifa_index != static_cast<uint32_t>(mIfIndex)) continue; in addAddress()
174 for (rtattr* rta = IFA_RTA(ifaddr); RTA_OK(rta, ifalen); rta = RTA_NEXT(rta, ifalen)) { in addAddress()
/system/core/libsysutils/src/
DNetlinkEvent.cpp160 struct ifaddrmsg *ifaddr = (struct ifaddrmsg *) NLMSG_DATA(nh); in parseIfAddrMessage() local
165 if (!checkRtNetlinkLength(nh, sizeof(*ifaddr))) in parseIfAddrMessage()
180 for (rta = IFA_RTA(ifaddr); RTA_OK(rta, len); rta = RTA_NEXT(rta, len)) { in parseIfAddrMessage()
188 if (ifaddr->ifa_family == AF_INET) { in parseIfAddrMessage()
196 } else if (ifaddr->ifa_family == AF_INET6) { in parseIfAddrMessage()
205 SLOGE("Unknown address family %d\n", ifaddr->ifa_family); in parseIfAddrMessage()
210 if (!if_indextoname(ifaddr->ifa_index, ifname)) { in parseIfAddrMessage()
211 SLOGD("Unknown ifindex %d in %s", ifaddr->ifa_index, msgtype); in parseIfAddrMessage()
238 asprintf(&mParams[0], "ADDRESS=%s/%d", addrstr, ifaddr->ifa_prefixlen); in parseIfAddrMessage()
240 asprintf(&mParams[2], "FLAGS=%u", ifaddr->ifa_flags); in parseIfAddrMessage()
[all …]