#include <ldap.h>
int ldap_add_ext( LDAP *ld, const char *dn, LDAPMod **attrs,
LDAPControl **serverctrls, LDAPControl **clientctrls,
int *msgidp );
ld |
Connection handle, which is a pointer to an |
dn | |
attrs |
Pointer to a NULL-terminated array of pointers to |
serverctrls |
Pointer to an array of |
clientctrls |
Pointer to an array of |
msgidp |
Pointer to an integer that will be set to the message ID of the LDAP operation. To check the result of this operation, call |
LDAP_SUCCESS if successful. LDAP_PARAM_ERROR if any of the arguments are invalid. LDAP_ENCODING_ERROR if an error occurred when BER-encoding the request. LDAP_SERVER_DOWN if the LDAP server did not receive the request or if the connection to the server was lost. LDAP_NO_MEMORY if memory cannot be allocated. LDAP_NOT_SUPPORTED if controls are included in your request (for example, as a session preference) and your LDAP client does not specify that it is using the LDAP v3 protocol. Make sure that you set the version of your LDAP client to version 3 before calling this function. (For details, see "Specifying the LDAP Version of Your Client" on page 54.) ldap_add_ext() adds a new entry to the directory asynchronously.
This function is a new version of the ldap_add() function. If you are writing a new LDAP client, you should call this function instead of ldap_add().
To add a new entry to the directory, you need to specify the following information:
dn argument to specify the DN of the new entry. Note that the parents of the entry should already exist. For example, if you are adding the entry uid=bjensen, ou=People, o=Airius.com, the entries ou=People, o=Airius.com and o=Airius.com should already exist in the directory. LDAPMod structure for each attribute. Set the mod_op field to 0 if the attribute values are string values. To specify values that consist of binary data (such as a sound file or a JPEG file), set the mod_op field to LDAP_MOD_BVALUES.
Create an array of these LDAPMod structures and pass the array as the attrs argument. ldap_add_ext() is an asynchronous function; it does not directly return results. If you want the results to be returned directly by the function, call the synchronous function ldap_add_ext_s() instead. (For more information on asynchronous and synchronous functions, see "Calling Synchronous and Asynchronous Functions" on page 80.)
In order to get the results of the LDAP add operation, you need to call the ldap_result() function and the ldap_parse_result() function. (See "Calling Asynchronous Functions" on page 82 for details.) For a list of possible result codes for an LDAP add operation, see the result code documentation for the ldap_add_ext_s() function.
For additional information on adding new entries to the directory, see "Adding a New Entry" on page 170.
ldap_add_ext_s(), ldap_result(), ldap_parse_result(), LDAPMod.
Last Updated: 10/01/98 17:06:23