1*f14fb602SLionel Sambuc.\" $NetBSD: inet.3,v 1.5 2012/07/25 14:51:15 ginsbach Exp $ 22fe8fb19SBen Gras.\" 32fe8fb19SBen Gras.\" Copyright (c) 1983, 1990, 1991, 1993 42fe8fb19SBen Gras.\" The Regents of the University of California. All rights reserved. 52fe8fb19SBen Gras.\" 62fe8fb19SBen Gras.\" Redistribution and use in source and binary forms, with or without 72fe8fb19SBen Gras.\" modification, are permitted provided that the following conditions 82fe8fb19SBen Gras.\" are met: 92fe8fb19SBen Gras.\" 1. Redistributions of source code must retain the above copyright 102fe8fb19SBen Gras.\" notice, this list of conditions and the following disclaimer. 112fe8fb19SBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright 122fe8fb19SBen Gras.\" notice, this list of conditions and the following disclaimer in the 132fe8fb19SBen Gras.\" documentation and/or other materials provided with the distribution. 142fe8fb19SBen Gras.\" 3. Neither the name of the University nor the names of its contributors 152fe8fb19SBen Gras.\" may be used to endorse or promote products derived from this software 162fe8fb19SBen Gras.\" without specific prior written permission. 172fe8fb19SBen Gras.\" 182fe8fb19SBen Gras.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 192fe8fb19SBen Gras.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 202fe8fb19SBen Gras.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 212fe8fb19SBen Gras.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 222fe8fb19SBen Gras.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 232fe8fb19SBen Gras.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 242fe8fb19SBen Gras.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 252fe8fb19SBen Gras.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 262fe8fb19SBen Gras.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 272fe8fb19SBen Gras.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 282fe8fb19SBen Gras.\" SUCH DAMAGE. 292fe8fb19SBen Gras.\" 302fe8fb19SBen Gras.\" @(#)inet.3 8.1 (Berkeley) 6/4/93 312fe8fb19SBen Gras.\" 32*f14fb602SLionel Sambuc.Dd July 25, 2012 332fe8fb19SBen Gras.Dt INET 3 342fe8fb19SBen Gras.Os 352fe8fb19SBen Gras.Sh NAME 362fe8fb19SBen Gras.Nm inet_addr , 372fe8fb19SBen Gras.Nm inet_aton , 382fe8fb19SBen Gras.Nm inet_lnaof , 392fe8fb19SBen Gras.Nm inet_makeaddr , 402fe8fb19SBen Gras.Nm inet_netof , 412fe8fb19SBen Gras.Nm inet_network , 422fe8fb19SBen Gras.Nm inet_ntoa , 432fe8fb19SBen Gras.Nm inet_ntop , 442fe8fb19SBen Gras.Nm inet_pton , 452fe8fb19SBen Gras.Nm addr , 462fe8fb19SBen Gras.Nm ntoa , 472fe8fb19SBen Gras.Nm network 482fe8fb19SBen Gras.Nd Internet address manipulation routines 492fe8fb19SBen Gras.Sh LIBRARY 502fe8fb19SBen Gras.Lb libc 512fe8fb19SBen Gras.Sh SYNOPSIS 522fe8fb19SBen Gras.In arpa/inet.h 532fe8fb19SBen Gras.Ft in_addr_t 542fe8fb19SBen Gras.Fn inet_addr "const char *cp" 552fe8fb19SBen Gras.Ft int 562fe8fb19SBen Gras.Fn inet_aton "const char *cp" "struct in_addr *addr" 572fe8fb19SBen Gras.Ft in_addr_t 582fe8fb19SBen Gras.Fn inet_lnaof "struct in_addr in" 592fe8fb19SBen Gras.Ft struct in_addr 602fe8fb19SBen Gras.Fn inet_makeaddr "in_addr_t net" "in_addr_t lna" 612fe8fb19SBen Gras.Ft in_addr_t 622fe8fb19SBen Gras.Fn inet_netof "struct in_addr in" 632fe8fb19SBen Gras.Ft in_addr_t 642fe8fb19SBen Gras.Fn inet_network "const char *cp" 652fe8fb19SBen Gras.Ft char * 662fe8fb19SBen Gras.Fn inet_ntoa "struct in_addr in" 672fe8fb19SBen Gras.Ft const char * 682fe8fb19SBen Gras.Fn inet_ntop "int af" "const void * restrict src" "char * restrict dst" "socklen_t size" 692fe8fb19SBen Gras.Ft int 702fe8fb19SBen Gras.Fn inet_pton "int af" "const char * restrict src" "void * restrict dst" 712fe8fb19SBen Gras.Sh DESCRIPTION 722fe8fb19SBen GrasThe routines 732fe8fb19SBen Gras.Fn inet_aton , 742fe8fb19SBen Gras.Fn inet_addr 752fe8fb19SBen Grasand 762fe8fb19SBen Gras.Fn inet_network 772fe8fb19SBen Grasinterpret character strings representing 782fe8fb19SBen Grasnumbers expressed in the Internet standard 792fe8fb19SBen Gras.Qq dotted quad 802fe8fb19SBen Grasnotation. 812fe8fb19SBen Gras.Pp 822fe8fb19SBen GrasThe 832fe8fb19SBen Gras.Fn inet_pton 842fe8fb19SBen Grasfunction converts a presentation format address (that is, printable form 852fe8fb19SBen Grasas held in a character string) to network format (usually a 862fe8fb19SBen Gras.Ft struct in_addr 872fe8fb19SBen Grasor some other internal binary representation, in network byte order). 882fe8fb19SBen GrasIt returns 1 if the address was valid for the specified address family, or 892fe8fb19SBen Gras0 if the address wasn't parsable in the specified address family, or -1 902fe8fb19SBen Grasif some system error occurred (in which case 912fe8fb19SBen Gras.Va errno 922fe8fb19SBen Graswill have been set). 932fe8fb19SBen GrasThis function is presently valid for 942fe8fb19SBen Gras.Dv AF_INET 952fe8fb19SBen Grasand 962fe8fb19SBen Gras.Dv AF_INET6 . 972fe8fb19SBen Gras.Pp 982fe8fb19SBen GrasThe 992fe8fb19SBen Gras.Fn inet_aton 1002fe8fb19SBen Grasroutine interprets the specified character string as an Internet address, 1012fe8fb19SBen Grasplacing the address into the structure provided. 1022fe8fb19SBen GrasIt returns 1 if the string was successfully interpreted, 1032fe8fb19SBen Grasor 0 if the string is invalid. 1042fe8fb19SBen Gras.Pp 1052fe8fb19SBen GrasThe 1062fe8fb19SBen Gras.Fn inet_addr 1072fe8fb19SBen Grasand 1082fe8fb19SBen Gras.Fn inet_network 1092fe8fb19SBen Grasfunctions return numbers suitable for use 1102fe8fb19SBen Grasas Internet addresses and Internet network 1112fe8fb19SBen Grasnumbers, respectively. 1122fe8fb19SBen Gras.Pp 1132fe8fb19SBen GrasThe function 1142fe8fb19SBen Gras.Fn inet_ntop 1152fe8fb19SBen Grasconverts an address from network format (usually a 1162fe8fb19SBen Gras.Ft struct in_addr 1172fe8fb19SBen Grasor some other binary form, in network byte order) to presentation format 1182fe8fb19SBen Gras(suitable for external display purposes). 1192fe8fb19SBen GrasIt returns NULL if a system error occurs (in which case, 1202fe8fb19SBen Gras.Va errno 1212fe8fb19SBen Graswill have been set), or it returns a pointer to the destination string. 122*f14fb602SLionel SambucThe 123*f14fb602SLionel Sambuc.Ar size 124*f14fb602SLionel Sambucparameter is the size of the 125*f14fb602SLionel Sambuc.Ar buf 126*f14fb602SLionel Sambucargument. 1272fe8fb19SBen Gras.Pp 1282fe8fb19SBen GrasThe routine 1292fe8fb19SBen Gras.Fn inet_ntoa 1302fe8fb19SBen Grastakes an Internet address and returns an 1312fe8fb19SBen Gras.Tn ASCII 1322fe8fb19SBen Grasstring representing the address in 1332fe8fb19SBen Gras.Qq dotted quad 1342fe8fb19SBen Grasnotation. 1352fe8fb19SBen Gras.Pp 1362fe8fb19SBen GrasThe routine 1372fe8fb19SBen Gras.Fn inet_makeaddr 1382fe8fb19SBen Grastakes an Internet network number and a local network address (both in 1392fe8fb19SBen Grashost order) and constructs an Internet address from it. 1402fe8fb19SBen GrasNote that to convert only a single value to a 1412fe8fb19SBen Gras.Ft struct in_addr 1422fe8fb19SBen Grasform that value should be passed as the first parameter and 1432fe8fb19SBen Gras.Ql 0L 1442fe8fb19SBen Grasshould be given for the second parameter. 1452fe8fb19SBen Gras.Pp 1462fe8fb19SBen GrasThe routines 1472fe8fb19SBen Gras.Fn inet_netof 1482fe8fb19SBen Grasand 1492fe8fb19SBen Gras.Fn inet_lnaof 1502fe8fb19SBen Grasbreak apart Internet host addresses, returning the network number and 1512fe8fb19SBen Graslocal network address part, respectively (both in host order). 1522fe8fb19SBen Gras.Pp 1532fe8fb19SBen GrasAll Internet addresses are returned in network 1542fe8fb19SBen Grasorder (bytes ordered from left to right). 1552fe8fb19SBen GrasAll network numbers and local address parts are 1562fe8fb19SBen Grasreturned as machine format integer values. 1572fe8fb19SBen Gras.Sh INTERNET ADDRESSES (IP VERSION 4) 1582fe8fb19SBen GrasValues specified using the 1592fe8fb19SBen Gras.Qq dotted quad 1602fe8fb19SBen Grasnotation take one 1612fe8fb19SBen Grasof the following forms: 1622fe8fb19SBen Gras.Bd -literal -offset indent 1632fe8fb19SBen Grasa.b.c.d 1642fe8fb19SBen Grasa.b.c 1652fe8fb19SBen Grasa.b 1662fe8fb19SBen Grasa 1672fe8fb19SBen Gras.Ed 1682fe8fb19SBen Gras.Pp 1692fe8fb19SBen GrasWhen four parts are specified, each is interpreted 1702fe8fb19SBen Grasas a byte of data and assigned, from left to right, 1712fe8fb19SBen Grasto the four bytes of an Internet address. 1722fe8fb19SBen GrasNote that when an Internet address is viewed as a 32-bit 1732fe8fb19SBen Grasinteger quantity on a system that uses little-endian 1742fe8fb19SBen Grasbyte order (e.g. 1752fe8fb19SBen Gras.Tn Intel i386, i486 1762fe8fb19SBen Grasand 1772fe8fb19SBen Gras.Tn Pentium 1782fe8fb19SBen Grasprocessors) the bytes referred to above appear as 1792fe8fb19SBen Gras.Dq Li d.c.b.a . 1802fe8fb19SBen GrasThat is, little-endian bytes are ordered from right to left. 1812fe8fb19SBen Gras.Pp 1822fe8fb19SBen GrasWhen a three part address is specified, the last 1832fe8fb19SBen Graspart is interpreted as a 16-bit quantity and placed 1842fe8fb19SBen Grasin the right-most two bytes of the network address. 1852fe8fb19SBen GrasThis makes the three part address format convenient 1862fe8fb19SBen Grasfor specifying Class B network addresses as 1872fe8fb19SBen Gras.Dq Li 128.net.host . 1882fe8fb19SBen Gras.Pp 1892fe8fb19SBen GrasWhen a two part address is supplied, the last part 1902fe8fb19SBen Grasis interpreted as a 24-bit quantity and placed in 1912fe8fb19SBen Grasthe right most three bytes of the network address. 1922fe8fb19SBen GrasThis makes the two part address format convenient 1932fe8fb19SBen Grasfor specifying Class A network addresses as 1942fe8fb19SBen Gras.Dq Li net.host . 1952fe8fb19SBen Gras.Pp 1962fe8fb19SBen GrasWhen only one part is given, the value is stored 1972fe8fb19SBen Grasdirectly in the network address without any byte 1982fe8fb19SBen Grasrearrangement. 1992fe8fb19SBen Gras.Pp 2002fe8fb19SBen GrasAll numbers supplied as 2012fe8fb19SBen Gras.Dq parts 2022fe8fb19SBen Grasin a 2032fe8fb19SBen Gras.Qq dotted quad 2042fe8fb19SBen Grasnotation 2052fe8fb19SBen Grasmay be decimal, octal, or hexadecimal, as specified 2062fe8fb19SBen Grasin the C language (i.e., a leading 0x or 0X implies 2072fe8fb19SBen Grashexadecimal; otherwise, a leading 0 implies octal; 2082fe8fb19SBen Grasotherwise, the number is interpreted as decimal). 2092fe8fb19SBen Gras.Sh INTERNET ADDRESSES (IP VERSION 6) 2102fe8fb19SBen GrasIn order to support scoped IPv6 addresses, 2112fe8fb19SBen Grasthe use of 2122fe8fb19SBen Gras.Xr getaddrinfo 3 2132fe8fb19SBen Grasand 2142fe8fb19SBen Gras.Xr getnameinfo 3 2152fe8fb19SBen Grasis recommended rather than the functions presented here. 2162fe8fb19SBen Gras.Pp 2172fe8fb19SBen GrasThe presentation format of an IPv6 address is given in RFC 2373: 2182fe8fb19SBen Gras.Pp 2192fe8fb19SBen GrasThere are three conventional forms for representing IPv6 addresses as 2202fe8fb19SBen Grastext strings: 2212fe8fb19SBen Gras.Bl -enum 2222fe8fb19SBen Gras.It 2232fe8fb19SBen GrasThe preferred form is x:x:x:x:x:x:x:x, where the 'x's are the 2242fe8fb19SBen Grashexadecimal values of the eight 16-bit pieces of the address. 2252fe8fb19SBen GrasExamples: 2262fe8fb19SBen Gras.Bd -literal -offset indent 2272fe8fb19SBen GrasFEDC:BA98:7654:3210:FEDC:BA98:7654:3210 2282fe8fb19SBen Gras1080:0:0:0:8:800:200C:417A 2292fe8fb19SBen Gras.Ed 2302fe8fb19SBen Gras.Pp 2312fe8fb19SBen GrasNote that it is not necessary to write the leading zeros in an 2322fe8fb19SBen Grasindividual field, but there must be at least one numeral in 2332fe8fb19SBen Grasevery field (except for the case described in 2). 2342fe8fb19SBen Gras.It 2352fe8fb19SBen GrasDue to the method of allocating certain styles of IPv6 2362fe8fb19SBen Grasaddresses, it will be common for addresses to contain long 2372fe8fb19SBen Grasstrings of zero bits. 2382fe8fb19SBen GrasIn order to make writing addresses 2392fe8fb19SBen Grascontaining zero bits easier, a special syntax is available to 2402fe8fb19SBen Grascompress the zeros. 2412fe8fb19SBen GrasThe use of ``::'' indicates multiple groups of 16-bits of zeros. 2422fe8fb19SBen GrasThe ``::'' can only appear once in an address. 2432fe8fb19SBen GrasThe ``::'' can also be used to compress the leading 2442fe8fb19SBen Grasand/or trailing zeros in an address. 2452fe8fb19SBen Gras.Pp 2462fe8fb19SBen GrasFor example the following addresses: 2472fe8fb19SBen Gras.Bd -literal -offset indent 2482fe8fb19SBen Gras1080:0:0:0:8:800:200C:417A a unicast address 2492fe8fb19SBen GrasFF01:0:0:0:0:0:0:43 a multicast address 2502fe8fb19SBen Gras0:0:0:0:0:0:0:1 the loopback address 2512fe8fb19SBen Gras0:0:0:0:0:0:0:0 the unspecified addresses 2522fe8fb19SBen Gras.Ed 2532fe8fb19SBen Gras.Pp 2542fe8fb19SBen Grasmay be represented as: 2552fe8fb19SBen Gras.Bd -literal -offset indent 2562fe8fb19SBen Gras1080::8:800:200C:417A a unicast address 2572fe8fb19SBen GrasFF01::43 a multicast address 2582fe8fb19SBen Gras::1 the loopback address 2592fe8fb19SBen Gras:: the unspecified addresses 2602fe8fb19SBen Gras.Ed 2612fe8fb19SBen Gras.It 2622fe8fb19SBen GrasAn alternative form that is sometimes more convenient when 2632fe8fb19SBen Grasdealing with a mixed environment of IPv4 and IPv6 nodes is 2642fe8fb19SBen Grasx:x:x:x:x:x:d.d.d.d, where the 'x's are the hexadecimal values 2652fe8fb19SBen Grasof the six high-order 16-bit pieces of the address, and the 'd's 2662fe8fb19SBen Grasare the decimal values of the four low-order 8-bit pieces of the 2672fe8fb19SBen Grasaddress (standard IPv4 representation). 2682fe8fb19SBen GrasExamples: 2692fe8fb19SBen Gras.Bd -literal -offset indent 2702fe8fb19SBen Gras0:0:0:0:0:0:13.1.68.3 2712fe8fb19SBen Gras0:0:0:0:0:FFFF:129.144.52.38 2722fe8fb19SBen Gras.Ed 2732fe8fb19SBen Gras.Pp 2742fe8fb19SBen Grasor in compressed form: 2752fe8fb19SBen Gras.Bd -literal -offset indent 2762fe8fb19SBen Gras::13.1.68.3 2772fe8fb19SBen Gras::FFFF:129.144.52.38 2782fe8fb19SBen Gras.Ed 2792fe8fb19SBen Gras.El 2802fe8fb19SBen Gras.Sh DIAGNOSTICS 2812fe8fb19SBen GrasThe constant 2822fe8fb19SBen Gras.Dv INADDR_NONE 2832fe8fb19SBen Grasis returned by 2842fe8fb19SBen Gras.Fn inet_addr 2852fe8fb19SBen Grasand 2862fe8fb19SBen Gras.Fn inet_network 2872fe8fb19SBen Grasfor malformed requests. 288*f14fb602SLionel Sambuc.Sh ERRORS 289*f14fb602SLionel SambucThe 290*f14fb602SLionel Sambuc.Fn inet_ntop 291*f14fb602SLionel Sambucand 292*f14fb602SLionel Sambuc.Fn inet_pton 293*f14fb602SLionel Sambucfunctions may fail with 294*f14fb602SLionel Sambuc.Bl -tag -width Er 295*f14fb602SLionel Sambuc.It Bq Er EAFNOSUPPORT 296*f14fb602SLionel SambucThe value of 297*f14fb602SLionel Sambuc.Fa af 298*f14fb602SLionel Sambucwas not 299*f14fb602SLionel Sambuc.Dv AF_INET 300*f14fb602SLionel Sambucor 301*f14fb602SLionel Sambuc.Dv AF_INET6 . 302*f14fb602SLionel Sambuc.El 303*f14fb602SLionel Sambuc.Pp 304*f14fb602SLionel SambucThe 305*f14fb602SLionel Sambuc.Fn inet_ntop 306*f14fb602SLionel Sambucfunction may fail with 307*f14fb602SLionel Sambuc.Bl -tag -width Er 308*f14fb602SLionel Sambuc.It Bq Er ENOSPC 309*f14fb602SLionel SambucThe 310*f14fb602SLionel Sambuc.Fa size 311*f14fb602SLionel Sambucindicated for 312*f14fb602SLionel Sambuc.Fa dst 313*f14fb602SLionel Sambucwas too small to store the presentation form of the network address. 314*f14fb602SLionel Sambuc.El 3152fe8fb19SBen Gras.Sh SEE ALSO 3162fe8fb19SBen Gras.Xr byteorder 3 , 3172fe8fb19SBen Gras.Xr gethostbyname 3 , 3182fe8fb19SBen Gras.Xr getnetent 3 , 3192fe8fb19SBen Gras.Xr inet_net 3 , 3202fe8fb19SBen Gras.Xr hosts 5 , 3212fe8fb19SBen Gras.Xr networks 5 3222fe8fb19SBen Gras.Rs 3232fe8fb19SBen Gras.%R RFC 2373 3242fe8fb19SBen Gras.%D July 1998 3252fe8fb19SBen Gras.%T "IP Version 6 Addressing Architecture" 3262fe8fb19SBen Gras.Re 3272fe8fb19SBen Gras.Rs 3282fe8fb19SBen Gras.%R RFC 3493 3292fe8fb19SBen Gras.%D February 2003 3302fe8fb19SBen Gras.%T "Basic Socket Interface Extensions for IPv6" 3312fe8fb19SBen Gras.Re 3322fe8fb19SBen Gras.Sh STANDARDS 3332fe8fb19SBen GrasThe 334*f14fb602SLionel Sambuc.Fn inet_ntop 3352fe8fb19SBen Grasand 336*f14fb602SLionel Sambuc.Fn inet_pton 3372fe8fb19SBen Grasfunctions conform to 3382fe8fb19SBen Gras.St -p1003.1-2001 . 3392fe8fb19SBen GrasNote that 340*f14fb602SLionel Sambuc.Fn inet_pton 3412fe8fb19SBen Grasdoes not accept 1-, 2-, or 3-part dotted addresses; all four parts 3422fe8fb19SBen Grasmust be specified. 343*f14fb602SLionel SambucAdditionally all four parts of a dotted address must be decimal. 3442fe8fb19SBen GrasThis is a narrower input set than that accepted by 345*f14fb602SLionel Sambuc.Fn inet_aton . 3462fe8fb19SBen Gras.Sh HISTORY 3472fe8fb19SBen GrasThe 348*f14fb602SLionel Sambuc.Fn inet_addr , 349*f14fb602SLionel Sambuc.Fn inet_network , 350*f14fb602SLionel Sambuc.Fn inet_makeaddr , 351*f14fb602SLionel Sambuc.Fn inet_lnaof 3522fe8fb19SBen Grasand 353*f14fb602SLionel Sambuc.Fn inet_netof 3542fe8fb19SBen Grasfunctions appeared in 3552fe8fb19SBen Gras.Bx 4.2 . 3562fe8fb19SBen GrasThey were changed to use 357*f14fb602SLionel Sambuc.Vt in_addr_t 3582fe8fb19SBen Grasin place of 359*f14fb602SLionel Sambuc.Vt unsigned long 3602fe8fb19SBen Grasin 3612fe8fb19SBen Gras.Nx 2.0 . 3622fe8fb19SBen GrasThe 363*f14fb602SLionel Sambuc.Fn inet_aton 3642fe8fb19SBen Grasand 365*f14fb602SLionel Sambuc.Fn inet_ntoa 3662fe8fb19SBen Grasfunctions appeared in 3672fe8fb19SBen Gras.Bx 4.3 . 3682fe8fb19SBen GrasThe 369*f14fb602SLionel Sambuc.Fn inet_pton 3702fe8fb19SBen Grasand 371*f14fb602SLionel Sambuc.Fn inet_ntop 3722fe8fb19SBen Grasfunctions appeared in BIND 4.9.4 and thence 3732fe8fb19SBen Gras.Nx 1.3 ; 3742fe8fb19SBen Grasthey were also in 3752fe8fb19SBen Gras.St -xns5.2 . 3762fe8fb19SBen Gras.Sh BUGS 3772fe8fb19SBen GrasThe value 3782fe8fb19SBen Gras.Dv INADDR_NONE 3792fe8fb19SBen Gras(0xffffffff) is a valid broadcast address, but 3802fe8fb19SBen Gras.Fn inet_addr 3812fe8fb19SBen Grascannot return that value without indicating failure. 3822fe8fb19SBen GrasThe newer 3832fe8fb19SBen Gras.Fn inet_aton 3842fe8fb19SBen Grasfunction does not share this problem. 3852fe8fb19SBen Gras.Pp 3862fe8fb19SBen GrasThe problem of host byte ordering versus network byte ordering is 3872fe8fb19SBen Grasconfusing. 3882fe8fb19SBen Gras.Pp 3892fe8fb19SBen GrasThe string returned by 3902fe8fb19SBen Gras.Fn inet_ntoa 3912fe8fb19SBen Grasresides in a static memory area. 3922fe8fb19SBen Gras.Pp 393*f14fb602SLionel SambucThe function 3942fe8fb19SBen Gras.Fn inet_addr 3952fe8fb19SBen Grasshould return a 396*f14fb602SLionel Sambuc.Vt struct in_addr . 397*f14fb602SLionel Sambuc.Pp 398*f14fb602SLionel SambucThe function 399*f14fb602SLionel Sambuc.Fn inet_network 400*f14fb602SLionel Sambucdoes not support byte rearrangement for one, two, and three 401*f14fb602SLionel Sambucpart addresses. 402