diff options
Diffstat (limited to 'src/sssd/LMI_HostedSSSDServiceProvider.c')
-rw-r--r-- | src/sssd/LMI_HostedSSSDServiceProvider.c | 238 |
1 files changed, 238 insertions, 0 deletions
diff --git a/src/sssd/LMI_HostedSSSDServiceProvider.c b/src/sssd/LMI_HostedSSSDServiceProvider.c new file mode 100644 index 0000000..8db231a --- /dev/null +++ b/src/sssd/LMI_HostedSSSDServiceProvider.c @@ -0,0 +1,238 @@ +/* + Authors: + Pavel Březina <pbrezina@redhat.com> + + 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 <http://www.gnu.org/licenses/>. +*/ + +#include <konkret/konkret.h> +#include <openlmi/openlmi.h> +#include "LMI_HostedSSSDService.h" +#include "LMI_SSSD_utils.h" + +static const CMPIBroker* _cb; + +static void LMI_HostedSSSDServiceInitialize(const CMPIContext *ctx) +{ + lmi_init(PROVIDER_NAME, _cb, ctx, NULL); +} + +static CMPIStatus LMI_HostedSSSDServiceCleanup( + CMPIInstanceMI* mi, + const CMPIContext* cc, + CMPIBoolean term) +{ + CMReturn(CMPI_RC_OK); +} + +static CMPIStatus LMI_HostedSSSDServiceEnumInstanceNames( + CMPIInstanceMI* mi, + const CMPIContext* cc, + const CMPIResult* cr, + const CMPIObjectPath* cop) +{ + return KDefaultEnumerateInstanceNames( + _cb, mi, cc, cr, cop); +} + +static CMPIStatus LMI_HostedSSSDServiceEnumInstances( + CMPIInstanceMI* mi, + const CMPIContext* cc, + const CMPIResult* cr, + const CMPIObjectPath* cop, + const char** properties) +{ + LMI_SSSDServiceRef lmi_sssd; + LMI_HostedSSSDService association; + const char *namespace = KNameSpace(cop); + + LMI_SSSDService_Get_Ref(_cb, namespace, &lmi_sssd); + + LMI_HostedSSSDService_Init(&association, _cb, namespace); + LMI_HostedSSSDService_Set_Dependent(&association, &lmi_sssd); + LMI_HostedSSSDService_SetObjectPath_Antecedent(&association, + lmi_get_computer_system()); + + KReturnInstance(cr, association); + + CMReturn(CMPI_RC_OK); +} + +static CMPIStatus LMI_HostedSSSDServiceGetInstance( + 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_HostedSSSDServiceCreateInstance( + CMPIInstanceMI* mi, + const CMPIContext* cc, + const CMPIResult* cr, + const CMPIObjectPath* cop, + const CMPIInstance* ci) +{ + CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); +} + +static CMPIStatus LMI_HostedSSSDServiceModifyInstance( + 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_HostedSSSDServiceDeleteInstance( + CMPIInstanceMI* mi, + const CMPIContext* cc, + const CMPIResult* cr, + const CMPIObjectPath* cop) +{ + CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); +} + +static CMPIStatus LMI_HostedSSSDServiceExecQuery( + CMPIInstanceMI* mi, + const CMPIContext* cc, + const CMPIResult* cr, + const CMPIObjectPath* cop, + const char* lang, + const char* query) +{ + CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); +} + +static CMPIStatus LMI_HostedSSSDServiceAssociationCleanup( + CMPIAssociationMI* mi, + const CMPIContext* cc, + CMPIBoolean term) +{ + CMReturn(CMPI_RC_OK); +} + +static CMPIStatus LMI_HostedSSSDServiceAssociators( + CMPIAssociationMI* mi, + const CMPIContext* cc, + const CMPIResult* cr, + const CMPIObjectPath* cop, + const char* assocClass, + const char* resultClass, + const char* role, + const char* resultRole, + const char** properties) +{ + return KDefaultAssociators( + _cb, + mi, + cc, + cr, + cop, + LMI_HostedSSSDService_ClassName, + assocClass, + resultClass, + role, + resultRole, + properties); +} + +static CMPIStatus LMI_HostedSSSDServiceAssociatorNames( + CMPIAssociationMI* mi, + const CMPIContext* cc, + const CMPIResult* cr, + const CMPIObjectPath* cop, + const char* assocClass, + const char* resultClass, + const char* role, + const char* resultRole) +{ + return KDefaultAssociatorNames( + _cb, + mi, + cc, + cr, + cop, + LMI_HostedSSSDService_ClassName, + assocClass, + resultClass, + role, + resultRole); +} + +static CMPIStatus LMI_HostedSSSDServiceReferences( + CMPIAssociationMI* mi, + const CMPIContext* cc, + const CMPIResult* cr, + const CMPIObjectPath* cop, + const char* assocClass, + const char* role, + const char** properties) +{ + return KDefaultReferences( + _cb, + mi, + cc, + cr, + cop, + LMI_HostedSSSDService_ClassName, + assocClass, + role, + properties); +} + +static CMPIStatus LMI_HostedSSSDServiceReferenceNames( + CMPIAssociationMI* mi, + const CMPIContext* cc, + const CMPIResult* cr, + const CMPIObjectPath* cop, + const char* assocClass, + const char* role) +{ + return KDefaultReferenceNames( + _cb, + mi, + cc, + cr, + cop, + LMI_HostedSSSDService_ClassName, + assocClass, + role); +} + +CMInstanceMIStub( + LMI_HostedSSSDService, + LMI_HostedSSSDService, + _cb, + LMI_HostedSSSDServiceInitialize(ctx)) + +CMAssociationMIStub( + LMI_HostedSSSDService, + LMI_HostedSSSDService, + _cb, + LMI_HostedSSSDServiceInitialize(ctx)) + +KONKRET_REGISTRATION( + "root/cimv2", + "LMI_HostedSSSDService", + "LMI_HostedSSSDService", + "instance association") |