mirror of
https://passt.top/passt
synced 2024-12-22 13:45:32 +00:00
dc9a5d71e9
tcp_listen_handler() uses the epoll reference for the listening socket it handles, and also passes on one variant of it to tcp_tap_conn_from_sock() and tcp_splice_conn_from_sock(). The latter two functions only need a couple of specific fields from the reference. Pass those specific values instead of the whole reference, which localises the handling of the listening (as opposed to accepted) socket and its reference entirely within tcp_listen_handler(). Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
21 lines
551 B
C
21 lines
551 B
C
/* SPDX-License-Identifier: GPL-2.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;
|
|
union sockaddr_inany;
|
|
|
|
void tcp_splice_sock_handler(struct ctx *c, union epoll_ref ref,
|
|
uint32_t events);
|
|
bool tcp_splice_conn_from_sock(const struct ctx *c,
|
|
uint8_t pif0, in_port_t dstport,
|
|
union flow *flow, int s0,
|
|
const union sockaddr_inany *sa);
|
|
void tcp_splice_init(struct ctx *c);
|
|
|
|
#endif /* TCP_SPLICE_H */
|