LDAP Library Functions ldapadd(3LDAP)
NAME
ldapadd, ldapadds, ldapaddext, ldapaddexts - perform
an LDAP add operation
SYNOPSIS
cc[ flag... ] file... -lldap[ library... ]
#include
#include
intldapadd(LDAP *ld, char *dn, LDAPMod *attrs[]);
intldapadds(LDAP *ld, char *dn, LDAPMod *attrs[]);
int ldapaddext(LDAP *ld, char *dn, LDAPMod **attrs,
LDAPControl **serverctrls, int * msgidp);
int ldapaddexts(LDAP *ld, char *dn, LDAPMod **attrs,
LDAPControl **serverctrls, LDAPControl **clientctrls);
DESCRIPTION
The ldapadds() function 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 represent attributes, with
the modtype and modvalues fields being used as described
under ldapmodify(3LDAP), 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 com-
ponent in the given DN must already exist. ldapadds()
returns an LDAP error code indicating success or failure of
the operation. See ldaperror(3LDAP) for more details.
The ldapadd() function works just like ldapadds(), but it
is asynchronous. It returns the message id of the request
it initiated. The result of this operation can be obtained
by calling ldapresult(3LDAP).
The ldapaddext() function initiates an asynchronous add
operation and returns LDAPSUCES if the request was suc-
cessfully sent to the server, or else it returns a LDAP
error code if not (see ldaperror(3LDAP)). If successful,
ldapaddext() places the message id of *msgidp. A subse-
quent call to ldapresult(), can be used to obtain the
SunOS 5.11 Last change: 27 Jan 2002 1
LDAP Library Functions ldapadd(3LDAP)
result of the add request.
The ldapaddexts() function initiates a synchronous add
operation and returns the result of the operation itself.
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.
ATRIBUTES
See attributes(5) for a description of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Availability SUNWcsl (32-bit)
SUNWcslx (64-bit)
Interface Stability Evolving
SEE ALSO
ldap(3LDAP), ldaperror(3LDAP), ldapmodify(3LDAP), attri-
butes(5)
SunOS 5.11 Last change: 27 Jan 2002 2
|