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 __CM_USER_H_ENV__
11 #define __CM_USER_H_ENV__ 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 char userName[MAXKTCNAMELEN]; /* user name */
37 #define CM_UCELLFLAG_HASTIX 1 /* has Kerberos tickets */
38 #define CM_UCELLFLAG_RXKAD 2 /* an rxkad connection */
39 #define CM_UCELLFLAG_BADTIX 4 /* tickets are bad or expired */
40 #define CM_UCELLFLAG_RXGK 8 /* an rxgk connection */
42 typedef struct cm_user {
43 unsigned long refCount; /* ref count - cm_userLock */
44 cm_ucell_t *cellInfop; /* list of cell info */
45 osi_mutex_t mx; /* mutex */
46 int vcRefs; /* count of references from virtual circuits */
50 #define CM_USERFLAG_DELETE 1 /* delete on last reference */
51 #define CM_USERFLAG_WASLOGON 2 /* was logon DLL user */
53 extern void cm_InitUser(void);
55 extern cm_user_t *cm_NewUser(void);
57 extern cm_ucell_t *cm_GetUCell(cm_user_t *userp, struct cm_cell *cellp);
59 extern cm_ucell_t *cm_FindUCell(cm_user_t *userp, int iterator);
61 extern void cm_HoldUser(cm_user_t *up);
63 extern void cm_ReleaseUser(cm_user_t *up);
65 extern void cm_ReleaseUserVCRef(cm_user_t *up);
67 extern void cm_CheckTokenCache(time_t now);
69 extern cm_user_t *cm_rootUserp;
71 #endif /* __CM_USER_H_ENV__ */