Home
last modified time | relevance | path

Searched refs:ip6h (Results 1 – 25 of 33) sorted by relevance

12

/tools/testing/selftests/bpf/progs/
A Dcgroup_skb_sk_lookup_kern.c30 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 Dtest_xdp.c164 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 Dtest_xdp_loop.c160 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 Dtest_xdp_dynptr.c168 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 Ddecap_sanity.c35 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 Dip_check_defrag.c35 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 Dxdp_flowtable.c111 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 Dtest_xdp_noinline.c285 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 Dtest_btf_skc_cls_ingress.c72 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 Dcrypto_sanity.c22 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 Dtest_tc_neigh_fib.c57 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 Dbpf_flow.c327 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 Dtest_assign_reuse.c130 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 Dtest_pkt_access.c124 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 Dxdp_metadata.c41 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 Dxdp_hw_metadata.c31 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 Dtest_sk_lookup_kern.c39 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 Dtest_tc_neigh.c61 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 Dtest_tc_dtime.c143 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 Dtest_l4lb.c238 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 Dtest_l4lb_noinline.c237 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 Dcgroup_tcp_skb.c27 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 Dtest_sk_assign.c81 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 Dskf_net_off.c122 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 Dcsum.c209 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 …]

Completed in 36 milliseconds

12