Lines Matching refs:iph
81 struct iphdr *iph = data + sizeof(struct ethhdr); in handle_ipv4() local
89 if (iph + 1 > data_end) in handle_ipv4()
92 dport = get_dport(iph + 1, data_end, iph->protocol); in handle_ipv4()
96 vip.protocol = iph->protocol; in handle_ipv4()
98 vip.daddr.v4 = iph->daddr; in handle_ipv4()
100 payload_len = bpf_ntohs(iph->tot_len); in handle_ipv4()
114 iph = data + sizeof(*new_eth); in handle_ipv4()
115 old_eth = data + sizeof(*iph); in handle_ipv4()
119 iph + 1 > data_end) in handle_ipv4()
124 iph->version = 4; in handle_ipv4()
125 iph->ihl = sizeof(*iph) >> 2; in handle_ipv4()
126 iph->frag_off = 0; in handle_ipv4()
127 iph->protocol = IPPROTO_IPIP; in handle_ipv4()
128 iph->check = 0; in handle_ipv4()
129 iph->tos = 0; in handle_ipv4()
130 iph->tot_len = bpf_htons(payload_len + sizeof(*iph)); in handle_ipv4()
131 iph->daddr = tnl->daddr.v4; in handle_ipv4()
132 iph->saddr = tnl->saddr.v4; in handle_ipv4()
133 iph->ttl = 8; in handle_ipv4()
135 next_iph = (__u16 *)iph; in handle_ipv4()
137 for (i = 0; i < sizeof(*iph) >> 1; i++) in handle_ipv4()
140 iph->check = ~((csum & 0xffff) + (csum >> 16)); in handle_ipv4()