Lines Matching refs:iphdr
96 ip_forward(struct pbuf *p, struct ip_hdr *iphdr)
102 if ((netif = ip_route((struct ip_addr *)&(iphdr->dest))) == NULL) {
106 ip_addr_debug_print(IP_DEBUG, ((struct ip_addr *)&(iphdr->dest)));
113 if (--iphdr->hoplim == 0) {
116 if (iphdr->nexthdr != IP_PROTO_ICMP) {
125 /* if (iphdr->chksum >= htons(0xffff - 0x100)) {
126 iphdr->chksum += htons(0x100) + 1;
128 iphdr->chksum += htons(0x100);
134 ip_addr_debug_print(IP_DEBUG, ((struct ip_addr *)&(iphdr->dest)));
143 netif->output(netif, p, (struct ip_addr *)&(iphdr->dest));
158 struct ip_hdr *iphdr;
172 iphdr = p->payload;
175 if (iphdr->v != 6) {
189 LWIP_DEBUGF(IP_DEBUG, ("ip_input: iphdr->dest "));
190 ip_addr_debug_print(IP_DEBUG, ((struct ip_addr *)&(iphdr->dest)));
192 ip_addr_debug_print(IP_DEBUG, ((struct ip_addr *)&(iphdr->dest)));
195 if (ip_addr_cmp(&(iphdr->dest), &(netif->ip_addr))) {
204 ip_forward(p, iphdr);
210 pbuf_realloc(p, IP_HLEN + ntohs(iphdr->len));
224 switch (iphdr->nexthdr) {
243 iphdr->nexthdr));
264 struct ip_hdr *iphdr;
277 iphdr = p->payload;
282 iphdr->hoplim = ttl;
283 iphdr->nexthdr = proto;
284 iphdr->len = htons(p->tot_len - IP_HLEN);
285 ip_addr_set(&(iphdr->dest), dest);
287 iphdr->v = 6;
290 ip_addr_set(&(iphdr->src), &(netif->ip_addr));
292 ip_addr_set(&(iphdr->src), src);
296 dest = &(iphdr->dest);
356 struct ip_hdr *iphdr = p->payload;
361 iphdr->v,
362 iphdr->tclass1, iphdr->tclass2,
363 iphdr->flow1, iphdr->flow2));
366 ntohs(iphdr->len),
367 iphdr->nexthdr,
368 iphdr->hoplim));
371 (ntohl(iphdr->src.addr[0]) >> 16) & 0xffff,
372 ntohl(iphdr->src.addr[0]) & 0xffff));
374 (ntohl(iphdr->src.addr[1]) >> 16) & 0xffff,
375 ntohl(iphdr->src.addr[1]) & 0xffff));
377 (ntohl(iphdr->src.addr[2]) >> 16) & 0xffff,
378 ntohl(iphdr->src.addr[2]) & 0xffff));
380 (ntohl(iphdr->src.addr[3]) >> 16) & 0xffff,
381 ntohl(iphdr->src.addr[3]) & 0xffff));
384 (ntohl(iphdr->dest.addr[0]) >> 16) & 0xffff,
385 ntohl(iphdr->dest.addr[0]) & 0xffff));
387 (ntohl(iphdr->dest.addr[1]) >> 16) & 0xffff,
388 ntohl(iphdr->dest.addr[1]) & 0xffff));
390 (ntohl(iphdr->dest.addr[2]) >> 16) & 0xffff,
391 ntohl(iphdr->dest.addr[2]) & 0xffff));
393 (ntohl(iphdr->dest.addr[3]) >> 16) & 0xffff,
394 ntohl(iphdr->dest.addr[3]) & 0xffff));