-BerElement *ldap_alloc_ber_with_options( LDAP *ld );
-void ldap_set_ber_options( LDAP *ld, BerElement *ber );
-
-#if defined( LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS ) \
- || defined( LDAP_API_FEATURE_X_OPENLDAP_V2_DNS )
-int ldap_send_server_request( LDAP *ld, BerElement *ber, int msgid,
- LDAPRequest *parentreq, LDAPServer *srvlist, LDAPConn *lc,
- int bind );
-LDAPConn *ldap_new_connection( LDAP *ld, LDAPServer **srvlistp, int use_ldsb,
- int connect, int bind );
-LDAPRequest *ldap_find_request_by_msgid( LDAP *ld, int msgid );
-void ldap_free_request( LDAP *ld, LDAPRequest *lr );
-void ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind );
-void ldap_dump_connection( LDAP *ld, LDAPConn *lconns, int all );
-void ldap_dump_requests_and_responses( LDAP *ld );
-#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS || LDAP_API_FEATURE_X_OPENLDAP_V2_DNS */
-
-#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
-int ldap_chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp );
-int ldap_append_referral( LDAP *ld, char **referralsp, char *s );
-#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */
+LDAP_F (BerElement *) ldap_alloc_ber_with_options( LDAP *ld );
+LDAP_F (void) ldap_set_ber_options( LDAP *ld, BerElement *ber );
+
+LDAP_F (int) ldap_send_server_request( LDAP *ld, BerElement *ber, ber_int_t msgid, LDAPRequest *parentreq, LDAPURLDesc *srvlist, LDAPConn *lc, LDAPreqinfo *bind );
+LDAP_F (LDAPConn *) ldap_new_connection( LDAP *ld, LDAPURLDesc *srvlist, int use_ldsb, int connect, LDAPreqinfo *bind );
+LDAP_F (LDAPRequest *) ldap_find_request_by_msgid( LDAP *ld, ber_int_t msgid );
+LDAP_F (void) ldap_free_request( LDAP *ld, LDAPRequest *lr );
+LDAP_F (void) ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind );
+LDAP_F (void) ldap_dump_connection( LDAP *ld, LDAPConn *lconns, int all );
+LDAP_F (void) ldap_dump_requests_and_responses( LDAP *ld );
+LDAP_F (int) ldap_chase_referrals( LDAP *ld, LDAPRequest *lr,
+ char **errstrp, int sref, int *hadrefp );
+LDAP_F (int) ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr,
+ char **refs, int sref, char **referralsp, int *hadrefp );
+LDAP_F (int) ldap_append_referral( LDAP *ld, char **referralsp, char *s );