Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Converting protocol names to protocol numbers

&pagelevel(3)&pagelevel

The getprotobyname() function converts a protocol name to a protocol number. The protocol name is passed when getprotobyname() is called.

getprotobyname() returns a pointer to an object of type struct protoent as its result.

The protoent structure is declared in <netdb.h> as follows:

struct protoent {
     char *p_name;          /* official protocol name */
     char **p_aliases;      /* alias list */
     int  p_proto;          /* protocol number */
};