Lines Matching refs:iphdr
211 struct ip_hdr *iphdr = (struct ip_hdr *)(p->payload + SIZEOF_ETH_HDR);
213 /* printf("Is an IP packet, type %x\n", IPH_PROTO(iphdr)); */
215 if(IPH_PROTO(iphdr) == IP_PROTO_UDP) {
216 struct udp_hdr *udphdr = (struct udp_hdr *)(p->payload + SIZEOF_ETH_HDR + (IPH_HL(iphdr) * 4));
217 uint8_t *payload = p->payload + SIZEOF_ETH_HDR + (IPH_HL(iphdr) * 4) + sizeof(struct udp_hdr);
220 /* iphdr->dest.addr, udphdr->dest); */
222 if(htonl(iphdr->dest.addr) != 0x80d00643 ||
232 struct udp_hdr *myudp = (struct udp_hdr *)(outp->payload + SIZEOF_ETH_HDR + (IPH_HL(iphdr) * 4));
233 uint8_t *mypayload = outp->payload + SIZEOF_ETH_HDR + (IPH_HL(iphdr) * 4) + sizeof(struct udp_hdr);
241 memcpy(myip, iphdr, sizeof(struct ip_hdr));
242 memcpy(&myip->src, &iphdr->dest, sizeof(ip_addr_p_t));
243 memcpy(&myip->dest, &iphdr->src, sizeof(ip_addr_p_t));