Lines Matching refs:pong

94 static void pxping_icmp4_callback(struct pong4 *pong);
98 static void pxping_icmp6_callback(struct pong6 *pong);
169 struct pong4 *pong;
178 pong = NULL;
217 pong = (struct pong4 *)malloc(RT_OFFSETOF(struct pong4, buf) + bufsize);
218 if (RT_UNLIKELY(pong == NULL)) {
221 pong->bufsize = bufsize;
222 pong->netif = pxping->netif;
224 memcpy(&pong->reqiph, iph, sizeof(*iph));
225 memcpy(&pong->reqicmph, icmph, sizeof(*icmph));
234 pbuf_copy_partial(p, pong->buf, p->tot_len, 0);
235 reqdata = pong->buf;
245 pxping->callback4, pong,
247 pong->buf, (DWORD)pong->bufsize,
280 pong = NULL; /* callback owns it now */
282 if (pong != NULL) {
283 free(pong);
292 struct pong4 *pong = (struct pong4 *)ctx;
296 if (pong != NULL) {
297 pxping_icmp4_callback(pong);
298 free(pong);
306 struct pong4 *pong = (struct pong4 *)ctx;
308 if (pong != NULL) {
309 pxping_icmp4_callback(pong);
310 free(pong);
316 pxping_icmp4_callback(struct pong4 *pong)
326 nreplies = IcmpParseReplies(pong->buf, (DWORD)pong->bufsize);
330 DPRINTF2(("pong4: %p timed out\n", (void *)pong));
334 (void *)pong, error));
339 reply = (ICMP_ECHO_REPLY *)pong->buf;
359 && IP_HLEN + icmplen > pong->netif->mtu)
373 icmph->id = pong->reqicmph.id;
374 icmph->seqno = pong->reqicmph.seqno;
412 icmplen = sizeof(*icmph) + sizeof(pong->reqiph) + sizeof(pong->reqicmph);
432 &pong->reqiph, sizeof(pong->reqiph));
434 memcpy((u8_t *)p->payload + sizeof(*icmph) + sizeof(pong->reqiph),
435 &pong->reqicmph, sizeof(pong->reqicmph));
440 (ip_addr_t *)&pong->reqiph.src, /* dst */
444 pong->netif);
455 struct pong6 *pong;
464 pong = NULL;
501 pong = (struct pong6 *)malloc(RT_OFFSETOF(struct pong6, buf) + bufsize);
502 if (RT_UNLIKELY(pong == NULL)) {
505 pong->bufsize = bufsize;
506 pong->netif = pxping->netif;
508 ip6_addr_copy(pong->reqsrc, *ip6_current_src_addr());
509 memcpy(&pong->reqicmph, icmph, sizeof(*icmph));
511 memset(pong->buf, 0xa5, pong->bufsize);
513 pong->reqsize = reqsize = p->tot_len;
520 pbuf_copy_partial(p, pong->buf, p->tot_len, 0);
521 reqdata = pong->buf;
532 pxping->callback6, pong,
534 pong->buf, (DWORD)pong->bufsize,
566 pong = NULL; /* callback owns it now */
568 if (pong != NULL) {
569 free(pong);
578 struct pong6 *pong = (struct pong6 *)ctx;
582 if (pong != NULL) {
583 pxping_icmp6_callback(pong);
584 free(pong);
592 struct pong6 *pong = (struct pong6 *)ctx;
594 if (pong != NULL) {
595 pxping_icmp6_callback(pong);
596 free(pong);
602 pxping_icmp6_callback(struct pong6 *pong)
612 nreplies = Icmp6ParseReplies(pong->buf, (DWORD)pong->bufsize);
616 DPRINTF2(("pong6: %p timed out\n", (void *)pong));
620 (void *)pong, error));
625 reply = (ICMPV6_ECHO_REPLY *)pong->buf;
637 icmplen = sizeof(*icmph) + pong->reqsize;
647 icmph->id = pong->reqicmph.id;
648 icmph->seqno = pong->reqicmph.seqno;
651 pong->buf + sizeof(*reply), pong->reqsize);
654 &src, &pong->reqsrc);
655 ip6_output_if(p, /* :src */ &src, /* :dst */ &pong->reqsrc,
657 pong->netif);