ldap_add()--Perform an LDAP Add Operation


  Syntax
 #include <ldap.h>
 
 int ldap_add(
         LDAP           *ld,
         const char     *dn,
         LDAPMod        **attrs)

  Library Name/Service Program: QSYS/QGLDCLNT

  Default Public Authority: *USE

  Threadsafe: Yes

The ldap_add() function is used to perform an LDAP add operation.


Authorities and Locks

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


Parameters

ld
(Input) The LDAP pointer returned by a previous call to ldap_init(), ldap_ssl_init(), or ldap_open().

dn
(Input) The DN of the entry to add.

attrs
(Input) The entry's attributes, specified using the LDAPMod structure, as defined for ldap_modify(). The mod_type and mod_vals fields should be filled in. The mod_op field is ignored unless ORed with the constant LDAP_MOD_BVALUES. In this case, the mod_op field is used to select the mod_bvalues case of the mod_vals union.

Return Value

Message ID of the operation initiated
if the request was successfully sent. A subsequent call to ldap_result(), can be used to obtain the result of the operation.

-1
if the request was not successful.

Error Conditions

If ldap_add() is not successful, ld_errno will be set to indicate the error. See LDAP Client API Error Conditions for possible LDAP error code values and ldap_get_errno() function to retrieve the error information.


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_add API.


Related Information



API introduced: V4R3

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