ldap_parse_entrychange_control

Decodes the information returned from a search operation that used a persistent search control.

LDAP Version:v3
Library:*ldapsdk.*
NDS Version:8.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_entrychange_control (
     LDAP          *ld,
     LDAPControl   **ctls,
     int           *changeType,
     char          **prevDN,
     int           *hasChangeNum,
     long          *changeNum);
  
  

Parameters

ld

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

ctrls

(IN) A pointer to an array of pointers to controls returned by the server. The controls are obtained by calling the ldap_get_entry_controls() function on an entry returned by the server.

changeType

(OUT) A pointer to an integer specifying the type of change made to the entry. Valid flags are as follows:

LDAP_CHANGETYPE_ADD

Specifies that the entry was added to the directory.

LDAP_CHANGETYPE_DELETE

Specifies that the entry was deleted from the directory.

LDAP_CHANGETYPE_MODIFY

Specifies that the entry was modified.

LDAP_CHANGETYPE_MODDN

Specifies that the DN or RDN of the entry was changed (a modify RDN or modify DN operation was performed).

prevDN

(OUT) A pointer to the previous DN of the entry, if the changetypes argument is LDAP_CHANGETYPE_MODDN. (If the changetypes argument has a different value, this argument is set to NULL.)

When done, you should free this by calling the ldap_memfree function. This parameter is optional and can be set to NULL.

hasChangeNum

(OUT) A pointer to an integer specifying whether or not the change number is included in the control. A non-zero value indicates that the change number is included and is available as the changeNum argument. Zero indicates that the change number is not included. This parameter and the changeNum parameter must either both be NULL or both be non-NULL.

changeNum

(OUT) A pointer to the change number identifying the change made to the entry. This parameter and the hasChangeNum parameter must either both be NULL or both be non-NULL. Change numbers are typically only returned by servers that support a change log.

Return Values

0x00

LDAP_SUCCESS

0x53

LDAP_DECODING_ERROR

0x5A

LDAP_NO_MEMORY

Non-zero

Non-zero values indicate errors. See LDAP Return Codes.

Remarks

The ldap_parse_entrychange_control function examines the controls returned with and entry as a result of a persistent search operation. If an entry change control is present, the control is parsed and its elements' values are retrieved. This function should be called after an entry is returned to the client as a result of a persistent search operation. An entry’s controls are retrieved by calling the ldap_get_entry_controls function.

For example code, see searchPersist.c.

See Also

ldap_search_ext, ldap_get_entry_controls, ldap_create_persistentsearch_control