2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #ifndef OPENAFS_WINNT_AFSD_CM_USER_H
11 #define OPENAFS_WINNT_AFSD_CM_USER_H 1
17 * no free references outside of cm_allUsersp
18 * there are held references from cm_conn_t.
20 * All the fields in this structure are locked by the
21 * corresponding userp's userp->mx mutex.
23 typedef struct cm_ucell {
24 struct cm_ucell *nextp; /* next cell in the list */
25 struct cm_cell *cellp; /* the cell this applies to */
26 char *ticketp; /* locked by mx */
27 int ticketLen; /* by mx */
28 struct ktc_encryptionKey sessionKey;/* by mx */
29 long kvno; /* key version in ticket */
30 time_t expirationTime; /* when tix expire */
31 int gen; /* generation number */
32 int iterator; /* for use as ListTokens cookie */
33 long flags; /* flags */
34 fschar_t userName[MAXKTCNAMELEN]; /* user name */
36 afs_uint32 uid; /* User's AFS ID in this cell */
40 #define CM_UCELLFLAG_HASTIX 1 /* has Kerberos tickets */
41 #define CM_UCELLFLAG_RXKAD 2 /* an rxkad connection */
42 #define CM_UCELLFLAG_BADTIX 4 /* tickets are bad or expired */
43 #define CM_UCELLFLAG_RXGK 8 /* an rxgk connection */
44 #define CM_UCELLFLAG_ROOTUSER 0x10 /* cm_rootUser connection */
46 typedef struct cm_user {
47 long refCount; /* ref count - cm_userLock */
48 cm_ucell_t *cellInfop; /* list of cell info */
49 osi_mutex_t mx; /* mutex */
50 long vcRefs; /* count of references from virtual circuits */
52 GUID authgroup; /* AFS redirector */
55 #define CM_USERFLAG_DELETE 1 /* delete on last reference */
57 extern void cm_InitUser(void);
59 extern cm_user_t *cm_NewUser(void);
61 extern cm_ucell_t *cm_GetUCell(cm_user_t *userp, struct cm_cell *cellp);
63 extern cm_ucell_t *cm_FindUCell(cm_user_t *userp, int iterator);
65 extern void cm_HoldUser(cm_user_t *up);
67 extern void cm_HoldUserVCRef(cm_user_t *up);
69 extern void cm_ReleaseUser(cm_user_t *up);
71 extern void cm_ReleaseUserVCRef(cm_user_t *up);
73 extern void cm_CheckTokenCache(time_t now);
75 extern cm_user_t *cm_rootUserp;
77 #endif /* OPENAFS_WINNT_AFSD_CM_USER_H */