Lines Matching defs:iph

253 	struct iphdr *iph = buf;
267 memset(iph, 0, sizeof(*iph));
269 iph->version = 4;
270 iph->ihl = 5;
271 iph->ttl = 8;
272 iph->protocol = protocol;
273 iph->tot_len = htons(sizeof(struct tcphdr) +
275 iph->frag_off = htons(0x4000); /* DF = 1, MF = 0 */
276 if (inet_pton(AF_INET, addr4_src, &iph->saddr) != 1)
278 if (inet_pton(AF_INET, addr4_dst, &iph->daddr) != 1)
280 iph->check = checksum_fold(buf, sizeof(struct iphdr), 0);
419 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN);
429 iph->tot_len = htons(ntohs(iph->tot_len) + extlen);
430 iph->check = 0;
431 iph->check = checksum_fold(iph, sizeof(struct iphdr), 0);
434 iph += 1;
435 iph->tot_len = htons(ntohs(iph->tot_len) + extlen);
436 iph->check = 0;
437 iph->check = checksum_fold(iph, sizeof(struct iphdr), 0);
604 struct iphdr *iph;
618 iph = (struct iphdr *)(optpkt + ETH_HLEN);
619 iph->ihl = 5 + (optlen / 4);
620 iph->tot_len = htons(ntohs(iph->tot_len) + optlen);
621 iph->check = 0;
622 iph->check = checksum_fold(iph, sizeof(struct iphdr) + optlen, 0);
628 struct ipv6hdr *iph = (struct ipv6hdr *)(optpkt + ETH_HLEN);
640 iph->nexthdr = exthdr_type;
641 iph->payload_len = htons(ntohs(iph->payload_len) + MIN_EXTHDR_SIZE);
644 static void fix_ip4_checksum(struct iphdr *iph)
646 iph->check = 0;
647 iph->check = checksum_fold(iph, sizeof(struct iphdr), 0);
788 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN);
803 iph->frag_off = htons(0x6000); // DF = 1, MF = 1
804 iph->check = 0;
805 iph->check = checksum_fold(iph, sizeof(struct iphdr), 0);
814 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN);
820 iph->ttl = 7;
821 iph->check = 0;
822 iph->check = checksum_fold(iph, sizeof(struct iphdr), 0);
831 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN);
839 iph->tos = 1;
840 iph->check = 0;
841 iph->check = checksum_fold(iph, sizeof(struct iphdr), 0);
853 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN);
861 iph->check = 0;
862 iph->check = checksum_fold(iph, sizeof(struct iphdr), 0);
932 struct iphdr *iph = (struct iphdr *)(buffer + ETH_HLEN);
954 if (iph->version == 4)
955 ip_ext_len = (iph->ihl - 5) * 4;
970 if (pkt_size == ETH_ZLEN && iph->version == 4) {
971 data_len = ntohs(iph->tot_len)