Home
last modified time | relevance | path

Searched refs:tuple (Results 1 – 21 of 21) sorted by relevance

/tools/testing/selftests/bpf/progs/
A Dtest_sk_lookup_kern.c61 struct bpf_sock_tuple *tuple; in sk_lookup_success() local
70 if (!tuple || tuple + sizeof *tuple > data_end) in sk_lookup_success()
73 tuple_len = ipv4 ? sizeof(tuple->ipv4) : sizeof(tuple->ipv6); in sk_lookup_success()
87 sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0); in sk_lookup_success_simple()
100 sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0); in err_use_after_free()
114 sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0); in err_modify_sk_pointer()
128 sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0); in err_modify_sk_or_null_pointer()
140 bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0); in err_no_release()
150 sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0); in err_release_twice()
162 sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0); in err_release_unchecked()
[all …]
A Dconnect6_prog.c30 struct bpf_sock_tuple tuple = {}; in connect_v6_prog() local
35 memset(&tuple.ipv6.saddr, 0, sizeof(tuple.ipv6.saddr)); in connect_v6_prog()
36 memset(&tuple.ipv6.sport, 0, sizeof(tuple.ipv6.sport)); in connect_v6_prog()
38 tuple.ipv6.daddr[0] = bpf_htonl(DST_REWRITE_IP6_0); in connect_v6_prog()
43 tuple.ipv6.dport = bpf_htons(DST_REWRITE_PORT6); in connect_v6_prog()
48 sk = bpf_sk_lookup_tcp(ctx, &tuple, sizeof(tuple.ipv6), in connect_v6_prog()
51 sk = bpf_sk_lookup_udp(ctx, &tuple, sizeof(tuple.ipv6), in connect_v6_prog()
57 if (sk->src_ip6[0] != tuple.ipv6.daddr[0] || in connect_v6_prog()
58 sk->src_ip6[1] != tuple.ipv6.daddr[1] || in connect_v6_prog()
59 sk->src_ip6[2] != tuple.ipv6.daddr[2] || in connect_v6_prog()
[all …]
A Dxdp_flowtable.c71 struct bpf_fib_lookup tuple = { in xdp_flowtable_do_lookup() local
98 tuple.family = AF_INET; in xdp_flowtable_do_lookup()
99 tuple.tos = iph->tos; in xdp_flowtable_do_lookup()
100 tuple.l4_protocol = iph->protocol; in xdp_flowtable_do_lookup()
102 tuple.ipv4_src = iph->saddr; in xdp_flowtable_do_lookup()
103 tuple.ipv4_dst = iph->daddr; in xdp_flowtable_do_lookup()
104 tuple.sport = ports->source; in xdp_flowtable_do_lookup()
105 tuple.dport = ports->dest; in xdp_flowtable_do_lookup()
124 tuple.family = AF_INET6; in xdp_flowtable_do_lookup()
129 tuple.sport = ports->source; in xdp_flowtable_do_lookup()
[all …]
A Dtest_sk_assign.c110 tuple_len = ipv4 ? sizeof(tuple->ipv4) : sizeof(tuple->ipv6); in handle_udp()
111 if ((void *)tuple + tuple_len > (void *)(long)skb->data_end) in handle_udp()
118 dport = ipv4 ? tuple->ipv4.dport : tuple->ipv6.dport; in handle_udp()
141 tuple_len = ipv4 ? sizeof(tuple->ipv4) : sizeof(tuple->ipv6); in handle_tcp()
142 if ((void *)tuple + tuple_len > (void *)(long)skb->data_end) in handle_tcp()
152 dport = ipv4 ? tuple->ipv4.dport : tuple->ipv6.dport; in handle_tcp()
174 struct bpf_sock_tuple *tuple; in bpf_sk_assign_test() local
179 tuple = get_tuple(skb, &ipv4, &tcp); in bpf_sk_assign_test()
180 if (!tuple) in bpf_sk_assign_test()
189 ret = handle_tcp(skb, tuple, ipv4); in bpf_sk_assign_test()
[all …]
A Dcgroup_skb_sk_lookup_kern.c29 static inline void set_tuple(struct bpf_sock_tuple *tuple, 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()
35 tuple->ipv6.sport = tcph->dest; in set_tuple()
36 tuple->ipv6.dport = tcph->source; in set_tuple()
44 struct bpf_sock_tuple tuple; in is_allowed_peer_cg() local
45 size_t tuple_len = sizeof(tuple.ipv6); in is_allowed_peer_cg()
48 set_tuple(&tuple, ip6h, tcph); in is_allowed_peer_cg()
50 peer_sk = bpf_sk_lookup_tcp(skb, &tuple, tuple_len, in is_allowed_peer_cg()
A Dconnect4_prog.c151 struct bpf_sock_tuple tuple = {}; in connect_v4_prog() local
155 memset(&tuple.ipv4.saddr, 0, sizeof(tuple.ipv4.saddr)); in connect_v4_prog()
156 memset(&tuple.ipv4.sport, 0, sizeof(tuple.ipv4.sport)); in connect_v4_prog()
158 tuple.ipv4.daddr = bpf_htonl(DST_REWRITE_IP4); in connect_v4_prog()
159 tuple.ipv4.dport = bpf_htons(DST_REWRITE_PORT4); in connect_v4_prog()
174 sk = bpf_sk_lookup_tcp(ctx, &tuple, sizeof(tuple.ipv4), in connect_v4_prog()
177 sk = bpf_sk_lookup_udp(ctx, &tuple, sizeof(tuple.ipv4), in connect_v4_prog()
183 if (sk->src_ip4 != tuple.ipv4.daddr || in connect_v4_prog()
A Dtest_cls_redirect.c629 tuple->ipv4.sport = sport; in fill_tuple()
630 tuple->ipv4.dport = dport; in fill_tuple()
631 return sizeof(tuple->ipv4); in fill_tuple()
640 tuple->ipv6.sport = sport; in fill_tuple()
641 tuple->ipv6.dport = dport; in fill_tuple()
642 return sizeof(tuple->ipv6); in fill_tuple()
752 struct bpf_sock_tuple tuple; in process_icmpv4() local
804 struct bpf_sock_tuple tuple; in process_icmpv6() local
805 memcpy(&tuple.ipv6.saddr, &ipv6->daddr, sizeof(tuple.ipv6.saddr)); in process_icmpv6()
806 memcpy(&tuple.ipv6.daddr, &ipv6->saddr, sizeof(tuple.ipv6.daddr)); in process_icmpv6()
[all …]
A Dtest_cls_redirect_dynptr.c519 tuple->ipv4.sport = sport; in fill_tuple()
520 tuple->ipv4.dport = dport; in fill_tuple()
521 return sizeof(tuple->ipv4); in fill_tuple()
530 tuple->ipv6.sport = sport; in fill_tuple()
531 tuple->ipv6.dport = dport; in fill_tuple()
532 return sizeof(tuple->ipv6); in fill_tuple()
641 struct bpf_sock_tuple tuple; in process_icmpv4() local
657 struct bpf_sock_tuple tuple; in process_icmpv6() local
694 memcpy(&tuple.ipv6.saddr, &ipv6.daddr, sizeof(tuple.ipv6.saddr)); in process_icmpv6()
695 memcpy(&tuple.ipv6.daddr, &ipv6.saddr, sizeof(tuple.ipv6.daddr)); in process_icmpv6()
[all …]
A Dtest_btf_skc_cls_ingress.c68 struct bpf_sock_tuple *tuple = NULL; in handle_ip_tcp() local
92 tuple_len = sizeof(tuple->ipv4); in handle_ip_tcp()
93 tuple = (struct bpf_sock_tuple *)&ip4h->saddr; in handle_ip_tcp()
109 tuple_len = sizeof(tuple->ipv6); in handle_ip_tcp()
110 tuple = (struct bpf_sock_tuple *)&ip6h->saddr; in handle_ip_tcp()
118 if ((void *)tuple + tuple_len > data_end) { in handle_ip_tcp()
123 bpf_skc = bpf_skc_lookup_tcp(skb, tuple, tuple_len, in handle_ip_tcp()
A Dtest_tcp_custom_syncookie.c509 struct bpf_sock_tuple tuple; in tcp_handle_ack() local
516 tuple.ipv4.saddr = ctx->ipv4->saddr; in tcp_handle_ack()
517 tuple.ipv4.daddr = ctx->ipv4->daddr; in tcp_handle_ack()
518 tuple.ipv4.sport = ctx->tcp->source; in tcp_handle_ack()
519 tuple.ipv4.dport = ctx->tcp->dest; in tcp_handle_ack()
520 tuple_size = sizeof(tuple.ipv4); in tcp_handle_ack()
522 __builtin_memcpy(tuple.ipv6.saddr, &ctx->ipv6->saddr, sizeof(tuple.ipv6.saddr)); in tcp_handle_ack()
523 __builtin_memcpy(tuple.ipv6.daddr, &ctx->ipv6->daddr, sizeof(tuple.ipv6.daddr)); in tcp_handle_ack()
524 tuple.ipv6.sport = ctx->tcp->source; in tcp_handle_ack()
525 tuple.ipv6.dport = ctx->tcp->dest; in tcp_handle_ack()
[all …]
A Dtest_bpf_nf.c197 struct nf_conntrack_tuple *tuple; in nf_ct_test() local
200 tuple = &ct_lk->tuplehash[IP_CT_DIR_REPLY].tuple; in nf_ct_test()
201 if (tuple->dst.u3.ip == saddr.ip && in nf_ct_test()
202 tuple->dst.u.all == bpf_htons(sport)) in nf_ct_test()
204 if (tuple->src.u3.ip == daddr.ip && in nf_ct_test()
205 tuple->src.u.all == bpf_htons(dport)) in nf_ct_test()
/tools/testing/selftests/bpf/prog_tests/
A Dcls_redirect.c33 struct tuple { struct
63 int *server, int *conn, struct tuple *tuple) in set_up_conn() argument
97 tuple->family = ss.ss_family; in set_up_conn()
245 const struct tuple *tuple) in build_input() argument
258 if (tuple->family == AF_INET6) in build_input()
273 switch (tuple->family) { in build_input()
290 .saddr = tuple->src.in6_addr, in build_input()
291 .daddr = tuple->dst.in6_addr, in build_input()
306 .dest = tuple->dst.port, in build_input()
317 .dest = tuple->dst.port, in build_input()
[all …]
/tools/testing/selftests/drivers/net/
A Dnetpoll_basic.py67 def ethtool_get_ringsize(interface_name: str) -> tuple[int, int]:
83 def ethtool_set_ringsize(interface_name: str, ring_size: tuple[int, int]) -> bool:
99 def ethtool_get_queues_cnt(interface_name: str) -> tuple[int, int, int]:
116 def ethtool_set_queues_cnt(interface_name: str, queues: tuple[int, int, int]) -> None:
339 ethtool_set_queues_cnt(ifname, tuple(1 if x > 0 else x for x in prev_queues))
/tools/crypto/ccp/
A Ddbc.py57 if type(message) != tuple:
/tools/perf/scripts/python/
A Dsched-migration.py101 self.tasks = tuple(tasks)
137 next_tasks = self.tasks[:] + tuple([new])
A Dtask-analyzer.py527 fd_sum.write(fmt.format(*tuple(self._body[i])) + "\n")
/tools/testing/selftests/drivers/net/mlxsw/
A Dsharedbuffer_configuration.py148 return tuple(ret)
/tools/testing/selftests/hid/tests/
A Dtest_tablet.py205 return tuple()
269 return tuple()
A Dtest_mouse.py70 if isinstance(wheels, tuple):
/tools/power/pm-graph/
A Dbootgraph.py87 val = tuple(map(int, m.groups()))
/tools/testing/selftests/net/openvswitch/
A Dovs-dpctl.py318 if isinstance(ret, tuple):

Completed in 44 milliseconds