/* ldap-int.h - defines & prototypes internal to the LDAP library */
/* $OpenLDAP$ */
/*
- * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
/* Portions
LDAPRequest *ld_requests; /* list of outstanding requests */
LDAPMessage *ld_responses; /* list of outstanding responses */
+#ifdef LDAP_R_COMPILE
+ ldap_pvt_thread_mutex_t ld_req_mutex;
+ ldap_pvt_thread_mutex_t ld_res_mutex;
+#endif
+
ber_int_t *ld_abandoned; /* array of abandoned requests */
LDAPCache *ld_cache; /* non-null if cache is initialized */
#endif
#endif
+#ifdef LDAP_R_COMPILE
+#define LDAP_NEXT_MSGID(ld, id) \
+ ldap_pvt_thread_mutex_lock( &(ld)->ld_req_mutex ); \
+ id = ++(ld)->ld_msgid; \
+ ldap_pvt_thread_mutex_unlock( &(ld)->ld_req_mutex )
+#else
+#define LDAP_NEXT_MSGID(ld, id) id = ++(ld)->ld_msgid
+#endif
+
/*
* in init.c
*/
/* memory.c */
/* simple macros to realloc for now */
-#define LDAP_MALLOC(s) (LBER_MALLOC((s)))
-#define LDAP_CALLOC(n,s) (LBER_CALLOC((n),(s)))
-#define LDAP_REALLOC(p,s) (LBER_REALLOC((p),(s)))
-#define LDAP_FREE(p) (LBER_FREE((p)))
-#define LDAP_VFREE(v) (LBER_VFREE((void **)(v)))
-#define LDAP_STRDUP(s) (LBER_STRDUP((s)))
-#define LDAP_STRNDUP(s,l) (LBER_STRNDUP((s),(l)))
+#define LDAP_MALLOC(s) (ber_memalloc_x((s),NULL))
+#define LDAP_CALLOC(n,s) (ber_memcalloc_x((n),(s),NULL))
+#define LDAP_REALLOC(p,s) (ber_memrealloc_x((p),(s),NULL))
+#define LDAP_FREE(p) (ber_memfree_x((p),NULL))
+#define LDAP_VFREE(v) (ber_memvfree_x((void **)(v),NULL))
+#define LDAP_STRDUP(s) (ber_strdup_x((s),NULL))
+#define LDAP_STRNDUP(s,l) (ber_strndup_x((s),(l),NULL))
+
+#define LDAP_MALLOCX(s,x) (ber_memalloc_x((s),(x)))
+#define LDAP_CALLOCX(n,s,x) (ber_memcalloc_x((n),(s),(x)))
+#define LDAP_REALLOCX(p,s,x) (ber_memrealloc_x((p),(s),(x)))
+#define LDAP_FREEX(p,x) (ber_memfree_x((p),(x)))
+#define LDAP_VFREEX(v,x) (ber_memvfree_x((void **)(v),(x)))
+#define LDAP_STRDUPX(s,x) (ber_strdup_x((s),(x)))
+#define LDAP_STRNDUPX(s,l,x) (ber_strndup_x((s),(l),(x)))
/*
* in error.c
* in os-ip.c
*/
LDAP_V (int) ldap_int_tblsize;
-LDAP_F (int) ldap_int_timeval_dup( struct timeval **dest, const struct timeval *tm );
+LDAP_F (int) ldap_int_timeval_dup( struct timeval **dest,
+ const struct timeval *tm );
LDAP_F (int) ldap_connect_to_host( LDAP *ld, Sockbuf *sb,
- int proto, const char *host, unsigned long address, int port,
- int async );
+ int proto, const char *host, int port, int async );
#if defined(LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND) || \
defined(HAVE_TLS) || defined(HAVE_CYRUS_SASL)
LDAP_V (char *) ldap_int_hostname;
-LDAP_F (char *) ldap_host_connected_to( Sockbuf *sb );
+LDAP_F (char *) ldap_host_connected_to( Sockbuf *sb,
+ const char *host );
#endif
LDAP_F (void) ldap_int_ip_init( void );
* in request.c
*/
LDAP_F (ber_int_t) ldap_send_initial_request( LDAP *ld, ber_tag_t msgtype,
- const char *dn, BerElement *ber );
+ const char *dn, BerElement *ber, ber_int_t msgid );
LDAP_F (BerElement *) ldap_alloc_ber_with_options( LDAP *ld );
LDAP_F (void) ldap_set_ber_options( LDAP *ld, BerElement *ber );
LDAPControl **sctrls,
LDAPControl **cctrls,
ber_int_t timelimit,
- ber_int_t sizelimit ));
+ ber_int_t sizelimit,
+ ber_int_t *msgidp));
/*
LDAPURLDesc **ludlist,
const char *url ));
+LDAP_F (int) ldap_url_parselist_ext LDAP_P((
+ LDAPURLDesc **ludlist,
+ const char *url,
+ const char *sep ));
+
LDAP_F (int) ldap_url_parsehosts LDAP_P((
LDAPURLDesc **ludlist,
const char *hosts,