1LDAP_FIRST_REFERENCE(3)    Library Functions Manual    LDAP_FIRST_REFERENCE(3)
2
3
4

NAME

6       ldap_first_reference,   ldap_next_reference,   ldap_count_references  -
7       Stepping through continuation references in a result chain
8

LIBRARY

10       OpenLDAP LDAP (libldap, -lldap)
11

SYNOPSIS

13       #include <ldap.h>
14
15       int ldap_count_references( LDAP *ld, LDAPMessage *result )
16
17       LDAPMessage *ldap_first_reference( LDAP *ld, LDAPMessage *result )
18
19       LDAPMessage *ldap_next_reference( LDAP *ld, LDAPMessage *reference )
20

DESCRIPTION

22       These routines are used to step through the continuation references  in
23       a  result  chain  received  from ldap_result(3) or the synchronous LDAP
24       search operation routines.
25
26       The ldap_first_reference() routine is used to retrieve the first refer‐
27       ence  message  in a result chain.  It takes the result as returned by a
28       call to ldap_result(3), ldap_search_s(3) or ldap_search_st(3)  and  re‐
29       turns a pointer to the first reference message in the result chain.
30
31       This  pointer should be supplied on a subsequent call to ldap_next_ref‐
32       erence() to get the next reference message, the result of which  should
33       be   supplied   to   the   next  call  to  ldap_next_reference(),  etc.
34       ldap_next_reference() will return NULL when there are no more reference
35       messages.  The reference messages returned from these calls are used by
36       ldap_parse_reference(3) to extract referrals and controls.
37
38       A count of the number of reference messages in the search result can be
39       obtained  by  calling  ldap_count_references().  It can also be used to
40       count the number of reference messages remaining in a result chain.
41

ERRORS

43       If an error occurs in ldap_first_reference() or  ldap_next_reference(),
44       NULL is returned.  If an error occurs in ldap_count_references(), -1 is
45       returned.
46

SEE ALSO

48       ldap(3), ldap_result(3), ldap_search(3), ldap_parse_reference(3)
49

ACKNOWLEDGEMENTS

51       OpenLDAP Software is developed and maintained by The  OpenLDAP  Project
52       <http://www.openldap.org/>.  OpenLDAP Software is derived from the Uni‐
53       versity of Michigan LDAP 3.3 Release.
54
55
56
57OpenLDAP 2.6.2                    2022/05/04           LDAP_FIRST_REFERENCE(3)
Impressum