/tools/testing/selftests/bpf/prog_tests/ |
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 | sockopt_inherit.c | 70 int client_fd; in server_thread() local 88 client_fd = accept(fd, (struct sockaddr *)&addr, &len); in server_thread() 89 if (CHECK_FAIL(client_fd < 0)) { in server_thread() 94 err += verify_sockopt(client_fd, CUSTOM_INHERIT1, "accept", 1); in server_thread() 95 err += verify_sockopt(client_fd, CUSTOM_INHERIT2, "accept", 1); in server_thread() 96 err += verify_sockopt(client_fd, CUSTOM_LISTENER, "accept", 0); in server_thread() 98 close(client_fd); in server_thread() 173 int server_fd = -1, client_fd; in run_test() local 205 client_fd = connect_to_server(server_fd); in run_test() 206 if (CHECK_FAIL(client_fd < 0)) in run_test() [all …]
|
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 (CHECK_FAIL(bpf_map_lookup_elem(map_fd, &client_fd, &val) < 0)) { in verify_sk() 101 int client_fd; in run_test() local 121 client_fd = connect_to_fd(server_fd, 0); in run_test() 122 if (client_fd < 0) { in run_test() 127 err += verify_sk(map_fd, client_fd, "syn-ack", in run_test() 134 send_byte(client_fd); in run_test() 135 if (wait_for_ack(client_fd, 100) < 0) { in run_test() 141 err += verify_sk(map_fd, client_fd, "first payload byte", in run_test() 149 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 | 437 static int tcp_echo_test(int client_fd, int server_fd) in tcp_echo_test() argument 441 err = send_byte(client_fd); in tcp_echo_test() 447 err = recv_byte(client_fd); in tcp_echo_test() 454 static int udp_echo_test(int client_fd, int server_fd) in udp_echo_test() argument 458 err = send_byte(client_fd); in udp_echo_test() 464 err = recv_byte(client_fd); in udp_echo_test() 602 int client_fd, reuse_conn_fd = -1; in run_lookup_prog() local 652 client_fd = make_client(t->sotype, t->connect_to.ip, t->connect_to.port); in run_lookup_prog() 653 if (client_fd < 0) in run_lookup_prog() 657 tcp_echo_test(client_fd, server_fds[t->accept_on]); in run_lookup_prog() [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 | tc_redirect.c | 353 int listen_fd = -1, accept_fd = -1, client_fd = -1; in test_tcp() local 371 client_fd = connect_to_fd(listen_fd, TIMEOUT_MILLIS); in test_tcp() 372 if (!ASSERT_GE(client_fd, 0, "connect_to_fd")) in test_tcp() 382 n = write(client_fd, buf, sizeof(buf)); in test_tcp() 396 if (client_fd >= 0) in test_tcp() 397 close(client_fd); in test_tcp()
|
/tools/testing/vsock/ |
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()
|
/tools/testing/selftests/bpf/ |
D | network_helpers.h | 51 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms);
|
D | network_helpers.c | 294 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms) in connect_fd_to_fd() argument 299 if (settimeo(client_fd, timeout_ms)) in connect_fd_to_fd() 307 if (connect_fd_to_addr(client_fd, &addr, len, false)) in connect_fd_to_fd()
|