995d038fb418edad7200b01177eba468c1a8f3d7
[openafs.git] / src / WINNT / afsd / afskfw.h
1 /*
2  * Copyright (c) 2003 SkyRope, LLC
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 are met:
7  * 
8  * - Redistributions of source code must retain the above copyright notice, 
9  *   this list of conditions and the following disclaimer.
10  * - Redistributions in binary form must reproduce the above copyright notice, 
11  *   this list of conditions and the following disclaimer in the documentation 
12  *   and/or other materials provided with the distribution.
13  * - Neither the name of Skyrope, LLC nor the names of its contributors may be 
14  *   used to endorse or promote products derived from this software without 
15  *   specific prior written permission from Skyrope, LLC.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
21  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  *
29  */
30
31 #ifndef AFSKFW_H
32 #define AFSKFW_H
33 #ifdef  __cplusplus
34 extern "C" {
35 #endif
36 #include <afs/stds.h>
37 #include <afs/auth.h>
38 #include <afs/cellconfig.h>
39 #include <rxkad.h>
40
41 #define MAXCELLCHARS   64
42 #define MAXHOSTCHARS   64
43 #define MAXHOSTSPERCELL 8
44 #define TRANSARCAFSDAEMON "TransarcAFSDaemon"
45
46 void KFW_initialize(void);
47 void KFW_cleanup(void);
48 int  KFW_is_available(void);
49 int  KFW_AFS_destroy_tickets_for_cell(char *);
50 int  KFW_AFS_renew_expiring_tokens(void);
51 int  KFW_AFS_get_cred( char * username, 
52                         char * cell,
53                         char * password,
54                         int lifetime,
55                         char * smbname,
56                         char ** reasonP );
57 int  KFW_AFS_renew_token_for_cell(char * cell);
58 int  KFW_AFS_renew_tokens_for_all_cells(void);
59 BOOL KFW_AFS_wait_for_service_start(void);
60 BOOL KFW_probe_kdc(struct afsconf_cell *);
61 int  KFW_AFS_get_cellconfig(char *, struct afsconf_cell *, char *);
62 void KFW_import_windows_lsa(void);
63
64 /* From afs/krb_prot.h */
65 /* values for kerb error codes */
66 #define         KERB_ERR_OK                              0
67 #define         KERB_ERR_NAME_EXP                        1
68 #define         KERB_ERR_SERVICE_EXP                     2
69 #define         KERB_ERR_AUTH_EXP                        3
70 #define         KERB_ERR_PKT_VER                         4
71 #define         KERB_ERR_NAME_MAST_KEY_VER               5
72 #define         KERB_ERR_SERV_MAST_KEY_VER               6
73 #define         KERB_ERR_BYTE_ORDER                      7
74 #define         KERB_ERR_PRINCIPAL_UNKNOWN               8
75 #define         KERB_ERR_PRINCIPAL_NOT_UNIQUE            9
76 #define         KERB_ERR_NULL_KEY                       10
77
78 /* From afs/krb.h */
79 #define           RD_AP_TIME     37       /* delta_t too big */
80 #define           INTK_BADPW     62       /* Incorrect password */
81
82 #define PROBE_USERNAME               "OPENAFS-KDC-PROBE"
83 #define PROBE_PASSWORD_LEN           16
84
85 #ifdef  __cplusplus
86 }
87 #endif
88 #endif /* AFSKFW_H */