1 | /* |
---|
2 | * Copyright 1987, 1988 by the Massachusetts Institute of Technology. |
---|
3 | * |
---|
4 | * For copying and distribution information, please see the file |
---|
5 | * <mit-copyright.h>. |
---|
6 | * |
---|
7 | * spm Project Athena 8/85 |
---|
8 | * |
---|
9 | * This file defines data structures for the kerberos |
---|
10 | * authentication/authorization database. |
---|
11 | * |
---|
12 | * They MUST correspond to those defined in *.rel |
---|
13 | */ |
---|
14 | |
---|
15 | #include "mit-copyright.h" |
---|
16 | |
---|
17 | #ifndef KRB_DB_DEFS |
---|
18 | #define KRB_DB_DEFS |
---|
19 | |
---|
20 | #define KERB_M_NAME "K" /* Kerberos */ |
---|
21 | #define KERB_M_INST "M" /* Master */ |
---|
22 | #define KERB_DEFAULT_NAME "default" |
---|
23 | #define KERB_DEFAULT_INST "" |
---|
24 | #define DBM_FILE "KDBDIR/principal" |
---|
25 | |
---|
26 | /* this also defines the number of queue headers */ |
---|
27 | #define KERB_DB_HASH_MODULO 64 |
---|
28 | |
---|
29 | |
---|
30 | /* Arguments to kerb_dbl_lock() */ |
---|
31 | |
---|
32 | #define KERB_DBL_EXCLUSIVE 1 |
---|
33 | #define KERB_DBL_SHARED 0 |
---|
34 | |
---|
35 | /* arguments to kerb_db_set_lockmode() */ |
---|
36 | |
---|
37 | #define KERB_DBL_BLOCKING 0 |
---|
38 | #define KERB_DBL_NONBLOCKING 1 |
---|
39 | |
---|
40 | /* Principal defines the structure of a principal's name */ |
---|
41 | |
---|
42 | typedef struct { |
---|
43 | char name[ANAME_SZ]; |
---|
44 | char instance[INST_SZ]; |
---|
45 | |
---|
46 | unsigned KRB_INT32 key_low; |
---|
47 | unsigned KRB_INT32 key_high; |
---|
48 | unsigned long exp_date; |
---|
49 | char exp_date_txt[DATE_SZ]; |
---|
50 | unsigned long mod_date; |
---|
51 | char mod_date_txt[DATE_SZ]; |
---|
52 | unsigned short attributes; |
---|
53 | unsigned char max_life; |
---|
54 | unsigned char kdc_key_ver; |
---|
55 | unsigned char key_version; |
---|
56 | |
---|
57 | char mod_name[ANAME_SZ]; |
---|
58 | char mod_instance[INST_SZ]; |
---|
59 | char *old; /* cast to (Principal *); not in db, |
---|
60 | * ptr to old vals */ |
---|
61 | } |
---|
62 | Principal; |
---|
63 | |
---|
64 | typedef struct { |
---|
65 | long cpu; |
---|
66 | long elapsed; |
---|
67 | long dio; |
---|
68 | long pfault; |
---|
69 | long t_stamp; |
---|
70 | long n_retrieve; |
---|
71 | long n_replace; |
---|
72 | long n_append; |
---|
73 | long n_get_stat; |
---|
74 | long n_put_stat; |
---|
75 | } |
---|
76 | DB_stat; |
---|
77 | |
---|
78 | /* Dba defines the structure of a database administrator */ |
---|
79 | |
---|
80 | typedef struct { |
---|
81 | char name[ANAME_SZ]; |
---|
82 | char instance[INST_SZ]; |
---|
83 | unsigned short attributes; |
---|
84 | unsigned long exp_date; |
---|
85 | char exp_date_txt[DATE_SZ]; |
---|
86 | char *old; /* |
---|
87 | * cast to (Dba *); not in db, ptr to |
---|
88 | * old vals |
---|
89 | */ |
---|
90 | } |
---|
91 | Dba; |
---|
92 | |
---|
93 | /* Function declarations */ |
---|
94 | |
---|
95 | extern int kerb_get_principal PROTOTYPE ((char *, char *, Principal *, |
---|
96 | unsigned int, int *)); |
---|
97 | extern int kerb_put_principal PROTOTYPE ((Principal *, unsigned int)); |
---|
98 | extern int kerb_db_get_stat PROTOTYPE ((DB_stat *)); |
---|
99 | extern int kerb_db_put_stat PROTOTYPE ((DB_stat *)); |
---|
100 | extern int kerb_get_dba PROTOTYPE ((char *, char *, Dba *, unsigned int, |
---|
101 | int *)); |
---|
102 | extern int kerb_db_get_dba PROTOTYPE ((char *, char *, Dba *, unsigned int, |
---|
103 | int *)); |
---|
104 | extern long kdb_get_master_key PROTOTYPE ((int, C_Block, Key_schedule, int)); |
---|
105 | extern long kdb_get_master_key_from PROTOTYPE ((int, C_Block, Key_schedule, |
---|
106 | int, char *)); |
---|
107 | /* No prototype for kdb_verify_master_key, since we don't want to |
---|
108 | require that FILE be defined. */ |
---|
109 | extern long kdb_verify_master_key (); |
---|
110 | |
---|
111 | #endif /* KRB_DB_DEFS */ |
---|