X-Git-Url: https://git.saurik.com/apple/libinfo.git/blobdiff_plain/84e6ee29846bd48cc36d74aeb5c13c52a59c5a55..d49d4c8153e0d4ad98ce995c3e488a8b52df9a8e:/gen.subproj/getnetent.3 diff --git a/gen.subproj/getnetent.3 b/gen.subproj/getnetent.3 index 7786ce0..5e34499 100644 --- a/gen.subproj/getnetent.3 +++ b/gen.subproj/getnetent.3 @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. @@ -30,43 +26,32 @@ .\" SUCH DAMAGE. .\" .\" @(#)getnetent.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/net/getnetent.3,v 1.11.2.3 2001/08/17 15:42:38 ru Exp $ +.\" $FreeBSD: src/lib/libc/net/getnetent.3,v 1.23 2007/01/09 00:28:02 imp Exp $ .\" .Dd June 4, 1993 .Dt GETNETENT 3 .Os .Sh NAME -.Nm endnetent , +.Nm getnetent , .Nm getnetbyaddr , .Nm getnetbyname , -.Nm getnetent , -.Nm setnetent +.Nm setnetent , +.Nm endnetent .Nd get network entry .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.Fd #include -.Ft void -.Fo endnetent -.Fa void -.Fc +.In netdb.h .Ft struct netent * -.Fo getnetbyaddr -.Fa "uint32_t net" -.Fa "int type" -.Fc +.Fn getnetent void .Ft struct netent * -.Fo getnetbyname -.Fa "const char *name" -.Fc +.Fn getnetbyname "const char *name" .Ft struct netent * -.Fo getnetent -.Fa void -.Fc +.Fn getnetbyaddr "uint32_t net" "int type" .Ft void -.Fo setnetent -.Fa "int stayopen" -.Fc +.Fn setnetent "int stayopen" +.Ft void +.Fn endnetent void .Sh DESCRIPTION The .Fn getnetent , @@ -75,16 +60,29 @@ and .Fn getnetbyaddr functions each return a pointer to an object with the -following structure -containing the broken-out -fields of a line in the network data base, +following structure describing an internet network. +.\"This structure contains either the information obtained +.\"from the nameserver, +.\".Xr named 8 , +.\"broken-out fields of a line in the network data base +.\".Pa /etc/networks , +.\"or entries supplied by the +.\".Xr yp 8 +.\"system. +.\"The order of the lookups is controlled by the +.\"`networks' entry in +.\".Xr nsswitch.conf 5 . +This structure contains information obtained from +.Xr DirectoryService 8 , +including records in .Pa /etc/networks . +.Pp .Bd -literal -offset indent struct netent { char *n_name; /* official name of net */ char **n_aliases; /* alias list */ int n_addrtype; /* net number type */ - unsigned long n_net; /* net number */ + uint32_t n_net; /* net number */ }; .Ed .Pp @@ -97,7 +95,8 @@ A zero terminated list of alternate names for the network. .It Fa n_addrtype The type of the network number returned; currently only AF_INET. .It Fa n_net -The network number. Network numbers are returned in machine byte +The network number. +Network numbers are returned in machine byte order. .El .Pp @@ -109,7 +108,8 @@ reads the next line of the file, opening the file if necessary. The .Fn setnetent function -opens and rewinds the file. If the +opens and rewinds the file. +If the .Fa stayopen flag is non-zero, the net data base will not be closed after each call to @@ -136,12 +136,15 @@ or until is encountered. The .Fa type +argument must be .Dv AF_INET . Network numbers are supplied in host order. .Sh FILES -.Bl -tag -width /etc/networks -compact +.Bl -tag -width /etc/nsswitch.conf -compact .It Pa /etc/networks +.\".It Pa /etc/nsswitch.conf +.It Pa /etc/resolv.conf .El .Sh DIAGNOSTICS Null pointer @@ -164,7 +167,7 @@ functions appeared in .Bx 4.2 . .Sh BUGS The data space used by -these functions is static; if future use requires the data, it should be +these functions is thread-specific; if future use requires the data, it should be copied before any subsequent calls to these functions overwrite it. Only Internet network numbers are currently understood.