diff options
author | schwarze <> | 2018-04-28 15:37:43 +0000 |
---|---|---|
committer | schwarze <> | 2018-04-28 15:37:43 +0000 |
commit | 7be10f4ca4ede8d2cd30527c4ce206d4323a3dc5 (patch) | |
tree | 8214e058a1bec099439c52e43098cbace57e9fd5 | |
parent | 249ea9925fc6cab53616b6e4f39a454a847dd373 (diff) | |
download | openbsd-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.3 | 77 |
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 |
53 | The | 53 | The |
54 | .Fn getnetent , | 54 | .Fn getnetbyname |
55 | .Fn getnetbyname , | ||
56 | and | 55 | and |
57 | .Fn getnetbyaddr | 56 | .Fn getnetbyaddr |
58 | functions each return a pointer to an object with the following structure | 57 | functions return a pointer to an object with the following structure: |
59 | containing 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 |
62 | struct netent { | 59 | struct 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 |
75 | A null-terminated list of alternate names for the network. | 72 | A null-terminated list of alternate names for the network. |
76 | .It Fa n_addrtype | 73 | .It Fa n_addrtype |
77 | The type of the network number returned; currently only | 74 | The 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 |
80 | The network number. | 77 | The network number. |
81 | Network numbers are returned in machine byte order. | 78 | Network numbers are returned in machine byte order. |
82 | .El | 79 | .El |
83 | .Pp | 80 | .Pp |
84 | The | 81 | On |
85 | .Fn getnetent | 82 | .Ox , |
86 | function reads the next line of the file, opening the file if necessary. | 83 | these legacy functions perform a lookup in a similar fashion as |
87 | .Pp | 84 | .Xr gethostbyname 3 |
88 | The | 85 | and |
89 | .Fn setnetent | 86 | .Xr gethostbyaddr 3 , |
90 | function opens and rewinds the file. | 87 | respectively. |
91 | If the | 88 | On other systems, they may use a separate network database file, |
92 | .Fa stayopen | 89 | .Pa /etc/networks . |
93 | flag is non-zero, | ||
94 | the net database will not be closed after each call to | ||
95 | .Fn getnetbyname | ||
96 | or | ||
97 | .Fn getnetbyaddr . | ||
98 | .Pp | 90 | .Pp |
99 | The | 91 | In contrast to |
100 | .Fn endnetent | 92 | .Xr gethostbyaddr 3 , |
101 | function closes the file. | 93 | the |
94 | .Fa net | ||
95 | argument is expected in machine byte order. | ||
102 | .Pp | 96 | .Pp |
103 | The | 97 | The |
104 | .Fn getnetbyname | 98 | .Fn setnetent , |
99 | .Fn getnetent , | ||
105 | and | 100 | and |
106 | .Fn getnetbyaddr | 101 | .Fn endnetent |
107 | functions search the domain name server if the system is configured to use one. | 102 | functions are deprecated and no longer have any effect. |
108 | If the search fails, or no name server is configured, they sequentially | 103 | They could be used in the past to iterate over entries in the former file |
109 | search from the beginning of the file until a matching net name or | 104 | .Pa /etc/networks . |
110 | net address and type is found, or until | ||
111 | .Dv EOF | ||
112 | is encountered. | ||
113 | Network numbers are supplied in host order. | ||
114 | .Sh RETURN VALUES | 105 | .Sh RETURN VALUES |
115 | The | 106 | The |
116 | .Fn getnetent , | 107 | .Fn getnetbyaddr |
117 | .Fn getnetbyaddr , | ||
118 | and | 108 | and |
119 | .Fn getnetbyname | 109 | .Fn getnetbyname |
120 | functions return | 110 | functions return |
121 | .Dv NULL | 111 | .Dv NULL |
122 | if the requested entry is not found. | 112 | if the requested entry is not found. |
113 | .Pp | ||
114 | The | ||
115 | .Fn getnetent | ||
116 | function 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 |
121 | The 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 |
131 | These functions conform to | 130 | These functions conform to |
132 | .St -p1003.1-2008 . | 131 | .St -p1003.1-2008 . |