#include <eim.h> int eimRetrieveConfiguration(unsigned int lengthOfEimConfig, EimConfig * configData, int ccsid, EimRC * eimrc)Service Program Name: QSYS/QSYEIM
The eimRetrieveConfiguration() function retrieves the EIM configuration information for this system.
No authorization is required.
The EimConfig structure contains information about the returned data. The API will return as much data as space has been provided.
EimConfig structure:
typedef struct EimConfig { 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. */ int enable; /* Flag to indicate if enabled to participate in EIM domain 0 = not enabled 1 = enabled */ EimListData ldapURL; /* ldap URL for domain controller */ EimListData localRegistry; /* Local system registry */ EimListData kerberosRegistry; /* Kerberos registry */ EimListData x509Registry; /* X.509 registry */ } EimConfig;
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_DATA_CONVERSION (13) | Error occurred when converting data between code pages. |
EIMERR_CCSID_INVAL (8) | CCSID is outside of valid range or CCSID is not supported. |
EIMERR_CONFIG_SIZE (10) | Length of EimConfig 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_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 retrieves the configuration information and prints out the results..
#include <eim.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> void printListData(char * fieldName, void * entry, int offset); int main (int argc, char *argv[]) { int rc; char eimerr[100]; EimRC * err; char listData[4000]; EimConfig * list = (EimConfig * ) listData; /* Set up error structure. */ memset(eimerr,0x00,100); err = (EimRC *)eimerr; err->memoryProvidedByCaller = 100; /* Get configuration information */ if (0 != (rc = eimRetrieveConfiguration(4000, list, 0, err))) { printf("Retrieve configuration error = %d", rc); return -1; } /* Print the results */ printf("___________\n"); printf(" bytesReturned = %d\n", list->bytesReturned); printf(" bytesAvailable = %d\n", list->bytesAvailable); printf("\n"); if (0 == list->enable) printf("Disabled.\n"); else printf("Enabled.\n"); printListData("ldap URL", list, offsetof(EimConfig, ldapURL)); printListData("local Registry", list, offsetof(EimConfig, localRegistry)); printListData("kerberos registry", list, offsetof(EimConfig, kerberosRegistry)); printListData("x.509 registry", list, offsetof(EimConfig, x509Registry)); return 0; } void printListData(char * fieldName, void * entry, int offset) { EimListData * listData; char * data; int dataLength; printf(" %s = ",fieldName); /* Address the EimListData object */ listData = (EimListData *)((char *)entry + offset); /* Print out results */ data = (char *)entry + listData->disp; dataLength = listData->length; if (dataLength > 0) printf("%.*s\n",dataLength, data); else printf("Not found.\n"); }
Top | Security APIs | APIs by category |