#include <lber.h> #include <ldap.h>int ldap_add(LDAP
ld, char
dn, LDAPMod
attrs[]);
int ldap_add_s(LDAP
ld, char
dn, LDAPMod
attrs[]);
mod_type
and mod_values
fields being used as described
on the
ldapmod(4ldap)
manual page, and the ldap_op
field being used only if you need to
specify the LDAP_MOD_BVALUES option. If not, it should be set
to zero.
Note that all entries except that specified by the last component in the given DN must already exist. ldap_add_s returns an LDAP error code indicating success or failure of the operation. See ldap_perror(3ldap) for more details.
The ldap_add routine works just like ldap_add_s, but is asynchronous. It returns the message ID of the request it initiated. The result of this operation can be obtained by calling ldap_result(3ldap).