HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
Table 14-2 Front end API functions for LDAP Controls
Call this function:To perform this action:
slapi_add_control_ext()Append a control to the end of an array or to a new array.
slapi_add_controls()Append an array of controls to the end of an array or to
a new array.
“slapi_build_control()”
Create an LDAPControl structure based on a BerElement,
an OID, and a criticality flag. It returns an LDAP error
code.
“slapi_build_control_from_berval()”
Create an LDAPControl structure based on a struct
berval, an OID, and a criticality flag. It returns an LDAP
error code.
“slapi_control_present()”
Check for the presence of a specific LDAPControl. It
returns nonzero for presence and zero for absence.
“slapi_mod_get_ldapmod_passout()”
Retrieve the LDAPMod contained in a Slapi_Mod
structure.
“slapi_register_supported_control()”Register the specified control with the server. This
function associates the control with an object identification
(OID).
slapi_get_supported_controls_copy()Retrieve an allocated array of object identifiers (OIDs)
representing the controls supported by the Directory
Server.
Syntax This struct definition uses the following syntax:
typedef struct ldapcontrol {
char *ldctl_oid;
struct berval ldctl_value;
char ldctl_iscritical;
} LDAPControl;
Parameters This function has the following parameters:
Table 14-3 LDAPControl parameters
DescriptionField
Object ID (OID) of the control.
ldctl_oid
berval structure containing the value used by the control for the operation.ldctl_value
Specifies whether the control is critical to the operation. This field can have one of the
following values:
LDAP_OPT_ON specifies that the control is critical to the operation.
LDAP_OPT_OFF specifies that the control is not critical to the operation.
ldctl_iscritical
14.4 LDAPMod
Specifies changes to an attribute in a directory entry.
LDAPMod is a type of structure that specifies changes to an attribute in a directory entry. Before
you call the slapi_add_internal_pb() and slapi_modify_internal_pb() routines to
add or modify an entry in the directory, you need to fill LDAPMod structures with the attribute
values that you intend to add or change.
The following section of code sets up an LDAPMod structure to change the email address of a
user's entry to bab@example.com:
Slapi_PBlock *rcpb;
LDAPMod attribute1;
LDAPMod *list_of_attrs[2];
118 Data type and structure reference