Lines Matching refs:iph
85 struct iphdr *iph = data + sizeof(struct ethhdr); in handle_ipv4() local
93 if (iph + 1 > data_end) in handle_ipv4()
96 dport = get_dport(iph + 1, data_end, iph->protocol); in handle_ipv4()
100 vip.protocol = iph->protocol; in handle_ipv4()
102 vip.daddr.v4 = iph->daddr; in handle_ipv4()
104 payload_len = bpf_ntohs(iph->tot_len); in handle_ipv4()
118 iph = data + sizeof(*new_eth); in handle_ipv4()
119 old_eth = data + sizeof(*iph); in handle_ipv4()
123 iph + 1 > data_end) in handle_ipv4()
128 iph->version = 4; in handle_ipv4()
129 iph->ihl = sizeof(*iph) >> 2; in handle_ipv4()
130 iph->frag_off = 0; in handle_ipv4()
131 iph->protocol = IPPROTO_IPIP; in handle_ipv4()
132 iph->check = 0; in handle_ipv4()
133 iph->tos = 0; in handle_ipv4()
134 iph->tot_len = bpf_htons(payload_len + sizeof(*iph)); in handle_ipv4()
135 iph->daddr = tnl->daddr.v4; in handle_ipv4()
136 iph->saddr = tnl->saddr.v4; in handle_ipv4()
137 iph->ttl = 8; in handle_ipv4()
139 next_iph = (__u16 *)iph; in handle_ipv4()
141 for (i = 0; i < sizeof(*iph) >> 1; i++) in handle_ipv4()
144 iph->check = ~((csum & 0xffff) + (csum >> 16)); in handle_ipv4()