xref: /freebsd/crypto/heimdal/lib/krb5/krb5_get_krbhst.3 (revision 9a14aa017b21c292740c00ee098195cd46642730)
1.\" Copyright (c) 2001 Kungliga Tekniska H�gskolan
2.\" (Royal Institute of Technology, Stockholm, Sweden).
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\"
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\"
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.
15.\"
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.
19.\"
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
30.\" SUCH DAMAGE.
31.\"
32.\" $Id: krb5_get_krbhst.3 14905 2005-04-24 07:46:59Z lha $
33.\"
34.Dd April 24, 2005
35.Dt KRB5_GET_KRBHST 3
36.Os HEIMDAL
37.Sh NAME
38.Nm krb5_get_krbhst ,
39.Nm krb5_get_krb_admin_hst ,
40.Nm krb5_get_krb_changepw_hst ,
41.Nm krb5_get_krb524hst ,
42.Nm krb5_free_krbhst
43.Nd lookup Kerberos KDC hosts
44.Sh LIBRARY
45Kerberos 5 Library (libkrb5, -lkrb5)
46.Sh SYNOPSIS
47.In krb5.h
48.Ft krb5_error_code
49.Fn krb5_get_krbhst "krb5_context context" "const krb5_realm *realm" "char ***hostlist"
50.Ft krb5_error_code
51.Fn krb5_get_krb_admin_hst "krb5_context context" "const krb5_realm *realm" "char ***hostlist"
52.Ft krb5_error_code
53.Fn krb5_get_krb_changepw_hst "krb5_context context" "const krb5_realm *realm" "char ***hostlist"
54.Ft krb5_error_code
55.Fn krb5_get_krb524hst "krb5_context context" "const krb5_realm *realm" "char ***hostlist"
56.Ft krb5_error_code
57.Fn krb5_free_krbhst "krb5_context context" "char **hostlist"
58.Sh DESCRIPTION
59These functions implement the old API to get a list of Kerberos hosts,
60and are thus similar to the
61.Fn krb5_krbhst_init
62functions. However, since these functions returns
63.Em all
64hosts in one go, they potentially have to do more lookups than
65necessary. These functions remain for compatibility reasons.
66.Pp
67After a call to one of these functions,
68.Fa hostlist
69is a
70.Dv NULL
71terminated list of strings, pointing to the requested Kerberos hosts. These should be freed with
72.Fn krb5_free_krbhst
73when done with.
74.Sh EXAMPLES
75The following code will print the KDCs of the realm
76.Dq MY.REALM .
77.Bd -literal -offset indent
78char **hosts, **p;
79krb5_get_krbhst(context, "MY.REALM", &hosts);
80for(p = hosts; *p; p++)
81    printf("%s\\n", *p);
82krb5_free_krbhst(context, hosts);
83.Ed
84.\" .Sh BUGS
85.Sh SEE ALSO
86.Xr krb5_krbhst_init 3
87