Lines Matching refs:msg
227 inet_diag_msg *msg = reinterpret_cast<inet_diag_msg *>(NLMSG_DATA(nlh)); in readDiagMsg()
228 if (callback(proto, msg)) { in readDiagMsg()
229 sockDestroy(proto, msg); in readDiagMsg()
239 bool SockDiag::isLoopbackSocket(const inet_diag_msg *msg) { in isLoopbackSocket() argument
240 switch (msg->idiag_family) { in isLoopbackSocket()
243 return IN_LOOPBACK(htonl(msg->id.idiag_src[0])) || in isLoopbackSocket()
244 IN_LOOPBACK(htonl(msg->id.idiag_dst[0])) || in isLoopbackSocket()
245 msg->id.idiag_src[0] == msg->id.idiag_dst[0]; in isLoopbackSocket()
248 const struct in6_addr *src = (const struct in6_addr *) &msg->id.idiag_src; in isLoopbackSocket()
249 const struct in6_addr *dst = (const struct in6_addr *) &msg->id.idiag_dst; in isLoopbackSocket()
260 int SockDiag::sockDestroy(uint8_t proto, const inet_diag_msg *msg) { in sockDestroy() argument
261 if (msg == nullptr) { in sockDestroy()
271 .sdiag_family = msg->idiag_family, in sockDestroy()
273 .idiag_states = (uint32_t) (1 << msg->idiag_state), in sockDestroy()
274 .id = msg->id, in sockDestroy()
348 auto shouldDestroy = [uid, excludeLoopback] (uint8_t, const inet_diag_msg *msg) { in destroySockets() argument
349 return msg != nullptr && in destroySockets()
350 msg->idiag_uid == uid && in destroySockets()
351 !(excludeLoopback && isLoopbackSocket(msg)); in destroySockets()
379 auto shouldDestroy = [&] (uint8_t, const inet_diag_msg *msg) { in destroySockets() argument
380 return msg != nullptr && in destroySockets()
381 uidRanges.hasUid(msg->idiag_uid) && in destroySockets()
382 skipUids.find(msg->idiag_uid) == skipUids.end() && in destroySockets()
383 !(excludeLoopback && isLoopbackSocket(msg)); in destroySockets()
485 auto shouldDestroy = [&] (uint8_t, const inet_diag_msg *msg) { in destroySocketsLackingPermission() argument
486 return msg != nullptr && !(excludeLoopback && isLoopbackSocket(msg)); in destroySocketsLackingPermission()