/linux-master/tools/testing/selftests/bpf/ |
H A D | xdp_hw_metadata.c | 405 static int verify_metadata(struct xsk *rx_xsk, int rxq, int server_fd, clockid_t clock_id) argument 421 fds[rxq].fd = server_fd; 444 verify_skb_metadata(server_fd); 674 int server_fd = -1; local 716 server_fd = start_server(AF_INET6, SOCK_DGRAM, NULL, 9092, 1000); 717 if (server_fd < 0) 719 timestamping_enable(server_fd, 742 ret = verify_metadata(rx_xsk, rxq, server_fd, clock_id); 743 close(server_fd);
|
H A D | network_helpers.h | 55 int connect_to_fd(int server_fd, int timeout_ms); 56 int connect_to_fd_opts(int server_fd, const struct network_helper_opts *opts); 57 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms); 58 int fastopen_connect(int server_fd, const char *data, unsigned int data_len,
|
H A D | network_helpers.c | 197 int fastopen_connect(int server_fd, const char *data, unsigned int data_len, argument 205 if (getsockname(server_fd, (struct sockaddr *)&addr, &addrlen)) { 283 int connect_to_fd_opts(int server_fd, const struct network_helper_opts *opts) argument 298 if (getsockopt(server_fd, SOL_SOCKET, SO_TYPE, &type, &optlen)) { 307 if (getsockopt(server_fd, SOL_SOCKET, SO_PROTOCOL, &protocol, &optlen)) { 314 if (getsockname(server_fd, (struct sockaddr *)&addr, &addrlen)) { 345 int connect_to_fd(int server_fd, int timeout_ms) argument 351 return connect_to_fd_opts(server_fd, &opts); 354 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms) argument 362 if (getsockname(server_fd, (struc [all...] |
H A D | test_tcp_check_syncookie_user.c | 120 static int run_test(int server_fd, int results_fd, bool xdp, argument 151 srv_client = accept(server_fd, NULL, 0); 204 static bool get_port(int server_fd, in_port_t *port) argument 209 if (getsockname(server_fd, (struct sockaddr *)&addr, &len)) {
|
/linux-master/tools/testing/selftests/bpf/prog_tests/ |
H A D | mptcp.c | 156 static int run_test(int cgroup_fd, int server_fd, bool is_mptcp) argument 175 client_fd = connect_to_fd(server_fd, 0); 194 int server_fd, cgroup_fd; local 205 server_fd = start_server(AF_INET, SOCK_STREAM, NULL, 0, 0); 206 if (!ASSERT_GE(server_fd, 0, "start_server")) 209 ASSERT_OK(run_test(cgroup_fd, server_fd, false), "run_test tcp"); 211 close(server_fd); 215 server_fd = start_mptcp_server(AF_INET, NULL, 0, 0); 216 if (!ASSERT_GE(server_fd, 0, "start_mptcp_server")) 219 ASSERT_OK(run_test(cgroup_fd, server_fd, tru 235 verify_mptcpify(int server_fd, int client_fd) argument 269 int server_fd, client_fd, err = 0; local [all...] |
H A D | cgrp_local_storage.c | 87 int server_fd = 0, client_fd = 0, err = 0; local 113 server_fd = start_server(AF_INET6, SOCK_STREAM, "::1", 0, 0); 114 if (!ASSERT_GE(server_fd, 0, "start_server")) 117 client_fd = connect_to_fd(server_fd, 0); 136 close(server_fd);
|
H A D | cgroup_v1v2.c | 10 static int run_test(int cgroup_fd, int server_fd, bool classid) argument 35 fd = connect_to_fd_opts(server_fd, &opts); 48 int server_fd, client_fd, cgroup_fd; local 52 server_fd = start_server(AF_INET, SOCK_STREAM, NULL, port, 0); 53 if (!ASSERT_GE(server_fd, 0, "server_fd")) 55 client_fd = connect_to_fd_opts(server_fd, &opts); 57 close(server_fd); 61 close(server_fd); 67 server_fd [all...] |
H A D | sockopt_inherit.c | 12 static int connect_to_server(int server_fd) argument 24 if (getsockname(server_fd, (struct sockaddr *)&addr, &len)) { 141 int server_fd = -1, client_fd; local 163 server_fd = start_server(); 164 if (!ASSERT_GE(server_fd, 0, "start_server")) 169 (void *)&server_fd), "pthread_create")) { 176 client_fd = connect_to_server(server_fd); 192 close(server_fd);
|
H A D | cg_storage_multi.c | 59 int server_fd = -1, client_fd = -1; local 66 server_fd = start_server(AF_INET, SOCK_DGRAM, NULL, 0, 0); 67 if (server_fd < 0) 70 client_fd = connect_to_fd(server_fd, 0); 77 if (read(server_fd, &message, sizeof(message)) < 0) 84 close(server_fd);
|
H A D | sk_assign.c | 157 run_test(int server_fd, const struct sockaddr *addr, socklen_t len, int type) argument 171 srv_client = accept(server_fd, NULL, NULL); 177 srv_client = server_fd; 209 if (srv_client != server_fd)
|
H A D | tcp_rtt.c | 90 static int run_test(int cgroup_fd, int server_fd) argument 111 client_fd = connect_to_fd(server_fd, 0); 148 int server_fd, cgroup_fd; local 154 server_fd = start_server(AF_INET, SOCK_STREAM, NULL, 0, 0); 155 if (!ASSERT_GE(server_fd, 0, "start_server")) 158 ASSERT_OK(run_test(cgroup_fd, server_fd), "run_test"); 160 close(server_fd);
|
H A D | load_bytes_relative.c | 12 int server_fd, cgroup_fd, prog_fd, map_fd, client_fd; local 26 server_fd = start_server(AF_INET, SOCK_STREAM, NULL, 0, 0); 27 if (CHECK_FAIL(server_fd < 0)) 52 client_fd = connect_to_fd(server_fd, 0); 67 close(server_fd);
|
H A D | connect_force_port.c | 49 static int run_test(int cgroup_fd, int server_fd, int family, int type) argument 118 fd = connect_to_fd(server_fd, 0); 135 int server_fd, cgroup_fd; local 141 server_fd = start_server(AF_INET, SOCK_STREAM, NULL, 60123, 0); 142 if (CHECK_FAIL(server_fd < 0)) 144 CHECK_FAIL(run_test(cgroup_fd, server_fd, AF_INET, SOCK_STREAM)); 145 close(server_fd); 147 server_fd = start_server(AF_INET6, SOCK_STREAM, NULL, 60124, 0); 148 if (CHECK_FAIL(server_fd < 0)) 150 CHECK_FAIL(run_test(cgroup_fd, server_fd, AF_INET [all...] |
H A D | sk_lookup.c | 311 static int tcp_recv_send(int server_fd) argument 317 fd = accept(server_fd, NULL, NULL); 356 static int udp_recv_send(int server_fd) argument 380 n = recvmsg(server_fd, &msg, 0); 436 static int tcp_echo_test(int client_fd, int server_fd) argument 443 err = tcp_recv_send(server_fd); 453 static int udp_echo_test(int client_fd, int server_fd) argument 460 err = udp_recv_send(server_fd); 868 int client_fd, server_fd, err; local 876 server_fd 1150 int err, client_fd, connected_fd, server_fd; local 1221 int map_fd, server_fd, client_fd; local [all...] |
H A D | netns_cookie.c | 15 int server_fd = -1, client_fd = -1, cgroup_fd = -1; local 41 server_fd = start_server(AF_INET6, SOCK_STREAM, "::1", 0, 0); 42 if (CHECK(server_fd < 0, "start_server", "errno %d\n", errno)) 45 client_fd = connect_to_fd(server_fd, 0); 73 if (server_fd != -1) 74 close(server_fd);
|
H A D | socket_cookie.c | 18 int server_fd = 0, client_fd = 0, cgroup_fd = 0, err = 0; local 48 server_fd = start_server(AF_INET6, SOCK_STREAM, "::1", 0, 0); 49 if (CHECK(server_fd < 0, "start_server", "errno %d\n", errno)) 52 client_fd = connect_to_fd(server_fd, 0); 71 close(server_fd);
|
/linux-master/tools/testing/selftests/net/ |
H A D | bind_timewait.c | 45 int server_fd, client_fd, child_fd, ret; local 49 server_fd = socket(AF_INET, SOCK_STREAM, 0); 50 ASSERT_GT(server_fd, 0); 52 ret = bind(server_fd, (struct sockaddr *)&self->addr, self->addrlen); 55 ret = listen(server_fd, 1); 58 ret = getsockname(server_fd, (struct sockaddr *)&self->addr, &self->addrlen); 68 child_fd = accept(server_fd, (struct sockaddr *)&addr, &addrlen); 73 close(server_fd);
|
H A D | tcp_inq.c | 61 int server_fd = (int)(unsigned long)arg; local 71 fd = accept(server_fd, (struct sockaddr *)&addr, &addrlen); 92 close(server_fd); 105 int server_fd, fd; local 124 server_fd = socket(family, SOCK_STREAM, 0); 125 if (server_fd < 0) 128 if (setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR, 131 if (bind(server_fd, (const struct sockaddr *)&listen_addr, 134 if (listen(server_fd, 128) == -1) 137 (void *)(unsigned long)server_fd) ! [all...] |