getprotoent

Name

getprotoent -- get protocol entry

Synopsis

struct protoent *getprotoent(void);

Description

The getprotoent() function reads the next line from the file /etc/protocols and returns a structure protoent containing the broken out fields from the line. The /etc/protocols file is opened if necessary.

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 getprotoent() 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