Searches the protocols table until a matching protocol number is
found or until the end of the table is encountered.
Format
#include <netdb.h>
struct protoent *getprotobynumber ( int *proto ) ;
1 – Argument
proto
A pointer to a string containing the desired protocol number.
2 – Description
This function returns a pointer to a protoent structure
containing the data from the protocols table. For information
about the protoent structure, refer to protoent Structure.
All information is contained in a static area, so it must be
copied to be saved.
Related Functions
See also getprotoent() and getprotobyname().
3 – Return Values
NULL Indicates end of table or an error.
x A pointer to a protoent structure.