xref: /onnv-gate/usr/src/lib/krb5/kadm5/clnt/client_internal.h (revision 7934:6aeeafc994de)
10Sstevel@tonic-gate /*
2*7934SMark.Phalan@Sun.COM  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
30Sstevel@tonic-gate  * Use is subject to license terms.
40Sstevel@tonic-gate  */
50Sstevel@tonic-gate 
60Sstevel@tonic-gate #ifndef	__KADM5_CLIENT_INTERNAL_H__
70Sstevel@tonic-gate #define	__KADM5_CLIENT_INTERNAL_H__
80Sstevel@tonic-gate 
90Sstevel@tonic-gate 
100Sstevel@tonic-gate /*
110Sstevel@tonic-gate  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  *	Openvision retains the copyright to derivative works of
140Sstevel@tonic-gate  *	this source code.  Do *NOT* create a derivative of this
150Sstevel@tonic-gate  *	source code before consulting with your legal department.
160Sstevel@tonic-gate  *	Do *NOT* integrate *ANY* of this source code into another
170Sstevel@tonic-gate  *	product before consulting with your legal department.
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  *	For further information, read the top-level Openvision
200Sstevel@tonic-gate  *	copyright which is contained in the top-level MIT Kerberos
210Sstevel@tonic-gate  *	copyright.
220Sstevel@tonic-gate  *
230Sstevel@tonic-gate  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
240Sstevel@tonic-gate  *
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate 
280Sstevel@tonic-gate /*
290Sstevel@tonic-gate  * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved
300Sstevel@tonic-gate  *
31*7934SMark.Phalan@Sun.COM  * $Header$
322881Smp153739  *
33*7934SMark.Phalan@Sun.COM  * $Log$
340Sstevel@tonic-gate  * Revision 1.1  1996/07/24 22:22:43  tlyu
350Sstevel@tonic-gate  * 	* Makefile.in, configure.in: break out client lib into a
360Sstevel@tonic-gate  * 		subdirectory
370Sstevel@tonic-gate  *
380Sstevel@tonic-gate  * Revision 1.11  1996/07/22 20:35:46  marc
390Sstevel@tonic-gate  * this commit includes all the changes on the OV_9510_INTEGRATION and
400Sstevel@tonic-gate  * OV_MERGE branches.  This includes, but is not limited to, the new openvision
410Sstevel@tonic-gate  * admin system, and major changes to gssapi to add functionality, and bring
420Sstevel@tonic-gate  * the implementation in line with rfc1964.  before committing, the
430Sstevel@tonic-gate  * code was built and tested for netbsd and solaris.
440Sstevel@tonic-gate  *
450Sstevel@tonic-gate  * Revision 1.10.4.1  1996/07/18 03:08:37  marc
460Sstevel@tonic-gate  * merged in changes from OV_9510_BP to OV_9510_FINAL1
470Sstevel@tonic-gate  *
480Sstevel@tonic-gate  * Revision 1.10.2.1  1996/06/20  02:16:46  marc
490Sstevel@tonic-gate  * File added to the repository on a branch
500Sstevel@tonic-gate  *
510Sstevel@tonic-gate  * Revision 1.10  1996/06/06  20:09:16  bjaspan
520Sstevel@tonic-gate  * add destroy_cache, for kadm5_init_with_creds
530Sstevel@tonic-gate  *
540Sstevel@tonic-gate  * Revision 1.9  1996/05/30 21:04:42  bjaspan
550Sstevel@tonic-gate  * add lhandle to handle
560Sstevel@tonic-gate  *
570Sstevel@tonic-gate  * Revision 1.8  1996/05/28 20:33:49  bjaspan
580Sstevel@tonic-gate  * rework kadm5_config
590Sstevel@tonic-gate  *
600Sstevel@tonic-gate  * Revision 1.7  1996/05/17 21:36:59  bjaspan
610Sstevel@tonic-gate  * rename to kadm5, begin implementing version 2
620Sstevel@tonic-gate  *
630Sstevel@tonic-gate  * Revision 1.6  1996/05/16 21:45:07  bjaspan
640Sstevel@tonic-gate  * add context
650Sstevel@tonic-gate  *
660Sstevel@tonic-gate  * Revision 1.5  1996/05/08 21:10:23  bjaspan
670Sstevel@tonic-gate  * marc's changes
680Sstevel@tonic-gate  *
690Sstevel@tonic-gate  * Revision 1.4  1996/01/16  20:54:30  grier
700Sstevel@tonic-gate  * secure/3570 use krb5_ui_4 not unsigned int
710Sstevel@tonic-gate  *
720Sstevel@tonic-gate  * Revision 1.3  1995/11/14  17:48:57  grier
730Sstevel@tonic-gate  * long to int
740Sstevel@tonic-gate  *
750Sstevel@tonic-gate  * Revision 1.2  1994/08/16  18:53:47  jik
760Sstevel@tonic-gate  * Versioning stuff.
770Sstevel@tonic-gate  *
780Sstevel@tonic-gate  * Revision 1.1  1994/08/09  21:14:38  jik
790Sstevel@tonic-gate  * Initial revision
800Sstevel@tonic-gate  *
810Sstevel@tonic-gate  */
820Sstevel@tonic-gate 
830Sstevel@tonic-gate /*
840Sstevel@tonic-gate  * This header file is used internally by the Admin API client
850Sstevel@tonic-gate  * libraries.  IF YOU THINK YOU NEED TO USE THIS FILE FOR ANYTHING,
860Sstevel@tonic-gate  * YOU'RE ALMOST CERTAINLY WRONG.
870Sstevel@tonic-gate  */
880Sstevel@tonic-gate 
890Sstevel@tonic-gate #ifdef __cplusplus
900Sstevel@tonic-gate extern "C" {
910Sstevel@tonic-gate #endif
920Sstevel@tonic-gate 
93*7934SMark.Phalan@Sun.COM 
940Sstevel@tonic-gate #include "admin_internal.h"
950Sstevel@tonic-gate 
960Sstevel@tonic-gate typedef struct _kadm5_server_handle_t {
970Sstevel@tonic-gate 	krb5_ui_4	magic_number;
980Sstevel@tonic-gate 	krb5_ui_4	struct_version;
990Sstevel@tonic-gate 	krb5_ui_4	api_version;
1002881Smp153739 	char *		cache_name;
1010Sstevel@tonic-gate 	int		destroy_cache;
1022881Smp153739 	CLIENT *	clnt;
1030Sstevel@tonic-gate 	krb5_context	context;
104*7934SMark.Phalan@Sun.COM 	/* Solaris Kerberos */
1050Sstevel@tonic-gate 	gss_cred_id_t	my_cred;
1060Sstevel@tonic-gate 	kadm5_config_params params;
1070Sstevel@tonic-gate 	struct _kadm5_server_handle_t *lhandle;
1080Sstevel@tonic-gate } kadm5_server_handle_rec, *kadm5_server_handle_t;
1090Sstevel@tonic-gate 
1102881Smp153739 #define CLIENT_CHECK_HANDLE(handle) \
1110Sstevel@tonic-gate { \
1122881Smp153739 	kadm5_server_handle_t srvr = \
1132881Smp153739 	     (kadm5_server_handle_t) handle; \
1142881Smp153739  \
1150Sstevel@tonic-gate 	if (srvr->params.kpasswd_protocol == KRB5_CHGPWD_RPCSEC && ! srvr->clnt) \
1162881Smp153739 	     return KADM5_BAD_SERVER_HANDLE; \
1170Sstevel@tonic-gate 	if (! srvr->cache_name) \
1182881Smp153739 	     return KADM5_BAD_SERVER_HANDLE; \
1190Sstevel@tonic-gate 	if (! srvr->lhandle) \
1202881Smp153739 	     return KADM5_BAD_SERVER_HANDLE; \
1210Sstevel@tonic-gate }
1220Sstevel@tonic-gate 
1232881Smp153739 #define CHECK_HANDLE(handle) \
1242881Smp153739      GENERIC_CHECK_HANDLE(handle, KADM5_OLD_LIB_API_VERSION, \
1252881Smp153739 			  KADM5_NEW_LIB_API_VERSION) \
1262881Smp153739      CLIENT_CHECK_HANDLE(handle)
1270Sstevel@tonic-gate 
1280Sstevel@tonic-gate #ifdef __cplusplus
1290Sstevel@tonic-gate }
1300Sstevel@tonic-gate #endif
1310Sstevel@tonic-gate 
1320Sstevel@tonic-gate #endif /* __KADM5_CLIENT_INTERNAL_H__ */
133