• Home
  • Raw
  • Download

Lines Matching refs:msg

35     static bool isLoopbackSocket(const inet_diag_msg *msg) {  in isLoopbackSocket()  argument
36 return SockDiag::isLoopbackSocket(msg); in isLoopbackSocket()
106 auto checkIPv4Dump = [&] (uint8_t /* proto */, const inet_diag_msg *msg) { in TEST_F() argument
107 if (msg == nullptr) { in TEST_F()
112 EXPECT_EQ(htonl(INADDR_LOOPBACK), msg->id.idiag_src[0]); in TEST_F()
114 seenclient46 |= (msg->id.idiag_sport == client46.sin6_port); in TEST_F()
115 inet_ntop(AF_INET, msg->id.idiag_src, src, sizeof(src)); in TEST_F()
116 inet_ntop(AF_INET, msg->id.idiag_src, dst, sizeof(dst)); in TEST_F()
118 src, htons(msg->id.idiag_sport), in TEST_F()
119 dst, htons(msg->id.idiag_dport), in TEST_F()
120 tcpStateName(msg->idiag_state)); in TEST_F()
121 if (msg->idiag_state == TCP_ESTABLISHED) { in TEST_F()
122 EXPECT_TRUE(isLoopbackSocket(msg)); in TEST_F()
130 auto checkIPv6Dump = [&] (uint8_t /* proto */, const inet_diag_msg *msg) { in TEST_F() argument
131 if (msg == nullptr) { in TEST_F()
136 struct in6_addr *saddr = (struct in6_addr *) msg->id.idiag_src; in TEST_F()
141 seenClient6 |= (msg->id.idiag_sport == client6.sin6_port); in TEST_F()
142 seenServer46 |= (msg->id.idiag_sport == htons(port)); in TEST_F()
143 seenServer6 |= (msg->id.idiag_sport == htons(port)); in TEST_F()
144 inet_ntop(AF_INET6, msg->id.idiag_src, src, sizeof(src)); in TEST_F()
145 inet_ntop(AF_INET6, msg->id.idiag_src, dst, sizeof(dst)); in TEST_F()
147 src, htons(msg->id.idiag_sport), in TEST_F()
148 dst, htons(msg->id.idiag_dport), in TEST_F()
149 tcpStateName(msg->idiag_state)); in TEST_F()
150 if (msg->idiag_state == TCP_ESTABLISHED) { in TEST_F()
151 EXPECT_TRUE(isLoopbackSocket(msg)); in TEST_F()
210 inet_diag_msg msg = { in makeDiagMessage() local
220 EXPECT_TRUE(fillDiagAddr(msg.id.idiag_src, src)); in makeDiagMessage()
221 EXPECT_TRUE(fillDiagAddr(msg.id.idiag_dst, dst)); in makeDiagMessage()
222 return msg; in makeDiagMessage()
230 inet_diag_msg msg = makeDiagMessage(src->ai_addr->sa_family, src->ai_addr, dst->ai_addr); in makeDiagMessage() local
233 return msg; in makeDiagMessage()
237 inet_diag_msg msg; in TEST_F() local
239 msg = makeDiagMessage("127.0.0.1", "127.0.0.1"); in TEST_F()
240 EXPECT_TRUE(isLoopbackSocket(&msg)); in TEST_F()
242 msg = makeDiagMessage("::1", "::1"); in TEST_F()
243 EXPECT_TRUE(isLoopbackSocket(&msg)); in TEST_F()
245 msg = makeDiagMessage("::1", "::ffff:127.0.0.1"); in TEST_F()
246 EXPECT_TRUE(isLoopbackSocket(&msg)); in TEST_F()
248 msg = makeDiagMessage("192.0.2.1", "192.0.2.1"); in TEST_F()
249 EXPECT_TRUE(isLoopbackSocket(&msg)); in TEST_F()
251 msg = makeDiagMessage("192.0.2.1", "8.8.8.8"); in TEST_F()
252 EXPECT_FALSE(isLoopbackSocket(&msg)); in TEST_F()
254 msg = makeDiagMessage("192.0.2.1", "127.0.0.1"); in TEST_F()
255 EXPECT_TRUE(isLoopbackSocket(&msg)); in TEST_F()
257 msg = makeDiagMessage("2001:db8::1", "2001:db8::1"); in TEST_F()
258 EXPECT_TRUE(isLoopbackSocket(&msg)); in TEST_F()
260 msg = makeDiagMessage("2001:db8::1", "2001:4860:4860::6464"); in TEST_F()
261 EXPECT_FALSE(isLoopbackSocket(&msg)); in TEST_F()
269 msg = makeDiagMessage("127.0.0.1", "0.0.0.0"); in TEST_F()
270 EXPECT_TRUE(isLoopbackSocket(&msg)); in TEST_F()
272 msg = makeDiagMessage("::1", "::"); in TEST_F()
273 EXPECT_TRUE(isLoopbackSocket(&msg)); in TEST_F()
440 bool checkSocketState(int i, int sock, const char *msg) { in checkSocketState() argument
450 EXPECT_EQ(-1, ret) << msg << " " << i << " not closed"; in checkSocketState()
458 << msg << ": unexpected error: " << strerror(err); in checkSocketState()