/tools/testing/selftests/bpf/prog_tests/ |
D | cgroup_v1v2.c | 10 static int run_test(int cgroup_fd, int server_fd, bool classid) in run_test() argument 35 fd = connect_to_fd_opts(server_fd, &opts); in run_test() 48 int server_fd, client_fd, cgroup_fd; in test_cgroup_v1v2() local 52 server_fd = start_server(AF_INET, SOCK_STREAM, NULL, port, 0); in test_cgroup_v1v2() 53 if (!ASSERT_GE(server_fd, 0, "server_fd")) in test_cgroup_v1v2() 55 client_fd = connect_to_fd_opts(server_fd, &opts); in test_cgroup_v1v2() 57 close(server_fd); in test_cgroup_v1v2() 61 close(server_fd); in test_cgroup_v1v2() 67 server_fd = start_server(AF_INET, SOCK_STREAM, NULL, port, 0); in test_cgroup_v1v2() 68 if (!ASSERT_GE(server_fd, 0, "server_fd")) { in test_cgroup_v1v2() [all …]
|
D | connect_force_port.c | 49 static int run_test(int cgroup_fd, int server_fd, int family, int type) in run_test() argument 117 fd = connect_to_fd(server_fd, 0); in run_test() 134 int server_fd, cgroup_fd; in test_connect_force_port() local 140 server_fd = start_server(AF_INET, SOCK_STREAM, NULL, 60123, 0); in test_connect_force_port() 141 if (CHECK_FAIL(server_fd < 0)) in test_connect_force_port() 143 CHECK_FAIL(run_test(cgroup_fd, server_fd, AF_INET, SOCK_STREAM)); in test_connect_force_port() 144 close(server_fd); in test_connect_force_port() 146 server_fd = start_server(AF_INET6, SOCK_STREAM, NULL, 60124, 0); in test_connect_force_port() 147 if (CHECK_FAIL(server_fd < 0)) in test_connect_force_port() 149 CHECK_FAIL(run_test(cgroup_fd, server_fd, AF_INET6, SOCK_STREAM)); in test_connect_force_port() [all …]
|
D | load_bytes_relative.c | 12 int server_fd, cgroup_fd, prog_fd, map_fd, client_fd; in test_load_bytes_relative() local 26 server_fd = start_server(AF_INET, SOCK_STREAM, NULL, 0, 0); in test_load_bytes_relative() 27 if (CHECK_FAIL(server_fd < 0)) in test_load_bytes_relative() 52 client_fd = connect_to_fd(server_fd, 0); in test_load_bytes_relative() 67 close(server_fd); in test_load_bytes_relative()
|
D | netns_cookie.c | 15 int server_fd = -1, client_fd = -1, cgroup_fd = -1; in test_netns_cookie() local 41 server_fd = start_server(AF_INET6, SOCK_STREAM, "::1", 0, 0); in test_netns_cookie() 42 if (CHECK(server_fd < 0, "start_server", "errno %d\n", errno)) in test_netns_cookie() 45 client_fd = connect_to_fd(server_fd, 0); in test_netns_cookie() 73 if (server_fd != -1) in test_netns_cookie() 74 close(server_fd); in test_netns_cookie()
|
D | tcp_rtt.c | 92 static int run_test(int cgroup_fd, int server_fd) in run_test() argument 121 client_fd = connect_to_fd(server_fd, 0); in run_test() 158 int server_fd, cgroup_fd; in test_tcp_rtt() local 164 server_fd = start_server(AF_INET, SOCK_STREAM, NULL, 0, 0); in test_tcp_rtt() 165 if (CHECK_FAIL(server_fd < 0)) in test_tcp_rtt() 168 CHECK_FAIL(run_test(cgroup_fd, server_fd)); in test_tcp_rtt() 170 close(server_fd); in test_tcp_rtt()
|
D | socket_cookie.c | 18 int server_fd = 0, client_fd = 0, cgroup_fd = 0, err = 0; in test_socket_cookie() local 48 server_fd = start_server(AF_INET6, SOCK_STREAM, "::1", 0, 0); in test_socket_cookie() 49 if (CHECK(server_fd < 0, "start_server", "errno %d\n", errno)) in test_socket_cookie() 52 client_fd = connect_to_fd(server_fd, 0); in test_socket_cookie() 71 close(server_fd); in test_socket_cookie()
|
D | sockopt_inherit.c | 10 static int connect_to_server(int server_fd) in connect_to_server() argument 22 if (getsockname(server_fd, (struct sockaddr *)&addr, &len)) { in connect_to_server() 173 int server_fd = -1, client_fd; in run_test() local 192 server_fd = start_server(); in run_test() 193 if (CHECK_FAIL(server_fd < 0)) in run_test() 198 (void *)&server_fd))) { in run_test() 205 client_fd = connect_to_server(server_fd); in run_test() 221 close(server_fd); in run_test()
|
D | sk_lookup.c | 312 static int tcp_recv_send(int server_fd) in tcp_recv_send() argument 318 fd = accept(server_fd, NULL, NULL); in tcp_recv_send() 357 static int udp_recv_send(int server_fd) in udp_recv_send() argument 381 n = recvmsg(server_fd, &msg, 0); in udp_recv_send() 437 static int tcp_echo_test(int client_fd, int server_fd) in tcp_echo_test() argument 444 err = tcp_recv_send(server_fd); in tcp_echo_test() 454 static int udp_echo_test(int client_fd, int server_fd) in udp_echo_test() argument 461 err = udp_recv_send(server_fd); in udp_echo_test() 869 int client_fd, server_fd, err; in drop_on_lookup() local 877 server_fd = make_server(t->sotype, t->listen_at.ip, t->listen_at.port, in drop_on_lookup() [all …]
|
D | cg_storage_multi.c | 59 int server_fd = -1, client_fd = -1; in connect_send() local 66 server_fd = start_server(AF_INET, SOCK_DGRAM, NULL, 0, 0); in connect_send() 67 if (server_fd < 0) in connect_send() 70 client_fd = connect_to_fd(server_fd, 0); in connect_send() 77 if (read(server_fd, &message, sizeof(message)) < 0) in connect_send() 84 close(server_fd); in connect_send()
|
D | sk_assign.c | 157 run_test(int server_fd, const struct sockaddr *addr, socklen_t len, int type) in run_test() argument 171 srv_client = accept(server_fd, NULL, NULL); in run_test() 177 srv_client = server_fd; in run_test() 209 if (srv_client != server_fd) in run_test()
|
/tools/testing/selftests/net/ |
D | tcp_inq.c | 61 int server_fd = (int)(unsigned long)arg; in start_server() local 71 fd = accept(server_fd, (struct sockaddr *)&addr, &addrlen); in start_server() 92 close(server_fd); in start_server() 105 int server_fd, fd; in main() local 124 server_fd = socket(family, SOCK_STREAM, 0); in main() 125 if (server_fd < 0) in main() 128 if (setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR, in main() 131 if (bind(server_fd, (const struct sockaddr *)&listen_addr, in main() 134 if (listen(server_fd, 128) == -1) in main() 137 (void *)(unsigned long)server_fd) != 0) in main()
|
/tools/testing/selftests/bpf/ |
D | network_helpers.h | 49 int connect_to_fd(int server_fd, int timeout_ms); 50 int connect_to_fd_opts(int server_fd, const struct network_helper_opts *opts); 51 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms); 52 int fastopen_connect(int server_fd, const char *data, unsigned int data_len,
|
D | network_helpers.c | 172 int fastopen_connect(int server_fd, const char *data, unsigned int data_len, in fastopen_connect() argument 180 if (getsockname(server_fd, (struct sockaddr *)&addr, &addrlen)) { in fastopen_connect() 238 int connect_to_fd_opts(int server_fd, const struct network_helper_opts *opts) in connect_to_fd_opts() argument 249 if (getsockopt(server_fd, SOL_SOCKET, SO_TYPE, &type, &optlen)) { in connect_to_fd_opts() 255 if (getsockname(server_fd, (struct sockaddr *)&addr, &addrlen)) { in connect_to_fd_opts() 285 int connect_to_fd(int server_fd, int timeout_ms) in connect_to_fd() argument 291 return connect_to_fd_opts(server_fd, &opts); in connect_to_fd() 294 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms) in connect_fd_to_fd() argument 302 if (getsockname(server_fd, (struct sockaddr *)&addr, &len)) { in connect_fd_to_fd()
|
D | test_tcp_check_syncookie_user.c | 50 static int connect_to_server(int server_fd) in connect_to_server() argument 56 if (getsockname(server_fd, (struct sockaddr *)&addr, &len)) { in connect_to_server() 119 static int run_test(int server_fd, int results_fd, bool xdp) in run_test() argument 145 client = connect_to_server(server_fd); in run_test() 149 srv_client = accept(server_fd, NULL, 0); in run_test()
|