Lines Matching refs:pkt
255 struct icmp *pkt; in ping4() local
258 pkt = (struct icmp *) G.packet; in ping4()
260 pkt->icmp_type = ICMP_ECHO; in ping4()
261 pkt->icmp_id = G.myid; in ping4()
262 pkt->icmp_cksum = inet_cksum(pkt, sizeof(G.packet)); in ping4()
285 pkt = (struct icmp *) (G.packet + (iphdr->ihl << 2)); /* skip ip hdr */ in ping4()
286 if (pkt->icmp_id != G.myid) in ping4()
288 if (pkt->icmp_type == ICMP_ECHOREPLY) in ping4()
297 struct icmp6_hdr *pkt; in ping6() local
301 pkt = (struct icmp6_hdr *) G.packet; in ping6()
303 pkt->icmp6_type = ICMP6_ECHO_REQUEST; in ping6()
304 pkt->icmp6_id = G.myid; in ping6()
328 if (pkt->icmp6_id != G.myid) in ping6()
330 if (pkt->icmp6_type == ICMP6_ECHO_REPLY) in ping6()
562 struct icmp *pkt = G.snd_packet; in sendping4() local
564 memset(pkt, G.pattern, datalen + ICMP_MINLEN + 4); in sendping4()
565 pkt->icmp_type = ICMP_ECHO; in sendping4()
567 pkt->icmp_cksum = 0; /* cksum is calculated with this field set to 0 */ in sendping4()
568 pkt->icmp_seq = htons(G.ntransmitted); /* don't ++ here, it can be a macro */ in sendping4()
569 pkt->icmp_id = myid; in sendping4()
576 *(uint32_t*)&pkt->icmp_dun = G.cur_us = monotonic_us(); in sendping4()
578 pkt->icmp_cksum = inet_cksum(pkt, datalen + ICMP_MINLEN); in sendping4()
585 struct icmp6_hdr *pkt = G.snd_packet; in sendping6() local
587 memset(pkt, G.pattern, datalen + sizeof(struct icmp6_hdr) + 4); in sendping6()
588 pkt->icmp6_type = ICMP6_ECHO_REQUEST; in sendping6()
591 pkt->icmp6_seq = htons(G.ntransmitted); /* don't ++ here, it can be a macro */ in sendping6()
592 pkt->icmp6_id = myid; in sendping6()
595 *(bb__aliased_uint32_t*)(&pkt->icmp6_data8[4]) = G.cur_us = monotonic_us(); in sendping6()