Home | History | Annotate | Download | only in src

Lines Matching defs:nh

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