03_resolve-port-names.diff
This patch allows to resolve port numbers into names defined
in the services(5) /etc/services database:
(a) it provides a standalone function which will fall back to
stringifying a port number;
(b) it resets the 'numeric service' flag of getnameinfo(3) to
analogously consider a lookup in /etc/services.
Assuming the following had been added to /etc/services:
para_server_control 2990/tcp # para_server control
paraslash_http_service 8000/tcp # paraslash http sender
paraslash_dccp_service 8000/dccp # paraslash dccp sender
paraslash_udp_service 8000/udp # paraslash udp sender,
then the output of 'para_client si' would look like:
http sender:
status: on
port: paraslash_http_service
...
dccp sender:
status: on
port: paraslash_dccp_service
...
udp sender:
status: on
port: paraslash_udp_service
...
Note: On some systems the service lookup may involve LDAP or NIS lookups,
depending on the 'services' configuration in /etc/nsswitch.conf. This does
not seem to cause a problem, as it implies a working network connection.