Lines Matching defs:pong

40 struct pong {
43 TAILQ_ENTRY(pong) queue_entry;
56 static void icmpwin_callback(struct pong *pong);
57 static void icmpwin_pong(struct pong *pong);
59 static struct mbuf *icmpwin_get_error(struct pong *pong, int type, int code);
112 struct pong *pong = TAILQ_FIRST(&pData->pongs_received);
113 TAILQ_REMOVE(&pData->pongs_received, pong, queue_entry);
114 RTMemFree(pong);
119 struct pong *pong = TAILQ_FIRST(&pData->pongs_expected);
120 TAILQ_REMOVE(&pData->pongs_expected, pong, queue_entry);
121 pong->pData = NULL;
136 struct pong *pong;
154 pongsize = RT_OFFSETOF(struct pong, buf) + bufsize;
158 pong = RTMemAlloc(pongsize);
159 if (RT_UNLIKELY(pong == NULL))
162 pong->pData = pData;
163 pong->bufsize = bufsize;
164 m_copydata(m, 0, hlen, (caddr_t)&pong->reqiph);
165 m_copydata(m, hlen, sizeof(struct icmp_echo), (caddr_t)&pong->reqicmph);
166 AssertReturnVoid(pong->reqicmph.icmp_type == ICMP_ECHO);
176 reqdata = pong->buf;
191 pfIcmpCallback, pong,
193 pong->buf, (DWORD)pong->bufsize,
219 struct mbuf *em = icmpwin_get_error(pong, ICMP_UNREACH, code);
230 Log2(("NAT: pong %p for ping %RTnaipv4 id 0x%04x seq %d len %zu (%zu)\n",
231 pong, dst,
232 RT_N2H_U16(pong->reqicmph.icmp_echo_id),
233 RT_N2H_U16(pong->reqicmph.icmp_echo_seq),
237 TAILQ_INSERT_TAIL(&pData->pongs_expected, pong, queue_entry);
238 pong = NULL; /* callback owns it now */
241 if (pong != NULL)
242 RTMemFree(pong);
249 struct pong *pong = (struct pong *)ctx;
250 if (pong != NULL)
251 icmpwin_callback(pong);
258 struct pong *pong = (struct pong *)ctx;
259 if (pong != NULL)
260 icmpwin_callback(pong);
266 * trampoline will free "pong" argument for us.
273 icmpwin_callback(struct pong *pong)
275 PNATState pData = pong->pData;
279 RTMemFree(pong);
285 struct pong *expected, *already;
289 if (expected == pong)
296 if (already == pong)
303 TAILQ_REMOVE(&pData->pongs_expected, pong, queue_entry);
304 TAILQ_INSERT_TAIL(&pData->pongs_received, pong, queue_entry);
322 struct pong *pong = TAILQ_FIRST(&pongs);
325 sz = RT_OFFSETOF(struct pong, buf) + pong->bufsize;
329 icmpwin_pong(pong);
331 TAILQ_REMOVE(&pongs, pong, queue_entry);
332 RTMemFree(pong);
338 icmpwin_pong(struct pong *pong)
348 pData = pong->pData; /* to make slirp_state.h macro hackery work */
350 nreplies = IcmpParseReplies(pong->buf, (DWORD)pong->bufsize);
355 Log2(("NAT: ping %p timed out\n", (void *)pong));
358 (void *)pong, error));
362 reply = (ICMP_ECHO_REPLY *)pong->buf;
396 ip->ip_dst = pong->reqiph.ip_src;
401 icmp->icmp_echo_id = pong->reqicmph.icmp_echo_id;
402 icmp->icmp_echo_seq = pong->reqicmph.icmp_echo_seq;
446 m = icmpwin_get_error(pong, type, code);
467 icmpwin_get_error(struct pong *pong, int type, int code)
469 PNATState pData = pong->pData;
477 reqsize = sizeof(pong->reqiph) + sizeof(pong->reqicmph);
492 ip->ip_dst = pong->reqiph.ip_src;
500 m_append(pData, m, sizeof(pong->reqiph), (caddr_t)&pong->reqiph);
501 m_append(pData, m, sizeof(pong->reqicmph), (caddr_t)&pong->reqicmph);