ldap_parse_reference

Extracts URLs and controls from an LDAPMessage structure of type LDAP_RES_SEARCH_REFERENCE.

LDAP Version:v3
Library:*ldapsdk.*
NDS Version:7.xx or higher
Platform:NLM, Windows (NT, 95, 98, 2000, XP, Vista 32-bit and 64-bit ), Linux (32-bit and 64-bit), Solaris, AIX, and HP-UX

Syntax

  #include <ldap.h>
  
  int ldap_parse_reference (
     LDAP            *ld,
     LDAPMessage     *ref,
     char          ***referralsp,
     LDAPControl   ***serverctrlsp,
     int              freeit);
  
  

Parameters

ld

(IN) Points to the handle for the LDAP session.

ref

(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.

referralsp

(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.

serverctrlsp

(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.

freeit

(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.

Return Values

0x00

LDAP_SUCCESS

Non-zero

Failure. For a complete list, see LDAP Return Codes.

0x54

LDAP_DECODING_ERROR

0x59

LDAP_PARAM_ERROR

See Also

ldap_first_reference, ldap_next_reference