xref: /titanic_50/usr/src/cmd/krb5/kadmin/dbutil/kdb5_util.h (revision 22337b4b3c8a2b9db615e524e0e9e1fbd3dc71bf)
1 /*
2  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 #ifndef _KDB5_UTIL_H
7 #define	_KDB5_UTIL_H
8 
9 #pragma ident	"%Z%%M%	%I%	%E% SMI"
10 
11 /*
12  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
13  *
14  *	Openvision retains the copyright to derivative works of
15  *	this source code.  Do *NOT* create a derivative of this
16  *	source code before consulting with your legal department.
17  *	Do *NOT* integrate *ANY* of this source code into another
18  *	product before consulting with your legal department.
19  *
20  *	For further information, read the top-level Openvision
21  *	copyright which is contained in the top-level MIT Kerberos
22  *	copyright.
23  *
24  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
25  *
26  */
27 
28 #ifdef	__cplusplus
29 extern "C" {
30 #endif
31 
32 /*
33  * admin/edit/kdb5_edit.h
34  *
35  * Copyright 1992 by the Massachusetts Institute of Technology.
36  * All Rights Reserved.
37  *
38  * Export of this software from the United States of America may
39  *   require a specific license from the United States Government.
40  *   It is the responsibility of any person or organization contemplating
41  *   export to obtain such a license before exporting.
42  *
43  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
44  * distribute this software and its documentation for any purpose and
45  * without fee is hereby granted, provided that the above copyright
46  * notice appear in all copies and that both that copyright notice and
47  * this permission notice appear in supporting documentation, and that
48  * the name of M.I.T. not be used in advertising or publicity pertaining
49  * to distribution of the software without specific, written prior
50  * permission.  Furthermore if you modify this software you must label
51  * your software as modified software and not distribute it in such a
52  * fashion that it might be confused with the original M.I.T. software.
53  * M.I.T. makes no representations about the suitability of
54  * this software for any purpose.  It is provided "as is" without express
55  * or implied warranty.
56  *
57  */
58 #include <kdb/kdb_log.h>
59 #define MAX_HEADER      1024
60 #define REALM_SEP	'@'
61 #define REALM_SEP_STR	"@"
62 
63 extern char *progname;
64 extern char *Err_no_database;
65 #ifndef V4_DECLARES_STATIC
66 extern krb5_keyblock master_keyblock;
67 extern krb5_principal master_princ;
68 #endif
69 extern krb5_boolean dbactive;
70 extern int exit_status;
71 extern krb5_context util_context;
72 extern kadm5_config_params global_params;
73 extern int valid_master_key;
74 extern krb5_db_entry master_db;
75 extern char **db5util_db_args;
76 extern int    db5util_db_args_size;
77 extern int add_db_arg(char *arg);
78 
79 extern void usage(void);
80 
81 extern void add_key
82 	(char const *, char const *,
83 		   krb5_const_principal, const krb5_keyblock *,
84 		   krb5_kvno, krb5_keysalt *);
85 extern int set_dbname_help
86 	(char *, char *);
87 
88 extern char *kdb5_util_Init (int, char **);
89 
90 extern int quit (void);
91 
92 extern int check_for_match
93 	(char *, int, krb5_db_entry *, int, int);
94 
95 extern void parse_token
96 	(char *, int *, int *, char *);
97 
98 extern int create_db_entry (krb5_principal, krb5_db_entry *);
99 
100 extern int kadm5_create_magic_princs (kadm5_config_params *params,
101 						krb5_context context);
102 
103 extern int process_ov_principal (char *fname, krb5_context kcontext,
104 					   FILE *filep, int verbose,
105 					   int *linenop);
106 
107 extern void load_db (int argc, char **argv);
108 extern void dump_db (int argc, char **argv);
109 extern void kdb5_create (int argc, char **argv);
110 extern void kdb5_destroy (int argc, char **argv);
111 extern void kdb5_stash (int argc, char **argv);
112 
113 extern void update_ok_file (char *file_name);
114 
115 extern int kadm5_create (kadm5_config_params *params);
116 
117 void usage (void);
118 
119 #ifdef	__cplusplus
120 }
121 #endif
122 
123 #endif	/* !_KDB5_UTIL_H */
124