#include <ldap.h>
LDAP *ldap_open(
char *host,
int port)
|
The ldap_open() function opens a connection to an LDAP server and allocates an LDAP structure, which is used to identify the connection and to maintain per-connection information.
The ldap_open() 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_open() 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.
As a rule of thumb, the LDAP application is typically running as LDAP V2 when it uses ldap_open() to create the LDAP connection. The LDAP application is typically running as LDAP V3 when it uses ldap_init() to create the LDAP connection. However, it was possible with the LDAP V2 API to call ldap_init() so that there may be cases where this rule of thumb is not true.
No OS/400 authority is required. All authority checking is done by the LDAP server.
ldap_open() 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_open API.
ldap_init() -- Initializes a session with an LDAP server.
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] |