ldap_extended_operation()--Perform extended operations.


  Syntax
 #include <ldap.h>
 
 int ldap_extended_operation(
             LDAP                 *ld,
             const char           *reqoid,
             const struct berval  *reqdata,
             LDAPControl         **serverctrls,
             LDAPControl         **clientctrls,
             int                  *msgidp)

  Default Public Authority: *USE

  Library Name/Service Program: QSYS/QGLDCLNT

  Threadsafe: Yes

The ldap_extended_operation() function is used to initiate an asynchronous extended operation, which returns LDAP_SUCCESS if the extended operation was successfully sent, or an LDAP error code if not. If successful, the ldap_extended_operation() API places the message id of the request in *msgid. A subsequent call to ldap_result() can be used to obtain the result of the extended operation, which can then be passed to ldap_parse_extended_result() to obtain the Object IDentifier (OID) and data contained in the response.

If the LDAP server does not support the extended operation, the server will reject the request. To determine if the requisite extended operation is supported by the server, get the rootDSE of the LDAP server, and check for the supportedExtension attribute. If the values for this attribute include the OID of your extended operation, then the server supports the extended operation. If the supportedExtension attribute is not present in the rootDSE, then the server is not configured to support any extended operations.


Authorities and Locks

No IBM® i authority is required. All authority checking is done by the LDAP server.


Parameters

ld
(Input) Specifies the LDAP pointer returned by a previous call to ldap_init(), ldap_ssl_init(), or ldap_open().
reqoid
(Input) Specifies the dotted-OID text string that identifies the extended operation to be performed by the server.
reqdata
(Input) Specifies the arbitrary data required by the extended operation (if NULL, no data is sent to the server).
serverctrls
(Input) Specifies a list of LDAP server controls. This parameter may be set to null. See Controls for LDAP APIs for more information about server controls.
clientctrls
(Input) Specifies a list of LDAP client controls. This parameter may be set to null. See Controls for LDAP APIs for more information about client controls.
msgidp
(Output) This result parameter is set to the message id of the request if the ldap_extended_operation() call succeeds.

Return Value

LDAP_SUCCESS
if the request was successful. ldap_extended_operation() places the message id of the request in *msgidp. To check the result of this operation, call ldap_result() and ldap_parse_extended_result() APIs. The server may also return an OID and result data.

another LDAP error code
if the request was not successful.


Error Conditions

If ldap_extended_operation() is not successful, will return a -1 instead of a valid msgid, setting the session error in the LD structure, which can be obtained by using ldap_get_errno().



Error Messages

The following message may be sent from this function.

Message ID Error Message Text
CPF3CF2 E Error(s) occurred during running of ldap_extended_operation API.


Related Information

The ldap_extended_operation() API supports LDAP V3 server controls and client controls.


API introduced: V5R1

[ Back to top | LDAP APIs | APIs by category ]