| /linux/tools/testing/selftests/bpf/prog_tests/ |
| H A D | connect_force_port.c | 49 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 …]
|
| H A D | cgroup_v1v2.c | 10 static int run_test(int cgroup_fd, int server_fd, bool classid) in run_test() argument 19 port = get_socket_local_port(server_fd); in run_test() 39 fd = connect_to_fd_opts(server_fd, NULL); in run_test() 56 int server_fd, client_fd, cgroup_fd; in test_cgroup_v1v2() 59 server_fd = start_server(AF_INET, SOCK_STREAM, NULL, 0, 0); in test_cgroup_v1v2() 60 if (!ASSERT_GE(server_fd, 0, "server_fd")) in test_cgroup_v1v2() 62 client_fd = connect_to_fd_opts(server_fd, &opts); in test_cgroup_v1v2() 64 close(server_fd); in test_cgroup_v1v2() 68 close(server_fd); in test_cgroup_v1v2() 50 int server_fd, client_fd, cgroup_fd; test_cgroup_v1v2() local [all...] |
| H A D | mptcp.c | 156 static int run_test(int cgroup_fd, int server_fd, bool is_mptcp) in run_test() argument 175 client_fd = connect_to_fd(server_fd, 0); in run_test() 194 int server_fd, cgroup_fd; in test_base() local 205 server_fd = start_server(AF_INET, SOCK_STREAM, NULL, 0, 0); in test_base() 206 if (!ASSERT_GE(server_fd, 0, "start_server")) in test_base() 209 ASSERT_OK(run_test(cgroup_fd, server_fd, false), "run_test tcp"); in test_base() 211 close(server_fd); in test_base() 215 server_fd = start_mptcp_server(AF_INET, NULL, 0, 0); in test_base() 216 if (!ASSERT_GE(server_fd, 0, "start_mptcp_server")) in test_base() 219 ASSERT_OK(run_test(cgroup_fd, server_fd, true), "run_test mptcp"); in test_base() [all …]
|
| H A D | ns_current_pid_tgid.c | 82 int server_fd = -1, ret = -1, err; in test_current_pid_tgid_cgrp() local 105 server_fd = start_server(AF_INET, SOCK_STREAM, NULL, 0, 0); in test_current_pid_tgid_cgrp() 106 if (!ASSERT_GE(server_fd, 0, "start_server")) in test_current_pid_tgid_cgrp() 116 if (server_fd >= 0) in test_current_pid_tgid_cgrp() 117 close(server_fd); in test_current_pid_tgid_cgrp() 124 int verdict, map, server_fd = -1, client_fd = -1; in test_current_pid_tgid_sk_msg() local 151 server_fd = start_server(AF_INET6, SOCK_STREAM, "::1", 0, 0); in test_current_pid_tgid_sk_msg() 152 if (!ASSERT_GE(server_fd, 0, "start_server")) in test_current_pid_tgid_sk_msg() 155 client_fd = connect_to_fd(server_fd, 0); in test_current_pid_tgid_sk_msg() 174 if (server_fd > in test_current_pid_tgid_sk_msg() [all...] |
| H A D | tcp_rtt.c | 105 static int run_test(int cgroup_fd, int server_fd) in run_test() argument 126 client_fd = connect_to_fd(server_fd, 0); in run_test() 163 int server_fd, cgroup_fd; in test_tcp_rtt() local 169 server_fd = start_server(AF_INET, SOCK_STREAM, NULL, 0, 0); in test_tcp_rtt() 170 if (!ASSERT_GE(server_fd, 0, "start_server")) in test_tcp_rtt() 173 ASSERT_OK(run_test(cgroup_fd, server_fd), "run_test"); in test_tcp_rtt() 175 close(server_fd); in test_tcp_rtt()
|
| H A 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()
|
| H A D | xdp_synproxy.c | 60 int server_fd = -1, client_fd = -1, accept_fd = -1; in test_synproxy() local 128 server_fd = start_server(AF_INET, SOCK_STREAM, "198.18.0.2", 8080, 0); in test_synproxy() 129 if (!ASSERT_GE(server_fd, 0, "start_server")) in test_synproxy() 135 client_fd = connect_to_fd(server_fd, 10000); in test_synproxy() 139 accept_fd = accept(server_fd, NULL, NULL); in test_synproxy() 163 if (server_fd >= 0) in test_synproxy() 164 close(server_fd); in test_synproxy()
|
| H A 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()
|
| H A D | sockopt_inherit.c | 98 int server_fd = -1, client_fd; in run_test() local 124 server_fd = start_server_addr(SOCK_STREAM, (struct sockaddr_storage *)&addr, in run_test() 126 if (!ASSERT_GE(server_fd, 0, "start_server")) in run_test() 131 (void *)&server_fd), "pthread_create")) { in run_test() 138 client_fd = connect_to_fd(server_fd, 0); in run_test() 154 close(server_fd); in run_test()
|
| H A D | sk_lookup.c | 257 static int tcp_recv_send(int server_fd) in tcp_recv_send() argument 263 fd = accept(server_fd, NULL, NULL); in tcp_recv_send() 302 static int udp_recv_send(int server_fd) in udp_recv_send() argument 326 n = recvmsg(server_fd, &msg, 0); in udp_recv_send() 376 static int tcp_echo_test(int client_fd, int server_fd) in tcp_echo_test() argument 383 err = tcp_recv_send(server_fd); in tcp_echo_test() 393 static int udp_echo_test(int client_fd, int server_fd) in udp_echo_test() argument 400 err = udp_recv_send(server_fd); in udp_echo_test() 804 int client_fd, server_fd, err; in drop_on_lookup() local 813 server_fd = make_server(t->sotype, t->listen_at.ip, t->listen_at.port, in drop_on_lookup() [all …]
|
| H A 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()
|
| H A D | sk_assign.c | 112 run_test(int server_fd, const struct sockaddr *addr, socklen_t len, int type) in run_test() 126 srv_client = accept(server_fd, NULL, NULL); in run_test() 132 srv_client = server_fd; in run_test() 164 if (srv_client != server_fd) in run_test() 110 run_test(int server_fd,const struct sockaddr * addr,socklen_t len,int type) run_test() argument
|
| /linux/tools/testing/selftests/net/ |
| H A D | bind_timewait.c | 45 int server_fd, client_fd, child_fd, ret; in create_timewait_socket() local 49 server_fd = socket(AF_INET, SOCK_STREAM, 0); in create_timewait_socket() 50 ASSERT_GT(server_fd, 0); in create_timewait_socket() 52 ret = bind(server_fd, (struct sockaddr *)&self->addr, self->addrlen); in create_timewait_socket() 55 ret = listen(server_fd, 1); in create_timewait_socket() 58 ret = getsockname(server_fd, (struct sockaddr *)&self->addr, &self->addrlen); in create_timewait_socket() 68 child_fd = accept(server_fd, (struct sockaddr *)&addr, &addrlen); in create_timewait_socket() 73 close(server_fd); in create_timewait_socket()
|
| H A 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()
|
| /linux/tools/testing/selftests/bpf/ |
| H A D | network_helpers.h | 78 int connect_to_fd(int server_fd, int timeout_ms); 79 int connect_to_fd_opts(int server_fd, const struct network_helper_opts *opts); 80 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms); 81 int fastopen_connect(int server_fd, const char *data, unsigned int data_len,
|
| H A D | xdp_hw_metadata.c | 444 static int verify_metadata(struct xsk *rx_xsk, int rxq, int server_fd, clockid_t clock_id) in verify_metadata() argument 461 fds[rxq].fd = server_fd; in verify_metadata() 484 verify_skb_metadata(server_fd); in verify_metadata() 739 int server_fd = -1; in main() local 856 server_fd = start_server(AF_INET6, SOCK_DGRAM, NULL, 9092, 1000); in main() 857 if (server_fd < 0) in main() 859 timestamping_enable(server_fd, in main() 882 ret = verify_metadata(rx_xsk, rxq, server_fd, clock_id); in main() 883 close(server_fd); in main()
|
| H A D | network_helpers.c | 229 int fastopen_connect(int server_fd, const char *data, unsigned int data_len, in fastopen_connect() 237 if (getsockname(server_fd, (struct sockaddr *)&addr, &addrlen)) { in fastopen_connect() 332 int connect_to_fd_opts(int server_fd, const struct network_helper_opts *opts) in connect_to_fd_opts() 342 if (getsockopt(server_fd, SOL_SOCKET, SO_TYPE, &type, &optlen)) { in connect_to_fd_opts() 348 if (getsockname(server_fd, (struct sockaddr *)&addr, &addrlen)) { in connect_to_fd_opts() 356 int connect_to_fd(int server_fd, int timeout_ms) in connect_to_fd() 365 if (getsockopt(server_fd, SOL_SOCKET, SO_PROTOCOL, &protocol, &optlen)) { in connect_to_fd() 371 return connect_to_fd_opts(server_fd, &opts); in connect_fd_to_fd() 374 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms) in connect_fd_to_fd() 382 if (getsockname(server_fd, (struc in connect_fd_to_fd() 223 fastopen_connect(int server_fd,const char * data,unsigned int data_len,int timeout_ms) fastopen_connect() argument 326 connect_to_fd_opts(int server_fd,const struct network_helper_opts * opts) connect_to_fd_opts() argument 350 connect_to_fd(int server_fd,int timeout_ms) connect_to_fd() argument 368 connect_fd_to_fd(int client_fd,int server_fd,int timeout_ms) connect_fd_to_fd() argument [all...] |