LDAP_FIRST_REFERENCE(3)
π
LDAP_FIRST_REFERENCE(3) π
πΈ NAME πΈ
ldap_first_reference, ldap_next_reference, ldap_count_references β Stepping through continuation references in a result chain
π LIBRARY π
OpenLDAP LDAP (libldap, -lldap) β yes bestie, that's the one π
π§Ύ SYNOPSIS π§Ύ
#include <ldap.h>
int ldap_count_references( LDAP *ld, LDAPMessage *result )
LDAPMessage *ldap_first_reference( LDAP *ld, LDAPMessage *result )
LDAPMessage *ldap_next_reference( LDAP *ld, LDAPMessage *reference )
β¨ DESCRIPTION β¨
okay so these routines are literally your tour guides through the continuation references in a result chain that you got from ldap_result(3) or the synchronous LDAP search operation routines. Slay π
ldap_first_reference() is your main character for grabbing the first reference message in a result chain. You hand it the result that came back from a call to ldap_result(3), ldap_search_s(3), or ldap_search_st(3), and it gives you back a pointer to the first reference message in the result chain. Periodt β¨
Then you take that pointer and pass it into the next call to ldap_next_reference() to get the next reference message. Pass that result into the next call to ldap_next_reference(), and keep going, etc. π«Ά ldap_next_reference() will return NULL when there are no more reference messages. The reference messages returned from these calls are used by ldap_parse_reference(3) to extract referrals and controls. iykyk π₯
Wanna know how many reference messages are in the search result? Call ldap_count_references() and boom, you got a count. It can also be used to count the number of reference messages remaining in a result chain. No cap π―
π ERRORS π
If an error occurs in ldap_first_reference() or ldap_next_reference(), NULL is returned. If an error occurs in ldap_count_references(), -1 is returned. Not the vibe, but at least you know π
π SEE ALSO π
π«Ά 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. Iconic behavior honestly π
OpenLDAP 2.6.16 Β· 2026/10/21 Β· LDAP_FIRST_REFERENCE(3) β mwah, love u, bye bestie πβ¨
π¦ where this page comes from
- fedora 44: openldap-devel 2.6.16-1.fc44 Β· OLDAP-2.8
- fedora 44: openldap-devel 2.6.16-1.fc44 Β· OLDAP-2.8
- Copyright 1998-2026 The OpenLDAP Foundation All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms