1 .\" Copyright (c) 2003, 2005 - 2006 Kungliga Tekniska Högskolan
2 .\" (Royal Institute of Technology, Stockholm, Sweden).
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" 3. Neither the name of the Institute nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" $Heimdal: krb5_address.3 17461 2006-05-05 13:13:18Z lha $
41 .Nm krb5_sockaddr2address ,
42 .Nm krb5_sockaddr2port ,
43 .Nm krb5_addr2sockaddr ,
44 .Nm krb5_max_sockaddr_size ,
45 .Nm krb5_sockaddr_uninteresting ,
46 .Nm krb5_h_addr2sockaddr ,
47 .Nm krb5_h_addr2addr ,
49 .Nm krb5_print_address ,
50 .Nm krb5_parse_address ,
51 .Nm krb5_address_order ,
52 .Nm krb5_address_compare ,
53 .Nm krb5_address_search ,
54 .Nm krb5_free_address ,
55 .Nm krb5_free_addresses ,
56 .Nm krb5_copy_address ,
57 .Nm krb5_copy_addresses ,
58 .Nm krb5_append_addresses ,
59 .Nm krb5_make_addrport
60 .Nd mange addresses in Kerberos
62 Kerberos 5 Library (libkrb5, -lkrb5)
67 .Fo krb5_sockaddr2address
68 .Fa "krb5_context context"
69 .Fa "const struct sockaddr *sa"
70 .Fa "krb5_address *addr"
73 .Fo krb5_sockaddr2port
74 .Fa "krb5_context context"
75 .Fa "const struct sockaddr *sa"
79 .Fo krb5_addr2sockaddr
80 .Fa "krb5_context context"
81 .Fa "const krb5_address *addr"
82 .Fa "struct sockaddr *sa"
83 .Fa "krb5_socklen_t *sa_size"
87 .Fo krb5_max_sockaddr_size
91 .Fo krb5_sockaddr_uninteresting
92 .Fa "const struct sockaddr *sa"
95 .Fo krb5_h_addr2sockaddr
96 .Fa "krb5_context context"
98 .Fa "const char *addr"
99 .Fa "struct sockaddr *sa"
100 .Fa "krb5_socklen_t *sa_size"
105 .Fa "krb5_context context"
107 .Fa "const char *haddr"
108 .Fa "krb5_address *addr"
112 .Fa "krb5_context context"
114 .Fa "struct sockaddr *sa"
115 .Fa "krb5_socklen_t *sa_size"
119 .Fo krb5_print_address
120 .Fa "const krb5_address *addr"
123 .Fa "size_t *ret_len"
126 .Fo krb5_parse_address
127 .Fa "krb5_context context"
128 .Fa "const char *string"
129 .Fa "krb5_addresses *addresses"
132 .Fo "krb5_address_order"
133 .Fa "krb5_context context"
134 .Fa "const krb5_address *addr1"
135 .Fa "const krb5_address *addr2"
138 .Fo krb5_address_compare
139 .Fa "krb5_context context"
140 .Fa "const krb5_address *addr1"
141 .Fa "const krb5_address *addr2"
144 .Fo krb5_address_search
145 .Fa "krb5_context context"
146 .Fa "const krb5_address *addr"
147 .Fa "const krb5_addresses *addrlist"
150 .Fo krb5_free_address
151 .Fa "krb5_context context"
152 .Fa "krb5_address *address"
155 .Fo krb5_free_addresses
156 .Fa "krb5_context context"
157 .Fa "krb5_addresses *addresses"
160 .Fo krb5_copy_address
161 .Fa "krb5_context context"
162 .Fa "const krb5_address *inaddr"
163 .Fa "krb5_address *outaddr"
166 .Fo krb5_copy_addresses
167 .Fa "krb5_context context"
168 .Fa "const krb5_addresses *inaddr"
169 .Fa "krb5_addresses *outaddr"
172 .Fo krb5_append_addresses
173 .Fa "krb5_context context"
174 .Fa "krb5_addresses *dest"
175 .Fa "const krb5_addresses *source"
178 .Fo krb5_make_addrport
179 .Fa "krb5_context context"
180 .Fa "krb5_address **res"
181 .Fa "const krb5_address *addr"
187 structure holds a address that can be used in Kerberos API
188 calls. There are help functions to set and extract address information
193 structure holds a set of krb5_address:es.
195 .Fn krb5_sockaddr2address
197 .Li "struct sockaddr"
202 .Fn krb5_sockaddr2port
206 .Li "struct sockaddr"
209 .Fn krb5_addr2sockaddr
219 should initially contain the size of the
221 and after the call, it will contain the actual length of the address.
223 .Fn krb5_max_sockaddr_size
224 returns the max size of the
226 that the Kerberos library will return.
228 .Fn krb5_sockaddr_uninteresting
233 that the kerberos library thinks are uninteresting.
234 One example are link local addresses.
236 .Fn krb5_h_addr2sockaddr
238 .Li "struct sockaddr"
245 .Xr gethostbyname 3 )
250 should initially contain the size of the
252 and after the call, it will contain the actual length of the address.
256 .Fn krb5_h_addr2sockaddr
257 with the exception that it operates on a
260 .Li struct sockaddr .
264 .Li "struct sockaddr"
271 should initially contain the size of the
273 and after the call, it will contain the actual length of the address.
275 .Fn krb5_print_address
276 prints the address in
286 it will be filled with the length of the string if size were unlimited (not
290 .Fn krb5_parse_address
291 Returns the resolved hostname in
297 .Fn krb5_address_order
298 compares the addresses
302 so that it can be used for sorting addresses. If the addresses are the
304 .Fa krb5_address_order
307 .Fn krb5_address_compare
308 compares the addresses
314 if the two addresses are the same.
316 .Fn krb5_address_search
317 checks if the address
319 is a member of the address set list
322 .Fn krb5_free_address
323 frees the data stored in the
325 that is alloced with any of the krb5_address functions.
327 .Fn krb5_free_addresses
328 frees the data stored in the
330 that is alloced with any of the krb5_address functions.
332 .Fn krb5_copy_address
333 copies the content of address
338 .Fn krb5_copy_addresses
339 copies the content of the address list
344 .Fn krb5_append_addresses
345 adds the set of addresses in
349 While copying the addresses, duplicates are also sorted out.
351 .Fn krb5_make_addrport
352 allocates and creates an
355 of type KRB5_ADDRESS_ADDRPORT from
356 .Fa ( addr , port ) .