1/* staticopen.h
2 * Rob Siemborski
3 * Howard Chu
4 * $Id: staticopen.h,v 1.4 2005/05/17 21:56:44 snsimon Exp $
5 */
6/*
7 * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 *    notice, this list of conditions and the following disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above copyright
17 *    notice, this list of conditions and the following disclaimer in
18 *    the documentation and/or other materials provided with the
19 *    distribution.
20 *
21 * 3. The name "Carnegie Mellon University" must not be used to
22 *    endorse or promote products derived from this software without
23 *    prior written permission. For permission or any other legal
24 *    details, please contact
25 *      Office of Technology Transfer
26 *      Carnegie Mellon University
27 *      5000 Forbes Avenue
28 *      Pittsburgh, PA  15213-3890
29 *      (412) 268-4387, fax: (412) 268-7395
30 *      tech-transfer@andrew.cmu.edu
31 *
32 * 4. Redistributions of any form whatsoever must retain the following
33 *    acknowledgment:
34 *    "This product includes software developed by Computing Services
35 *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
36 *
37 * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
38 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
39 * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
40 * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
41 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
42 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
43 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
44 */
45
46typedef enum {
47	UNKNOWN = 0, SERVER = 1, CLIENT = 2, AUXPROP = 3, CANONUSER = 4
48} _sasl_plug_type;
49
50typedef struct {
51	_sasl_plug_type type;
52	char *name;
53	sasl_client_plug_init_t *plug;
54} _sasl_plug_rec;
55
56/* For static linking */
57#define SPECIFIC_CLIENT_PLUG_INIT_PROTO( x ) \
58sasl_client_plug_init_t x##_client_plug_init
59
60#define SPECIFIC_SERVER_PLUG_INIT_PROTO( x ) \
61sasl_server_plug_init_t x##_server_plug_init
62
63#define SPECIFIC_AUXPROP_PLUG_INIT_PROTO( x ) \
64sasl_auxprop_init_t x##_auxprop_plug_init
65
66#define SPECIFIC_CANONUSER_PLUG_INIT_PROTO( x ) \
67sasl_canonuser_init_t x##_canonuser_plug_init
68
69/* Static Compillation Foo */
70#define SPECIFIC_CLIENT_PLUG_INIT( x, n )\
71	{ CLIENT, n, x##_client_plug_init }
72#define SPECIFIC_SERVER_PLUG_INIT( x, n )\
73	{ SERVER, n, (sasl_client_plug_init_t *)x##_server_plug_init }
74#define SPECIFIC_AUXPROP_PLUG_INIT( x, n )\
75	{ AUXPROP, n, (sasl_client_plug_init_t *)x##_auxprop_plug_init }
76#define SPECIFIC_CANONUSER_PLUG_INIT( x, n )\
77	{ CANONUSER, n, (sasl_client_plug_init_t *)x##_canonuser_plug_init }
78
79#ifdef STATIC_ANONYMOUS
80extern SPECIFIC_SERVER_PLUG_INIT_PROTO( anonymous );
81extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( anonymous );
82#endif
83#ifdef STATIC_CRAMMD5
84extern SPECIFIC_SERVER_PLUG_INIT_PROTO( crammd5 );
85extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( crammd5 );
86#endif
87#ifdef STATIC_DIGESTMD5
88extern SPECIFIC_SERVER_PLUG_INIT_PROTO( digestmd5 );
89extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( digestmd5 );
90#endif
91#ifdef STATIC_GSSAPIV2
92extern SPECIFIC_SERVER_PLUG_INIT_PROTO( gssapiv2 );
93extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( gssapiv2 );
94#endif
95#ifdef STATIC_KERBEROS4
96extern SPECIFIC_SERVER_PLUG_INIT_PROTO( kerberos4 );
97extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( kerberos4 );
98#endif
99#ifdef STATIC_LOGIN
100extern SPECIFIC_SERVER_PLUG_INIT_PROTO( login );
101extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( login );
102#endif
103#ifdef STATIC_NTLM
104extern SPECIFIC_SERVER_PLUG_INIT_PROTO( ntlm );
105extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( ntlm );
106#endif
107#ifdef STATIC_OTP
108extern SPECIFIC_SERVER_PLUG_INIT_PROTO( otp );
109extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( otp );
110#endif
111#ifdef STATIC_PLAIN
112extern SPECIFIC_SERVER_PLUG_INIT_PROTO( plain );
113extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( plain );
114#endif
115#ifdef STATIC_SRP
116extern SPECIFIC_SERVER_PLUG_INIT_PROTO( srp );
117extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( srp );
118#endif
119#ifdef STATIC_SASLDB
120extern SPECIFIC_AUXPROP_PLUG_INIT_PROTO( sasldb );
121#endif
122#ifdef STATIC_SQL
123extern SPECIFIC_AUXPROP_PLUG_INIT_PROTO( sql );
124#endif
125#ifdef STATIC_LDAPDB
126extern SPECIFIC_AUXPROP_PLUG_INIT_PROTO( ldapdb );
127#endif
128
129_sasl_plug_rec _sasl_static_plugins[] = {
130#ifdef STATIC_ANONYMOUS
131	SPECIFIC_SERVER_PLUG_INIT( anonymous, "ANONYMOUS" ),
132	SPECIFIC_CLIENT_PLUG_INIT( anonymous, "ANONYMOUS" ),
133#endif
134#ifdef STATIC_CRAMMD5
135	SPECIFIC_SERVER_PLUG_INIT( crammd5, "CRAM-MD5" ),
136	SPECIFIC_CLIENT_PLUG_INIT( crammd5, "CRAM-MD5" ),
137#endif
138#ifdef STATIC_DIGESTMD5
139	SPECIFIC_SERVER_PLUG_INIT( digestmd5, "DIGEST-MD5" ),
140	SPECIFIC_CLIENT_PLUG_INIT( digestmd5, "DIGEST-MD5" ),
141#endif
142#ifdef STATIC_GSSAPIV2
143	SPECIFIC_SERVER_PLUG_INIT( gssapiv2, "GSSAPI" ),
144	SPECIFIC_CLIENT_PLUG_INIT( gssapiv2, "GSSAPI" ),
145#endif
146#ifdef STATIC_KERBEROS4
147	SPECIFIC_SERVER_PLUG_INIT( kerberos4, "KERBEROS_V4" ),
148	SPECIFIC_CLIENT_PLUG_INIT( kerberos4, "KERBEROS_V4" ),
149#endif
150#ifdef STATIC_LOGIN
151	SPECIFIC_SERVER_PLUG_INIT( login, "LOGIN" ),
152	SPECIFIC_CLIENT_PLUG_INIT( login, "LOGIN" ),
153#endif
154#ifdef STATIC_NTLM
155	SPECIFIC_SERVER_PLUG_INIT( ntlm, "NTLM" ),
156	SPECIFIC_CLIENT_PLUG_INIT( ntlm, "NTLM" ),
157#endif
158#ifdef STATIC_OTP
159	SPECIFIC_SERVER_PLUG_INIT( otp, "OTP" ),
160	SPECIFIC_CLIENT_PLUG_INIT( otp, "OTP" ),
161#endif
162#ifdef STATIC_PLAIN
163	SPECIFIC_SERVER_PLUG_INIT( plain, "PLAIN" ),
164	SPECIFIC_CLIENT_PLUG_INIT( plain, "PLAIN" ),
165#endif
166#ifdef STATIC_SRP
167	SPECIFIC_SERVER_PLUG_INIT( srp, "SRP" ),
168	SPECIFIC_CLIENT_PLUG_INIT( srp, "SRP" ),
169#endif
170#ifdef STATIC_SASLDB
171	SPECIFIC_AUXPROP_PLUG_INIT( sasldb, "SASLDB" ),
172#endif
173#ifdef STATIC_SQL
174	SPECIFIC_AUXPROP_PLUG_INIT( sql, "SQL" ),
175#endif
176#ifdef STATIC_LDAPDB
177    SPECIFIC_AUXPROP_PLUG_INIT( ldapdb, "LDAPDB" ),
178#endif
179	{ UNKNOWN, NULL, NULL }
180};
181