Restructure Makefiles to accomodate multiple archs
[dragonfly.git] / crypto / heimdal-0.6.3 / lib / krb5 / krb5_krbhst_init.cat3
1
2 KRB5_KRBHST_INIT(3)        UNIX Programmer's Manual        KRB5_KRBHST_INIT(3)
3
4 N\bNA\bAM\bME\bE
5      k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_i\bin\bni\bit\bt, k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_n\bne\bex\bxt\bt, k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_n\bne\bex\bxt\bt_\b_a\bas\bs_\b_s\bst\btr\bri\bin\bng\bg,
6      k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_r\bre\bes\bse\bet\bt, k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_f\bfr\bre\bee\be, k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_f\bfo\bor\brm\bma\bat\bt_\b_s\bst\btr\bri\bin\bng\bg,
7      k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_g\bge\bet\bt_\b_a\bad\bdd\bdr\bri\bin\bnf\bfo\bo - lookup Kerberos KDC hosts
8
9 L\bLI\bIB\bBR\bRA\bAR\bRY\bY
10      Kerberos 5 Library (libkrb5, -lkrb5)
11
12 S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
13      _\bk_\br_\bb_\b5_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be
14      k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_i\bin\bni\bit\bt(_\bk_\br_\bb_\b5_\b__\bc_\bo_\bn_\bt_\be_\bx_\bt _\bc_\bo_\bn_\bt_\be_\bx_\bt, _\bc_\bo_\bn_\bs_\bt _\bc_\bh_\ba_\br _\b*_\br_\be_\ba_\bl_\bm,
15              _\bu_\bn_\bs_\bi_\bg_\bn_\be_\bd _\bi_\bn_\bt _\bt_\by_\bp_\be, _\bk_\br_\bb_\b5_\b__\bk_\br_\bb_\bh_\bs_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be _\b*_\bh_\ba_\bn_\bd_\bl_\be)
16
17      _\bk_\br_\bb_\b5_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be
18      k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_n\bne\bex\bxt\bt(_\bk_\br_\bb_\b5_\b__\bc_\bo_\bn_\bt_\be_\bx_\bt _\bc_\bo_\bn_\bt_\be_\bx_\bt, _\bk_\br_\bb_\b5_\b__\bk_\br_\bb_\bh_\bs_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be _\bh_\ba_\bn_\bd_\bl_\be,
19              _\bk_\br_\bb_\b5_\b__\bk_\br_\bb_\bh_\bs_\bt_\b__\bi_\bn_\bf_\bo _\b*_\b*_\bh_\bo_\bs_\bt)
20
21      _\bk_\br_\bb_\b5_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be
22      k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_n\bne\bex\bxt\bt_\b_a\bas\bs_\b_s\bst\btr\bri\bin\bng\bg(_\bk_\br_\bb_\b5_\b__\bc_\bo_\bn_\bt_\be_\bx_\bt _\bc_\bo_\bn_\bt_\be_\bx_\bt,
23              _\bk_\br_\bb_\b5_\b__\bk_\br_\bb_\bh_\bs_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be _\bh_\ba_\bn_\bd_\bl_\be, _\bc_\bh_\ba_\br _\b*_\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be, _\bs_\bi_\bz_\be_\b__\bt _\bh_\bo_\bs_\bt_\bl_\be_\bn)
24
25      _\bv_\bo_\bi_\bd
26      k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_r\bre\bes\bse\bet\bt(_\bk_\br_\bb_\b5_\b__\bc_\bo_\bn_\bt_\be_\bx_\bt _\bc_\bo_\bn_\bt_\be_\bx_\bt, _\bk_\br_\bb_\b5_\b__\bk_\br_\bb_\bh_\bs_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be _\bh_\ba_\bn_\bd_\bl_\be)
27
28      _\bv_\bo_\bi_\bd
29      k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_f\bfr\bre\bee\be(_\bk_\br_\bb_\b5_\b__\bc_\bo_\bn_\bt_\be_\bx_\bt _\bc_\bo_\bn_\bt_\be_\bx_\bt, _\bk_\br_\bb_\b5_\b__\bk_\br_\bb_\bh_\bs_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be _\bh_\ba_\bn_\bd_\bl_\be)
30
31      _\bk_\br_\bb_\b5_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be
32      k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_f\bfo\bor\brm\bma\bat\bt_\b_s\bst\btr\bri\bin\bng\bg(_\bk_\br_\bb_\b5_\b__\bc_\bo_\bn_\bt_\be_\bx_\bt _\bc_\bo_\bn_\bt_\be_\bx_\bt,
33              _\bc_\bo_\bn_\bs_\bt _\bk_\br_\bb_\b5_\b__\bk_\br_\bb_\bh_\bs_\bt_\b__\bi_\bn_\bf_\bo _\b*_\bh_\bo_\bs_\bt, _\bc_\bh_\ba_\br _\b*_\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be, _\bs_\bi_\bz_\be_\b__\bt _\bh_\bo_\bs_\bt_\bl_\be_\bn)
34
35      _\bk_\br_\bb_\b5_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be
36      k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_g\bge\bet\bt_\b_a\bad\bdd\bdr\bri\bin\bnf\bfo\bo(_\bk_\br_\bb_\b5_\b__\bc_\bo_\bn_\bt_\be_\bx_\bt _\bc_\bo_\bn_\bt_\be_\bx_\bt, _\bk_\br_\bb_\b5_\b__\bk_\br_\bb_\bh_\bs_\bt_\b__\bi_\bn_\bf_\bo _\b*_\bh_\bo_\bs_\bt,
37              _\bs_\bt_\br_\bu_\bc_\bt _\ba_\bd_\bd_\br_\bi_\bn_\bf_\bo _\b*_\b*_\ba_\bi)
38
39 D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
40      These functions are used to sequence through all Kerberos hosts of a par-
41      ticular realm and service. The service type can be the KDCs, the adminis-
42      trative servers, the password changing servers, or the servers for Ker-
43      beros 4 ticket conversion.
44
45      First a handle to a particular service is obtained by calling
46      k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_i\bin\bni\bit\bt() with the _\br_\be_\ba_\bl_\bm of interest and the type of service to
47      lookup. The _\bt_\by_\bp_\be can be one of:
48
49            KRB5_KRBHST_KDC
50            KRB5_KRBHST_ADMIN
51            KRB5_KRBHST_CHANGEPW
52            KRB5_KRBHST_KRB524
53
54      The _\bh_\ba_\bn_\bd_\bl_\be is returned to the caller, and should be passed to the other
55      functions.
56
57      For each call to k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_n\bne\bex\bxt\bt() information a new host is returned.
58      The former function returns in _\bh_\bo_\bs_\bt a pointer to a structure containing
59      information about the host, such as protocol, hostname, and port:
60
61            typedef struct krb5_krbhst_info {
62                enum { KRB5_KRBHST_UDP,
63                       KRB5_KRBHST_TCP,
64                       KRB5_KRBHST_HTTP } proto;
65                unsigned short port;
66                struct addrinfo *ai;
67                struct krb5_krbhst_info *next;
68                char hostname[1];
69            } krb5_krbhst_info;
70
71      The related function, k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_n\bne\bex\bxt\bt_\b_a\bas\bs_\b_s\bst\btr\bri\bin\bng\bg(), return the same in-
72      formation as a url-like string.
73
74      When there are no more hosts, these functions return KRB5_KDC_UNREACH.
75
76      To re-iterate over all hosts, call k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_r\bre\bes\bse\bet\bt() and the next call
77      to k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_n\bne\bex\bxt\bt() will return the first host.
78
79      When done with the handle, k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_f\bfr\bre\bee\be() should be called.
80
81      To use a _\bk_\br_\bb_\b5_\b__\bk_\br_\bb_\bh_\bs_\bt_\b__\bi_\bn_\bf_\bo, there are two functions:
82      k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_f\bfo\bor\brm\bma\bat\bt_\b_s\bst\btr\bri\bin\bng\bg() that will return a printable representation
83      of that struct and k\bkr\brb\bb5\b5_\b_k\bkr\brb\bbh\bhs\bst\bt_\b_g\bge\bet\bt_\b_a\bad\bdd\bdr\bri\bin\bnf\bfo\bo() that will return a _\bs_\bt_\br_\bu_\bc_\bt
84      _\ba_\bd_\bd_\br_\bi_\bn_\bf_\bo that can then be used for communicating with the server men-
85      tioned.
86
87 E\bEX\bXA\bAM\bMP\bPL\bLE\bE
88      The following code will print the KDCs of the realm ``MY.REALM''.
89
90            krb5_krbhst_handle handle;
91            char host[MAXHOSTNAMELEN];
92            krb5_krbhst_init(context, "MY.REALM", KRB5_KRBHST_KDC, &handle);
93            while(krb5_krbhst_next_as_string(context, handle,
94                                             host, sizeof(host)) == 0)
95                printf("%s\n", host);
96            krb5_krbhst_free(context, handle);
97
98 H\bHI\bIS\bST\bTO\bOR\bRY\bY
99      These functions first appeared in Heimdal 0.3g.
100
101 S\bSE\bEE\bE A\bAL\bLS\bSO\bO
102      getaddrinfo(3),  krb5_get_krbhst(3)
103
104  HEIMDAL                         June 17, 2001                               2