xref: /titanic_41/usr/src/lib/gss_mechs/mech_krb5/krb5/rcache/rc_file.h (revision 159d09a20817016f09b3ea28d1bdada4a336bb91)
1 /*
2  * Copyright 2008 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 /*
14  * Declarations for the file replay cache implementation.
15  */
16 
17 #ifndef _KRB5_RC_FILE_H
18 #define	_KRB5_RC_FILE_H
19 
20 
21 /* Solaris Kerberos */
22 
23 #include "rc_common.h"
24 #include "rc_io.h"
25 #include "rc-int.h"
26 
27 #ifndef EXCESSREPS
28 #define	EXCESSREPS 30
29 #endif
30 /*
31  * The rcache will be automatically expunged when the number of expired
32  * krb5_donot_replays encountered incidentally in searching exceeds the number
33  * of live krb5_donot_replays by EXCESSREPS. With the defaults here, a typical
34  * cache might build up some 10K of expired krb5_donot_replays before an
35  * automatic expunge, with the waste basically independent of the number of
36  * stores per minute.
37 
38  * The rcache will also automatically be expunged when it encounters more
39  * than EXCESSREPS expired entries when recovering a cache in
40  * file_recover.
41  */
42 
43 struct file_data {
44 	char *name;
45 	krb5_deltat lifespan;
46 	int hsize;
47 	int numhits;
48 	int nummisses;
49 	struct authlist **h;
50 	struct authlist *a;
51 	krb5_rc_iostuff d;
52 	char recovering;
53 };
54 
55 extern const krb5_rc_ops krb5_rc_file_ops;
56 
57 krb5_error_code KRB5_CALLCONV krb5_rc_file_init
58     	(krb5_context,
59 		   krb5_rcache,
60 		   krb5_deltat);
61 krb5_error_code KRB5_CALLCONV krb5_rc_file_recover
62 	(krb5_context,
63 		   krb5_rcache);
64 krb5_error_code KRB5_CALLCONV krb5_rc_file_recover_or_init
65     	(krb5_context,
66 		   krb5_rcache,
67 		   krb5_deltat);
68 krb5_error_code KRB5_CALLCONV krb5_rc_file_destroy
69 	(krb5_context,
70 		   krb5_rcache);
71 krb5_error_code KRB5_CALLCONV krb5_rc_file_close
72 	(krb5_context,
73 		   krb5_rcache);
74 krb5_error_code KRB5_CALLCONV krb5_rc_file_store
75 	(krb5_context,
76 		   krb5_rcache,
77 		   krb5_donot_replay *);
78 krb5_error_code KRB5_CALLCONV krb5_rc_file_expunge
79 	(krb5_context,
80 		   krb5_rcache);
81 krb5_error_code KRB5_CALLCONV krb5_rc_file_get_span
82 	(krb5_context,
83 		   krb5_rcache,
84 		   krb5_deltat *);
85 char * KRB5_CALLCONV krb5_rc_file_get_name
86 	(krb5_context,
87 		   krb5_rcache);
88 krb5_error_code KRB5_CALLCONV krb5_rc_file_resolve
89 	(krb5_context,
90 		   krb5_rcache,
91 		   char *);
92 krb5_error_code krb5_rc_file_close_no_free
93 	(krb5_context,
94 		   krb5_rcache);
95 void krb5_rc_free_entry
96 	(krb5_context,
97 		   krb5_donot_replay **);
98 #endif
99 
100