Lines Matching refs:iph
16 #define IP_NEXT_PTR(iph) ((uint8_t *)iph + (iph->ihl << 2)) argument
65 struct iphdr *iph; in ICMPOutput() local
100 iph = (struct iphdr *)EthernetOutput(mtcp, pctx, ETH_P_IP, nif, haddr, pktlen, ts); in ICMPOutput()
101 if (!iph) in ICMPOutput()
105 iph->ihl = IP_HEADER_LEN >> 2; in ICMPOutput()
106 iph->version = 4; in ICMPOutput()
107 iph->tos = 0; in ICMPOutput()
108 iph->tot_len = htons(pktlen); in ICMPOutput()
109 iph->id = htons(0); in ICMPOutput()
110 iph->frag_off = htons(IP_DF); in ICMPOutput()
111 iph->ttl = 64; in ICMPOutput()
112 iph->protocol = IPPROTO_ICMP; in ICMPOutput()
113 iph->saddr = saddr; in ICMPOutput()
114 iph->daddr = daddr; in ICMPOutput()
115 iph->check = 0; in ICMPOutput()
116 iph->check = ip_fast_csum(iph, iph->ihl); in ICMPOutput()
118 icmph = (struct icmphdr *) IP_NEXT_PTR(iph); in ICMPOutput()
138 return (uint8_t *)(iph + 1); in ICMPOutput()
157 if (ICMPChecksum((uint16_t *) icmph, pctx->p.ip_len - (pctx->p.iph->ihl << 2) )) in ProcessICMPECHORequest()
160 ICMPOutput(mtcp, pctx, pctx->p.iph->daddr, pctx->p.iph->saddr, ICMP_ECHOREPLY, 0, in ProcessICMPECHORequest()
162 (uint16_t) (pctx->p.ip_len - (pctx->p.iph->ihl << 2) - sizeof(struct icmphdr)) ); in ProcessICMPECHORequest()
189 struct icmphdr *icmph = (struct icmphdr *) IP_NEXT_PTR(pctx->p.iph); in ProcessICMPPacket()
195 if (pctx->p.iph->daddr == g_config.mos->netdev_table->ent[i]->ip_addr) { in ProcessICMPPacket()