1 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /* lib/krb5/ccache/cc-int.h */
4 * Copyright 1990,1991 by the Massachusetts Institute of Technology.
7 * Export of this software from the United States of America may
8 * require a specific license from the United States Government.
9 * It is the responsibility of any person or organization contemplating
10 * export to obtain such a license before exporting.
12 * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
13 * distribute this software and its documentation for any purpose and
14 * without fee is hereby granted, provided that the above copyright
15 * notice appear in all copies and that both that copyright notice and
16 * this permission notice appear in supporting documentation, and that
17 * the name of M.I.T. not be used in advertising or publicity pertaining
18 * to distribution of the software without specific, written prior
19 * permission. Furthermore if you modify this software you must label
20 * your software as modified software and not distribute it in such a
21 * fashion that it might be confused with the original M.I.T. software.
22 * M.I.T. makes no representations about the suitability of
23 * this software for any purpose. It is provided "as is" without express
24 * or implied warranty.
27 /* This file contains constant and function declarations used in the
28 * file-based credential cache routines. */
30 #ifndef __KRB5_CCACHE_H__
31 #define __KRB5_CCACHE_H__
36 krb5int_cc_creds_match_request(krb5_context, krb5_flags whichfields, krb5_creds *mcreds, krb5_creds *creds);
39 krb5int_cc_initialize(void);
42 krb5int_cc_finalize(void);
44 krb5_error_code krb5int_random_string (krb5_context, char *, unsigned int);
47 * Cursor for iterating over ccache types
49 struct krb5_cc_typecursor;
50 typedef struct krb5_cc_typecursor *krb5_cc_typecursor;
53 krb5int_cc_typecursor_new(krb5_context context, krb5_cc_typecursor *cursor);
56 krb5int_cc_typecursor_next(
58 krb5_cc_typecursor cursor,
59 const struct _krb5_cc_ops **ops);
62 krb5int_cc_typecursor_free(
64 krb5_cc_typecursor *cursor);
66 /* reentrant mutex used by krb5_cc_* functions */
67 typedef struct _k5_cc_mutex {
73 #define K5_CC_MUTEX_PARTIAL_INITIALIZER \
74 { K5_MUTEX_PARTIAL_INITIALIZER, NULL, 0 }
77 k5_cc_mutex_init(k5_cc_mutex *m);
80 k5_cc_mutex_finish_init(k5_cc_mutex *m);
82 #define k5_cc_mutex_destroy(M) \
83 k5_mutex_destroy(&(M)->lock);
86 k5_cc_mutex_assert_locked(krb5_context context, k5_cc_mutex *m);
89 k5_cc_mutex_assert_unlocked(krb5_context context, k5_cc_mutex *m);
92 k5_cc_mutex_lock(krb5_context context, k5_cc_mutex *m);
95 k5_cc_mutex_unlock(krb5_context context, k5_cc_mutex *m);
97 extern k5_cc_mutex krb5int_mcc_mutex;
98 extern k5_cc_mutex krb5int_krcc_mutex;
99 extern k5_cc_mutex krb5int_cc_file_mutex;
102 extern krb5_error_code KRB5_CALLCONV krb5_stdccv3_context_lock
103 (krb5_context context);
105 extern krb5_error_code KRB5_CALLCONV krb5_stdccv3_context_unlock
106 (krb5_context context);
110 k5_cc_mutex_force_unlock(k5_cc_mutex *m);
113 k5_cccol_force_unlock(void);
116 krb5int_fcc_new_unique(krb5_context context, char *template, krb5_ccache *id);
119 ccselect_realm_initvt(krb5_context context, int maj_ver, int min_ver,
120 krb5_plugin_vtable vtable);
123 ccselect_k5identity_initvt(krb5_context context, int maj_ver, int min_ver,
124 krb5_plugin_vtable vtable);
126 #endif /* __KRB5_CCACHE_H__ */