1
Content-type: text/html
3
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<HTML><HEAD><TITLE>Man page of IPSEC_INITADDR</TITLE>
6
<H1>IPSEC_INITADDR</H1>
7
Section: C Library Functions (3)<BR>Updated: 11 Sept 2000<BR><A HREF="#index">Index</A>
8
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
11
<A NAME="lbAB"> </A>
14
ipsec initaddr - initialize an ip_address
17
ipsec addrtypeof - get address type of an ip_address
20
ipsec addrlenof - get length of address within an ip_address
23
ipsec addrbytesof - get copy of address within an ip_address
26
ipsec addrbytesptr - get pointer to address within an ip_address
27
<A NAME="lbAC"> </A>
30
<B>#include <<A HREF="file:///usr/include/freeswan.h">freeswan.h</A>></B>
33
<B>const char *initaddr(const char *src, size_t srclen,</B>
37
<B>int af, ip_address *dst);</B>
41
<B>int addrtypeof(const ip_address *src);</B>
45
<B>size_t addrlenof(const ip_address *src);</B>
49
<B>size_t addrbytesof(const ip_address *src,</B>
53
<B>unsigned char *dst, size_t dstlen);</B>
57
<B>size_t addrbytesptr(const ip_address *src,</B>
61
<B>const unsigned char **dst);</B>
63
<A NAME="lbAD"> </A>
67
<B><<A HREF="file:///usr/include/freeswan.h">freeswan.h</A>></B>
69
library uses an internal type
72
to contain one of the (currently two) types of IP address.
73
These functions provide basic tools for creating and examining this type.
78
initializes a variable
85
(in network byte order,
86
indicated by a pointer
101
The length must be consistent with the address family.
106
returns the address type of an address,
114
<B><<A HREF="file:///usr/include/freeswan.h">freeswan.h</A>></B>
116
header file arranges to include the necessary headers for these
122
returns the size (in bytes) of the address within an
125
to permit storage allocation etc.
130
copies the address within the
135
to the buffer indicated by the pointer
141
and returns the address length (in bytes).
142
If the address will not fit,
143
as many bytes as will fit are copied;
144
the returned length is still the full length.
145
It is the caller's responsibility to check the
146
returned value to ensure that there was enough room.
154
to a pointer to the internal address within the
157
and returns the address length (in bytes).
164
it just returns the address length.
165
The pointer points to
168
to discourage misuse.
177
a pointer to a string-literal error message for failure;
181
The functions which return
188
<A NAME="lbAE"> </A>
191
<A HREF="/cgi-bin/man/man2html?3+inet">inet</A>(3), <A HREF="/cgi-bin/man/man2html?3+ipsec_ttoaddr">ipsec_ttoaddr</A>(3)
192
<A NAME="lbAF"> </A>
195
An unknown address family is a fatal error for any of these functions
199
An address-size mismatch is a fatal error for
202
<A NAME="lbAG"> </A>
205
Written for the FreeS/WAN project by Henry Spencer.
206
<A NAME="lbAH"> </A>
211
should probably have been named
217
<A NAME="index"> </A><H2>Index</H2>
219
<DT><A HREF="#lbAB">NAME</A><DD>
220
<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
221
<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
222
<DT><A HREF="#lbAE">SEE ALSO</A><DD>
223
<DT><A HREF="#lbAF">DIAGNOSTICS</A><DD>
224
<DT><A HREF="#lbAG">HISTORY</A><DD>
225
<DT><A HREF="#lbAH">BUGS</A><DD>
228
This document was created by
229
<A HREF="/cgi-bin/man/man2html">man2html</A>,
230
using the manual pages.<BR>
231
Time: 10:29:41 GMT, June 17, 2004