1.lf 1 stdin 2.TH LDAP_PARSE_REFERENCE 3 "2020/04/28" "OpenLDAP 2.4.50" 3.\" $OpenLDAP$ 4.\" Copyright 1998-2020 The OpenLDAP Foundation All Rights Reserved. 5.\" Copying restrictions apply. See COPYRIGHT/LICENSE. 6.SH NAME 7ldap_parse_reference \- Extract referrals and controls from a reference message 8.SH LIBRARY 9OpenLDAP LDAP (libldap, \-lldap) 10.SH SYNOPSIS 11.nf 12.ft B 13#include <ldap.h> 14.LP 15.ft B 16int ldap_parse_reference( LDAP *ld, LDAPMessage *reference, 17 char ***referralsp, LDAPControl ***serverctrlsp, 18 int freeit ) 19.SH DESCRIPTION 20.LP 21The 22.B ldap_parse_reference() 23routine is used to extract referrals and controls from a reference message. 24The \fIreference\fP parameter is a reference message as returned by a 25call to 26.BR ldap_first_reference (3) , 27.BR ldap_next_reference (3) , 28.BR ldap_first_message (3) , 29.BR ldap_next_message (3) , 30or 31.BR ldap_result (3) . 32.LP 33The \fIreferralsp\fP parameter will be filled in with an allocated array of 34character strings. The strings are copies of the referrals contained in 35the parsed message. The array should be freed by calling 36.BR ldap_value_free (3) . 37If \fIreferralsp\fP is NULL, no referrals are returned. 38If no referrals were returned, \fI*referralsp\fP is set to NULL. 39.LP 40The \fIserverctrlsp\fP parameter will be filled in with an allocated array of 41controls copied from the parsed message. The array should be freed by calling 42.BR ldap_controls_free (3). 43If \fIserverctrlsp\fP is NULL, no controls are returned. 44If no controls were returned, \fI*serverctrlsp\fP is set to NULL. 45.LP 46The \fIfreeit\fP parameter determines whether the parsed message is 47freed or not after the extraction. Any non-zero value will make it 48free the message. The 49.BR ldap_msgfree (3) 50routine can also be used to free the message later. 51.SH ERRORS 52Upon success LDAP_SUCCESS is returned. Otherwise the values of the 53\fIreferralsp\fP and \fIserverctrlsp\fP parameters are undefined. 54.SH SEE ALSO 55.BR ldap (3), 56.BR ldap_first_reference (3), 57.BR ldap_first_message (3), 58.BR ldap_result (3), 59.BR ldap_get_values (3), 60.BR ldap_controls_free (3) 61.SH ACKNOWLEDGEMENTS 62.lf 1 ./../Project 63.\" Shared Project Acknowledgement Text 64.B "OpenLDAP Software" 65is developed and maintained by The OpenLDAP Project <http://www.openldap.org/>. 66.B "OpenLDAP Software" 67is derived from the University of Michigan LDAP 3.3 Release. 68.lf 62 stdin 69