diff options
author | deraadt <> | 2019-08-30 18:33:17 +0000 |
---|---|---|
committer | deraadt <> | 2019-08-30 18:33:17 +0000 |
commit | 8246156efcf91d8f31624e8dd455eee553240f60 (patch) | |
tree | 538e1664547aeefad8ffe457703c860ce752d069 /src/lib/libc/net/inet_net.3 | |
parent | 72036bf4bbef02536427f2044486d9b6d6e2e355 (diff) | |
download | openbsd-8246156efcf91d8f31624e8dd455eee553240f60.tar.gz openbsd-8246156efcf91d8f31624e8dd455eee553240f60.tar.bz2 openbsd-8246156efcf91d8f31624e8dd455eee553240f60.zip |
Move 4 manual pages from not-a-function filenames to a correct filename,
and correct Xr.
ok jmc
Diffstat (limited to 'src/lib/libc/net/inet_net.3')
-rw-r--r-- | src/lib/libc/net/inet_net.3 | 197 |
1 files changed, 0 insertions, 197 deletions
diff --git a/src/lib/libc/net/inet_net.3 b/src/lib/libc/net/inet_net.3 deleted file mode 100644 index adb7589fca..0000000000 --- a/src/lib/libc/net/inet_net.3 +++ /dev/null | |||
@@ -1,197 +0,0 @@ | |||
1 | .\" $OpenBSD: inet_net.3,v 1.19 2018/04/28 20:29:18 schwarze Exp $ | ||
2 | .\" $NetBSD: inet_net.3,v 1.1 1997/06/18 02:25:27 lukem Exp $ | ||
3 | .\" | ||
4 | .\" Copyright (c) 1997 The NetBSD Foundation, Inc. | ||
5 | .\" All rights reserved. | ||
6 | .\" | ||
7 | .\" This code is derived from software contributed to The NetBSD Foundation | ||
8 | .\" by Luke Mewburn. | ||
9 | .\" | ||
10 | .\" Redistribution and use in source and binary forms, with or without | ||
11 | .\" modification, are permitted provided that the following conditions | ||
12 | .\" are met: | ||
13 | .\" 1. Redistributions of source code must retain the above copyright | ||
14 | .\" notice, this list of conditions and the following disclaimer. | ||
15 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
16 | .\" notice, this list of conditions and the following disclaimer in the | ||
17 | .\" documentation and/or other materials provided with the distribution. | ||
18 | .\" | ||
19 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | ||
20 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | ||
21 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
22 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE | ||
23 | .\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
24 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
25 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
26 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
27 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
28 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
29 | .\" POSSIBILITY OF SUCH DAMAGE. | ||
30 | .\" | ||
31 | .Dd $Mdocdate: April 28 2018 $ | ||
32 | .Dt INET_NET_NTOP 3 | ||
33 | .Os | ||
34 | .Sh NAME | ||
35 | .Nm inet_net_ntop , | ||
36 | .Nm inet_net_pton | ||
37 | .Nd Internet network number manipulation routines | ||
38 | .Sh SYNOPSIS | ||
39 | .In sys/types.h | ||
40 | .In sys/socket.h | ||
41 | .In netinet/in.h | ||
42 | .In arpa/inet.h | ||
43 | .Ft char * | ||
44 | .Fn inet_net_ntop "int af" "const void *src" "int bits" "char *dst" "size_t size" | ||
45 | .Ft int | ||
46 | .Fn inet_net_pton "int af" "const char *src" "void *dst" "size_t size" | ||
47 | .Sh DESCRIPTION | ||
48 | The | ||
49 | .Fn inet_net_ntop | ||
50 | function converts an Internet network number from network format (usually a | ||
51 | .Li struct in_addr | ||
52 | or some other binary form, in network byte order) to CIDR presentation format | ||
53 | (suitable for external display purposes). | ||
54 | .Fa bits | ||
55 | is the number of bits in | ||
56 | .Fa src | ||
57 | that are the network number. | ||
58 | It returns | ||
59 | .Dv NULL | ||
60 | if a system error occurs (in which case, | ||
61 | .Va errno | ||
62 | will have been set), or it returns a pointer to the destination string. | ||
63 | .Pp | ||
64 | The | ||
65 | .Fn inet_net_pton | ||
66 | function converts a presentation format Internet network number (that is, | ||
67 | printable form as held in a character string) to network format (usually a | ||
68 | .Li struct in_addr | ||
69 | or some other internal binary representation, in network byte order). | ||
70 | It returns the number of bits (either computed based on the class, or | ||
71 | specified with /CIDR), or \-1 if a failure occurred | ||
72 | (in which case | ||
73 | .Va errno | ||
74 | will have been set. | ||
75 | It will be set to | ||
76 | .Er ENOENT | ||
77 | if the Internet network number was not valid). | ||
78 | .Pp | ||
79 | Caution: | ||
80 | The | ||
81 | .Fa dst | ||
82 | field should be zeroed before calling | ||
83 | .Fn inet_net_pton | ||
84 | as the function will only fill the number of bytes necessary to | ||
85 | encode the network number in network byte order. | ||
86 | .Pp | ||
87 | The only values for | ||
88 | .Fa af | ||
89 | currently supported are | ||
90 | .Dv AF_INET | ||
91 | and | ||
92 | .Dv AF_INET6 . | ||
93 | .Fa size | ||
94 | is the size of the result buffer | ||
95 | .Fa dst . | ||
96 | .Sh NETWORK NUMBERS (IP VERSION 4) | ||
97 | The external representation of Internet network numbers may be specified in | ||
98 | one of the following forms: | ||
99 | .Bd -literal -offset indent | ||
100 | a | ||
101 | a.b | ||
102 | a.b.c | ||
103 | a.b.c.d | ||
104 | .Ed | ||
105 | .Pp | ||
106 | Any of the above four forms may have | ||
107 | .Dq Li /bits | ||
108 | appended where | ||
109 | .Dq Li bits | ||
110 | is in the range | ||
111 | .Li 0-32 | ||
112 | and is used to explicitly specify the number of bits in the network address. | ||
113 | When | ||
114 | .Dq Li /bits | ||
115 | is not specified the number of bits in the network address is calculated | ||
116 | as the larger of the number of bits in the class to which the address | ||
117 | belongs and the number of bits provided rounded up modulo 8. | ||
118 | Examples: | ||
119 | .Pp | ||
120 | .Bl -tag -width 10.1.2.3/24 -offset indent -compact | ||
121 | .It Li 10 | ||
122 | an 8-bit network number (class A), value | ||
123 | .Li 10.0.0.0 . | ||
124 | .It Li 192 | ||
125 | a 24-bit network number (class C), value | ||
126 | .Li 192.0.0.0 . | ||
127 | .It Li 10.10 | ||
128 | a 16-bit network number, value | ||
129 | .Li 10.10.0.0 . | ||
130 | .It Li 10.1.2 | ||
131 | a 24-bit network number, value | ||
132 | .Li 10.1.2.0 . | ||
133 | .It Li 10.1.2.3 | ||
134 | a 32-bit network number, value | ||
135 | .Li 10.1.2.3 . | ||
136 | .It Li 10.1.2.3/24 | ||
137 | a 24-bit network number (explicit), value | ||
138 | .Li 10.1.2.3 . | ||
139 | .El | ||
140 | .Pp | ||
141 | Note that when the number of bits is specified using | ||
142 | .Dq Li /bits | ||
143 | notation, the value of the address still includes all bits supplied | ||
144 | in the external representation, even those bits which are the host | ||
145 | part of an Internet address. | ||
146 | Also, unlike | ||
147 | .Xr inet_pton 3 | ||
148 | where the external representation is assumed to be a host address, the | ||
149 | external representation for | ||
150 | .Fn inet_net_pton | ||
151 | is assumed to be a network address. | ||
152 | Thus | ||
153 | .Dq Li 10.1 | ||
154 | is assumed to be | ||
155 | .Dq Li 10.1.0.0 | ||
156 | not | ||
157 | .Dq Li 10.0.0.1 | ||
158 | .Pp | ||
159 | All numbers supplied as | ||
160 | .Dq parts | ||
161 | in a | ||
162 | .Ql \&. | ||
163 | notation | ||
164 | may be decimal, octal, or hexadecimal, as specified | ||
165 | in the C language (i.e., a leading 0x or 0X implies | ||
166 | hexadecimal; otherwise, a leading 0 implies octal; | ||
167 | otherwise, the number is interpreted as decimal). | ||
168 | .Sh NETWORK NUMBERS (IP VERSION 6) | ||
169 | See | ||
170 | .Xr inet_pton 3 | ||
171 | for valid external representations of IP version 6 addresses. | ||
172 | A valid external representation may have | ||
173 | .Dq Li /bits | ||
174 | appended where | ||
175 | .Dq Li bits | ||
176 | is in the range | ||
177 | .Li 0-128 | ||
178 | and is used to explicitly specify the number of bits in the network address. | ||
179 | When | ||
180 | .Dq Li /bits | ||
181 | is not specified 128 is used. | ||
182 | Note that when the number of bits is specified using | ||
183 | .Dq Li /bits | ||
184 | notation, the value of the address still includes all bits supplied | ||
185 | in the external representation, even those bits which are the host | ||
186 | part of an Internet address. | ||
187 | .Sh SEE ALSO | ||
188 | .Xr byteorder 3 , | ||
189 | .Xr inet_pton 3 , | ||
190 | .Xr inet 4 , | ||
191 | .Xr hosts 5 | ||
192 | .Sh HISTORY | ||
193 | The | ||
194 | .Nm inet_net_ntop | ||
195 | and | ||
196 | .Nm inet_net_pton | ||
197 | functions first appeared in BIND 4.9.4. | ||