/linux-6.6.21/tools/testing/selftests/bpf/prog_tests/ |
D | cgroup_tcp_skb.c | 63 static int talk_to_cgroup(int *client_fd, int *listen_fd, int *service_fd, in talk_to_cgroup() argument 80 *listen_fd = start_server(AF_INET6, SOCK_STREAM, NULL, 0, 0); in talk_to_cgroup() 81 if (!ASSERT_GE(*listen_fd, 0, "listen_fd")) in talk_to_cgroup() 83 port = get_socket_local_port(*listen_fd); in talk_to_cgroup() 89 err = connect_fd_to_fd(*client_fd, *listen_fd, 0); in talk_to_cgroup() 92 *service_fd = accept(*listen_fd, NULL, NULL); in talk_to_cgroup() 109 static int talk_to_outside(int *client_fd, int *listen_fd, int *service_fd, in talk_to_outside() argument 121 *listen_fd = start_server(AF_INET6, SOCK_STREAM, NULL, 0, 0); in talk_to_outside() 122 if (!ASSERT_GE(*listen_fd, 0, "listen_fd")) in talk_to_outside() 133 port = get_socket_local_port(*listen_fd); in talk_to_outside() [all …]
|
D | btf_skc_cls_ingress.c | 76 int listen_fd = -1, cli_fd = -1, srv_fd = -1, err; in test_conn() local 83 listen_fd = start_server(AF_INET6, SOCK_STREAM, "::1", 0, 0); in test_conn() 84 if (CHECK_FAIL(listen_fd == -1)) in test_conn() 87 err = getsockname(listen_fd, (struct sockaddr *)&srv_sa6, &addrlen); in test_conn() 94 cli_fd = connect_to_fd(listen_fd, 0); in test_conn() 98 srv_fd = accept(listen_fd, NULL, NULL); in test_conn() 120 if (listen_fd != -1) in test_conn() 121 close(listen_fd); in test_conn() 130 int listen_fd = -1, cli_fd = -1, srv_fd = -1, err; in test_syncookie() local 138 listen_fd = start_server(AF_INET6, SOCK_STREAM, "::1", 0, 0); in test_syncookie() [all …]
|
D | sk_storage_tracing.c | 50 int listen_fd = -1, passive_fd = -1, active_fd = -1, value = 1, err; in do_test() local 53 listen_fd = start_server(AF_INET6, SOCK_STREAM, LO_ADDR6, 0, 0); in do_test() 54 if (CHECK(listen_fd == -1, "start_server", in do_test() 55 "listen_fd:%d errno:%d\n", listen_fd, errno)) in do_test() 58 active_fd = connect_to_fd(listen_fd, 0); in do_test() 68 passive_fd = accept(listen_fd, NULL, 0); in do_test() 88 err = check_sk_stg(listen_fd, BPF_TCP_LISTEN); in do_test() 104 if (listen_fd != -1) in do_test() 105 close(listen_fd); in do_test()
|
D | bpf_iter_setsockopt.c | 51 static int *make_established(int listen_fd, unsigned int nr_est, in make_established() argument 68 est_fds[i] = connect_to_fd(listen_fd, 0); in make_established() 76 accepted_fds[i] = accept(listen_fd, NULL, 0); in make_established() 109 int err, iter_fd = -1, listen_fd = -1; in do_bpf_iter_setsockopt() local 113 listen_fd = start_server(AF_INET6, SOCK_STREAM, "::1", 0, 0); in do_bpf_iter_setsockopt() 114 if (!ASSERT_GE(listen_fd, 0, "start_server")) in do_bpf_iter_setsockopt() 116 if (!ASSERT_EQ(set_bpf_cubic(&listen_fd, 1), 1, in do_bpf_iter_setsockopt() 119 iter_skel->bss->listen_hport = get_local_port(listen_fd); in do_bpf_iter_setsockopt() 125 est_fds = make_established(listen_fd, nr_est, &accepted_fds); in do_bpf_iter_setsockopt() 161 ASSERT_EQ(check_bpf_dctcp(&listen_fd, 1), 1, in do_bpf_iter_setsockopt() [all …]
|
D | tcpbpf_user.c | 49 int listen_fd = -1, cli_fd = -1, accept_fd = -1; in run_test() local 54 listen_fd = start_server(AF_INET6, SOCK_STREAM, LO_ADDR6, 0, 0); in run_test() 55 if (!ASSERT_NEQ(listen_fd, -1, "start_server")) in run_test() 58 cli_fd = connect_to_fd(listen_fd, 0); in run_test() 62 accept_fd = accept(listen_fd, NULL, NULL); in run_test() 107 if (listen_fd != -1) in run_test() 108 close(listen_fd); in run_test()
|
D | sock_fields.c | 276 int listen_fd = -1, cli_fd = -1, accept_fd = -1, err, i; in test() local 281 listen_fd = start_server(AF_INET6, SOCK_STREAM, "::1", 0xcafe, 0); in test() 283 if (CHECK_FAIL(listen_fd == -1)) in test() 286 err = getsockname(listen_fd, (struct sockaddr *)&srv_sa6, &addrlen); in test() 292 cli_fd = connect_to_fd(listen_fd, 0); in test() 301 accept_fd = accept(listen_fd, NULL, NULL); in test() 343 if (listen_fd != -1) in test() 344 close(listen_fd); in test()
|
D | tc_redirect.c | 321 int listen_fd = -1, accept_fd = -1, client_fd = -1; in test_tcp() local 330 listen_fd = start_server(family, SOCK_STREAM, addr, port, 0); in test_tcp() 331 if (!ASSERT_GE(listen_fd, 0, "listen")) in test_tcp() 339 client_fd = connect_to_fd(listen_fd, TIMEOUT_MILLIS); in test_tcp() 343 accept_fd = accept(listen_fd, NULL, NULL); in test_tcp() 360 if (listen_fd >= 0) in test_tcp() 361 close(listen_fd); in test_tcp() 477 int opt = 1, accept_fd = -1, client_fd = -1, listen_fd, err; in test_inet_dtime() local 484 listen_fd = start_server(family, type, addr, port, 0); in test_inet_dtime() 487 if (!ASSERT_GE(listen_fd, 0, "listen")) in test_inet_dtime() [all …]
|
D | lsm_cgroup.c | 70 int listen_fd, client_fd, accepted_fd; in test_lsm_cgroup_functional() local 220 listen_fd = start_server(AF_INET6, SOCK_STREAM, "::1", 0, 0); in test_lsm_cgroup_functional() 221 ASSERT_GE(listen_fd, 0, "start_server"); in test_lsm_cgroup_functional() 222 client_fd = connect_to_fd(listen_fd, 0); in test_lsm_cgroup_functional() 224 accepted_fd = accept(listen_fd, NULL, NULL); in test_lsm_cgroup_functional() 269 close(listen_fd); in test_lsm_cgroup_functional()
|