#include <ldap.h>
LDAP *ldap_init(
char *host,
int port)
|
The ldap_init() function is used to allocate an LDAP structure, which is used to identify the connection and to maintain per-connection information.
The ldap_init() function returns a pointer to an LDAP structure, which should be passed to subsequent calls to other LDAP functions such as ldap_bind() and ldap_search().
ldap_init() initializes a session with an LDAP server. The server is not actually contacted until an operation is performed that requires it, allowing various options to be set after initialization, but before actually contacting the host. It allocates an LDAP structure which is used to identify the connection and maintain per-connection information. Although still supported, the use of ldap_open() is deprecated. The ldap_open() API allocates an LDAP structure and opens a connection to the LDAP server. Use of ldap_init() instead of ldap_open() is recommended.
No OS/400 authority is required. All authority checking is done by the LDAP server.
ldap_init() will return NULL and set the ld_errno error code, if not successful. See LDAP Client API Error Conditions for possible LDAP error codes values.
The following message may be set from this function.
CPF3CF2 E Error(s) occurred during running of ldap_init API.
ldap_open() -- Open a connection to an LDAP server (deprecated).
ldap_set_option() -- Set an option associated with an LDAP descriptor.
ldap_get_option() -- Get an option associated with an LDAP descriptor.
ldap_version() -- Obtain LDAP version and SSL cipher information.
|
Top
| LDAP APIs List APIs by category |
| [Information Center Home Page | Feedback ] | [Legal | AS/400 Glossary] |