2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 * Copyright 2001-2005 The OpenLDAP Foundation.
5 * Portions Copyright 2001-2003 Pierangelo Masarati.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
12 * A copy of this license is available in file LICENSE in the
13 * top-level directory of the distribution or, alternatively, at
14 * <http://www.OpenLDAP.org/license.html>.
17 * This work was initially developed by Pierangelo Masarati for inclusion
18 * in OpenLDAP Software.
21 #ifndef _PROTO_BACK_MONITOR
22 #define _PROTO_BACK_MONITOR
24 #include <ldap_cdefs.h>
32 monitor_subsys_backend_init LDAP_P((
34 monitor_subsys_t *ms ));
40 monitor_cache_cmp LDAP_P((
44 monitor_cache_dup LDAP_P((
48 monitor_cache_add LDAP_P((
52 monitor_cache_get LDAP_P((
57 monitor_cache_dn2entry LDAP_P((
64 monitor_cache_lock LDAP_P((
67 monitor_cache_release LDAP_P((
75 monitor_subsys_conn_init LDAP_P((
77 monitor_subsys_t *ms ));
79 monitor_subsys_conn_update LDAP_P((
84 monitor_subsys_conn_create LDAP_P((
95 monitor_subsys_database_init LDAP_P((
97 monitor_subsys_t *ms ));
99 monitor_subsys_database_modify LDAP_P((
108 monitor_entry_update LDAP_P((
113 monitor_entry_create LDAP_P((
120 monitor_entry_modify LDAP_P((
125 monitor_entry_test_flags LDAP_P((
128 extern monitor_entry_t *
129 monitor_entrypriv_create LDAP_P((
136 monitor_back_register_subsys LDAP_P((
137 monitor_subsys_t *ms ));
138 extern monitor_subsys_t *
139 monitor_back_get_subsys LDAP_P((
141 extern monitor_subsys_t *
142 monitor_back_get_subsys_by_dn LDAP_P((
146 monitor_back_register_entry LDAP_P((
148 monitor_callback_t *cb ));
150 monitor_back_register_entry_parent LDAP_P((
152 monitor_callback_t *cb,
155 struct berval *filter ));
157 monitor_filter2ndn LDAP_P((
160 struct berval *filter,
161 struct berval *ndn ));
163 monitor_back_register_entry_attrs LDAP_P((
166 monitor_callback_t *cb,
169 struct berval *filter ));
171 monitor_back_register_entry_callback LDAP_P((
173 monitor_callback_t *cb,
176 struct berval *filter ));
182 monitor_subsys_listener_init LDAP_P((
184 monitor_subsys_t *ms ));
190 monitor_subsys_log_init LDAP_P((
192 monitor_subsys_t *ms ));
194 monitor_subsys_log_modify LDAP_P((
203 monitor_subsys_ops_init LDAP_P((
205 monitor_subsys_t *ms ));
207 monitor_subsys_ops_update LDAP_P((
216 monitor_subsys_overlay_init LDAP_P((
218 monitor_subsys_t *ms ));
224 monitor_subsys_sent_init LDAP_P((
226 monitor_subsys_t *ms ));
228 monitor_subsys_sent_update LDAP_P((
237 monitor_subsys_thread_init LDAP_P((
239 monitor_subsys_t *ms ));
241 monitor_subsys_thread_update LDAP_P((
249 extern int monitor_subsys_time_init LDAP_P((
251 monitor_subsys_t *ms ));
253 monitor_subsys_time_update LDAP_P((
262 monitor_subsys_rww_init LDAP_P((
264 monitor_subsys_t *ms ));
266 monitor_subsys_rww_update LDAP_P((
271 /* NOTE: this macro assumes that bv has been allocated
272 * by ber_* malloc functions or is { 0L, NULL } */
273 #if defined(HAVE_BIGNUM)
274 #define UI2BV(bv,ui) \
278 val = BN_bn2dec(ui); \
281 if ( len > (bv)->bv_len ) { \
282 (bv)->bv_val = ber_memrealloc( (bv)->bv_val, len + 1 ); \
284 AC_MEMCPY((bv)->bv_val, val, len + 1); \
285 (bv)->bv_len = len; \
288 ber_memfree( (bv)->bv_val ); \
289 BER_BVZERO( (bv) ); \
292 #elif defined(HAVE_GMP)
293 /* NOTE: according to the documentation, the result
294 * of mpz_sizeinbase() can exceed the length of the
295 * string representation of the number by 1
297 #define UI2BV(bv,ui) \
299 ber_len_t len = mpz_sizeinbase( (ui), 10 ); \
300 if ( len > (bv)->bv_len ) { \
301 (bv)->bv_val = ber_memrealloc( (bv)->bv_val, len + 1 ); \
303 (void)mpz_get_str( (bv)->bv_val, 10, (ui) ); \
304 if ( (bv)->bv_val[ len - 1 ] == '\0' ) { \
307 (bv)->bv_len = len; \
309 #else /* ! HAVE_BIGNUM && ! HAVE_GMP */
310 #define UI2BV(bv,ui) \
312 char buf[] = "+9223372036854775807L"; \
314 snprintf( buf, sizeof( buf ), "%lu", (ui) ); \
315 len = strlen( buf ); \
316 if ( len > (bv)->bv_len ) { \
317 (bv)->bv_val = ber_memrealloc( (bv)->bv_val, len + 1 ); \
319 AC_MEMCPY( (bv)->bv_val, buf, len + 1 ); \
321 #endif /* ! HAVE_GMP */
327 extern BI_init monitor_back_initialize;
329 extern BI_db_init monitor_back_db_init;
330 extern BI_db_open monitor_back_db_open;
331 extern BI_config monitor_back_config;
332 extern BI_db_destroy monitor_back_db_destroy;
333 extern BI_db_config monitor_back_db_config;
335 extern BI_op_search monitor_back_search;
336 extern BI_op_compare monitor_back_compare;
337 extern BI_op_modify monitor_back_modify;
338 extern BI_op_bind monitor_back_bind;
339 extern BI_operational monitor_back_operational;
343 #endif /* _PROTO_BACK_MONITOR */