#include <eim.h>
int eimCreateHandle(EimHandle * eim,
char * ldapURL,
EimRC * eimrc)
Service Program Name: QSYS/QSYEIMThe eimCreateHandle() function is used to allocate an EimHandle structure, which is used to identify the EIM connection and to maintain per-connection information. The EimHandle structure should be passed on subsequent calls to other EIM operations.
If a NULL is not passed for the ldapURL parameter, then the caller of the API must have *SECADM special authority.
ldap://host:port/dn
or
ldaps://host:port/dn
where:
Examples:
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_AUTH_ERR (7) | Insufficient authority for the operation. |
| EIMERR_NOLOCK (26) | Unable to allocate internal system object. |
| EIMERR_DATA_CONVERSION (13) | Error occurred when converting data between code pages. |
| EIMERR_PARM_REQ (34) | Missing required parameter. Please check API documentation. |
| EIMERR_PTR_INVAL (35) | Pointer parameter is not valid. |
| EIMERR_URL_NODN (45) | URL has no dn (required). |
| EIMERR_URL_NODOMAIN (46) | URL has no domain (required). |
| EIMERR_URL_NOHOST (47) | URL does not have a host. |
| EIMERR_URL_NOTLDAP (49) | URL does not begin with ldap. |
| EIMERR_INVALID_DN (66) | Distinguished Name (DN) is not valid. |
| EIMERR_NOMEM (27) | No memory available. Unable to allocate required space. |
| EIMERR_NOTCONFIG (30) | EIM environment is not configured. Run eimSetConfiguration() API and try the request again. |
| EIMERR_LDAP_ERR (23) | Unexpected LDAP error. %s |
| EIMERR_UNKNOWN (44) | Unknown error or unknown system state. |
The following example creates an EIM handle.
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;
EimHandle handle;
EimHandle handle2;
char * ldapURL = "ldap://eimsystem:389/ibm-eimDomainName=myEimDomain,o=mycompany,c=us";
/* Set up error structure. */
memset(eimerr,0x00,100);
err = (EimRC *)eimerr;
err->memoryProvidedByCaller = 100;
/* Create a new eim handle. Use the eim configuration URL */
if (0 != (rc = eimCreateHandle(&handle,
NULL,
err)))
printf("Create handle error = %d", rc);
/* Create a new eim handle. Use the specified URL */
if (0 != (rc = eimCreateHandle(&handle2,
ldapURL,
err)))
printf("Create handle error = %d", rc);
return 0;
}
[ Back to top | Security APIs | APIs by category ]