xref: /titanic_52/usr/src/lib/krb5/kadm5/clnt/client_internal.h (revision fb3fb4f3d76d55b64440afd0af72775dfad3bd1d)
1 /*
2  * Copyright 2005 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: /afs/athena.mit.edu/astaff/project/krbdev/.cvsroot/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 
110 #define	CLIENT_CHECK_HANDLE(handle) \
111 { \
112 kadm5_server_handle_t srvr = (kadm5_server_handle_t)handle; \
113 	if (srvr->params.kpasswd_protocol == KRB5_CHGPWD_RPCSEC && ! srvr->clnt) \
114 	    return (KADM5_BAD_SERVER_HANDLE); \
115 	if (! srvr->cache_name) \
116 	    return (KADM5_BAD_SERVER_HANDLE); \
117 	if (! srvr->lhandle) \
118 return (KADM5_BAD_SERVER_HANDLE); \
119 }
120 
121 #define	CHECK_HANDLE(handle) \
122 GENERIC_CHECK_HANDLE(handle, KADM5_OLD_LIB_API_VERSION, \
123 KADM5_NEW_LIB_API_VERSION) \
124 CLIENT_CHECK_HANDLE(handle)
125 
126 #ifdef __cplusplus
127 }
128 #endif
129 
130 #endif /* __KADM5_CLIENT_INTERNAL_H__ */
131