Home
last modified time | relevance | path

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

/tools/testing/selftests/bpf/progs/
Dcgroup_skb_sk_lookup_kern.c31 const struct ipv6hdr *ip6h, in set_tuple() argument
34 set_ip(tuple->ipv6.saddr, &ip6h->daddr); in set_tuple()
35 set_ip(tuple->ipv6.daddr, &ip6h->saddr); in set_tuple()
41 const struct ipv6hdr *ip6h, in is_allowed_peer_cg() argument
49 set_tuple(&tuple, ip6h, tcph); in is_allowed_peer_cg()
71 struct ipv6hdr ip6h; in ingress_lookup() local
81 if (bpf_skb_load_bytes(skb, 0, &ip6h, sizeof(ip6h))) in ingress_lookup()
84 if (ip6h.nexthdr != IPPROTO_TCP) in ingress_lookup()
87 if (bpf_skb_load_bytes(skb, sizeof(ip6h), &tcph, sizeof(tcph))) in ingress_lookup()
96 return is_allowed_peer_cg(skb, &ip6h, &tcph); in ingress_lookup()
Dtest_btf_skc_cls_ingress.c27 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 …]
Dtest_xdp_loop.c156 struct ipv6hdr *ip6h = data + sizeof(struct ethhdr); in handle_ipv6() local
161 if (ip6h + 1 > data_end) in handle_ipv6()
164 dport = get_dport(ip6h + 1, data_end, ip6h->nexthdr); in handle_ipv6()
168 vip.protocol = ip6h->nexthdr; in handle_ipv6()
170 memcpy(vip.daddr.v6, ip6h->daddr.s6_addr32, sizeof(vip.daddr)); in handle_ipv6()
172 payload_len = ip6h->payload_len; in handle_ipv6()
186 ip6h = data + sizeof(*new_eth); in handle_ipv6()
187 old_eth = data + sizeof(*ip6h); in handle_ipv6()
190 ip6h + 1 > data_end) in handle_ipv6()
195 ip6h->version = 6; in handle_ipv6()
[all …]
Dtest_xdp.c160 struct ipv6hdr *ip6h = data + sizeof(struct ethhdr); in handle_ipv6() local
165 if (ip6h + 1 > data_end) in handle_ipv6()
168 dport = get_dport(ip6h + 1, data_end, ip6h->nexthdr); in handle_ipv6()
172 vip.protocol = ip6h->nexthdr; in handle_ipv6()
174 memcpy(vip.daddr.v6, ip6h->daddr.s6_addr32, sizeof(vip.daddr)); in handle_ipv6()
176 payload_len = ip6h->payload_len; in handle_ipv6()
190 ip6h = data + sizeof(*new_eth); in handle_ipv6()
191 old_eth = data + sizeof(*ip6h); in handle_ipv6()
194 ip6h + 1 > data_end) in handle_ipv6()
199 ip6h->version = 6; in handle_ipv6()
[all …]
Dtest_xdp_noinline.c284 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 …]
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()
Dbpf_flow.c313 struct ipv6hdr *ip6h, _ip6h; in PROG() local
315 ip6h = bpf_flow_dissect_get_header(skb, sizeof(*ip6h), &_ip6h); in PROG()
316 if (!ip6h) in PROG()
320 memcpy(&keys->ipv6_src, &ip6h->saddr, 2*sizeof(ip6h->saddr)); in PROG()
323 keys->ip_proto = ip6h->nexthdr; in PROG()
324 keys->flow_label = ip6_flowlabel(ip6h); in PROG()
329 return parse_ipv6_proto(skb, ip6h->nexthdr); in PROG()
335 struct ipv6_opt_hdr *ip6h, _ip6h; in PROG() local
337 ip6h = bpf_flow_dissect_get_header(skb, sizeof(*ip6h), &_ip6h); in PROG()
338 if (!ip6h) in PROG()
[all …]
Dtest_pkt_access.c122 struct ipv6hdr *ip6h = (struct ipv6hdr *)(eth + 1); in test_pkt_access() local
124 if (ip6h + 1 > data_end) in test_pkt_access()
126 ihl_len = sizeof(*ip6h); in test_pkt_access()
127 proto = ip6h->nexthdr; in test_pkt_access()
128 tcp = (struct tcphdr *)((void *)(ip6h) + ihl_len); in test_pkt_access()
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()
Dtest_sk_lookup_kern.c40 struct ipv6hdr *ip6h = (struct ipv6hdr *)(data + nh_off); in get_tuple() local
42 if (ip6h + 1 > data_end) in get_tuple()
44 ihl_len = sizeof(*ip6h); in get_tuple()
45 proto = ip6h->nexthdr; in get_tuple()
47 result = (struct bpf_sock_tuple *)&ip6h->saddr; in get_tuple()
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 …]
Dtest_l4lb.c240 struct ipv6hdr *ip6h; in parse_icmpv6() local
248 ip6h = data + off; in parse_icmpv6()
249 if (ip6h + 1 > data_end) in parse_icmpv6()
251 pckt->proto = ip6h->nexthdr; in parse_icmpv6()
253 memcpy(pckt->srcv6, ip6h->daddr.s6_addr32, 16); in parse_icmpv6()
254 memcpy(pckt->dstv6, ip6h->saddr.s6_addr32, 16); in parse_icmpv6()
337 struct ipv6hdr *ip6h; in process_packet() local
350 ip6h = data + off; in process_packet()
351 if (ip6h + 1 > data_end) in process_packet()
355 protocol = ip6h->nexthdr; in process_packet()
[all …]
Dtest_sk_assign.c82 struct ipv6hdr *ip6h = (struct ipv6hdr *)(data + sizeof(*eth)); in get_tuple() local
84 if (ip6h + 1 > data_end) in get_tuple()
86 ihl_len = sizeof(*ip6h); in get_tuple()
87 proto = ip6h->nexthdr; in get_tuple()
89 result = (struct bpf_sock_tuple *)&ip6h->saddr; in get_tuple()
/tools/testing/selftests/bpf/
Dtest_flow_dissector.c183 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/
Dgro.c222 struct ipv6hdr *ip6h = buf; in fill_networklayer() local
226 memset(ip6h, 0, sizeof(*ip6h)); in fill_networklayer()
228 ip6h->version = 6; in fill_networklayer()
229 ip6h->payload_len = htons(sizeof(struct tcphdr) + payload_len); in fill_networklayer()
230 ip6h->nexthdr = IPPROTO_TCP; in fill_networklayer()
231 ip6h->hop_limit = 8; in fill_networklayer()
232 if (inet_pton(AF_INET6, SIP6, &ip6h->saddr) != 1) in fill_networklayer()
234 if (inet_pton(AF_INET6, DIP6, &ip6h->daddr) != 1) in fill_networklayer()
378 struct ipv6hdr *ip6h = (struct ipv6hdr *)(buf + ETH_HLEN); in recompute_packet() local
393 ip6h->payload_len = htons(ntohs(ip6h->payload_len) + extlen); in recompute_packet()
[all …]
Dmsg_zerocopy.c276 static int setup_ip6h(struct ipv6hdr *ip6h, uint16_t payload_len) in setup_ip6h() argument
281 memset(ip6h, 0, sizeof(*ip6h)); in setup_ip6h()
283 ip6h->version = 6; in setup_ip6h()
284 ip6h->payload_len = htons(payload_len); in setup_ip6h()
285 ip6h->nexthdr = IPPROTO_EGP; in setup_ip6h()
286 ip6h->hop_limit = 2; in setup_ip6h()
287 ip6h->saddr = saddr->sin6_addr; in setup_ip6h()
288 ip6h->daddr = daddr->sin6_addr; in setup_ip6h()
290 return sizeof(*ip6h); in setup_ip6h()
488 struct ipv6hdr ip6h; in do_tx() member
[all …]
Dtxtimestamp.c450 struct ipv6hdr *ip6h = p; in fill_header_ipv6() local
452 memset(ip6h, 0, sizeof(*ip6h)); in fill_header_ipv6()
454 ip6h->version = 6; in fill_header_ipv6()
455 ip6h->payload_len = htons(sizeof(struct udphdr) + cfg_payload_len); in fill_header_ipv6()
456 ip6h->nexthdr = IPPROTO_UDP; in fill_header_ipv6()
457 ip6h->hop_limit = 64; in fill_header_ipv6()
459 ip6h->saddr = daddr6.sin6_addr; in fill_header_ipv6()
460 ip6h->daddr = daddr6.sin6_addr; in fill_header_ipv6()
464 return sizeof(*ip6h); in fill_header_ipv6()
Dioam6_parser.c612 struct ipv6hdr *ip6h; in main() local
645 ip6h = (struct ipv6hdr *)buffer; in main()
647 if (!ipv6_addr_equal(&ip6h->saddr, &src) || in main()
648 !ipv6_addr_equal(&ip6h->daddr, &dst)) in main()
651 if (ip6h->nexthdr != IPPROTO_HOPOPTS) in main()
654 p = buffer + sizeof(*ip6h); in main()