| /tools/testing/selftests/bpf/progs/ |
| A D | cgroup_skb_sk_lookup_kern.c | 30 const struct ipv6hdr *ip6h, in set_tuple() argument 33 set_ip(tuple->ipv6.saddr, &ip6h->daddr); in set_tuple() 34 set_ip(tuple->ipv6.daddr, &ip6h->saddr); in set_tuple() 40 const struct ipv6hdr *ip6h, in is_allowed_peer_cg() argument 48 set_tuple(&tuple, ip6h, tcph); in is_allowed_peer_cg() 69 struct ipv6hdr ip6h; in ingress_lookup() local 79 if (bpf_skb_load_bytes(skb, 0, &ip6h, sizeof(ip6h))) in ingress_lookup() 82 if (ip6h.nexthdr != IPPROTO_TCP) in ingress_lookup() 85 if (bpf_skb_load_bytes(skb, sizeof(ip6h), &tcph, sizeof(tcph))) in ingress_lookup() 94 return is_allowed_peer_cg(skb, &ip6h, &tcph); in ingress_lookup()
|
| A D | test_xdp.c | 164 if (ip6h + 1 > data_end) in handle_ipv6() 167 dport = get_dport(ip6h + 1, data_end, ip6h->nexthdr); in handle_ipv6() 171 vip.protocol = ip6h->nexthdr; in handle_ipv6() 189 ip6h = data + sizeof(*new_eth); in handle_ipv6() 193 ip6h + 1 > data_end) in handle_ipv6() 198 ip6h->version = 6; in handle_ipv6() 199 ip6h->priority = 0; in handle_ipv6() 200 memset(ip6h->flow_lbl, 0, sizeof(ip6h->flow_lbl)); in handle_ipv6() 201 ip6h->payload_len = bpf_htons(bpf_ntohs(payload_len) + sizeof(*ip6h)); in handle_ipv6() 202 ip6h->nexthdr = IPPROTO_IPV6; in handle_ipv6() [all …]
|
| A D | test_xdp_loop.c | 160 if (ip6h + 1 > data_end) in handle_ipv6() 163 dport = get_dport(ip6h + 1, data_end, ip6h->nexthdr); in handle_ipv6() 167 vip.protocol = ip6h->nexthdr; in handle_ipv6() 185 ip6h = data + sizeof(*new_eth); in handle_ipv6() 189 ip6h + 1 > data_end) in handle_ipv6() 194 ip6h->version = 6; in handle_ipv6() 195 ip6h->priority = 0; in handle_ipv6() 196 memset(ip6h->flow_lbl, 0, sizeof(ip6h->flow_lbl)); in handle_ipv6() 197 ip6h->payload_len = bpf_htons(bpf_ntohs(payload_len) + sizeof(*ip6h)); in handle_ipv6() 198 ip6h->nexthdr = IPPROTO_IPV6; in handle_ipv6() [all …]
|
| A D | test_xdp_dynptr.c | 168 struct ipv6hdr *ip6h; in handle_ipv6() local 182 if (!ip6h) in handle_ipv6() 185 dport = get_dport(ip6h + 1, ip6h->nexthdr); in handle_ipv6() 189 vip.protocol = ip6h->nexthdr; in handle_ipv6() 193 payload_len = ip6h->payload_len; in handle_ipv6() 209 old_eth = (struct ethhdr *)(ip6h + 1); in handle_ipv6() 216 ip6h->version = 6; in handle_ipv6() 217 ip6h->priority = 0; in handle_ipv6() 218 memset(ip6h->flow_lbl, 0, sizeof(ip6h->flow_lbl)); in handle_ipv6() 220 ip6h->nexthdr = IPPROTO_IPV6; in handle_ipv6() [all …]
|
| A D | decap_sanity.c | 35 struct ipv6hdr ip6h; in decap_sanity() local 42 if (bpf_skb_load_bytes(skb, ETH_HLEN, &ip6h, sizeof(ip6h))) in decap_sanity() 45 if (ip6h.nexthdr != IPPROTO_UDP) in decap_sanity() 48 if (bpf_skb_load_bytes(skb, ETH_HLEN + sizeof(ip6h), &udph, sizeof(udph))) in decap_sanity() 56 err = bpf_skb_adjust_room(skb, -(s32)(ETH_HLEN + sizeof(ip6h) + sizeof(udph)), in decap_sanity()
|
| A D | ip_check_defrag.c | 35 static bool is_frag_v6(struct ipv6hdr *ip6h) in is_frag_v6() argument 42 return ip6h->nexthdr == NEXTHDR_FRAGMENT; in is_frag_v6() 70 struct ipv6hdr *ip6h; in handle_v6() local 76 ip6h = bpf_dynptr_slice(&ptr, 0, ip6h_buf, sizeof(ip6h_buf)); in handle_v6() 77 if (!ip6h) in handle_v6() 81 if (is_frag_v6(ip6h)) { in handle_v6()
|
| A D | xdp_flowtable.c | 111 struct ipv6hdr *ip6h = data + sizeof(*eth); in xdp_flowtable_do_lookup() local 113 ports = (struct flow_ports___local *)(ip6h + 1); in xdp_flowtable_do_lookup() 117 if (ip6h->hop_limit <= 1) in xdp_flowtable_do_lookup() 121 ip6h->nexthdr)) in xdp_flowtable_do_lookup() 125 tuple.l4_protocol = ip6h->nexthdr; in xdp_flowtable_do_lookup() 126 tuple.tot_len = bpf_ntohs(ip6h->payload_len); in xdp_flowtable_do_lookup() 127 *src = ip6h->saddr; in xdp_flowtable_do_lookup() 128 *dst = ip6h->daddr; in xdp_flowtable_do_lookup()
|
| A D | test_xdp_noinline.c | 285 struct ipv6hdr *ip6h; in encap_v6() local 303 ip6h->version = 6; in encap_v6() 304 ip6h->priority = 0; in encap_v6() 305 memset(ip6h->flow_lbl, 0, sizeof(ip6h->flow_lbl)); in encap_v6() 309 ip6h->payload_len = in encap_v6() 311 ip6h->hop_limit = 4; in encap_v6() 444 ip6h = data + off; in send_icmp6_reply() 449 ip6h->hop_limit = 4; in send_icmp6_reply() 451 memcpy(ip6h->saddr.in6_u.u6_addr32, ip6h->daddr.in6_u.u6_addr32, 16); in send_icmp6_reply() 471 ip6h = data + off; in parse_icmpv6() [all …]
|
| A D | test_btf_skc_cls_ingress.c | 72 struct ipv6hdr *ip6h; in handle_ip_tcp() local 98 ip6h = (struct ipv6hdr *)(eth + 1); in handle_ip_tcp() 99 if (ip6h + 1 > data_end) in handle_ip_tcp() 101 if (ip6h->nexthdr != IPPROTO_TCP) in handle_ip_tcp() 103 th = (struct tcphdr *)(ip6h + 1); in handle_ip_tcp() 110 tuple = (struct bpf_sock_tuple *)&ip6h->saddr; in handle_ip_tcp() 111 iphdr = ip6h; in handle_ip_tcp() 112 iphdr_size = sizeof(*ip6h); in handle_ip_tcp()
|
| A D | crypto_sanity.c | 22 struct ipv6hdr ip6h; in skb_dynptr_validate() local 29 if (bpf_skb_load_bytes(skb, ETH_HLEN, &ip6h, sizeof(ip6h))) in skb_dynptr_validate() 32 if (ip6h.nexthdr != IPPROTO_UDP) in skb_dynptr_validate() 35 if (bpf_skb_load_bytes(skb, ETH_HLEN + sizeof(ip6h), &udph, sizeof(udph))) in skb_dynptr_validate() 41 offset = ETH_HLEN + sizeof(ip6h) + sizeof(udph); in skb_dynptr_validate()
|
| A D | test_tc_neigh_fib.c | 57 struct ipv6hdr *ip6h; in fill_fib_params_v6() local 62 ip6h = (struct ipv6hdr *)(data + sizeof(struct ethhdr)); in fill_fib_params_v6() 63 if ((void *)(ip6h + 1) > data_end) in fill_fib_params_v6() 68 fib_params->l4_protocol = ip6h->nexthdr; in fill_fib_params_v6() 71 fib_params->tot_len = bpf_ntohs(ip6h->payload_len); in fill_fib_params_v6() 72 *src = ip6h->saddr; in fill_fib_params_v6() 73 *dst = ip6h->daddr; in fill_fib_params_v6()
|
| A D | bpf_flow.c | 327 struct ipv6hdr *ip6h, _ip6h; in PROG() local 329 ip6h = bpf_flow_dissect_get_header(skb, sizeof(*ip6h), &_ip6h); in PROG() 330 if (!ip6h) in PROG() 334 memcpy(&keys->ipv6_src, &ip6h->saddr, 2*sizeof(ip6h->saddr)); in PROG() 337 keys->ip_proto = ip6h->nexthdr; in PROG() 338 keys->flow_label = ip6_flowlabel(ip6h); in PROG() 349 struct ipv6_opt_hdr *ip6h, _ip6h; in PROG() local 351 ip6h = bpf_flow_dissect_get_header(skb, sizeof(*ip6h), &_ip6h); in PROG() 352 if (!ip6h) in PROG() 358 keys->thoff += (1 + ip6h->hdrlen) << 3; in PROG() [all …]
|
| A D | test_assign_reuse.c | 130 struct ipv6hdr *ip6h = (struct ipv6hdr *)(data + sizeof(*eth)); in tc_main() local 132 if (ip6h + 1 > data_end) in tc_main() 135 if (ip6h->nexthdr == IPPROTO_TCP) in tc_main() 136 return maybe_assign_tcp(skb, (struct tcphdr *)(ip6h + 1)); in tc_main() 137 else if (ip6h->nexthdr == IPPROTO_UDP) in tc_main() 138 return maybe_assign_udp(skb, (struct udphdr *)(ip6h + 1)); in tc_main()
|
| A D | test_pkt_access.c | 124 struct ipv6hdr *ip6h = (struct ipv6hdr *)(eth + 1); in test_pkt_access() local 126 if (ip6h + 1 > data_end) in test_pkt_access() 128 ihl_len = sizeof(*ip6h); in test_pkt_access() 129 proto = ip6h->nexthdr; in test_pkt_access() 130 tcp = (struct tcphdr *)((void *)(ip6h) + ihl_len); in test_pkt_access()
|
| A D | xdp_metadata.c | 41 struct ipv6hdr *ip6h = NULL; in rx() local 59 ip6h = (void *)(eth + 1); in rx() 60 if (ip6h + 1 < data_end && ip6h->nexthdr == IPPROTO_UDP) in rx() 61 udp = (void *)(ip6h + 1); in rx()
|
| A D | xdp_hw_metadata.c | 31 struct ipv6hdr *ip6h = NULL; in rx() local 56 ip6h = (void *)(eth + 1); in rx() 57 if (ip6h + 1 < data_end && ip6h->nexthdr == IPPROTO_UDP) in rx() 58 udp = (void *)(ip6h + 1); in rx()
|
| A D | test_sk_lookup_kern.c | 39 struct ipv6hdr *ip6h = (struct ipv6hdr *)(data + nh_off); in get_tuple() local 41 if (ip6h + 1 > data_end) in get_tuple() 43 ihl_len = sizeof(*ip6h); in get_tuple() 44 proto = ip6h->nexthdr; in get_tuple() 46 result = (struct bpf_sock_tuple *)&ip6h->saddr; in get_tuple()
|
| A D | test_tc_neigh.c | 61 struct ipv6hdr *ip6h; in is_remote_ep_v6() local 66 ip6h = (struct ipv6hdr *)(data + sizeof(struct ethhdr)); in is_remote_ep_v6() 67 if ((void *)(ip6h + 1) > data_end) in is_remote_ep_v6() 70 return v6_equal(ip6h->daddr, addr); in is_remote_ep_v6()
|
| A D | test_tc_dtime.c | 143 struct ipv6hdr *ip6h; in skb_get_type() local 163 ip6h = data + sizeof(struct ethhdr); in skb_get_type() 164 if (ip6h + 1 > data_end) in skb_get_type() 166 if (v6_equal(ip6h->saddr, (struct in6_addr){{ip6_src}})) in skb_get_type() 168 else if (v6_equal(ip6h->saddr, (struct in6_addr){{ip6_dst}})) in skb_get_type() 170 inet_proto = ip6h->nexthdr; in skb_get_type() 171 trans = ip6h + 1; in skb_get_type()
|
| A D | test_l4lb.c | 238 struct ipv6hdr *ip6h; in parse_icmpv6() local 246 ip6h = data + off; in parse_icmpv6() 247 if (ip6h + 1 > data_end) in parse_icmpv6() 249 pckt->proto = ip6h->nexthdr; in parse_icmpv6() 251 memcpy(pckt->srcv6, ip6h->daddr.s6_addr32, 16); in parse_icmpv6() 252 memcpy(pckt->dstv6, ip6h->saddr.s6_addr32, 16); in parse_icmpv6() 335 struct ipv6hdr *ip6h; in process_packet() local 348 ip6h = data + off; in process_packet() 349 if (ip6h + 1 > data_end) in process_packet() 353 protocol = ip6h->nexthdr; in process_packet() [all …]
|
| A D | test_l4lb_noinline.c | 237 struct ipv6hdr *ip6h; in parse_icmpv6() local 245 ip6h = data + off; in parse_icmpv6() 246 if (ip6h + 1 > data_end) in parse_icmpv6() 248 pckt->proto = ip6h->nexthdr; in parse_icmpv6() 250 memcpy(pckt->srcv6, ip6h->daddr.s6_addr32, 16); in parse_icmpv6() 251 memcpy(pckt->dstv6, ip6h->saddr.s6_addr32, 16); in parse_icmpv6() 334 struct ipv6hdr *ip6h; in process_packet() local 347 ip6h = data + off; in process_packet() 348 if (ip6h + 1 > data_end) in process_packet() 352 protocol = ip6h->nexthdr; in process_packet() [all …]
|
| A D | cgroup_tcp_skb.c | 27 struct ipv6hdr ip6h; in needed_tcp_pkt() local 31 if (bpf_skb_load_bytes(skb, 0, &ip6h, sizeof(ip6h))) in needed_tcp_pkt() 34 if (ip6h.nexthdr != IPPROTO_TCP) in needed_tcp_pkt() 37 if (bpf_skb_load_bytes(skb, sizeof(ip6h), tcph, sizeof(*tcph))) in needed_tcp_pkt()
|
| A D | test_sk_assign.c | 81 struct ipv6hdr *ip6h = (struct ipv6hdr *)(data + sizeof(*eth)); in get_tuple() local 83 if (ip6h + 1 > data_end) in get_tuple() 85 ihl_len = sizeof(*ip6h); in get_tuple() 86 proto = ip6h->nexthdr; in get_tuple() 88 result = (struct bpf_sock_tuple *)&ip6h->saddr; in get_tuple()
|
| /tools/testing/selftests/net/ |
| A D | skf_net_off.c | 122 struct ipv6hdr ip6h = {0}; in tun_write() local 135 ip6h.version = 6; in tun_write() 136 ip6h.payload_len = htons(sizeof(uh) + sizeof(uint32_t)); in tun_write() 137 ip6h.nexthdr = IPPROTO_UDP; in tun_write() 138 ip6h.hop_limit = 8; in tun_write() 139 if (inet_pton(AF_INET6, "fdab::2", &ip6h.saddr) != 1) in tun_write() 141 if (inet_pton(AF_INET6, "fdab::1", &ip6h.daddr) != 1) in tun_write() 146 uh.len = ip6h.payload_len; in tun_write() 155 iov[2].iov_base = &ip6h; in tun_write() 156 iov[2].iov_len = sizeof(ip6h); in tun_write()
|
| /tools/testing/selftests/net/lib/ |
| A D | csum.c | 209 struct ipv6hdr *ip6h = _ip6h; in build_packet_ipv6() local 211 memset(ip6h, 0, sizeof(*ip6h)); in build_packet_ipv6() 213 ip6h->version = 6; in build_packet_ipv6() 214 ip6h->payload_len = htons(len); in build_packet_ipv6() 215 ip6h->nexthdr = proto; in build_packet_ipv6() 216 ip6h->hop_limit = 64; in build_packet_ipv6() 220 iph_addr_p = &ip6h->saddr; in build_packet_ipv6() 222 return ip6h + 1; in build_packet_ipv6() 676 struct ipv6hdr *ip6h = nh; in recv_verify_packet_ipv6() local 680 if (len < sizeof(*ip6h) || ip6h->nexthdr != proto) in recv_verify_packet_ipv6() [all …]
|