/tools/testing/selftests/bpf/progs/ |
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()
|
D | test_btf_skc_cls_ingress.c | 27 static void test_syncookie_helper(struct ipv6hdr *ip6h, struct tcphdr *th, in test_syncookie_helper() argument 47 mss_cookie = bpf_tcp_gen_syncookie(tp, ip6h, sizeof(*ip6h), in test_syncookie_helper() 57 int ret = bpf_tcp_check_syncookie(tp, ip6h, sizeof(*ip6h), in test_syncookie_helper() 69 static int handle_ip6_tcp(struct ipv6hdr *ip6h, struct __sk_buff *skb) in handle_ip6_tcp() argument 79 th = (struct tcphdr *)(ip6h + 1); in handle_ip6_tcp() 88 tuple = (struct bpf_sock_tuple *)&ip6h->saddr; in handle_ip6_tcp() 135 test_syncookie_helper(ip6h, th, tp, skb); in handle_ip6_tcp() 151 struct ipv6hdr *ip6h; in cls_ingress() local 164 ip6h = (struct ipv6hdr *)(eth + 1); in cls_ingress() 165 if (ip6h + 1 > data_end) in cls_ingress() [all …]
|
D | test_xdp.c | 158 struct ipv6hdr *ip6h = data + sizeof(struct ethhdr); in handle_ipv6() local 163 if (ip6h + 1 > data_end) in handle_ipv6() 166 dport = get_dport(ip6h + 1, data_end, ip6h->nexthdr); in handle_ipv6() 170 vip.protocol = ip6h->nexthdr; in handle_ipv6() 172 memcpy(vip.daddr.v6, ip6h->daddr.s6_addr32, sizeof(vip.daddr)); in handle_ipv6() 174 payload_len = ip6h->payload_len; in handle_ipv6() 188 ip6h = data + sizeof(*new_eth); in handle_ipv6() 189 old_eth = data + sizeof(*ip6h); in handle_ipv6() 192 ip6h + 1 > data_end) in handle_ipv6() 197 ip6h->version = 6; in handle_ipv6() [all …]
|
D | test_xdp_loop.c | 154 struct ipv6hdr *ip6h = data + sizeof(struct ethhdr); in handle_ipv6() local 159 if (ip6h + 1 > data_end) in handle_ipv6() 162 dport = get_dport(ip6h + 1, data_end, ip6h->nexthdr); in handle_ipv6() 166 vip.protocol = ip6h->nexthdr; in handle_ipv6() 168 memcpy(vip.daddr.v6, ip6h->daddr.s6_addr32, sizeof(vip.daddr)); in handle_ipv6() 170 payload_len = ip6h->payload_len; in handle_ipv6() 184 ip6h = data + sizeof(*new_eth); in handle_ipv6() 185 old_eth = data + sizeof(*ip6h); in handle_ipv6() 188 ip6h + 1 > data_end) in handle_ipv6() 193 ip6h->version = 6; in handle_ipv6() [all …]
|
D | test_xdp_dynptr.c | 168 struct ipv6hdr *ip6h; in handle_ipv6() local 178 ip6h = bpf_dynptr_slice(xdp_ptr, ethhdr_sz, ip6h_buffer_udp, sizeof(ip6h_buffer_udp)); in handle_ipv6() 180 ip6h = bpf_dynptr_slice(xdp_ptr, ethhdr_sz, ip6h_buffer_tcp, sizeof(ip6h_buffer_tcp)); in handle_ipv6() 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() 191 memcpy(vip.daddr.v6, ip6h->daddr.s6_addr32, sizeof(vip.daddr)); in handle_ipv6() 193 payload_len = ip6h->payload_len; in handle_ipv6() 208 ip6h = (struct ipv6hdr *)(new_eth + 1); in handle_ipv6() 209 old_eth = (struct ethhdr *)(ip6h + 1); in handle_ipv6() [all …]
|
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()
|
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()
|
D | test_xdp_noinline.c | 284 struct ipv6hdr *ip6h; in encap_v6() local 294 ip6h = data + sizeof(struct eth_hdr); in encap_v6() 297 old_eth + 1 > data_end || ip6h + 1 > data_end) in encap_v6() 302 ip6h->version = 6; in encap_v6() 303 ip6h->priority = 0; in encap_v6() 304 memset(ip6h->flow_lbl, 0, sizeof(ip6h->flow_lbl)); in encap_v6() 306 ip6h->nexthdr = IPPROTO_IPV6; in encap_v6() 308 ip6h->payload_len = in encap_v6() 310 ip6h->hop_limit = 4; in encap_v6() 312 ip6h->saddr.in6_u.u6_addr32[0] = 1; in encap_v6() [all …]
|
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()
|
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() 343 return parse_ipv6_proto(skb, ip6h->nexthdr); 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() [all …]
|
D | xdp_hw_metadata.c | 28 struct ipv6hdr *ip6h = NULL; in rx() local 45 ip6h = (void *)(eth + 1); in rx() 46 if (ip6h + 1 < data_end && ip6h->nexthdr == IPPROTO_UDP) in rx() 47 udp = (void *)(ip6h + 1); in rx()
|
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()
|
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()
|
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()
|
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()
|
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 …]
|
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 …]
|
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()
|
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()
|
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()
|
D | test_l4lb_noinline_dynptr.c | 240 struct ipv6hdr *ip6h; in parse_icmpv6() local 249 ip6h = bpf_dynptr_slice(skb_ptr, off, buffer, sizeof(buffer)); in parse_icmpv6() 250 if (!ip6h) in parse_icmpv6() 252 pckt->proto = ip6h->nexthdr; in parse_icmpv6() 254 memcpy(pckt->srcv6, ip6h->daddr.s6_addr32, 16); in parse_icmpv6() 255 memcpy(pckt->dstv6, ip6h->saddr.s6_addr32, 16); in parse_icmpv6() 339 struct ipv6hdr *ip6h; in process_packet() local 354 ip6h = bpf_dynptr_slice(skb_ptr, off, buffer, sizeof(buffer)); in process_packet() 355 if (!ip6h) in process_packet() 359 protocol = ip6h->nexthdr; in process_packet() [all …]
|
D | xdpwall.c | 257 parse_gue_v6(struct pkt_info *info, struct ipv6hdr *ip6h, void *data_end) in parse_gue_v6() argument 259 struct udphdr *udp = (struct udphdr *)(ip6h + 1); in parse_gue_v6() 301 struct ipv6hdr *ip6h = data + sizeof(struct ethhdr); in parse_ipv6_gue() local 303 if (ip6h + 1 > data_end) in parse_ipv6_gue() 306 info->proto = ip6h->nexthdr; in parse_ipv6_gue() 307 info->ip.ipv6 = ip6h; in parse_ipv6_gue() 312 return parse_gue_v6(info, ip6h, data_end); in parse_ipv6_gue()
|
/tools/testing/selftests/bpf/ |
D | test_flow_dissector.c | 183 static void ipv6_set_dsfield(struct ipv6hdr *ip6h, uint8_t dsfield) in ipv6_set_dsfield() argument 185 uint16_t val, *ptr = (uint16_t *)ip6h; in ipv6_set_dsfield() 198 struct ipv6hdr *ip6h = header; in build_ipv6_header() local 200 ip6h->version = 6; in build_ipv6_header() 201 ip6h->payload_len = htons(payload_len); in build_ipv6_header() 202 ip6h->nexthdr = proto; in build_ipv6_header() 203 ip6h->hop_limit = 8; in build_ipv6_header() 204 ipv6_set_dsfield(ip6h, dsfield); in build_ipv6_header() 206 memcpy(&ip6h->saddr, &src->sin6_addr, sizeof(ip6h->saddr)); in build_ipv6_header() 207 memcpy(&ip6h->daddr, &dst->sin6_addr, sizeof(ip6h->daddr)); in build_ipv6_header() [all …]
|
/tools/testing/selftests/net/ |
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() 217 ip6h->saddr = cfg_saddr6.sin6_addr; in build_packet_ipv6() 218 ip6h->daddr = cfg_daddr6.sin6_addr; in build_packet_ipv6() 220 iph_addr_p = &ip6h->saddr; in build_packet_ipv6() 222 return ip6h + 1; in build_packet_ipv6() [all …]
|
D | gro.c | 223 struct ipv6hdr *ip6h = buf; in fill_networklayer() local 227 memset(ip6h, 0, sizeof(*ip6h)); in fill_networklayer() 229 ip6h->version = 6; in fill_networklayer() 230 ip6h->payload_len = htons(sizeof(struct tcphdr) + payload_len); in fill_networklayer() 231 ip6h->nexthdr = IPPROTO_TCP; in fill_networklayer() 232 ip6h->hop_limit = 8; in fill_networklayer() 233 if (inet_pton(AF_INET6, addr6_src, &ip6h->saddr) != 1) in fill_networklayer() 235 if (inet_pton(AF_INET6, addr6_dst, &ip6h->daddr) != 1) in fill_networklayer() 379 struct ipv6hdr *ip6h = (struct ipv6hdr *)(buf + ETH_HLEN); in recompute_packet() local 394 ip6h->payload_len = htons(ntohs(ip6h->payload_len) + extlen); in recompute_packet() [all …]
|