xref: /titanic_41/usr/src/lib/gss_mechs/mech_krb5/include/krb5/k5-plugin.h (revision 54925bf60766fbb4f1f2d7c843721406a7b7a3fb)
1 /*
2  * Copyright (C) 2006 Massachusetts Institute of Technology.
3  * All Rights Reserved.
4  *
5  * This software is being provided to you, the LICENSEE, by the
6  * Massachusetts Institute of Technology (M.I.T.) under the following
7  * license.  By obtaining, using and/or copying this software, you agree
8  * that you have read, understood, and will comply with these terms and
9  * conditions:
10  *
11  * Export of this software from the United States of America may
12  * require a specific license from the United States Government.
13  * It is the responsibility of any person or organization contemplating
14  * export to obtain such a license before exporting.
15  *
16  * WITHIN THAT CONSTRAINT, permission to use, copy, modify and distribute
17  * this software and its documentation for any purpose and without fee or
18  * royalty is hereby granted, provided that you agree to comply with the
19  * following copyright notice and statements, including the disclaimer, and
20  * that the same appear on ALL copies of the software and documentation,
21  * including modifications that you make for internal use or for
22  * distribution:
23  *
24  * THIS SOFTWARE IS PROVIDED "AS IS", AND M.I.T. MAKES NO REPRESENTATIONS
25  * OR WARRANTIES, EXPRESS OR IMPLIED.  By way of example, but not
26  * limitation, M.I.T. MAKES NO REPRESENTATIONS OR WARRANTIES OF
27  * MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF
28  * THE LICENSED SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY
29  * PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
30  *
31  * The name of the Massachusetts Institute of Technology or M.I.T. may NOT
32  * be used in advertising or publicity pertaining to distribution of the
33  * software.  Title to copyright in this software and any associated
34  * documentation shall at all times remain with M.I.T., and USER agrees to
35  * preserve same.
36  *
37  * Furthermore if you modify this software you must label
38  * your software as modified software and not distribute it in such a
39  * fashion that it might be confused with the original M.I.T. software.
40  */
41 
42 /* Just those definitions which are needed by util/support/plugins.c,
43    which gets compiled before util/et is built, which happens before
44    we can construct krb5.h, which is included by k5-int.h.
45 
46    So, no krb5 types.  */
47 
48 #ifndef _K5_PLUGIN_H_
49 #define _K5_PLUGIN_H_
50 
51 #pragma ident	"%Z%%M%	%I%	%E% SMI"
52 
53 #if defined(_MSDOS) || defined(_WIN32)
54 #include "win-mac.h"
55 #endif
56 #include "autoconf.h"
57 #ifndef KRB5_CALLCONV
58 #define KRB5_CALLCONV
59 #define KRB5_CALLCONV_C
60 #endif
61 
62 #ifdef HAVE_STDINT_H
63 # include <stdint.h>
64 #elif defined(HAVE_INTTYPES_H)
65 # include <inttypes.h>
66 #endif
67 
68 #include "k5-err.h"
69 
70 struct plugin_file_handle;	/* opaque */
71 
72 struct plugin_dir_handle {
73     /* This points to a NULL-terminated list of pointers to plugin_file_handle structs */
74     struct plugin_file_handle **files;
75 };
76 #define PLUGIN_DIR_INIT(P) ((P)->files = NULL)
77 #define PLUGIN_DIR_OPEN(P) ((P)->files != NULL)
78 
79 long KRB5_CALLCONV
80 krb5int_open_plugin (const char *, struct plugin_file_handle **, struct errinfo *);
81 void KRB5_CALLCONV
82 krb5int_close_plugin (struct plugin_file_handle *);
83 
84 long KRB5_CALLCONV
85 krb5int_get_plugin_data (struct plugin_file_handle *, const char *, void **,
86 			 struct errinfo *);
87 
88 long KRB5_CALLCONV
89 krb5int_get_plugin_func (struct plugin_file_handle *, const char *,
90 			 void (**)(), struct errinfo *);
91 
92 
93 long KRB5_CALLCONV
94 krb5int_open_plugin_dirs (const char * const *, const char * const *,
95 			  struct plugin_dir_handle *, struct errinfo *);
96 void KRB5_CALLCONV
97 krb5int_close_plugin_dirs (struct plugin_dir_handle *);
98 
99 long KRB5_CALLCONV
100 krb5int_get_plugin_dir_data (struct plugin_dir_handle *, const char *,
101 			     void ***, struct errinfo *);
102 void KRB5_CALLCONV
103 krb5int_free_plugin_dir_data (void **);
104 
105 long KRB5_CALLCONV
106 krb5int_get_plugin_dir_func (struct plugin_dir_handle *, const char *,
107 			     void (***)(void), struct errinfo *);
108 void KRB5_CALLCONV
109 krb5int_free_plugin_dir_func (void (**)(void));
110 
111 #endif /* _K5_PLUGIN_H_ */
112