staticopen.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. /* staticopen.h
  2. * Rob Siemborski
  3. * Howard Chu
  4. */
  5. /*
  6. * Copyright (c) 1998-2016 Carnegie Mellon University. All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. *
  12. * 1. Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. *
  15. * 2. Redistributions in binary form must reproduce the above copyright
  16. * notice, this list of conditions and the following disclaimer in
  17. * the documentation and/or other materials provided with the
  18. * distribution.
  19. *
  20. * 3. The name "Carnegie Mellon University" must not be used to
  21. * endorse or promote products derived from this software without
  22. * prior written permission. For permission or any other legal
  23. * details, please contact
  24. * Carnegie Mellon University
  25. * Center for Technology Transfer and Enterprise Creation
  26. * 4615 Forbes Avenue
  27. * Suite 302
  28. * Pittsburgh, PA 15213
  29. * (412) 268-7393, fax: (412) 268-7395
  30. * innovation@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. typedef enum {
  46. UNKNOWN = 0, SERVER = 1, CLIENT = 2, AUXPROP = 3, CANONUSER = 4
  47. } _sasl_plug_type;
  48. typedef struct {
  49. _sasl_plug_type type;
  50. char *name;
  51. sasl_client_plug_init_t *plug;
  52. } _sasl_plug_rec;
  53. /* For static linking */
  54. #define SPECIFIC_CLIENT_PLUG_INIT_PROTO( x ) \
  55. sasl_client_plug_init_t x##_client_plug_init
  56. #define SPECIFIC_SERVER_PLUG_INIT_PROTO( x ) \
  57. sasl_server_plug_init_t x##_server_plug_init
  58. #define SPECIFIC_AUXPROP_PLUG_INIT_PROTO( x ) \
  59. sasl_auxprop_init_t x##_auxprop_plug_init
  60. #define SPECIFIC_CANONUSER_PLUG_INIT_PROTO( x ) \
  61. sasl_canonuser_init_t x##_canonuser_plug_init
  62. /* Static Compillation Foo */
  63. #define SPECIFIC_CLIENT_PLUG_INIT( x, n )\
  64. { CLIENT, n, x##_client_plug_init }
  65. #define SPECIFIC_SERVER_PLUG_INIT( x, n )\
  66. { SERVER, n, (sasl_client_plug_init_t *)x##_server_plug_init }
  67. #define SPECIFIC_AUXPROP_PLUG_INIT( x, n )\
  68. { AUXPROP, n, (sasl_client_plug_init_t *)x##_auxprop_plug_init }
  69. #define SPECIFIC_CANONUSER_PLUG_INIT( x, n )\
  70. { CANONUSER, n, (sasl_client_plug_init_t *)x##_canonuser_plug_init }
  71. #ifdef STATIC_ANONYMOUS
  72. extern SPECIFIC_SERVER_PLUG_INIT_PROTO( anonymous );
  73. extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( anonymous );
  74. #endif
  75. #ifdef STATIC_CRAMMD5
  76. extern SPECIFIC_SERVER_PLUG_INIT_PROTO( crammd5 );
  77. extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( crammd5 );
  78. #endif
  79. #ifdef STATIC_DIGESTMD5
  80. extern SPECIFIC_SERVER_PLUG_INIT_PROTO( digestmd5 );
  81. extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( digestmd5 );
  82. #endif
  83. #ifdef STATIC_SCRAM
  84. extern SPECIFIC_SERVER_PLUG_INIT_PROTO( scram );
  85. extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( scram );
  86. #endif
  87. #ifdef STATIC_GSSAPIV2
  88. extern SPECIFIC_SERVER_PLUG_INIT_PROTO( gssapiv2 );
  89. extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( gssapiv2 );
  90. #endif
  91. #ifdef STATIC_KERBEROS4
  92. extern SPECIFIC_SERVER_PLUG_INIT_PROTO( kerberos4 );
  93. extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( kerberos4 );
  94. #endif
  95. #ifdef STATIC_LOGIN
  96. extern SPECIFIC_SERVER_PLUG_INIT_PROTO( login );
  97. extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( login );
  98. #endif
  99. #ifdef STATIC_NTLM
  100. extern SPECIFIC_SERVER_PLUG_INIT_PROTO( ntlm );
  101. extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( ntlm );
  102. #endif
  103. #ifdef STATIC_OTP
  104. extern SPECIFIC_SERVER_PLUG_INIT_PROTO( otp );
  105. extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( otp );
  106. #endif
  107. #ifdef STATIC_PLAIN
  108. extern SPECIFIC_SERVER_PLUG_INIT_PROTO( plain );
  109. extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( plain );
  110. #endif
  111. #ifdef STATIC_SRP
  112. extern SPECIFIC_SERVER_PLUG_INIT_PROTO( srp );
  113. extern SPECIFIC_CLIENT_PLUG_INIT_PROTO( srp );
  114. #endif
  115. #ifdef STATIC_SASLDB
  116. extern SPECIFIC_AUXPROP_PLUG_INIT_PROTO( sasldb );
  117. #endif
  118. #ifdef STATIC_SQL
  119. extern SPECIFIC_AUXPROP_PLUG_INIT_PROTO( sql );
  120. #endif
  121. #ifdef STATIC_LDAPDB
  122. extern SPECIFIC_AUXPROP_PLUG_INIT_PROTO( ldapdb );
  123. #endif
  124. _sasl_plug_rec _sasl_static_plugins[] = {
  125. #ifdef STATIC_ANONYMOUS
  126. SPECIFIC_SERVER_PLUG_INIT( anonymous, "ANONYMOUS" ),
  127. SPECIFIC_CLIENT_PLUG_INIT( anonymous, "ANONYMOUS" ),
  128. #endif
  129. #ifdef STATIC_CRAMMD5
  130. SPECIFIC_SERVER_PLUG_INIT( crammd5, "CRAM-MD5" ),
  131. SPECIFIC_CLIENT_PLUG_INIT( crammd5, "CRAM-MD5" ),
  132. #endif
  133. #ifdef STATIC_DIGESTMD5
  134. SPECIFIC_SERVER_PLUG_INIT( digestmd5, "DIGEST-MD5" ),
  135. SPECIFIC_CLIENT_PLUG_INIT( digestmd5, "DIGEST-MD5" ),
  136. #endif
  137. #ifdef STATIC_GSSAPIV2
  138. SPECIFIC_SERVER_PLUG_INIT( gssapiv2, "GSSAPI" ),
  139. SPECIFIC_CLIENT_PLUG_INIT( gssapiv2, "GSSAPI" ),
  140. #endif
  141. #ifdef STATIC_KERBEROS4
  142. SPECIFIC_SERVER_PLUG_INIT( kerberos4, "KERBEROS_V4" ),
  143. SPECIFIC_CLIENT_PLUG_INIT( kerberos4, "KERBEROS_V4" ),
  144. #endif
  145. #ifdef STATIC_LOGIN
  146. SPECIFIC_SERVER_PLUG_INIT( login, "LOGIN" ),
  147. SPECIFIC_CLIENT_PLUG_INIT( login, "LOGIN" ),
  148. #endif
  149. #ifdef STATIC_NTLM
  150. SPECIFIC_SERVER_PLUG_INIT( ntlm, "NTLM" ),
  151. SPECIFIC_CLIENT_PLUG_INIT( ntlm, "NTLM" ),
  152. #endif
  153. #ifdef STATIC_OTP
  154. SPECIFIC_SERVER_PLUG_INIT( otp, "OTP" ),
  155. SPECIFIC_CLIENT_PLUG_INIT( otp, "OTP" ),
  156. #endif
  157. #ifdef STATIC_PLAIN
  158. SPECIFIC_SERVER_PLUG_INIT( plain, "PLAIN" ),
  159. SPECIFIC_CLIENT_PLUG_INIT( plain, "PLAIN" ),
  160. #endif
  161. #ifdef STATIC_SCRAM
  162. SPECIFIC_SERVER_PLUG_INIT( scram, "SCRAM" ),
  163. SPECIFIC_CLIENT_PLUG_INIT( scram, "SCRAM" ),
  164. #endif
  165. #ifdef STATIC_SRP
  166. SPECIFIC_SERVER_PLUG_INIT( srp, "SRP" ),
  167. SPECIFIC_CLIENT_PLUG_INIT( srp, "SRP" ),
  168. #endif
  169. #ifdef STATIC_SASLDB
  170. SPECIFIC_AUXPROP_PLUG_INIT( sasldb, "SASLDB" ),
  171. #endif
  172. #ifdef STATIC_SQL
  173. SPECIFIC_AUXPROP_PLUG_INIT( sql, "SQL" ),
  174. #endif
  175. #ifdef STATIC_LDAPDB
  176. SPECIFIC_AUXPROP_PLUG_INIT( ldapdb, "LDAPDB" ),
  177. #endif
  178. { UNKNOWN, NULL, NULL }
  179. };