#include <eim.h> int eimGetAttribute(EimHandle * eim, enum EimHandleAttr attrName, unsigned int lengthOfEimAttribute, EimAttribute * attribute, EimRC * eimrc)Service Program Name: QSYS/QSYEIM
The eimGetAttribute() function is used to get attributes for this EIM handle.
The ldap configuration file is used to retrieve information for the master host, master port, and secure port. If the host system is not a replica then the master information retrieved is the same as the host and port defined in the handle.
None.
EIM_HANDLE_CCSID (0) | This is the CCSID of character data passed by the caller of EIM APIs with the specified EimHandle. The returned field is a 4 byte integer. |
EIM_HANDLE_DOMAIN (1) | The EIM domain name. |
EIM_HANDLE_HOST (2) | The host system for the EIM domain. |
EIM_HANDLE_PORT (3) | The port for the EIM connection. The returned field is a 4 byte integer. |
EIM_HANDLE_SECPORT (4) | Security type for this connection. The returned
field is a 4 byte integer. Possible values:
|
EIM_HANDLE_MASTER_HOST (5) | If the EIM_HANDLE_HOST is a replica LDAP server, this value will indicate the master LDAP server. |
EIM_HANDLE_MASTER_PORT (6) | If the EIM_HANDLE_HOST is a replica LDAP server, this value will indicate the port for the master LDAP server. The returned field is a 4 byte integer. |
EIM_HANDLE_MASTER_SECPORT (7) | If the EIM_HANDLE_HOST is a replica LDAP server, this value will indicate the security type for the master LDAP server. The returned field is a 4 byte integer. |
The EimAttribute structure contains information about the returned data. The API will return as much data as space has been provided.
EimAttribute structure:
typedef struct EimAttribute { unsigned int bytesReturned; /* Number of bytes actually returned by the API */ unsigned int bytesAvailable; /* Number of bytes of available data that could have been returned by the API */ EimListData attribute; /* handle attribute */ } EimAttribute;
EimListData structure:
typedef struct EimListData { unsigned int length; /* Length of data */ unsigned int disp; /* Displacement to data. This byte offset is relative to the start of the parent structure; that is, the structure containing this structure. */ } EimListData;
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_ACCESS (1) | Insufficient access to EIM data. |
EIMERR_NOLOCK (26) | Unable to allocate internal system object. |
EIMERR_DATA_CONVERSION (13) | Error occurred when converting data between code pages. |
EIMERR_ATTR_INVAL (5) | Attribute name is not valid. |
EIMERR_ATTRIB_SIZE (53) | Length of EimAttribute is 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_SPACE (41) | Unexpected error accessing parameter. |
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_ATTR_NOTSUPP (6) | Attribute not supported. |
EIMERR_LDAP_ERR (23) | Unexpected LDAP error. %s |
EIMERR_UNKNOWN (44) | Unknown error or unknown system state. |
See Code disclaimer information for information pertaining to code examples.
The following example will get the domain for the EIM handle.
#include <eim.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int rc; char eimerr[100]; EimRC * err; EimHandle * handle; char * data; char * listData[1000]; EimAttribute * list = (EimAttribute *) listData; /* Get eim handle from input arg. */ /* This handle is already connected to EIM. */ handle = (EimHandle *)argv[1]; /* Set up error structure. */ memset(eimerr,0x00,100); err = (EimRC *)eimerr; err->memoryProvidedByCaller = 100; /* Get EIM domain name */ if (0 != (rc = eimGetAttribute(handle, EIM_HANDLE_DOMAIN, 1000, list, err))) printf("Get Attribute error = %d", rc); /* Print results */ printf(" Bytes returned = %d.\n", list->bytesReturned); printf(" Bytes available = %d.\n", list->bytesAvailable); printf(" Attr size = %d.\n", list->attribute.length); printf(" Attr disp = %d.\n", list->attribute.disp); data = (char * )list + list->attribute.disp; printf(" %s = %s.\n", "domain name", data); return 0; }
Top | Security APIs | APIs by category |