.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" References consulted: .\" Linux libc source code .\" 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) .\" Translated into Spanish Tue Jan 27 1998 by Gerardo Aburruzaga .\" García .\" Translation revised Sun Aug 16 1998 by Juan Piernas .\" .TH GETNETENT 3 "24 julio 1993" "BSD" "Manual del Programador de Linux" .SH NOMBRE getnetent, getnetbyname, getnetbyaddr, setnetent, endnetent \- obtienen una entrada del fichero de redes .SH SINOPSIS .nf .B #include .sp .B struct netent *getnetent(void); .sp .BI "struct netent *getnetbyname(const char *" nombre ); .sp .BI "struct netent *getnetbyaddr(long " red ", int " tipo ); .sp .BI "void setnetent(int " dejaloabierto ); .sp .B void endnetent(void); .fi .SH DESCRIPCIÓN La función \fBgetnetent()\fP lee la línea siguiente del fichero \fI/etc/networks\fP y devuelve una estructura \fInetent\fP que contiene los campos descompuestos correspondientes a la línea obtenida. El fichero \fI/etc/networks\fP se abre si es necesario. .PP La función \fBgetnetbyname()\fP devuelve una estructura \fInetent\fP correspondiente a la línea de \fI/etc/networks\fP que concuerde con el nombre de red \fInombre\fP. .PP La función \fBgetnetbyaddr()\fP devuelve una estructura \fInetent\fP para la línea que concuerde con el número de red \fInet\fP de tipo \fItipo\fP. .PP La función \fBsetnetent()\fP abre y rebobina el fichero \fI/etc/networks\fP. Si \fIdejaloabierto\fP es verdadero (1), entonces el fichero no se cerrará entre llamadas a \fBgetnetbyname()\fP y \fBgetnetbyaddr()\fP. .PP La función \fBendnetent()\fP cierra \fI/etc/networks\fP. .PP La estructura \fInetent\fP se define en \fI\fP como sigue: .sp .RS .nf .ne 6 .ta 8n 16n 34n struct netent { char *n_name; /* nombre oficial de red */ char **n_aliases; /* lista de sinónimos */ int n_addrtype; /* tipo de dirección de red */ unsigned long int n_net; /* número de red */ } .ta .fi .RE .PP Los miembros de la estructura \fInetent\fP son: .TP .I n_name El nombre oficial de la red. .TP .I n_aliases Una lista terminada en cero de nombres alternativos para la red. .TP .I n_addrtype El tipo del número de red; siempre es AF_INET. .TP .I n_net El número de red en el orden de bytes del ordenador (``host''). .SH "VALOR DEVUELTO" Las funciones \fBgetnetent()\fP, \fBgetnetbyname()\fP y \fBgetnetbyaddr()\fP devuelven la estructura \fInetent\fP, o un puntero NULL si ocurre un error o se llega al final del fichero. .SH FICHEROS /etc/networks fichero de datos de redes .SH "CONFORME A" BSD 4.3 .br RFC 1101 .SH "VÉASE TAMBIÉN" .BR getprotoent "(3), " getservent "(3), " networks (5)