#include <eim.h> int eimGetVersion(EimHostInfo * hostInfo, enum EimVersion * version, EimRC * eimrc)Service Program Name: QSYS/QSYEIM
The eimGetVersion() function returns the EIM version supported by the local EIM APIs for the specified EIM host.
For EIM_HANDLE (0) host type, the hostInfo field must contain an EIM handle returned by a previous call to eimCreateHandle() and eimConnect().
For EIM_LDAP_URL (1) host type, the hostInfo field must contain a uniform resource locator (URL) that contains the EIM host information. A NULL value for the ldapURL field indicates that the ldap URL information set by the eimSetConfiguration() API should be used. This URL has the following format:
ldap://host:port/dn or ldaps://host:port
where:
Examples:
The structure layouts follow:
enum EimHostInfoType { EIM_HANDLE, EIM_LDAP_URL }; typedef struct EimHostInfo { enum EimHostInfoType hostType; union { EimHandle * eim; char * ldapURL; } hostInfo; } EimHostInfo;
EIM_VERSION_0 (0) | EIM is not supported on the specified host. |
EIM_VERSION_1 (1) | EIM version 1 is supported by the local EIM APIs for the specified host. This host supports EIM functionality provided with the first version of the EIM APIs . |
EIM_VERSION_2 (2) | EIM version 2 is supported by the local EIM APIs for the specified host. This host supports EIM functionality provided with the second version of the EIM APIs, which includes policy association support. |
EIM_VERSION_3 (3) | EIM version 3 is supported by the local EIM APIs for the specified host. This host supports EIM functionality provided with the third version of the EIM APIs, which includes credentials and group registries. |
The return value from the API. Following each return value is the list of possible values for the messageCatalogMessageID field in the eimrc parameter for that value.
EIMERR_NOLOCK (26) | Unable to allocate internal system object. |
EIMERR_HANDLE_INVAL (17) | EimHandle is not valid. |
EIMERR_PARM_REQ (34) | Missing required parameter. Please check API documentation. |
EIMERR_PTR_INVAL (35) | Pointer parameter is not valid. |
EIMERR_URL_NOHOST (47) | URL does not have a host. |
EIMERR_URL_NOTLDAP (49) | URL does not begin with ldap. |
EIMERR_TYPE_INVAL (69) | The specified type is not valid. |
EIMERR_NOMEM (27) | No memory available. Unable to allocate required space. |
EIMERR_NOT_CONN (31) | Not connected to LDAP. Use eimConnect() API and try the request again. |
EIMERR_LDAP_ERR (23) | Unexpected LDAP error. %s |
EIMERR_UNKNOWN (44) | Unknown error or unknown system state. |
EIMERR_LDAP_SCHEMA_NOT_FOUND (71) | Unable to find LDAP schema. |
See Code disclaimer information for information pertaining to code examples.
The following example gets the version supported by the local EIM APIs for the EIM host.
#include <eim.h> #include <stdio.h> int main(int argc, char *argv[]) { int rc; char eimerr[100]; EimRC * err; EimHostInfo hostInfo; enum EimVersion version; /* Get eim handle from input arg. */ /* This handle is already connected to EIM. */ hostInfo.hostInfo.eim = (EimHandle *)argv[1]; hostInfo.hostType = EIM_HANDLE; /* Set up error structure. */ memset(eimerr,0x00,100); err = (EimRC *)eimerr; err->memoryProvidedByCaller = 100; /* Get the version */ if (0 != (rc = eimGetVersion(&hostInfo, &version, err))) { printf("Get Version error = %d", rc); return -1; } /* Print the version. */ printf("Version = %d", version); return 0; }
Top | Security APIs | APIs by category |