Lines Matching refs:iph
438 to->iph = from->iph ? in ClonePacketCtx()
440 if (to->iph) { in ClonePacketCtx()
443 (struct tcphdr *)(((uint8_t *)(to->iph)) + (to->iph->ihl<<2)) : NULL; in ClonePacketCtx()
575 if (!(pkt->iph) || !(pkt->tcph)) { in mtcp_sendpkt()
583 pkt->iph->saddr, pkt->tcph->source, in mtcp_sendpkt()
584 pkt->iph->daddr, pkt->tcph->dest, in mtcp_sendpkt()
590 pkt->iph->id, pkt->in_ifidx); in mtcp_sendpkt()
938 struct iphdr *iph; in mtcp_setlastpkt() local
1040 (iph=(struct iphdr *)(cur_pkt_ctx->p.ethh + 1)) == NULL) { in mtcp_setlastpkt()
1046 if (offset + datalen > (iph->ihl<<2)) { in mtcp_setlastpkt()
1053 memcpy((uint8_t *)iph + offset, data, datalen); in mtcp_setlastpkt()
1056 memmove((uint8_t *)iph + offset, in mtcp_setlastpkt()
1057 (uint8_t *)iph + offset + datalen, in mtcp_setlastpkt()
1061 if (iph->protocol == IPPROTO_TCP) { in mtcp_setlastpkt()
1062 cur_pkt_ctx->p.tcph = (struct tcphdr *)((uint8_t *)iph + (iph->ihl<<2)); in mtcp_setlastpkt()
1070 cur_pkt_ctx->p.ip_len = ntohs(iph->tot_len); in mtcp_setlastpkt()
1074 memmove((uint8_t *)iph + offset + datalen, in mtcp_setlastpkt()
1075 (uint8_t *)iph + offset + 1, in mtcp_setlastpkt()
1077 memcpy((uint8_t *)iph + offset, in mtcp_setlastpkt()
1081 if (iph->protocol == IPPROTO_TCP) { in mtcp_setlastpkt()
1082 cur_pkt_ctx->p.tcph = (struct tcphdr *)((uint8_t *)iph + (iph->ihl<<2)); in mtcp_setlastpkt()
1090 cur_pkt_ctx->p.ip_len = ntohs(iph->tot_len); in mtcp_setlastpkt()
1097 iph = (struct iphdr *)(cur_pkt_ctx->p.ethh + 1); in mtcp_setlastpkt()
1098 if (iph == NULL || in mtcp_setlastpkt()
1099 iph->protocol != IPPROTO_TCP || in mtcp_setlastpkt()
1100 (tcph=(struct tcphdr *)((uint8_t *)iph + (iph->ihl<<2))) == NULL) { in mtcp_setlastpkt()
1143 iph = (struct iphdr *)(cur_pkt_ctx->p.ethh + 1); in mtcp_setlastpkt()
1144 tcph = (struct tcphdr *)((uint8_t *)iph + (iph->ihl<<2)); in mtcp_setlastpkt()
1147 if (offset + datalen > ntohs(iph->tot_len) - in mtcp_setlastpkt()
1148 (iph->ihl<<2) - (tcph->doff<<2)) { in mtcp_setlastpkt()
1164 (tcph->doff<<2) - (iph->ihl<<2); in mtcp_setlastpkt()
1171 (tcph->doff<<2) - (iph->ihl<<2); in mtcp_setlastpkt()
1181 iph = (struct iphdr *)(cur_pkt_ctx->p.ethh + 1); in mtcp_setlastpkt()
1182 iph->check = 0; in mtcp_setlastpkt()
1183 iph->check = ip_fast_csum(iph, iph->ihl); in mtcp_setlastpkt()
1188 iph = (struct iphdr *)(cur_pkt_ctx->p.ethh + 1); in mtcp_setlastpkt()
1189 tcph = (struct tcphdr *)((uint8_t *)iph + (iph->ihl<<2)); in mtcp_setlastpkt()
1192 ntohs(iph->tot_len) - (iph->ihl<<2), in mtcp_setlastpkt()
1193 iph->saddr, iph->daddr); in mtcp_setlastpkt()