LDAP_OPT_REFERRALS
Use the LDAP_OPT_REFERRALS setting to specify whether the LDAP library automatically follows referrals that are returned by LDAP servers or not.
The API can be set to one of the constants LDAP_OPT_ON or LDAP_OPT_OFF. By default, the LDAP client follows referrals. For example:
int value;
ldap_set_option( ld, LDAP_OPT_REFFERALS, (void *)LDAP_OPT_ON);
ldap_get_option( ld, LDAP_OPT_REFFERALS, &value);