From 1a40d0089506e120dac83c000777e86f6bcdd362 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 3 Nov 2023 13:23:01 +1100 Subject: port_fwd: Split TCP and UDP cases for get_bound_ports() Currently get_bound_ports() takes a parameter to determine if it scans for UDP or TCP bound ports, but in fact there's almost nothing in common between those two paths. The parameter appears primarily to have been a convenience for when we needed to invoke this function via NS_CALL(). Now that we don't need that, split it into separate TCP and UDP versions. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- port_fwd.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'port_fwd.h') diff --git a/port_fwd.h b/port_fwd.h index ad8ed1f..2f8f526 100644 --- a/port_fwd.h +++ b/port_fwd.h @@ -31,7 +31,8 @@ struct port_fwd { in_port_t delta[NUM_PORTS]; }; -void get_bound_ports(struct ctx *c, int ns, uint8_t proto); +void get_bound_ports_tcp(struct ctx *c, int ns); +void get_bound_ports_udp(struct ctx *c, int ns); void port_fwd_init(struct ctx *c); #endif /* PORT_FWD_H */ -- cgit v1.2.3