1 .TH IPSEC_INITADDR 3 "11 Sept 2000"
2 .\" RCSID $Id: initaddr.3,v 1.6 2002/03/12 16:49:56 henry Exp $
4 ipsec initaddr \- initialize an ip_address
6 ipsec addrtypeof \- get address type of an ip_address
8 ipsec addrlenof \- get length of address within an ip_address
10 ipsec addrbytesof \- get copy of address within an ip_address
12 ipsec addrbytesptr \- get pointer to address within an ip_address
14 .B "#include <freeswan.h>"
16 .B "const char *initaddr(const char *src, size_t srclen,"
18 .B "int af, ip_address *dst);"
20 .B "int addrtypeof(const ip_address *src);"
22 .B "size_t addrlenof(const ip_address *src);"
24 .B "size_t addrbytesof(const ip_address *src,"
26 .B "unsigned char *dst, size_t dstlen);"
28 .B "size_t addrbytesptr(const ip_address *src,"
30 .B "const unsigned char **dst);"
34 library uses an internal type
36 to contain one of the (currently two) types of IP address.
37 These functions provide basic tools for creating and examining this type.
40 initializes a variable
45 (in network byte order,
46 indicated by a pointer
56 The length must be consistent with the address family.
59 returns the address type of an address,
66 header file arranges to include the necessary headers for these
70 returns the size (in bytes) of the address within an
72 to permit storage allocation etc.
75 copies the address within the
78 to the buffer indicated by the pointer
82 and returns the address length (in bytes).
83 If the address will not fit,
84 as many bytes as will fit are copied;
85 the returned length is still the full length.
86 It is the caller's responsibility to check the
87 returned value to ensure that there was enough room.
92 to a pointer to the internal address within the
94 and returns the address length (in bytes).
99 it just returns the address length.
100 The pointer points to
102 to discourage misuse.
108 a pointer to a string-literal error message for failure;
111 The functions which return
117 inet(3), ipsec_ttoaddr(3)
119 An unknown address family is a fatal error for any of these functions
122 An address-size mismatch is a fatal error for
125 Written for the FreeS/WAN project by Henry Spencer.
128 should probably have been named