diff options
author | Peter Schiffer <pschiffe@redhat.com> | 2014-06-25 16:08:15 +0200 |
---|---|---|
committer | Peter Schiffer <pschiffe@redhat.com> | 2014-06-26 13:37:56 +0200 |
commit | 8d989029fa454645158918e919b37ebf5427d794 (patch) | |
tree | 15404a026ec0837d496c62e39054a9dcde9ae93c | |
parent | 67006a81bb288f12850015ff5a6ed808c47dc8be (diff) | |
download | openlmi-providers-8d989029fa454645158918e919b37ebf5427d794.tar.gz openlmi-providers-8d989029fa454645158918e919b37ebf5427d794.tar.xz openlmi-providers-8d989029fa454645158918e919b37ebf5427d794.zip |
software-dbus: implemented AssociatedSoftwareInstallationServiceCapabilities
-rw-r--r-- | src/software-dbus/LMI_AssociatedSoftwareInstallationServiceCapabilitiesProvider.c | 60 |
1 files changed, 57 insertions, 3 deletions
diff --git a/src/software-dbus/LMI_AssociatedSoftwareInstallationServiceCapabilitiesProvider.c b/src/software-dbus/LMI_AssociatedSoftwareInstallationServiceCapabilitiesProvider.c index c9a4b71..c49daf3 100644 --- a/src/software-dbus/LMI_AssociatedSoftwareInstallationServiceCapabilitiesProvider.c +++ b/src/software-dbus/LMI_AssociatedSoftwareInstallationServiceCapabilitiesProvider.c @@ -1,10 +1,32 @@ +/* + * Copyright (C) 2013-2014 Red Hat, Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Authors: Peter Schiffer <pschiffe@redhat.com> + */ + #include <konkret/konkret.h> #include "LMI_AssociatedSoftwareInstallationServiceCapabilities.h" +#include "sw-utils.h" static const CMPIBroker* _cb; -static void LMI_AssociatedSoftwareInstallationServiceCapabilitiesInitialize() +static void LMI_AssociatedSoftwareInstallationServiceCapabilitiesInitialize(const CMPIContext *ctx) { + lmi_init(provider_name, _cb, ctx, provider_config_defaults); } static CMPIStatus LMI_AssociatedSoftwareInstallationServiceCapabilitiesCleanup( @@ -32,6 +54,38 @@ static CMPIStatus LMI_AssociatedSoftwareInstallationServiceCapabilitiesEnumInsta const CMPIObjectPath* cop, const char** properties) { + char instance_id[BUFLEN]; + + create_instance_id(LMI_SoftwareInstallationServiceCapabilities_ClassName, + NULL, instance_id, BUFLEN); + + LMI_SoftwareInstallationServiceCapabilitiesRef sisc; + LMI_SoftwareInstallationServiceCapabilitiesRef_Init(&sisc, _cb, KNameSpace(cop)); + LMI_SoftwareInstallationServiceCapabilitiesRef_Set_InstanceID(&sisc, instance_id); + + create_instance_id(LMI_SoftwareInstallationService_ClassName, + NULL, instance_id, BUFLEN); + + LMI_SoftwareInstallationServiceRef sis; + LMI_SoftwareInstallationServiceRef_Init(&sis, _cb, KNameSpace(cop)); + LMI_SoftwareInstallationServiceRef_Set_CreationClassName(&sis, + LMI_SoftwareInstallationService_ClassName); + LMI_SoftwareInstallationServiceRef_Set_SystemCreationClassName(&sis, + lmi_get_system_creation_class_name()); + LMI_SoftwareInstallationServiceRef_Set_SystemName(&sis, + lmi_get_system_name_safe(cc)); + LMI_SoftwareInstallationServiceRef_Set_Name(&sis, instance_id); + + LMI_AssociatedSoftwareInstallationServiceCapabilities w; + LMI_AssociatedSoftwareInstallationServiceCapabilities_Init(&w, _cb, KNameSpace(cop)); + LMI_AssociatedSoftwareInstallationServiceCapabilities_Set_Capabilities(&w, &sisc); + LMI_AssociatedSoftwareInstallationServiceCapabilities_Set_ManagedElement(&w, &sis); + LMI_AssociatedSoftwareInstallationServiceCapabilities_Init_Characteristics(&w, 2); + LMI_AssociatedSoftwareInstallationServiceCapabilities_Set_Characteristics_Default(&w, 0); + LMI_AssociatedSoftwareInstallationServiceCapabilities_Set_Characteristics_Current(&w, 1); + + KReturnInstance(cr, w); + CMReturn(CMPI_RC_OK); } @@ -187,13 +241,13 @@ CMInstanceMIStub( LMI_AssociatedSoftwareInstallationServiceCapabilities, LMI_AssociatedSoftwareInstallationServiceCapabilities, _cb, - LMI_AssociatedSoftwareInstallationServiceCapabilitiesInitialize()) + LMI_AssociatedSoftwareInstallationServiceCapabilitiesInitialize(ctx)) CMAssociationMIStub( LMI_AssociatedSoftwareInstallationServiceCapabilities, LMI_AssociatedSoftwareInstallationServiceCapabilities, _cb, - LMI_AssociatedSoftwareInstallationServiceCapabilitiesInitialize()) + LMI_AssociatedSoftwareInstallationServiceCapabilitiesInitialize(ctx)) KONKRET_REGISTRATION( "root/cimv2", |