Open System Services Library Calls Reference Manual (G06.28+, H06.05+)

getprotoent(3) OSS Library Calls Reference Manual
NAME
getprotoent - Gets the next protocol entry
LIBRARY
G-series native OSS processes: /G/system/sysnn/zinetsrl
H-series OSS processes: /G/system/zdllnnn/zinetdll
SYNOPSIS
#include <netdb.h>
struct protoent *getprotoent(void);
DESCRIPTION
The getprotoent() (get protocol entry) function retrieves the next entry from /etc/protocols, the
network protocol database.
The getprotoent() function returns a pointer to a protoent structure, whose members contain
information from the /etc/protocols le. The netdb.h header le denes the protoent structure.
An application program can use the getprotoent() function to access a protocol name, its aliases,
and protocol number. Use the endprotoent( ) function to close the /etc/protocols le.
NOTES
The getprotoent() function return value points to static data, which is overwritten by any subse-
quent calls to getprotobyname( ), getprotobynumber(),orgetprotoent().
RETURN VALUES
Upon successful completion, the getprotoent() function returns a pointer to a protoent structure
if an entry was found, and a null pointer if the end of the le was reached. If the call to getpro-
toent() fails, a null pointer is returned.
ERRORS
The getprotoent() function does not set errno.
FILES
/etc/protocols The Internet network protocols database. Each record in the le occupies a sin-
gle line and has three elds: the protocol name, the protocol number, and proto-
col aliases.
RELATED INFORMATION
Functions: getprotobynumber(3), getprotobyname(3), setprotoent(3), endprotoent(3).
Files: protocols(4).
364 Hewlett-Packard Company 527187-007