summaryrefslogtreecommitdiff
path: root/tools/testing/vsock/util.h
diff options
context:
space:
mode:
authorLuigi Leonardi <luigi.leonardi@outlook.com>2024-07-30 21:43:08 +0200
committerDavid S. Miller <davem@davemloft.net>2024-08-02 09:20:28 +0100
commit18ee44ce97c18ee72f5807140d07ff8cebe3cab5 (patch)
treebed6f1d43b4e565cda910594fac8835701c715f0 /tools/testing/vsock/util.h
parente6ab45005772014ce49a693a63f928203c0cbbb0 (diff)
test/vsock: add ioctl unsent bytes test
Introduce two tests, one for SOCK_STREAM and one for SOCK_SEQPACKET, which use SIOCOUTQ ioctl to check that the number of unsent bytes is zero after delivering a packet. vsock_connect and vsock_accept are no longer static: this is to create more generic tests, allowing code to be reused for SEQPACKET and STREAM. Signed-off-by: Luigi Leonardi <luigi.leonardi@outlook.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/vsock/util.h')
-rw-r--r--tools/testing/vsock/util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/testing/vsock/util.h b/tools/testing/vsock/util.h
index e95e62485959..fff22d4a14c0 100644
--- a/tools/testing/vsock/util.h
+++ b/tools/testing/vsock/util.h
@@ -39,6 +39,9 @@ struct test_case {
void init_signals(void);
unsigned int parse_cid(const char *str);
unsigned int parse_port(const char *str);
+int vsock_connect(unsigned int cid, unsigned int port, int type);
+int vsock_accept(unsigned int cid, unsigned int port,
+ struct sockaddr_vm *clientaddrp, int type);
int vsock_stream_connect(unsigned int cid, unsigned int port);
int vsock_bind_connect(unsigned int cid, unsigned int port,
unsigned int bind_port, int type);