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