LDAP_OPT_API_INFO

Use the LDAP_OPT_API_INFO setting to return basic information about the API and the specific implementation that is used.

This setting is a read-only option. The ld parameter to ldap_get_option() can be either NULL or a valid LDAP session handle that is obtained by calling ldap_init(), ldap_ssl_init() or ldap_open(). The optdata parameter to ldap_get_option() must be the address of an LDAPAPIInfo structure, which is defined as follows:
   typedef struct ldapapiinfo {
       int  ldapai_info_version;        /* version of this struct (1) */
       int  ldapai_api_version;         /* revision of API supported */
       int  ldapai_protocol_version;    /* highest LDAP version supported */
       char **ldapai_extensions;        /* names of API extensions */
       const char *ldapai_vendor_name;  /* name of supplier */
       int  ldapai_vendor_version;      /* supplier-specific version times 100 */
   } LDAPAPIInfo;
Note: The ldapai_info_version field of the LDAPAPIInfo structure must be set to the value LDAP_API_INFO_VERSION before you call ldap_get_option() so that it can be checked for consistency. All other fields are set by the ldap_get_option() function.
The members of the LDAPAPIInfo structure are:
ldapai_info_version
A number that identifies the version of the LDAPAPIInfo structure. This member must be set to the value LDAP_API_INFO_VERSION before you call ldap_get_option(). If the value received is not recognized by the API implementation, the ldap_get_option() function sets ldapai_info_version to a valid value that can be recognized, sets ldapai_api_version to the correct value, and returns an error without supplying any of the other fields in the LDAPAPIInfo structure.
ldapai_api_version
A number that matches that assigned to the C LDAP API RFC supported by the API implementation. This number must match the value of the LDAP_API_VERSION define.
ldapai_protocol_version
The highest LDAP protocol version that is supported by the implementation. For example, if LDAP V3 is the highest version supported then this field is set to 3.
ldapai_extensions
A NULL-terminated array of character strings that lists the names of API extensions. The caller is responsible for disposing of the memory that is occupied by this array by passing it to ldap_value_free().