inet_net.3 (c879ae3536e6d92b8d96c8965c5b05fcb9541520) inet_net.3 (81a3cb97a5e39ab53062df9bd762ba6e0f9156cb)
1.\" $NetBSD: inet_net.3,v 1.4 1999/03/22 19:44:52 garbled Exp $
2.\"
3.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Luke Mewburn.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in the
16.\" documentation and/or other materials provided with the distribution.
1.\" $NetBSD: inet_net.3,v 1.4 1999/03/22 19:44:52 garbled Exp $
2.\"
3.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Luke Mewburn.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in the
16.\" documentation and/or other materials provided with the distribution.
17.\" 3. All advertising materials mentioning features or use of this software
18.\" must display the following acknowledgement:
19.\" This product includes software developed by the NetBSD
20.\" Foundation, Inc. and its contributors.
17.\" 4. Neither the name of The NetBSD Foundation nor the names of its
18.\" contributors may be used to endorse or promote products derived
19.\" from this software without specific prior written permission.
20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
22.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
25.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31.\" POSSIBILITY OF SUCH DAMAGE.
32.\"
33.\" $FreeBSD$
34.\"
21.\" 4. Neither the name of The NetBSD Foundation nor the names of its
22.\" contributors may be used to endorse or promote products derived
23.\" from this software without specific prior written permission.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35.\" POSSIBILITY OF SUCH DAMAGE.
36.\"
37.\" $FreeBSD$
38.\"
35.Dd February 26, 2006
39.Dd June 18, 1997
36.Dt INET_NET 3
37.Os
38.Sh NAME
39.Nm inet_net_ntop ,
40.Nm inet_net_pton
41.Nd Internet network number manipulation routines
42.Sh LIBRARY
43.Lb libc

--- 8 unchanged lines hidden (view full) ---

52.Fn inet_net_pton "int af" "const char *src" "void *dst" "size_t size"
53.Sh DESCRIPTION
54The
55.Fn inet_net_ntop
56function converts an Internet network number from network format (usually a
57.Vt "struct in_addr"
58or some other binary form, in network byte order) to CIDR presentation format
59(suitable for external display purposes).
40.Dt INET_NET 3
41.Os
42.Sh NAME
43.Nm inet_net_ntop ,
44.Nm inet_net_pton
45.Nd Internet network number manipulation routines
46.Sh LIBRARY
47.Lb libc

--- 8 unchanged lines hidden (view full) ---

56.Fn inet_net_pton "int af" "const char *src" "void *dst" "size_t size"
57.Sh DESCRIPTION
58The
59.Fn inet_net_ntop
60function converts an Internet network number from network format (usually a
61.Vt "struct in_addr"
62or some other binary form, in network byte order) to CIDR presentation format
63(suitable for external display purposes).
60The
61.Fa bits
64.Fa bits
62argument
63is the number of bits in
64.Fa src
65that are the network number.
66It returns
67.Dv NULL
68if a system error occurs (in which case,
69.Va errno
70will have been set), or it returns a pointer to the destination string.

--- 8 unchanged lines hidden (view full) ---

79specified with /CIDR), or \-1 if a failure occurred
80(in which case
81.Va errno
82will have been set.
83It will be set to
84.Er ENOENT
85if the Internet network number was not valid).
86.Pp
65is the number of bits in
66.Fa src
67that are the network number.
68It returns
69.Dv NULL
70if a system error occurs (in which case,
71.Va errno
72will have been set), or it returns a pointer to the destination string.

--- 8 unchanged lines hidden (view full) ---

81specified with /CIDR), or \-1 if a failure occurred
82(in which case
83.Va errno
84will have been set.
85It will be set to
86.Er ENOENT
87if the Internet network number was not valid).
88.Pp
87The currently supported values for
89The only value for
88.Fa af
90.Fa af
89are
90.Dv AF_INET
91and
92.Dv AF_INET6 .
93The
91currently supported is
92.Dv AF_INET .
94.Fa size
93.Fa size
95argument
96is the size of the result buffer
97.Fa dst .
98.Pp
99.Sh NETWORK NUMBERS (IP VERSION 4)
100Internet network numbers may be specified in one of the following forms:
101.Bd -literal -offset indent
102a.b.c.d/bits
103a.b.c.d

--- 38 unchanged lines hidden (view full) ---

142.Dq parts
143in a
144.Ql \&.
145notation
146may be decimal, octal, or hexadecimal, as specified
147in the C language (i.e., a leading 0x or 0X implies
148hexadecimal; otherwise, a leading 0 implies octal;
149otherwise, the number is interpreted as decimal).
94is the size of the result buffer
95.Fa dst .
96.Pp
97.Sh NETWORK NUMBERS (IP VERSION 4)
98Internet network numbers may be specified in one of the following forms:
99.Bd -literal -offset indent
100a.b.c.d/bits
101a.b.c.d

--- 38 unchanged lines hidden (view full) ---

140.Dq parts
141in a
142.Ql \&.
143notation
144may be decimal, octal, or hexadecimal, as specified
145in the C language (i.e., a leading 0x or 0X implies
146hexadecimal; otherwise, a leading 0 implies octal;
147otherwise, the number is interpreted as decimal).
150.\"
151.\" .Sh NETWORK NUMBERS (IP VERSION 6)
152.\" XXX - document this!
153.\"
154.Sh SEE ALSO
155.Xr byteorder 3 ,
156.Xr inet 3 ,
157.Xr networks 5
158.Sh HISTORY
159The
160.Fn inet_net_ntop
161and
162.Fn inet_net_pton
163functions appeared in BIND 4.9.4.
148.Sh SEE ALSO
149.Xr byteorder 3 ,
150.Xr inet 3 ,
151.Xr networks 5
152.Sh HISTORY
153The
154.Fn inet_net_ntop
155and
156.Fn inet_net_pton
157functions appeared in BIND 4.9.4.