1 .\" Copyright (c) 2003 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 .\" $Id: krb5_address.3,v 1.4 2003/04/16 13:58:12 lha Exp $
40 .Nm krb5_sockaddr2address ,
41 .Nm krb5_sockaddr2port ,
42 .Nm krb5_addr2sockaddr ,
43 .Nm krb5_max_sockaddr_size ,
44 .Nm krb5_sockaddr_uninteresting ,
45 .Nm krb5_h_addr2sockaddr ,
46 .Nm krb5_h_addr2addr ,
48 .Nm krb5_print_address ,
49 .Nm krb5_parse_address ,
50 .Nm krb5_address_order ,
51 .Nm krb5_address_compare ,
52 .Nm krb5_address_search ,
53 .Nm krb5_free_address ,
54 .Nm krb5_free_addresses ,
55 .Nm krb5_copy_address ,
56 .Nm krb5_copy_addresses ,
57 .Nm krb5_append_addresses ,
58 .Nm krb5_make_addrport
59 .Nd mange addresses in Kerberos.
61 Kerberos 5 Library (libkrb5, -lkrb5)
66 .Fo krb5_sockaddr2address
67 .Fa "krb5_context context"
68 .Fa "const struct sockaddr *sa"
69 .Fa "krb5_address *addr"
72 .Fo krb5_sockaddr2port
73 .Fa "krb5_context context"
74 .Fa "const struct sockaddr *sa"
78 .Fo krb5_addr2sockaddr
79 .Fa "krb5_context context"
80 .Fa "const krb5_address *addr"
81 .Fa "struct sockaddr *sa"
82 .Fa "krb5_socklen_t *sa_size"
86 .Fo krb5_max_sockaddr_size
90 .Fo krb5_sockaddr_uninteresting
91 .Fa "const struct sockaddr *sa"
94 .Fo krb5_h_addr2sockaddr
95 .Fa "krb5_context context"
97 .Fa "const char *addr"
98 .Fa "struct sockaddr *sa"
99 .Fa "krb5_socklen_t *sa_size"
104 .Fa "krb5_context context"
106 .Fa "const char *haddr"
107 .Fa "krb5_address *addr"
111 .Fa "krb5_context context"
113 .Fa "struct sockaddr *sa"
114 .Fa "krb5_socklen_t *sa_size"
118 .Fo krb5_print_address
119 .Fa "const krb5_address *addr"
122 .Fa "size_t *ret_len"
125 .Fo krb5_parse_address
126 .Fa "krb5_context context"
127 .Fa "const char *string"
128 .Fa "krb5_addresses *addresses"
131 .Fo "krb5_address_order"
132 .Fa "krb5_context context"
133 .Fa "const krb5_address *addr1"
134 .Fa "const krb5_address *addr2"
137 .Fo krb5_address_compare
138 .Fa "krb5_context context"
139 .Fa "const krb5_address *addr1"
140 .Fa "const krb5_address *addr2"
143 .Fo krb5_address_search
144 .Fa "krb5_context context"
145 .Fa "const krb5_address *addr"
146 .Fa "const krb5_addresses *addrlist"
149 .Fo krb5_free_address
150 .Fa "krb5_context context"
151 .Fa "krb5_address *address"
154 .Fo krb5_free_addresses
155 .Fa "krb5_context context"
156 .Fa "krb5_addresses *addresses"
159 .Fo krb5_copy_address
160 .Fa "krb5_context context"
161 .Fa "const krb5_address *inaddr"
162 .Fa "krb5_address *outaddr"
165 .Fo krb5_copy_addresses
166 .Fa "krb5_context context"
167 .Fa "const krb5_addresses *inaddr"
168 .Fa "krb5_addresses *outaddr"
171 .Fo krb5_append_addresses
172 .Fa "krb5_context context"
173 .Fa "krb5_addresses *dest"
174 .Fa "const krb5_addresses *source"
177 .Fo krb5_make_addrport
178 .Fa "krb5_context context"
179 .Fa "krb5_address **res"
180 .Fa "const krb5_address *addr"
186 structure holds a address that can be used in Kerberos API
187 calls. There are help functions to set and extract address information
192 structure holds a set of krb5_address:es.
194 .Fn krb5_sockaddr2address
196 .Li "struct sockaddr"
201 .Fn krb5_sockaddr2port
205 .Li "struct sockaddr"
208 .Fn krb5_addr2sockaddr
217 should be initially contain the size of the
219 and after the call, it will contain the actual length of the address.
221 .Fn krb5_max_sockaddr_size
222 returns the max size of the
224 that the Kerberos library will return.
226 .Fn krb5_sockaddr_uninteresting
231 that for that the kerberos library thinks are uninteresting.
232 One example are link local addresses.
234 .Fn krb5_h_addr2sockaddr
236 .Li "struct sockaddr"
243 .Xr gethostbyname 3 )
247 should be initially contain the size of the
249 and after the call, it will contain the actual length of the address.
255 .Fn krb5_h_addr2sockaddr
256 with the exception that it operates on a
263 .Li "struct sockaddr"
269 should be initially contain the size of the
271 and after the call, it will contain the actual length of the address.
273 .Fn krb5_print_address
274 prints the address in
284 it will be filled in length of the string.
286 .Fn krb5_parse_address
287 Returns the resolving a hostname in
293 .Fn krb5_address_order
294 compares to addresses
298 so that it can be used for sorting addresses. If the addresses are the
300 .Fa krb5_address_order will be return 0.
302 .Fn krb5_address_compare
303 compares the addresses
309 if the two addresses are the same.
311 .Fn krb5_address_search
312 checks if the address
314 is a member of the address set list
317 .Fn krb5_free_address
318 frees the data stored in the
320 that is alloced with any of the krb5_address functions.
322 .Fn krb5_free_addresses
323 frees the data stored in the
325 that is alloced with any of the krb5_address functions.
327 .Fn krb5_copy_address
328 copies the content of address
333 .Fn krb5_copy_addresses
334 copies the content of the address list
339 .Fn krb5_append_addresses
340 adds the set of addresses in
344 While copying the addresses, duplicates are also sorted out.
346 .Fn krb5_make_addrport
347 allocates and creates an
350 of type KRB5_ADDRESS_ADDRPORT from
351 .Fa ( addr , port ) .