VMS Help TCPIP Services, Programming Interfaces, Sockets API, getservbyport(), Description *Conan The Librarian (sorry for the slow response - running on an old VAX) |
This function searches sequentially from the beginning of the file until a matching port is found, or until end of file is encountered. If a protocol name is also supplied, searches must also match the protocol. This function returns a pointer to a servent structure containing the broken-out fields of the requested line in the network services database: struct servent { char *s_name; /* official name of service */ char **s_aliases; /* alias list */ long s_port; /* port service resides at */ char *s_proto; /* protocol to use */ }; The members of this structure are: s_name The official name of the service. s_aliases A zero-terminated list of alternate names for the service. s_port The port number at which the service resides. Port numbers are returned in network byte order. s_proto The name of the protocol to use when contacting the service. All information is contained in a static area, so it must be copied to be saved. Related Functions See also getservbyname().
|