/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 74 *client_fd = create_client_sock_v6(); in talk_to_cgroup() 75 if (!ASSERT_GE(*client_fd, 0, "client_fd")) in talk_to_cgroup() 89 err = connect_fd_to_fd(*client_fd, *listen_fd, 0); in talk_to_cgroup() 98 cp = write(*client_fd, "hello", 5); in talk_to_cgroup() 109 static int talk_to_outside(int *client_fd, int *listen_fd, int *service_fd, in talk_to_outside() argument 127 *client_fd = create_client_sock_v6(); in talk_to_outside() 128 if (!ASSERT_GE(*client_fd, 0, "client_fd")) in talk_to_outside() 139 err = connect_fd_to_fd(*client_fd, *listen_fd, 0); in talk_to_outside() 145 cp = write(*client_fd, "hello", 5); in talk_to_outside() [all …]
|
D | mptcp.c | 85 static int verify_tsk(int map_fd, int client_fd) in verify_tsk() argument 87 int err, cfd = client_fd; in verify_tsk() 123 static int verify_msk(int map_fd, int client_fd, __u32 token) in verify_msk() argument 126 int err, cfd = client_fd; in verify_msk() 158 int client_fd, prog_fd, map_fd, err; in run_test() local 175 client_fd = connect_to_fd(server_fd, 0); in run_test() 176 if (!ASSERT_GE(client_fd, 0, "connect to fd")) { in run_test() 181 err += is_mptcp ? verify_msk(map_fd, client_fd, sock_skel->bss->token) : in run_test() 182 verify_tsk(map_fd, client_fd); in run_test() 184 close(client_fd); in run_test() [all …]
|
D | sockopt_inherit.c | 72 int client_fd; in server_thread() local 88 client_fd = accept(fd, (struct sockaddr *)&addr, &len); in server_thread() 89 if (!ASSERT_GE(client_fd, 0, "accept client")) in server_thread() 92 err += verify_sockopt(client_fd, CUSTOM_INHERIT1, "accept", 1); in server_thread() 93 err += verify_sockopt(client_fd, CUSTOM_INHERIT2, "accept", 1); in server_thread() 94 err += verify_sockopt(client_fd, CUSTOM_LISTENER, "accept", 0); in server_thread() 96 close(client_fd); in server_thread() 141 int server_fd = -1, client_fd; in run_test() local 176 client_fd = connect_to_server(server_fd); in run_test() 177 if (!ASSERT_GE(client_fd, 0, "connect_to_server")) in run_test() [all …]
|
D | netns_cookie.c | 15 int server_fd = -1, client_fd = -1, cgroup_fd = -1; in test_netns_cookie() local 45 client_fd = connect_to_fd(server_fd, 0); in test_netns_cookie() 46 if (CHECK(client_fd < 0, "connect_to_fd", "errno %d\n", errno)) in test_netns_cookie() 49 ret = send(client_fd, send_msg, sizeof(send_msg), 0); in test_netns_cookie() 54 &client_fd, &val); in test_netns_cookie() 58 err = getsockopt(client_fd, SOL_SOCKET, SO_NETNS_COOKIE, in test_netns_cookie() 66 &client_fd, &val); in test_netns_cookie() 75 if (client_fd != -1) in test_netns_cookie() 76 close(client_fd); in test_netns_cookie()
|
D | tcp_rtt.c | 46 static int verify_sk(int map_fd, int client_fd, const char *msg, __u32 invoked, in verify_sk() argument 53 if (!ASSERT_GE(bpf_map_lookup_elem(map_fd, &client_fd, &val), 0, "read socket storage")) in verify_sk() 93 int client_fd; in run_test() local 111 client_fd = connect_to_fd(server_fd, 0); in run_test() 112 if (client_fd < 0) { in run_test() 117 err += verify_sk(map_fd, client_fd, "syn-ack", in run_test() 124 send_byte(client_fd); in run_test() 125 if (wait_for_ack(client_fd, 100) < 0) { in run_test() 131 err += verify_sk(map_fd, client_fd, "first payload byte", in run_test() 139 close(client_fd); in run_test()
|
D | socket_cookie.c | 18 int server_fd = 0, client_fd = 0, cgroup_fd = 0, err = 0; in test_socket_cookie() local 52 client_fd = connect_to_fd(server_fd, 0); in test_socket_cookie() 53 if (CHECK(client_fd < 0, "connect_to_fd", "errno %d\n", errno)) in test_socket_cookie() 57 &client_fd, &val); in test_socket_cookie() 61 err = getsockname(client_fd, (struct sockaddr *)&addr, &addr_len); in test_socket_cookie() 69 close(client_fd); in test_socket_cookie()
|
D | load_bytes_relative.c | 12 int server_fd, cgroup_fd, prog_fd, map_fd, client_fd; in test_load_bytes_relative() local 52 client_fd = connect_to_fd(server_fd, 0); in test_load_bytes_relative() 53 if (CHECK_FAIL(client_fd < 0)) in test_load_bytes_relative() 55 close(client_fd); in test_load_bytes_relative()
|
D | cgroup_v1v2.c | 48 int server_fd, client_fd, cgroup_fd; in test_cgroup_v1v2() local 55 client_fd = connect_to_fd_opts(server_fd, &opts); in test_cgroup_v1v2() 56 if (!ASSERT_GE(client_fd, 0, "client_fd")) { in test_cgroup_v1v2() 60 close(client_fd); in test_cgroup_v1v2()
|
D | sk_lookup.c | 436 static int tcp_echo_test(int client_fd, int server_fd) in tcp_echo_test() argument 440 err = send_byte(client_fd); in tcp_echo_test() 446 err = recv_byte(client_fd); in tcp_echo_test() 453 static int udp_echo_test(int client_fd, int server_fd) in udp_echo_test() argument 457 err = send_byte(client_fd); in udp_echo_test() 463 err = recv_byte(client_fd); in udp_echo_test() 601 int client_fd, reuse_conn_fd = -1; in run_lookup_prog() local 651 client_fd = make_client(t->sotype, t->connect_to.ip, t->connect_to.port); in run_lookup_prog() 652 if (client_fd < 0) in run_lookup_prog() 656 tcp_echo_test(client_fd, server_fds[t->accept_on]); in run_lookup_prog() [all …]
|
D | xdp_synproxy.c | 60 int server_fd = -1, client_fd = -1, accept_fd = -1; in test_synproxy() local 135 client_fd = connect_to_fd(server_fd, 10000); in test_synproxy() 136 if (!ASSERT_GE(client_fd, 0, "connect_to_fd")) in test_synproxy() 161 if (client_fd >= 0) in test_synproxy() 162 close(client_fd); in test_synproxy()
|
D | bpf_nf.c | 53 int srv_fd = -1, client_fd = -1, srv_client_fd = -1; in test_bpf_nf_ct() local 80 client_fd = connect_to_server(srv_fd); in test_bpf_nf_ct() 81 if (!ASSERT_GE(client_fd, 0, "connect_to_server")) in test_bpf_nf_ct() 126 if (client_fd != -1) in test_bpf_nf_ct() 127 close(client_fd); in test_bpf_nf_ct()
|
D | cgrp_local_storage.c | 70 int server_fd = 0, client_fd = 0, err = 0; in test_attach_cgroup() local 100 client_fd = connect_to_fd(server_fd, 0); in test_attach_cgroup() 101 if (!ASSERT_GE(client_fd, 0, "connect_to_fd")) in test_attach_cgroup() 109 err = getsockname(client_fd, (struct sockaddr *)&addr, &addr_len); in test_attach_cgroup() 117 close(client_fd); in test_attach_cgroup()
|
D | tc_redirect.c | 321 int listen_fd = -1, accept_fd = -1, client_fd = -1; in test_tcp() local 339 client_fd = connect_to_fd(listen_fd, TIMEOUT_MILLIS); in test_tcp() 340 if (!ASSERT_GE(client_fd, 0, "connect_to_fd")) in test_tcp() 350 n = write(client_fd, buf, sizeof(buf)); in test_tcp() 364 if (client_fd >= 0) in test_tcp() 365 close(client_fd); in test_tcp() 477 int opt = 1, accept_fd = -1, client_fd = -1, listen_fd, err; in test_inet_dtime() local 509 client_fd = connect_to_fd(listen_fd, TIMEOUT_MILLIS); in test_inet_dtime() 512 if (!ASSERT_GE(client_fd, 0, "connect_to_fd")) in test_inet_dtime() 522 n = write(client_fd, buf, sizeof(buf)); in test_inet_dtime() [all …]
|
D | cg_storage_multi.c | 59 int server_fd = -1, client_fd = -1; in connect_send() local 70 client_fd = connect_to_fd(server_fd, 0); in connect_send() 71 if (client_fd < 0) in connect_send() 74 if (send(client_fd, &message, sizeof(message), 0) < 0) in connect_send() 83 close(client_fd); in connect_send()
|
D | lsm_cgroup.c | 70 int listen_fd, client_fd, accepted_fd; in test_lsm_cgroup_functional() local 222 client_fd = connect_to_fd(listen_fd, 0); in test_lsm_cgroup_functional() 223 ASSERT_GE(client_fd, 0, "connect_to_fd"); in test_lsm_cgroup_functional() 270 close(client_fd); in test_lsm_cgroup_functional()
|
/linux-6.6.21/tools/testing/selftests/net/ ! |
D | bind_timewait.c | 45 int server_fd, client_fd, child_fd, ret; in create_timewait_socket() local 61 client_fd = socket(AF_INET, SOCK_STREAM, 0); in create_timewait_socket() 62 ASSERT_GT(client_fd, 0); in create_timewait_socket() 64 ret = connect(client_fd, (struct sockaddr *)&self->addr, self->addrlen); in create_timewait_socket() 72 close(client_fd); in create_timewait_socket()
|
/linux-6.6.21/tools/testing/vsock/ ! |
D | vsock_perf.c | 138 int client_fd; in run_receiver() local 175 client_fd = accept(fd, &clientaddr.sa, &clientaddr_len); in run_receiver() 177 if (client_fd < 0) in run_receiver() 180 vsock_increase_buf_size(client_fd); in run_receiver() 182 if (setsockopt(client_fd, SOL_SOCKET, SO_RCVLOWAT, in run_receiver() 202 fds.fd = client_fd; in run_receiver() 246 close(client_fd); in run_receiver()
|
D | util.c | 155 int client_fd; in vsock_accept() local 174 client_fd = accept(fd, &clientaddr.sa, &clientaddr_len); in vsock_accept() 176 } while (client_fd < 0 && errno == EINTR); in vsock_accept() 183 if (client_fd < 0) in vsock_accept() 184 return client_fd; in vsock_accept() 199 return client_fd; in vsock_accept()
|
D | vsock_diag_test.c | 404 int client_fd; in test_connect_server() local 406 client_fd = vsock_stream_accept(VMADDR_CID_ANY, 1234, NULL); in test_connect_server() 407 if (client_fd < 0) { in test_connect_server() 415 st = find_vsock_stat(&sockets, client_fd); in test_connect_server() 421 close(client_fd); in test_connect_server()
|
/linux-6.6.21/tools/testing/selftests/bpf/ ! |
D | network_helpers.c | 333 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms) in connect_fd_to_fd() argument 338 if (settimeo(client_fd, timeout_ms)) in connect_fd_to_fd() 346 if (connect_fd_to_addr(client_fd, &addr, len, false)) in connect_fd_to_fd()
|
D | network_helpers.h | 56 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms);
|
/linux-6.6.21/fs/notify/fanotify/ ! |
D | fanotify_user.c | 255 int client_fd; in create_fd() local 258 client_fd = get_unused_fd_flags(group->fanotify_data.f_flags); in create_fd() 259 if (client_fd < 0) in create_fd() 260 return client_fd; in create_fd() 277 put_unused_fd(client_fd); in create_fd() 278 client_fd = PTR_ERR(new_file); in create_fd() 283 return client_fd; in create_fd()
|