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