/* Authors: Pavel Březina Copyright (C) 2014 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include #include "LMI_SSSDSubdomain.h" #include "LMI_SSSD_utils.h" static const CMPIBroker* _cb = NULL; static void LMI_SSSDSubdomainInitialize(const CMPIContext *ctx) { lmi_init(PROVIDER_NAME, _cb, ctx, NULL); } static CMPIStatus LMI_SSSDSubdomainCleanup( CMPIInstanceMI* mi, const CMPIContext* cc, CMPIBoolean term) { CMReturn(CMPI_RC_OK); } static CMPIStatus LMI_SSSDSubdomainEnumInstanceNames( CMPIInstanceMI* mi, const CMPIContext* cc, const CMPIResult* cr, const CMPIObjectPath* cop) { return KDefaultEnumerateInstanceNames( _cb, mi, cc, cr, cop); } static CMPIStatus LMI_SSSDSubdomainEnumInstances( CMPIInstanceMI* mi, const CMPIContext* cc, const CMPIResult* cr, const CMPIObjectPath* cop, const char** properties) { LMI_SSSDSubdomain lmi_subdomain; const char *namespace = KNameSpace(cop); const char *subdomains[] = {"bos.ad.pb", "brq.ad.pb", NULL}; int i; for (i = 0; subdomains[i] != NULL; i++) { LMI_SSSDSubdomain_Init(&lmi_subdomain, _cb, namespace); /* Set keys */ LMI_SSSDSubdomain_Set_Name(&lmi_subdomain, subdomains[i]); /* Set values */ LMI_SSSDSubdomain_Set_DebugLevel(&lmi_subdomain, 0x3ff0); LMI_SSSDSubdomain_Set_IsEnabled(&lmi_subdomain, true); LMI_SSSDSubdomain_Set_Description(&lmi_subdomain, "SSSD Subdomain"); KReturnInstance(cr, lmi_subdomain); } CMReturn(CMPI_RC_OK); } static CMPIStatus LMI_SSSDSubdomainGetInstance( CMPIInstanceMI* mi, const CMPIContext* cc, const CMPIResult* cr, const CMPIObjectPath* cop, const char** properties) { return KDefaultGetInstance( _cb, mi, cc, cr, cop, properties); } static CMPIStatus LMI_SSSDSubdomainCreateInstance( CMPIInstanceMI* mi, const CMPIContext* cc, const CMPIResult* cr, const CMPIObjectPath* cop, const CMPIInstance* ci) { CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } static CMPIStatus LMI_SSSDSubdomainModifyInstance( CMPIInstanceMI* mi, const CMPIContext* cc, const CMPIResult* cr, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } static CMPIStatus LMI_SSSDSubdomainDeleteInstance( CMPIInstanceMI* mi, const CMPIContext* cc, const CMPIResult* cr, const CMPIObjectPath* cop) { CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } static CMPIStatus LMI_SSSDSubdomainExecQuery( CMPIInstanceMI* mi, const CMPIContext* cc, const CMPIResult* cr, const CMPIObjectPath* cop, const char* lang, const char* query) { CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } CMInstanceMIStub( LMI_SSSDSubdomain, LMI_SSSDSubdomain, _cb, LMI_SSSDSubdomainInitialize(ctx)) static CMPIStatus LMI_SSSDSubdomainMethodCleanup( CMPIMethodMI* mi, const CMPIContext* cc, CMPIBoolean term) { CMReturn(CMPI_RC_OK); } static CMPIStatus LMI_SSSDSubdomainInvokeMethod( CMPIMethodMI* mi, const CMPIContext* cc, const CMPIResult* cr, const CMPIObjectPath* cop, const char* meth, const CMPIArgs* in, CMPIArgs* out) { return LMI_SSSDSubdomain_DispatchMethod( _cb, mi, cc, cr, cop, meth, in, out); } CMMethodMIStub( LMI_SSSDSubdomain, LMI_SSSDSubdomain, _cb, LMI_SSSDSubdomainInitialize(ctx)) KUint32 LMI_SSSDSubdomain_SetDebugLevelPermanently( const CMPIBroker* cb, CMPIMethodMI* mi, const CMPIContext* context, const LMI_SSSDSubdomainRef* self, const KUint16* debug_level, CMPIStatus* status) { KUint32 result = KUINT32_INIT; KSetStatus(status, ERR_NOT_SUPPORTED); return result; } KUint32 LMI_SSSDSubdomain_SetDebugLevelTemporarily( const CMPIBroker* cb, CMPIMethodMI* mi, const CMPIContext* context, const LMI_SSSDSubdomainRef* self, const KUint16* debug_level, CMPIStatus* status) { KUint32 result = KUINT32_INIT; KSetStatus(status, ERR_NOT_SUPPORTED); return result; } KUint32 LMI_SSSDSubdomain_Enable( const CMPIBroker* cb, CMPIMethodMI* mi, const CMPIContext* context, const LMI_SSSDSubdomainRef* self, CMPIStatus* status) { KUint32 result = KUINT32_INIT; KSetStatus(status, ERR_NOT_SUPPORTED); return result; } KUint32 LMI_SSSDSubdomain_Disable( const CMPIBroker* cb, CMPIMethodMI* mi, const CMPIContext* context, const LMI_SSSDSubdomainRef* self, CMPIStatus* status) { KUint32 result = KUINT32_INIT; KSetStatus(status, ERR_NOT_SUPPORTED); return result; } KONKRET_REGISTRATION( "root/cimv2", "LMI_SSSDSubdomain", "LMI_SSSDSubdomain", "instance method")