COHERENT manpages
This page displays the COHERENT manpage for getprotoent() [Get protocol entry].
List of available manpages
Index
getprotoent() -- Sockets Function (libsocket) Get protocol entry #include <netdb.h> struct protoent *getprotoent(); getprotoent() reads the next entry from file /etc/protocols, which holds information about all protocols recognized by your local network. If necessary, it opens the file. It returns a pointer to an object of type protoent, which is defined in header file <netdb.h>: struct protoent { char *p_name; /* official name of protocol */ char **p_aliases; /* alias list */ int p_proto; /* protocol number */ }; The following details each member: p_name The official name of the protocol. p_aliases This points to a zero-terminated list of alternate names for the protocol. p_proto The number of the protocol. To close /etc/protocols, call function endprotoent(). getprotoent() returns NULL if an error occurs, or if it encounters the end of the file. See Also endprotoent(), getprotobyname(), getprotobynumber(), libsocket, netdb.h, setprotoent() Notes This function uses a static data space. If your application needs to save these data, it must copy them before any subsequent calls overwrite them. At present, only the Internet protocols are understood.