Lines Matching refs:opts

38 static void test_stream_connection_reset(const struct test_opts *opts)  in test_stream_connection_reset()  argument
46 .svm_port = opts->peer_port, in test_stream_connection_reset()
47 .svm_cid = opts->peer_cid, in test_stream_connection_reset()
74 static void test_stream_bind_only_client(const struct test_opts *opts) in test_stream_bind_only_client() argument
82 .svm_port = opts->peer_port, in test_stream_bind_only_client()
83 .svm_cid = opts->peer_cid, in test_stream_bind_only_client()
116 static void test_stream_bind_only_server(const struct test_opts *opts) in test_stream_bind_only_server() argument
120 fd = vsock_bind(VMADDR_CID_ANY, opts->peer_port, SOCK_STREAM); in test_stream_bind_only_server()
131 static void test_stream_client_close_client(const struct test_opts *opts) in test_stream_client_close_client() argument
135 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_client_close_client()
145 static void test_stream_client_close_server(const struct test_opts *opts) in test_stream_client_close_server() argument
149 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_client_close_server()
166 static void test_stream_server_close_client(const struct test_opts *opts) in test_stream_server_close_client() argument
170 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_server_close_client()
187 static void test_stream_server_close_server(const struct test_opts *opts) in test_stream_server_close_server() argument
191 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_server_close_server()
206 static void test_stream_multiconn_client(const struct test_opts *opts) in test_stream_multiconn_client() argument
212 fds[i] = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_multiconn_client()
230 static void test_stream_multiconn_server(const struct test_opts *opts) in test_stream_multiconn_server() argument
236 fds[i] = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_multiconn_server()
256 static void test_msg_peek_client(const struct test_opts *opts, in test_msg_peek_client() argument
264 fd = vsock_seqpacket_connect(opts->peer_cid, opts->peer_port); in test_msg_peek_client()
266 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_msg_peek_client()
283 static void test_msg_peek_server(const struct test_opts *opts, in test_msg_peek_server() argument
292 fd = vsock_seqpacket_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_msg_peek_server()
294 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_msg_peek_server()
339 static void test_stream_msg_peek_client(const struct test_opts *opts) in test_stream_msg_peek_client() argument
341 return test_msg_peek_client(opts, false); in test_stream_msg_peek_client()
344 static void test_stream_msg_peek_server(const struct test_opts *opts) in test_stream_msg_peek_server() argument
346 return test_msg_peek_server(opts, false); in test_stream_msg_peek_server()
352 static void test_seqpacket_msg_bounds_client(const struct test_opts *opts) in test_seqpacket_msg_bounds_client() argument
360 fd = vsock_seqpacket_connect(opts->peer_cid, opts->peer_port); in test_seqpacket_msg_bounds_client()
422 static void test_seqpacket_msg_bounds_server(const struct test_opts *opts) in test_seqpacket_msg_bounds_server() argument
431 fd = vsock_seqpacket_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_seqpacket_msg_bounds_server()
493 static void test_seqpacket_msg_trunc_client(const struct test_opts *opts) in test_seqpacket_msg_trunc_client() argument
498 fd = vsock_seqpacket_connect(opts->peer_cid, opts->peer_port); in test_seqpacket_msg_trunc_client()
510 static void test_seqpacket_msg_trunc_server(const struct test_opts *opts) in test_seqpacket_msg_trunc_server() argument
517 fd = vsock_seqpacket_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_seqpacket_msg_trunc_server()
560 static void test_seqpacket_timeout_client(const struct test_opts *opts) in test_seqpacket_timeout_client() argument
568 fd = vsock_seqpacket_connect(opts->peer_cid, opts->peer_port); in test_seqpacket_timeout_client()
607 static void test_seqpacket_timeout_server(const struct test_opts *opts) in test_seqpacket_timeout_server() argument
611 fd = vsock_seqpacket_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_seqpacket_timeout_server()
621 static void test_seqpacket_bigmsg_client(const struct test_opts *opts) in test_seqpacket_bigmsg_client() argument
631 fd = vsock_seqpacket_connect(opts->peer_cid, opts->peer_port); in test_seqpacket_bigmsg_client()
666 static void test_seqpacket_bigmsg_server(const struct test_opts *opts) in test_seqpacket_bigmsg_server() argument
670 fd = vsock_seqpacket_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_seqpacket_bigmsg_server()
684 static void test_seqpacket_invalid_rec_buffer_client(const struct test_opts *opts) in test_seqpacket_invalid_rec_buffer_client() argument
691 fd = vsock_seqpacket_connect(opts->peer_cid, opts->peer_port); in test_seqpacket_invalid_rec_buffer_client()
719 static void test_seqpacket_invalid_rec_buffer_server(const struct test_opts *opts) in test_seqpacket_invalid_rec_buffer_server() argument
731 fd = vsock_seqpacket_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_seqpacket_invalid_rec_buffer_server()
802 static void test_stream_poll_rcvlowat_server(const struct test_opts *opts) in test_stream_poll_rcvlowat_server() argument
807 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_poll_rcvlowat_server()
830 static void test_stream_poll_rcvlowat_client(const struct test_opts *opts) in test_stream_poll_rcvlowat_client() argument
838 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_poll_rcvlowat_client()
895 static void test_inv_buf_client(const struct test_opts *opts, bool stream) in test_inv_buf_client() argument
902 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_inv_buf_client()
904 fd = vsock_seqpacket_connect(opts->peer_cid, opts->peer_port); in test_inv_buf_client()
931 static void test_inv_buf_server(const struct test_opts *opts, bool stream) in test_inv_buf_server() argument
937 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_inv_buf_server()
939 fd = vsock_seqpacket_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_inv_buf_server()
955 static void test_stream_inv_buf_client(const struct test_opts *opts) in test_stream_inv_buf_client() argument
957 test_inv_buf_client(opts, true); in test_stream_inv_buf_client()
960 static void test_stream_inv_buf_server(const struct test_opts *opts) in test_stream_inv_buf_server() argument
962 test_inv_buf_server(opts, true); in test_stream_inv_buf_server()
965 static void test_seqpacket_inv_buf_client(const struct test_opts *opts) in test_seqpacket_inv_buf_client() argument
967 test_inv_buf_client(opts, false); in test_seqpacket_inv_buf_client()
970 static void test_seqpacket_inv_buf_server(const struct test_opts *opts) in test_seqpacket_inv_buf_server() argument
972 test_inv_buf_server(opts, false); in test_seqpacket_inv_buf_server()
978 static void test_stream_virtio_skb_merge_client(const struct test_opts *opts) in test_stream_virtio_skb_merge_client() argument
982 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_virtio_skb_merge_client()
1005 static void test_stream_virtio_skb_merge_server(const struct test_opts *opts) in test_stream_virtio_skb_merge_server() argument
1011 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_virtio_skb_merge_server()
1046 static void test_seqpacket_msg_peek_client(const struct test_opts *opts) in test_seqpacket_msg_peek_client() argument
1048 return test_msg_peek_client(opts, true); in test_seqpacket_msg_peek_client()
1051 static void test_seqpacket_msg_peek_server(const struct test_opts *opts) in test_seqpacket_msg_peek_server() argument
1053 return test_msg_peek_server(opts, true); in test_seqpacket_msg_peek_server()
1124 static void test_stream_shutwr_client(const struct test_opts *opts) in test_stream_shutwr_client() argument
1134 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_shutwr_client()
1152 static void test_stream_shutwr_server(const struct test_opts *opts) in test_stream_shutwr_server() argument
1156 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_shutwr_server()
1167 static void test_stream_shutrd_client(const struct test_opts *opts) in test_stream_shutrd_client() argument
1177 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_shutrd_client()
1192 static void test_stream_shutrd_server(const struct test_opts *opts) in test_stream_shutrd_server() argument
1196 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_shutrd_server()
1213 static void test_double_bind_connect_server(const struct test_opts *opts) in test_double_bind_connect_server() argument
1219 listen_fd = vsock_stream_listen(VMADDR_CID_ANY, opts->peer_port); in test_double_bind_connect_server()
1244 static void test_double_bind_connect_client(const struct test_opts *opts) in test_double_bind_connect_client() argument
1257 client_fd = vsock_bind_connect(opts->peer_cid, opts->peer_port, in test_double_bind_connect_client()
1258 opts->peer_port + 1, SOCK_STREAM); in test_double_bind_connect_client()
1265 static void test_unsent_bytes_server(const struct test_opts *opts, int type) in test_unsent_bytes_server() argument
1270 client_fd = vsock_accept(VMADDR_CID_ANY, opts->peer_port, NULL, type); in test_unsent_bytes_server()
1282 static void test_unsent_bytes_client(const struct test_opts *opts, int type) in test_unsent_bytes_client() argument
1287 fd = vsock_connect(opts->peer_cid, opts->peer_port, type); in test_unsent_bytes_client()
1311 static void test_unread_bytes_server(const struct test_opts *opts, int type) in test_unread_bytes_server() argument
1316 client_fd = vsock_accept(VMADDR_CID_ANY, opts->peer_port, NULL, type); in test_unread_bytes_server()
1331 static void test_unread_bytes_client(const struct test_opts *opts, int type) in test_unread_bytes_client() argument
1336 fd = vsock_connect(opts->peer_cid, opts->peer_port, type); in test_unread_bytes_client()
1359 static void test_stream_unsent_bytes_client(const struct test_opts *opts) in test_stream_unsent_bytes_client() argument
1361 test_unsent_bytes_client(opts, SOCK_STREAM); in test_stream_unsent_bytes_client()
1364 static void test_stream_unsent_bytes_server(const struct test_opts *opts) in test_stream_unsent_bytes_server() argument
1366 test_unsent_bytes_server(opts, SOCK_STREAM); in test_stream_unsent_bytes_server()
1369 static void test_seqpacket_unsent_bytes_client(const struct test_opts *opts) in test_seqpacket_unsent_bytes_client() argument
1371 test_unsent_bytes_client(opts, SOCK_SEQPACKET); in test_seqpacket_unsent_bytes_client()
1374 static void test_seqpacket_unsent_bytes_server(const struct test_opts *opts) in test_seqpacket_unsent_bytes_server() argument
1376 test_unsent_bytes_server(opts, SOCK_SEQPACKET); in test_seqpacket_unsent_bytes_server()
1379 static void test_stream_unread_bytes_client(const struct test_opts *opts) in test_stream_unread_bytes_client() argument
1381 test_unread_bytes_client(opts, SOCK_STREAM); in test_stream_unread_bytes_client()
1384 static void test_stream_unread_bytes_server(const struct test_opts *opts) in test_stream_unread_bytes_server() argument
1386 test_unread_bytes_server(opts, SOCK_STREAM); in test_stream_unread_bytes_server()
1389 static void test_seqpacket_unread_bytes_client(const struct test_opts *opts) in test_seqpacket_unread_bytes_client() argument
1391 test_unread_bytes_client(opts, SOCK_SEQPACKET); in test_seqpacket_unread_bytes_client()
1394 static void test_seqpacket_unread_bytes_server(const struct test_opts *opts) in test_seqpacket_unread_bytes_server() argument
1396 test_unread_bytes_server(opts, SOCK_SEQPACKET); in test_seqpacket_unread_bytes_server()
1407 static void test_stream_rcvlowat_def_cred_upd_client(const struct test_opts *opts) in test_stream_rcvlowat_def_cred_upd_client() argument
1413 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_rcvlowat_def_cred_upd_client()
1440 static void test_stream_credit_update_test(const struct test_opts *opts, in test_stream_credit_update_test() argument
1450 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_credit_update_test()
1550 static void test_stream_cred_upd_on_low_rx_bytes(const struct test_opts *opts) in test_stream_cred_upd_on_low_rx_bytes() argument
1552 test_stream_credit_update_test(opts, true); in test_stream_cred_upd_on_low_rx_bytes()
1555 static void test_stream_cred_upd_on_set_rcvlowat(const struct test_opts *opts) in test_stream_cred_upd_on_set_rcvlowat() argument
1557 test_stream_credit_update_test(opts, false); in test_stream_cred_upd_on_set_rcvlowat()
1574 static void test_stream_leak_acceptq_client(const struct test_opts *opts) in test_stream_leak_acceptq_client() argument
1583 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_leak_acceptq_client()
1592 static void test_stream_leak_acceptq_server(const struct test_opts *opts) in test_stream_leak_acceptq_server() argument
1597 fd = vsock_stream_listen(VMADDR_CID_ANY, opts->peer_port); in test_stream_leak_acceptq_server()
1604 static void test_stream_msgzcopy_leak_errq_client(const struct test_opts *opts) in test_stream_msgzcopy_leak_errq_client() argument
1609 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_msgzcopy_leak_errq_client()
1628 static void test_stream_msgzcopy_leak_errq_server(const struct test_opts *opts) in test_stream_msgzcopy_leak_errq_server() argument
1632 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_msgzcopy_leak_errq_server()
1713 static void test_stream_msgzcopy_leak_zcskb_client(const struct test_opts *opts) in test_stream_msgzcopy_leak_zcskb_client() argument
1735 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_msgzcopy_leak_zcskb_client()
1776 static void test_stream_msgzcopy_leak_zcskb_server(const struct test_opts *opts) in test_stream_msgzcopy_leak_zcskb_server() argument
1780 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_msgzcopy_leak_zcskb_server()
1882 static void test_stream_transport_uaf_client(const struct test_opts *opts) in test_stream_transport_uaf_client() argument
1899 static void test_stream_connect_retry_client(const struct test_opts *opts) in test_stream_connect_retry_client() argument
1909 if (!vsock_connect_fd(fd, opts->peer_cid, opts->peer_port)) { in test_stream_connect_retry_client()
1917 if (vsock_connect_fd(fd, opts->peer_cid, opts->peer_port)) { in test_stream_connect_retry_client()
1925 static void test_stream_connect_retry_server(const struct test_opts *opts) in test_stream_connect_retry_server() argument
1931 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_connect_retry_server()
1968 static void test_stream_transport_change_client(const struct test_opts *opts) in test_stream_transport_change_client() argument
2006 .svm_cid = opts->peer_cid, in test_stream_transport_change_client()
2007 .svm_port = opts->peer_port, in test_stream_transport_change_client()
2076 static void test_stream_transport_change_server(const struct test_opts *opts) in test_stream_transport_change_server() argument
2078 int s = vsock_stream_listen(VMADDR_CID_ANY, opts->peer_port); in test_stream_transport_change_server()
2115 static void test_stream_linger_client(const struct test_opts *opts) in test_stream_linger_client() argument
2119 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_linger_client()
2129 static void test_stream_linger_server(const struct test_opts *opts) in test_stream_linger_server() argument
2133 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_linger_server()
2146 static void test_stream_nolinger_client(const struct test_opts *opts) in test_stream_nolinger_client() argument
2152 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_nolinger_client()
2176 static void test_stream_nolinger_server(const struct test_opts *opts) in test_stream_nolinger_server() argument
2180 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_nolinger_server()
2464 struct test_opts opts = { in main() local
2485 opts.mode = TEST_MODE_CLIENT; in main()
2487 opts.mode = TEST_MODE_SERVER; in main()
2494 opts.peer_cid = parse_cid(optarg); in main()
2497 opts.peer_port = parse_port(optarg); in main()
2521 if (opts.mode == TEST_MODE_UNSET) in main()
2523 if (opts.peer_cid == VMADDR_CID_ANY) in main()
2527 if (opts.mode != TEST_MODE_SERVER) in main()
2533 opts.mode == TEST_MODE_SERVER); in main()
2535 run_tests(test_cases, &opts); in main()