mirror of
https://passt.top/passt
synced 2025-05-17 23:25:35 +02:00

udp_buf_reply_sock_data() can handle forwarding data either from socket to socket ("splicing") or from socket to tap. It has a test on each datagram for which case we're in, but that will be the same for everything in the batch. Split out the spliced path into a separate udp_sock_to_sock() function. This leaves udp_{buf,vu}_reply_sock_data() handling only forwards from socket to tap, so rename and simplify them accordingly. This makes the code slightly longer for now, but will allow future cleanups to shrink it back down again. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> [sbrivio: Fix typos in comments to udp_sock_recv() and udp_vu_listen_sock_data()] Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
13 lines
364 B
C
13 lines
364 B
C
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
/* Copyright Red Hat
|
|
* Author: Laurent Vivier <lvivier@redhat.com>
|
|
*/
|
|
|
|
#ifndef UDP_VU_H
|
|
#define UDP_VU_H
|
|
|
|
void udp_vu_listen_sock_data(const struct ctx *c, union epoll_ref ref,
|
|
const struct timespec *now);
|
|
void udp_vu_sock_to_tap(const struct ctx *c, int s, int n, flow_sidx_t tosidx);
|
|
|
|
#endif /* UDP_VU_H */
|