ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/eimgetversion.htm

453 lines
14 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>eimGetVersion()--Get EIM Version</title>
<!-- Begin header records -->
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!-- Created by Carol Budnik on 17 July 2001 -->
<!-- Edited by Kersten Jan 02 -->
<!-- End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!--Java sync-link-->
<script type="text/javascript" language="javascript" src="../rzahg/synch.js">
</script>
<a name="Top_Of_Page"></a>
<!-- ============================================================== -->
<!-- -->
<!-- -->
<!-- ============================================================== -->
<h2>eimGetVersion()--Get EIM
Version</h2>
<!-- ============================================================== -->
<!-- -->
<!-- S Y N T A X / P A R M T A B L E -->
<!-- -->
<!-- ============================================================== -->
<div class="box" style="width: 80%;">
<br>
&nbsp;&nbsp;Syntax
<pre>
#include &lt;eim.h&gt;
int eimGetVersion(EimHostInfo * <em>hostInfo</em>,
enum EimVersion * <em>version</em>,
EimRC * <em>eimrc</em>)
</pre>
&nbsp;&nbsp;Service Program Name: QSYS/QSYEIM<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Yes<br>
<!-- iddvc RMBR -->
<br>
</div>
<!-- ============================================================== -->
<!-- -->
<!-- D E S C R I P T I O N -->
<!-- -->
<!-- ============================================================== -->
<p>The <strong>eimGetVersion()</strong> function returns the EIM version
supported by the local EIM APIs for the specified EIM host.</p>
<br>
<!-- ============================================================== -->
<!-- -->
<!-- A U T H O R I T I E S A N D L O C K S -->
<!-- -->
<!-- ============================================================== -->
<h3>Authorities and Locks</h3>
<dl>
<dt>None</dt>
</dl>
<br>
<!-- ============================================================== -->
<!-- -->
<!-- P A R A M E T E R S -->
<!-- -->
<!-- ============================================================== -->
<h3>Parameters</h3>
<dl><!-- ============================================================== -->
<!-- hostInfo -->
<!-- ============================================================== -->
<dt><strong>hostInfo</strong> (Input)</dt>
<dd>The structure that contains the EIM host information for which to return
the EIM version supported by the local EIM APIs.
<p>For EIM_HANDLE (0) host type, the <em>hostInfo</em> field must contain an
EIM handle returned by a previous call to eimCreateHandle() and
eimConnect().</p>
<p>For EIM_LDAP_URL (1) host type, the <em>hostInfo</em> field must contain a
uniform resource locator (URL) that contains the EIM host information. A NULL
value for the <em>ldapURL</em> field indicates that the ldap URL information
set by the eimSetConfiguration() API should be used. This URL has the following
format:</p>
<pre>
ldap://host:port/dn
or
ldaps://host:port
</pre>
<p>where:</p>
<ul>
<li><em>host:port</em> is the name of the host on which the EIM domain
controller is running with an optional port number.</li>
<li><em>dn</em> is the distinguished name of the domain to work with
(optional).</li>
<li><em>ldaps</em> indicates that this host/port combination uses SSL and
TLS.</li>
</ul>
<p>Examples:</p>
<ul>
<li>ldap://systemx:389/ibm-eimDomainName=myEimDomain,o=myCompany,c=us</li>
<li>ldaps://systemy:636/ibm-eimDomainName=thisEimDomain</li>
</ul>
<br>
<br>
<p>The structure layouts follow:</p>
<pre>
enum EimHostInfoType {
EIM_HANDLE,
EIM_LDAP_URL
};
typedef struct EimHostInfo
{
enum EimHostInfoType hostType;
union {
EimHandle * eim;
char * ldapURL;
} hostInfo;
} EimHostInfo;
</pre>
<br>
<br>
</dd>
<!-- ============================================================== -->
<!-- version -->
<!-- ============================================================== -->
<dt><strong>version</strong> (Output)</dt>
<dd>The EIM version supported by the local EIM APIs for the specified host.
Possible values are:<br>
<br>
<table width="100%">
<!-- cols="30 70" -->
<tr>
<td align="left" valign="top"><em>EIM_VERSION_0 (0)</em></td>
<td align="left" valign="top">EIM is not supported on the specified host.</td>
</tr>
<tr>
<td align="left" valign="top"><em>EIM_VERSION_1 (1)</em></td>
<td align="left" valign="top">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 .</td>
</tr>
<tr>
<td align="left" valign="top"><em>EIM_VERSION_2 (2)</em></td>
<td align="left" valign="top">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.</td>
</tr>
<tr>
<td align="left" valign="top"><img src="delta.gif" alt="Start of change"><em>EIM_VERSION_3 (3)</em></td>
<td align="left" valign="top">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.
<img src="deltaend.gif" alt="End of change"></td>
</tr>
</table>
<br>
<br>
</dd>
<!-- ============================================================== -->
<!-- eimrc -->
<!-- ============================================================== -->
<dt><strong>eimrc</strong> (Input/Output)</dt>
<dd>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 <a href="eimrc.htm">EimRC--EIM
Return Code Parameter</a>.<br>
<br>
</dd>
</dl>
<!-- ============================================================== -->
<!-- -->
<!-- R E T U R N V A L U E -->
<!-- -->
<!-- ============================================================== -->
<h3>Return Value</h3>
<p>The return value from the API. Following each return value is the list of
possible values for the <samp>messageCatalogMessageID</samp> field in the <em>
eimrc</em> parameter for that value.</p>
<dl><!-- ============================================================== -->
<!-- 0 -->
<!-- ============================================================== -->
<dt><strong>0</strong></dt>
<dd>Request was successful.<br>
<br>
</dd>
<!-- ============================================================== -->
<!-- EBADDATA -->
<!-- ============================================================== -->
<dt><strong>EBADDATA</strong></dt>
<dd>eimrc is not valid.<br>
<br>
</dd>
<!-- ============================================================== -->
<!-- EBUSY -->
<!-- ============================================================== -->
<dt><strong>EBUSY</strong></dt>
<dd>Unable to allocate internal system object.<br>
<br>
<table cellpadding="5">
<!-- cols="25 75" -->
<tr>
<td align="left" valign="top"><em>EIMERR_NOLOCK (26)</em></td>
<td align="left" valign="top">Unable to allocate internal system object.</td>
</tr>
</table>
<br>
</dd>
<!-- ============================================================== -->
<!-- EINVAL -->
<!-- ============================================================== -->
<dt><strong>EINVAL</strong></dt>
<dd>Input parameter was not valid.<br>
<br>
<table cellpadding="5">
<!-- cols="35 65" -->
<tr>
<td align="left" valign="top"><em>EIMERR_HANDLE_INVAL (17)</em></td>
<td align="left" valign="top">EimHandle is not valid.</td>
</tr>
<tr>
<td align="left" valign="top"><em>EIMERR_PARM_REQ (34)</em></td>
<td align="left" valign="top">Missing required parameter. Please check API
documentation.</td>
</tr>
<tr>
<td align="left" valign="top"><em>EIMERR_PTR_INVAL (35)</em></td>
<td align="left" valign="top">Pointer parameter is not valid.</td>
</tr>
<tr>
<td align="left" valign="top"><em>EIMERR_URL_NOHOST (47)</em></td>
<td align="left" valign="top">URL does not have a host.</td>
</tr>
<tr>
<td align="left" valign="top"><em>EIMERR_URL_NOTLDAP (49)</em></td>
<td align="left" valign="top">URL does not begin with ldap.</td>
</tr>
<tr>
<td align="left" valign="top"><em>EIMERR_TYPE_INVAL (69)</em></td>
<td align="left" valign="top">The specified type is not valid.</td>
</tr>
</table>
<br>
</dd>
<!-- ============================================================== -->
<!-- ENOMEM -->
<!-- ============================================================== -->
<dt><strong>ENOMEM</strong></dt>
<dd>Unable to allocate required space.<br>
<br>
<table cellpadding="5">
<!-- cols="25 75" -->
<tr>
<td align="left" valign="top"><em>EIMERR_NOMEM (27)</em></td>
<td align="left" valign="top">No memory available. Unable to allocate required
space.</td>
</tr>
</table>
<br>
</dd>
<!-- ============================================================== -->
<!-- ENOTCONN -->
<!-- ============================================================== -->
<dt><strong>ENOTCONN</strong></dt>
<dd>LDAP connection has not been made.<br>
<br>
<table cellpadding="5">
<!-- cols="25 75" -->
<tr>
<td align="left" valign="top"><em>EIMERR_NOT_CONN (31)</em></td>
<td align="left" valign="top">Not connected to LDAP. Use eimConnect() API and
try the request again.</td>
</tr>
</table>
<br>
</dd>
<!-- ============================================================== -->
<!-- EUNKNOWN -->
<!-- ============================================================== -->
<dt><strong>EUNKNOWN</strong></dt>
<dd>Unexpected exception.<br>
<br>
<table cellpadding="5">
<!-- cols="40 60" -->
<tr>
<td align="left" valign="top">EIMERR_LDAP_ERR (23)</td>
<td align="left" valign="top">Unexpected LDAP error. %s</td>
</tr>
<tr>
<td align="left" valign="top"><em>EIMERR_UNKNOWN (44)</em></td>
<td align="left" valign="top">Unknown error or unknown system state.</td>
</tr>
<tr>
<td align="left" valign="top"><em>EIMERR_LDAP_SCHEMA_NOT_FOUND (71)</em></td>
<td align="left" valign="top">Unable to find LDAP schema.</td>
</tr>
</table>
</dd>
</dl>
<br>
<!-- ============================================================== -->
<!-- -->
<!-- E X A M P L E -->
<!-- -->
<!-- ============================================================== -->
<h3>Example</h3>
<p>See <a href="../apiref/aboutapis.htm#codedisclaimer">Code disclaimer information</a>
for information pertaining to code examples.</p>
<p>The following example gets the version supported by the local EIM APIs for
the EIM host.</p>
<pre>
#include &lt;eim.h&gt;
#include &lt;stdio.h&gt;
int main(int argc, char *argv[])
{
int rc;
char eimerr[100];
EimRC * err;
EimHostInfo hostInfo;
enum EimVersion version;
<em>/* Get eim handle from input arg. */</em>
<em>/* This handle is already connected to EIM. */</em>
hostInfo.hostInfo.eim = (EimHandle *)argv[1];
hostInfo.hostType = EIM_HANDLE;
<em>/* Set up error structure. */</em>
memset(eimerr,0x00,100);
err = (EimRC *)eimerr;
err-&gt;memoryProvidedByCaller = 100;
<em>/* Get the version */</em>
if (0 != (rc = eimGetVersion(&amp;hostInfo,
&amp;version,
err)))
{
printf("Get Version error = %d", rc);
return -1;
}
<em>/* Print the version. */</em>
printf("Version = %d", version);
return 0;
}
</pre>
<br>
<!-- ============================================================== -->
<!-- -->
<!-- F O O T E R -->
<!-- -->
<!-- ============================================================== --> <br>
<hr>
API introduced: V5R3
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
"sec.htm">Security APIs</a> | <a href="aplist.htm">APIs by category</a></td>
</tr>
</table>
</center>
</body>
</html>