xref: /illumos-gate/usr/src/lib/gss_mechs/mech_krb5/include/krb5/kdb_dbc.h (revision 03100a6332bd4edc7a53091fcf7c9a7131bcdaa7)
1 /*
2  * Copyright (c) 1999 by Sun Microsystems, Inc.
3  * All rights reserved.
4  */
5 #pragma ident	"%Z%%M%	%I%	%E% SMI"
6 
7 /*
8  * lib/gss_mechs/mech_krb5/include/krb5/kdb_dbc.h
9  * Copyright 1995 by the Massachusetts Institute of Technology.
10  * All Rights Reserved.
11  *
12  * Export of this software from the United States of America may
13  *   require a specific license from the United States Government.
14  *   It is the responsibility of any person or organization contemplating
15  *   export to obtain such a license before exporting.
16  *
17  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
18  * distribute this software and its documentation for any purpose and
19  * without fee is hereby granted, provided that the above copyright
20  * notice appear in all copies and that both that copyright notice and
21  * this permission notice appear in supporting documentation, and that
22  * the name of M.I.T. not be used in advertising or publicity pertaining
23  * to distribution of the software without specific, written prior
24  * permission.  M.I.T. makes no representations about the suitability of
25  * this software for any purpose.  It is provided "as is" without express
26  * or implied warranty.
27  *
28  *
29  * KDC Database context definitions.
30  */
31 
32 
33 #ifndef KRB5_KDB5_DBC__
34 #define KRB5_KDB5_DBC__
35 
36 #if !defined(_MACINTOSH) && !defined(_MSDOS)
37 
38 #include "kdb.h"
39 
40 /* Per-database context. */
41 typedef struct __krb5_db_context {
42     krb5_boolean        db_inited;      /* Context initialized          */
43     char *              db_name;        /* Name of database             */
44     DBM *               db_dbm_ctx;     /* DBM context for database     */
45     char *              db_lf_name;     /* Name of lock file            */
46     int                 db_lf_file;     /* File descriptor of lock file */
47     time_t              db_lf_time;     /* Time last updated            */
48     int                 db_locks_held;  /* Number of times locked       */
49     int                 db_lock_mode;   /* Last lock mode, e.g. greatest*/
50     krb5_boolean        db_nb_locks;    /* [Non]Blocking lock modes     */
51     krb5_encrypt_block *db_master_key;  /* Master key of database       */
52     kdb5_dispatch_table *db_dispatch;   /* Dispatch table               */
53 } krb5_db_context;
54 
55 krb5_error_code krb5_ktkdb_resolve
56         KRB5_PROTOTYPE((krb5_context, krb5_db_context *, krb5_keytab *));
57 
58 krb5_error_code krb5_dbm_db_set_mkey
59         KRB5_PROTOTYPE((krb5_context,krb5_db_context *,krb5_encrypt_block *));
60 
61 krb5_error_code krb5_dbm_db_get_mkey
62         KRB5_PROTOTYPE((krb5_context,krb5_encrypt_block **));
63 
64 #endif /* !defined(_MACINTOSH) && !defined(_MSDOS) */
65 #endif /* KRB5_KDB5_DBM__ */
66