1 #pragma ident	"%Z%%M%	%I%	%E% SMI"
2 
3 /*
4  * lib/krb5/keytab/rc-int.h
5  *
6  * Copyright 2004 by the Massachusetts Institute of Technology.
7  * All Rights Reserved.
8  *
9  * Export of this software from the United States of America may
10  *   require a specific license from the United States Government.
11  *   It is the responsibility of any person or organization contemplating
12  *   export to obtain such a license before exporting.
13  *
14  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
15  * distribute this software and its documentation for any purpose and
16  * without fee is hereby granted, provided that the above copyright
17  * notice appear in all copies and that both that copyright notice and
18  * this permission notice appear in supporting documentation, and that
19  * the name of M.I.T. not be used in advertising or publicity pertaining
20  * to distribution of the software without specific, written prior
21  * permission.  Furthermore if you modify this software you must label
22  * your software as modified software and not distribute it in such a
23  * fashion that it might be confused with the original M.I.T. software.
24  * M.I.T. makes no representations about the suitability of
25  * this software for any purpose.  It is provided "as is" without express
26  * or implied warranty.
27  *
28  *
29  * This file contains constant and function declarations used in the
30  * file-based replay cache routines.
31  */
32 
33 #ifndef __KRB5_RCACHE_INT_H__
34 #define __KRB5_RCACHE_INT_H__
35 
36 int krb5int_rc_finish_init(void);
37 
38 void krb5int_rc_terminate(void);
39 
40 struct krb5_rc_st {
41     krb5_magic magic;
42     const struct _krb5_rc_ops *ops;
43     krb5_pointer data;
44     k5_mutex_t lock;
45 };
46 
47 struct _krb5_rc_ops {
48     krb5_magic magic;
49     char *type;
50     krb5_error_code (KRB5_CALLCONV *init)
51 	(krb5_context, krb5_rcache,krb5_deltat); /* create */
52     krb5_error_code (KRB5_CALLCONV *recover)
53 	(krb5_context, krb5_rcache); /* open */
54     krb5_error_code (KRB5_CALLCONV *recover_or_init)
55 	(krb5_context, krb5_rcache,krb5_deltat);
56     krb5_error_code (KRB5_CALLCONV *destroy)
57 	(krb5_context, krb5_rcache);
58     krb5_error_code (KRB5_CALLCONV *close)
59 	(krb5_context, krb5_rcache);
60     krb5_error_code (KRB5_CALLCONV *store)
61 	(krb5_context, krb5_rcache,krb5_donot_replay *);
62     krb5_error_code (KRB5_CALLCONV *expunge)
63 	(krb5_context, krb5_rcache);
64     krb5_error_code (KRB5_CALLCONV *get_span)
65 	(krb5_context, krb5_rcache,krb5_deltat *);
66     char *(KRB5_CALLCONV *get_name)
67 	(krb5_context, krb5_rcache);
68     krb5_error_code (KRB5_CALLCONV *resolve)
69 	(krb5_context, krb5_rcache, char *);
70 };
71 
72 typedef struct _krb5_rc_ops krb5_rc_ops;
73 
74 krb5_error_code krb5_rc_register_type (krb5_context, const krb5_rc_ops *);
75 
76 extern krb5_rc_ops *krb5_rc_dfl_ops;
77 extern const krb5_rc_ops krb5_rc_none_ops;
78 
79 #endif /* __KRB5_RCACHE_INT_H__ */
80