Home
last modified time | relevance | path

Searched refs:rta (Results 1 – 4 of 4) sorted by relevance

/system/core/libsysutils/src/
DNetlinkEvent.cpp154 struct rtattr *rta; in parseIfInfoMessage() local
155 for (rta = IFLA_RTA(ifi); RTA_OK(rta, len); rta = RTA_NEXT(rta, len)) { in parseIfInfoMessage()
156 switch(rta->rta_type) { in parseIfInfoMessage()
158 asprintf(&mParams[0], "INTERFACE=%s", (char *) RTA_DATA(rta)); in parseIfInfoMessage()
200 struct rtattr *rta; in parseIfAddrMessage() local
202 for (rta = IFA_RTA(ifaddr); RTA_OK(rta, len); rta = RTA_NEXT(rta, len)) { in parseIfAddrMessage()
203 if (rta->rta_type == IFA_ADDRESS) { in parseIfAddrMessage()
211 struct in_addr *addr4 = (struct in_addr *) RTA_DATA(rta); in parseIfAddrMessage()
212 if (RTA_PAYLOAD(rta) < sizeof(*addr4)) { in parseIfAddrMessage()
214 RTA_PAYLOAD(rta), msgtype); in parseIfAddrMessage()
[all …]
/system/netd/tests/
Dtun_interface.cpp178 for (rtattr* rta = IFA_RTA(ifaddr); RTA_OK(rta, ifalen); rta = RTA_NEXT(rta, ifalen)) { in addAddress() local
179 if (rta->rta_type != IFA_LOCAL && rta->rta_type != IFA_ADDRESS) continue; in addAddress()
180 if (RTA_PAYLOAD(rta) != addrlen) continue; in addAddress()
181 if (!memcmp(RTA_DATA(rta), &ip, addrlen)) { in addAddress()
/system/netd/server/
DNetlinkCommands.cpp215 rtattr *rta = reinterpret_cast<rtattr *> RTM_RTA(msg); in getRtmU32Attribute() local
216 for (; RTA_OK(rta, rta_len); rta = RTA_NEXT(rta, rta_len)) { in getRtmU32Attribute()
217 if (rta->rta_type == attribute) { in getRtmU32Attribute()
218 return *(static_cast<uint32_t *>(RTA_DATA(rta))); in getRtmU32Attribute()
/system/core/libnetutils/
Difc_utils.c274 struct rtattr *rta; in ifc_act_on_address() local
319 rta = (struct rtattr *) (((char *) &req) + NLMSG_ALIGN(req.n.nlmsg_len)); in ifc_act_on_address()
320 rta->rta_type = IFA_LOCAL; in ifc_act_on_address()
321 rta->rta_len = RTA_LENGTH(addrlen); in ifc_act_on_address()
323 memcpy(RTA_DATA(rta), addr, addrlen); in ifc_act_on_address()
327 rta = (struct rtattr *) (((char *) &req) + NLMSG_ALIGN(req.n.nlmsg_len)); in ifc_act_on_address()
328 rta->rta_type = IFA_BROADCAST; in ifc_act_on_address()
329 rta->rta_len = RTA_LENGTH(addrlen); in ifc_act_on_address()
332 memcpy(RTA_DATA(rta), addr, addrlen); in ifc_act_on_address()