xref: /titanic_41/usr/src/lib/krb5/kadm5/clnt/client_internal.h (revision 56f9a274cc7ca7f2d6f19959b2db143d94a4e7e0)
1 /*
2  * Copyright 2008 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 
10 /*
11  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
12  *
13  *	Openvision retains the copyright to derivative works of
14  *	this source code.  Do *NOT* create a derivative of this
15  *	source code before consulting with your legal department.
16  *	Do *NOT* integrate *ANY* of this source code into another
17  *	product before consulting with your legal department.
18  *
19  *	For further information, read the top-level Openvision
20  *	copyright which is contained in the top-level MIT Kerberos
21  *	copyright.
22  *
23  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
24  *
25  */
26 
27 
28 /*
29  * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved
30  *
31  * $Header$
32  *
33  * $Log$
34  * Revision 1.1  1996/07/24 22:22:43  tlyu
35  * 	* Makefile.in, configure.in: break out client lib into a
36  * 		subdirectory
37  *
38  * Revision 1.11  1996/07/22 20:35:46  marc
39  * this commit includes all the changes on the OV_9510_INTEGRATION and
40  * OV_MERGE branches.  This includes, but is not limited to, the new openvision
41  * admin system, and major changes to gssapi to add functionality, and bring
42  * the implementation in line with rfc1964.  before committing, the
43  * code was built and tested for netbsd and solaris.
44  *
45  * Revision 1.10.4.1  1996/07/18 03:08:37  marc
46  * merged in changes from OV_9510_BP to OV_9510_FINAL1
47  *
48  * Revision 1.10.2.1  1996/06/20  02:16:46  marc
49  * File added to the repository on a branch
50  *
51  * Revision 1.10  1996/06/06  20:09:16  bjaspan
52  * add destroy_cache, for kadm5_init_with_creds
53  *
54  * Revision 1.9  1996/05/30 21:04:42  bjaspan
55  * add lhandle to handle
56  *
57  * Revision 1.8  1996/05/28 20:33:49  bjaspan
58  * rework kadm5_config
59  *
60  * Revision 1.7  1996/05/17 21:36:59  bjaspan
61  * rename to kadm5, begin implementing version 2
62  *
63  * Revision 1.6  1996/05/16 21:45:07  bjaspan
64  * add context
65  *
66  * Revision 1.5  1996/05/08 21:10:23  bjaspan
67  * marc's changes
68  *
69  * Revision 1.4  1996/01/16  20:54:30  grier
70  * secure/3570 use krb5_ui_4 not unsigned int
71  *
72  * Revision 1.3  1995/11/14  17:48:57  grier
73  * long to int
74  *
75  * Revision 1.2  1994/08/16  18:53:47  jik
76  * Versioning stuff.
77  *
78  * Revision 1.1  1994/08/09  21:14:38  jik
79  * Initial revision
80  *
81  */
82 
83 /*
84  * This header file is used internally by the Admin API client
85  * libraries.  IF YOU THINK YOU NEED TO USE THIS FILE FOR ANYTHING,
86  * YOU'RE ALMOST CERTAINLY WRONG.
87  */
88 
89 #ifdef __cplusplus
90 extern "C" {
91 #endif
92 
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 	/* Solaris Kerberos */
105 	gss_cred_id_t	my_cred;
106 	kadm5_config_params params;
107 	struct _kadm5_server_handle_t *lhandle;
108 } kadm5_server_handle_rec, *kadm5_server_handle_t;
109 
110 #define CLIENT_CHECK_HANDLE(handle) \
111 { \
112 	kadm5_server_handle_t srvr = \
113 	     (kadm5_server_handle_t) handle; \
114  \
115 	if (srvr->params.kpasswd_protocol == KRB5_CHGPWD_RPCSEC && ! srvr->clnt) \
116 	     return KADM5_BAD_SERVER_HANDLE; \
117 	if (! srvr->cache_name) \
118 	     return KADM5_BAD_SERVER_HANDLE; \
119 	if (! srvr->lhandle) \
120 	     return KADM5_BAD_SERVER_HANDLE; \
121 }
122 
123 #define CHECK_HANDLE(handle) \
124      GENERIC_CHECK_HANDLE(handle, KADM5_OLD_LIB_API_VERSION, \
125 			  KADM5_NEW_LIB_API_VERSION) \
126      CLIENT_CHECK_HANDLE(handle)
127 
128 #ifdef __cplusplus
129 }
130 #endif
131 
132 #endif /* __KADM5_CLIENT_INTERNAL_H__ */
133