]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/ldap-int.h
Don't do (unsafe) DNS reverse lookups.
[openldap] / libraries / libldap / ldap-int.h
index ec0aa4883e4fdb8614d34873dcaa2efdfe3458e9..a6f940107cb7265adb074b2df14de63c9e6c8c74 100644 (file)
@@ -1,7 +1,7 @@
 /*  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
@@ -302,6 +302,11 @@ struct ldap {
        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 */
@@ -322,6 +327,15 @@ LDAP_V( ldap_pvt_thread_mutex_t ) ldap_int_sasl_mutex;
 #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
  */
@@ -334,13 +348,21 @@ LDAP_F ( void ) ldap_int_initialize_global_options LDAP_P((
 
 /* 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
@@ -411,15 +433,16 @@ LDAP_F (int) ldap_int_open_connection( LDAP *ld,
  * 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 );
@@ -444,7 +467,7 @@ LDAP_F (int) ldap_connect_to_path( LDAP *ld, Sockbuf *sb,
  * 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 );
 
@@ -480,7 +503,8 @@ LDAP_F (BerElement *) ldap_build_search_req LDAP_P((
        LDAPControl **sctrls,
        LDAPControl **cctrls,
        ber_int_t timelimit,
-       ber_int_t sizelimit ));
+       ber_int_t sizelimit,
+       ber_int_t *msgidp));
 
 
 /*
@@ -511,6 +535,11 @@ LDAP_F (int) ldap_url_parselist LDAP_P((
        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,