diff options
author | Stefano Garzarella <sgarzare@redhat.com> | 2023-09-15 14:14:50 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-09-17 17:42:37 +0100 |
commit | 12329bd51fdcde211fd9c76015ded4db3458ba8a (patch) | |
tree | e577faf5a470df529b2805dd4c9b8dbe99a92de8 /tools/testing/vsock/util.h | |
parent | a0bcb83577165b0d6fb948c8ab207a1dd7146f6f (diff) |
vsock/test: add send_buf() utility function
Move the code of send_byte() out in a new utility function that
can be used to send a generic buffer.
This new function can be used when we need to send a custom
buffer and not just a single 'A' byte.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Arseniy Krasnov <avkrasnov@salutedevices.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.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/vsock/util.h b/tools/testing/vsock/util.h index fe31f267e67e..e5407677ce05 100644 --- a/tools/testing/vsock/util.h +++ b/tools/testing/vsock/util.h @@ -42,6 +42,8 @@ int vsock_stream_accept(unsigned int cid, unsigned int port, int vsock_seqpacket_accept(unsigned int cid, unsigned int port, struct sockaddr_vm *clientaddrp); void vsock_wait_remote_close(int fd); +void send_buf(int fd, const void *buf, size_t len, int flags, + ssize_t expected_ret); void recv_buf(int fd, void *buf, size_t len, int flags, ssize_t expected_ret); void send_byte(int fd, int expected_ret, int flags); void recv_byte(int fd, int expected_ret, int flags); |