The LDAP toolkit has been enhanced to support both LDAP Version 2 and LDAP Version 3 APIs and protocols. The LDAP toolkit APIs and protocols are based on the Internet Draft, which is classified as a "work in progress."
The LDAP APIs provide typical directory functions such as read, write, and search. With the advent of support for LDAP Version 3 APIs and protocols, the following features are also supported:
In general, the connection-associated LDAP Version 3 APIs ( APIs that have ld as one of their parameters ) are designed to accept and return string data in either UTF-8 encoded format or in the local code page format, depending on the LDAP_OPT_UTF8_IO option value set using the ldap_set_option() API to LDAP_UTF8_XLATE_ON (the default) or LDAP_UTF8_XLATE_OFF.
The following LDAP APIs (and related APIs) accept and return UTF-8 encoded string data when the LDAP_OPT_UTF8_IO option is set to LDAP_UTF8_XLATE_OFF. Otherwise, they accept or return string data in the local code page (the default).
APIs that are NOT associated with a connection (APIs that
do not have ld as one of their parameters),
always expect and return string data (DNs, for example) in local code page.
The following LDAP APIs (and related APIs) will accept and return string data
in the local code page.
As a non-standard extension to the API set on i5/OS(TM) only, two APIs have been added that allow input of string data in UTF8. These are:
The LDAP API also supports a client-side extension mechanism, which can be used to define client controls. The client-side controls affect the behavior of the LDAP client library, and are never sent to the server. Note that client-side controls are not defined for this client library.
A common data structure is used to represent both server-side and client-side controls:
typedef struct ldapcontrol { char *ldctl_oid; struct berval ldctl_value; char ldctl_iscritical; } LDAPControl, *PLDAPControl;
The LDAPControl fields have the following definitions:
If using any of the ber_xxx functions to set up the berval structure, you must specify QSYS/QGLDBRDR as one of the the bind service programs when creating the program.
With this toolkit, an application that uses the ldap_open API defaults to the LDAP V2 protocol. In this way, existing LDAP applications will continue to work, and can interoperate with both LDAP V2 servers and LDAP V3 servers.
An application that uses the ldap_init API defaults to the LDAP V3 protocol (with optional bind). An LDAP V3 application will not necessarily interoperate with an LDAP server that supports only LDAP V2 protocols.
An application can use the ldap_set_option API to change its LDAP protocol version. This should be done after using ldap_open or ldap_init but before issuing a bind or other operation that results in contacting the server.
Top | Directory Server APIs | APIs by category |