1 | /* staticopen.h |
---|
2 | * Rob Siemborski |
---|
3 | * Howard Chu |
---|
4 | * $Id: staticopen.h,v 1.1.1.1 2003-02-12 22:33:14 ghudson Exp $ |
---|
5 | */ |
---|
6 | /* |
---|
7 | * Copyright (c) 2001 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 | |
---|
46 | typedef enum { |
---|
47 | UNKNOWN = 0, SERVER = 1, CLIENT = 2, AUXPROP = 3, CANONUSER = 4 |
---|
48 | } _sasl_plug_type; |
---|
49 | |
---|
50 | typedef 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 ) \ |
---|
58 | sasl_client_plug_init_t x##_client_plug_init |
---|
59 | |
---|
60 | #define SPECIFIC_SERVER_PLUG_INIT_PROTO( x ) \ |
---|
61 | sasl_server_plug_init_t x##_server_plug_init |
---|
62 | |
---|
63 | #define SPECIFIC_AUXPROP_PLUG_INIT_PROTO( x ) \ |
---|
64 | sasl_auxprop_init_t x##_auxprop_plug_init |
---|
65 | |
---|
66 | #define SPECIFIC_CANONUSER_PLUG_INIT_PROTO( x ) \ |
---|
67 | sasl_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 |
---|
80 | extern SPECIFIC_SERVER_PLUG_INIT_PROTO( anonymous ); |
---|
81 | extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( anonymous ); |
---|
82 | #endif |
---|
83 | #ifdef STATIC_CRAMMD5 |
---|
84 | extern SPECIFIC_SERVER_PLUG_INIT_PROTO( crammd5 ); |
---|
85 | extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( crammd5 ); |
---|
86 | #endif |
---|
87 | #ifdef STATIC_DIGESTMD5 |
---|
88 | extern SPECIFIC_SERVER_PLUG_INIT_PROTO( digestmd5 ); |
---|
89 | extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( digestmd5 ); |
---|
90 | #endif |
---|
91 | #ifdef STATIC_GSSAPIV2 |
---|
92 | extern SPECIFIC_SERVER_PLUG_INIT_PROTO( gssapiv2 ); |
---|
93 | extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( gssapiv2 ); |
---|
94 | #endif |
---|
95 | #ifdef STATIC_KERBEROS4 |
---|
96 | extern SPECIFIC_SERVER_PLUG_INIT_PROTO( kerberos4 ); |
---|
97 | extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( kerberos4 ); |
---|
98 | #endif |
---|
99 | #ifdef STATIC_LOGIN |
---|
100 | extern SPECIFIC_SERVER_PLUG_INIT_PROTO( login ); |
---|
101 | extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( login ); |
---|
102 | #endif |
---|
103 | #ifdef STATIC_NTLM |
---|
104 | extern SPECIFIC_SERVER_PLUG_INIT_PROTO( ntlm ); |
---|
105 | extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( ntlm ); |
---|
106 | #endif |
---|
107 | #ifdef STATIC_OTP |
---|
108 | extern SPECIFIC_SERVER_PLUG_INIT_PROTO( otp ); |
---|
109 | extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( otp ); |
---|
110 | #endif |
---|
111 | #ifdef STATIC_PLAIN |
---|
112 | extern SPECIFIC_SERVER_PLUG_INIT_PROTO( plain ); |
---|
113 | extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( plain ); |
---|
114 | #endif |
---|
115 | #ifdef STATIC_SRP |
---|
116 | extern SPECIFIC_SERVER_PLUG_INIT_PROTO( srp ); |
---|
117 | extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( srp ); |
---|
118 | #endif |
---|
119 | #ifdef STATIC_SASLDB |
---|
120 | extern SPECIFIC_AUXPROP_PLUG_INIT_PROTO( sasldb ); |
---|
121 | #endif |
---|
122 | #ifdef STATIC_MYSQL |
---|
123 | extern SPECIFIC_AUXPROP_PLUG_INIT_PROTO( mysql ); |
---|
124 | #endif |
---|
125 | |
---|
126 | _sasl_plug_rec _sasl_static_plugins[] = { |
---|
127 | #ifdef STATIC_ANONYMOUS |
---|
128 | SPECIFIC_SERVER_PLUG_INIT( anonymous, "ANONYMOUS" ), |
---|
129 | SPECIFIC_CLIENT_PLUG_INIT( anonymous, "ANONYMOUS" ), |
---|
130 | #endif |
---|
131 | #ifdef STATIC_CRAMMD5 |
---|
132 | SPECIFIC_SERVER_PLUG_INIT( crammd5, "CRAM-MD5" ), |
---|
133 | SPECIFIC_CLIENT_PLUG_INIT( crammd5, "CRAM-MD5" ), |
---|
134 | #endif |
---|
135 | #ifdef STATIC_DIGESTMD5 |
---|
136 | SPECIFIC_SERVER_PLUG_INIT( digestmd5, "DIGEST-MD5" ), |
---|
137 | SPECIFIC_CLIENT_PLUG_INIT( digestmd5, "DIGEST-MD5" ), |
---|
138 | #endif |
---|
139 | #ifdef STATIC_GSSAPIV2 |
---|
140 | SPECIFIC_SERVER_PLUG_INIT( gssapiv2, "GSSAPI" ), |
---|
141 | SPECIFIC_CLIENT_PLUG_INIT( gssapiv2, "GSSAPI" ), |
---|
142 | #endif |
---|
143 | #ifdef STATIC_KERBEROS4 |
---|
144 | SPECIFIC_SERVER_PLUG_INIT( kerberos4, "KERBEROS_V4" ), |
---|
145 | SPECIFIC_CLIENT_PLUG_INIT( kerberos4, "KERBEROS_V4" ), |
---|
146 | #endif |
---|
147 | #ifdef STATIC_LOGIN |
---|
148 | SPECIFIC_SERVER_PLUG_INIT( login, "LOGIN" ), |
---|
149 | SPECIFIC_CLIENT_PLUG_INIT( login, "LOGIN" ), |
---|
150 | #endif |
---|
151 | #ifdef STATIC_NTLM |
---|
152 | SPECIFIC_SERVER_PLUG_INIT( ntlm, "NTLM" ), |
---|
153 | SPECIFIC_CLIENT_PLUG_INIT( ntlm, "NTLM" ), |
---|
154 | #endif |
---|
155 | #ifdef STATIC_OTP |
---|
156 | SPECIFIC_SERVER_PLUG_INIT( otp, "OTP" ), |
---|
157 | SPECIFIC_CLIENT_PLUG_INIT( otp, "OTP" ), |
---|
158 | #endif |
---|
159 | #ifdef STATIC_PLAIN |
---|
160 | SPECIFIC_SERVER_PLUG_INIT( plain, "PLAIN" ), |
---|
161 | SPECIFIC_CLIENT_PLUG_INIT( plain, "PLAIN" ), |
---|
162 | #endif |
---|
163 | #ifdef STATIC_SRP |
---|
164 | SPECIFIC_SERVER_PLUG_INIT( srp, "SRP" ), |
---|
165 | SPECIFIC_CLIENT_PLUG_INIT( srp, "SRP" ), |
---|
166 | #endif |
---|
167 | #ifdef STATIC_SASLDB |
---|
168 | SPECIFIC_AUXPROP_PLUG_INIT( sasldb, "SASLDB" ), |
---|
169 | #endif |
---|
170 | #ifdef STATIC_MYSQL |
---|
171 | SPECIFIC_AUXPROP_PLUG_INIT( mysql, "MYSQL" ), |
---|
172 | #endif |
---|
173 | { UNKNOWN, NULL, NULL } |
---|
174 | }; |
---|