1
0
mirror of https://passt.top/passt synced 2024-10-01 03:25:48 +00:00
passt/tcp_splice.h
David Gibson 356c6e0677 tcp: Unify part of spliced and non-spliced conn_from_sock path
In tcp_sock_handler() we split off to handle spliced sockets before
checking anything else.  However the first steps of the "new connection"
path for each case are the same: allocate a connection entry and accept()
the connection.

Remove this duplication by making tcp_conn_from_sock() handle both spliced
and non-spliced cases, with help from more specific tcp_tap_conn_from_sock
and tcp_splice_conn_from_sock functions for the later stages which differ.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2022-11-25 01:35:19 +01:00

18 lines
471 B
C

/* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (c) 2022 Red Hat GmbH
* Author: Stefano Brivio <sbrivio@redhat.com>
*/
#ifndef TCP_SPLICE_H
#define TCP_SPLICE_H
struct tcp_splice_conn;
void tcp_sock_handler_splice(struct ctx *c, union epoll_ref ref,
uint32_t events);
void tcp_splice_conn_from_sock(struct ctx *c, union epoll_ref ref,
struct tcp_splice_conn *conn, int s);
void tcp_splice_init(struct ctx *c);
#endif /* TCP_SPLICE_H */