Lines Matching refs:iph
86 struct iphdr *iph; in handle_ipv4() local
99 iph = bpf_dynptr_slice(xdp_ptr, ethhdr_sz, iph_buffer_udp, sizeof(iph_buffer_udp)); in handle_ipv4()
101 iph = bpf_dynptr_slice(xdp_ptr, ethhdr_sz, iph_buffer_tcp, sizeof(iph_buffer_tcp)); in handle_ipv4()
103 if (!iph) in handle_ipv4()
106 dport = get_dport(iph + 1, iph->protocol); in handle_ipv4()
110 vip.protocol = iph->protocol; in handle_ipv4()
112 vip.daddr.v4 = iph->daddr; in handle_ipv4()
114 payload_len = bpf_ntohs(iph->tot_len); in handle_ipv4()
129 iph = (struct iphdr *)(new_eth + 1); in handle_ipv4()
130 old_eth = (struct ethhdr *)(iph + 1); in handle_ipv4()
137 iph->version = 4; in handle_ipv4()
138 iph->ihl = iphdr_sz >> 2; in handle_ipv4()
139 iph->frag_off = 0; in handle_ipv4()
140 iph->protocol = IPPROTO_IPIP; in handle_ipv4()
141 iph->check = 0; in handle_ipv4()
142 iph->tos = 0; in handle_ipv4()
143 iph->tot_len = bpf_htons(payload_len + iphdr_sz); in handle_ipv4()
144 iph->daddr = tnl->daddr.v4; in handle_ipv4()
145 iph->saddr = tnl->saddr.v4; in handle_ipv4()
146 iph->ttl = 8; in handle_ipv4()
148 next_iph = (__u16 *)iph; in handle_ipv4()
152 iph->check = ~((csum & 0xffff) + (csum >> 16)); in handle_ipv4()