TCP/IP Programming Manual

proto_ptr
input value; points to a null-terminated character string that contains the name of the protocol
associated with the service.
Errors
No errors are returned for this function.
Usage Guidelines
This call requires the presence of a SERVICES file providing information on the available
services. The information in the default SERVICES file is given in Table 19 (page 242). The
format of this file is described in the TCP/IPv6 Configuration and Management Manual and
the Cluster I/O Protocols Configuration and Management Manual.
The servent structure is statically declared. Subsequent calls to getservbyname replace
the existing data in the servent structure.
getservbyport
The getservbyport function gets the name of the service associated with the specified port.
C Synopsis
#include <netdb.h>
serv_entry_ptr = getservbyport (port_number, proto_ptr);
struct servent *serv_entry_ptr;
char *proto_ptr;
int port_number;
TAL Synopsis
?NOLIST, SOURCE SOCKDEFT
?NOLIST, SOURCE SOCKPROC
serv_entry_ptr := getservbyport (port_number, proto_ptr);
INT(32) serv_entry_ptr;
INT(32) port_number;
STRING .EXT proto_ptr;
serv_entry_ptr
return value; points to a structure (based on the servent structure) that contains information
on the specified service. This is the return value.
If the lookup fails, NULL is returned.
port_number
input value; the port number.
proto_ptr
input value; points to a null-terminated character string that contains the name of the protocol
associated with the service.
Errors
No errors are returned for this function.
getservbyport 125