eimGetVersion()--Get EIM Version


  Syntax
 #include <eim.h>

 int eimGetVersion(EimHostInfo             * hostInfo,
                   enum EimVersion         * version,
                   EimRC                   * eimrc)

 
  Service Program Name: QSYS/QSYEIM

  Default Public Authority: *USE

  Threadsafe: Yes

The eimGetVersion() function returns the EIM version supported by the local EIM APIs for the specified EIM host.


Authorities and Locks

None

Parameters

hostInfo (Input)
The structure that contains the EIM host information for which to return the EIM version supported by the local EIM APIs.

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;



version (Output)
The EIM version supported by the local EIM APIs for the specified host. Possible values are:

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.
Start of changeEIM_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. End of change


eimrc (Input/Output)
The structure in which to return error code information. If the return value is not 0, eimrc is set with additional information. This parameter may be NULL. For the format of the structure, see EimRC--EIM Return Code Parameter.

Return Value

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.

0
Request was successful.

EBADDATA
eimrc is not valid.

EBUSY
Unable to allocate internal system object.

EIMERR_NOLOCK (26) Unable to allocate internal system object.

EINVAL
Input parameter was not valid.

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.

ENOMEM
Unable to allocate required space.

EIMERR_NOMEM (27) No memory available. Unable to allocate required space.

ENOTCONN
LDAP connection has not been made.

EIMERR_NOT_CONN (31) Not connected to LDAP. Use eimConnect() API and try the request again.

EUNKNOWN
Unexpected exception.

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.

Example

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;
}



API introduced: V5R3
Top | Security APIs | APIs by category