17c478bd9Sstevel@tonic-gate /*
2*159d09a2SMark Phalan  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
37c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
47c478bd9Sstevel@tonic-gate  */
57c478bd9Sstevel@tonic-gate /*
67c478bd9Sstevel@tonic-gate  * lib/krb5/rcache/rc_file.h
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * This file of the Kerberos V5 software is derived from public-domain code
97c478bd9Sstevel@tonic-gate  * contributed by Daniel J. Bernstein, <brnstnd@acf10.nyu.edu>.
10*159d09a2SMark Phalan  *
117c478bd9Sstevel@tonic-gate  */
127c478bd9Sstevel@tonic-gate 
137c478bd9Sstevel@tonic-gate /*
147c478bd9Sstevel@tonic-gate  * Declarations for the file replay cache implementation.
157c478bd9Sstevel@tonic-gate  */
167c478bd9Sstevel@tonic-gate 
177c478bd9Sstevel@tonic-gate #ifndef _KRB5_RC_FILE_H
187c478bd9Sstevel@tonic-gate #define	_KRB5_RC_FILE_H
197c478bd9Sstevel@tonic-gate 
207c478bd9Sstevel@tonic-gate 
21*159d09a2SMark Phalan /* Solaris Kerberos */
227c478bd9Sstevel@tonic-gate 
237c478bd9Sstevel@tonic-gate #include "rc_common.h"
247c478bd9Sstevel@tonic-gate #include "rc_io.h"
25505d05c7Sgtb #include "rc-int.h"
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef EXCESSREPS
287c478bd9Sstevel@tonic-gate #define	EXCESSREPS 30
297c478bd9Sstevel@tonic-gate #endif
307c478bd9Sstevel@tonic-gate /*
317c478bd9Sstevel@tonic-gate  * The rcache will be automatically expunged when the number of expired
327c478bd9Sstevel@tonic-gate  * krb5_donot_replays encountered incidentally in searching exceeds the number
337c478bd9Sstevel@tonic-gate  * of live krb5_donot_replays by EXCESSREPS. With the defaults here, a typical
347c478bd9Sstevel@tonic-gate  * cache might build up some 10K of expired krb5_donot_replays before an
357c478bd9Sstevel@tonic-gate  * automatic expunge, with the waste basically independent of the number of
367c478bd9Sstevel@tonic-gate  * stores per minute.
377c478bd9Sstevel@tonic-gate 
387c478bd9Sstevel@tonic-gate  * The rcache will also automatically be expunged when it encounters more
397c478bd9Sstevel@tonic-gate  * than EXCESSREPS expired entries when recovering a cache in
407c478bd9Sstevel@tonic-gate  * file_recover.
417c478bd9Sstevel@tonic-gate  */
427c478bd9Sstevel@tonic-gate 
437c478bd9Sstevel@tonic-gate struct file_data {
447c478bd9Sstevel@tonic-gate 	char *name;
457c478bd9Sstevel@tonic-gate 	krb5_deltat lifespan;
467c478bd9Sstevel@tonic-gate 	int hsize;
477c478bd9Sstevel@tonic-gate 	int numhits;
487c478bd9Sstevel@tonic-gate 	int nummisses;
497c478bd9Sstevel@tonic-gate 	struct authlist **h;
507c478bd9Sstevel@tonic-gate 	struct authlist *a;
517c478bd9Sstevel@tonic-gate 	krb5_rc_iostuff d;
527c478bd9Sstevel@tonic-gate 	char recovering;
537c478bd9Sstevel@tonic-gate };
547c478bd9Sstevel@tonic-gate 
55*159d09a2SMark Phalan extern const krb5_rc_ops krb5_rc_file_ops;
567c478bd9Sstevel@tonic-gate 
577c478bd9Sstevel@tonic-gate krb5_error_code KRB5_CALLCONV krb5_rc_file_init
58505d05c7Sgtb     	(krb5_context,
597c478bd9Sstevel@tonic-gate 		   krb5_rcache,
60505d05c7Sgtb 		   krb5_deltat);
617c478bd9Sstevel@tonic-gate krb5_error_code KRB5_CALLCONV krb5_rc_file_recover
62505d05c7Sgtb 	(krb5_context,
63505d05c7Sgtb 		   krb5_rcache);
64505d05c7Sgtb krb5_error_code KRB5_CALLCONV krb5_rc_file_recover_or_init
65505d05c7Sgtb     	(krb5_context,
66505d05c7Sgtb 		   krb5_rcache,
67505d05c7Sgtb 		   krb5_deltat);
687c478bd9Sstevel@tonic-gate krb5_error_code KRB5_CALLCONV krb5_rc_file_destroy
69505d05c7Sgtb 	(krb5_context,
70505d05c7Sgtb 		   krb5_rcache);
717c478bd9Sstevel@tonic-gate krb5_error_code KRB5_CALLCONV krb5_rc_file_close
72505d05c7Sgtb 	(krb5_context,
73505d05c7Sgtb 		   krb5_rcache);
747c478bd9Sstevel@tonic-gate krb5_error_code KRB5_CALLCONV krb5_rc_file_store
75505d05c7Sgtb 	(krb5_context,
767c478bd9Sstevel@tonic-gate 		   krb5_rcache,
77505d05c7Sgtb 		   krb5_donot_replay *);
787c478bd9Sstevel@tonic-gate krb5_error_code KRB5_CALLCONV krb5_rc_file_expunge
79505d05c7Sgtb 	(krb5_context,
80505d05c7Sgtb 		   krb5_rcache);
817c478bd9Sstevel@tonic-gate krb5_error_code KRB5_CALLCONV krb5_rc_file_get_span
82505d05c7Sgtb 	(krb5_context,
837c478bd9Sstevel@tonic-gate 		   krb5_rcache,
84505d05c7Sgtb 		   krb5_deltat *);
857c478bd9Sstevel@tonic-gate char * KRB5_CALLCONV krb5_rc_file_get_name
86505d05c7Sgtb 	(krb5_context,
87505d05c7Sgtb 		   krb5_rcache);
887c478bd9Sstevel@tonic-gate krb5_error_code KRB5_CALLCONV krb5_rc_file_resolve
89505d05c7Sgtb 	(krb5_context,
907c478bd9Sstevel@tonic-gate 		   krb5_rcache,
91505d05c7Sgtb 		   char *);
927c478bd9Sstevel@tonic-gate krb5_error_code krb5_rc_file_close_no_free
93505d05c7Sgtb 	(krb5_context,
94505d05c7Sgtb 		   krb5_rcache);
957c478bd9Sstevel@tonic-gate void krb5_rc_free_entry
96505d05c7Sgtb 	(krb5_context,
97505d05c7Sgtb 		   krb5_donot_replay **);
987c478bd9Sstevel@tonic-gate #endif
997c478bd9Sstevel@tonic-gate 
100