xref: /freebsd/crypto/krb5/src/lib/kadm5/clnt/client_internal.h (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /*
3  * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved
4  *
5  * $Header$
6  *
7  * $Log$
8  * Revision 1.1  1996/07/24 22:22:43  tlyu
9  *      * Makefile.in, configure.in: break out client lib into a
10  *              subdirectory
11  *
12  * Revision 1.11  1996/07/22 20:35:46  marc
13  * this commit includes all the changes on the OV_9510_INTEGRATION and
14  * OV_MERGE branches.  This includes, but is not limited to, the new openvision
15  * admin system, and major changes to gssapi to add functionality, and bring
16  * the implementation in line with rfc1964.  before committing, the
17  * code was built and tested for netbsd and solaris.
18  *
19  * Revision 1.10.4.1  1996/07/18 03:08:37  marc
20  * merged in changes from OV_9510_BP to OV_9510_FINAL1
21  *
22  * Revision 1.10.2.1  1996/06/20  02:16:46  marc
23  * File added to the repository on a branch
24  *
25  * Revision 1.10  1996/06/06  20:09:16  bjaspan
26  * add destroy_cache, for kadm5_init_with_creds
27  *
28  * Revision 1.9  1996/05/30 21:04:42  bjaspan
29  * add lhandle to handle
30  *
31  * Revision 1.8  1996/05/28 20:33:49  bjaspan
32  * rework kadm5_config
33  *
34  * Revision 1.7  1996/05/17 21:36:59  bjaspan
35  * rename to kadm5, begin implementing version 2
36  *
37  * Revision 1.6  1996/05/16 21:45:07  bjaspan
38  * add context
39  *
40  * Revision 1.5  1996/05/08 21:10:23  bjaspan
41  * marc's changes
42  *
43  * Revision 1.4  1996/01/16  20:54:30  grier
44  * secure/3570 use krb5_ui_4 not unsigned int
45  *
46  * Revision 1.3  1995/11/14  17:48:57  grier
47  * long to int
48  *
49  * Revision 1.2  1994/08/16  18:53:47  jik
50  * Versioning stuff.
51  *
52  * Revision 1.1  1994/08/09  21:14:38  jik
53  * Initial revision
54  *
55  */
56 
57 /*
58  * This header file is used internally by the Admin API client
59  * libraries.  IF YOU THINK YOU NEED TO USE THIS FILE FOR ANYTHING,
60  * YOU'RE ALMOST CERTAINLY WRONG.
61  */
62 
63 #ifndef __KADM5_CLIENT_INTERNAL_H__
64 #define __KADM5_CLIENT_INTERNAL_H__
65 
66 #include "admin_internal.h"
67 
68 typedef struct _kadm5_server_handle_t {
69     krb5_ui_4       magic_number;
70     krb5_ui_4       struct_version;
71     krb5_ui_4       api_version;
72     char *          cache_name;
73     int             destroy_cache;
74     CLIENT *        clnt;
75     int             client_socket;
76     krb5_context    context;
77     gss_cred_id_t   cred;
78     kadm5_config_params params;
79     struct _kadm5_server_handle_t *lhandle;
80 } kadm5_server_handle_rec, *kadm5_server_handle_t;
81 
82 #define CLIENT_CHECK_HANDLE(handle)             \
83     {                                           \
84         kadm5_server_handle_t srvr =            \
85             (kadm5_server_handle_t) handle;     \
86                                                 \
87         if (! srvr->clnt)                       \
88             return KADM5_BAD_SERVER_HANDLE;     \
89         if (! srvr->cache_name)                 \
90             return KADM5_BAD_SERVER_HANDLE;     \
91         if (! srvr->lhandle)                    \
92             return KADM5_BAD_SERVER_HANDLE;     \
93     }
94 
95 #define CHECK_HANDLE(handle)                                    \
96     GENERIC_CHECK_HANDLE(handle, KADM5_OLD_LIB_API_VERSION,     \
97                          KADM5_NEW_LIB_API_VERSION)             \
98     CLIENT_CHECK_HANDLE(handle)
99 
100 #endif /* __KADM5_CLIENT_INTERNAL_H__ */
101