Lines Matching defs:iph

224 	struct iphdr *iph = buf;
238 memset(iph, 0, sizeof(*iph));
240 iph->version = 4;
241 iph->ihl = 5;
242 iph->ttl = 8;
243 iph->protocol = IPPROTO_TCP;
244 iph->tot_len = htons(sizeof(struct tcphdr) +
246 iph->frag_off = htons(0x4000); /* DF = 1, MF = 0 */
247 if (inet_pton(AF_INET, addr4_src, &iph->saddr) != 1)
249 if (inet_pton(AF_INET, addr4_dst, &iph->daddr) != 1)
251 iph->check = checksum_fold(buf, sizeof(struct iphdr), 0);
380 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN);
390 iph->tot_len = htons(ntohs(iph->tot_len) + extlen);
391 iph->check = 0;
392 iph->check = checksum_fold(iph, sizeof(struct iphdr), 0);
558 struct iphdr *iph;
572 iph = (struct iphdr *)(optpkt + ETH_HLEN);
573 iph->ihl = 5 + (optlen / 4);
574 iph->tot_len = htons(ntohs(iph->tot_len) + optlen);
575 iph->check = 0;
576 iph->check = checksum_fold(iph, sizeof(struct iphdr) + optlen, 0);
602 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN);
617 iph->frag_off = htons(0x6000); // DF = 1, MF = 1
618 iph->check = 0;
619 iph->check = checksum_fold(iph, sizeof(struct iphdr), 0);
628 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN);
634 iph->ttl = 7;
635 iph->check = 0;
636 iph->check = checksum_fold(iph, sizeof(struct iphdr), 0);
645 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN);
653 iph->tos = 1;
654 iph->check = 0;
655 iph->check = checksum_fold(iph, sizeof(struct iphdr), 0);
667 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN);
675 iph->check = 0;
676 iph->check = checksum_fold(iph, sizeof(struct iphdr), 0);
746 struct iphdr *iph = (struct iphdr *)(buffer + ETH_HLEN);
767 if (iph->version == 4)
768 ip_ext_len = (iph->ihl - 5) * 4;
783 if (pkt_size == ETH_ZLEN && iph->version == 4) {
784 data_len = ntohs(iph->tot_len)