Lines Matching refs:eth

74 	struct ethhdr *eth = data;  in filter_udphdr()  local
76 if (data + sizeof(*eth) > data_end) in filter_udphdr()
79 if (eth->h_proto == bpf_htons(ETH_P_IP)) { in filter_udphdr()
80 struct iphdr *iph = data + sizeof(*eth); in filter_udphdr()
86 udph = (void *)eth + sizeof(*iph) + sizeof(*eth); in filter_udphdr()
87 } else if (eth->h_proto == bpf_htons(ETH_P_IPV6)) { in filter_udphdr()
88 struct ipv6hdr *ipv6h = data + sizeof(*eth); in filter_udphdr()
94 udph = (void *)eth + sizeof(*ipv6h) + sizeof(*eth); in filter_udphdr()
138 struct ethhdr *eth = data; in swap_machdr() local
141 __builtin_memcpy(tmp_mac, eth->h_source, ETH_ALEN); in swap_machdr()
142 __builtin_memcpy(eth->h_source, eth->h_dest, ETH_ALEN); in swap_machdr()
143 __builtin_memcpy(eth->h_dest, tmp_mac, ETH_ALEN); in swap_machdr()
151 struct ethhdr *eth = data; in xdp_mode_tx_handler() local
153 if (data + sizeof(*eth) > data_end) in xdp_mode_tx_handler()
156 if (eth->h_proto == bpf_htons(ETH_P_IP)) { in xdp_mode_tx_handler()
157 struct iphdr *iph = data + sizeof(*eth); in xdp_mode_tx_handler()
164 udph = data + sizeof(*iph) + sizeof(*eth); in xdp_mode_tx_handler()
172 swap_machdr((void *)eth); in xdp_mode_tx_handler()
181 } else if (eth->h_proto == bpf_htons(ETH_P_IPV6)) { in xdp_mode_tx_handler()
182 struct ipv6hdr *ipv6h = data + sizeof(*eth); in xdp_mode_tx_handler()
189 udph = data + sizeof(*ipv6h) + sizeof(*eth); in xdp_mode_tx_handler()
197 swap_machdr((void *)eth); in xdp_mode_tx_handler()
217 struct ethhdr *eth = data; in update_pkt() local
220 if (data + sizeof(*eth) > data_end) in update_pkt()
223 if (eth->h_proto == bpf_htons(ETH_P_IP)) { in update_pkt()
224 struct iphdr *iph = data + sizeof(*eth); in update_pkt()
232 udph = (void *)eth + sizeof(*iph) + sizeof(*eth); in update_pkt()
237 } else if (eth->h_proto == bpf_htons(ETH_P_IPV6)) { in update_pkt()
238 struct ipv6hdr *ipv6h = data + sizeof(*eth); in update_pkt()
244 udph = (void *)eth + sizeof(*ipv6h) + sizeof(*eth); in update_pkt()