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 <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
David Gibson
2023-11-03 13:22:56 +11:00
committed by Stefano Brivio
parent 26d86f1304
commit e90f2770ae
8 changed files with 185 additions and 153 deletions

1
conf.h
View File

@@ -7,6 +7,5 @@
#define CONF_H
void conf(struct ctx *c, int argc, char **argv);
void get_bound_ports(struct ctx *c, int ns, uint8_t proto);
#endif /* CONF_H */