/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 33 fd = connect_to_fd_opts(server_fd, NULL); in run_test() 50 int server_fd, client_fd, cgroup_fd; in test_cgroup_v1v2() local 54 server_fd = start_server(AF_INET, SOCK_STREAM, NULL, port, 0); in test_cgroup_v1v2() 55 if (!ASSERT_GE(server_fd, 0, "server_fd")) in test_cgroup_v1v2() 57 client_fd = connect_to_fd_opts(server_fd, &opts); in test_cgroup_v1v2() 59 close(server_fd); in test_cgroup_v1v2() 63 close(server_fd); in test_cgroup_v1v2() 69 server_fd = start_server(AF_INET, SOCK_STREAM, NULL, port, 0); in test_cgroup_v1v2() 70 if (!ASSERT_GE(server_fd, 0, "server_fd")) { in test_cgroup_v1v2() [all …]
|
H A D | mptcp.c | 154 static int run_test(int cgroup_fd, int server_fd, bool is_mptcp) in verify_msk() 173 client_fd = connect_to_fd(server_fd, 0); in run_test() 192 int server_fd, cgroup_fd; in run_test() 203 server_fd = start_server(AF_INET, SOCK_STREAM, NULL, 0, 0); in test_base() 204 if (!ASSERT_GE(server_fd, 0, "start_server")) in test_base() 207 ASSERT_OK(run_test(cgroup_fd, server_fd, false), "run_test tcp"); in test_base() 209 close(server_fd); in test_base() 213 server_fd = start_mptcp_server(AF_INET, NULL, 0, 0); in test_base() 214 if (!ASSERT_GE(server_fd, 0, "start_mptcp_server")) in test_base() 217 ASSERT_OK(run_test(cgroup_fd, server_fd, tru in test_base() 167 run_test(int cgroup_fd,int server_fd,bool is_mptcp) run_test() argument 205 int server_fd, cgroup_fd; test_base() local 246 verify_mptcpify(int server_fd,int client_fd) verify_mptcpify() argument 280 int server_fd, client_fd, err = 0; run_mptcpify() local [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 >= 0) in test_current_pid_tgid_sk_msg() [all …]
|
H A D | netns_cookie.c | 19 int server_fd = -1, client_fd = -1, cgroup_fd = -1; in test_netns_cookie() 50 server_fd = start_server(AF_INET6, SOCK_STREAM, "::1", 0, 0); in test_netns_cookie() 51 if (CHECK(server_fd < 0, "start_server", "errno %d\n", errno)) in test_netns_cookie() 54 client_fd = connect_to_fd(server_fd, 0); in test_netns_cookie() 88 if (server_fd != -1) 89 close(server_fd); 15 int server_fd = -1, client_fd = -1, cgroup_fd = -1; test_netns_cookie() local
|
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 | cgrp_local_storage.c | 87 int server_fd = 0, client_fd = 0, err = 0; in test_attach_cgroup() local 113 server_fd = start_server(AF_INET6, SOCK_STREAM, "::1", 0, 0); in test_attach_cgroup() 114 if (!ASSERT_GE(server_fd, 0, "start_server")) in test_attach_cgroup() 117 client_fd = connect_to_fd(server_fd, 0); in test_attach_cgroup() 136 close(server_fd); in test_attach_cgroup()
|
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 | 110 run_test(int server_fd, const struct sockaddr *addr, socklen_t len, int type) in run_test() argument 124 srv_client = accept(server_fd, NULL, NULL); in run_test() 130 srv_client = server_fd; in run_test() 162 if (srv_client != server_fd) in run_test()
|
/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 | 75 int connect_to_fd(int server_fd, int timeout_ms); 76 int connect_to_fd_opts(int server_fd, const struct network_helper_opts *opts); 77 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms); 78 int fastopen_connect(int server_fd, const char *data, unsigned int data_len,
|
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) in verify_metadata() argument 421 fds[rxq].fd = server_fd; in verify_metadata() 444 verify_skb_metadata(server_fd); in verify_metadata() 662 int server_fd = -1; in main() local 704 server_fd = start_server(AF_INET6, SOCK_DGRAM, NULL, 9092, 1000); in main() 705 if (server_fd < 0) in main() 707 timestamping_enable(server_fd, in main() 730 ret = verify_metadata(rx_xsk, rxq, server_fd, clock_id); in main() 731 close(server_fd); in main()
|
H A D | test_tcp_check_syncookie_user.c |
|
H A D | network_helpers.c | 223 int fastopen_connect(int server_fd, const char *data, unsigned int data_len, in fastopen_connect() argument 231 if (getsockname(server_fd, (struct sockaddr *)&addr, &addrlen)) { in fastopen_connect() 326 int connect_to_fd_opts(int server_fd, const struct network_helper_opts *opts) in connect_to_fd_opts() argument 336 if (getsockopt(server_fd, SOL_SOCKET, SO_TYPE, &type, &optlen)) { in connect_to_fd_opts() 342 if (getsockname(server_fd, (struct sockaddr *)&addr, &addrlen)) { in connect_to_fd_opts() 350 int connect_to_fd(int server_fd, int timeout_ms) in connect_to_fd() argument 359 if (getsockopt(server_fd, SOL_SOCKET, SO_PROTOCOL, &protocol, &optlen)) { in connect_to_fd() 365 return connect_to_fd_opts(server_fd, &opts); in connect_to_fd() 368 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms) in connect_fd_to_fd() argument 376 if (getsockname(server_fd, (struct sockaddr *)&addr, &len)) { in connect_fd_to_fd()
|