Home
last modified time | relevance | path

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

/tools/testing/selftests/bpf/progs/
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_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_pkt_access.c42 struct ipv6hdr *ip6h = (struct ipv6hdr *)(eth + 1); in process() local
44 if (ip6h + 1 > data_end) in process()
46 ihl_len = sizeof(*ip6h); in process()
47 proto = ip6h->nexthdr; in process()
48 tcp = (struct tcphdr *)((void *)(ip6h) + ihl_len); in process()
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 …]
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_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.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_l4lb_noinline.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 …]
/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/
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 …]
/tools/testing/selftests/networking/timestamping/
Dtxtimestamp.c355 struct ipv6hdr *ip6h = p; in fill_header_ipv6() local
357 memset(ip6h, 0, sizeof(*ip6h)); in fill_header_ipv6()
359 ip6h->version = 6; in fill_header_ipv6()
360 ip6h->payload_len = htons(sizeof(struct udphdr) + cfg_payload_len); in fill_header_ipv6()
361 ip6h->nexthdr = IPPROTO_UDP; in fill_header_ipv6()
362 ip6h->hop_limit = 64; in fill_header_ipv6()
364 ip6h->saddr = daddr6.sin6_addr; in fill_header_ipv6()
365 ip6h->daddr = daddr6.sin6_addr; in fill_header_ipv6()
369 return sizeof(*ip6h); in fill_header_ipv6()