1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
22 TITLE="TCP/IP Library Reference"
23 HREF="tcpip-library-reference.html"><LINK
25 TITLE="inet6_rthdr_space"
26 HREF="net-common-tcpip-manpages-inet6-rthdr-space.html"><LINK
29 HREF="net-common-tcpip-manpages-ipx.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="net-common-tcpip-manpages-inet6-rthdr-space.html"
65 >Chapter 38. TCP/IP Library Reference</TD
71 HREF="net-common-tcpip-manpages-ipx.html"
85 NAME="NET-COMMON-TCPIP-MANPAGES-INET-NET">inet_net</H1
94 >INET_NET(3) System Library Functions Manual INET_NET(3)
97 inet_net_ntop, inet_net_pton - Internet network number manipulation rou-
101 #include <sys/socket.h>
102 #include <netinet/in.h>
103 #include <arpa/inet.h>
106 inet_net_ntop(int af, const void *src, int bits, char *dst, size_t size);
109 inet_net_pton(int af, const char *src, void *dst, size_t size);
112 The inet_net_ntop() function converts an Internet network number from
113 network format (usually a struct in_addr or some other binary form, in
114 network byte order) to CIDR presentation format (suitable for external
115 display purposes). bits is the number of bits in src that are the net-
116 work number. It returns NULL if a system error occurs (in which case,
117 errno will have been set), or it returns a pointer to the destination
120 The inet_net_pton() function converts a presentation format Internet net-
121 work number (that is, printable form as held in a character string) to
122 network format (usually a struct in_addr or some other internal binary
123 representation, in network byte order). It returns the number of bits
124 (either computed based on the class, or specified with /CIDR), or -1 if a
125 failure occurred (in which case errno will have been set. It will be set
126 to ENOENT if the Internet network number was not valid).
128 The only value for af currently supported is AF_INET. size is the size
129 of the result buffer dst.
131 NETWORK NUMBERS (IP VERSION 4)
132 Internet network numbers may be specified in one of the following forms:
140 When four parts are specified, each is interpreted as a byte of data and
141 assigned, from left to right, to the four bytes of an Internet network
142 number. Note that when an Internet network number is viewed as a 32-bit
143 integer quantity on a system that uses little-endian byte order (such as
144 the Intel 386, 486, and Pentium processors) the bytes referred to above
145 appear as ``d.c.b.a''. That is, little-endian bytes are ordered from
148 When a three part number is specified, the last part is interpreted as a
149 16-bit quantity and placed in the rightmost two bytes of the Internet
150 network number. This makes the three part number format convenient for
151 specifying Class B network numbers as ``128.net.host''.
153 When a two part number is supplied, the last part is interpreted as a
154 24-bit quantity and placed in the rightmost three bytes of the Internet
155 network number. This makes the two part number format convenient for
156 specifying Class A network numbers as ``net.host''.
158 When only one part is given, the value is stored directly in the Internet
159 network number without any byte rearrangement.
161 All numbers supplied as ``parts'' in a `.' notation may be decimal,
162 octal, or hexadecimal, as specified in the C language (i.e., a leading 0x
163 or 0X implies hexadecimal; otherwise, a leading 0 implies octal; other-
164 wise, the number is interpreted as decimal).
167 byteorder(3), inet(3), networks(5)
170 The inet_net_ntop and inet_net_pton functions first appeared in BIND
173 BSD June 18, 1997 BSD
184 SUMMARY="Footer navigation table"
195 HREF="net-common-tcpip-manpages-inet6-rthdr-space.html"
213 HREF="net-common-tcpip-manpages-ipx.html"
223 >inet6_rthdr_space</TD
229 HREF="tcpip-library-reference.html"