2 * Copyright 2021 Hans Leidekker for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 /* compatible with structures defined in ldap.h */
20 typedef struct bervalU
33 struct bervalU
**modv_bvals
;
40 struct bervalU ldctl_value
;
41 char ldctl_iscritical
;
54 int ldvlv_before_count
;
55 int ldvlv_after_count
;
58 struct bervalU
*ldvlv_attrvalue
;
59 struct bervalU
*ldvlv_context
;
60 void *ldvlv_extradata
;
65 int ldapai_info_version
;
66 int ldapai_api_version
;
67 int ldapai_protocol_version
;
68 char **ldapai_extensions
;
69 char *ldapai_vendor_name
;
70 int ldapai_vendor_version
;
75 int ldapaif_info_version
;
78 } LDAPAPIFeatureInfoU
;
80 typedef struct timevalU
86 #ifndef SASL_CB_LIST_END
87 #define SASL_CB_LIST_END 0
88 #define SASL_CB_USER 0x4001
89 #define SASL_CB_PASS 0x4004
90 #define SASL_CB_GETREALM 0x4008
93 typedef struct sasl_interactU
96 const char *challenge
;
98 const char *defresult
;
103 extern void * CDECL
wrap_ber_alloc_t(int) DECLSPEC_HIDDEN
;
104 extern void CDECL
wrap_ber_bvecfree(struct bervalU
**) DECLSPEC_HIDDEN
;
105 extern void CDECL
wrap_ber_bvfree(struct bervalU
*) DECLSPEC_HIDDEN
;
106 extern unsigned int CDECL
wrap_ber_first_element(void *, unsigned int *, char **) DECLSPEC_HIDDEN
;
107 extern int CDECL
wrap_ber_flatten(void *, struct bervalU
**) DECLSPEC_HIDDEN
;
108 extern void CDECL
wrap_ber_free(void *, int) DECLSPEC_HIDDEN
;
109 extern void * CDECL
wrap_ber_init(struct bervalU
*) DECLSPEC_HIDDEN
;
110 extern unsigned int CDECL
wrap_ber_next_element(void *, unsigned int *, char *) DECLSPEC_HIDDEN
;
111 extern unsigned int CDECL
wrap_ber_peek_tag(void *, unsigned int *) DECLSPEC_HIDDEN
;
112 extern unsigned int CDECL
wrap_ber_skip_tag(void *, unsigned int *) DECLSPEC_HIDDEN
;
113 extern int WINAPIV
wrap_ber_printf(void *, char *, ...) DECLSPEC_HIDDEN
;
114 extern int WINAPIV
wrap_ber_scanf(void *, char *, ...) DECLSPEC_HIDDEN
;
116 extern int CDECL
wrap_ldap_abandon_ext(void *, int, LDAPControlU
**, LDAPControlU
**) DECLSPEC_HIDDEN
;
117 extern int CDECL
wrap_ldap_add_ext(void *, const char *, LDAPModU
**, LDAPControlU
**, LDAPControlU
**,
118 ULONG
*) DECLSPEC_HIDDEN
;
119 extern int CDECL
wrap_ldap_add_ext_s(void *, const char *, LDAPModU
**, LDAPControlU
**,
120 LDAPControlU
**) DECLSPEC_HIDDEN
;
121 extern int CDECL
wrap_ldap_compare_ext(void *, const char *, const char *, struct bervalU
*, LDAPControlU
**,
122 LDAPControlU
**, ULONG
*) DECLSPEC_HIDDEN
;
123 extern int CDECL
wrap_ldap_compare_ext_s(void *, const char *, const char *, struct bervalU
*, LDAPControlU
**,
124 LDAPControlU
**) DECLSPEC_HIDDEN
;
125 extern void CDECL
wrap_ldap_control_free(LDAPControlU
*) DECLSPEC_HIDDEN
;
126 extern void CDECL
wrap_ldap_controls_free(LDAPControlU
**) DECLSPEC_HIDDEN
;
127 extern int CDECL
wrap_ldap_count_entries(void *, void *) DECLSPEC_HIDDEN
;
128 extern int CDECL
wrap_ldap_count_references(void *, void *) DECLSPEC_HIDDEN
;
129 extern int CDECL
wrap_ldap_count_values_len(struct bervalU
**) DECLSPEC_HIDDEN
;
130 extern int CDECL
wrap_ldap_create_sort_control(void *, LDAPSortKeyU
**, int, LDAPControlU
**) DECLSPEC_HIDDEN
;
131 extern int CDECL
wrap_ldap_create_vlv_control(void *, LDAPVLVInfoU
*, LDAPControlU
**) DECLSPEC_HIDDEN
;
132 extern int CDECL
wrap_ldap_delete_ext(void *, const char *, LDAPControlU
**, LDAPControlU
**, ULONG
*) DECLSPEC_HIDDEN
;
133 extern int CDECL
wrap_ldap_delete_ext_s(void *, const char *, LDAPControlU
**, LDAPControlU
**) DECLSPEC_HIDDEN
;
134 extern char * CDECL
wrap_ldap_dn2ufn(const char *) DECLSPEC_HIDDEN
;
135 extern char ** CDECL
wrap_ldap_explode_dn(const char *, int) DECLSPEC_HIDDEN
;
136 extern int CDECL
wrap_ldap_extended_operation(void *, const char *, struct bervalU
*, LDAPControlU
**,
137 LDAPControlU
**, ULONG
*) DECLSPEC_HIDDEN
;
138 extern int CDECL
wrap_ldap_extended_operation_s(void *, const char *, struct bervalU
*, LDAPControlU
**,
139 LDAPControlU
**, char **, struct bervalU
**) DECLSPEC_HIDDEN
;
140 extern char * CDECL
wrap_ldap_get_dn(void *, void *) DECLSPEC_HIDDEN
;
141 extern int CDECL
wrap_ldap_get_option(void *, int, void *) DECLSPEC_HIDDEN
;
142 extern struct bervalU
** CDECL
wrap_ldap_get_values_len(void *, void *, const char *) DECLSPEC_HIDDEN
;
143 extern int CDECL
wrap_ldap_initialize(void **, const char *) DECLSPEC_HIDDEN
;
144 extern char * CDECL
wrap_ldap_first_attribute(void *, void *, void **) DECLSPEC_HIDDEN
;
145 extern void * CDECL
wrap_ldap_first_entry(void *, void *) DECLSPEC_HIDDEN
;
146 extern void * CDECL
wrap_ldap_first_reference(void *, void *) DECLSPEC_HIDDEN
;
147 extern void CDECL
wrap_ldap_memfree(void *) DECLSPEC_HIDDEN
;
148 extern void CDECL
wrap_ldap_memvfree(void **) DECLSPEC_HIDDEN
;
149 extern int CDECL
wrap_ldap_modify_ext(void *, const char *, LDAPModU
**, LDAPControlU
**, LDAPControlU
**,
150 ULONG
*) DECLSPEC_HIDDEN
;
151 extern int CDECL
wrap_ldap_modify_ext_s(void *, const char *, LDAPModU
**, LDAPControlU
**,
152 LDAPControlU
**) DECLSPEC_HIDDEN
;
153 extern int CDECL
wrap_ldap_msgfree(void *) DECLSPEC_HIDDEN
;
154 extern char * CDECL
wrap_ldap_next_attribute(void *, void *, void *) DECLSPEC_HIDDEN
;
155 extern void * CDECL
wrap_ldap_next_entry(void *, void *) DECLSPEC_HIDDEN
;
156 extern void * CDECL
wrap_ldap_next_reference(void *, void *) DECLSPEC_HIDDEN
;
157 extern int CDECL
wrap_ldap_parse_extended_result(void *, void *, char **, struct bervalU
**, int) DECLSPEC_HIDDEN
;
158 extern int CDECL
wrap_ldap_parse_reference(void *, void *, char ***, LDAPControlU
***, int) DECLSPEC_HIDDEN
;
159 extern int CDECL
wrap_ldap_parse_result(void *, void *, int *, char **, char **, char ***, LDAPControlU
***,
160 int) DECLSPEC_HIDDEN
;
161 extern int CDECL
wrap_ldap_parse_sortresponse_control(void *, LDAPControlU
*, int *, char **) DECLSPEC_HIDDEN
;
162 extern int CDECL
wrap_ldap_parse_vlvresponse_control(void *, LDAPControlU
*, int *, int *, struct bervalU
**,
163 int *) DECLSPEC_HIDDEN
;
164 extern int CDECL
wrap_ldap_rename(void *, const char *, const char *, const char *, int, LDAPControlU
**,
165 LDAPControlU
**, ULONG
*) DECLSPEC_HIDDEN
;
166 extern int CDECL
wrap_ldap_rename_s(void *, const char *, const char *, const char *, int, LDAPControlU
**,
167 LDAPControlU
**) DECLSPEC_HIDDEN
;
168 extern int CDECL
wrap_ldap_result(void *, int, int, struct timevalU
*, void **) DECLSPEC_HIDDEN
;
169 extern int CDECL
wrap_ldap_sasl_bind(void *, const char *, const char *, struct bervalU
*, LDAPControlU
**,
170 LDAPControlU
**, int *) DECLSPEC_HIDDEN
;
171 extern int CDECL
wrap_ldap_sasl_bind_s(void *, const char *, const char *, struct bervalU
*, LDAPControlU
**,
172 LDAPControlU
**, struct bervalU
**) DECLSPEC_HIDDEN
;
173 extern int CDECL
wrap_ldap_sasl_interactive_bind_s(void *, const char *, const char *, LDAPControlU
**,
174 LDAPControlU
**, unsigned int, void *) DECLSPEC_HIDDEN
;
175 extern int CDECL
wrap_ldap_search_ext(void *, const char *, int, const char *, char **, int, LDAPControlU
**,
176 LDAPControlU
**, struct timevalU
*, int, ULONG
*) DECLSPEC_HIDDEN
;
177 extern int CDECL
wrap_ldap_search_ext_s(void *, const char *, int, const char *, char **, int, LDAPControlU
**,
178 LDAPControlU
**, struct timevalU
*, int, void **) DECLSPEC_HIDDEN
;
179 extern int CDECL
wrap_ldap_set_option(void *, int, const void *) DECLSPEC_HIDDEN
;
180 extern int CDECL
wrap_ldap_start_tls_s(void *, LDAPControlU
**, LDAPControlU
**) DECLSPEC_HIDDEN
;
181 extern int CDECL
wrap_ldap_unbind_ext(void *, LDAPControlU
**, LDAPControlU
**) DECLSPEC_HIDDEN
;
182 extern int CDECL
wrap_ldap_unbind_ext_s(void *, LDAPControlU
**, LDAPControlU
**) DECLSPEC_HIDDEN
;
183 extern void CDECL
wrap_ldap_value_free_len(struct bervalU
**) DECLSPEC_HIDDEN
;
187 void * (CDECL
*fn_ber_alloc_t
)(int);
188 void (CDECL
*fn_ber_bvecfree
)(struct bervalU
**);
189 void (CDECL
*fn_ber_bvfree
)(struct bervalU
*);
190 unsigned int (CDECL
*fn_ber_first_element
)(void *, unsigned int *, char **);
191 int (CDECL
*fn_ber_flatten
)(void *, struct bervalU
**);
192 void (CDECL
*fn_ber_free
)(void *, int);
193 void * (CDECL
*fn_ber_init
)(struct bervalU
*);
194 unsigned int (CDECL
*fn_ber_next_element
)(void *, unsigned int *, char *);
195 unsigned int (CDECL
*fn_ber_peek_tag
)(void *, unsigned int *);
196 unsigned int (CDECL
*fn_ber_skip_tag
)(void *, unsigned int *);
197 int (WINAPIV
*fn_ber_printf
)(void *, char *, ...);
198 int (WINAPIV
*fn_ber_scanf
)(void *, char *, ...);
200 int (CDECL
*fn_ldap_abandon_ext
)(void *, int, LDAPControlU
**, LDAPControlU
**);
201 int (CDECL
*fn_ldap_add_ext
)(void *, const char *, LDAPModU
**, LDAPControlU
**, LDAPControlU
**, ULONG
*);
202 int (CDECL
*fn_ldap_add_ext_s
)(void *, const char *, LDAPModU
**, LDAPControlU
**, LDAPControlU
**);
203 int (CDECL
*fn_ldap_compare_ext
)(void *, const char *, const char *, struct bervalU
*, LDAPControlU
**,
204 LDAPControlU
**, ULONG
*);
205 int (CDECL
*fn_ldap_compare_ext_s
)(void *, const char *, const char *, struct bervalU
*, LDAPControlU
**,
207 void (CDECL
*fn_ldap_control_free
)(LDAPControlU
*);
208 void (CDECL
*fn_ldap_controls_free
)(LDAPControlU
**);
209 int (CDECL
*fn_ldap_count_entries
)(void *, void *);
210 int (CDECL
*fn_ldap_count_references
)(void *, void *);
211 int (CDECL
*fn_ldap_count_values_len
)(struct bervalU
**);
212 int (CDECL
*fn_ldap_create_sort_control
)(void *, LDAPSortKeyU
**, int, LDAPControlU
**);
213 int (CDECL
*fn_ldap_create_vlv_control
)(void *, LDAPVLVInfoU
*, LDAPControlU
**);
214 int (CDECL
*fn_ldap_delete_ext
)(void *, const char *, LDAPControlU
**, LDAPControlU
**, ULONG
*);
215 int (CDECL
*fn_ldap_delete_ext_s
)(void *, const char *, LDAPControlU
**, LDAPControlU
**);
216 char * (CDECL
*fn_ldap_dn2ufn
)(const char *);
217 char ** (CDECL
*fn_ldap_explode_dn
)(const char *, int);
218 int (CDECL
*fn_ldap_extended_operation
)(void *, const char *, struct bervalU
*, LDAPControlU
**,
219 LDAPControlU
**, ULONG
*);
220 int (CDECL
*fn_ldap_extended_operation_s
)(void *, const char *, struct bervalU
*, LDAPControlU
**,
221 LDAPControlU
**, char **, struct bervalU
**);
222 char * (CDECL
*fn_ldap_get_dn
)(void *, void *);
223 int (CDECL
*fn_ldap_get_option
)(void *, int, void *);
224 struct bervalU
** (CDECL
*fn_ldap_get_values_len
)(void *, void *, const char *);
225 int (CDECL
*fn_ldap_initialize
)(void **, const char *);
226 char * (CDECL
*fn_ldap_first_attribute
)(void *, void *, void **);
227 void * (CDECL
*fn_ldap_first_entry
)(void *, void *);
228 void * (CDECL
*fn_ldap_first_reference
)(void *, void *);
229 void (CDECL
*fn_ldap_memfree
)(void *);
230 void (CDECL
*fn_ldap_memvfree
)(void **);
231 int (CDECL
*fn_ldap_modify_ext
)(void *, const char *, LDAPModU
**, LDAPControlU
**, LDAPControlU
**, ULONG
*);
232 int (CDECL
*fn_ldap_modify_ext_s
)(void *, const char *, LDAPModU
**, LDAPControlU
**, LDAPControlU
**);
233 int (CDECL
*fn_ldap_msgfree
)(void *);
234 char * (CDECL
*fn_ldap_next_attribute
)(void *, void *, void *);
235 void * (CDECL
*fn_ldap_next_entry
)(void *, void *);
236 void * (CDECL
*fn_ldap_next_reference
)(void *, void *);
237 int (CDECL
*fn_ldap_parse_extended_result
)(void *, void *, char **, struct bervalU
**, int);
238 int (CDECL
*fn_ldap_parse_reference
)(void *, void *, char ***, LDAPControlU
***, int);
239 int (CDECL
*fn_ldap_parse_result
)(void *, void *, int *, char **, char **, char ***, LDAPControlU
***, int);
240 int (CDECL
*fn_ldap_parse_sortresponse_control
)(void *, LDAPControlU
*, int *, char **);
241 int (CDECL
*fn_ldap_parse_vlvresponse_control
)(void *, LDAPControlU
*, int *, int *, struct bervalU
**, int *);
242 int (CDECL
*fn_ldap_rename
)(void *, const char *, const char *, const char *, int, LDAPControlU
**,
243 LDAPControlU
**, ULONG
*);
244 int (CDECL
*fn_ldap_rename_s
)(void *, const char *, const char *, const char *, int, LDAPControlU
**,
246 int (CDECL
*fn_ldap_result
)(void *, int, int, struct timevalU
*, void **);
247 int (CDECL
*fn_ldap_sasl_bind
)(void *, const char *, const char *, struct bervalU
*, LDAPControlU
**,
248 LDAPControlU
**, int *);
249 int (CDECL
*fn_ldap_sasl_bind_s
)(void *, const char *, const char *, struct bervalU
*, LDAPControlU
**,
250 LDAPControlU
**, struct bervalU
**);
251 int (CDECL
*fn_ldap_sasl_interactive_bind_s
)(void *, const char *, const char *, LDAPControlU
**,
252 LDAPControlU
**, unsigned int, void *);
253 int (CDECL
*fn_ldap_search_ext
)(void *, const char *, int, const char *, char **, int, LDAPControlU
**,
254 LDAPControlU
**, struct timevalU
*, int, ULONG
*);
255 int (CDECL
*fn_ldap_search_ext_s
)(void *, const char *, int, const char *, char **, int, LDAPControlU
**,
256 LDAPControlU
**, struct timevalU
*, int, void **);
257 int (CDECL
*fn_ldap_set_option
)(void *, int, const void *);
258 int (CDECL
*fn_ldap_start_tls_s
)(void *, LDAPControlU
**, LDAPControlU
**);
259 int (CDECL
*fn_ldap_unbind_ext
)(void *, LDAPControlU
**, LDAPControlU
**);
260 int (CDECL
*fn_ldap_unbind_ext_s
)(void *, LDAPControlU
**, LDAPControlU
**);
261 void (CDECL
*fn_ldap_value_free_len
)(struct bervalU
**);
264 extern int CDECL
sasl_interact_cb(void *, unsigned int, void *, void *) DECLSPEC_HIDDEN
;
266 struct ldap_callbacks
268 int (CDECL
*sasl_interact
)(void *, unsigned int, void *, void *);
271 extern const struct ldap_funcs
*ldap_funcs
;