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 long 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 */
41 typedef struct cm_user {
42 unsigned long refCount; /* ref count */
43 cm_ucell_t *cellInfop; /* list of cell info */
44 osi_mutex_t mx; /* mutex */
45 int vcRefs; /* count of references from virtual circuits */
49 #define CM_USERFLAG_DELETE 1 /* delete on last reference */
50 #define CM_USERFLAG_WASLOGON 2 /* was logon DLL user */
52 extern void cm_InitUser(void);
54 extern cm_user_t *cm_NewUser(void);
56 extern cm_ucell_t *cm_GetUCell(cm_user_t *userp, struct cm_cell *cellp);
58 extern cm_ucell_t *cm_FindUCell(cm_user_t *userp, int iterator);
60 extern void cm_HoldUser(cm_user_t *up);
62 extern void cm_ReleaseUser(cm_user_t *up);
64 extern void cm_ReleaseUserVCRef(cm_user_t *up);
66 extern void cm_CheckTokenCache(long now);
68 extern cm_user_t *cm_rootUserp;
70 #endif /* __CM_USER_H_ENV__ */