getprotobyname

Name

getprotobyname -- get protocol entry

Synopsis

struct protoent *getprotobynumber(int proto);

Description

The getprotobyname() function returns a protoent structure for the line from /etc/protocols that matches the protocol name name.

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

struct protoent {

char *p_name; /* official protocol name */

char **p_aliases; /* alias list */

int p_proto; /* protocol number */

}

Return Value

The getprotobyname() function returns the protoent structure, or a NULL pointer if an error occurs or the end of the file is reached.

Files

/etc/protocols protocol database file