.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\" %sccs.include.redist.man%
.\" @(#)getprotoent.3 8.1 (Berkeley) %G%
.Fn getprotobyname "char *name"
.Fn getprotobynumber "int proto"
.Fn setprotoent "int stayopen"
each return a pointer to an object with the
containing the broken-out
fields of a line in the network protocol data base,
.Bd -literal -offset indent
char *p_name; /* official name of protocol */
char **p_aliases; /* alias list */
int p_proto; /* protocol number */
The members of this structure are:
.Bl -tag -width p_aliases
The official name of the protocol.
A zero terminated list of alternate names for the protocol.
reads the next line of the file, opening the file if necessary.
opens and rewinds the file. If the
the net data base will not be closed after each call to
sequentially search from the beginning
of the file until a matching
protocol number is found,
.Bl -tag -width /etc/protocols -compact
These functions use a static data space;
if the data is needed for future use, it should be
copied before any subsequent calls overwrite it.
protocols are currently understood.