1ldap_add(3LDAP)             LDAP Library Functions             ldap_add(3LDAP)
2
3
4

NAME

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

SYNOPSIS

10       cc[ flag... ] file... -lldap[ library... ]
11       #include <lber.h>
12       #include <ldap.h>
13
14       intldap_add(LDAP *ld, char *dn, LDAPMod *attrs[]);
15
16
17       intldap_add_s(LDAP *ld, char *dn, LDAPMod *attrs[]);
18
19
20       int ldap_add_ext(LDAP *ld, char *dn, LDAPMod **attrs,
21            LDAPControl **serverctrls, int * msgidp);
22
23
24       int ldap_add_ext_s(LDAP *ld, char *dn, LDAPMod **attrs,
25            LDAPControl **serverctrls, LDAPControl **clientctrls);
26
27

DESCRIPTION

29       The ldap_add_s() function is used to perform an LDAP add operation.  It
30       takes  dn,  the  DN  of  the entry to add, and attrs, a null-terminated
31       array of the entry's attributes.  The LDAPMod structure is used to rep‐
32       resent  attributes,  with the mod_type and mod_values fields being used
33       as described under ldap_modify(3LDAP), and the ldap_op field being used
34       only if you need to specify the  LDAP_MOD_BVALUES option. Otherwise, it
35       should be set to zero.
36
37
38       Note that all entries except that specified by the  last  component  in
39       the  given  DN  must  already exist. ldap_add_s() returns an LDAP error
40       code  indicating  success   or   failure   of   the   operation.    See
41       ldap_error(3LDAP) for more details.
42
43
44       The  ldap_add()  function works just like ldap_add_s(), but it is asyn‐
45       chronous.  It returns the message id of the request it initiated.   The
46       result of this operation can be obtained by calling ldap_result(3LDAP).
47
48
49       The   ldap_add_ext()  function  initiates an asynchronous add operation
50       and  returns  LDAP_SUCCESS if the request was successfully sent to  the
51       server,    or   else   it  returns  a  LDAP  error  code  if  not  (see
52       ldap_error(3LDAP)). If successful,  ldap_add_ext() places  the  message
53       id  of  *msgidp.  A  subsequent  call to  ldap_result(), can be used to
54       obtain the result of the  add request.
55
56
57       The  ldap_add_ext_s() function initiates a  synchronous  add  operation
58       and returns the result of the operation itself.
59

ERRORS

61       ldap_add()  returns   −1  in  case of error initiating the request, and
62       will set the ld_errno field in the ld parameter to indicate the  error.
63       ldap_add_s() will return an LDAP error code directly.
64

ATTRIBUTES

66       See attributes(5) for a description of the following attributes:
67
68
69
70
71       ┌─────────────────────────────┬─────────────────────────────┐
72       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
73       │Availability                 │SUNWcsl (32-bit)             │
74       │                             │SUNWcslx (64-bit)            │
75       │Interface Stability          │Evolving                     │
76       └─────────────────────────────┴─────────────────────────────┘
77

SEE ALSO

79       ldap(3LDAP), ldap_error(3LDAP), ldap_modify(3LDAP), attributes(5)
80
81
82
83SunOS 5.11                        27 Jan 2002                  ldap_add(3LDAP)
Impressum