diff options
author | Laurent Vivier <lvivier@redhat.com> | 2024-06-13 14:36:49 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-06-13 15:45:05 +0200 |
commit | fba2b544b6c60904ac1818fba44aa86772e40ebf (patch) | |
tree | 7cdcaa97c9959cfd3ee5c2c6dea8f8e34b8e1ae1 /tcp_buf.h | |
parent | ec26fa013ad94cab4e7585c3eaedddb4b41a64fa (diff) | |
download | passt-fba2b544b6c60904ac1818fba44aa86772e40ebf.tar passt-fba2b544b6c60904ac1818fba44aa86772e40ebf.tar.gz passt-fba2b544b6c60904ac1818fba44aa86772e40ebf.tar.bz2 passt-fba2b544b6c60904ac1818fba44aa86772e40ebf.tar.lz passt-fba2b544b6c60904ac1818fba44aa86772e40ebf.tar.xz passt-fba2b544b6c60904ac1818fba44aa86772e40ebf.tar.zst passt-fba2b544b6c60904ac1818fba44aa86772e40ebf.zip |
tcp: move buffers management functions to their own file
Move all the TCP parts using internal buffers to tcp_buf.c
and keep generic TCP management functions in tcp.c.
Add tcp_internal.h to export needed functions from tcp.c and
tcp_buf.h from tcp_buf.c
With this change we can use existing TCP functions with a
different kind of memory storage as for instance the shared
memory provided by the guest via vhost-user.
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp_buf.h')
-rw-r--r-- | tcp_buf.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tcp_buf.h b/tcp_buf.h new file mode 100644 index 0000000..14be7b9 --- /dev/null +++ b/tcp_buf.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later + * Copyright (c) 2021 Red Hat GmbH + * Author: Stefano Brivio <sbrivio@redhat.com> + */ + +#ifndef TCP_BUF_H +#define TCP_BUF_H + +void tcp_sock4_iov_init(const struct ctx *c); +void tcp_sock6_iov_init(const struct ctx *c); +void tcp_flags_flush(const struct ctx *c); +void tcp_payload_flush(const struct ctx *c); +int tcp_buf_data_from_sock(struct ctx *c, struct tcp_tap_conn *conn); +int tcp_buf_send_flag(struct ctx *c, struct tcp_tap_conn *conn, int flags); + +#endif /*TCP_BUF_H */ |