HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
“slapi_build_control_from_berval()”
ldap_control_free()
21.4 slapi_build_control_from_berval()
Description This function creates an LDAPControl structure based on a struct berval, an
OID, and a criticality flag. The LDAPControl that is created can be used in LDAP client requests
or internal operations.
Syntax
#include "slapi-plugin.h"
int slapi_build_control_from_berval( char *oid, struct berval
*bvp,char iscritical, LDAPControl **ctrlp );
Parameters This function takes the following parameters:
The OID (object identifier) for the control that is to be created.
oid
A struct berval that contains the control value. Pass NULL if the control has no
value.
bvp
The criticality flag. If nonzero, the control will be marked as critical. If 0, it will not be
marked as critical.
iscritical
Pointer that will receive the allocated LDAPControl structure.ctrlp
Returns This function returns LDAP_SUCCESS (LDAP result code) if successful.
Memory concerns The contents of the bvp parameter are consumed by this function. Because
of this, the caller should not free the bvp->bvval pointer after a successful call to this function
has been made.
The LDAPControl pointer that is returned in ctrlp should be freed by calling
ldap_control_free(), which is an LDAP API function; see the Mozilla LDAP SDK for C
Programmer's Guide.
See also
“slapi_build_control()”
“slapi_dup_control()”
ldap_control_free()
21.5 slapi_control_present()
Description Determines whether the specified object identification (OID) identifies a control
that is present in a list of controls.
Syntax
#include "slapi-plugin.h"
int slapi_control_present( LDAPControl **controls, char *oid,
struct berval **val, int *iscritical );
Parameters This function takes the following parameters:
List of controls that you want to check.
controls
OID of the control that you want to find.
oid
21.4 slapi_build_control_from_berval() 197