Lines Matching +full:server +full:- +full:side
1 // SPDX-License-Identifier: GPL-2.0-only
3 * vsock_diag_test - vsock_diag.ko test suite
29 /* Per-socket status */
96 print_vsock_addr(fp, st->msg.vdiag_src_cid, st->msg.vdiag_src_port); in print_vsock_stat()
98 print_vsock_addr(fp, st->msg.vdiag_dst_cid, st->msg.vdiag_dst_port); in print_vsock_stat()
100 sock_type_str(st->msg.vdiag_type), in print_vsock_stat()
101 sock_state_str(st->msg.vdiag_state), in print_vsock_stat()
102 sock_shutdown_str(st->msg.vdiag_shutdown), in print_vsock_stat()
103 st->msg.vdiag_ino); in print_vsock_stat()
125 if (st->msg.vdiag_ino == stat.st_ino) in find_vsock_stat()
159 if (st->msg.vdiag_state != state) { in check_socket_state()
161 state, st->msg.vdiag_state); in check_socket_state()
249 st->msg = *resp; in add_vsock_stat()
250 list_add_tail(&st->list, sockets); in add_vsock_stat()
284 if (h->nlmsg_type == NLMSG_DONE) in read_vsock_stat()
287 if (h->nlmsg_type == NLMSG_ERROR) { in read_vsock_stat()
290 if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) in read_vsock_stat()
293 errno = -err->error; in read_vsock_stat()
300 if (h->nlmsg_type != SOCK_DIAG_BY_FAMILY) { in read_vsock_stat()
302 h->nlmsg_type); in read_vsock_stat()
305 if (h->nlmsg_len < in read_vsock_stat()
347 .svm_port = opts->peer_port, in test_listen_socket_server()
383 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_connect_client()
408 client_fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_connect_server()
447 .name = "control-host",
452 .name = "control-port",
462 .name = "peer-cid",
467 .name = "peer-port",
491 …ck_diag_test [--help] [--control-host=<host>] --control-port=<port> --mode=client|server --peer-ci… in usage()
493 " Server: vsock_diag_test --control-port=1234 --mode=server --peer-cid=3\n" in usage()
494 …" Client: vsock_diag_test --control-host=192.168.0.1 --control-port=1234 --mode=client --peer-cid… in usage()
497 "guest and host. One side must use --mode=client and\n" in usage()
498 "the other side must use --mode=server.\n" in usage()
501 "between the client and the server. The server requires a\n" in usage()
505 "The CID of the other side must be given with --peer-cid=<cid>.\n" in usage()
508 " --help This help message\n" in usage()
509 " --control-host <host> Server IP address to connect to\n" in usage()
510 " --control-port <port> Server port to listen on/connect to\n" in usage()
511 " --mode client|server Server or client mode\n" in usage()
512 " --peer-cid <cid> CID of the other side\n" in usage()
513 " --peer-port <port> AF_VSOCK port used for the test [default: %d]\n" in usage()
514 " --list List of tests that will be executed\n" in usage()
515 " --skip <test_id> Test ID to skip;\n" in usage()
516 " use multiple --skip options to skip more tests\n", in usage()
537 if (opt == -1) in main()
547 else if (strcmp(optarg, "server") == 0) in main()
550 fprintf(stderr, "--mode must be \"client\" or \"server\"\n"); in main()
567 skip_test(test_cases, ARRAY_SIZE(test_cases) - 1, in main()