Returns information about a protocol, given its protocol number.
#include <netdb.h> struct protoent *getprotobynumber ( int proto);
(IN) Points to the protocol number. The following numbers have been defined in the netinet/in.h file:
If successful, returns a pointer to a structure of type protoent. Otherwise, returns NULL.
The getprotobynumber function accepts an integer value representing the protocol number. The function begins searching for the protocol number from the beginning of the sys:\etc\protocol file and continues until it finds a matching entry or reaches end-of-file. A matching entry might not be defined in the netinet/in.h file, which lists some of the common protocols and assigns them numbers.
NOTE:Calling any database routine overwrites the results of the last call to getprotobynumber.