]> git.tuebingen.mpg.de Git - paraslash.git/commit
03_resolve-port-names.diff
authorGerrit Renker <grenker@cscs.ch>
Thu, 25 Feb 2010 16:05:45 +0000 (17:05 +0100)
committerAndre Noll <maan@systemlinux.org>
Thu, 25 Feb 2010 16:05:45 +0000 (17:05 +0100)
commit7964fd8324c24679ca2ec85b6e9589f24079e089
tree8da5f6c57542211495c25661ff28f6d449bf18a2
parent98ac200376a2952942f3dcf1be8a0d7f42bae8a8
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.
net.c
net.h
send_common.c
udp_send.c