Lines Matching refs:packet_len
165 static void set_ip4hdr(struct iphdr *iph, size_t packet_len, int proto,
171 iph->tot_len = htons(packet_len);
193 size_t packet_len;
199 packet_len = sizeof(packet);
200 set_ip4hdr(&packet.iph, packet_len, IPPROTO_ICMP, src, dst);
209 packet_len = sizeof(packet.iphe) + sizeof(packet.tcph);
210 set_ip4hdr(&packet.iphe, packet_len, IPPROTO_TCP, dst, src);
216 packet_len = sizeof(packet) - sizeof(packet.iph);
218 packet_len, 0);
229 static void set_ip6hdr(struct ipv6hdr *iph, size_t packet_len, int proto,
233 iph->payload_len = htons(packet_len);
308 size_t packet_len;
315 packet_len = sizeof(packet) - sizeof(packet.iph);
316 set_ip6hdr(&packet.iph, packet_len, IPPROTO_ICMPV6, src, dst);
321 packet_len = sizeof(packet.iphe) + sizeof(packet.tcph);
322 set_ip6hdr(&packet.iphe, packet_len, IPPROTO_TCP, dst, src);
328 packet_len = sizeof(packet) - sizeof(packet.iph);
331 (void *)&packet.icmph, packet_len, IPPROTO_ICMPV6);