Lines Matching refs:pNLMsg
1076 mDNSlocal void PrintNetLinkMsg(const struct nlmsghdr *pNLMsg)
1081 printf("nlmsghdr len=%d, type=%s, flags=0x%x\n", pNLMsg->nlmsg_len,
1082 pNLMsg->nlmsg_type < RTM_BASE ? kNLMsgTypes[pNLMsg->nlmsg_type] : kNLRtMsgTypes[pNLMsg->nlmsg_type - RTM_BASE],
1083 pNLMsg->nlmsg_flags);
1085 if (RTM_NEWLINK <= pNLMsg->nlmsg_type && pNLMsg->nlmsg_type <= RTM_GETLINK)
1087 struct ifinfomsg *pIfInfo = (struct ifinfomsg*) NLMSG_DATA(pNLMsg);
1092 else if (RTM_NEWADDR <= pNLMsg->nlmsg_type && pNLMsg->nlmsg_type <= RTM_GETADDR)
1094 struct ifaddrmsg *pIfAddr = (struct ifaddrmsg*) NLMSG_DATA(pNLMsg);
1108 struct nlmsghdr *pNLMsg = (struct nlmsghdr*) buff;
1121 if (((char*) &pNLMsg[1] > (buff + readCount)) || // i.e. *pNLMsg extends off end of buffer
1122 ((char*) pNLMsg + pNLMsg->nlmsg_len > (buff + readCount)))
1124 if (buff < (char*) pNLMsg) // we have space to shuffle
1127 readCount -= ((char*) pNLMsg - buff);
1128 memmove(buff, pNLMsg, readCount);
1129 pNLMsg = (struct nlmsghdr*) buff;
1140 PrintNetLinkMsg(pNLMsg);
1144 if (pNLMsg->nlmsg_type == RTM_GETLINK || pNLMsg->nlmsg_type == RTM_NEWLINK)
1145 result |= 1 << ((struct ifinfomsg*) NLMSG_DATA(pNLMsg))->ifi_index;
1146 else if (pNLMsg->nlmsg_type == RTM_DELADDR || pNLMsg->nlmsg_type == RTM_NEWADDR)
1147 result |= 1 << ((struct ifaddrmsg*) NLMSG_DATA(pNLMsg))->ifa_index;
1149 // Advance pNLMsg to the next message in the buffer
1150 if ((pNLMsg->nlmsg_flags & NLM_F_MULTI) != 0 && pNLMsg->nlmsg_type != NLMSG_DONE)
1152 ssize_t len = readCount - ((char*)pNLMsg - buff);
1153 pNLMsg = NLMSG_NEXT(pNLMsg, len);