1LDAP_CONTROLS(3) Library Functions Manual LDAP_CONTROLS(3)
2
3
4
6 ldap_control_create, ldap_control_find, ldap_control_dup, ldap_con‐
7 trols_dup, ldap_control_free, ldap_controls_free - LDAP control manipu‐
8 lation routines
9
11 OpenLDAP LDAP (libldap, -lldap)
12
14 #include <ldap.h>
15
16 int ldap_control_create(const char *oid, int iscritical, struct berval
17 *value, int dupval, LDAPControl **ctrlp);
18
19 LDAPControl *ldap_control_find( const char *oid, LDAPControl **ctrls,
20 LDAPControl ***nextctrlp);
21
22 LDAPControl *ldap_control_dup(LDAPControl *ctrl);
23
24 LDAPControl **ldap_controls_dup(LDAPControl **ctrls);
25
26 void ldap_control_free(LDAPControl *ctrl);
27
28 void ldap_controls_free(LDAPControl **ctrls);
29
31 These routines are used to manipulate structures used for LDAP con‐
32 trols.
33
34 ldap_control_create() creates a control with the specified OID using
35 the contents of the value parameter for the control value, if any. The
36 content of value is duplicated if dupval is non-zero. The iscritical
37 parameter must be non-zero for a critical control. The created control
38 is returned in the ctrlp parameter. The routine returns LDAP_SUCCESS
39 on success or some other error code on failure. The content of value,
40 for supported control types, can be prepared using helpers provided by
41 this implementation of libldap, usually in the form ldap_create_<con‐
42 trol name>_control_value(). Otherwise, it can be BER-encoded using the
43 functionalities of liblber.
44
45 ldap_control_find() searches the NULL-terminated ctrls array for a con‐
46 trol whose OID matches the oid parameter. The routine returns a
47 pointer to the control if found, NULL otherwise. If the parameter
48 nextctrlp is not NULL, on return it will point to the next control in
49 the array, and can be passed to the ldap_control_find() routine for
50 subsequent calls, to find further occurrences of the same control type.
51 The use of this function is discouraged; the recommended way of han‐
52 dling controls in responses consists in going through the array of con‐
53 trols, dealing with each of them in the returned order, since it could
54 matter.
55
56 ldap_control_dup() duplicates an individual control structure, and
57 ldap_controls_dup() duplicates a NULL-terminated array of controls.
58
59 ldap_control_free() frees an individual control structure, and
60 ldap_controls_free() frees a NULL-terminated array of controls.
61
62
64 ldap(3), ldap_error(3)
65
67 OpenLDAP Software is developed and maintained by The OpenLDAP Project
68 <http://www.openldap.org/>. OpenLDAP Software is derived from the Uni‐
69 versity of Michigan LDAP 3.3 Release.
70
71
72
73OpenLDAP 2.4.57 2021/01/18 LDAP_CONTROLS(3)