Function getprotobyname
Get protocol information from protocol name.
struct protoent {
const char * p_name; // official protocol name
const char * * p_aliases; // alias list (will be NULL)
short p_proto; // protocol number
short fill; // reserved
const char * alias; // extended part for actual string
};
struct protoent * getprotobyname(char * name);
ParametersnamePointer to protocol name to query (e.g. "tcp", "udp").
return valueReturns a pointer to a protent 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:
Value |
Meaning |
ENODATA |
The DNS server could not resolve the protocol name. |
ENOTINITIALIZED |
RTIP-32 has not been initialized (xn_rtip_init has not been called). |
Socket API
Function getpeername
Function getprotobynumber
|