LDAPAD(3) LDAPAD(3)
NAME
ldapadd, ldapadds, ldapaddext, ldapaddexts - Perform an LDAP
add operation
LIBRARY
OpenLDAP LDAP (libldap, -lldap)
SYNOPSIS
##include <>
int ldapadd(LDAP **ld,, const char **dn,, LDAPod **attrs[]);;
int ldapadds(LDAP **ld,, const char **dn,, LDAPod **attrs[]);;
int ldapaddext(LDAP **ld,, const char **dn,, LDAPod **attrs[],,
LDAPControl **sctrls[],, LDAPControl **cctrls[],, int **msgidp);;
int ldapaddexts(LDAP **ld,, const char **dn,, LDAPod **attrs[],,
LDAPControl **sctrls[],, LDAPControl **cctrls[]);;
DESCRIPTION
The ldapadds() routine is used to perform an LDAP add operation. It
takes dn, the DN of the entry to add, and attrs, a null-terminated
array of the entry's attributes. The LDAPMod structure is used to rep-
resent attributes, with the modtype and modvalues fields being used
as described under ldapmodify(3), and the ldapop field being used
only if you need to specify the LDAPMODBVALUES option. Otherwise, it
should be set to zero.
Note that all entries except that specified by the last component in
the given DN must already exist. ldapadds() returns an LDAP error
code indicating success or failure of the operation. See ldaperror(3)
for more details.
The ldapadd() routine works just like ldapadds(), but it is asyn-
chronous. It returns the message id of the request it initiated. The
result of this operation can be obtained by calling ldapresult(3).
The ldapaddext() routine allows server and client controls to be
specified to extend the add request. This routine is asynchronous like
ldapadd(), but its return value is an LDAP error code. It stores the
message id of the request in the integer pointed to by msgidp.
The ldapaddexts() routine is the synchronous version of
ldapaddext(). It also returns an LDAP error code indicating success
or failure of the operation.
ERORS
ldapadd() returns -1 in case of error initiating the request, and will
set the lderrno field in the ld parameter to indicate the error.
ldapadds() will return an LDAP error code directly (LDAPSUCES if
everything went ok, some error otherwise). ldapaddext() and
ldapaddexts() also directly return LDAP error codes.
SEE ALSO
ldap(3), ldapmodify(3)
ACKNOWLEDGEMENTS
OpenLDAP is developed and maintained by The OpenLDAP Project
(http:/www.openldap.org/). OpenLDAP is derived from University of
Michigan LDAP 3.3 Release.
OpenLDAP 2.2.19 2004/11/26 LDAPAD(3)
|