Lines Matching refs:iphdr
487 struct ip_hdr *iphdr = (struct ip_hdr *)(p->payload + SIZEOF_ETH_HDR);
494 if(IPH_PROTO(iphdr) != IP_PROTO_IPENCAP) {
565 if(peers_get_from_ip(iphdr->src.addr) == NULL) {
569 newpeer->ip = iphdr->src.addr;
690 struct ip_hdr *iphdr = (struct ip_hdr *)(p + SIZEOF_ETH_HDR);
692 uint8_t ttl = IPH_TTL(iphdr);
697 unsigned int outer_len = IPH_HL(iphdr) * 4;
699 memcpy(iphdr, inner_iphdr, len - SIZEOF_ETH_HDR - outer_len);
704 IPH_TTL_SET(iphdr, ttl - 1);
707 uint32_t tmpip = iphdr->dest.addr;
708 iphdr->dest.addr = iphdr->src.addr;
709 iphdr->src.addr = tmpip;
710 /* iphdr->_chksum = 0; */
733 /* struct ip_hdr *iphdr = (struct ip_hdr *)(p + SIZEOF_ETH_HDR); */
735 /* printf("%d: Is an IP packet, type %x\n", disp_get_core_id(), IPH_PROTO(iphdr)); */