| /tools/testing/selftests/bpf/progs/ |
| A D | xdp_hw_metadata.c | 35 struct ethhdr *eth; in rx() local 40 eth = data; in rx() 42 if (eth + 1 < data_end && (eth->h_proto == bpf_htons(ETH_P_8021AD) || in rx() 44 eth = (void *)eth + sizeof(struct vlan_hdr); in rx() 46 if (eth + 1 < data_end && eth->h_proto == bpf_htons(ETH_P_8021Q)) in rx() 47 eth = (void *)eth + sizeof(struct vlan_hdr); in rx() 49 if (eth + 1 < data_end) { in rx() 50 if (eth->h_proto == bpf_htons(ETH_P_IP)) { in rx() 51 iph = (void *)(eth + 1); in rx() 55 if (eth->h_proto == bpf_htons(ETH_P_IPV6)) { in rx() [all …]
|
| A D | test_tc_link.c | 36 struct ethhdr eth = {}; in tc1() local 40 if (bpf_skb_load_bytes(skb, 0, ð, sizeof(eth))) in tc1() 42 seen_eth = eth.h_proto == bpf_htons(ETH_P_IP); in tc1() 45 eth.h_dest[0] = 4; in tc1() 46 if (bpf_skb_store_bytes(skb, 0, ð, sizeof(eth), 0)) in tc1() 94 struct ethhdr eth = {}; in tc7() local 98 if (bpf_skb_load_bytes(skb, 0, ð, sizeof(eth))) in tc7() 100 if (eth.h_dest[0] == 4 && set_type) { in tc7()
|
| A D | xdping_kern.c | 64 struct ethhdr *eth = data; in icmp_check() local 68 if (data + sizeof(*eth) + sizeof(*iph) + ICMP_ECHO_LEN > data_end) in icmp_check() 71 if (eth->h_proto != bpf_htons(ETH_P_IP)) in icmp_check() 74 iph = data + sizeof(*eth); in icmp_check() 82 icmph = data + sizeof(*eth) + sizeof(*iph); in icmp_check() 95 struct ethhdr *eth = data; in xdping_client() local 109 iph = data + sizeof(*eth); in xdping_client() 110 icmph = data + sizeof(*eth) + sizeof(*iph); in xdping_client() 157 struct ethhdr *eth = data; in xdping_server() local 168 iph = data + sizeof(*eth); in xdping_server() [all …]
|
| A D | xdp_redirect_map.c | 45 struct ethhdr *eth = data; in xdp_count() local 48 if (data + sizeof(*eth) > data_end) in xdp_count() 51 if (bpf_htons(eth->h_proto) == ETH_P_IP) { in xdp_count() 90 struct ethhdr *eth = data; in store_mac() local 94 if (data + sizeof(*eth) > data_end) in store_mac() 98 if (eth->h_proto == bpf_htons(ETH_P_IP)) { in store_mac() 99 __builtin_memcpy(&mac, eth->h_source, ETH_ALEN); in store_mac()
|
| A D | test_btf_skc_cls_ingress.c | 66 static int handle_ip_tcp(struct ethhdr *eth, struct __sk_buff *skb) in handle_ip_tcp() argument 79 switch (eth->h_proto) { in handle_ip_tcp() 81 ip4h = (struct iphdr *)(eth + 1); in handle_ip_tcp() 98 ip6h = (struct ipv6hdr *)(eth + 1); in handle_ip_tcp() 180 struct ethhdr *eth; in cls_ingress() local 185 eth = (struct ethhdr *)(long)(skb->data); in cls_ingress() 186 if (eth + 1 > data_end) in cls_ingress() 189 if (eth->h_proto != bpf_htons(ETH_P_IP) && in cls_ingress() 190 eth->h_proto != bpf_htons(ETH_P_IPV6)) in cls_ingress() 193 return handle_ip_tcp(eth, skb); in cls_ingress()
|
| A D | xdp_metadata.c | 42 struct ethhdr *eth = NULL; in rx() local 51 eth = data; in rx() 52 if (eth + 1 < data_end) { in rx() 53 if (eth->h_proto == bpf_htons(ETH_P_IP)) { in rx() 54 iph = (void *)(eth + 1); in rx() 58 if (eth->h_proto == bpf_htons(ETH_P_IPV6)) { in rx() 59 ip6h = (void *)(eth + 1); in rx()
|
| A D | xdp_redirect_multi_kern.c | 51 struct ethhdr *eth = data; in xdp_redirect_map_multi_prog() local 57 nh_off = sizeof(*eth); in xdp_redirect_map_multi_prog() 61 h_proto = bpf_htons(eth->h_proto); in xdp_redirect_map_multi_prog() 96 struct ethhdr *eth = data; in xdp_devmap_prog() local 100 nh_off = sizeof(*eth); in xdp_devmap_prog() 106 __builtin_memcpy(eth->h_source, mac, ETH_ALEN); in xdp_devmap_prog()
|
| A D | test_pkt_access.c | 107 struct ethhdr *eth = (struct ethhdr *)(data); in test_pkt_access() local 112 if (eth + 1 > data_end) in test_pkt_access() 115 if (eth->h_proto == bpf_htons(ETH_P_IP)) { in test_pkt_access() 116 struct iphdr *iph = (struct iphdr *)(eth + 1); in test_pkt_access() 123 } else if (eth->h_proto == bpf_htons(ETH_P_IPV6)) { in test_pkt_access() 124 struct ipv6hdr *ip6h = (struct ipv6hdr *)(eth + 1); in test_pkt_access()
|
| A D | test_migrate_reuseport.c | 49 struct ethhdr *eth = data; in drop_ack() local 52 if (eth + 1 > data_end) in drop_ack() 55 switch (bpf_ntohs(eth->h_proto)) { in drop_ack() 57 struct iphdr *ip = (struct iphdr *)(eth + 1); in drop_ack() 69 struct ipv6hdr *ipv6 = (struct ipv6hdr *)(eth + 1); in drop_ack()
|
| A D | vrf_socket_lookup.c | 20 struct ethhdr *eth = data; in socket_lookup() local 26 if (eth + 1 > data_end) in socket_lookup() 29 if (eth->h_proto != bpf_htons(ETH_P_IP)) in socket_lookup() 32 iph = (struct iphdr *)(eth + 1); in socket_lookup()
|
| A D | load_bytes_relative.c | 23 struct ethhdr eth; in load_bytes_relative() local 30 if (bpf_skb_load_bytes_relative(skb, 0, ð, sizeof(eth), in load_bytes_relative()
|
| A D | test_assign_reuse.c | 111 struct ethhdr *eth; in tc_main() local 113 eth = (struct ethhdr *)(data); in tc_main() 114 if (eth + 1 > data_end) in tc_main() 117 if (eth->h_proto == bpf_htons(ETH_P_IP)) { in tc_main() 118 struct iphdr *iph = (struct iphdr *)(data + sizeof(*eth)); in tc_main() 130 struct ipv6hdr *ip6h = (struct ipv6hdr *)(data + sizeof(*eth)); in tc_main()
|
| A D | test_sk_assign.c | 60 struct ethhdr *eth; in get_tuple() local 64 eth = (struct ethhdr *)(data); in get_tuple() 65 if (eth + 1 > data_end) in get_tuple() 68 if (eth->h_proto == bpf_htons(ETH_P_IP)) { in get_tuple() 69 struct iphdr *iph = (struct iphdr *)(data + sizeof(*eth)); in get_tuple() 80 } else if (eth->h_proto == bpf_htons(ETH_P_IPV6)) { in get_tuple() 81 struct ipv6hdr *ip6h = (struct ipv6hdr *)(data + sizeof(*eth)); in get_tuple()
|
| A D | test_xdp_vlan.c | 57 bool parse_eth_frame(struct ethhdr *eth, void *data_end, struct parse_pkt *pkt) in parse_eth_frame() argument 62 offset = sizeof(*eth); in parse_eth_frame() 64 if ((void *)eth + offset + (2*sizeof(struct _vlan_hdr)) > data_end) in parse_eth_frame() 67 eth_type = eth->h_proto; in parse_eth_frame() 74 vlan_hdr = (void *)eth + offset; in parse_eth_frame() 87 vlan_hdr = (void *)eth + offset; in parse_eth_frame()
|
| A D | test_queue_stack_map.h | 32 struct ethhdr *eth = (struct ethhdr *)(data); in _test() local 36 if (eth + 1 > data_end) in _test() 39 struct iphdr *iph = (struct iphdr *)(eth + 1); in _test()
|
| A D | skb_pkt_end.c | 18 struct ethhdr *eth; in get_iphdr() local 23 eth = (void *)(long)skb->data; in get_iphdr() 24 ip = (void *)(eth + 1); in get_iphdr()
|
| A D | xdp_flowtable.c | 75 struct ethhdr *eth = data; in xdp_flowtable_do_lookup() local 79 if (eth + 1 > data_end) in xdp_flowtable_do_lookup() 82 switch (eth->h_proto) { in xdp_flowtable_do_lookup() 84 struct iphdr *iph = data + sizeof(*eth); in xdp_flowtable_do_lookup() 111 struct ipv6hdr *ip6h = data + sizeof(*eth); in xdp_flowtable_do_lookup()
|
| A D | test_xdp_meta.c | 47 struct ethhdr *eth; in ing_xdp() local 58 eth = (struct ethhdr *)data; in ing_xdp() 69 if (eth->h_proto != 0) in ing_xdp()
|
| A D | xdp_synproxy_kern.c | 368 struct ethhdr *eth; member 378 hdr->eth = data; in tcp_dissect() 379 if (hdr->eth + 1 > data_end) in tcp_dissect() 386 hdr->ipv4 = (void *)hdr->eth + sizeof(*hdr->eth); in tcp_dissect() 402 hdr->ipv6 = (void *)hdr->eth + sizeof(*hdr->eth); in tcp_dissect() 544 swap_eth_addr(hdr->eth->h_source, hdr->eth->h_dest); in tcpv4_gen_synack() 567 swap_eth_addr(hdr->eth->h_source, hdr->eth->h_dest); in tcpv6_gen_synack() 791 hdr->eth = data; in syncookie_part2() 792 hdr->ipv4 = (void *)hdr->eth + sizeof(*hdr->eth); in syncookie_part2() 800 hdr->eth = data; in syncookie_part2() [all …]
|
| /tools/testing/selftests/net/lib/ |
| A D | xdp_native.bpf.c | 74 struct ethhdr *eth = data; in filter_udphdr() local 86 udph = (void *)eth + sizeof(*iph) + 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 142 __builtin_memcpy(eth->h_source, eth->h_dest, ETH_ALEN); in swap_machdr() 151 struct ethhdr *eth = data; in xdp_mode_tx_handler() local 172 swap_machdr((void *)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 232 udph = (void *)eth + sizeof(*iph) + sizeof(*eth); in update_pkt() [all …]
|
| /tools/testing/selftests/drivers/net/dsa/ |
| A D | test_bridge_fdb_stress.sh | 32 eth=${NETIFS[p1]} 35 ip link add br0 type bridge && ip link set $eth master br0 38 bridge fdb add 00:01:02:03:04:05 dev $eth master static 39 bridge fdb del 00:01:02:03:04:05 dev $eth master static
|
| /tools/testing/selftests/net/ |
| A D | nat6to4.bpf.c | 54 const struct ethhdr * const eth = data; // used iff is_ethernet in sched_cls_ingress6_nat_6_prog() local 55 const struct ipv6hdr * const ip6 = (void *)(eth + 1); in sched_cls_ingress6_nat_6_prog() 70 if (eth->h_proto != bpf_htons(ETH_P_IPV6)) in sched_cls_ingress6_nat_6_prog() 91 eth2 = *eth; // Copy over the ethernet header (src/dst mac) in sched_cls_ingress6_nat_6_prog() 155 const struct ethhdr *const eth = data; // used iff is_ethernet in sched_cls_egress4_snat4_prog() local 156 const struct iphdr *const ip4 = (void *)(eth + 1); in sched_cls_egress4_snat4_prog() 167 if (eth->h_proto != bpf_htons(ETH_P_IP)) in sched_cls_egress4_snat4_prog() 226 eth2 = *eth; // Copy over the ethernet header (src/dst mac) in sched_cls_egress4_snat4_prog()
|
| A D | skf_net_off.c | 124 struct ethhdr eth = {0}; in tun_write() local 131 memcpy(eth.h_source, eth_src, sizeof(eth_src)); in tun_write() 132 memcpy(eth.h_dest, eth_dst, sizeof(eth_dst)); in tun_write() 133 eth.h_proto = htons(ETH_P_IPV6); in tun_write() 153 iov[1].iov_base = ð in tun_write() 154 iov[1].iov_len = sizeof(eth); in tun_write()
|
| /tools/testing/selftests/bpf/prog_tests/ |
| A D | flow_dissector.c | 19 struct ethhdr eth; member 25 struct ethhdr eth; member 32 struct ethhdr eth; member 40 struct ethhdr eth; member 46 struct ethhdr eth; member 58 struct ethhdr eth; member 73 struct ethhdr eth; member 102 .eth.h_proto = __bpf_constant_htons(ETH_P_IP), 124 .eth.h_proto = __bpf_constant_htons(ETH_P_IPV6), 192 .eth.h_proto = __bpf_constant_htons(ETH_P_IP), [all …]
|
| A D | xdp_context_test_run.c | 131 struct ethhdr eth = { 0 }; in send_test_packet() local 133 memcpy(packet, ð, sizeof(eth)); in send_test_packet() 134 memcpy(packet + sizeof(eth), test_payload, TEST_PAYLOAD_LEN); in send_test_packet() 307 struct ethhdr eth = { 0 }; in test_xdp_context_tuntap() local 309 memcpy(packet, ð, sizeof(eth)); in test_xdp_context_tuntap() 310 memcpy(packet + sizeof(eth), test_payload, TEST_PAYLOAD_LEN); in test_xdp_context_tuntap()
|