Lines Matching full:packet
192 } packet = {};
199 packet_len = sizeof(packet);
200 set_ip4hdr(&packet.iph, packet_len, IPPROTO_ICMP, src, dst);
202 packet.icmph.type = type;
203 packet.icmph.code = code;
205 randomize_buffer(&packet.icmph.un.frag.mtu,
206 sizeof(packet.icmph.un.frag.mtu));
209 packet_len = sizeof(packet.iphe) + sizeof(packet.tcph);
210 set_ip4hdr(&packet.iphe, packet_len, IPPROTO_TCP, dst, src);
212 packet.tcph.sport = dst->sin_port;
213 packet.tcph.dport = src->sin_port;
214 packet.tcph.seq = htonl(rcv_nxt);
216 packet_len = sizeof(packet) - sizeof(packet.iph);
217 packet.icmph.checksum = checksum4_fold((void *)&packet.icmph,
220 bytes = sendto(sk, &packet, sizeof(packet), 0,
222 if (bytes != sizeof(packet))
307 } packet = {};
315 packet_len = sizeof(packet) - sizeof(packet.iph);
316 set_ip6hdr(&packet.iph, packet_len, IPPROTO_ICMPV6, src, dst);
318 packet.icmph.icmp6_type = type;
319 packet.icmph.icmp6_code = code;
321 packet_len = sizeof(packet.iphe) + sizeof(packet.tcph);
322 set_ip6hdr(&packet.iphe, packet_len, IPPROTO_TCP, dst, src);
324 packet.tcph.sport = dst->sin6_port;
325 packet.tcph.dport = src->sin6_port;
326 packet.tcph.seq = htonl(rcv_nxt);
328 packet_len = sizeof(packet) - sizeof(packet.iph);
330 packet.icmph.icmp6_cksum = icmp6_checksum(src, dst,
331 (void *)&packet.icmph, packet_len, IPPROTO_ICMPV6);
334 bytes = sendto(sk, &packet, sizeof(packet), 0,
336 if (bytes != sizeof(packet))