Home | History | Annotate | Download | only in src

Lines Matching defs:nh

106 static bool checkRtNetlinkLength(const struct nlmsghdr *nh, size_t size) {
107 if (nh->nlmsg_len < NLMSG_LENGTH(size)) {
108 SLOGE("Got a short %s message\n", rtMessageName(nh->nlmsg_type));
130 bool NetlinkEvent::parseIfInfoMessage(const struct nlmsghdr *nh) {
131 struct ifinfomsg *ifi = (struct ifinfomsg *) NLMSG_DATA(nh);
132 if (!checkRtNetlinkLength(nh, sizeof(*ifi)))
139 int len = IFLA_PAYLOAD(nh);
158 bool NetlinkEvent::parseIfAddrMessage(const struct nlmsghdr *nh) {
159 struct ifaddrmsg *ifaddr = (struct ifaddrmsg *) NLMSG_DATA(nh);
164 if (!checkRtNetlinkLength(nh, sizeof(*ifaddr)))
168 int type = nh->nlmsg_type;
178 int len = IFA_PAYLOAD(nh);
257 bool NetlinkEvent::parseUlogPacketMessage(const struct nlmsghdr *nh) {
259 ulog_packet_msg_t *pm = (ulog_packet_msg_t *) NLMSG_DATA(nh);
260 if (!checkRtNetlinkLength(nh, sizeof(*pm)))
274 bool NetlinkEvent::parseNfPacketMessage(struct nlmsghdr *nh) {
279 struct nlattr *uid_attr = nlmsg_find_attr(nh, sizeof(struct genlmsghdr), NFULA_UID);
284 struct nlattr *payload = nlmsg_find_attr(nh, sizeof(struct genlmsghdr), NFULA_PAYLOAD);
309 bool NetlinkEvent::parseRtMessage(const struct nlmsghdr *nh) {
310 uint8_t type = nh->nlmsg_type;
319 struct rtmsg *rtm = (struct rtmsg *) NLMSG_DATA(nh);
320 if (!checkRtNetlinkLength(nh, sizeof(*rtm)))
344 size_t len = RTM_PAYLOAD(nh);
401 bool NetlinkEvent::parseNdUserOptMessage(const struct nlmsghdr *nh) {
402 struct nduseroptmsg *msg = (struct nduseroptmsg *) NLMSG_DATA(nh);
403 if (!checkRtNetlinkLength(nh, sizeof(*msg)))
407 int len = NLMSG_PAYLOAD(nh, sizeof(*msg));
519 struct nlmsghdr *nh;
521 for (nh = (struct nlmsghdr *) buffer;
522 NLMSG_OK(nh, (unsigned) size) && (nh->nlmsg_type != NLMSG_DONE);
523 nh = NLMSG_NEXT(nh, size)) {
525 if (!rtMessageName(nh->nlmsg_type)) {
526 SLOGD("Unexpected netlink message type %d\n", nh->nlmsg_type);
530 if (nh->nlmsg_type == RTM_NEWLINK) {
531 if (parseIfInfoMessage(nh))
534 } else if (nh->nlmsg_type == LOCAL_QLOG_NL_EVENT) {
535 if (parseUlogPacketMessage(nh))
538 } else if (nh->nlmsg_type == RTM_NEWADDR ||
539 nh->nlmsg_type == RTM_DELADDR) {
540 if (parseIfAddrMessage(nh))
543 } else if (nh->nlmsg_type == RTM_NEWROUTE ||
544 nh->nlmsg_type == RTM_DELROUTE) {
545 if (parseRtMessage(nh))
548 } else if (nh->nlmsg_type == RTM_NEWNDUSEROPT) {
549 if (parseNdUserOptMessage(nh))
552 } else if (nh->nlmsg_type == LOCAL_NFLOG_PACKET) {
553 if (parseNfPacketMessage(nh))