• Home
  • Raw
  • Download

Lines Matching refs:nh

109 static bool checkRtNetlinkLength(const struct nlmsghdr *nh, size_t size) {  in checkRtNetlinkLength()  argument
110 if (nh->nlmsg_len < NLMSG_LENGTH(size)) { in checkRtNetlinkLength()
111 SLOGE("Got a short %s message\n", rtMessageName(nh->nlmsg_type)); in checkRtNetlinkLength()
133 bool NetlinkEvent::parseIfInfoMessage(const struct nlmsghdr *nh) { in parseIfInfoMessage() argument
134 struct ifinfomsg *ifi = (struct ifinfomsg *) NLMSG_DATA(nh); in parseIfInfoMessage()
135 if (!checkRtNetlinkLength(nh, sizeof(*ifi))) in parseIfInfoMessage()
142 int len = IFLA_PAYLOAD(nh); in parseIfInfoMessage()
161 bool NetlinkEvent::parseIfAddrMessage(const struct nlmsghdr *nh) { in parseIfAddrMessage() argument
162 struct ifaddrmsg *ifaddr = (struct ifaddrmsg *) NLMSG_DATA(nh); in parseIfAddrMessage()
167 if (!checkRtNetlinkLength(nh, sizeof(*ifaddr))) in parseIfAddrMessage()
171 int type = nh->nlmsg_type; in parseIfAddrMessage()
181 int len = IFA_PAYLOAD(nh); in parseIfAddrMessage()
260 bool NetlinkEvent::parseUlogPacketMessage(const struct nlmsghdr *nh) { in parseUlogPacketMessage() argument
262 ulog_packet_msg_t *pm = (ulog_packet_msg_t *) NLMSG_DATA(nh); in parseUlogPacketMessage()
263 if (!checkRtNetlinkLength(nh, sizeof(*pm))) in parseUlogPacketMessage()
277 bool NetlinkEvent::parseRtMessage(const struct nlmsghdr *nh) { in parseRtMessage() argument
278 uint8_t type = nh->nlmsg_type; in parseRtMessage()
287 struct rtmsg *rtm = (struct rtmsg *) NLMSG_DATA(nh); in parseRtMessage()
288 if (!checkRtNetlinkLength(nh, sizeof(*rtm))) in parseRtMessage()
312 size_t len = RTM_PAYLOAD(nh); in parseRtMessage()
369 bool NetlinkEvent::parseNdUserOptMessage(const struct nlmsghdr *nh) { in parseNdUserOptMessage() argument
370 struct nduseroptmsg *msg = (struct nduseroptmsg *) NLMSG_DATA(nh); in parseNdUserOptMessage()
371 if (!checkRtNetlinkLength(nh, sizeof(*msg))) in parseNdUserOptMessage()
375 int len = NLMSG_PAYLOAD(nh, sizeof(*msg)); in parseNdUserOptMessage()
481 const struct nlmsghdr *nh; in parseBinaryNetlinkMessage() local
483 for (nh = (struct nlmsghdr *) buffer; in parseBinaryNetlinkMessage()
484 NLMSG_OK(nh, (unsigned) size) && (nh->nlmsg_type != NLMSG_DONE); in parseBinaryNetlinkMessage()
485 nh = NLMSG_NEXT(nh, size)) { in parseBinaryNetlinkMessage()
487 if (!rtMessageName(nh->nlmsg_type)) { in parseBinaryNetlinkMessage()
488 SLOGD("Unexpected netlink message type %d\n", nh->nlmsg_type); in parseBinaryNetlinkMessage()
492 if (nh->nlmsg_type == RTM_NEWLINK) { in parseBinaryNetlinkMessage()
493 if (parseIfInfoMessage(nh)) in parseBinaryNetlinkMessage()
496 } else if (nh->nlmsg_type == QLOG_NL_EVENT) { in parseBinaryNetlinkMessage()
497 if (parseUlogPacketMessage(nh)) in parseBinaryNetlinkMessage()
500 } else if (nh->nlmsg_type == RTM_NEWADDR || in parseBinaryNetlinkMessage()
501 nh->nlmsg_type == RTM_DELADDR) { in parseBinaryNetlinkMessage()
502 if (parseIfAddrMessage(nh)) in parseBinaryNetlinkMessage()
505 } else if (nh->nlmsg_type == RTM_NEWROUTE || in parseBinaryNetlinkMessage()
506 nh->nlmsg_type == RTM_DELROUTE) { in parseBinaryNetlinkMessage()
507 if (parseRtMessage(nh)) in parseBinaryNetlinkMessage()
510 } else if (nh->nlmsg_type == RTM_NEWNDUSEROPT) { in parseBinaryNetlinkMessage()
511 if (parseNdUserOptMessage(nh)) in parseBinaryNetlinkMessage()