ldap_parse_reference(3)

ldap_parse_reference3

Extract referrals and controls from a reference message

Usage

#include <ldap.h>

int ldap_parse_reference( LDAP *ld, LDAPMessage *reference,
char ***referralsp, LDAPControl ***serverctrlsp,
int freeit )

Library

OpenLDAP LDAP (libldap, -lldap)

Overview

The ldap_parse_reference() routine is used to extract referrals and controls from a reference message. The reference parameter is a reference message as returned by a call to ldap_first_reference(3), ldap_next_reference(3), ldap_first_message(3), ldap_next_message(3), or ldap_result(3).

The referralsp parameter will be filled in with an allocated array of character strings. The strings are copies of the referrals contained in the parsed message. The array should be freed by calling ldap_memvfree(3). If referralsp is NULL, no referrals are returned. If no referrals were returned, *referralsp is set to NULL.

The serverctrlsp parameter will be filled in with an allocated array of controls copied from the parsed message. The array should be freed by calling ldap_controls_free(3). If serverctrlsp is NULL, no controls are returned. If no controls were returned, *serverctrlsp is set to NULL.

The freeit parameter determines whether the parsed message is freed or not after the extraction. Any non-zero value will make it free the message. The ldap_msgfree(3) routine can also be used to free the message later.

Errors

Upon success LDAP_SUCCESS is returned. Otherwise the values of the referralsp and serverctrlsp parameters are undefined.

Acknowledgements

OpenLDAP Software is developed and maintained by The OpenLDAP Project <http://www.openldap.org/>. OpenLDAP Software is derived from the University of Michigan LDAP 3.3 Release.

Releases

12 releases since Debian 3.1 (Sarge); the text changed 10 times.

  1. 3.1–4.0
  2. 5.0
  3. 6.0
  4. 7
  5. 8
  6. 9
  7. 10
  8. 11
  9. 12
  10. 13
  11. Arch

From libldap 2.7.2-2 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.