~ubuntu-branches/ubuntu/hardy/openswan/hardy-updates

« back to all changes in this revision

Viewing changes to doc/manpage.d/ipsec_rangetoa.3.html

  • Committer: Bazaar Package Importer
  • Author(s): Rene Mayrhofer
  • Date: 2005-01-27 16:10:11 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050127161011-idgybmyz3vwhpfiq
Tags: 2.3.0-2
Urgency HIGH due to security issue and problems with build-deps in sarge.
* Fix the security issue. Please see
  http://www.idefense.com/application/poi/display?id=190&
      type=vulnerabilities&flashstatus=false
  for more details. Thanks to Martin Schulze for informing me about
  this issue.
  Closes: #292458: Openswan XAUTH/PAM Buffer Overflow Vulnerability
* Added a Build-Dependency to lynx.
  Closes: #291143: openswan: FTBFS: Missing build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Content-type: text/html
2
 
 
3
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
 
<HTML><HEAD><TITLE>Man page of IPSEC_ATOASR</TITLE>
5
 
</HEAD><BODY>
6
 
<H1>IPSEC_ATOASR</H1>
7
 
Section: C Library Functions (3)<BR>Updated: 11 June 2001<BR><A HREF="#index">Index</A>
8
 
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
9
 
 
10
 
 
11
 
<A NAME="lbAB">&nbsp;</A>
12
 
<H2>NAME</H2>
13
 
 
14
 
ipsec atoasr - convert ASCII to Internet address, subnet, or range
15
 
<BR>
16
 
 
17
 
ipsec rangetoa - convert Internet address range to ASCII
18
 
<A NAME="lbAC">&nbsp;</A>
19
 
<H2>SYNOPSIS</H2>
20
 
 
21
 
<B>#include &lt;<A HREF="file:///usr/include/freeswan.h">freeswan.h</A>&gt;</B>
22
 
 
23
 
<P>
24
 
<B>const char *atoasr(const char *src, size_t srclen,</B>
25
 
 
26
 
<BR>
27
 
&nbsp;
28
 
<B>char *type, struct in_addr *addrs);</B>
29
 
 
30
 
<BR>
31
 
 
32
 
<B>size_t rangetoa(struct in_addr *addrs, int format,</B>
33
 
 
34
 
<BR>
35
 
&nbsp;
36
 
<B>char *dst, size_t dstlen);</B>
37
 
 
38
 
<A NAME="lbAD">&nbsp;</A>
39
 
<H2>DESCRIPTION</H2>
40
 
 
41
 
These functions are obsolete;
42
 
there is no current equivalent,
43
 
because so far they have not proved useful.
44
 
<P>
45
 
 
46
 
<I>Atoasr</I>
47
 
 
48
 
converts an ASCII address, subnet, or address range
49
 
into a suitable combination of binary addresses
50
 
(in network byte order).
51
 
<I>Rangetoa</I>
52
 
 
53
 
converts an address range back into ASCII,
54
 
using dotted-decimal form for the addresses
55
 
(the other reverse conversions are handled by
56
 
<I><A HREF="/cgi-bin/man/man2html?3+ipsec_addrtoa">ipsec_addrtoa</A></I>(3)
57
 
 
58
 
and
59
 
<I><A HREF="/cgi-bin/man/man2html?3+ipsec_subnettoa">ipsec_subnettoa</A></I>(3)).
60
 
 
61
 
<P>
62
 
 
63
 
A single address can be any form acceptable to
64
 
<I><A HREF="/cgi-bin/man/man2html?3+ipsec_atoaddr">ipsec_atoaddr</A></I>(3):
65
 
 
66
 
dotted decimal, DNS name, or hexadecimal number.
67
 
A subnet
68
 
specification uses the form <I>network</I><B>/</B><I>mask</I>
69
 
interpreted by
70
 
<I><A HREF="/cgi-bin/man/man2html?3+ipsec_atosubnet">ipsec_atosubnet</A></I>(3).
71
 
 
72
 
<P>
73
 
 
74
 
An address range is two
75
 
<I><A HREF="/cgi-bin/man/man2html?3+ipsec_atoaddr">ipsec_atoaddr</A></I>(3)
76
 
 
77
 
addresses separated by a
78
 
<B>...</B>
79
 
 
80
 
delimiter.
81
 
If there are four dots rather than three, the first is taken as
82
 
part of the begin address,
83
 
e.g. for a complete DNS name which ends with
84
 
<B>.</B>
85
 
 
86
 
to suppress completion attempts.
87
 
The begin address of a range must be
88
 
less than or equal to the end address.
89
 
<P>
90
 
 
91
 
The
92
 
<I>srclen</I>
93
 
 
94
 
parameter of
95
 
<I>atoasr</I>
96
 
 
97
 
specifies the length of the ASCII string pointed to by
98
 
<I>src</I>;
99
 
 
100
 
it is an error for there to be anything else
101
 
(e.g., a terminating NUL) within that length.
102
 
As a convenience for cases where an entire NUL-terminated string is
103
 
to be converted,
104
 
a
105
 
<I>srclen</I>
106
 
 
107
 
value of
108
 
<B>0</B>
109
 
 
110
 
is taken to mean
111
 
<B>strlen(src)</B>.
112
 
 
113
 
<P>
114
 
 
115
 
The
116
 
<I>type</I>
117
 
 
118
 
parameter of
119
 
<I>atoasr</I>
120
 
 
121
 
must point to a
122
 
<B>char</B>
123
 
 
124
 
variable used to record which form was found.
125
 
The
126
 
<I>addrs</I>
127
 
 
128
 
parameter must point to a two-element array of
129
 
<B>struct in_addr</B>
130
 
 
131
 
which receives the results.
132
 
The values stored into
133
 
<B>*type</B>,
134
 
 
135
 
and the corresponding values in the array, are:
136
 
<P>
137
 
 
138
 
 
139
 
 
140
 
<TT>&nbsp;&nbsp;&nbsp;</TT>*typeaddrs[0]addrs[1]<BR>
141
 
<P>
142
 
address<B>'a'</B>address-<BR>
143
 
<BR>
144
 
 
145
 
subnet<TT>&nbsp;</TT><B>'s'</B>networkmask<BR>
146
 
<BR>
147
 
 
148
 
range<TT>&nbsp;&nbsp;</TT><B>'r'</B>beginend<BR>
149
 
<P>
150
 
 
151
 
The
152
 
<I>dstlen</I>
153
 
 
154
 
parameter of
155
 
<I>rangetoa</I>
156
 
 
157
 
specifies the size of the
158
 
<I>dst</I>
159
 
 
160
 
parameter;
161
 
under no circumstances are more than
162
 
<I>dstlen</I>
163
 
 
164
 
bytes written to
165
 
<I>dst</I>.
166
 
 
167
 
A result which will not fit is truncated.
168
 
<I>Dstlen</I>
169
 
 
170
 
can be zero, in which case
171
 
<I>dst</I>
172
 
 
173
 
need not be valid and no result is written,
174
 
but the return value is unaffected;
175
 
in all other cases, the (possibly truncated) result is NUL-terminated.
176
 
The
177
 
<I>freeswan.h</I>
178
 
 
179
 
header file defines a constant,
180
 
<B>RANGETOA_BUF</B>,
181
 
 
182
 
which is the size of a buffer just large enough for worst-case results.
183
 
<P>
184
 
 
185
 
The
186
 
<I>format</I>
187
 
 
188
 
parameter of
189
 
<I>rangetoa</I>
190
 
 
191
 
specifies what format is to be used for the conversion.
192
 
The value
193
 
<B>0</B>
194
 
 
195
 
(not the ASCII character
196
 
<B>'0'</B>,
197
 
 
198
 
but a zero value)
199
 
specifies a reasonable default,
200
 
and is in fact the only format currently available.
201
 
This parameter is a hedge against future needs.
202
 
<P>
203
 
 
204
 
<I>Atoasr</I>
205
 
 
206
 
returns NULL for success and
207
 
a pointer to a string-literal error message for failure;
208
 
see DIAGNOSTICS.
209
 
<I>Rangetoa</I>
210
 
 
211
 
returns
212
 
<B>0</B>
213
 
 
214
 
for a failure, and otherwise
215
 
always returns the size of buffer which would 
216
 
be needed to
217
 
accommodate the full conversion result, including terminating NUL;
218
 
it is the caller's responsibility to check this against the size of
219
 
the provided buffer to determine whether truncation has occurred.
220
 
<A NAME="lbAE">&nbsp;</A>
221
 
<H2>SEE ALSO</H2>
222
 
 
223
 
<A HREF="/cgi-bin/man/man2html?3+ipsec_atoaddr">ipsec_atoaddr</A>(3), <A HREF="/cgi-bin/man/man2html?3+ipsec_atosubnet">ipsec_atosubnet</A>(3)
224
 
<A NAME="lbAF">&nbsp;</A>
225
 
<H2>DIAGNOSTICS</H2>
226
 
 
227
 
Fatal errors in
228
 
<I>atoasr</I>
229
 
 
230
 
are:
231
 
empty input;
232
 
error in
233
 
<I><A HREF="/cgi-bin/man/man2html?3+ipsec_atoaddr">ipsec_atoaddr</A></I>(3)
234
 
 
235
 
or
236
 
<I><A HREF="/cgi-bin/man/man2html?3+ipsec_atosubnet">ipsec_atosubnet</A></I>(3)
237
 
 
238
 
during conversion;
239
 
begin address of range exceeds end address.
240
 
<P>
241
 
 
242
 
Fatal errors in
243
 
<I>rangetoa</I>
244
 
 
245
 
are:
246
 
unknown format.
247
 
<A NAME="lbAG">&nbsp;</A>
248
 
<H2>HISTORY</H2>
249
 
 
250
 
Written for the FreeS/WAN project by Henry Spencer.
251
 
<A NAME="lbAH">&nbsp;</A>
252
 
<H2>BUGS</H2>
253
 
 
254
 
The restriction of error reports to literal strings
255
 
(so that callers don't need to worry about freeing them or copying them)
256
 
does limit the precision of error reporting.
257
 
<P>
258
 
 
259
 
The error-reporting convention lends itself
260
 
to slightly obscure code,
261
 
because many readers will not think of NULL as signifying success.
262
 
A good way to make it clearer is to write something like:
263
 
<P>
264
 
 
265
 
<DL COMPACT><DT><DD>
266
 
<PRE>
267
 
<B>const char *error;</B>
268
 
 
269
 
<B>error = atoasr( /* ... */ );</B>
270
 
<B>if (error != NULL) {</B>
271
 
<B>        /* something went wrong */</B>
272
 
</PRE>
273
 
 
274
 
</DL>
275
 
 
276
 
<P>
277
 
 
278
 
<HR>
279
 
<A NAME="index">&nbsp;</A><H2>Index</H2>
280
 
<DL>
281
 
<DT><A HREF="#lbAB">NAME</A><DD>
282
 
<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
283
 
<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
284
 
<DT><A HREF="#lbAE">SEE ALSO</A><DD>
285
 
<DT><A HREF="#lbAF">DIAGNOSTICS</A><DD>
286
 
<DT><A HREF="#lbAG">HISTORY</A><DD>
287
 
<DT><A HREF="#lbAH">BUGS</A><DD>
288
 
</DL>
289
 
<HR>
290
 
This document was created by
291
 
<A HREF="/cgi-bin/man/man2html">man2html</A>,
292
 
using the manual pages.<BR>
293
 
Time: 10:29:42 GMT, June 17, 2004
294
 
</BODY>
295
 
</HTML>