diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2021-07-21 17:44:39 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2021-07-21 17:44:39 +0200 |
commit | 49631a38a6ec550fb9254f2f9e4a049eea02ed6d (patch) | |
tree | 1c1d294c156dd9bf2c0977bbbd6ba89a9c8ee95f /udp.h | |
parent | b508079c4c6ef3b79b253736eaeb654486922324 (diff) | |
download | passt-49631a38a6ec550fb9254f2f9e4a049eea02ed6d.tar passt-49631a38a6ec550fb9254f2f9e4a049eea02ed6d.tar.gz passt-49631a38a6ec550fb9254f2f9e4a049eea02ed6d.tar.bz2 passt-49631a38a6ec550fb9254f2f9e4a049eea02ed6d.tar.lz passt-49631a38a6ec550fb9254f2f9e4a049eea02ed6d.tar.xz passt-49631a38a6ec550fb9254f2f9e4a049eea02ed6d.tar.zst passt-49631a38a6ec550fb9254f2f9e4a049eea02ed6d.zip |
tcp, udp: Split IPv4 and IPv6 bound port sets
Allow to bind IPv4 and IPv6 ports to tap, namespace or init separately.
Port numbers of TCP ports that are bound in a namespace are also bound
for UDP for convenience (e.g. iperf3), and IPv4 ports are always bound
if the corresponding IPv6 port is bound (socket might not have the
IPV6_V6ONLY option set). This will also be configurable later.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'udp.h')
-rw-r--r-- | udp.h | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -38,15 +38,20 @@ union udp_epoll_ref { /** * struct udp_ctx - Execution context for UDP - * @port_to_tap: Ports bound host/init-side, packets to guest/tap - * @port_to_init: Ports bound namespace-side, spliced to init - * @port_to_ns: Ports bound init-side, spliced to namespace + * @port6_to_tap: IPv6 ports bound host/init-side, packets to guest/tap + * @port4_to_init: IPv4 ports bound namespace-side, spliced to init + * @port6_to_init: IPv6 ports bound namespace-side, spliced to init + * @port4_to_ns: IPv4 ports bound init-side, spliced to namespace + * @port6_to_ns: IPv6 ports bound init-side, spliced to namespace * @timer_run: Timestamp of most recent timer run */ struct udp_ctx { - uint8_t port_to_tap [USHRT_MAX / 8]; - uint8_t port_to_init [USHRT_MAX / 8]; - uint8_t port_to_ns [USHRT_MAX / 8]; + uint8_t port4_to_tap [USHRT_MAX / 8]; + uint8_t port6_to_tap [USHRT_MAX / 8]; + uint8_t port4_to_init [USHRT_MAX / 8]; + uint8_t port6_to_init [USHRT_MAX / 8]; + uint8_t port4_to_ns [USHRT_MAX / 8]; + uint8_t port6_to_ns [USHRT_MAX / 8]; struct timespec timer_run; }; |