Lines Matching refs:iphdr

93 static void ip_forward(struct pbuf *p, struct ip_hdr *iphdr)
99 if ((netif = ip_route((struct ip_addr *) &(iphdr->dest))) == NULL) {
103 ip_addr_debug_print(IP_DEBUG, ((struct ip_addr *) &(iphdr->dest)));
110 if (--iphdr->hoplim == 0) {
113 if (iphdr->nexthdr != IP_PROTO_ICMP) {
122 /* if (iphdr->chksum >= htons(0xffff - 0x100)) {
123 iphdr->chksum += htons(0x100) + 1;
125 iphdr->chksum += htons(0x100);
131 ip_addr_debug_print(IP_DEBUG, ((struct ip_addr *) &(iphdr->dest)));
140 netif->output(netif, p, (struct ip_addr *) &(iphdr->dest));
155 struct ip_hdr *iphdr;
169 iphdr = p->payload;
172 if (iphdr->v != 6) {
187 LWIP_DEBUGF(IP_DEBUG, ("ip_input: iphdr->dest "));
188 ip_addr_debug_print(IP_DEBUG, ((struct ip_addr *) &(iphdr->dest)));
190 ip_addr_debug_print(IP_DEBUG, ((struct ip_addr *) &(iphdr->dest)));
193 if (ip_addr_cmp(&(iphdr->dest), &(netif->ip_addr))) {
202 ip_forward(p, iphdr);
208 pbuf_realloc(p, IP_HLEN + ntohs(iphdr->len));
222 switch (iphdr->nexthdr) {
242 iphdr->nexthdr));
262 struct ip_hdr *iphdr;
278 iphdr = p->payload;
283 iphdr->hoplim = ttl;
284 iphdr->nexthdr = proto;
285 iphdr->len = htons(p->tot_len - IP_HLEN);
286 ip_addr_set(&(iphdr->dest), dest);
288 iphdr->v = 6;
291 ip_addr_set(&(iphdr->src), &(netif->ip_addr));
293 ip_addr_set(&(iphdr->src), src);
297 dest = &(iphdr->dest);
361 struct ip_hdr *iphdr = p->payload;
368 iphdr->v, iphdr->tclass1, iphdr->tclass2, iphdr->flow1,
369 iphdr->flow2));
373 " | (len, nexthdr, hoplim)\n", ntohs(iphdr->len),
374 iphdr->nexthdr, iphdr->hoplim));
378 (ntohl(iphdr->src.addr[0]) >> 16) & 0xffff,
379 ntohl(iphdr->src.addr[0]) & 0xffff));
382 (ntohl(iphdr->src.addr[1]) >> 16) & 0xffff,
383 ntohl(iphdr->src.addr[1]) & 0xffff));
386 (ntohl(iphdr->src.addr[2]) >> 16) & 0xffff,
387 ntohl(iphdr->src.addr[2]) & 0xffff));
390 (ntohl(iphdr->src.addr[3]) >> 16) & 0xffff,
391 ntohl(iphdr->src.addr[3]) & 0xffff));
395 (ntohl(iphdr->dest.addr[0]) >> 16) & 0xffff,
396 ntohl(iphdr->dest.addr[0]) & 0xffff));
399 (ntohl(iphdr->dest.addr[1]) >> 16) & 0xffff,
400 ntohl(iphdr->dest.addr[1]) & 0xffff));
403 (ntohl(iphdr->dest.addr[2]) >> 16) & 0xffff,
404 ntohl(iphdr->dest.addr[2]) & 0xffff));
407 (ntohl(iphdr->dest.addr[3]) >> 16) & 0xffff,
408 ntohl(iphdr->dest.addr[3]) & 0xffff));