2 * include/krb5/rcache.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. M.I.T. makes no representations about the suitability of
20 * this software for any purpose. It is provided "as is" without express
21 * or implied warranty.
24 * Replay detection cache definitions.
31 typedef struct krb5_rc_st {
33 struct _krb5_rc_ops *ops;
37 typedef struct _krb5_donot_replay {
39 char *server; /* null-terminated */
40 char *client; /* null-terminated */
45 typedef struct _krb5_rc_ops {
48 krb5_error_code (INTERFACE *init)NPROTOTYPE((krb5_context, krb5_rcache,krb5_deltat)); /* create */
49 krb5_error_code (INTERFACE *recover)NPROTOTYPE((krb5_context, krb5_rcache)); /* open */
50 krb5_error_code (INTERFACE *destroy)NPROTOTYPE((krb5_context, krb5_rcache));
51 krb5_error_code (INTERFACE *close)NPROTOTYPE((krb5_context, krb5_rcache));
52 krb5_error_code (INTERFACE *store)NPROTOTYPE((krb5_context, krb5_rcache,krb5_donot_replay *));
53 krb5_error_code (INTERFACE *expunge)NPROTOTYPE((krb5_context, krb5_rcache));
54 krb5_error_code (INTERFACE *get_span)NPROTOTYPE((krb5_context, krb5_rcache,krb5_deltat *));
55 char *(INTERFACE *get_name)NPROTOTYPE((krb5_context, krb5_rcache));
56 krb5_error_code (INTERFACE *resolve)NPROTOTYPE((krb5_context, krb5_rcache, char *));
59 krb5_error_code INTERFACE krb5_rc_default
60 PROTOTYPE((krb5_context,
62 krb5_error_code INTERFACE krb5_rc_register_type
63 PROTOTYPE((krb5_context,
65 krb5_error_code INTERFACE krb5_rc_resolve_type
66 PROTOTYPE((krb5_context,
67 krb5_rcache *,char *));
68 krb5_error_code INTERFACE krb5_rc_resolve_full
69 PROTOTYPE((krb5_context,
70 krb5_rcache *,char *));
71 char * INTERFACE krb5_rc_get_type
72 PROTOTYPE((krb5_context,
74 char * INTERFACE krb5_rc_default_type
75 PROTOTYPE((krb5_context));
76 char * INTERFACE krb5_rc_default_name
77 PROTOTYPE((krb5_context));
78 krb5_error_code INTERFACE krb5_auth_to_rep
79 PROTOTYPE((krb5_context,
81 krb5_donot_replay *));
83 #define krb5_rc_initialize(context, id, span) (*(id)->ops->init)(context, id, span)
84 #define krb5_rc_recover(context, id) (*(id)->ops->recover)(context, id)
85 #define krb5_rc_destroy(context, id) (*(id)->ops->destroy)(context, id)
86 #define krb5_rc_close(context, id) (*(id)->ops->close)(context, id)
87 #define krb5_rc_store(context, id, dontreplay) (*(id)->ops->store)(context, id, dontreplay)
88 #define krb5_rc_expunge(context, id) (*(id)->ops->expunge)(context, id)
89 #define krb5_rc_get_lifespan(context, id, spanp) (*(id)->ops->get_span)(context, id, spanp)
90 #define krb5_rc_get_name(context, id) (*(id)->ops->get_name)(context, id)
91 #define krb5_rc_resolve(context, id, name) (*(id)->ops->resolve)(context, id, name)
93 extern krb5_rc_ops krb5_rc_dfl_ops;
95 #endif /* KRB5_RCACHE__ */