summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2018-04-28 15:37:43 +0000
committerschwarze <>2018-04-28 15:37:43 +0000
commit7be10f4ca4ede8d2cd30527c4ce206d4323a3dc5 (patch)
tree8214e058a1bec099439c52e43098cbace57e9fd5
parent249ea9925fc6cab53616b6e4f39a454a847dd373 (diff)
downloadopenbsd-7be10f4ca4ede8d2cd30527c4ce206d4323a3dc5.tar.gz
openbsd-7be10f4ca4ede8d2cd30527c4ce206d4323a3dc5.tar.bz2
openbsd-7be10f4ca4ede8d2cd30527c4ce206d4323a3dc5.zip
Stop talking about /etc/networks, which is no longer used,
and reference gethostby*(3) and /etc/hosts instead. Say that setnetent(3), getnetent(3), and endnetent(3) now do nothing. With feedback from guenther and significant help from deraadt@.
-rw-r--r--src/lib/libc/net/getnetent.377
1 files changed, 38 insertions, 39 deletions
diff --git a/src/lib/libc/net/getnetent.3 b/src/lib/libc/net/getnetent.3
index f45526ec1d..0f4f74e364 100644
--- a/src/lib/libc/net/getnetent.3
+++ b/src/lib/libc/net/getnetent.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: getnetent.3,v 1.17 2017/11/28 18:10:59 schwarze Exp $ 1.\" $OpenBSD: getnetent.3,v 1.18 2018/04/28 15:37:43 schwarze Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1991, 1993 3.\" Copyright (c) 1983, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -27,7 +27,7 @@
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE. 28.\" SUCH DAMAGE.
29.\" 29.\"
30.Dd $Mdocdate: November 28 2017 $ 30.Dd $Mdocdate: April 28 2018 $
31.Dt GETNETENT 3 31.Dt GETNETENT 3
32.Os 32.Os
33.Sh NAME 33.Sh NAME
@@ -51,13 +51,10 @@
51.Fn endnetent "void" 51.Fn endnetent "void"
52.Sh DESCRIPTION 52.Sh DESCRIPTION
53The 53The
54.Fn getnetent , 54.Fn getnetbyname
55.Fn getnetbyname ,
56and 55and
57.Fn getnetbyaddr 56.Fn getnetbyaddr
58functions each return a pointer to an object with the following structure 57functions return a pointer to an object with the following structure:
59containing the broken-out fields of a line in the network database,
60.Pa /etc/networks .
61.Bd -literal -offset indent 58.Bd -literal -offset indent
62struct netent { 59struct netent {
63 char *n_name; /* official name of net */ 60 char *n_name; /* official name of net */
@@ -74,59 +71,61 @@ The official name of the network.
74.It Fa n_aliases 71.It Fa n_aliases
75A null-terminated list of alternate names for the network. 72A null-terminated list of alternate names for the network.
76.It Fa n_addrtype 73.It Fa n_addrtype
77The type of the network number returned; currently only 74The type of the network number returned; it is always
78.Dv AF_INET . 75.Dv AF_INET .
79.It Fa n_net 76.It Fa n_net
80The network number. 77The network number.
81Network numbers are returned in machine byte order. 78Network numbers are returned in machine byte order.
82.El 79.El
83.Pp 80.Pp
84The 81On
85.Fn getnetent 82.Ox ,
86function reads the next line of the file, opening the file if necessary. 83these legacy functions perform a lookup in a similar fashion as
87.Pp 84.Xr gethostbyname 3
88The 85and
89.Fn setnetent 86.Xr gethostbyaddr 3 ,
90function opens and rewinds the file. 87respectively.
91If the 88On other systems, they may use a separate network database file,
92.Fa stayopen 89.Pa /etc/networks .
93flag is non-zero,
94the net database will not be closed after each call to
95.Fn getnetbyname
96or
97.Fn getnetbyaddr .
98.Pp 90.Pp
99The 91In contrast to
100.Fn endnetent 92.Xr gethostbyaddr 3 ,
101function closes the file. 93the
94.Fa net
95argument is expected in machine byte order.
102.Pp 96.Pp
103The 97The
104.Fn getnetbyname 98.Fn setnetent ,
99.Fn getnetent ,
105and 100and
106.Fn getnetbyaddr 101.Fn endnetent
107functions search the domain name server if the system is configured to use one. 102functions are deprecated and no longer have any effect.
108If the search fails, or no name server is configured, they sequentially 103They could be used in the past to iterate over entries in the former file
109search from the beginning of the file until a matching net name or 104.Pa /etc/networks .
110net address and type is found, or until
111.Dv EOF
112is encountered.
113Network numbers are supplied in host order.
114.Sh RETURN VALUES 105.Sh RETURN VALUES
115The 106The
116.Fn getnetent , 107.Fn getnetbyaddr
117.Fn getnetbyaddr ,
118and 108and
119.Fn getnetbyname 109.Fn getnetbyname
120functions return 110functions return
121.Dv NULL 111.Dv NULL
122if the requested entry is not found. 112if the requested entry is not found.
113.Pp
114The
115.Fn getnetent
116function always returns
117.Dv NULL .
123.Sh FILES 118.Sh FILES
124.Bl -tag -width /etc/networks -compact 119.Bl -tag -width /etc/hosts -compact
125.It Pa /etc/networks 120.It Pa /etc/hosts
121The local host and network name database.
126.El 122.El
127.Sh SEE ALSO 123.Sh SEE ALSO
124.Xr getaddrinfo 3 ,
125.Xr gethostbyname 3 ,
126.Xr getnameinfo 3 ,
128.Xr resolver 3 , 127.Xr resolver 3 ,
129.Xr networks 5 128.Xr hosts 5
130.Sh STANDARDS 129.Sh STANDARDS
131These functions conform to 130These functions conform to
132.St -p1003.1-2008 . 131.St -p1003.1-2008 .