Windows global stuff:
[krb5.git] / src / lib / krb5 / keytab / file / ktfile.h
1 /*
2  * lib/krb5/keytab/file/ktfile.h
3  *
4  * Copyright 1990 by the Massachusetts Institute of Technology.
5  * All Rights Reserved.
6  *
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.
11  * 
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.
22  * 
23  *
24  * This header file contains information needed by internal routines
25  * of the file-based ticket cache implementation.
26  */
27
28
29 #ifndef KRB5_KTFILE__
30 #define KRB5_KTFILE__
31
32 #include <stdio.h>
33
34 /*
35  * Constants
36  */
37 #define IGNORE_VNO 0
38
39 #define KRB5_KT_VNO_1   0x0501  /* krb v5, keytab version 1 (DCE compat) */
40 #define KRB5_KT_VNO     0x0502  /* krb v5, keytab version 2 (standard)  */
41
42 #define KRB5_KT_DEFAULT_VNO KRB5_KT_VNO
43
44 /* 
45  * Types
46  */
47 typedef struct _krb5_ktfile_data {
48     char *name;                 /* Name of the file */
49     FILE *openf;                /* open file, if any. */
50     int version;                /* Version number of keytab */
51 } krb5_ktfile_data;
52
53 /*
54  * Macros
55  */
56 #define KTPRIVATE(id) ((krb5_ktfile_data *)(id)->data)
57 #define KTFILENAME(id) (((krb5_ktfile_data *)(id)->data)->name)
58 #define KTFILEP(id) (((krb5_ktfile_data *)(id)->data)->openf)
59 #define KTVERSION(id) (((krb5_ktfile_data *)(id)->data)->version)
60
61 extern struct _krb5_kt_ops krb5_ktf_ops;
62 extern struct _krb5_kt_ops krb5_ktf_writable_ops;
63
64 krb5_error_code krb5_ktfile_resolve 
65         PROTOTYPE((krb5_context,
66                    const char *,
67                    krb5_keytab *));
68
69 krb5_error_code krb5_ktfile_wresolve 
70         PROTOTYPE((krb5_context,
71                    const char *,
72                    krb5_keytab *));
73
74 krb5_error_code krb5_ktfile_get_name 
75         PROTOTYPE((krb5_context,
76                    krb5_keytab,
77                    char *,
78                    int));
79
80 krb5_error_code krb5_ktfile_close 
81         PROTOTYPE((krb5_context,
82                    krb5_keytab));
83
84 krb5_error_code krb5_ktfile_get_entry 
85         PROTOTYPE((krb5_context,
86                    krb5_keytab,
87                    krb5_principal,
88                    krb5_kvno,
89                    krb5_keytype,
90                    krb5_keytab_entry *));
91
92 krb5_error_code krb5_ktfile_start_seq_get 
93         PROTOTYPE((krb5_context,
94                    krb5_keytab,
95                    krb5_kt_cursor *));
96
97 krb5_error_code krb5_ktfile_get_next 
98         PROTOTYPE((krb5_context,
99                    krb5_keytab,
100                    krb5_keytab_entry *,
101                    krb5_kt_cursor *));
102
103 krb5_error_code krb5_ktfile_end_get 
104         PROTOTYPE((krb5_context,
105                    krb5_keytab,
106                    krb5_kt_cursor *));
107
108 /* routines to be included on extended version (write routines) */
109 krb5_error_code krb5_ktfile_add 
110         PROTOTYPE((krb5_context,
111                    krb5_keytab,
112                    krb5_keytab_entry *));
113
114 krb5_error_code krb5_ktfile_remove 
115         PROTOTYPE((krb5_context,
116                    krb5_keytab,
117                    krb5_keytab_entry *));
118
119 krb5_error_code krb5_ktfileint_openr 
120         PROTOTYPE((krb5_context,
121                    krb5_keytab));
122
123 krb5_error_code krb5_ktfileint_openw 
124         PROTOTYPE((krb5_context,
125                    krb5_keytab));
126
127 krb5_error_code krb5_ktfileint_close 
128         PROTOTYPE((krb5_context,
129                    krb5_keytab));
130
131 krb5_error_code krb5_ktfileint_read_entry 
132         PROTOTYPE((krb5_context,
133                    krb5_keytab,
134                    krb5_keytab_entry *));
135
136 krb5_error_code krb5_ktfileint_write_entry 
137         PROTOTYPE((krb5_context,
138                    krb5_keytab,
139                    krb5_keytab_entry *));
140
141 krb5_error_code krb5_ktfileint_delete_entry 
142         PROTOTYPE((krb5_context,
143                    krb5_keytab,
144                    krb5_int32));
145
146 krb5_error_code krb5_ktfileint_internal_read_entry 
147         PROTOTYPE((krb5_context,
148                    krb5_keytab,
149                    krb5_keytab_entry *,
150                    krb5_int32 *));
151
152 krb5_error_code krb5_ktfileint_size_entry 
153         PROTOTYPE((krb5_context,
154                    krb5_keytab_entry *,
155                    krb5_int32 *));
156
157 krb5_error_code krb5_ktfileint_find_slot 
158         PROTOTYPE((krb5_context,
159                    krb5_keytab,
160                    krb5_int32 *,
161                    krb5_int32 *));
162
163
164 #endif /* KRB5_KTFILE__ */