OpenAFS
OpenAFS distributed network file system
/cygdrive/c/src/openafs/openafs.git/repo/src/WINNT/afsd/afskfw.h
00001 /*
00002 * Copyright (c) 2004, 2005, 2006 Secure Endpoints Inc.
00003 * Copyright (c) 2003 SkyRope, LLC
00004  * All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions are met:
00008  *
00009  * - Redistributions of source code must retain the above copyright notice,
00010  *   this list of conditions and the following disclaimer.
00011  * - Redistributions in binary form must reproduce the above copyright notice,
00012  *   this list of conditions and the following disclaimer in the documentation
00013  *   and/or other materials provided with the distribution.
00014  * - Neither the name of Skyrope, LLC nor the names of its contributors may be
00015  *   used to endorse or promote products derived from this software without
00016  *   specific prior written permission from Skyrope, LLC.
00017  *
00018  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00019  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
00020  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
00021  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
00022  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00023  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00024  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00025  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00026  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00027  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00028  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029  *
00030  */
00031 
00032 #ifndef AFSKFW_H
00033 #define AFSKFW_H
00034 
00035 #ifdef  __cplusplus
00036 extern "C" {
00037 #endif
00038 #include <afs/stds.h>
00039 #include <afs/auth.h>
00040 #include <afs/cellconfig.h>
00041 #include <cm_config.h>
00042 #include <rx/rxkad.h>
00043 
00044 #define CELL_MAXNAMELEN 256
00045 #define MAXHOSTCHARS   64
00046 #define MAXHOSTSPERCELL 8
00047 #define TRANSARCAFSDAEMON "TransarcAFSDaemon"
00048 
00049 void KFW_initialize(void);
00050 void KFW_cleanup(void);
00051 int  KFW_is_available(void);
00052 int  KFW_AFS_destroy_tickets_for_cell(char *);
00053 int  KFW_AFS_destroy_tickets_for_principal(char *);
00054 int  KFW_AFS_renew_expiring_tokens(void);
00055 int  KFW_AFS_get_cred( char * username,
00056                         char * cell,
00057                         char * password,
00058                         int lifetime,
00059                         char * smbname,
00060                         char ** reasonP );
00061 int  KFW_AFS_renew_token_for_cell(char * cell);
00062 int  KFW_AFS_renew_tokens_for_all_cells(void);
00063 BOOL KFW_AFS_wait_for_service_start(void);
00064 BOOL KFW_probe_kdc(struct afsconf_cell *);
00065 int  KFW_AFS_get_cellconfig(char *, struct afsconf_cell *, char *);
00066 void KFW_import_windows_lsa(void);
00067 BOOL KFW_AFS_get_lsa_principal(char *, DWORD *);
00068 int  KFW_AFS_set_file_cache_dacl(char *filename, HANDLE hUserToken);
00069 int  KFW_AFS_obtain_user_temp_directory(HANDLE hUserToken, char *newfilename, int size);
00070 int  KFW_AFS_copy_file_cache_to_default_cache(char * filename);
00071 char * KFW_get_default_realm(void);
00072 
00073 
00074 /* These functions are only to be used in the afslogon.dll */
00075 void KFW_AFS_copy_cache_to_system_file(char *, char *);
00076 int  KFW_AFS_copy_system_file_to_default_cache(char *);
00077 
00078 /* From afs/krb_prot.h */
00079 /* values for kerb error codes */
00080 #define         KERB_ERR_OK                              0
00081 #define         KERB_ERR_NAME_EXP                        1
00082 #define         KERB_ERR_SERVICE_EXP                     2
00083 #define         KERB_ERR_AUTH_EXP                        3
00084 #define         KERB_ERR_PKT_VER                         4
00085 #define         KERB_ERR_NAME_MAST_KEY_VER               5
00086 #define         KERB_ERR_SERV_MAST_KEY_VER               6
00087 #define         KERB_ERR_BYTE_ORDER                      7
00088 #define         KERB_ERR_PRINCIPAL_UNKNOWN               8
00089 #define         KERB_ERR_PRINCIPAL_NOT_UNIQUE            9
00090 #define         KERB_ERR_NULL_KEY                       10
00091 
00092 /* From afs/krb.h */
00093 #ifndef RD_AP_TIME
00094 #define           RD_AP_TIME     37       /* delta_t too big */
00095 #endif
00096 #ifndef INTK_BADPW
00097 #define           INTK_BADPW     62       /* Incorrect password */
00098 #endif
00099 
00100 #define PROBE_USERNAME               "OPENAFS-KDC-PROBE"
00101 #define PROBE_PASSWORD_LEN           16
00102 
00103 #define DO_NOT_REGISTER_VARNAME  "OPENAFS_DO_NOT_REGISTER_AFS_ID"
00104 #ifdef  __cplusplus
00105 }
00106 #endif
00107 #endif /* AFSKFW_H */
 All Data Structures Files Functions Variables