Extracts URLs and controls from an LDAPMessage structure of type LDAP_RES_SEARCH_REFERENCE.
#include <ldap.h>
int ldap_parse_reference (
LDAP *ld,
LDAPMessage *ref,
char ***referralsp,
LDAPControl ***serverctrlsp,
int freeit);
(IN) Points to the handle for the LDAP session.
(IN) Points to the reference to parse which was returned by the ldap_result, ldap_first_reference, ldap_next_reference, ldap_first_message, or ldap_next_message function.
(OUT) Points to a NULL-terminated array of strings which contains zero or more alternate LDAP server URLs where the request can be sent. Pass in NULL to ignore this parameter. When you are finished, free the referrals array by calling the ldap_value_free function.
(OUT) Points to aa NULL-terminated array of LDAPControl structures which are returned by the LDAP server and which list the controls the LDAP server supports. When you are finished, free the control array by calling the ldap_controls_free function. Pass in NULL to ignore this parameter.
(IN) Specifies whether the resources specified by the ref parameter are freed.
Zero indicates that the resources specified by the res parameter are not freed automatically. When you are done with the LDAPMessage structure, you must call the ldap_msgfree function to free the memory.
Non-zero indicates that memory is freed by the ldap_parse_reference function after it extracts the information.
|
0x00 |
LDAP_SUCCESS |
|
Non-zero |
Failure. For a complete list, see |
|
0x54 |
LDAP_DECODING_ERROR |
|
0x59 |
LDAP_PARAM_ERROR |