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:

  • host:port is the name of the host on which the EIM domain controller is running with an optional port number.
  • dn is the distinguished name of the domain to work with (optional).
  • ldaps indicates that this host/port combination uses SSL and TLS.

Examples:

  • ldap://systemx:389/ibm-eimDomainName=myEimDomain,o=myCompany,c=us
  • ldaps://systemy:636/ibm-eimDomainName=thisEimDomain


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:


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.


EINVAL
Input parameter was not valid.


ENOMEM
Unable to allocate required space.


ENOTCONN
LDAP connection has not been made.


EUNKNOWN
Unexpected exception.


Example

The following example gets the version supported by the local EIM APIs for the EIM host.

Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.

#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

[ Back to top | Security APIs | APIs by category ]