1LDAP_ADD(3)                Library Functions Manual                LDAP_ADD(3)
2
3
4

NAME

6       ldap_add,  ldap_add_s,  ldap_add_ext,  ldap_add_ext_s - Perform an LDAP
7       add operation
8

LIBRARY

10       OpenLDAP LDAP (libldap, -lldap)
11

SYNOPSIS

13       #include <ldap.h>
14
15       int ldap_add(LDAP *ld, const char *dn, LDAPMod *attrs[]);
16
17       int ldap_add_s(LDAP *ld, const char *dn, LDAPMod *attrs[]);
18
19       int ldap_add_ext(LDAP *ld, const char *dn, LDAPMod *attrs[],
20              LDAPControl *sctrls[], LDAPControl *cctrls[], int *msgidp);
21
22       int ldap_add_ext_s(LDAP *ld, const char *dn, LDAPMod *attrs[],
23              LDAPControl *sctrls[], LDAPControl *cctrls[]);
24

DESCRIPTION

26       The ldap_add_s() routine is used to perform an LDAP add operation.   It
27       takes  dn,  the  DN  of  the entry to add, and attrs, a null-terminated
28       array of the entry's attributes.  The LDAPMod structure is used to rep‐
29       resent  attributes,  with the mod_type and mod_values fields being used
30       as described under ldap_modify(3), and the  ldap_op  field  being  used
31       only  if you need to specify the LDAP_MOD_BVALUES option. Otherwise, it
32       should be set to zero.
33
34       Note that all entries except that specified by the  last  component  in
35       the  given  DN  must already exist.  ldap_add_s() returns an LDAP error
36       code indicating success or failure of the operation.  See ldap_error(3)
37       for more details.
38
39       The  ldap_add()  routine  works just like ldap_add_s(), but it is asyn‐
40       chronous.  It returns the message id of the request it initiated.   The
41       result of this operation can be obtained by calling ldap_result(3).
42
43       The  ldap_add_ext()  routine  allows  server  and client controls to be
44       specified to extend the add request. This routine is asynchronous  like
45       ldap_add(),  but its return value is an LDAP error code.  It stores the
46       message id of the request in the integer pointed to by msgidp.
47
48       The  ldap_add_ext_s()   routine   is   the   synchronous   version   of
49       ldap_add_ext().   It also returns an LDAP error code indicating success
50       or failure of the operation.
51

ERRORS

53       ldap_add() returns -1 in case of error initiating the request, and will
54       set  the  ld_errno  field  in  the  ld parameter to indicate the error.
55       ldap_add_s() will return an LDAP error code directly  (LDAP_SUCCESS  if
56       everything   went   ok,  some  error  otherwise).   ldap_add_ext()  and
57       ldap_add_ext_s() also directly return LDAP error codes.
58

SEE ALSO

60       ldap(3), ldap_modify(3)
61

ACKNOWLEDGEMENTS

63       OpenLDAP  is  developed  and  maintained  by   The   OpenLDAP   Project
64       (http://www.openldap.org/).   OpenLDAP  is  derived  from University of
65       Michigan LDAP 3.3 Release.
66
67
68
69OpenLDAP 2.3.34                    2007/2/16                       LDAP_ADD(3)
Impressum