Home |
Function getservbyport |
Function getservbyportGet service information from a port number and a protocol name. struct servent { const char * s_name; // official name of the service const char * * s_aliases; // alternative names (will be NULL) int s_port; // port number in network byte order const char * s_proto; // name of the protocol }; struct servent * getservbyport(int port, char * proto); ParametersportPort number of service to query (e.g. 80 for www or 21 for ftp, etc). protoPointer to protocol name (e.g. "tcp", "udp"). return valueReturns a pointer to a servent structure if successful, otherwise NULL. If an error occurred, call xn_getlasterror and xn_geterror_string to return the error value. Section Error Codes further describes each error. Possible values for this function are:
|