17c478bd9Sstevel@tonic-gate /*
254925bf6Swillf  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
37c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
47c478bd9Sstevel@tonic-gate  */
57c478bd9Sstevel@tonic-gate 
67c478bd9Sstevel@tonic-gate #ifndef _KDB5_UTIL_H
77c478bd9Sstevel@tonic-gate #define	_KDB5_UTIL_H
87c478bd9Sstevel@tonic-gate 
97c478bd9Sstevel@tonic-gate /*
107c478bd9Sstevel@tonic-gate  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
117c478bd9Sstevel@tonic-gate  *
127c478bd9Sstevel@tonic-gate  *	Openvision retains the copyright to derivative works of
137c478bd9Sstevel@tonic-gate  *	this source code.  Do *NOT* create a derivative of this
147c478bd9Sstevel@tonic-gate  *	source code before consulting with your legal department.
157c478bd9Sstevel@tonic-gate  *	Do *NOT* integrate *ANY* of this source code into another
167c478bd9Sstevel@tonic-gate  *	product before consulting with your legal department.
177c478bd9Sstevel@tonic-gate  *
187c478bd9Sstevel@tonic-gate  *	For further information, read the top-level Openvision
197c478bd9Sstevel@tonic-gate  *	copyright which is contained in the top-level MIT Kerberos
207c478bd9Sstevel@tonic-gate  *	copyright.
217c478bd9Sstevel@tonic-gate  *
227c478bd9Sstevel@tonic-gate  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
237c478bd9Sstevel@tonic-gate  *
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
277c478bd9Sstevel@tonic-gate extern "C" {
287c478bd9Sstevel@tonic-gate #endif
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate /*
317c478bd9Sstevel@tonic-gate  * admin/edit/kdb5_edit.h
327c478bd9Sstevel@tonic-gate  *
337c478bd9Sstevel@tonic-gate  * Copyright 1992 by the Massachusetts Institute of Technology.
347c478bd9Sstevel@tonic-gate  * All Rights Reserved.
357c478bd9Sstevel@tonic-gate  *
367c478bd9Sstevel@tonic-gate  * Export of this software from the United States of America may
377c478bd9Sstevel@tonic-gate  *   require a specific license from the United States Government.
387c478bd9Sstevel@tonic-gate  *   It is the responsibility of any person or organization contemplating
397c478bd9Sstevel@tonic-gate  *   export to obtain such a license before exporting.
40*2a8bcb4eSToomas Soome  *
417c478bd9Sstevel@tonic-gate  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
427c478bd9Sstevel@tonic-gate  * distribute this software and its documentation for any purpose and
437c478bd9Sstevel@tonic-gate  * without fee is hereby granted, provided that the above copyright
447c478bd9Sstevel@tonic-gate  * notice appear in all copies and that both that copyright notice and
457c478bd9Sstevel@tonic-gate  * this permission notice appear in supporting documentation, and that
467c478bd9Sstevel@tonic-gate  * the name of M.I.T. not be used in advertising or publicity pertaining
477c478bd9Sstevel@tonic-gate  * to distribution of the software without specific, written prior
4856a424ccSmp  * permission.  Furthermore if you modify this software you must label
4956a424ccSmp  * your software as modified software and not distribute it in such a
5056a424ccSmp  * fashion that it might be confused with the original M.I.T. software.
5156a424ccSmp  * M.I.T. makes no representations about the suitability of
527c478bd9Sstevel@tonic-gate  * this software for any purpose.  It is provided "as is" without express
537c478bd9Sstevel@tonic-gate  * or implied warranty.
54*2a8bcb4eSToomas Soome  *
557c478bd9Sstevel@tonic-gate  */
567c478bd9Sstevel@tonic-gate #include <kdb/kdb_log.h>
5756a424ccSmp #define MAX_HEADER      1024
5856a424ccSmp #define REALM_SEP	'@'
5956a424ccSmp #define REALM_SEP_STR	"@"
607c478bd9Sstevel@tonic-gate 
617c478bd9Sstevel@tonic-gate extern char *progname;
627c478bd9Sstevel@tonic-gate extern char *Err_no_database;
6354925bf6Swillf #ifndef V4_DECLARES_STATIC
6454925bf6Swillf extern krb5_keyblock master_keyblock;
6554925bf6Swillf extern krb5_principal master_princ;
6654925bf6Swillf #endif
6756a424ccSmp extern krb5_boolean dbactive;
6856a424ccSmp extern int exit_status;
6956a424ccSmp extern krb5_context util_context;
7056a424ccSmp extern kadm5_config_params global_params;
7156a424ccSmp extern int valid_master_key;
7256a424ccSmp extern krb5_db_entry master_db;
7354925bf6Swillf extern char **db5util_db_args;
7454925bf6Swillf extern int    db5util_db_args_size;
7554925bf6Swillf extern int add_db_arg(char *arg);
7656a424ccSmp 
7756a424ccSmp extern void usage(void);
7856a424ccSmp 
79*2a8bcb4eSToomas Soome extern void add_key
80*2a8bcb4eSToomas Soome 	(char const *, char const *,
81*2a8bcb4eSToomas Soome 		   krb5_const_principal, const krb5_keyblock *,
8256a424ccSmp 		   krb5_kvno, krb5_keysalt *);
8356a424ccSmp extern int set_dbname_help
8456a424ccSmp 	(char *, char *);
8556a424ccSmp 
8656a424ccSmp extern char *kdb5_util_Init (int, char **);
8756a424ccSmp 
8856a424ccSmp extern int quit (void);
8956a424ccSmp 
9056a424ccSmp extern int check_for_match
9156a424ccSmp 	(char *, int, krb5_db_entry *, int, int);
9256a424ccSmp 
9356a424ccSmp extern void parse_token
9456a424ccSmp 	(char *, int *, int *, char *);
9556a424ccSmp 
9656a424ccSmp extern int create_db_entry (krb5_principal, krb5_db_entry *);
977c478bd9Sstevel@tonic-gate 
9856a424ccSmp extern int kadm5_create_magic_princs (kadm5_config_params *params,
9956a424ccSmp 						krb5_context context);
1007c478bd9Sstevel@tonic-gate 
101*2a8bcb4eSToomas Soome extern int process_ov_principal (char *fname, krb5_context kcontext,
102*2a8bcb4eSToomas Soome 					   FILE *filep, int verbose,
10354925bf6Swillf 					   int *linenop);
1047c478bd9Sstevel@tonic-gate 
10556a424ccSmp extern void load_db (int argc, char **argv);
10656a424ccSmp extern void dump_db (int argc, char **argv);
10756a424ccSmp extern void kdb5_create (int argc, char **argv);
10856a424ccSmp extern void kdb5_destroy (int argc, char **argv);
10956a424ccSmp extern void kdb5_stash (int argc, char **argv);
1107c478bd9Sstevel@tonic-gate 
11156a424ccSmp extern void update_ok_file (char *file_name);
1127c478bd9Sstevel@tonic-gate 
11356a424ccSmp extern int kadm5_create (kadm5_config_params *params);
1147c478bd9Sstevel@tonic-gate 
11556a424ccSmp void usage (void);
1167c478bd9Sstevel@tonic-gate 
1177c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1187c478bd9Sstevel@tonic-gate }
1197c478bd9Sstevel@tonic-gate #endif
1207c478bd9Sstevel@tonic-gate 
1217c478bd9Sstevel@tonic-gate #endif	/* !_KDB5_UTIL_H */
122