From e90f2770ae44de238a227f884e806637a2b80403 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 3 Nov 2023 13:22:56 +1100 Subject: port_fwd: Move automatic port forwarding code to port_fwd.[ch] The implementation of scanning /proc files to do automatic port forwarding is a bit awkwardly split between procfs_scan_listen() in util.c, get_bound_ports() and related functions in conf.c and the initial setup code in conf(). Consolidate all of this into port_fwd.h, which already has some related definitions, and a new port_fwd.c. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- port_fwd.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'port_fwd.h') diff --git a/port_fwd.h b/port_fwd.h index 6ed3f14..ad8ed1f 100644 --- a/port_fwd.h +++ b/port_fwd.h @@ -31,4 +31,7 @@ struct port_fwd { in_port_t delta[NUM_PORTS]; }; +void get_bound_ports(struct ctx *c, int ns, uint8_t proto); +void port_fwd_init(struct ctx *c); + #endif /* PORT_FWD_H */ -- cgit v1.2.3