/tools/testing/selftests/bpf/progs/ |
D | test_pkt_access.c | 25 struct ethhdr *eth = (struct ethhdr *)(data); in process() local 30 if (eth + 1 > data_end) in process() 33 if (eth->h_proto == bpf_htons(ETH_P_IP)) { in process() 34 struct iphdr *iph = (struct iphdr *)(eth + 1); in process() 41 } else if (eth->h_proto == bpf_htons(ETH_P_IPV6)) { in process() 42 struct ipv6hdr *ip6h = (struct ipv6hdr *)(eth + 1); in process()
|
D | xdping_kern.c | 63 struct ethhdr *eth = data; in icmp_check() local 67 if (data + sizeof(*eth) + sizeof(*iph) + ICMP_ECHO_LEN > data_end) in icmp_check() 70 if (eth->h_proto != bpf_htons(ETH_P_IP)) in icmp_check() 73 iph = data + sizeof(*eth); in icmp_check() 81 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() 158 struct ethhdr *eth = data; in xdping_server() local 169 iph = data + sizeof(*eth); in xdping_server() [all …]
|
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()
|
D | test_sk_lookup_kern.c | 61 struct ethhdr *eth = (struct ethhdr *)(data); in bpf_sk_lookup_test0() local 67 if (eth + 1 > data_end) in bpf_sk_lookup_test0() 70 tuple = get_tuple(data, sizeof(*eth), data_end, eth->h_proto, &ipv4); in bpf_sk_lookup_test0()
|
D | bpf_flow.c | 157 struct ethhdr *eth, _eth; in parse_ip_proto() local 201 eth = bpf_flow_dissect_get_header(skb, sizeof(*eth), in parse_ip_proto() 203 if (!eth) in parse_ip_proto() 206 keys->thoff += sizeof(*eth); in parse_ip_proto() 208 return parse_eth_proto(skb, eth->h_proto); in parse_ip_proto()
|
D | test_tc_tunnel.c | 205 struct ethhdr eth; in encap_ipv4() local 207 if (bpf_skb_load_bytes(skb, 0, ð, sizeof(eth)) < 0) in encap_ipv4() 209 eth.h_proto = bpf_htons(ETH_P_IP); in encap_ipv4() 210 if (bpf_skb_store_bytes(skb, 0, ð, sizeof(eth), 0) < 0) in encap_ipv4()
|
D | test_xdp.c | 218 struct ethhdr *eth = data; in _xdp_tx_iptunnel() local 221 if (eth + 1 > data_end) in _xdp_tx_iptunnel() 224 h_proto = eth->h_proto; in _xdp_tx_iptunnel()
|
D | test_xdp_loop.c | 214 struct ethhdr *eth = data; in _xdp_tx_iptunnel() local 217 if (eth + 1 > data_end) in _xdp_tx_iptunnel() 220 h_proto = eth->h_proto; in _xdp_tx_iptunnel()
|
D | test_xdp_noinline.c | 417 struct eth_hdr *eth; in swap_mac_and_send() local 419 eth = data; in swap_mac_and_send() 420 memcpy(tmp_mac, eth->eth_source, 6); in swap_mac_and_send() 421 memcpy(eth->eth_source, eth->eth_dest, 6); in swap_mac_and_send() 422 memcpy(eth->eth_dest, tmp_mac, 6); in swap_mac_and_send() 699 struct eth_hdr *eth = data; in process_packet() local 805 struct eth_hdr *eth = data; in balancer_ingress() local 812 eth_proto = bpf_ntohs(eth->eth_proto); in balancer_ingress()
|
D | test_l4lb.c | 329 struct eth_hdr *eth = pkt_start; in process_packet() local 449 *(u32 *)eth->eth_dest = tkey.remote_ipv4; in process_packet() 458 struct eth_hdr *eth = data; in balancer_ingress() local 465 eth_proto = eth->eth_proto; in balancer_ingress()
|
D | test_l4lb_noinline.c | 329 struct eth_hdr *eth = pkt_start; in process_packet() local 449 *(u32 *)eth->eth_dest = tkey.remote_ipv4; in process_packet() 458 struct eth_hdr *eth = data; in balancer_ingress() local 465 eth_proto = eth->eth_proto; in balancer_ingress()
|
/tools/testing/selftests/bpf/prog_tests/ |
D | flow_dissector.c | 39 struct ethhdr eth; member 45 struct ethhdr eth; member 52 struct ethhdr eth; member 60 struct ethhdr eth; member 66 struct ethhdr eth; member 78 struct ethhdr eth; member 107 .eth.h_proto = __bpf_constant_htons(ETH_P_IP), 128 .eth.h_proto = __bpf_constant_htons(ETH_P_IPV6), 148 .eth.h_proto = __bpf_constant_htons(ETH_P_8021Q), 170 .eth.h_proto = __bpf_constant_htons(ETH_P_8021AD), [all …]
|
/tools/testing/selftests/bpf/ |
D | test_queue_stack_map.h | 34 struct ethhdr *eth = (struct ethhdr *)(data); in _test() local 38 if (eth + 1 > data_end) in _test() 41 struct iphdr *iph = (struct iphdr *)(eth + 1); in _test()
|
D | test_progs.h | 81 struct ethhdr eth; member 89 struct ethhdr eth; member
|
D | test_progs.c | 168 .eth.h_proto = __bpf_constant_htons(ETH_P_IP), 177 .eth.h_proto = __bpf_constant_htons(ETH_P_IPV6),
|
D | test_tc_tunnel.sh | 108 for mac in none mpls eth ; do
|
/tools/testing/selftests/net/ |
D | txring_overwrite.c | 44 struct ethhdr *eth; in build_packet() local 50 eth = buffer; in build_packet() 51 eth->h_proto = htons(ETH_P_IP); in build_packet() 53 off += sizeof(*eth); in build_packet()
|
D | psock_tpacket.c | 126 struct ethhdr *eth = pay; in test_payload() local 134 if (eth->h_proto != htons(ETH_P_IP)) { in test_payload() 136 "type: 0x%x!\n", ntohs(eth->h_proto)); in test_payload() 144 struct ethhdr *eth = pay; in create_payload() local 145 struct iphdr *ip = pay + sizeof(*eth); in create_payload() 154 eth->h_proto = htons(ETH_P_IP); in create_payload() 157 ((uint8_t *) pay)[i + sizeof(*eth)] = (uint8_t) rand(); in create_payload() 164 ip->tot_len = htons((uint16_t) *len - sizeof(*eth)); in create_payload() 169 memset(pay + sizeof(*eth) + sizeof(*ip), in create_payload()
|
D | fib_nexthop_multiprefix.sh | 113 ip -netns h${i} li set r1h${i} netns r1 name eth${i} up 117 ip -netns r1 addr add dev eth${i} 172.16.10${i}.254/24 118 ip -netns r1 -6 addr add dev eth${i} 2001:db8:10${i}::64/64 159 run_cmd ip -netns r1 li set eth${hostid} mtu ${mtu}
|
D | psock_snd.c | 103 struct ethhdr *eth = header; in build_eth_header() local 108 eth->h_proto = htons(ETH_P_8021Q); in build_eth_header() 113 eth->h_proto = htons(ETH_P_IP); in build_eth_header()
|
D | msg_zerocopy.c | 487 struct ethhdr eth; in do_tx() local 502 memset(eth.h_dest, 0x06, ETH_ALEN); in do_tx() 503 memset(eth.h_source, 0x02, ETH_ALEN); in do_tx() 504 eth.h_proto = htons(proto); in do_tx() 505 iov[0].iov_base = ð in do_tx() 506 iov[0].iov_len = sizeof(eth); in do_tx()
|