1 /*
2  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 /*
6  * lib/krb5/rcache/rc_file.h
7  *
8  * This file of the Kerberos V5 software is derived from public-domain code
9  * contributed by Daniel J. Bernstein, <brnstnd@acf10.nyu.edu>.
10  */
11 
12 /*
13  * Declarations for the file replay cache implementation.
14  */
15 
16 #ifndef _KRB5_RC_FILE_H
17 #define	_KRB5_RC_FILE_H
18 
19 #pragma ident	"%Z%%M%	%I%	%E% SMI"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #include "rc_common.h"
26 #include "rc_io.h"
27 
28 #ifndef EXCESSREPS
29 #define	EXCESSREPS 30
30 #endif
31 /*
32  * The rcache will be automatically expunged when the number of expired
33  * krb5_donot_replays encountered incidentally in searching exceeds the number
34  * of live krb5_donot_replays by EXCESSREPS. With the defaults here, a typical
35  * cache might build up some 10K of expired krb5_donot_replays before an
36  * automatic expunge, with the waste basically independent of the number of
37  * stores per minute.
38 
39  * The rcache will also automatically be expunged when it encounters more
40  * than EXCESSREPS expired entries when recovering a cache in
41  * file_recover.
42  */
43 
44 struct file_data {
45 	char *name;
46 	krb5_deltat lifespan;
47 	int hsize;
48 	int numhits;
49 	int nummisses;
50 	struct authlist **h;
51 	struct authlist *a;
52 	krb5_rc_iostuff d;
53 	char recovering;
54 };
55 
56 extern krb5_rc_ops krb5_rc_file_ops;
57 
58 krb5_error_code KRB5_CALLCONV krb5_rc_file_init
59     	PROTOTYPE((krb5_context,
60 		   krb5_rcache,
61 		   krb5_deltat));
62 krb5_error_code KRB5_CALLCONV krb5_rc_file_recover
63 	PROTOTYPE((krb5_context,
64 		   krb5_rcache));
65 krb5_error_code KRB5_CALLCONV krb5_rc_file_destroy
66 	PROTOTYPE((krb5_context,
67 		   krb5_rcache));
68 krb5_error_code KRB5_CALLCONV krb5_rc_file_close
69 	PROTOTYPE((krb5_context,
70 		   krb5_rcache));
71 krb5_error_code KRB5_CALLCONV krb5_rc_file_store
72 	PROTOTYPE((krb5_context,
73 		   krb5_rcache,
74 		   krb5_donot_replay *));
75 krb5_error_code KRB5_CALLCONV krb5_rc_file_expunge
76 	PROTOTYPE((krb5_context,
77 		   krb5_rcache));
78 krb5_error_code KRB5_CALLCONV krb5_rc_file_get_span
79 	PROTOTYPE((krb5_context,
80 		   krb5_rcache,
81 		   krb5_deltat *));
82 char * KRB5_CALLCONV krb5_rc_file_get_name
83 	PROTOTYPE((krb5_context,
84 		   krb5_rcache));
85 krb5_error_code KRB5_CALLCONV krb5_rc_file_resolve
86 	PROTOTYPE((krb5_context,
87 		   krb5_rcache,
88 		   char *));
89 krb5_error_code krb5_rc_file_close_no_free
90 	PROTOTYPE((krb5_context,
91 		   krb5_rcache));
92 void krb5_rc_free_entry
93 	PROTOTYPE((krb5_context,
94 		   krb5_donot_replay **));
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 
100 #endif /* !_KRB5_RC_FILE_H */
101