xref: /titanic_41/usr/src/lib/krb5/kadm5/clnt/client_internal.h (revision 0a44ef6d9afbfe052a7e975f55ea0d2954b62a82)
1 /*
2  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 #ifndef	__KADM5_CLIENT_INTERNAL_H__
7 #define	__KADM5_CLIENT_INTERNAL_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 
29 /*
30  * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved
31  *
32  * $Header: /cvs/krbdev/krb5/src/lib/kadm5/clnt/client_internal.h,v 1.1 1996/07/24 22:22:43 tlyu Exp $
33  *
34  * $Log: client_internal.h,v $
35  * Revision 1.1  1996/07/24 22:22:43  tlyu
36  * 	* Makefile.in, configure.in: break out client lib into a
37  * 		subdirectory
38  *
39  * Revision 1.11  1996/07/22 20:35:46  marc
40  * this commit includes all the changes on the OV_9510_INTEGRATION and
41  * OV_MERGE branches.  This includes, but is not limited to, the new openvision
42  * admin system, and major changes to gssapi to add functionality, and bring
43  * the implementation in line with rfc1964.  before committing, the
44  * code was built and tested for netbsd and solaris.
45  *
46  * Revision 1.10.4.1  1996/07/18 03:08:37  marc
47  * merged in changes from OV_9510_BP to OV_9510_FINAL1
48  *
49  * Revision 1.10.2.1  1996/06/20  02:16:46  marc
50  * File added to the repository on a branch
51  *
52  * Revision 1.10  1996/06/06  20:09:16  bjaspan
53  * add destroy_cache, for kadm5_init_with_creds
54  *
55  * Revision 1.9  1996/05/30 21:04:42  bjaspan
56  * add lhandle to handle
57  *
58  * Revision 1.8  1996/05/28 20:33:49  bjaspan
59  * rework kadm5_config
60  *
61  * Revision 1.7  1996/05/17 21:36:59  bjaspan
62  * rename to kadm5, begin implementing version 2
63  *
64  * Revision 1.6  1996/05/16 21:45:07  bjaspan
65  * add context
66  *
67  * Revision 1.5  1996/05/08 21:10:23  bjaspan
68  * marc's changes
69  *
70  * Revision 1.4  1996/01/16  20:54:30  grier
71  * secure/3570 use krb5_ui_4 not unsigned int
72  *
73  * Revision 1.3  1995/11/14  17:48:57  grier
74  * long to int
75  *
76  * Revision 1.2  1994/08/16  18:53:47  jik
77  * Versioning stuff.
78  *
79  * Revision 1.1  1994/08/09  21:14:38  jik
80  * Initial revision
81  *
82  */
83 
84 /*
85  * This header file is used internally by the Admin API client
86  * libraries.  IF YOU THINK YOU NEED TO USE THIS FILE FOR ANYTHING,
87  * YOU'RE ALMOST CERTAINLY WRONG.
88  */
89 
90 #ifdef __cplusplus
91 extern "C" {
92 #endif
93 
94 #include "admin_internal.h"
95 
96 typedef struct _kadm5_server_handle_t {
97 	krb5_ui_4	magic_number;
98 	krb5_ui_4	struct_version;
99 	krb5_ui_4	api_version;
100 	char *		cache_name;
101 	int		destroy_cache;
102 	CLIENT *	clnt;
103 	krb5_context	context;
104 	gss_cred_id_t	my_cred;
105 	kadm5_config_params params;
106 	struct _kadm5_server_handle_t *lhandle;
107 } kadm5_server_handle_rec, *kadm5_server_handle_t;
108 
109 #define CLIENT_CHECK_HANDLE(handle) \
110 { \
111 	kadm5_server_handle_t srvr = \
112 	     (kadm5_server_handle_t) handle; \
113  \
114 	if (srvr->params.kpasswd_protocol == KRB5_CHGPWD_RPCSEC && ! srvr->clnt) \
115 	     return KADM5_BAD_SERVER_HANDLE; \
116 	if (! srvr->cache_name) \
117 	     return KADM5_BAD_SERVER_HANDLE; \
118 	if (! srvr->lhandle) \
119 	     return KADM5_BAD_SERVER_HANDLE; \
120 }
121 
122 #define CHECK_HANDLE(handle) \
123      GENERIC_CHECK_HANDLE(handle, KADM5_OLD_LIB_API_VERSION, \
124 			  KADM5_NEW_LIB_API_VERSION) \
125      CLIENT_CHECK_HANDLE(handle)
126 
127 #ifdef __cplusplus
128 }
129 #endif
130 
131 #endif /* __KADM5_CLIENT_INTERNAL_H__ */
132