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
- ldap_add_ext() -- Asynchronously add an entry with controls.
- ldap_add_ext_s() -- Synchronously add an entry with controls.
- ldap_compare_ext() -- Asynchronous compare to a directory entry with controls.
- ldap_compare_ext_s() -- Synchronous compare to a directory entry with controls.
- ldap_delete_ext() -- Asynchronous delete an entry with controls.
- ldap_delete_ext_s() -- Synchronous delete an entry with controls.
- ldap_modify_ext() -- Asynchronously modify an entry with controls.
- ldap_modify_ext_s() -- Synchronously modify an entry with controls.
- ldap_parse_extended_result() -- Parse extended result.
- ldap_sasl_bind() -- Asynchronously bind to the directory using the Simple Authentication Security Layer (SASL).
- ldap_sasl_bind_s() -- Synchronously bind to the directory using the Simple Authentication Security Layer (SASL).
- ldap_search_ext() -- Asynchronously search the directory with controls.
- ldap_search_ext_s() -- Synchronously search the directory with controls.
- ldap_rename() -- Asynchronously rename an entry with controls.
- ldap_rename_s() -- Synchronously rename an entry with controls.
- ldap_unbind_ext() -- Unbind with controls.
The ldap_extended_operation() API supports LDAP V3 server controls and client controls.
API introduced: V5R1
[ Back to top | LDAP APIs | APIs by category ]