update to reality with new interface
authorJohn Kohl <jtkohl@mit.edu>
Wed, 17 Jan 1990 17:29:09 +0000 (17:29 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Wed, 17 Jan 1990 17:29:09 +0000 (17:29 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@110 dc483132-0cff-0310-8789-dd5450dbe970

src/include/krb5/ccache.h

index 63f5a44fe46210e2967c600553c1903415eb4612..a7661b4a305c6a47fd3c73c787a409c7ba386d9a 100644 (file)
@@ -8,21 +8,41 @@
  * For copying and distribution information, please see the file
  * <krb5/mit-copyright.h>.
  *
- * Ticket cache definitions.
+ * Credentials cache definitions.
  */
 
 #include <krb5/copyright.h>
 
-#ifndef __KRB5_TCACHE__
-#define __KRB5_TCACHE__
+#ifndef __KRB5_CCACHE__
+#define __KRB5_CCACHE__
 
-typedef char * krb5_tcache_name;       /* a name of a ticket cache */
-typedef        int     krb5_tcache_id;         /* a short "identifier" for quick
-                                          cache access */
-typedef        int     krb5_tcache_magic;      /* cookie for sequential lookup */
+typedef        krb5_pointer    krb5_cc_cursor; /* cursor for sequential lookup */
 
-#define        KRB5_TC_READ    0               /* open cache for read only */
-#define        KRB5_TC_RDWR    1               /* open cache for read/write */
+typedef struct _krb5_ccache {
+       struct krb5_cc_ops *ops;
+       void *data;
+} *krb5_ccache;
+
+typedef struct _krb5_cc_ops {
+       char *prefix;
+       krb5_ccache (*resolve) PROTOTYPE((char *residual));
+       krb5_ccache (*gen_new) PROTOTYPE((void));
+       char *(*get_name) PROTOTYPE((krb5_ccache));
+       int (*init) PROTOTYPE((krb5_ccache, krb5_principal));
+       int (*destroy) PROTOTYPE((krb5_ccache));
+       int (*close) PROTOTYPE((krb5_ccache));
+       int (*store) PROTOTYPE((krb5_ccache, krb5_credentials *));
+       int (*retrieve) PROTOTYPE((krb5_ccache, krb5_flags,
+                                  krb5_credentials *, krb5_credentials *));
+       int (*get_princ) PROTOTYPE((krb5_ccache, krb5_principal *));
+       int (*get_first) PROTOTYPE((krb5_ccache, krb5_cc_cursor *));
+       int (*get_next) PROTOTYPE((krb5_ccache, krb5_cc_cursor *,
+                                  krb5_credentials *));
+       int (*end_get) PROTOTYPE((krb5_ccache, krb5_cc_cursor *));
+       int (*remove_cred) PROTOTYPE((krb5_ccache, krb5_flags,
+                                     krb5_credentials *));
+       int (*set_flags) PROTOTYPE((krb5_ccache, krb5_cflags));
+} krb5_cc_ops;
 
 /* for retrieve_cred */
 #define        KRB5_TC_MATCH_TIMES             0x00000001
@@ -31,4 +51,4 @@ typedef       int     krb5_tcache_magic;      /* cookie for sequential lookup */
 #define        KRB5_TC_MATCH_TIMES_EXACT       0x00000008
 #define        KRB5_TC_MATCH_FLAGS_EXACT       0x00000010
 
-#endif /* __KRB5_TCACHE__ */
+#endif /* __KRB5_CCACHE__ */