OpenAFS
OpenAFS distributed network file system
/cygdrive/c/src/openafs/openafs.git/repo/src/WINNT/afsd/cm_user.h
00001 /*
00002  * Copyright 2000, International Business Machines Corporation and others.
00003  * All Rights Reserved.
00004  *
00005  * This software has been released under the terms of the IBM Public
00006  * License.  For details, see the LICENSE file in the top-level source
00007  * directory or online at http://www.openafs.org/dl/license10.html
00008  */
00009 
00010 #ifndef OPENAFS_WINNT_AFSD_CM_USER_H
00011 #define OPENAFS_WINNT_AFSD_CM_USER_H 1
00012 
00013 #include <osi.h>
00014 #include <rx/rxkad.h>
00015 
00016 /* user structure
00017  * no free references outside of cm_allUsersp
00018  * there are held references from cm_conn_t.
00019  *
00020  * All the fields in this structure are locked by the
00021  * corresponding userp's userp->mx mutex.
00022  */
00023 typedef struct cm_ucell {
00024     struct cm_ucell *nextp;             /* next cell in the list */
00025     struct cm_cell *cellp;              /* the cell this applies to */
00026     char *ticketp;                      /* locked by mx */
00027     int ticketLen;                      /* by mx */
00028     struct ktc_encryptionKey sessionKey;/* by mx */
00029     long kvno;                          /* key version in ticket */
00030     time_t expirationTime;              /* when tix expire */
00031     int gen;                            /* generation number */
00032     int iterator;                       /* for use as ListTokens cookie */
00033     long flags;                         /* flags */
00034     fschar_t userName[MAXKTCNAMELEN];   /* user name */
00035 #ifdef QUERY_AFSID
00036     afs_uint32 uid;                     /* User's AFS ID in this cell */
00037 #endif
00038 } cm_ucell_t;
00039 
00040 #define CM_UCELLFLAG_HASTIX       1     /* has Kerberos tickets */
00041 #define CM_UCELLFLAG_RXKAD        2     /* an rxkad connection */
00042 #define CM_UCELLFLAG_BADTIX       4     /* tickets are bad or expired */
00043 #define CM_UCELLFLAG_RXGK         8     /* an rxgk connection */
00044 #define CM_UCELLFLAG_ROOTUSER  0x10     /* cm_rootUser connection */
00045 
00046 typedef struct cm_user {
00047     unsigned long refCount;             /* ref count - cm_userLock */
00048     cm_ucell_t *cellInfop;              /* list of cell info */
00049     osi_mutex_t mx;                     /* mutex */
00050     int vcRefs;                         /* count of references from virtual circuits */
00051     long flags;
00052     GUID authgroup;                     /* AFS redirector */
00053 } cm_user_t;
00054 
00055 #define CM_USERFLAG_DELETE      1       /* delete on last reference */
00056 
00057 extern void cm_InitUser(void);
00058 
00059 extern cm_user_t *cm_NewUser(void);
00060 
00061 extern cm_ucell_t *cm_GetUCell(cm_user_t *userp, struct cm_cell *cellp);
00062 
00063 extern cm_ucell_t *cm_FindUCell(cm_user_t *userp, int iterator);
00064 
00065 extern void cm_HoldUser(cm_user_t *up);
00066 
00067 extern void cm_HoldUserVCRef(cm_user_t *up);
00068 
00069 extern void cm_ReleaseUser(cm_user_t *up);
00070 
00071 extern void cm_ReleaseUserVCRef(cm_user_t *up);
00072 
00073 extern void cm_CheckTokenCache(time_t now);
00074 
00075 extern cm_user_t *cm_rootUserp;
00076 
00077 #endif /*  OPENAFS_WINNT_AFSD_CM_USER_H */
 All Data Structures Files Functions Variables