Lines Matching defs:eth
75 struct ethhdr *eth;
78 err = bpf_xdp_pull_data(ctx, sizeof(*eth));
83 data = eth = (void *)(long)ctx->data;
85 if (data + sizeof(*eth) > data_end)
88 if (eth->h_proto == bpf_htons(ETH_P_IP)) {
91 err = bpf_xdp_pull_data(ctx, sizeof(*eth) + sizeof(*iph) +
99 iph = data + sizeof(*eth);
105 udph = data + sizeof(*iph) + sizeof(*eth);
106 } else if (eth->h_proto == bpf_htons(ETH_P_IPV6)) {
109 err = bpf_xdp_pull_data(ctx, sizeof(*eth) + sizeof(*ipv6h) +
117 ipv6h = data + sizeof(*eth);
123 udph = data + sizeof(*ipv6h) + sizeof(*eth);
167 struct ethhdr *eth = data;
170 __builtin_memcpy(tmp_mac, eth->h_source, ETH_ALEN);
171 __builtin_memcpy(eth->h_source, eth->h_dest, ETH_ALEN);
172 __builtin_memcpy(eth->h_dest, tmp_mac, ETH_ALEN);
179 struct ethhdr *eth;
182 err = bpf_xdp_pull_data(ctx, sizeof(*eth));
187 data = eth = (void *)(long)ctx->data;
189 if (data + sizeof(*eth) > data_end)
192 if (eth->h_proto == bpf_htons(ETH_P_IP)) {
196 err = bpf_xdp_pull_data(ctx, sizeof(*eth) + sizeof(*iph) +
204 iph = data + sizeof(*eth);
210 udph = data + sizeof(*iph) + sizeof(*eth);
218 eth = data;
219 swap_machdr((void *)eth);
229 } else if (eth->h_proto == bpf_htons(ETH_P_IPV6)) {
233 err = bpf_xdp_pull_data(ctx, sizeof(*eth) + sizeof(*ipv6h) +
241 ipv6h = data + sizeof(*eth);
247 udph = data + sizeof(*ipv6h) + sizeof(*eth);
255 eth = data;
256 swap_machdr((void *)eth);
276 struct ethhdr *eth = data;
279 if (data + sizeof(*eth) > data_end)
282 if (eth->h_proto == bpf_htons(ETH_P_IP)) {
283 struct iphdr *iph = data + sizeof(*eth);
291 udph = (void *)eth + sizeof(*iph) + sizeof(*eth);
296 } else if (eth->h_proto == bpf_htons(ETH_P_IPV6)) {
297 struct ipv6hdr *ipv6h = data + sizeof(*eth);
303 udph = (void *)eth + sizeof(*ipv6h) + sizeof(*eth);