Lines Matching refs:ihdr

62 	struct iphdr *ihdr;  in net_test_get_skb()  local
85 ihdr = skb_put(skb, sizeof(*ihdr)); in net_test_get_skb()
113 (sizeof(*ihdr) + sizeof(*ehdr))); in net_test_get_skb()
117 ihdr->ihl = 5; in net_test_get_skb()
118 ihdr->ttl = 32; in net_test_get_skb()
119 ihdr->version = 4; in net_test_get_skb()
121 ihdr->protocol = IPPROTO_TCP; in net_test_get_skb()
123 ihdr->protocol = IPPROTO_UDP; in net_test_get_skb()
124 iplen = sizeof(*ihdr) + sizeof(*shdr) + attr->size; in net_test_get_skb()
133 ihdr->tot_len = htons(iplen); in net_test_get_skb()
134 ihdr->frag_off = 0; in net_test_get_skb()
135 ihdr->saddr = htonl(attr->ip_src); in net_test_get_skb()
136 ihdr->daddr = htonl(attr->ip_dst); in net_test_get_skb()
137 ihdr->tos = 0; in net_test_get_skb()
138 ihdr->id = 0; in net_test_get_skb()
139 ip_send_check(ihdr); in net_test_get_skb()
155 thdr->check = ~tcp_v4_check(skb->len, ihdr->saddr, in net_test_get_skb()
156 ihdr->daddr, 0); in net_test_get_skb()
160 udp4_hwcsum(skb, ihdr->saddr, ihdr->daddr); in net_test_get_skb()
182 struct iphdr *ihdr; in net_test_loopback_validate() local
204 ihdr = ip_hdr(skb); in net_test_loopback_validate()
206 ihdr = (struct iphdr *)(skb_network_header(skb) + 4); in net_test_loopback_validate()
209 if (ihdr->protocol != IPPROTO_TCP) in net_test_loopback_validate()
212 thdr = (struct tcphdr *)((u8 *)ihdr + 4 * ihdr->ihl); in net_test_loopback_validate()
218 if (ihdr->protocol != IPPROTO_UDP) in net_test_loopback_validate()
221 uhdr = (struct udphdr *)((u8 *)ihdr + 4 * ihdr->ihl); in net_test_loopback_validate()