Home
last modified time | relevance | path

Searched refs:server_fd (Results 1 – 16 of 16) sorted by relevance

/linux-6.1.9/tools/testing/selftests/bpf/prog_tests/
Dcgroup_v1v2.c10 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 …]
Dconnect_force_port.c49 static int run_test(int cgroup_fd, int server_fd, int family, int type) in run_test() argument
118 fd = connect_to_fd(server_fd, 0); in run_test()
135 int server_fd, cgroup_fd; in test_connect_force_port() local
141 server_fd = start_server(AF_INET, SOCK_STREAM, NULL, 60123, 0); in test_connect_force_port()
142 if (CHECK_FAIL(server_fd < 0)) in test_connect_force_port()
144 CHECK_FAIL(run_test(cgroup_fd, server_fd, AF_INET, SOCK_STREAM)); in test_connect_force_port()
145 close(server_fd); in test_connect_force_port()
147 server_fd = start_server(AF_INET6, SOCK_STREAM, NULL, 60124, 0); in test_connect_force_port()
148 if (CHECK_FAIL(server_fd < 0)) in test_connect_force_port()
150 CHECK_FAIL(run_test(cgroup_fd, server_fd, AF_INET6, SOCK_STREAM)); in test_connect_force_port()
[all …]
Dmptcp.c94 static int run_test(int cgroup_fd, int server_fd, bool is_mptcp) in run_test() argument
123 client_fd = connect_to_fd(server_fd, 0); in run_test()
141 int server_fd, cgroup_fd; in test_base() local
148 server_fd = start_server(AF_INET, SOCK_STREAM, NULL, 0, 0); in test_base()
149 if (!ASSERT_GE(server_fd, 0, "start_server")) in test_base()
152 ASSERT_OK(run_test(cgroup_fd, server_fd, false), "run_test tcp"); in test_base()
154 close(server_fd); in test_base()
158 server_fd = start_mptcp_server(AF_INET, NULL, 0, 0); in test_base()
159 if (!ASSERT_GE(server_fd, 0, "start_mptcp_server")) in test_base()
162 ASSERT_OK(run_test(cgroup_fd, server_fd, true), "run_test mptcp"); in test_base()
[all …]
Dtcp_rtt.c90 static int run_test(int cgroup_fd, int server_fd) in run_test() argument
111 client_fd = connect_to_fd(server_fd, 0); in run_test()
148 int server_fd, cgroup_fd; in test_tcp_rtt() local
154 server_fd = start_server(AF_INET, SOCK_STREAM, NULL, 0, 0); in test_tcp_rtt()
155 if (!ASSERT_GE(server_fd, 0, "start_server")) in test_tcp_rtt()
158 ASSERT_OK(run_test(cgroup_fd, server_fd), "run_test"); in test_tcp_rtt()
160 close(server_fd); in test_tcp_rtt()
Dnetns_cookie.c15 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()
Dload_bytes_relative.c12 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()
Dsockopt_inherit.c10 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()
167 int server_fd = -1, client_fd; in run_test() local
189 server_fd = start_server(); in run_test()
190 if (!ASSERT_GE(server_fd, 0, "start_server")) in run_test()
195 (void *)&server_fd), "pthread_create")) { in run_test()
202 client_fd = connect_to_server(server_fd); in run_test()
218 close(server_fd); in run_test()
Dxdp_synproxy.c65 int server_fd = -1, client_fd = -1, accept_fd = -1; in test_synproxy() local
133 server_fd = start_server(AF_INET, SOCK_STREAM, "198.18.0.2", 8080, 0); in test_synproxy()
134 if (!ASSERT_GE(server_fd, 0, "start_server")) in test_synproxy()
140 client_fd = connect_to_fd(server_fd, 10000); in test_synproxy()
144 accept_fd = accept(server_fd, NULL, NULL); in test_synproxy()
168 if (server_fd >= 0) in test_synproxy()
169 close(server_fd); in test_synproxy()
Dsocket_cookie.c18 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()
Dsk_lookup.c311 static int tcp_recv_send(int server_fd) in tcp_recv_send() argument
317 fd = accept(server_fd, NULL, NULL); in tcp_recv_send()
356 static int udp_recv_send(int server_fd) in udp_recv_send() argument
380 n = recvmsg(server_fd, &msg, 0); in udp_recv_send()
436 static int tcp_echo_test(int client_fd, int server_fd) in tcp_echo_test() argument
443 err = tcp_recv_send(server_fd); in tcp_echo_test()
453 static int udp_echo_test(int client_fd, int server_fd) in udp_echo_test() argument
460 err = udp_recv_send(server_fd); in udp_echo_test()
868 int client_fd, server_fd, err; in drop_on_lookup() local
876 server_fd = make_server(t->sotype, t->listen_at.ip, t->listen_at.port, in drop_on_lookup()
[all …]
Dcg_storage_multi.c60 int server_fd = -1, client_fd = -1; in connect_send() local
65 server_fd = start_server(AF_INET, SOCK_DGRAM, NULL, 0, 0); in connect_send()
66 if (server_fd < 0) in connect_send()
69 client_fd = connect_to_fd(server_fd, 0); in connect_send()
80 close(server_fd); in connect_send()
Dsk_assign.c144 run_test(int server_fd, const struct sockaddr *addr, socklen_t len, int type) in run_test() argument
158 srv_client = accept(server_fd, NULL, NULL); in run_test()
164 srv_client = server_fd; in run_test()
196 if (srv_client != server_fd) in run_test()
/linux-6.1.9/tools/testing/selftests/net/
Dtcp_inq.c61 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()
/linux-6.1.9/tools/testing/selftests/bpf/
Dnetwork_helpers.h51 int connect_to_fd(int server_fd, int timeout_ms);
52 int connect_to_fd_opts(int server_fd, const struct network_helper_opts *opts);
53 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms);
54 int fastopen_connect(int server_fd, const char *data, unsigned int data_len,
Dnetwork_helpers.c196 int fastopen_connect(int server_fd, const char *data, unsigned int data_len, in fastopen_connect() argument
204 if (getsockname(server_fd, (struct sockaddr *)&addr, &addrlen)) { in fastopen_connect()
262 int connect_to_fd_opts(int server_fd, const struct network_helper_opts *opts) in connect_to_fd_opts() argument
273 if (getsockopt(server_fd, SOL_SOCKET, SO_TYPE, &type, &optlen)) { in connect_to_fd_opts()
278 if (getsockopt(server_fd, SOL_SOCKET, SO_PROTOCOL, &protocol, &optlen)) { in connect_to_fd_opts()
284 if (getsockname(server_fd, (struct sockaddr *)&addr, &addrlen)) { in connect_to_fd_opts()
314 int connect_to_fd(int server_fd, int timeout_ms) in connect_to_fd() argument
320 return connect_to_fd_opts(server_fd, &opts); in connect_to_fd()
323 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms) in connect_fd_to_fd() argument
331 if (getsockname(server_fd, (struct sockaddr *)&addr, &len)) { in connect_fd_to_fd()
Dtest_tcp_check_syncookie_user.c120 static int run_test(int server_fd, int results_fd, bool xdp, in run_test() argument
151 srv_client = accept(server_fd, NULL, 0); in run_test()
204 static bool get_port(int server_fd, in_port_t *port) in get_port() argument
209 if (getsockname(server_fd, (struct sockaddr *)&addr, &len)) { in get_port()