.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
.\" 386BSD man pages
.\" Modified Sat Jul 24 21:48:06 1993 by Rik Faith (faith@cs.unc.edu)
-.TH GETNETENT 3 1993-05-15 "GNU" "Linux Programmer's Manual"
+.TH GETNETENT 3 2008-08-13 "GNU" "Linux Programmer's Manual"
.SH NAME
getnetent, getnetbyname, getnetbyaddr, setnetent, endnetent \-
get network entry
.SH DESCRIPTION
The
.BR getnetent ()
-function reads the next line from the file
-\fI/etc/networks\fP and returns a structure \fInetent\fP containing
-the broken out fields from the line.
-The \fI/etc/networks\fP file
-is opened if necessary.
+function reads the next entry from the networks database
+and returns a \fInetent\fP structure containing
+the broken-out fields from the entry.
+A connection is opened to the database if necessary.
.PP
The
.BR getnetbyname ()
function returns a \fInetent\fP structure
-for the line from \fI/etc/networks\fP that matches the network
-\fIname\fP.
+for the entry from the database
+that matches the network \fIname\fP.
.PP
The
.BR getnetbyaddr ()
function returns a \fInetent\fP structure
-for the line that matches the network number \fInet\fP of type
+for the entry from the database
+that matches the network number \fInet\fP of type
\fItype\fP.
.PP
The
.BR setnetent ()
-function opens and rewinds the
-\fI/etc/networks\fP file.
-If \fIstayopen\fP is true (1), then the
-file will not be closed between calls to
-.BR getnetbyname ()
-and
-.BR getnetbyaddr ().
+function opens a connection to the database,
+and sets the next entry to the first entry.
+If \fIstayopen\fP is non-zero,
+then the connection to the database
+will not be closed between calls to one of the
+.BR getnet* ()
+functions.
.PP
The
.BR endnetent ()
-function closes \fI/etc/networks\fP.
+function closes the connection to the database.
.PP
The \fInetent\fP structure is defined in \fI<netdb.h>\fP as follows:
.sp
The official name of the network.
.TP
.I n_aliases
-A zero terminated list of alternative names for the network.
+A NULL-terminated list of alternative names for the network.
.TP
.I n_addrtype
The type of the network number; always
4.3BSD, POSIX.1-2001.
.SH "SEE ALSO"
.BR getprotoent (3),
-.BR getservent (3),
-.BR networks (5)
+.BR getservent (3)
+.\" .BR networks (5)
.br
RFC\ 1101
.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
.\" 386BSD man pages
.\" Modified Sat Jul 24 19:26:03 1993 by Rik Faith (faith@cs.unc.edu)
-.TH GETPROTOENT 3 1993-04-24 "GNU" "Linux Programmer's Manual"
+.TH GETPROTOENT 3 2008-08-13 "GNU" "Linux Programmer's Manual"
.SH NAME
getprotoent, getprotobyname, getprotobynumber, setprotoent,
endprotoent \- get protocol entry
.SH DESCRIPTION
The
.BR getprotoent ()
-function reads the next line from the file
-\fI/etc/protocols\fP and returns a structure \fIprotoent\fP
-containing the broken out fields from the line.
-The \fI/etc/protocols\fP file is opened if necessary.
+function reads the next entry from the protocols database (see
+.BR protocols (5))
+and returns a \fIprotoent\fP structure
+containing the broken-out fields from the entry.
+A connection is opened to the database if necessary.
.PP
The
.BR getprotobyname ()
-function returns a \fIprotoent\fP
-structure for the line from \fI/etc/protocols\fP that matches
-the protocol name \fIname\fP.
+function returns a \fIprotoent\fP structure
+for the entry from the database
+that matches the protocol name \fIname\fP.
+A connection is opened to the database if necessary.
.PP
The
.BR getprotobynumber ()
-function returns a \fIprotoent\fP
-structure for the line that matches the protocol number \fInumber\fP.
+function returns a \fIprotoent\fP structure
+for the entry from the database
+that matches the protocol number \fInumber\fP.
+A connection is opened to the database if necessary.
.PP
The
.BR setprotoent ()
-function opens and rewinds the
-\fI/etc/protocols\fP file.
-If \fIstayopen\fP is true (1), then
-the file will not be closed between calls to
-.BR getprotobyname ()
-or
-.BR getprotobynumber ().
+function opens a connection to the database,
+and sets the next entry to the first entry.
+If \fIstayopen\fP is non-zero,
+then the connection to the database
+will not be closed between calls to one of the
+.BR getproto* ()
+functions.
.PP
The
.BR endprotoent ()
-function closes \fI/etc/protocols\fP.
+function closes the connection to the database.
.PP
The \fIprotoent\fP structure is defined in \fI<netdb.h>\fP as follows:
.sp
The official name of the protocol.
.TP
.I p_aliases
-A zero terminated list of alternative names for the protocol.
+A NULL-terminated list of alternative names for the protocol.
.TP
.I p_proto
The protocol number.
.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license)
.\"
.\" @(#)getrpcent.3n 2.2 88/08/02 4.0 RPCSRC; from 1.11 88/03/14 SMI
-.TH GETRPCENT 3 2007-12-23 "" "Linux Programmer's Manual"
+.TH GETRPCENT 3 2008-08-13 "" "Linux Programmer's Manual"
.SH NAME
getrpcent, getrpcbyname, getrpcbynumber, setrpcent, endrpcent \- get
RPC entry
.BR getrpcbynumber ()
each return a pointer to an object with the
following structure containing the broken-out
-fields of a line in the rpc program number data base,
-.IR /etc/rpc .
+fields of an entry in the RPC program number data base.
.in +4n
.nf
struct rpcent {
- char *r_name; /* name of server for this rpc program */
+ char *r_name; /* name of server for this RPC program */
char **r_aliases; /* alias list */
- long r_number; /* rpc program number */
+ long r_number; /* RPC program number */
};
.fi
.in
.RS 4
.TP 12
.I r_name
-The name of the server for this rpc program.
+The name of the server for this RPC program.
.TP
.I r_aliases
-A zero terminated list of alternate names for the rpc program.
+A NULL-terminated list of alternate names for the RPC program.
.TP
.I r_number
-The rpc program number for this service.
+The RPC program number for this service.
.RE
.LP
.BR getrpcent ()
-reads the next line of the file, opening the file if necessary.
+reads the next entry from the database.
+A connection is opened to the database if necessary.
.LP
.BR setrpcent ()
-opens and rewinds the file.
-If the
-.I stayopen
-flag is non-zero,
-the net data base will not be closed after each call to
-.BR getrpcent ()
-(either directly, or indirectly through one of
-the other \*(lqgetrpc\*(rq calls).
+function opens a connection to the database,
+and sets the next entry to the first entry.
+If \fIstayopen\fP is non-zero,
+then the connection to the database
+will not be closed between calls to one of the
+.BR getrpc* ()
+functions.
.LP
+The
.BR endrpcent ()
-closes the file.
+function closes the connection to the database.
.LP
.BR getrpcbyname ()
and
.BR getrpcbynumber ()
sequentially search from the beginning
-of the file until a matching rpc program name or
+of the file until a matching RPC program name or
program number is found, or until end-of-file is encountered.
.SH RETURN VALUE
.LP
A NULL pointer is returned on EOF or error.
.SH FILES
+.TP
.I /etc/rpc
+RPC program number database.
.SH "CONFORMING TO"
Not in POSIX.1-2001.
Present on the BSDs, Solaris, and many other systems.