Lines Matching refs:iph
84 struct iphdr *iph = data + sizeof(struct ethhdr); in handle_ipv4() local
92 if (iph + 1 > data_end) in handle_ipv4()
95 dport = get_dport(iph + 1, data_end, iph->protocol); in handle_ipv4()
99 vip.protocol = iph->protocol; in handle_ipv4()
101 vip.daddr.v4 = iph->daddr; in handle_ipv4()
103 payload_len = ntohs(iph->tot_len); in handle_ipv4()
119 iph = data + sizeof(*new_eth); in handle_ipv4()
120 old_eth = data + sizeof(*iph); in handle_ipv4()
124 iph + 1 > data_end) in handle_ipv4()
129 iph->version = 4; in handle_ipv4()
130 iph->ihl = sizeof(*iph) >> 2; in handle_ipv4()
131 iph->frag_off = 0; in handle_ipv4()
132 iph->protocol = IPPROTO_IPIP; in handle_ipv4()
133 iph->check = 0; in handle_ipv4()
134 iph->tos = 0; in handle_ipv4()
135 iph->tot_len = htons(payload_len + sizeof(*iph)); in handle_ipv4()
136 iph->daddr = tnl->daddr.v4; in handle_ipv4()
137 iph->saddr = tnl->saddr.v4; in handle_ipv4()
138 iph->ttl = 8; in handle_ipv4()
140 next_iph_u16 = (u16 *)iph; in handle_ipv4()
142 for (i = 0; i < sizeof(*iph) >> 1; i++) in handle_ipv4()
145 iph->check = ~((csum & 0xffff) + (csum >> 16)); in handle_ipv4()