#include <eim.h> int eimRemovePolicyAssociation(EimHandle * eim, EimPolicyAssociationInfo * policyAssoc, EimRC * eimrc)Service Program Name: QSYS/QSYEIM
The eimRemovePolicyAssociation() function removes the specified policy association from the domain.
EIM version 2 must be supported by the local EIM APIs to use this API (see eimGetVersion()--Get EIM Version).
The EimPolicyAssociationInfo structure contains information about the policy association to remove.
For EIM_CERT_FILTER_POLICY (6) association type, the policyAssociation field must contain an EimCertificateFilterPolicyAssociation structure.
For EIM_DEFAULT_REG_POLICY (7) association type, the policyAssociation field must contain an EimDefaultRegistryPolicyAssociation structure.
For EIM_DEFAULT_DOMAIN_POLICY (8) association type. the policyAssociation field must contain an EimDefaultDomainPolicyAssociation structure.
The structure layouts follow:
enum EimAssociationType { EIM_ALL_ASSOC, /* Not supported on this interface*/ EIM_TARGET, /* Not supported on this interface*/ EIM_SOURCE, /* Not supported on this interface*/ EIM_SOURCE_AND_TARGET, /* Not supported on this interface*/ EIM_ADMIN, /* Not supported on this interface*/ EIM_ALL_POLICY_ASSOC, /* Not supported on this interface*/ EIM_CERT_FILTER_POLICY, /* Association is a certificate filter policy association. */ EIM_DEFAULT_REG_POLICY, /* Association is a default registry policy association */ EIM_DEFAULT_DOMAIN_POLICY /* Policy is a default policy for the domain. */ }; typedef struct EimCertificateFilterPolicyAssociation { char * sourceRegistry; /* The source registry to remove the policy association from. */ char * filterValue; /* The filter value of the policy.*/ char * targetRegistry; /* The name of the target registry that the filter value is mapped to. */ char * targetRegistryUserName; /* The name of the target registry user name that the filter value is mapped to. */ } EimCertificateFilterPolicyAssociation; typedef struct EimDefaultRegistryPolicyAssociation { char * sourceRegistry; /* The source registry to remove the policy association from. */ char * targetRegistry; /* The name of the target registry that the policy association is mapped to. */ char * targetRegistryUserName; /* The name of the target registry user name that the policy association is mapped to. */ } EimDefaultRegistryPolicyAssociation; typedef struct EimDefaultDomainPolicyAssociation { char * targetRegistry; /* The name of the target registry that the policy association is mapped to. */ char * targetRegistryUserName; /* The name of the target registry user name that the policy association is mapped to. */ } EimDefaultDomainPolicyAssociation; typedef struct EimPolicyAssociationInfo { enum EimAssociationType type; union { EimCertificateFilterPolicyAssociation certFilter; EimDefaultRegistryPolicyAssociation defaultRegistry; EimDefaultDomainPolicyAssociation defaultDomain; } policyAssociation; } EimPolicyAssociationInfo;
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_NOREG (28) | EIM Registry not found or insufficient access to EIM data. |
EIMERR_NOPOLICYFILTER (61) | Policy filter value not found for the specified EIM Registry. |
EIMERR_NOLOCK (26) | Unable to allocate internal system object. |
EIMERR_DATA_CONVERSION (13) | Error occurred when converting data between code pages. |
EIMERR_ASSOC_TYPE_INVAL (4) | Association type 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_FUNCTION_NOT_ SUPPORTED (70) | The specified function is not supported by the EIM version. |
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_READ_ONLY (36) | LDAP connection is for read only. Use eimConnectToMaster() to get a write connection. |
EIMERR_LDAP_ERR (23) | Unexpected LDAP error. %s |
EIMERR_UNKNOWN (44) | Unknown error or unknown system state. |
EIMERR_UNEXP_OBJ_VIOLATION (56) | Unexpected object violation. |
See Code disclaimer information for information pertaining to code examples.
The following example removes a default registry policy association.
#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; EimPolicyAssociationInfo assocInfo; /* Set up error structure. */ memset(eimerr,0x00,100); err = (EimRC *)eimerr; err->memoryProvidedByCaller = 100; /* Get eim handle from input arg. */ /* This handle is already connected to EIM. */ handle = (EimHandle *)argv[1]; /* Set up policy association information */ assocInfo.type = EIM_DEFAULT_REG_POLICY; assocInfo.policyAssociation.defaultRegistry.sourceRegistry = "MySourceRegistry"; assocInfo.policyAssociation.defaultRegistry.targetRegistry = "localRegistry"; assocInfo.policyAssociation.defaultRegistry.targetRegistryUserName = "mjjones"; /* Remove the policy */ if (0 != (rc = eimRemovePolicyAssociation(handle, &assocInfo, err))) { printf("Remove EIM Policy Association error = %d", rc); return -1; } return 0; }
Top | Security APIs | APIs by category |