revert between 56095 -> 55830 in arch
[AROS.git] / workbench / network / stacks / AROSTCP / bsdsocket / api / auto_inetaddr.c
blobb44f25824133774a81a85a1df5e4d293f90756fa
1 /****** bsdsocket.library/inet_addr *****************************************
3 * NAME
4 * inet_addr, inet_network, Inet_MakeAddr, Inet_LnaOf,
5 * Inet_NetOf, Inet_NtoA - Internet address manipulation
7 * inet_makeaddr, inet_lnaof, inet_netof,
8 * inet_ntoa -- inline/stub functions to handle structure arguments
10 * SYNOPSIS
11 * #include <netinet/in.h>
13 * addr = inet_addr(cp)
14 * D0 A0
16 * unsigned long inet_addr(char *);
18 * net = inet_network(cp)
19 * D0 A0
21 * unsigned long inet_network(char *);
23 * in_addr = Inet_MakeAddr(net, lna)
24 * D0 D0 D1
26 * unsigned long Inet_MakeAddr(long, long);
28 * lna = Inet_LnaOf(in)
29 * D0 D0
31 * long Inet_LnaOf(unsigned long);
33 * net = Inet_NetOf(in)
34 * D0 D0
36 * long Inet_NetOf(unsigned long);
38 * addr = Inet_NtoA(in)
39 * DO D0
41 * char * Inet_NtoA(unsigned long);
44 * in_addr = inet_makeaddr(net, lna)
46 * struct in_addr inet_makeaddr(long, long);
48 * lna = inet_lnaof(in)
50 * int inet_lnaof(struct in_addr);
52 * net = inet_netof(in)
54 * int inet_netof(struct in_addr);
56 * addr = inet_ntoa(in)
58 * char * inet_ntoa(struct in_addr);
60 * IMPLEMENTATION NOTE
61 * Return value of Inet_MakeAddr() and argument types of
62 * Inet_LnaOf(), Inet_NetOf() and Inet_NtoA() are longs instead
63 * of struct in_addr. The original behaviour is achieved by
64 * using included stub functions (lower case function names)
65 * which handle structure arguments.
67 * DESCRIPTION
68 * The routines inet_addr() and inet_network() each interpret
69 * character strings representing numbers expressed in the
70 * Internet standard `.' notation, returning numbers suitable
71 * for use as Internet addresses and Internet network numbers,
72 * respectively. The routine inet_makeaddr() takes an Internet
73 * network number and a local network address and constructs an
74 * Internet address from it. The routines inet_netof() and
75 * inet_lnaof() break apart Internet host addresses, returning
76 * the network number and local network address part, respec-
77 * tively.
79 * The routine inet_ntoa() returns a pointer to a string in the
80 * base 256 notation ``d.d.d.d'' described below.
82 * All Internet address are returned in network order (bytes
83 * ordered from left to right). All network numbers and local
84 * address parts are returned as machine format integer values.
86 * INTERNET ADDRESSES
87 * Values specified using the `.' notation take one of the
89 * following forms:
91 * a.b.c.d
92 * a.b.c
93 * a.b
94 * a
96 * When four parts are specified, each is interpreted as a byte
97 * of data and assigned, from left to right, to the four bytes
98 * of an Internet address. Note: when an Internet address is
99 * viewed as a 32-bit integer quantity on little endian
100 * systems, the bytes referred to above appear as d.c.b.a.
101 * bytes are ordered from right to left.
103 * When a three part address is specified, the last part is
104 * interpreted as a 16-bit quantity and placed in the right
105 * most two bytes of the network address. This makes the three
106 * part address format convenient for specifying Class B net-
107 * work addresses as "128.net.host".
109 * When a two part address is supplied, the last part is inter-
110 * preted as a 24-bit quantity and placed in the right most
111 * three bytes of the network address. This makes the two part
112 * address format convenient for specifying Class A network
113 * addresses as "net.host".
115 * When only one part is given, the value is stored directly in
116 * the network address without any byte rearrangement.
118 * All numbers supplied as ``parts'' in a `.' notation may be
119 * decimal, octal, or hexadecimal, as specified in the C
120 * language (that is, a leading 0x or 0X implies hexadecimal;
121 * otherwise, a leading 0 implies octal; otherwise, the number
122 * is interpreted as decimal).
124 * RETURN VALUE
125 * The value -1 is returned by inet_addr() and inet_network()
126 * for malformed requests.
128 * BUGS
129 * The problem of host byte ordering versus network byte order-
130 * ing is confusing. A simple way to specify Class C network
131 * addresses in a manner similar to that for Class B and Class
132 * A is needed.
134 * The return value from inet_ntoa() points to static buffer
135 * which is overwritten in each inet_ntoa() call.
137 *****************************************************************************
141 #define NOTEX
142 /****** bsdsocket.library/Inet_LnaOf ****************************************
144 * SEE ALSO
145 * inet_addr()
147 *****************************************************************************
151 #define NOTEX
152 /****** bsdsocket.library/inet_lnaof ****************************************
154 * SEE ALSO
155 * inet_addr()
157 *****************************************************************************
161 #define NOTEX
162 /****** bsdsocket.library/inet_MakeAddr *************************************
164 * SEE ALSO
165 * inet_addr()
167 *****************************************************************************
171 #define NOTEX
172 /****** bsdsocket.library/inet_makeaddr *************************************
174 * SEE ALSO
175 * inet_addr()
177 *****************************************************************************
181 #define NOTEX
182 /****** bsdsocket.library/Inet_NetOf ****************************************
184 * SEE ALSO
185 * inet_addr()
187 *****************************************************************************
191 #define NOTEX
192 /****** bsdsocket.library/inet_netof ****************************************
194 * SEE ALSO
195 * inet_addr()
197 *****************************************************************************
201 #define NOTEX
202 /****** bsdsocket.library/inet_network **************************************
204 * SEE ALSO
205 * inet_addr()
207 *****************************************************************************
211 #define NOTEX
212 /****** bsdsocket.library/Inet_NtoA *****************************************
214 * SEE ALSO
215 * inet_addr()
217 *****************************************************************************
221 #define NOTEX
222 /****** bsdsocket.library/inet_ntoa *****************************************
224 * SEE ALSO
225 * inet_addr()
227 *****************************************************************************