]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - doc/html/ref/net-common-tcpip-manpages-inet-net.html
Initial revision
[karo-tx-redboot.git] / doc / html / ref / net-common-tcpip-manpages-inet-net.html
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.               -->
9 <HTML
10 ><HEAD
11 ><TITLE
12 >inet_net</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
14 <META
15 NAME="GENERATOR"
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
17 "><LINK
18 REL="HOME"
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
21 REL="UP"
22 TITLE="TCP/IP Library Reference"
23 HREF="tcpip-library-reference.html"><LINK
24 REL="PREVIOUS"
25 TITLE="inet6_rthdr_space"
26 HREF="net-common-tcpip-manpages-inet6-rthdr-space.html"><LINK
27 REL="NEXT"
28 TITLE="ipx"
29 HREF="net-common-tcpip-manpages-ipx.html"></HEAD
30 ><BODY
31 CLASS="SECT1"
32 BGCOLOR="#FFFFFF"
33 TEXT="#000000"
34 LINK="#0000FF"
35 VLINK="#840084"
36 ALINK="#0000FF"
37 ><DIV
38 CLASS="NAVHEADER"
39 ><TABLE
40 SUMMARY="Header navigation table"
41 WIDTH="100%"
42 BORDER="0"
43 CELLPADDING="0"
44 CELLSPACING="0"
45 ><TR
46 ><TH
47 COLSPAN="3"
48 ALIGN="center"
49 >eCos Reference Manual</TH
50 ></TR
51 ><TR
52 ><TD
53 WIDTH="10%"
54 ALIGN="left"
55 VALIGN="bottom"
56 ><A
57 HREF="net-common-tcpip-manpages-inet6-rthdr-space.html"
58 ACCESSKEY="P"
59 >Prev</A
60 ></TD
61 ><TD
62 WIDTH="80%"
63 ALIGN="center"
64 VALIGN="bottom"
65 >Chapter 38. TCP/IP Library Reference</TD
66 ><TD
67 WIDTH="10%"
68 ALIGN="right"
69 VALIGN="bottom"
70 ><A
71 HREF="net-common-tcpip-manpages-ipx.html"
72 ACCESSKEY="N"
73 >Next</A
74 ></TD
75 ></TR
76 ></TABLE
77 ><HR
78 ALIGN="LEFT"
79 WIDTH="100%"></DIV
80 ><DIV
81 CLASS="SECT1"
82 ><H1
83 CLASS="SECT1"
84 ><A
85 NAME="NET-COMMON-TCPIP-MANPAGES-INET-NET">inet_net</H1
86 ><TABLE
87 BORDER="5"
88 BGCOLOR="#E0E0F0"
89 WIDTH="70%"
90 ><TR
91 ><TD
92 ><PRE
93 CLASS="SCREEN"
94 >INET_NET(3)             System Library Functions Manual            INET_NET(3)
95
96 NAME
97      inet_net_ntop, inet_net_pton - Internet network number manipulation rou-
98      tines
99
100 SYNOPSIS
101      #include &lt;sys/socket.h&#62;
102      #include &lt;netinet/in.h&#62;
103      #include &lt;arpa/inet.h&#62;
104
105      char *
106      inet_net_ntop(int af, const void *src, int bits, char *dst, size_t size);
107
108      int
109      inet_net_pton(int af, const char *src, void *dst, size_t size);
110
111 DESCRIPTION
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
118      string.
119
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).
127
128      The only value for af currently supported is AF_INET.  size is the size
129      of the result buffer dst.
130
131 NETWORK NUMBERS (IP VERSION 4)
132      Internet network numbers may be specified in one of the following forms:
133
134            a.b.c.d/bits
135            a.b.c.d
136            a.b.c
137            a.b
138            a
139
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
146      right to left.
147
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''.
152
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''.
157
158      When only one part is given, the value is stored directly in the Internet
159      network number without any byte rearrangement.
160
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).
165
166 SEE ALSO
167      byteorder(3), inet(3), networks(5)
168
169 HISTORY
170      The inet_net_ntop and inet_net_pton functions first appeared in BIND
171      4.9.4.
172
173 BSD                              June 18, 1997                             BSD
174     </PRE
175 ></TD
176 ></TR
177 ></TABLE
178 ></DIV
179 ><DIV
180 CLASS="NAVFOOTER"
181 ><HR
182 ALIGN="LEFT"
183 WIDTH="100%"><TABLE
184 SUMMARY="Footer navigation table"
185 WIDTH="100%"
186 BORDER="0"
187 CELLPADDING="0"
188 CELLSPACING="0"
189 ><TR
190 ><TD
191 WIDTH="33%"
192 ALIGN="left"
193 VALIGN="top"
194 ><A
195 HREF="net-common-tcpip-manpages-inet6-rthdr-space.html"
196 ACCESSKEY="P"
197 >Prev</A
198 ></TD
199 ><TD
200 WIDTH="34%"
201 ALIGN="center"
202 VALIGN="top"
203 ><A
204 HREF="ecos-ref.html"
205 ACCESSKEY="H"
206 >Home</A
207 ></TD
208 ><TD
209 WIDTH="33%"
210 ALIGN="right"
211 VALIGN="top"
212 ><A
213 HREF="net-common-tcpip-manpages-ipx.html"
214 ACCESSKEY="N"
215 >Next</A
216 ></TD
217 ></TR
218 ><TR
219 ><TD
220 WIDTH="33%"
221 ALIGN="left"
222 VALIGN="top"
223 >inet6_rthdr_space</TD
224 ><TD
225 WIDTH="34%"
226 ALIGN="center"
227 VALIGN="top"
228 ><A
229 HREF="tcpip-library-reference.html"
230 ACCESSKEY="U"
231 >Up</A
232 ></TD
233 ><TD
234 WIDTH="33%"
235 ALIGN="right"
236 VALIGN="top"
237 >ipx</TD
238 ></TR
239 ></TABLE
240 ></DIV
241 ></BODY
242 ></HTML
243 >