opendrim-lmp-cpu-1.1.0~ppa/0000755000175000017500000000000011400667756016346 5ustar guillaumeguillaumeopendrim-lmp-cpu-1.1.0~ppa/Makefile.am0000644000175000017500000001105111400667756020400 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ VENDOR = OpenDRIM VERSION = $(shell cat ./VERSION) APP_NAME = opendrim-lmp-cpu RPM_PACKAGE_DIR = packaging PLATFORM = $(shell rpm --eval %_target_cpu) WORKING_DIR = $(shell pwd) SUBDIRS = Common OpenDRIM_RegisteredCPUProfile OpenDRIM_Processor OpenDRIM_CacheMemory OpenDRIM_ProcessorCore OpenDRIM_HardwareThread OpenDRIM_ProcessorConformsToProfile OpenDRIM_AssociatedProcessorCoreCacheMemory OpenDRIM_ProcessorCoreHardwareThread OpenDRIM_ProcessorProcessorCore OpenDRIM_ComputerSystemProcessor OpenDRIM_AssociatedProcessorCacheMemory test postinstall: registration/CPU.sh @CIMNAMESPACE@ $(VENDOR) @CIMSERVER@ @INTEROPNAMESPACE@ $(VERSION) . preuninstall: registration/CPU-remove.sh @CIMNAMESPACE@ @CIMSERVER@ @INTEROPNAMESPACE@ . test-OpenDRIM_RegisteredCPUProfile: all make -C test test-OpenDRIM_RegisteredCPUProfile test-OpenDRIM_Processor: all make -C test test-OpenDRIM_Processor test-OpenDRIM_CacheMemory: all make -C test test-OpenDRIM_CacheMemory test-OpenDRIM_ProcessorConformsToProfile: all make -C test test-OpenDRIM_ProcessorConformsToProfile test-OpenDRIM_AssociatedProcessorCoreCacheMemory: all make -C test test-OpenDRIM_AssociatedProcessorCoreCacheMemory test-OpenDRIM_ProcessorCoreHardwareThread: all make -C test test-OpenDRIM_ProcessorCoreHardwareThread test-OpenDRIM_ProcessorCore: all make -C test test-OpenDRIM_ProcessorCore test-OpenDRIM_HardwareThread: all make -C test test-OpenDRIM_HardwareThread test-OpenDRIM_ProcessorProcessorCore: all make -C test test-OpenDRIM_ProcessorProcessorCore test-OpenDRIM_ComputerSystemProcessor: all make -C test test-OpenDRIM_ComputerSystemProcessor test-OpenDRIM_AssociatedProcessorCacheMemory: all make -C test test-OpenDRIM_AssociatedProcessorCacheMemory pkg-src: rm -rf packaging/$(APP_NAME)-$(VERSION) rm -rf .tmp mkdir .tmp cp -r ./* .tmp/ rm -rf ./tmp/packaging/ mv .tmp packaging/$(APP_NAME)-$(VERSION) tar --directory packaging -zcf packaging/$(APP_NAME)-$(VERSION).tar.gz $(APP_NAME)-$(VERSION) rm -rf packaging/$(APP_NAME)-$(VERSION) pkg-rpm: pkg-src mkdir -p $(RPM_PACKAGE_DIR)/rpm/RPMS/$(PLATFORM) mkdir -p $(RPM_PACKAGE_DIR)/rpm/SRPMS mkdir -p $(RPM_PACKAGE_DIR)/rpm/BUILD mkdir -p $(RPM_PACKAGE_DIR)/rpm/SOURCES mkdir -p $(RPM_PACKAGE_DIR)/rpm/tmp - rm -r $(RPM_PACKAGE_DIR)/rpm/BUILD/$(APP_NAME)-root - rm -r $(RPM_PACKAGE_DIR)/rpm/RPMS/$(APP_NAME)-* - rm -r $(RPM_PACKAGE_DIR)/rpm/SRPMS/$(APP_NAME)-* - rm -r $(RPM_PACKAGE_DIR)/rpm/SOURCES/$(APP_NAME)-* mv packaging/$(APP_NAME)-$(VERSION).tar.gz $(RPM_PACKAGE_DIR)/rpm/SOURCES/ rpmbuild --define="_topdir $(WORKING_DIR)/$(RPM_PACKAGE_DIR)/rpm" --define="version $(VERSION)" -ba $(RPM_PACKAGE_DIR)/$(APP_NAME).spec pkg-deb: pkg-src cp packaging/$(APP_NAME)-$(VERSION).tar.gz packaging/$(APP_NAME)-$(VERSION).orig.tar.gz cd packaging/ && tar axf $(APP_NAME)-$(VERSION).tar.gz cp -R packaging/debian packaging/$(APP_NAME)-$(VERSION) - cd packaging/$(APP_NAME)-$(VERSION) && dpkg-buildpackage -b rm -rf packaging/$(APP_NAME)-$(VERSION)* packaging/*.changes opendrim-lmp-cpu-1.1.0~ppa/registration/0000755000175000017500000000000011400667756021060 5ustar guillaumeguillaumeopendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_CacheMemory.sh0000755000175000017500000001123511400667756025252 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_CacheMemory.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_CacheMemory provider module"; Name = "CPU_OpenDRIM_CacheMemoryModule"; Location = "cmpiCPU_OpenDRIM_CacheMemoryProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_CacheMemory provider"; Name = "CPU_OpenDRIM_CacheMemoryProvider"; ProviderModuleName = "CPU_OpenDRIM_CacheMemoryModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_CacheMemory provider capabilities"; ProviderModuleName = "CPU_OpenDRIM_CacheMemoryModule"; ProviderName = "CPU_OpenDRIM_CacheMemoryProvider"; ClassName = "OpenDRIM_CacheMemory"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"Caption", "Description", "ElementName", "InstallDate", "OperationalStatus", "StatusDescriptions", "Status", "HealthState", "PrimaryStatus", "DetailedStatus", "OperatingStatus", "CommunicationStatus", "EnabledState", "OtherEnabledState", "RequestedState", "EnabledDefault", "TimeOfLastStateChange", "AvailableRequestedStates", "TransitioningToState", "SystemCreationClassName", "SystemName", "CreationClassName", "DeviceID", "PowerManagementSupported", "PowerManagementCapabilities", "Availability", "StatusInfo", "LastErrorCode", "ErrorDescription", "ErrorCleared", "OtherIdentifyingInfo", "PowerOnHours", "TotalPowerOnHours", "IdentifyingDescriptions", "AdditionalAvailability", "MaxQuiesceTime", "LocationIndicator", "DataOrganization", "Purpose", "Access", "BlockSize", "NumberOfBlocks", "ConsumableBlocks", "IsBasedOnUnderlyingRedundancy", "SequentialAccess", "ExtentStatus", "NoSinglePointOfFailure", "DataRedundancy", "PackageRedundancy", "DeltaReservation", "Primordial", "Name", "NameFormat", "NameNamespace", "OtherNameNamespace", "OtherNameFormat", "Usage", "OtherUsageDescription", "ClientSettableUsage", "Volatile", "ErrorMethodology", "StartingAddress", "EndingAddress", "ErrorInfo", "OtherErrorDescription", "CorrectableError", "ErrorTime", "ErrorAccess", "ErrorTransferSize", "ErrorData", "ErrorDataOrder", "ErrorAddress", "SystemLevelAddress", "ErrorResolution", "AdditionalErrorData"}; SupportedMethods = {"RequestStateChange", "SetPowerState", "Reset", "EnableDevice", "OnlineDevice", "QuiesceDevice", "SaveProperties", "RestoreProperties"}; CapabilityID = "CPU_OpenDRIM_CacheMemory"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_CacheMemory.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_AssociatedProcessorCoreCacheMemory-remove.sh0000755000175000017500000000664711400667756033271 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryModule cimprovider -r -m CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_AssociatedProcessorCoreCacheMemory.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_ProcessorProcessorCore.sh0000755000175000017500000000657611400667756027562 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_ProcessorProcessorCore.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_ProcessorProcessorCore provider module"; Name = "CPU_OpenDRIM_ProcessorProcessorCoreModule"; Location = "cmpiCPU_OpenDRIM_ProcessorProcessorCoreProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_ProcessorProcessorCore provider"; Name = "CPU_OpenDRIM_ProcessorProcessorCoreProvider"; ProviderModuleName = "CPU_OpenDRIM_ProcessorProcessorCoreModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_ProcessorProcessorCore provider capabilities"; ProviderModuleName = "CPU_OpenDRIM_ProcessorProcessorCoreModule"; ProviderName = "CPU_OpenDRIM_ProcessorProcessorCoreProvider"; ClassName = "OpenDRIM_ProcessorProcessorCore"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"GroupComponent", "PartComponent"}; CapabilityID = "CPU_OpenDRIM_ProcessorProcessorCore"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_ProcessorProcessorCore.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_AssociatedProcessorCoreCacheMemory.sh0000755000175000017500000000760611400667756031772 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_AssociatedProcessorCoreCacheMemory.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_AssociatedProcessorCoreCacheMemory provider module"; Name = "CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryModule"; Location = "cmpiCPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_AssociatedProcessorCoreCacheMemory provider"; Name = "CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProvider"; ProviderModuleName = "CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_AssociatedProcessorCoreCacheMemory provider capabilities"; ProviderModuleName = "CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryModule"; ProviderName = "CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProvider"; ClassName = "OpenDRIM_AssociatedProcessorCoreCacheMemory"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent", "Level", "OtherLevelDescription", "WritePolicy", "OtherWritePolicyDescription", "CacheType", "OtherCacheTypeDescription", "LineSize", "ReplacementPolicy", "OtherReplacementPolicyDescription", "ReadPolicy", "OtherReadPolicyDescription", "FlushTimer", "Associativity", "OtherAssociativityDescription"}; CapabilityID = "CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_AssociatedProcessorCoreCacheMemory.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_CacheMemory-remove.sh0000755000175000017500000000627411400667756026554 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m CPU_OpenDRIM_CacheMemoryModule cimprovider -r -m CPU_OpenDRIM_CacheMemoryModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_CacheMemory.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_ProcessorCore.sh0000755000175000017500000000725211400667756025652 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_ProcessorCore.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_ProcessorCore provider module"; Name = "CPU_OpenDRIM_ProcessorCoreModule"; Location = "cmpiCPU_OpenDRIM_ProcessorCoreProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_ProcessorCore provider"; Name = "CPU_OpenDRIM_ProcessorCoreProvider"; ProviderModuleName = "CPU_OpenDRIM_ProcessorCoreModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_ProcessorCore provider capabilities"; ProviderModuleName = "CPU_OpenDRIM_ProcessorCoreModule"; ProviderName = "CPU_OpenDRIM_ProcessorCoreProvider"; ClassName = "OpenDRIM_ProcessorCore"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"Caption", "Description", "ElementName", "InstallDate", "Name", "OperationalStatus", "StatusDescriptions", "Status", "HealthState", "PrimaryStatus", "DetailedStatus", "OperatingStatus", "CommunicationStatus", "EnabledState", "OtherEnabledState", "RequestedState", "EnabledDefault", "TimeOfLastStateChange", "AvailableRequestedStates", "TransitioningToState", "InstanceID", "CoreEnabledState", "Characteristics", "LoadPercentage", "MaxClockSpeed", "CurrentClockSpeed"}; SupportedMethods = {"RequestStateChange"}; CapabilityID = "CPU_OpenDRIM_ProcessorCore"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_ProcessorCore.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_Processor-remove.sh0000755000175000017500000000625011400667756026331 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m CPU_OpenDRIM_ProcessorModule cimprovider -r -m CPU_OpenDRIM_ProcessorModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_Processor.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_ProcessorCoreHardwareThread.sh0000755000175000017500000000673511400667756030465 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_ProcessorCoreHardwareThread.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_ProcessorCoreHardwareThread provider module"; Name = "CPU_OpenDRIM_ProcessorCoreHardwareThreadModule"; Location = "cmpiCPU_OpenDRIM_ProcessorCoreHardwareThreadProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_ProcessorCoreHardwareThread provider"; Name = "CPU_OpenDRIM_ProcessorCoreHardwareThreadProvider"; ProviderModuleName = "CPU_OpenDRIM_ProcessorCoreHardwareThreadModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_ProcessorCoreHardwareThread provider capabilities"; ProviderModuleName = "CPU_OpenDRIM_ProcessorCoreHardwareThreadModule"; ProviderName = "CPU_OpenDRIM_ProcessorCoreHardwareThreadProvider"; ClassName = "OpenDRIM_ProcessorCoreHardwareThread"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"GroupComponent", "PartComponent"}; CapabilityID = "CPU_OpenDRIM_ProcessorCoreHardwareThread"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_ProcessorCoreHardwareThread.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_ProcessorConformsToProfile-remove.sh0000755000175000017500000001045111400667756031662 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m CPU_OpenDRIM_ProcessorConformsToProfileModule cimprovider -r -m CPU_OpenDRIM_ProcessorConformsToProfileModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE cat >> $OUTFILE < EOFC namespace=$3 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_ProcessorConformsToProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE owmofc -u http://localhost/$3 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/CPU-remove.sh0000755000175000017500000000531111400667756023341 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then if !( ps -C cimserver > /dev/null 2>&1 ) then echo "ERROR: Pegasus CIM server is not running" exit 1 fi fi if test "$2" = openwbem then if !( ps -C owcimomd > /dev/null 2>&1 ) then echo "ERROR: OpenWBEM CIM server is not running" exit 1 fi fi if test "$2" = sfcb then /etc/init.d/sfcb stop fi $4/registration/OpenDRIM_AssociatedProcessorCacheMemory-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_ComputerSystemProcessor-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_ProcessorProcessorCore-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_HardwareThread-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_ProcessorCore-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_ProcessorCoreHardwareThread-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_AssociatedProcessorCoreCacheMemory-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_ProcessorConformsToProfile-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_CacheMemory-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_Processor-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_RegisteredCPUProfile-remove.sh $1 $2 $3 $4 if test "$2" = sfcb then /etc/init.d/sfcb start fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_RegisteredCPUProfile-remove.sh0000755000175000017500000000641711400667756030345 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m CPU_OpenDRIM_RegisteredCPUProfileModule cimprovider -r -m CPU_OpenDRIM_RegisteredCPUProfileModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$3 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_RegisteredCPUProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$3 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/CPU.sh0000755000175000017500000000527611400667756022060 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then if !( ps -C cimserver > /dev/null 2>&1 ) then echo "ERROR: Pegasus CIM server is not running" exit 1 fi fi if test "$3" = openwbem then if !( ps -C owcimomd > /dev/null 2>&1 ) then echo "ERROR: OpenWBEM CIM server is not running" exit 1 fi fi if test "$3" = sfcb then /etc/init.d/sfcb stop fi $6/registration/OpenDRIM_RegisteredCPUProfile.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_Processor.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_CacheMemory.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_ProcessorConformsToProfile.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_AssociatedProcessorCoreCacheMemory.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_ProcessorCoreHardwareThread.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_ProcessorCore.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_HardwareThread.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_ProcessorProcessorCore.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_ComputerSystemProcessor.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_AssociatedProcessorCacheMemory.sh $1 $2 $3 $4 $5 $6 if test "$3" = sfcb then /etc/init.d/sfcb start fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_ComputerSystemProcessor.sh0000755000175000017500000000662111400667756027764 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_ComputerSystemProcessor.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_ComputerSystemProcessor provider module"; Name = "CPU_OpenDRIM_ComputerSystemProcessorModule"; Location = "cmpiCPU_OpenDRIM_ComputerSystemProcessorProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_ComputerSystemProcessor provider"; Name = "CPU_OpenDRIM_ComputerSystemProcessorProvider"; ProviderModuleName = "CPU_OpenDRIM_ComputerSystemProcessorModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_ComputerSystemProcessor provider capabilities"; ProviderModuleName = "CPU_OpenDRIM_ComputerSystemProcessorModule"; ProviderName = "CPU_OpenDRIM_ComputerSystemProcessorProvider"; ClassName = "OpenDRIM_ComputerSystemProcessor"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"GroupComponent", "PartComponent"}; CapabilityID = "CPU_OpenDRIM_ComputerSystemProcessor"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_ComputerSystemProcessor.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_ComputerSystemProcessor-remove.sh0000755000175000017500000000647111400667756031262 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m CPU_OpenDRIM_ComputerSystemProcessorModule cimprovider -r -m CPU_OpenDRIM_ComputerSystemProcessorModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_ComputerSystemProcessor.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_AssociatedProcessorCacheMemory-remove.sh0000755000175000017500000000657711400667756032462 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m CPU_OpenDRIM_AssociatedProcessorCacheMemoryModule cimprovider -r -m CPU_OpenDRIM_AssociatedProcessorCacheMemoryModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_AssociatedProcessorCacheMemory.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_AssociatedProcessorCacheMemory.sh0000755000175000017500000000747211400667756031162 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_AssociatedProcessorCacheMemory.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_AssociatedProcessorCacheMemory provider module"; Name = "CPU_OpenDRIM_AssociatedProcessorCacheMemoryModule"; Location = "cmpiCPU_OpenDRIM_AssociatedProcessorCacheMemoryProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_AssociatedProcessorCacheMemory provider"; Name = "CPU_OpenDRIM_AssociatedProcessorCacheMemoryProvider"; ProviderModuleName = "CPU_OpenDRIM_AssociatedProcessorCacheMemoryModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_AssociatedProcessorCacheMemory provider capabilities"; ProviderModuleName = "CPU_OpenDRIM_AssociatedProcessorCacheMemoryModule"; ProviderName = "CPU_OpenDRIM_AssociatedProcessorCacheMemoryProvider"; ClassName = "OpenDRIM_AssociatedProcessorCacheMemory"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent", "Level", "OtherLevelDescription", "WritePolicy", "OtherWritePolicyDescription", "CacheType", "OtherCacheTypeDescription", "LineSize", "ReplacementPolicy", "OtherReplacementPolicyDescription", "ReadPolicy", "OtherReadPolicyDescription", "FlushTimer", "Associativity", "OtherAssociativityDescription"}; CapabilityID = "CPU_OpenDRIM_AssociatedProcessorCacheMemory"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_AssociatedProcessorCacheMemory.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_HardwareThread-remove.sh0000755000175000017500000000633211400667756027240 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m CPU_OpenDRIM_HardwareThreadModule cimprovider -r -m CPU_OpenDRIM_HardwareThreadModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_HardwareThread.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_HardwareThread.sh0000755000175000017500000000716011400667756025745 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_HardwareThread.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_HardwareThread provider module"; Name = "CPU_OpenDRIM_HardwareThreadModule"; Location = "cmpiCPU_OpenDRIM_HardwareThreadProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_HardwareThread provider"; Name = "CPU_OpenDRIM_HardwareThreadProvider"; ProviderModuleName = "CPU_OpenDRIM_HardwareThreadModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_HardwareThread provider capabilities"; ProviderModuleName = "CPU_OpenDRIM_HardwareThreadModule"; ProviderName = "CPU_OpenDRIM_HardwareThreadProvider"; ClassName = "OpenDRIM_HardwareThread"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"Caption", "Description", "ElementName", "InstallDate", "Name", "OperationalStatus", "StatusDescriptions", "Status", "HealthState", "PrimaryStatus", "DetailedStatus", "OperatingStatus", "CommunicationStatus", "EnabledState", "OtherEnabledState", "RequestedState", "EnabledDefault", "TimeOfLastStateChange", "AvailableRequestedStates", "TransitioningToState", "InstanceID", "LoadPercentage"}; SupportedMethods = {"RequestStateChange"}; CapabilityID = "CPU_OpenDRIM_HardwareThread"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_HardwareThread.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_ProcessorCore-remove.sh0000755000175000017500000000632011400667756027140 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m CPU_OpenDRIM_ProcessorCoreModule cimprovider -r -m CPU_OpenDRIM_ProcessorCoreModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_ProcessorCore.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_ProcessorProcessorCore-remove.sh0000755000175000017500000000645711400667756031053 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m CPU_OpenDRIM_ProcessorProcessorCoreModule cimprovider -r -m CPU_OpenDRIM_ProcessorProcessorCoreModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_ProcessorProcessorCore.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_Processor.sh0000755000175000017500000001031711400667756025035 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_Processor.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_Processor provider module"; Name = "CPU_OpenDRIM_ProcessorModule"; Location = "cmpiCPU_OpenDRIM_ProcessorProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_Processor provider"; Name = "CPU_OpenDRIM_ProcessorProvider"; ProviderModuleName = "CPU_OpenDRIM_ProcessorModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_Processor provider capabilities"; ProviderModuleName = "CPU_OpenDRIM_ProcessorModule"; ProviderName = "CPU_OpenDRIM_ProcessorProvider"; ClassName = "OpenDRIM_Processor"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"Caption", "Description", "ElementName", "InstallDate", "Name", "OperationalStatus", "StatusDescriptions", "Status", "HealthState", "PrimaryStatus", "DetailedStatus", "OperatingStatus", "CommunicationStatus", "EnabledState", "OtherEnabledState", "RequestedState", "EnabledDefault", "TimeOfLastStateChange", "AvailableRequestedStates", "TransitioningToState", "SystemCreationClassName", "SystemName", "CreationClassName", "DeviceID", "PowerManagementSupported", "PowerManagementCapabilities", "Availability", "StatusInfo", "LastErrorCode", "ErrorDescription", "ErrorCleared", "OtherIdentifyingInfo", "PowerOnHours", "TotalPowerOnHours", "IdentifyingDescriptions", "AdditionalAvailability", "MaxQuiesceTime", "LocationIndicator", "Role", "Family", "OtherFamilyDescription", "UpgradeMethod", "MaxClockSpeed", "CurrentClockSpeed", "DataWidth", "AddressWidth", "LoadPercentage", "Stepping", "UniqueID", "CPUStatus", "ExternalBusClockSpeed", "Characteristics", "NumberOfEnabledCores"}; SupportedMethods = {"RequestStateChange", "SetPowerState", "Reset", "EnableDevice", "OnlineDevice", "QuiesceDevice", "SaveProperties", "RestoreProperties"}; CapabilityID = "CPU_OpenDRIM_Processor"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_Processor.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_RegisteredCPUProfile.sh0000755000175000017500000000675411400667756027056 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $4 $6/mof/OpenDRIM_RegisteredCPUProfile.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_RegisteredCPUProfile provider module"; Name = "CPU_OpenDRIM_RegisteredCPUProfileModule"; Location = "cmpiCPU_OpenDRIM_RegisteredCPUProfileProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_RegisteredCPUProfile provider"; Name = "CPU_OpenDRIM_RegisteredCPUProfileProvider"; ProviderModuleName = "CPU_OpenDRIM_RegisteredCPUProfileModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_RegisteredCPUProfile provider capabilities"; ProviderModuleName = "CPU_OpenDRIM_RegisteredCPUProfileModule"; ProviderName = "CPU_OpenDRIM_RegisteredCPUProfileProvider"; ClassName = "OpenDRIM_RegisteredCPUProfile"; ProviderType = {2}; Namespaces = {"$4"}; SupportedProperties = {"Caption", "Description", "ElementName", "InstanceID", "RegisteredOrganization", "OtherRegisteredOrganization", "RegisteredName", "RegisteredVersion", "AdvertiseTypes", "AdvertiseTypeDescriptions"}; CapabilityID = "CPU_OpenDRIM_RegisteredCPUProfile"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_RegisteredCPUProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$4 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_ProcessorCoreHardwareThread-remove.sh0000755000175000017500000000654111400667756031753 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m CPU_OpenDRIM_ProcessorCoreHardwareThreadModule cimprovider -r -m CPU_OpenDRIM_ProcessorCoreHardwareThreadModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_ProcessorCoreHardwareThread.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/registration/OpenDRIM_ProcessorConformsToProfile.sh0000755000175000017500000000721511400667756030373 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_ProcessorConformsToProfile.mof cimmof -aE -n $4 $6/mof/OpenDRIM_ProcessorConformsToProfile.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_ProcessorConformsToProfile provider module"; Name = "CPU_OpenDRIM_ProcessorConformsToProfileModule"; Location = "cmpiCPU_OpenDRIM_ProcessorConformsToProfileProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_ProcessorConformsToProfile provider"; Name = "CPU_OpenDRIM_ProcessorConformsToProfileProvider"; ProviderModuleName = "CPU_OpenDRIM_ProcessorConformsToProfileModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_ProcessorConformsToProfile provider capabilities"; ProviderModuleName = "CPU_OpenDRIM_ProcessorConformsToProfileModule"; ProviderName = "CPU_OpenDRIM_ProcessorConformsToProfileProvider"; ClassName = "OpenDRIM_ProcessorConformsToProfile"; ProviderType = {2, 3}; Namespaces = {"$1", "$4"}; SupportedProperties = {"ConformantStandard", "ManagedElement"}; CapabilityID = "CPU_OpenDRIM_ProcessorConformsToProfile"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_ProcessorConformsToProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE owmofc -u http://localhost/$4 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-cpu-1.1.0~ppa/cpuinfo/0000755000175000017500000000000011400667756020011 5ustar guillaumeguillaumeopendrim-lmp-cpu-1.1.0~ppa/cpuinfo/AMD Athlon(tm) 64 X2 Dual Core Processor 4200+0000644000175000017500000000231311400667756027010 0ustar guillaumeguillaumeprocessor : 0 vendor_id : AuthenticAMD cpu family : 15 model : 75 model name : AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ stepping : 2 cpu MHz : 2204.724 cache size : 512 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8legacy ts fid vid ttp tm stc bogomips : 4411.40 clflush size : 64 processor : 1 vendor_id : AuthenticAMD cpu family : 15 model : 75 model name : AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ stepping : 2 cpu MHz : 2204.724 cache size : 512 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8legacy ts fid vid ttp tm stc bogomips : 4408.58 clflush size : 64 opendrim-lmp-cpu-1.1.0~ppa/cpuinfo/Intel(R) Xeon(TM) CPU 3.00GHz(virtual_machine)0000644000175000017500000001163011400667756027325 0ustar guillaumeguillaumeprocessor : 0 vendor_id : GenuineIntel cpu family : 15 model : 6 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 4 cpu MHz : 1992.000 cache size : 2048 KB physical id : 0 siblings : 1 core id : 0 cpu cores : 1 fpu : yes fpu_exception : yes cpuid level : 6 wp : yes flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est cid cx16 xtpr lahf_lm bogomips : 7487.60 clflush size : 64 cache_alignment : 128 address sizes : 36 bits physical, 48 bits virtual power management: processor : 1 vendor_id : GenuineIntel cpu family : 15 model : 6 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 4 cpu MHz : 1992.000 cache size : 2048 KB physical id : 1 siblings : 1 core id : 0 cpu cores : 1 fpu : yes fpu_exception : yes cpuid level : 6 wp : yes flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est cid cx16 xtpr lahf_lm bogomips : 7487.60 clflush size : 64 cache_alignment : 128 address sizes : 36 bits physical, 48 bits virtual power management: processor : 2 vendor_id : GenuineIntel cpu family : 15 model : 6 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 4 cpu MHz : 1992.000 cache size : 2048 KB physical id : 2 siblings : 1 core id : 0 cpu cores : 1 fpu : yes fpu_exception : yes cpuid level : 6 wp : yes flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est cid cx16 xtpr lahf_lm bogomips : 7487.60 clflush size : 64 cache_alignment : 128 address sizes : 36 bits physical, 48 bits virtual power management: processor : 3 vendor_id : GenuineIntel cpu family : 15 model : 6 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 4 cpu MHz : 1992.000 cache size : 2048 KB physical id : 3 siblings : 1 core id : 0 cpu cores : 1 fpu : yes fpu_exception : yes cpuid level : 6 wp : yes flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est cid cx16 xtpr lahf_lm bogomips : 7487.60 clflush size : 64 cache_alignment : 128 address sizes : 36 bits physical, 48 bits virtual power management: processor : 4 vendor_id : GenuineIntel cpu family : 15 model : 6 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 4 cpu MHz : 1992.000 cache size : 2048 KB physical id : 4 siblings : 1 core id : 0 cpu cores : 1 fpu : yes fpu_exception : yes cpuid level : 6 wp : yes flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est cid cx16 xtpr lahf_lm bogomips : 7487.60 clflush size : 64 cache_alignment : 128 address sizes : 36 bits physical, 48 bits virtual power management: processor : 5 vendor_id : GenuineIntel cpu family : 15 model : 6 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 4 cpu MHz : 1992.000 cache size : 2048 KB physical id : 5 siblings : 1 core id : 0 cpu cores : 1 fpu : yes fpu_exception : yes cpuid level : 6 wp : yes flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est cid cx16 xtpr lahf_lm bogomips : 7487.60 clflush size : 64 cache_alignment : 128 address sizes : 36 bits physical, 48 bits virtual power management: processor : 6 vendor_id : GenuineIntel cpu family : 15 model : 6 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 4 cpu MHz : 1992.000 cache size : 2048 KB physical id : 6 siblings : 1 core id : 0 cpu cores : 1 fpu : yes fpu_exception : yes cpuid level : 6 wp : yes flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est cid cx16 xtpr lahf_lm bogomips : 7487.60 clflush size : 64 cache_alignment : 128 address sizes : 36 bits physical, 48 bits virtual power management: processor : 7 vendor_id : GenuineIntel cpu family : 15 model : 6 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 4 cpu MHz : 1992.000 cache size : 2048 KB physical id : 7 siblings : 1 core id : 0 cpu cores : 1 fpu : yes fpu_exception : yes cpuid level : 6 wp : yes flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est cid cx16 xtpr lahf_lm bogomips : 7487.60 clflush size : 64 cache_alignment : 128 address sizes : 36 bits physical, 48 bits virtual power management: opendrim-lmp-cpu-1.1.0~ppa/cpuinfo/Genuine Intel(R) CPU 1400 @ 1.83GHz0000644000175000017500000000253111400667756024726 0ustar guillaumeguillaumeprocessor : 0 vendor_id : GenuineIntel cpu family : 6 model : 14 model name : Genuine Intel(R) CPU 1400 @ 1.83GHz stepping : 8 cpu MHz : 1833.000 cache size : 2048 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 6 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc pni monitor vmx est tm2 xtpr bogomips : 3670.57 processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 14 model name : Genuine Intel(R) CPU 1400 @ 1.83GHz stepping : 8 cpu MHz : 1833.000 cache size : 2048 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 6 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc pni monitor vmx est tm2 xtpr bogomips : 3666.73 opendrim-lmp-cpu-1.1.0~ppa/cpuinfo/AMD-K7(tm) Processor0000644000175000017500000000100111400667756023226 0ustar guillaumeguillaumeprocessor : 0 vendor_id : AuthenticAMD cpu family : 6 model : 1 model name : AMD-K7(tm) Processor stepping : 2 cpu MHz : 598.911 cache size : 512 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat mmx syscall mmxext 3dnowext 3dnow up bogomips : 1199.01 opendrim-lmp-cpu-1.1.0~ppa/cpuinfo/mobile AMD Athlon(tm) XP 1600+0000644000175000017500000000067111400667756024413 0ustar guillaumeguillaumeprocessor : 0 vendor_id : AuthenticAMD cpu family : 6 model : 8 model name : mobile AMD Athlon(tm) XP 1600+ stepping : 0 cpu MHz : 662.590 cache size : 256 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mp mmxext 3dnowext 3dnow up ts fid vid bogomips : 1325.90 clflush size : 32 opendrim-lmp-cpu-1.1.0~ppa/cpuinfo/Dual Core AMD Opteron(tm) Processor 2650000644000175000017500000000561711400667756026413 0ustar guillaumeguillaumeprocessor : 0 vendor_id : AuthenticAMD cpu family : 15 model : 33 model name : Dual Core AMD Opteron(tm) Processor 265 stepping : 2 cpu MHz : 1795.496 cache size : 1024 KB physical id : 0 siblings : 1 core id : 0 cpu cores : 1 fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu tsc msr pae mce cx8 apic mca cmov pat pse36 clflush mmx fxsr sse s se2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm cmp_legacy bogomips : 3593.09 TLB size : 1024 4K pages clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: ts fid vid ttp processor : 1 vendor_id : AuthenticAMD cpu family : 15 model : 33 model name : Dual Core AMD Opteron(tm) Processor 265 stepping : 2 cpu MHz : 1795.496 cache size : 1024 KB physical id : 1 siblings : 1 core id : 0 cpu cores : 1 fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu tsc msr pae mce cx8 apic mca cmov pat pse36 clflush mmx fxsr sse s se2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm cmp_legacy bogomips : 3593.09 TLB size : 1024 4K pages clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: ts fid vid ttp processor : 2 vendor_id : AuthenticAMD cpu family : 15 model : 33 model name : Dual Core AMD Opteron(tm) Processor 265 stepping : 2 cpu MHz : 1795.496 cache size : 1024 KB physical id : 2 siblings : 1 core id : 0 cpu cores : 1 fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu tsc msr pae mce cx8 apic mca cmov pat pse36 clflush mmx fxsr sse s se2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm cmp_legacy bogomips : 3593.09 TLB size : 1024 4K pages clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: ts fid vid ttp processor : 3 vendor_id : AuthenticAMD cpu family : 15 model : 33 model name : Dual Core AMD Opteron(tm) Processor 265 stepping : 2 cpu MHz : 1795.496 cache size : 1024 KB physical id : 3 siblings : 1 core id : 0 cpu cores : 1 fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu tsc msr pae mce cx8 apic mca cmov pat pse36 clflush mmx fxsr sse s se2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm cmp_legacy bogomips : 3593.09 TLB size : 1024 4K pages clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: ts fid vid ttp opendrim-lmp-cpu-1.1.0~ppa/cpuinfo/AMD Athlon(tm) 64 X2 Dual Core Processor 5600+0000644000175000017500000000310711400667756027017 0ustar guillaumeguillaumeprocessor : 0 vendor_id : AuthenticAMD cpu family : 15 model : 67 model name : AMD Athlon(tm) 64 X2 Dual Core Processor 5600+ stepping : 3 cpu MHz : 2940.719 cache size : 1024 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8_legacy bogomips : 5887.88 TLB size : 1024 4K pages clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: ts fid vid ttp tm stc processor : 1 vendor_id : AuthenticAMD cpu family : 15 model : 67 model name : AMD Athlon(tm) 64 X2 Dual Core Processor 5600+ stepping : 3 cpu MHz : 2940.719 cache size : 1024 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8_legacy bogomips : 5881.68 TLB size : 1024 4K pages clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: ts fid vid ttp tm stc opendrim-lmp-cpu-1.1.0~ppa/cpuinfo/Intel(R) Xeon(TM) CPU 3.00GHz0000644000175000017500000001157011400667756024114 0ustar guillaumeguillaumeprocessor : 0 vendor_id : GenuineIntel cpu family : 15 model : 6 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 4 cpu MHz : 1992.000 cache size : 2048 KB physical id : 0 siblings : 4 core id : 0 cpu cores : 2 fpu : yes fpu_exception : yes cpuid level : 6 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est cid cx16 xtpr lahf_lm bogomips : 5991.63 clflush size : 64 cache_alignment : 128 address sizes : 36 bits physical, 48 bits virtual power management: processor : 1 vendor_id : GenuineIntel cpu family : 15 model : 6 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 4 cpu MHz : 1992.000 cache size : 2048 KB physical id : 0 siblings : 4 core id : 1 cpu cores : 2 fpu : yes fpu_exception : yes cpuid level : 6 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est cid cx16 xtpr lahf_lm bogomips : 5985.27 clflush size : 64 cache_alignment : 128 address sizes : 36 bits physical, 48 bits virtual power management: processor : 2 vendor_id : GenuineIntel cpu family : 15 model : 6 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 4 cpu MHz : 1992.000 cache size : 2048 KB physical id : 1 siblings : 4 core id : 0 cpu cores : 2 fpu : yes fpu_exception : yes cpuid level : 6 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est cid cx16 xtpr lahf_lm bogomips : 5985.30 clflush size : 64 cache_alignment : 128 address sizes : 36 bits physical, 48 bits virtual power management: processor : 3 vendor_id : GenuineIntel cpu family : 15 model : 6 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 4 cpu MHz : 1992.000 cache size : 2048 KB physical id : 1 siblings : 4 core id : 1 cpu cores : 2 fpu : yes fpu_exception : yes cpuid level : 6 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est cid cx16 xtpr lahf_lm bogomips : 5985.26 clflush size : 64 cache_alignment : 128 address sizes : 36 bits physical, 48 bits virtual power management: processor : 4 vendor_id : GenuineIntel cpu family : 15 model : 6 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 4 cpu MHz : 2988.000 cache size : 2048 KB physical id : 0 siblings : 4 core id : 0 cpu cores : 2 fpu : yes fpu_exception : yes cpuid level : 6 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est cid cx16 xtpr lahf_lm bogomips : 5985.33 clflush size : 64 cache_alignment : 128 address sizes : 36 bits physical, 48 bits virtual power management: processor : 5 vendor_id : GenuineIntel cpu family : 15 model : 6 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 4 cpu MHz : 2988.000 cache size : 2048 KB physical id : 0 siblings : 4 core id : 1 cpu cores : 2 fpu : yes fpu_exception : yes cpuid level : 6 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est cid cx16 xtpr lahf_lm bogomips : 5985.00 clflush size : 64 cache_alignment : 128 address sizes : 36 bits physical, 48 bits virtual power management: processor : 6 vendor_id : GenuineIntel cpu family : 15 model : 6 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 4 cpu MHz : 1992.000 cache size : 2048 KB physical id : 1 siblings : 4 core id : 0 cpu cores : 2 fpu : yes fpu_exception : yes cpuid level : 6 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est cid cx16 xtpr lahf_lm bogomips : 5985.26 clflush size : 64 cache_alignment : 128 address sizes : 36 bits physical, 48 bits virtual power management: processor : 7 vendor_id : GenuineIntel cpu family : 15 model : 6 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 4 cpu MHz : 1992.000 cache size : 2048 KB physical id : 1 siblings : 4 core id : 1 cpu cores : 2 fpu : yes fpu_exception : yes cpuid level : 6 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est cid cx16 xtpr lahf_lm bogomips : 5985.29 clflush size : 64 cache_alignment : 128 address sizes : 36 bits physical, 48 bits virtual power management: opendrim-lmp-cpu-1.1.0~ppa/cpuinfo/Intel(R) Pentium(R) 4 CPU 3.06GHz0000644000175000017500000000244111400667756024634 0ustar guillaumeguillaumeprocessor : 0 vendor_id : GenuineIntel cpu family : 15 model : 2 model name : Intel(R) Pentium(R) 4 CPU 3.06GHz stepping : 9 cpu MHz : 3066.348 cache size : 512 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 1 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr bogomips : 6134.91 clflush size : 64 processor : 1 vendor_id : GenuineIntel cpu family : 15 model : 2 model name : Intel(R) Pentium(R) 4 CPU 3.06GHz stepping : 9 cpu MHz : 3066.348 cache size : 512 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 1 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr bogomips : 6132.19 clflush size : 64 opendrim-lmp-cpu-1.1.0~ppa/cpuinfo/Intel(R) Core(TM)2 CPU T7400 @ 2.16GHz0000644000175000017500000000304111400667756025014 0ustar guillaumeguillaumeprocessor : 0 vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Core(TM)2 CPU T7400 @ 2.16GHz stepping : 6 cpu MHz : 1000.000 cache size : 4096 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm bogomips : 4327.50 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management: processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Core(TM)2 CPU T7400 @ 2.16GHz stepping : 6 cpu MHz : 1000.000 cache size : 4096 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm bogomips : 4322.47 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management: opendrim-lmp-cpu-1.1.0~ppa/cpuinfo/AMD Athlon(tm) 64 Processor 3200+0000644000175000017500000000113711400667756025021 0ustar guillaumeguillaumeprocessor : 0 vendor_id : AuthenticAMD cpu family : 15 model : 47 model name : AMD Athlon(tm) 64 Processor 3200+ stepping : 2 cpu MHz : 1000.000 cache size : 512 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt lm 3dnowext 3dnow up pni lahf_lm ts fid vid ttp tm stc bogomips : 2011.55 opendrim-lmp-cpu-1.1.0~ppa/cpuinfo/Genuine Intel(R) CPU T2500 @ 2.00GHz0000644000175000017500000000257711400667756025054 0ustar guillaumeguillaumeprocessor : 0 vendor_id : GenuineIntel cpu family : 6 model : 14 model name : Genuine Intel(R) CPU T2500 @ 2.00GHz stepping : 8 cpu MHz : 1000.000 cache size : 2048 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc pni monitor vmx est tm2 xtpr bogomips : 3999.30 processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 14 model name : Genuine Intel(R) CPU T2500 @ 2.00GHz stepping : 8 cpu MHz : 1000.000 cache size : 2048 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc pni monitor vmx est tm2 xtpr bogomips : 3994.61 opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorProcessorCore/0000755000175000017500000000000011400667756024473 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorProcessorCore/OpenDRIM_ProcessorProcessorCoreAccess.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorProcessorCore/OpenDRIM_ProcessorProcessorCoreAccess.cpp0000644000175000017500000002667711400667756034470 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_ProcessorProcessorCoreAccess.h" int CPU_OpenDRIM_ProcessorProcessorCore_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(CPU_CIM_ManagedElement_load(broker, errorMessage)); CF_assert(CPU_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int CPU_OpenDRIM_ProcessorProcessorCore_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(CPU_CIM_ManagedElement_unload(errorMessage)); CF_assert(CPU_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int CPU_OpenDRIM_ProcessorProcessorCore_isAssociated(const Instance& PartComponent, const Instance& GroupComponent, bool& isAssociated, string& errorMessage) { _E_; // Determine if the association can be established or not isAssociated=false; string processor_device_id; string core_instance_id; GroupComponent.getProperty("DeviceID", processor_device_id); PartComponent.getProperty("InstanceID", core_instance_id); // processor DeviceID must be numerical if (!CF_isNumber(processor_device_id)) return OK; unsigned int _processor_device_id = atoll(processor_device_id.c_str()); // processor core InstanceID must contain 2 numerical values seperated by ':' vector core_instance_id_elements; CF_splitText(core_instance_id_elements, core_instance_id, ':'); if (core_instance_id_elements.size() != 2) return OK; if (!CF_isNumber(core_instance_id_elements[0]) || !CF_isNumber(core_instance_id_elements[1])) return OK; unsigned int first_core_instance_id_element = atoll(core_instance_id_elements[0].c_str()); // the first element of the core InstanceID must match the processor DeviceID if (first_core_instance_id_element == _processor_device_id) isAssociated=true; _L_; return OK; } int CPU_OpenDRIM_ProcessorProcessorCore_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector subjects; // Only get the instance names CF_assert(CPU_OpenDRIM_ProcessorProcessorCore_enumeratePartComponents(broker, ctx, subjects, NULL, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(CPU_OpenDRIM_ProcessorProcessorCore_enumeratePartComponents(broker, ctx, subjects, NULL, false, errorMessage)); vector::iterator c = subjects.begin(); vector::iterator end = subjects.end(); for (; c != end; ++c) { bool leftToRight = true; vector associatedInstances; CPU_OpenDRIM_ProcessorProcessorCore_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), PartComponent_classnames[0], GroupComponent_classnames[0], PartComponent_role.c_str(), GroupComponent_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(CPU_OpenDRIM_ProcessorProcessorCore_referencePartComponentToGroupComponent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int CPU_OpenDRIM_ProcessorProcessorCore_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ProcessorProcessorCore& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath PartComponent_objectpath; instance.getPartComponent(PartComponent_objectpath); Instance PartComponent_instance; CF_assert(CPU_OpenDRIM_ProcessorProcessorCore_getPartComponent(broker, ctx, PartComponent_objectpath, PartComponent_instance, NULL, errorMessage)); Objectpath GroupComponent_objectpath; instance.getGroupComponent(GroupComponent_objectpath); Instance GroupComponent_instance; CF_assert(CPU_OpenDRIM_ProcessorProcessorCore_getGroupComponent(broker, ctx, GroupComponent_objectpath, GroupComponent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(CPU_OpenDRIM_ProcessorProcessorCore_isAssociated(PartComponent_instance, GroupComponent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int CPU_OpenDRIM_ProcessorProcessorCore_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorProcessorCore& newInstance, const OpenDRIM_ProcessorProcessorCore& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_ProcessorProcessorCore_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorProcessorCore& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_ProcessorProcessorCore_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorProcessorCore& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_ProcessorProcessorCore_associatorPartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const char** properties, vector& GroupComponent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector GroupComponent_instances; if (discriminant=="a") CF_assert(CPU_OpenDRIM_ProcessorProcessorCore_enumerateGroupComponents(broker, ctx, GroupComponent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(CPU_OpenDRIM_ProcessorProcessorCore_enumerateGroupComponents(broker, ctx, GroupComponent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(CPU_OpenDRIM_ProcessorProcessorCore_enumerateGroupComponents(broker, ctx, GroupComponent_instances, properties, false, errorMessage)); } for (size_t i=0; i& PartComponent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector PartComponent_instances; if (discriminant=="a") CF_assert(CPU_OpenDRIM_ProcessorProcessorCore_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(CPU_OpenDRIM_ProcessorProcessorCore_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(CPU_OpenDRIM_ProcessorProcessorCore_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, false, errorMessage)); } for (size_t i=0; i& GroupComponent_instances, vector& OpenDRIM_ProcessorProcessorCore_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < GroupComponent_instances.size(); i++) { OpenDRIM_ProcessorProcessorCore instance; instance.setPartComponent(((Instance) PartComponent_instance).getObjectpath()); instance.setGroupComponent(((Instance) GroupComponent_instances[i]).getObjectpath()); OpenDRIM_ProcessorProcessorCore_instances.push_back(instance); } _L_; return OK; } int CPU_OpenDRIM_ProcessorProcessorCore_referenceGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const vector& PartComponent_instances, vector& OpenDRIM_ProcessorProcessorCore_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < PartComponent_instances.size(); i++) { OpenDRIM_ProcessorProcessorCore instance; instance.setPartComponent(((Instance) PartComponent_instances[i]).getObjectpath()); instance.setGroupComponent(((Instance) GroupComponent_instance).getObjectpath()); OpenDRIM_ProcessorProcessorCore_instances.push_back(instance); } _L_; return OK; } int CPU_OpenDRIM_ProcessorProcessorCore_populate(OpenDRIM_ProcessorProcessorCore& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorProcessorCore/Makefile.am0000644000175000017500000000504511400667756026533 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiCPU_OpenDRIM_ProcessorProcessorCoreProvider.la libcmpiCPU_OpenDRIM_ProcessorProcessorCoreProvider_la_SOURCES = OpenDRIM_ProcessorProcessorCoreAccess.cpp OpenDRIM_ProcessorProcessorCoreProvider.cpp cmpiOpenDRIM_ProcessorProcessorCore.cpp assocOpenDRIM_ProcessorProcessorCore.cpp # May have to be adjusted for direct invocation libcmpiCPU_OpenDRIM_ProcessorProcessorCoreProvider_la_CPPFLAGS = -I../CIM_ManagedElement -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiCPU_OpenDRIM_ProcessorProcessorCoreProvider_la_LIBADD = ../Common/libcmpiCPU_Common.la #../CIM_ManagedElement/libcmpiCPU_CIM_ManagedElementProvider.la ../CIM_ManagedElement/libcmpiCPU_CIM_ManagedElementProvider.la libcmpiCPU_OpenDRIM_ProcessorProcessorCoreProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_ProcessorProcessorCore.h OpenDRIM_ProcessorProcessorCore.h OpenDRIM_ProcessorProcessorCoreAccess.h ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorProcessorCore/OpenDRIM_ProcessorProcessorCoreProvider.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorProcessorCore/OpenDRIM_ProcessorProcessorCoreProvider.c0000644000175000017500000004220211400667756034477 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ProcessorProcessorCore.h" #include "OpenDRIM_ProcessorProcessorCoreAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define CPU_OpenDRIM_ProcessorProcessorCoreProviderSetInstance CPU_OpenDRIM_ProcessorProcessorCoreProviderModifyInstance #endif int CPU_OpenDRIM_ProcessorProcessorCore_init(const CMPIBroker* broker); int CPU_OpenDRIM_ProcessorProcessorCore_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_ProcessorProcessorCoreProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_ProcessorProcessorCore_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorProcessorCoreProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorProcessorCore_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = CPU_OpenDRIM_ProcessorProcessorCore_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorProcessorCoreProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorProcessorCore_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = CPU_OpenDRIM_ProcessorProcessorCore_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorProcessorCoreProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ProcessorProcessorCore instance; CPU_OpenDRIM_ProcessorProcessorCore_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorProcessorCore_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = CPU_OpenDRIM_ProcessorProcessorCore_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorProcessorCoreProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ProcessorProcessorCore newInstance, oldInstance; CPU_OpenDRIM_ProcessorProcessorCore_toCPP(_broker, ci, newInstance); CPU_OpenDRIM_ProcessorProcessorCore_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorProcessorCore_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_ProcessorProcessorCore_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorProcessorCoreProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ProcessorProcessorCore instance; CPU_OpenDRIM_ProcessorProcessorCore_toCPP(_broker, ci, instance); string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorProcessorCore_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_ProcessorProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_ProcessorProcessorCore_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_ProcessorProcessorCore_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = CPU_OpenDRIM_ProcessorProcessorCore_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorProcessorCoreProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ProcessorProcessorCore instance; CPU_OpenDRIM_ProcessorProcessorCore_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorProcessorCore_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_ProcessorProcessorCore_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorProcessorCoreProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Association Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_ProcessorProcessorCoreProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_ProcessorProcessorCore_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorProcessorCoreProviderAssociatorNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_ProcessorProcessorCore_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnObjectPath(rslt, associatedInstances[i].getObjectpath().getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorProcessorCoreProviderAssociators(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_ProcessorProcessorCore_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnInstance(rslt, associatedInstances[i].getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorProcessorCoreProviderReferenceNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_ProcessorProcessorCore_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = CPU_OpenDRIM_ProcessorProcessorCore_referencePartComponentToGroupComponent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = CPU_OpenDRIM_ProcessorProcessorCore_referenceGroupComponentToPartComponent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = CPU_OpenDRIM_ProcessorProcessorCore_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorProcessorCoreProviderReferences(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_ProcessorProcessorCore_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = CPU_OpenDRIM_ProcessorProcessorCore_referencePartComponentToGroupComponent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = CPU_OpenDRIM_ProcessorProcessorCore_referenceGroupComponentToPartComponent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = CPU_OpenDRIM_ProcessorProcessorCore_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int CPU_OpenDRIM_ProcessorProcessorCore_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorProcessorCore_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_ProcessorProcessorCore_init FAILED: " + (string) OpenDRIM_ProcessorProcessorCore_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int CPU_OpenDRIM_ProcessorProcessorCore_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorProcessorCore_unload(errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_ProcessorProcessorCore_unload FAILED: " + (string) OpenDRIM_ProcessorProcessorCore_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define CPU_OpenDRIM_ProcessorProcessorCore_INIT if (CPU_OpenDRIM_ProcessorProcessorCore_init(_broker) < 0) return NULL CMInstanceMIStub(CPU_OpenDRIM_ProcessorProcessorCoreProvider, CPU_OpenDRIM_ProcessorProcessorCoreProvider, _broker, CPU_OpenDRIM_ProcessorProcessorCore_INIT); CMAssociationMIStub(CPU_OpenDRIM_ProcessorProcessorCoreProvider, CPU_OpenDRIM_ProcessorProcessorCoreProvider, _broker, CPU_OpenDRIM_ProcessorProcessorCore_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorProcessorCore/cmpiOpenDRIM_ProcessorProcessorCore.h0000644000175000017500000000447711400667756033656 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_PROCESSORPROCESSORCORE_H_ #define CMPIOPENDRIM_PROCESSORPROCESSORCORE_H_ #include "OpenDRIM_ProcessorProcessorCore.h" CMPIObjectPath* CPU_OpenDRIM_ProcessorProcessorCore_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ProcessorProcessorCore& instance); CMPIInstance* CPU_OpenDRIM_ProcessorProcessorCore_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ProcessorProcessorCore& instance); void CPU_OpenDRIM_ProcessorProcessorCore_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ProcessorProcessorCore& instance); void CPU_OpenDRIM_ProcessorProcessorCore_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ProcessorProcessorCore& instance); #endif /*CMPIOPENDRIM_PROCESSORPROCESSORCORE_H_*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorProcessorCore/OpenDRIM_ProcessorProcessorCore.h0000644000175000017500000000717611400667756033004 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PROCESSORPROCESSORCORE_H_ #define OPENDRIM_PROCESSORPROCESSORCORE_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_ManagedElement.h" #include "CIM_ManagedElementAccess.h" #include "cmpiCIM_ManagedElement.h" #include "CIM_ManagedElementAccess.h" */ const static char* OpenDRIM_ProcessorProcessorCore_classnames[] = {"OpenDRIM_ProcessorProcessorCore"}; static string OpenDRIM_ProcessorProcessorCore_NAMESPACE = _NAMESPACE; const static string PartComponent_role = "PartComponent"; const static char* PartComponent_classnames[] = {"OpenDRIM_ProcessorCore"}; const static string PartComponent_NAMESPACE = _NAMESPACE; const static string GroupComponent_role = "GroupComponent"; const static char* GroupComponent_classnames[] = {"OpenDRIM_Processor"}; const static string GroupComponent_NAMESPACE = _NAMESPACE; class OpenDRIM_ProcessorProcessorCore { public: Objectpath GroupComponent; bool GroupComponent_isNULL; Objectpath PartComponent; bool PartComponent_isNULL; OpenDRIM_ProcessorProcessorCore() { GroupComponent_isNULL = true; PartComponent_isNULL = true; } ~OpenDRIM_ProcessorProcessorCore() {} string getKeys() const { return CF_toLowCase(".GroupComponent=\"" + CF_quoteString(GroupComponent.toString()) + "\""".PartComponent=\"" + CF_quoteString(PartComponent.toString()) + "\""); } int getGroupComponent(Objectpath& value) const { if (GroupComponent_isNULL==true) return NOT_FOUND; value = GroupComponent; return OK; } int setGroupComponent(const Objectpath& newValue) { GroupComponent = newValue; GroupComponent.setNamespace(GroupComponent_NAMESPACE); GroupComponent_isNULL = false; return OK; } int getPartComponent(Objectpath& value) const { if (PartComponent_isNULL==true) return NOT_FOUND; value = PartComponent; return OK; } int setPartComponent(const Objectpath& newValue) { PartComponent = newValue; PartComponent.setNamespace(PartComponent_NAMESPACE); PartComponent_isNULL = false; return OK; } }; #endif /*OPENDRIM_PROCESSORPROCESSORCORE_H_*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorProcessorCore/assocOpenDRIM_ProcessorProcessorCore.cpp0000644000175000017500000002123311400667756034356 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_ProcessorProcessorCore.h" int CPU_OpenDRIM_ProcessorProcessorCore_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage) { _E_; string _assocClass, _resultClass, _resultRole, _role; assocClass == NULL ? _assocClass = "null" : _assocClass = assocClass; resultClass == NULL ? _resultClass = "null" : _resultClass = resultClass; resultRole == NULL ? _resultRole = "null" : _resultRole = resultRole; role == NULL ? _role = "null" : _role = role; for (unsigned int i=0; i& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant) { _E_; int errorCode = CPU_OpenDRIM_ProcessorProcessorCore_associatorFilter(broker, ctx, cop, knownInstance, assocClass, resultClass, role, resultRole, leftToRight, errorMessage); if (errorCode == -1) return OK; if (errorCode != OK) return errorCode; if (leftToRight) { if (role != NULL && strcasecmp(role, "PartComponent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "GroupComponent") != 0) return OK; CF_assert(CPU_OpenDRIM_ProcessorProcessorCore_associatorPartComponentToGroupComponent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "GroupComponent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "PartComponent") != 0) return OK; CF_assert(CPU_OpenDRIM_ProcessorProcessorCore_associatorGroupComponentToPartComponent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int CPU_OpenDRIM_ProcessorProcessorCore_enumeratePartComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, PartComponent_NAMESPACE, PartComponent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(CPU_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(CPU_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, CPU_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int CPU_OpenDRIM_ProcessorProcessorCore_getPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), PartComponent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), PartComponent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_ManagedElement _instance; CPU_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(CPU_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, CPU_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int CPU_OpenDRIM_ProcessorProcessorCore_enumerateGroupComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, GroupComponent_NAMESPACE, GroupComponent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(CPU_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(CPU_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, CPU_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int CPU_OpenDRIM_ProcessorProcessorCore_getGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), GroupComponent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), GroupComponent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_ManagedElement _instance; CPU_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(CPU_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, CPU_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorProcessorCore/assocOpenDRIM_ProcessorProcessorCore.h0000644000175000017500000000634511400667756034032 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_PROCESSORPROCESSORCORE_H_ #define ASSOCOPENDRIM_PROCESSORPROCESSORCORE_H_ #include "OpenDRIM_ProcessorProcessorCoreAccess.h" int CPU_OpenDRIM_ProcessorProcessorCore_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage); int CPU_OpenDRIM_ProcessorProcessorCore_associator(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties, vector& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant); int CPU_OpenDRIM_ProcessorProcessorCore_enumeratePartComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int CPU_OpenDRIM_ProcessorProcessorCore_getPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int CPU_OpenDRIM_ProcessorProcessorCore_enumerateGroupComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int CPU_OpenDRIM_ProcessorProcessorCore_getGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_PROCESSORPROCESSORCORE_H_*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorProcessorCore/OpenDRIM_ProcessorProcessorCoreAccess.h0000644000175000017500000001070511400667756034116 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PROCESSORPROCESSORCOREACCESS_H_ #define OPENDRIM_PROCESSORPROCESSORCOREACCESS_H_ #include "CPU_Common.h" #include "OpenDRIM_ProcessorProcessorCore.h" #include "assocOpenDRIM_ProcessorProcessorCore.h" int CPU_OpenDRIM_ProcessorProcessorCore_load(const CMPIBroker* broker, string& errorMessage); int CPU_OpenDRIM_ProcessorProcessorCore_unload(string& errorMessage); int CPU_OpenDRIM_ProcessorProcessorCore_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ProcessorProcessorCore_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ProcessorProcessorCore& instance, const char** properties, string& errorMessage); int CPU_OpenDRIM_ProcessorProcessorCore_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorProcessorCore& newInstance, const OpenDRIM_ProcessorProcessorCore& oldInstance, const char** properties, string& errorMessage); int CPU_OpenDRIM_ProcessorProcessorCore_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorProcessorCore& instance, string& errorMessage); int CPU_OpenDRIM_ProcessorProcessorCore_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorProcessorCore& instance, string& errorMessage); int CPU_OpenDRIM_ProcessorProcessorCore_associatorPartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const char** properties, vector& GroupComponent_associatedInstances, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ProcessorProcessorCore_associatorGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const char** properties, vector& PartComponent_associatedInstances, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ProcessorProcessorCore_referencePartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const vector& GroupComponent_instances, vector& OpenDRIM_ProcessorProcessorCore_instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ProcessorProcessorCore_referenceGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const vector& PartComponent_instances, vector& OpenDRIM_ProcessorProcessorCore_instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ProcessorProcessorCore_populate(OpenDRIM_ProcessorProcessorCore& instance, string& errorMessage); #endif /*OPENDRIM_PROCESSORPROCESSORCOREACCESS_H_*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorProcessorCore/cmpiOpenDRIM_ProcessorProcessorCore.cpp0000644000175000017500000000632511400667756034203 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ProcessorProcessorCore.h" CMPIObjectPath* CPU_OpenDRIM_ProcessorProcessorCore_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ProcessorProcessorCore& instance) { _E_; Objectpath op(broker, OpenDRIM_ProcessorProcessorCore_classnames[0], OpenDRIM_ProcessorProcessorCore_NAMESPACE); if (!instance.GroupComponent_isNULL) op.addKey("GroupComponent", instance.GroupComponent); if (!instance.PartComponent_isNULL) op.addKey("PartComponent", instance.PartComponent); _L_; return op.getHdl(); } CMPIInstance* CPU_OpenDRIM_ProcessorProcessorCore_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ProcessorProcessorCore& instance) { _E_; Objectpath op(broker, CPU_OpenDRIM_ProcessorProcessorCore_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void CPU_OpenDRIM_ProcessorProcessorCore_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ProcessorProcessorCore& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("PartComponent", instance.PartComponent) == OK) instance.PartComponent_isNULL = false; if (op.getKey("GroupComponent", instance.GroupComponent) == OK) instance.GroupComponent_isNULL = false; _L_; } void CPU_OpenDRIM_ProcessorProcessorCore_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ProcessorProcessorCore& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("GroupComponent", instance.GroupComponent) == OK) instance.GroupComponent_isNULL = false; if (inst.getProperty("PartComponent", instance.PartComponent) == OK) instance.PartComponent_isNULL = false; _L_; } opendrim-lmp-cpu-1.1.0~ppa/VERSION0000644000175000017500000000000611400667756017412 0ustar guillaumeguillaume1.1.0 opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorConformsToProfile/0000755000175000017500000000000011400667756025315 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorConformsToProfile/cmpiOpenDRIM_ProcessorConformsToProfile.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorConformsToProfile/cmpiOpenDRIM_ProcessorConformsToProfi0000644000175000017500000000646211400667756034547 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ProcessorConformsToProfile.h" CMPIObjectPath* CPU_OpenDRIM_ProcessorConformsToProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ProcessorConformsToProfile& instance) { _E_; Objectpath op(broker, OpenDRIM_ProcessorConformsToProfile_classnames[0], OpenDRIM_ProcessorConformsToProfile_NAMESPACE); if (!instance.ConformantStandard_isNULL) op.addKey("ConformantStandard", instance.ConformantStandard); if (!instance.ManagedElement_isNULL) op.addKey("ManagedElement", instance.ManagedElement); _L_; return op.getHdl(); } CMPIInstance* CPU_OpenDRIM_ProcessorConformsToProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ProcessorConformsToProfile& instance) { _E_; Objectpath op(broker, CPU_OpenDRIM_ProcessorConformsToProfile_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void CPU_OpenDRIM_ProcessorConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ProcessorConformsToProfile& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("ConformantStandard", instance.ConformantStandard) == OK) instance.ConformantStandard_isNULL = false; if (op.getKey("ManagedElement", instance.ManagedElement) == OK) instance.ManagedElement_isNULL = false; _L_; } void CPU_OpenDRIM_ProcessorConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ProcessorConformsToProfile& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("ConformantStandard", instance.ConformantStandard) == OK) instance.ConformantStandard_isNULL = false; if (inst.getProperty("ManagedElement", instance.ManagedElement) == OK) instance.ManagedElement_isNULL = false; _L_; } opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorConformsToProfile/Makefile.am0000644000175000017500000000513611400667756027356 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiCPU_OpenDRIM_ProcessorConformsToProfileProvider.la libcmpiCPU_OpenDRIM_ProcessorConformsToProfileProvider_la_SOURCES = OpenDRIM_ProcessorConformsToProfileAccess.cpp OpenDRIM_ProcessorConformsToProfileProvider.cpp cmpiOpenDRIM_ProcessorConformsToProfile.cpp assocOpenDRIM_ProcessorConformsToProfile.cpp # May have to be adjusted for direct invocation libcmpiCPU_OpenDRIM_ProcessorConformsToProfileProvider_la_CPPFLAGS = -I../CIM_RegisteredProfile -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiCPU_OpenDRIM_ProcessorConformsToProfileProvider_la_LIBADD = ../Common/libcmpiCPU_Common.la #../CIM_RegisteredProfile/libcmpiCPU_CIM_RegisteredProfileProvider.la ../CIM_ManagedElement/libcmpiCPU_CIM_ManagedElementProvider.la libcmpiCPU_OpenDRIM_ProcessorConformsToProfileProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_ProcessorConformsToProfile.h OpenDRIM_ProcessorConformsToProfile.h OpenDRIM_ProcessorConformsToProfileAccess.h ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorConformsToProfile/OpenDRIM_ProcessorConformsToProfileAccess.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorConformsToProfile/OpenDRIM_ProcessorConformsToProfileAc0000644000175000017500000002560011400667756034456 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_ProcessorConformsToProfileAccess.h" int CPU_OpenDRIM_ProcessorConformsToProfile_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(CPU_CIM_RegisteredProfile_load(broker, errorMessage)); CF_assert(CPU_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int CPU_OpenDRIM_ProcessorConformsToProfile_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(CPU_CIM_RegisteredProfile_unload(errorMessage)); CF_assert(CPU_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int CPU_OpenDRIM_ProcessorConformsToProfile_isAssociated(const Instance& ConformantStandard, const Instance& ManagedElement, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int CPU_OpenDRIM_ProcessorConformsToProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector subjects; // Only get the instance names CF_assert(CPU_OpenDRIM_ProcessorConformsToProfile_enumerateConformantStandards(broker, ctx, subjects, NULL, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(CPU_OpenDRIM_ProcessorConformsToProfile_enumerateConformantStandards(broker, ctx, subjects, NULL, false, errorMessage)); vector::iterator c = subjects.begin(); vector::iterator end = subjects.end(); for (; c != end; ++c) { bool leftToRight = true; vector associatedInstances; CPU_OpenDRIM_ProcessorConformsToProfile_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), ConformantStandard_classnames[0], ManagedElement_classnames[0], ConformantStandard_role.c_str(), ManagedElement_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(CPU_OpenDRIM_ProcessorConformsToProfile_referenceConformantStandardToManagedElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int CPU_OpenDRIM_ProcessorConformsToProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ProcessorConformsToProfile& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath ConformantStandard_objectpath; instance.getConformantStandard(ConformantStandard_objectpath); Instance ConformantStandard_instance; CF_assert(CPU_OpenDRIM_ProcessorConformsToProfile_getConformantStandard(broker, ctx, ConformantStandard_objectpath, ConformantStandard_instance, NULL, errorMessage)); Objectpath ManagedElement_objectpath; instance.getManagedElement(ManagedElement_objectpath); Instance ManagedElement_instance; CF_assert(CPU_OpenDRIM_ProcessorConformsToProfile_getManagedElement(broker, ctx, ManagedElement_objectpath, ManagedElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(CPU_OpenDRIM_ProcessorConformsToProfile_isAssociated(ConformantStandard_instance, ManagedElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int CPU_OpenDRIM_ProcessorConformsToProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorConformsToProfile& newInstance, const OpenDRIM_ProcessorConformsToProfile& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_ProcessorConformsToProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_ProcessorConformsToProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_ProcessorConformsToProfile_associatorConformantStandardToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ConformantStandard_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector ManagedElement_instances; if (discriminant=="a") CF_assert(CPU_OpenDRIM_ProcessorConformsToProfile_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(CPU_OpenDRIM_ProcessorConformsToProfile_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(CPU_OpenDRIM_ProcessorConformsToProfile_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); } for (size_t i=0; i& ConformantStandard_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector ConformantStandard_instances; if (discriminant=="a") CF_assert(CPU_OpenDRIM_ProcessorConformsToProfile_enumerateConformantStandards(broker, ctx, ConformantStandard_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(CPU_OpenDRIM_ProcessorConformsToProfile_enumerateConformantStandards(broker, ctx, ConformantStandard_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(CPU_OpenDRIM_ProcessorConformsToProfile_enumerateConformantStandards(broker, ctx, ConformantStandard_instances, properties, false, errorMessage)); } for (size_t i=0; i& ManagedElement_instances, vector& OpenDRIM_ProcessorConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < ManagedElement_instances.size(); i++) { OpenDRIM_ProcessorConformsToProfile instance; instance.setConformantStandard(((Instance) ConformantStandard_instance).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instances[i]).getObjectpath()); OpenDRIM_ProcessorConformsToProfile_instances.push_back(instance); } _L_; return OK; } int CPU_OpenDRIM_ProcessorConformsToProfile_referenceManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& ConformantStandard_instances, vector& OpenDRIM_ProcessorConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < ConformantStandard_instances.size(); i++) { OpenDRIM_ProcessorConformsToProfile instance; instance.setConformantStandard(((Instance) ConformantStandard_instances[i]).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instance).getObjectpath()); OpenDRIM_ProcessorConformsToProfile_instances.push_back(instance); } _L_; return OK; } int CPU_OpenDRIM_ProcessorConformsToProfile_populate(OpenDRIM_ProcessorConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorConformsToProfile/OpenDRIM_ProcessorConformsToProfileAccess.hopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorConformsToProfile/OpenDRIM_ProcessorConformsToProfileAc0000644000175000017500000001113511400667756034454 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PROCESSORCONFORMSTOPROFILEACCESS_H_ #define OPENDRIM_PROCESSORCONFORMSTOPROFILEACCESS_H_ #include "CPU_Common.h" #include "OpenDRIM_ProcessorConformsToProfile.h" #include "assocOpenDRIM_ProcessorConformsToProfile.h" int CPU_OpenDRIM_ProcessorConformsToProfile_load(const CMPIBroker* broker, string& errorMessage); int CPU_OpenDRIM_ProcessorConformsToProfile_unload(string& errorMessage); int CPU_OpenDRIM_ProcessorConformsToProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ProcessorConformsToProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ProcessorConformsToProfile& instance, const char** properties, string& errorMessage); int CPU_OpenDRIM_ProcessorConformsToProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorConformsToProfile& newInstance, const OpenDRIM_ProcessorConformsToProfile& oldInstance, const char** properties, string& errorMessage); int CPU_OpenDRIM_ProcessorConformsToProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorConformsToProfile& instance, string& errorMessage); int CPU_OpenDRIM_ProcessorConformsToProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorConformsToProfile& instance, string& errorMessage); int CPU_OpenDRIM_ProcessorConformsToProfile_associatorConformantStandardToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ConformantStandard_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ProcessorConformsToProfile_associatorManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const char** properties, vector& ConformantStandard_associatedInstances, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ProcessorConformsToProfile_referenceConformantStandardToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ConformantStandard_instance, const vector& ManagedElement_instances, vector& OpenDRIM_ProcessorConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ProcessorConformsToProfile_referenceManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& ConformantStandard_instances, vector& OpenDRIM_ProcessorConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ProcessorConformsToProfile_populate(OpenDRIM_ProcessorConformsToProfile& instance, string& errorMessage); #endif /*OPENDRIM_PROCESSORCONFORMSTOPROFILEACCESS_H_*/ ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorConformsToProfile/OpenDRIM_ProcessorConformsToProfile.hopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorConformsToProfile/OpenDRIM_ProcessorConformsToProfile.h0000644000175000017500000000742411400667756034444 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PROCESSORCONFORMSTOPROFILE_H_ #define OPENDRIM_PROCESSORCONFORMSTOPROFILE_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_RegisteredProfile.h" #include "CIM_RegisteredProfileAccess.h" #include "cmpiCIM_ManagedElement.h" #include "CIM_ManagedElementAccess.h" */ const static char* OpenDRIM_ProcessorConformsToProfile_classnames[] = {"OpenDRIM_ProcessorConformsToProfile"}; static string OpenDRIM_ProcessorConformsToProfile_NAMESPACE = _INTEROP_NAMESPACE; const static string ConformantStandard_role = "ConformantStandard"; const static char* ConformantStandard_classnames[] = {"OpenDRIM_RegisteredCPUProfile"}; const static string ConformantStandard_NAMESPACE = _INTEROP_NAMESPACE; const static string ManagedElement_role = "ManagedElement"; const static char* ManagedElement_classnames[] = {"OpenDRIM_Processor"}; const static string ManagedElement_NAMESPACE = _NAMESPACE; class OpenDRIM_ProcessorConformsToProfile { public: Objectpath ConformantStandard; bool ConformantStandard_isNULL; Objectpath ManagedElement; bool ManagedElement_isNULL; OpenDRIM_ProcessorConformsToProfile() { ConformantStandard_isNULL = true; ManagedElement_isNULL = true; } ~OpenDRIM_ProcessorConformsToProfile() {} string getKeys() const { return CF_toLowCase(".ConformantStandard=\"" + CF_quoteString(ConformantStandard.toString()) + "\""".ManagedElement=\"" + CF_quoteString(ManagedElement.toString()) + "\""); } int getConformantStandard(Objectpath& value) const { if (ConformantStandard_isNULL==true) return NOT_FOUND; value = ConformantStandard; return OK; } int setConformantStandard(const Objectpath& newValue) { ConformantStandard = newValue; ConformantStandard.setNamespace(ConformantStandard_NAMESPACE); ConformantStandard_isNULL = false; return OK; } int getManagedElement(Objectpath& value) const { if (ManagedElement_isNULL==true) return NOT_FOUND; value = ManagedElement; return OK; } int setManagedElement(const Objectpath& newValue) { ManagedElement = newValue; ManagedElement.setNamespace(ManagedElement_NAMESPACE); ManagedElement_isNULL = false; return OK; } }; #endif /*OPENDRIM_PROCESSORCONFORMSTOPROFILE_H_*/ ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorConformsToProfile/assocOpenDRIM_ProcessorConformsToProfile.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorConformsToProfile/assocOpenDRIM_ProcessorConformsToProf0000644000175000017500000002150311400667756034547 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_ProcessorConformsToProfile.h" int CPU_OpenDRIM_ProcessorConformsToProfile_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage) { _E_; string _assocClass, _resultClass, _resultRole, _role; assocClass == NULL ? _assocClass = "null" : _assocClass = assocClass; resultClass == NULL ? _resultClass = "null" : _resultClass = resultClass; resultRole == NULL ? _resultRole = "null" : _resultRole = resultRole; role == NULL ? _role = "null" : _role = role; for (unsigned int i=0; i& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant) { _E_; int errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_associatorFilter(broker, ctx, cop, knownInstance, assocClass, resultClass, role, resultRole, leftToRight, errorMessage); if (errorCode == -1) return OK; if (errorCode != OK) return errorCode; if (leftToRight) { if (role != NULL && strcasecmp(role, "ConformantStandard") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "ManagedElement") != 0) return OK; CF_assert(CPU_OpenDRIM_ProcessorConformsToProfile_associatorConformantStandardToManagedElement(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "ManagedElement") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "ConformantStandard") != 0) return OK; CF_assert(CPU_OpenDRIM_ProcessorConformsToProfile_associatorManagedElementToConformantStandard(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int CPU_OpenDRIM_ProcessorConformsToProfile_enumerateConformantStandards(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, ConformantStandard_NAMESPACE, ConformantStandard_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(CPU_CIM_RegisteredProfile_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(CPU_CIM_RegisteredProfile_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, CPU_CIM_RegisteredProfile_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int CPU_OpenDRIM_ProcessorConformsToProfile_getConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), ConformantStandard_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), ConformantStandard_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_RegisteredProfile _instance; CPU_CIM_RegisteredProfile_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(CPU_CIM_RegisteredProfile_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, CPU_CIM_RegisteredProfile_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int CPU_OpenDRIM_ProcessorConformsToProfile_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, ManagedElement_NAMESPACE, ManagedElement_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(CPU_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(CPU_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, CPU_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int CPU_OpenDRIM_ProcessorConformsToProfile_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), ManagedElement_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), ManagedElement_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_ManagedElement _instance; CPU_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(CPU_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, CPU_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorConformsToProfile/assocOpenDRIM_ProcessorConformsToProfile.hopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorConformsToProfile/assocOpenDRIM_ProcessorConformsToProf0000644000175000017500000000642711400667756034557 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_PROCESSORCONFORMSTOPROFILE_H_ #define ASSOCOPENDRIM_PROCESSORCONFORMSTOPROFILE_H_ #include "OpenDRIM_ProcessorConformsToProfileAccess.h" int CPU_OpenDRIM_ProcessorConformsToProfile_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage); int CPU_OpenDRIM_ProcessorConformsToProfile_associator(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties, vector& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant); int CPU_OpenDRIM_ProcessorConformsToProfile_enumerateConformantStandards(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int CPU_OpenDRIM_ProcessorConformsToProfile_getConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int CPU_OpenDRIM_ProcessorConformsToProfile_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int CPU_OpenDRIM_ProcessorConformsToProfile_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_PROCESSORCONFORMSTOPROFILE_H_*/ ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorConformsToProfile/cmpiOpenDRIM_ProcessorConformsToProfile.hopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorConformsToProfile/cmpiOpenDRIM_ProcessorConformsToProfi0000644000175000017500000000455711400667756034552 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_PROCESSORCONFORMSTOPROFILE_H_ #define CMPIOPENDRIM_PROCESSORCONFORMSTOPROFILE_H_ #include "OpenDRIM_ProcessorConformsToProfile.h" CMPIObjectPath* CPU_OpenDRIM_ProcessorConformsToProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ProcessorConformsToProfile& instance); CMPIInstance* CPU_OpenDRIM_ProcessorConformsToProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ProcessorConformsToProfile& instance); void CPU_OpenDRIM_ProcessorConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ProcessorConformsToProfile& instance); void CPU_OpenDRIM_ProcessorConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ProcessorConformsToProfile& instance); #endif /*CMPIOPENDRIM_PROCESSORCONFORMSTOPROFILE_H_*/ ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorConformsToProfile/OpenDRIM_ProcessorConformsToProfileProvider.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorConformsToProfile/OpenDRIM_ProcessorConformsToProfilePr0000644000175000017500000004277611400667756034531 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ProcessorConformsToProfile.h" #include "OpenDRIM_ProcessorConformsToProfileAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define CPU_OpenDRIM_ProcessorConformsToProfileProviderSetInstance CPU_OpenDRIM_ProcessorConformsToProfileProviderModifyInstance #endif int CPU_OpenDRIM_ProcessorConformsToProfile_init(const CMPIBroker* broker); int CPU_OpenDRIM_ProcessorConformsToProfile_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_ProcessorConformsToProfileProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorConformsToProfileProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = CPU_OpenDRIM_ProcessorConformsToProfile_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorConformsToProfileProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = CPU_OpenDRIM_ProcessorConformsToProfile_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorConformsToProfileProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ProcessorConformsToProfile instance; CPU_OpenDRIM_ProcessorConformsToProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = CPU_OpenDRIM_ProcessorConformsToProfile_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorConformsToProfileProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ProcessorConformsToProfile newInstance, oldInstance; CPU_OpenDRIM_ProcessorConformsToProfile_toCPP(_broker, ci, newInstance); CPU_OpenDRIM_ProcessorConformsToProfile_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorConformsToProfileProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ProcessorConformsToProfile instance; CPU_OpenDRIM_ProcessorConformsToProfile_toCPP(_broker, ci, instance); string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_ProcessorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = CPU_OpenDRIM_ProcessorConformsToProfile_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorConformsToProfileProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ProcessorConformsToProfile instance; CPU_OpenDRIM_ProcessorConformsToProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorConformsToProfileProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Association Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_ProcessorConformsToProfileProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorConformsToProfileProviderAssociatorNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnObjectPath(rslt, associatedInstances[i].getObjectpath().getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorConformsToProfileProviderAssociators(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnInstance(rslt, associatedInstances[i].getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorConformsToProfileProviderReferenceNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_referenceConformantStandardToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_referenceManagedElementToConformantStandard(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = CPU_OpenDRIM_ProcessorConformsToProfile_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorConformsToProfileProviderReferences(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_referenceConformantStandardToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_referenceManagedElementToConformantStandard(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = CPU_OpenDRIM_ProcessorConformsToProfile_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int CPU_OpenDRIM_ProcessorConformsToProfile_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_ProcessorConformsToProfile_init FAILED: " + (string) OpenDRIM_ProcessorConformsToProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int CPU_OpenDRIM_ProcessorConformsToProfile_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_unload(errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_ProcessorConformsToProfile_unload FAILED: " + (string) OpenDRIM_ProcessorConformsToProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define CPU_OpenDRIM_ProcessorConformsToProfile_INIT if (CPU_OpenDRIM_ProcessorConformsToProfile_init(_broker) < 0) return NULL CMInstanceMIStub(CPU_OpenDRIM_ProcessorConformsToProfileProvider, CPU_OpenDRIM_ProcessorConformsToProfileProvider, _broker, CPU_OpenDRIM_ProcessorConformsToProfile_INIT); CMAssociationMIStub(CPU_OpenDRIM_ProcessorConformsToProfileProvider, CPU_OpenDRIM_ProcessorConformsToProfileProvider, _broker, CPU_OpenDRIM_ProcessorConformsToProfile_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCoreCacheMemory/0000755000175000017500000000000011400667756026710 5ustar guillaumeguillaumeopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCoreCacheMemory/Makefile.am0000644000175000017500000000523511400667756030751 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiCPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProvider.la libcmpiCPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProvider_la_SOURCES = OpenDRIM_AssociatedProcessorCoreCacheMemoryAccess.cpp OpenDRIM_AssociatedProcessorCoreCacheMemoryProvider.cpp cmpiOpenDRIM_AssociatedProcessorCoreCacheMemory.cpp assocOpenDRIM_AssociatedProcessorCoreCacheMemory.cpp # May have to be adjusted for direct invocation libcmpiCPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProvider_la_CPPFLAGS = -I../CIM_Memory -I../CIM_LogicalElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiCPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProvider_la_LIBADD = ../Common/libcmpiCPU_Common.la #../CIM_Memory/libcmpiCPU_CIM_MemoryProvider.la ../CIM_LogicalElement/libcmpiCPU_CIM_LogicalElementProvider.la libcmpiCPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_AssociatedProcessorCoreCacheMemory.h OpenDRIM_AssociatedProcessorCoreCacheMemory.h OpenDRIM_AssociatedProcessorCoreCacheMemoryAccess.h ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCoreCacheMemory/assocOpenDRIM_AssociatedProcessorCoreCacheMemory.hopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCoreCacheMemory/assocOpenDRIM_AssociatedProce0000644000175000017500000000651511400667756034400 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_ASSOCIATEDPROCESSORCORECACHEMEMORY_H_ #define ASSOCOPENDRIM_ASSOCIATEDPROCESSORCORECACHEMEMORY_H_ #include "OpenDRIM_AssociatedProcessorCoreCacheMemoryAccess.h" int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage); int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_associator(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties, vector& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant); int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_ASSOCIATEDPROCESSORCORECACHEMEMORY_H_*/ ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCoreCacheMemory/cmpiOpenDRIM_AssociatedProcessorCoreCacheMemory.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCoreCacheMemory/cmpiOpenDRIM_AssociatedProces0000644000175000017500000001477711400667756034414 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_AssociatedProcessorCoreCacheMemory.h" CMPIObjectPath* CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_AssociatedProcessorCoreCacheMemory& instance) { _E_; Objectpath op(broker, OpenDRIM_AssociatedProcessorCoreCacheMemory_classnames[0], OpenDRIM_AssociatedProcessorCoreCacheMemory_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_AssociatedProcessorCoreCacheMemory& instance) { _E_; Objectpath op(broker, CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.Level_isNULL) ci.setProperty("Level", instance.Level); if (!instance.OtherLevelDescription_isNULL) ci.setProperty("OtherLevelDescription", instance.OtherLevelDescription); if (!instance.WritePolicy_isNULL) ci.setProperty("WritePolicy", instance.WritePolicy); if (!instance.OtherWritePolicyDescription_isNULL) ci.setProperty("OtherWritePolicyDescription", instance.OtherWritePolicyDescription); if (!instance.CacheType_isNULL) ci.setProperty("CacheType", instance.CacheType); if (!instance.OtherCacheTypeDescription_isNULL) ci.setProperty("OtherCacheTypeDescription", instance.OtherCacheTypeDescription); if (!instance.LineSize_isNULL) ci.setProperty("LineSize", instance.LineSize); if (!instance.ReplacementPolicy_isNULL) ci.setProperty("ReplacementPolicy", instance.ReplacementPolicy); if (!instance.OtherReplacementPolicyDescription_isNULL) ci.setProperty("OtherReplacementPolicyDescription", instance.OtherReplacementPolicyDescription); if (!instance.ReadPolicy_isNULL) ci.setProperty("ReadPolicy", instance.ReadPolicy); if (!instance.OtherReadPolicyDescription_isNULL) ci.setProperty("OtherReadPolicyDescription", instance.OtherReadPolicyDescription); if (!instance.FlushTimer_isNULL) ci.setProperty("FlushTimer", instance.FlushTimer); if (!instance.Associativity_isNULL) ci.setProperty("Associativity", instance.Associativity); if (!instance.OtherAssociativityDescription_isNULL) ci.setProperty("OtherAssociativityDescription", instance.OtherAssociativityDescription); _L_; return ci.getHdl(); } void CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_AssociatedProcessorCoreCacheMemory& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("Antecedent", instance.Antecedent) == OK) instance.Antecedent_isNULL = false; if (op.getKey("Dependent", instance.Dependent) == OK) instance.Dependent_isNULL = false; _L_; } void CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_AssociatedProcessorCoreCacheMemory& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Antecedent", instance.Antecedent) == OK) instance.Antecedent_isNULL = false; if (inst.getProperty("Dependent", instance.Dependent) == OK) instance.Dependent_isNULL = false; if (inst.getProperty("Level", instance.Level) == OK) instance.Level_isNULL = false; if (inst.getProperty("OtherLevelDescription", instance.OtherLevelDescription) == OK) instance.OtherLevelDescription_isNULL = false; if (inst.getProperty("WritePolicy", instance.WritePolicy) == OK) instance.WritePolicy_isNULL = false; if (inst.getProperty("OtherWritePolicyDescription", instance.OtherWritePolicyDescription) == OK) instance.OtherWritePolicyDescription_isNULL = false; if (inst.getProperty("CacheType", instance.CacheType) == OK) instance.CacheType_isNULL = false; if (inst.getProperty("OtherCacheTypeDescription", instance.OtherCacheTypeDescription) == OK) instance.OtherCacheTypeDescription_isNULL = false; if (inst.getProperty("LineSize", instance.LineSize) == OK) instance.LineSize_isNULL = false; if (inst.getProperty("ReplacementPolicy", instance.ReplacementPolicy) == OK) instance.ReplacementPolicy_isNULL = false; if (inst.getProperty("OtherReplacementPolicyDescription", instance.OtherReplacementPolicyDescription) == OK) instance.OtherReplacementPolicyDescription_isNULL = false; if (inst.getProperty("ReadPolicy", instance.ReadPolicy) == OK) instance.ReadPolicy_isNULL = false; if (inst.getProperty("OtherReadPolicyDescription", instance.OtherReadPolicyDescription) == OK) instance.OtherReadPolicyDescription_isNULL = false; if (inst.getProperty("FlushTimer", instance.FlushTimer) == OK) instance.FlushTimer_isNULL = false; if (inst.getProperty("Associativity", instance.Associativity) == OK) instance.Associativity_isNULL = false; if (inst.getProperty("OtherAssociativityDescription", instance.OtherAssociativityDescription) == OK) instance.OtherAssociativityDescription_isNULL = false; _L_; } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCoreCacheMemory/cmpiOpenDRIM_AssociatedProcessorCoreCacheMemory.hopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCoreCacheMemory/cmpiOpenDRIM_AssociatedProces0000644000175000017500000000471711400667756034405 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_ASSOCIATEDPROCESSORCORECACHEMEMORY_H_ #define CMPIOPENDRIM_ASSOCIATEDPROCESSORCORECACHEMEMORY_H_ #include "OpenDRIM_AssociatedProcessorCoreCacheMemory.h" CMPIObjectPath* CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_AssociatedProcessorCoreCacheMemory& instance); CMPIInstance* CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_AssociatedProcessorCoreCacheMemory& instance); void CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_AssociatedProcessorCoreCacheMemory& instance); void CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_AssociatedProcessorCoreCacheMemory& instance); #endif /*CMPIOPENDRIM_ASSOCIATEDPROCESSORCORECACHEMEMORY_H_*/ ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCoreCacheMemory/OpenDRIM_AssociatedProcessorCoreCacheMemoryAccess.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCoreCacheMemory/OpenDRIM_AssociatedProcessorC0000644000175000017500000003604311400667756034360 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_AssociatedProcessorCoreCacheMemoryAccess.h" #include int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(CPU_CIM_Memory_load(broker, errorMessage)); CF_assert(CPU_CIM_LogicalElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(CPU_CIM_Memory_unload(errorMessage)); CF_assert(CPU_CIM_LogicalElement_unload(errorMessage)); */ // TODO _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // Determine if the association can be established or not isAssociated=false; string core_instance_id; string memory_device_id; Dependent.getProperty("InstanceID", core_instance_id); Antecedent.getProperty("DeviceID", memory_device_id); // processor core InstanceID must contain 2 numerical values seperated by ':' vector core_instance_id_elements; CF_splitText(core_instance_id_elements, core_instance_id, ':'); if (core_instance_id_elements.size() != 2) return OK; if (!CF_isNumber(core_instance_id_elements[0]) || !CF_isNumber(core_instance_id_elements[1])) return OK; unsigned int first_core_instance_id_element = atoll(core_instance_id_elements[0].c_str()); unsigned int second_core_instance_id_element = atoll(core_instance_id_elements[1].c_str()); // memory DeviceID must contain 3 numerical values seperated by ':' vector memory_device_id_elements; CF_splitText(memory_device_id_elements, memory_device_id, ':'); if (memory_device_id_elements.size() != 3) return OK; if (!CF_isNumber(memory_device_id_elements[0]) || !CF_isNumber(memory_device_id_elements[1]) || memory_device_id_elements[2][0]!='L') return OK; unsigned int first_memory_device_id_element = atoll(memory_device_id_elements[0].c_str()); unsigned int second_memory_device_id_element = atoll(memory_device_id_elements[1].c_str()); // the first element and the second element of the memory DeviceID must match the core InstanceID if (first_memory_device_id_element == first_core_instance_id_element && second_memory_device_id_element == second_core_instance_id_element) isAssociated = true; _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector subjects; // Only get the instance names CF_assert(CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_enumerateAntecedents(broker, ctx, subjects, NULL, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_enumerateAntecedents(broker, ctx, subjects, NULL, false, errorMessage)); vector::iterator c = subjects.begin(); vector::iterator end = subjects.end(); for (; c != end; ++c) { bool leftToRight = true; vector associatedInstances; CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), Antecedent_classnames[0], Dependent_classnames[0], Antecedent_role.c_str(), Dependent_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_AssociatedProcessorCoreCacheMemory& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath Antecedent_objectpath; instance.getAntecedent(Antecedent_objectpath); Instance Antecedent_instance; CF_assert(CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } CF_assert(CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_populate(instance, errorMessage)); _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedProcessorCoreCacheMemory& newInstance, const OpenDRIM_AssociatedProcessorCoreCacheMemory& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedProcessorCoreCacheMemory& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedProcessorCoreCacheMemory& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector Dependent_instances; if (discriminant=="a") CF_assert(CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_enumerateDependents(broker, ctx, Dependent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Antecedent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector Antecedent_instances; if (discriminant=="a") CF_assert(CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_AssociatedProcessorCoreCacheMemory_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < Dependent_instances.size(); i++) { OpenDRIM_AssociatedProcessorCoreCacheMemory instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); if (discriminant == "r") { CF_assert(CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_populate(instance, errorMessage)); } OpenDRIM_AssociatedProcessorCoreCacheMemory_instances.push_back(instance); } _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_AssociatedProcessorCoreCacheMemory_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < Antecedent_instances.size(); i++) { OpenDRIM_AssociatedProcessorCoreCacheMemory instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); if (discriminant == "r") { CF_assert(CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_populate(instance, errorMessage)); } OpenDRIM_AssociatedProcessorCoreCacheMemory_instances.push_back(instance); } _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_populate(OpenDRIM_AssociatedProcessorCoreCacheMemory& instance, string& errorMessage) { _E_; /* * Properties to fill from profile * + Mandatory: * [X] Level * [X] WritePolicy * [X] CacheType * [X] ReadPolicy * [X] Associativity */ Objectpath Antecedent; instance.getAntecedent(Antecedent); string memory_device_id; Antecedent.getKey("DeviceID", memory_device_id); // memory DeviceID must contain 3 numerical values seperated by ':' vector memory_device_id_elements; CF_splitText(memory_device_id_elements, memory_device_id, ':'); if (memory_device_id_elements.size() != 3) return OK; if (!CF_isNumber(memory_device_id_elements[0]) || !CF_isNumber(memory_device_id_elements[1]) || memory_device_id_elements[2][0]!='L') return OK; unsigned int processor_id = atoll(memory_device_id_elements[0].c_str()); unsigned int level = atoll(memory_device_id_elements[2].substr(1).c_str()); // get info from SMBIOS vector<_processor_information> SMBIOS_processors_information; int errorCode = SMBIOS_getProcessorsInformation(SMBIOS_processors_information, errorMessage); // if we cannot get info from SMBIOS, we'll just use info from cpuinfo bool use_SMBIOS = false; if (errorCode == OK) use_SMBIOS = true; if (!use_SMBIOS) return OK; if (processor_id >= SMBIOS_processors_information.size()) return OK; if (level == 1) { if (!SMBIOS_processors_information[processor_id].has_l1_cache) return OK; instance.setWritePolicy(SMBIOS_processors_information[processor_id].l1_cache.operational_mode); instance.setCacheType(SMBIOS_processors_information[processor_id].l1_cache.system_cache_type); instance.setReadPolicy(0); // unknown instance.setAssociativity(SMBIOS_processors_information[processor_id].l1_cache.associativity); // smbios gives a wrong level information so we'd rather rely on the cache handles //instance.setLevel(SMBIOS_processors_information[processor_id].l1_cache.cache_level); instance.setLevel(3); } if (level == 2) { if (!SMBIOS_processors_information[processor_id].has_l2_cache) return OK; instance.setWritePolicy(SMBIOS_processors_information[processor_id].l2_cache.operational_mode); instance.setCacheType(SMBIOS_processors_information[processor_id].l2_cache.system_cache_type); instance.setReadPolicy(0); // unknown instance.setAssociativity(SMBIOS_processors_information[processor_id].l2_cache.associativity); // smbios gives a wrong level information so we'd rather rely on the cache handles //instance.setLevel(SMBIOS_processors_information[processor_id].l2_cache.cache_level); instance.setLevel(4); } _L_; return OK; } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCoreCacheMemory/OpenDRIM_AssociatedProcessorCoreCacheMemory.hopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCoreCacheMemory/OpenDRIM_AssociatedProcessorC0000644000175000017500000002216611400667756034361 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_ASSOCIATEDPROCESSORCORECACHEMEMORY_H_ #define OPENDRIM_ASSOCIATEDPROCESSORCORECACHEMEMORY_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_Memory.h" #include "CIM_MemoryAccess.h" #include "cmpiCIM_LogicalElement.h" #include "CIM_LogicalElementAccess.h" */ const static char* OpenDRIM_AssociatedProcessorCoreCacheMemory_classnames[] = {"OpenDRIM_AssociatedProcessorCoreCacheMemory"}; static string OpenDRIM_AssociatedProcessorCoreCacheMemory_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"OpenDRIM_CacheMemory"}; const static string Antecedent_NAMESPACE = _NAMESPACE; const static string Dependent_role = "Dependent"; const static char* Dependent_classnames[] = {"OpenDRIM_ProcessorCore"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_AssociatedProcessorCoreCacheMemory { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; unsigned short Level; bool Level_isNULL; string OtherLevelDescription; bool OtherLevelDescription_isNULL; unsigned short WritePolicy; bool WritePolicy_isNULL; string OtherWritePolicyDescription; bool OtherWritePolicyDescription_isNULL; unsigned short CacheType; bool CacheType_isNULL; string OtherCacheTypeDescription; bool OtherCacheTypeDescription_isNULL; unsigned int LineSize; bool LineSize_isNULL; unsigned short ReplacementPolicy; bool ReplacementPolicy_isNULL; string OtherReplacementPolicyDescription; bool OtherReplacementPolicyDescription_isNULL; unsigned short ReadPolicy; bool ReadPolicy_isNULL; string OtherReadPolicyDescription; bool OtherReadPolicyDescription_isNULL; unsigned int FlushTimer; bool FlushTimer_isNULL; unsigned short Associativity; bool Associativity_isNULL; string OtherAssociativityDescription; bool OtherAssociativityDescription_isNULL; OpenDRIM_AssociatedProcessorCoreCacheMemory() { Antecedent_isNULL = true; Dependent_isNULL = true; Level_isNULL = true; OtherLevelDescription_isNULL = true; WritePolicy_isNULL = true; OtherWritePolicyDescription_isNULL = true; CacheType_isNULL = true; OtherCacheTypeDescription_isNULL = true; LineSize_isNULL = true; ReplacementPolicy_isNULL = true; OtherReplacementPolicyDescription_isNULL = true; ReadPolicy_isNULL = true; OtherReadPolicyDescription_isNULL = true; FlushTimer_isNULL = true; Associativity_isNULL = true; OtherAssociativityDescription_isNULL = true; } ~OpenDRIM_AssociatedProcessorCoreCacheMemory() {} string getKeys() const { return CF_toLowCase(".Antecedent=\"" + CF_quoteString(Antecedent.toString()) + "\""".Dependent=\"" + CF_quoteString(Dependent.toString()) + "\""); } int getAntecedent(Objectpath& value) const { if (Antecedent_isNULL==true) return NOT_FOUND; value = Antecedent; return OK; } int setAntecedent(const Objectpath& newValue) { Antecedent = newValue; Antecedent.setNamespace(Antecedent_NAMESPACE); Antecedent_isNULL = false; return OK; } int getDependent(Objectpath& value) const { if (Dependent_isNULL==true) return NOT_FOUND; value = Dependent; return OK; } int setDependent(const Objectpath& newValue) { Dependent = newValue; Dependent.setNamespace(Dependent_NAMESPACE); Dependent_isNULL = false; return OK; } int getLevel(unsigned short& value) const { if (Level_isNULL==true) return NOT_FOUND; value = Level; return OK; } int setLevel(const unsigned short& newValue) { Level = newValue; Level_isNULL = false; return OK; } int getOtherLevelDescription(string& value) const { if (OtherLevelDescription_isNULL==true) return NOT_FOUND; value = OtherLevelDescription; return OK; } int setOtherLevelDescription(const string& newValue) { OtherLevelDescription = newValue; OtherLevelDescription_isNULL = false; return OK; } int getWritePolicy(unsigned short& value) const { if (WritePolicy_isNULL==true) return NOT_FOUND; value = WritePolicy; return OK; } int setWritePolicy(const unsigned short& newValue) { WritePolicy = newValue; WritePolicy_isNULL = false; return OK; } int getOtherWritePolicyDescription(string& value) const { if (OtherWritePolicyDescription_isNULL==true) return NOT_FOUND; value = OtherWritePolicyDescription; return OK; } int setOtherWritePolicyDescription(const string& newValue) { OtherWritePolicyDescription = newValue; OtherWritePolicyDescription_isNULL = false; return OK; } int getCacheType(unsigned short& value) const { if (CacheType_isNULL==true) return NOT_FOUND; value = CacheType; return OK; } int setCacheType(const unsigned short& newValue) { CacheType = newValue; CacheType_isNULL = false; return OK; } int getOtherCacheTypeDescription(string& value) const { if (OtherCacheTypeDescription_isNULL==true) return NOT_FOUND; value = OtherCacheTypeDescription; return OK; } int setOtherCacheTypeDescription(const string& newValue) { OtherCacheTypeDescription = newValue; OtherCacheTypeDescription_isNULL = false; return OK; } int getLineSize(unsigned int& value) const { if (LineSize_isNULL==true) return NOT_FOUND; value = LineSize; return OK; } int setLineSize(const unsigned int& newValue) { LineSize = newValue; LineSize_isNULL = false; return OK; } int getReplacementPolicy(unsigned short& value) const { if (ReplacementPolicy_isNULL==true) return NOT_FOUND; value = ReplacementPolicy; return OK; } int setReplacementPolicy(const unsigned short& newValue) { ReplacementPolicy = newValue; ReplacementPolicy_isNULL = false; return OK; } int getOtherReplacementPolicyDescription(string& value) const { if (OtherReplacementPolicyDescription_isNULL==true) return NOT_FOUND; value = OtherReplacementPolicyDescription; return OK; } int setOtherReplacementPolicyDescription(const string& newValue) { OtherReplacementPolicyDescription = newValue; OtherReplacementPolicyDescription_isNULL = false; return OK; } int getReadPolicy(unsigned short& value) const { if (ReadPolicy_isNULL==true) return NOT_FOUND; value = ReadPolicy; return OK; } int setReadPolicy(const unsigned short& newValue) { ReadPolicy = newValue; ReadPolicy_isNULL = false; return OK; } int getOtherReadPolicyDescription(string& value) const { if (OtherReadPolicyDescription_isNULL==true) return NOT_FOUND; value = OtherReadPolicyDescription; return OK; } int setOtherReadPolicyDescription(const string& newValue) { OtherReadPolicyDescription = newValue; OtherReadPolicyDescription_isNULL = false; return OK; } int getFlushTimer(unsigned int& value) const { if (FlushTimer_isNULL==true) return NOT_FOUND; value = FlushTimer; return OK; } int setFlushTimer(const unsigned int& newValue) { FlushTimer = newValue; FlushTimer_isNULL = false; return OK; } int getAssociativity(unsigned short& value) const { if (Associativity_isNULL==true) return NOT_FOUND; value = Associativity; return OK; } int setAssociativity(const unsigned short& newValue) { Associativity = newValue; Associativity_isNULL = false; return OK; } int getOtherAssociativityDescription(string& value) const { if (OtherAssociativityDescription_isNULL==true) return NOT_FOUND; value = OtherAssociativityDescription; return OK; } int setOtherAssociativityDescription(const string& newValue) { OtherAssociativityDescription = newValue; OtherAssociativityDescription_isNULL = false; return OK; } }; #endif /*OPENDRIM_ASSOCIATEDPROCESSORCORECACHEMEMORY_H_*/ ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCoreCacheMemory/OpenDRIM_AssociatedProcessorCoreCacheMemoryAccess.hopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCoreCacheMemory/OpenDRIM_AssociatedProcessorC0000644000175000017500000001132511400667756034354 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_ASSOCIATEDPROCESSORCORECACHEMEMORYACCESS_H_ #define OPENDRIM_ASSOCIATEDPROCESSORCORECACHEMEMORYACCESS_H_ #include "CPU_Common.h" #include "OpenDRIM_AssociatedProcessorCoreCacheMemory.h" #include "assocOpenDRIM_AssociatedProcessorCoreCacheMemory.h" int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_load(const CMPIBroker* broker, string& errorMessage); int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_unload(string& errorMessage); int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_AssociatedProcessorCoreCacheMemory& instance, const char** properties, string& errorMessage); int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedProcessorCoreCacheMemory& newInstance, const OpenDRIM_AssociatedProcessorCoreCacheMemory& oldInstance, const char** properties, string& errorMessage); int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedProcessorCoreCacheMemory& instance, string& errorMessage); int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedProcessorCoreCacheMemory& instance, string& errorMessage); int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_AssociatedProcessorCoreCacheMemory_instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_AssociatedProcessorCoreCacheMemory_instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_populate(OpenDRIM_AssociatedProcessorCoreCacheMemory& instance, string& errorMessage); #endif /*OPENDRIM_ASSOCIATEDPROCESSORCORECACHEMEMORYACCESS_H_*/ ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCoreCacheMemory/assocOpenDRIM_AssociatedProcessorCoreCacheMemory.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCoreCacheMemory/assocOpenDRIM_AssociatedProce0000644000175000017500000002123311400667756034372 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_AssociatedProcessorCoreCacheMemory.h" int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage) { _E_; string _assocClass, _resultClass, _resultRole, _role; assocClass == NULL ? _assocClass = "null" : _assocClass = assocClass; resultClass == NULL ? _resultClass = "null" : _resultClass = resultClass; resultRole == NULL ? _resultRole = "null" : _resultRole = resultRole; role == NULL ? _role = "null" : _role = role; for (unsigned int i=0; i& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant) { _E_; int errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_associatorFilter(broker, ctx, cop, knownInstance, assocClass, resultClass, role, resultRole, leftToRight, errorMessage); if (errorCode == -1) return OK; if (errorCode != OK) return errorCode; if (leftToRight) { if (role != NULL && strcasecmp(role, "Antecedent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "Dependent") != 0) return OK; CF_assert(CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_associatorAntecedentToDependent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "Dependent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "Antecedent") != 0) return OK; CF_assert(CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, Antecedent_NAMESPACE, Antecedent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(CPU_CIM_Memory_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(CPU_CIM_Memory_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, CPU_CIM_Memory_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Antecedent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Antecedent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_Memory _instance; CPU_CIM_Memory_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(CPU_CIM_Memory_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, CPU_CIM_Memory_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, Dependent_NAMESPACE, Dependent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(CPU_CIM_LogicalElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(CPU_CIM_LogicalElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, CPU_CIM_LogicalElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Dependent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Dependent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_LogicalElement _instance; CPU_CIM_LogicalElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(CPU_CIM_LogicalElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, CPU_CIM_LogicalElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCoreCacheMemory/OpenDRIM_AssociatedProcessorCoreCacheMemoryProvider.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCoreCacheMemory/OpenDRIM_AssociatedProcessorC0000644000175000017500000004423211400667756034357 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_AssociatedProcessorCoreCacheMemory.h" #include "OpenDRIM_AssociatedProcessorCoreCacheMemoryAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProviderSetInstance CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProviderModifyInstance #endif int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_init(const CMPIBroker* broker); int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCoreCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCoreCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_AssociatedProcessorCoreCacheMemory instance; CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCoreCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_AssociatedProcessorCoreCacheMemory newInstance, oldInstance; CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_toCPP(_broker, ci, newInstance); CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCoreCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCoreCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_AssociatedProcessorCoreCacheMemory instance; CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_toCPP(_broker, ci, instance); string errorMessage; int errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_AssociatedProcessorCoreCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCoreCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCoreCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_AssociatedProcessorCoreCacheMemory instance; CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCoreCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCoreCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Association Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProviderAssociatorNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCoreCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnObjectPath(rslt, associatedInstances[i].getObjectpath().getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProviderAssociators(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCoreCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnInstance(rslt, associatedInstances[i].getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProviderReferenceNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCoreCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCoreCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProviderReferences(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCoreCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCoreCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_init FAILED: " + (string) OpenDRIM_AssociatedProcessorCoreCacheMemory_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_unload(errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_unload FAILED: " + (string) OpenDRIM_AssociatedProcessorCoreCacheMemory_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_INIT if (CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_init(_broker) < 0) return NULL CMInstanceMIStub(CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProvider, CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProvider, _broker, CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_INIT); CMAssociationMIStub(CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProvider, CPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProvider, _broker, CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-cpu-1.1.0~ppa/test/0000755000175000017500000000000011400667756017325 5ustar guillaumeguillaumeopendrim-lmp-cpu-1.1.0~ppa/test/testOpenDRIM_ProcessorProcessorCore.cpp0000644000175000017500000001137011400667756027060 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ProcessorProcessorCore.h" #include "OpenDRIM_ProcessorProcessorCoreAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_ProcessorProcessorCore& instance) { os << " [OpenDRIM_ProcessorProcessorCore]" << endl; ToStringRef("GroupComponent", GroupComponent, GroupComponent_isNULL); ToStringRef("PartComponent", PartComponent, PartComponent_isNULL); os << " [\\OpenDRIM_ProcessorProcessorCore]" << endl; return os; } int main() { string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorProcessorCore_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = CPU_OpenDRIM_ProcessorProcessorCore_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = CPU_OpenDRIM_ProcessorProcessorCore_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = CPU_OpenDRIM_ProcessorProcessorCore_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = CPU_OpenDRIM_ProcessorProcessorCore_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-cpu-1.1.0~ppa/test/Makefile.am0000644000175000017500000001541011400667756021362 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ noinst_PROGRAMS = testOpenDRIM_RegisteredCPUProfile testOpenDRIM_Processor testOpenDRIM_CacheMemory testOpenDRIM_ProcessorConformsToProfile testOpenDRIM_AssociatedProcessorCoreCacheMemory testOpenDRIM_ProcessorCoreHardwareThread testOpenDRIM_ProcessorCore testOpenDRIM_HardwareThread testOpenDRIM_ProcessorProcessorCore testOpenDRIM_ComputerSystemProcessor testOpenDRIM_AssociatedProcessorCacheMemory testOpenDRIM_RegisteredCPUProfile_CPPFLAGS = -I../OpenDRIM_RegisteredCPUProfile/ testOpenDRIM_RegisteredCPUProfile_SOURCES = testOpenDRIM_RegisteredCPUProfile.cpp testOpenDRIM_RegisteredCPUProfile_LDADD = ../OpenDRIM_RegisteredCPUProfile/libcmpiCPU_OpenDRIM_RegisteredCPUProfileProvider.la test-OpenDRIM_RegisteredCPUProfile: testOpenDRIM_RegisteredCPUProfile ./testOpenDRIM_RegisteredCPUProfile testOpenDRIM_Processor_CPPFLAGS = -I../OpenDRIM_Processor/ testOpenDRIM_Processor_SOURCES = testOpenDRIM_Processor.cpp testOpenDRIM_Processor_LDADD = ../OpenDRIM_Processor/libcmpiCPU_OpenDRIM_ProcessorProvider.la test-OpenDRIM_Processor: testOpenDRIM_Processor ./testOpenDRIM_Processor testOpenDRIM_CacheMemory_CPPFLAGS = -I../OpenDRIM_CacheMemory/ testOpenDRIM_CacheMemory_SOURCES = testOpenDRIM_CacheMemory.cpp testOpenDRIM_CacheMemory_LDADD = ../OpenDRIM_CacheMemory/libcmpiCPU_OpenDRIM_CacheMemoryProvider.la test-OpenDRIM_CacheMemory: testOpenDRIM_CacheMemory ./testOpenDRIM_CacheMemory # May have to be adjusted for direct invocation testOpenDRIM_ProcessorConformsToProfile_CPPFLAGS = -I../OpenDRIM_ProcessorConformsToProfile/ -I../null/ -I../null/ testOpenDRIM_ProcessorConformsToProfile_SOURCES = testOpenDRIM_ProcessorConformsToProfile.cpp testOpenDRIM_ProcessorConformsToProfile_LDADD = ../OpenDRIM_ProcessorConformsToProfile/libcmpiCPU_OpenDRIM_ProcessorConformsToProfileProvider.la test-OpenDRIM_ProcessorConformsToProfile: testOpenDRIM_ProcessorConformsToProfile ./testOpenDRIM_ProcessorConformsToProfile # May have to be adjusted for direct invocation testOpenDRIM_AssociatedProcessorCoreCacheMemory_CPPFLAGS = -I../OpenDRIM_AssociatedProcessorCoreCacheMemory/ -I../null/ -I../null/ testOpenDRIM_AssociatedProcessorCoreCacheMemory_SOURCES = testOpenDRIM_AssociatedProcessorCoreCacheMemory.cpp testOpenDRIM_AssociatedProcessorCoreCacheMemory_LDADD = ../OpenDRIM_AssociatedProcessorCoreCacheMemory/libcmpiCPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProvider.la test-OpenDRIM_AssociatedProcessorCoreCacheMemory: testOpenDRIM_AssociatedProcessorCoreCacheMemory ./testOpenDRIM_AssociatedProcessorCoreCacheMemory # May have to be adjusted for direct invocation testOpenDRIM_ProcessorCoreHardwareThread_CPPFLAGS = -I../OpenDRIM_ProcessorCoreHardwareThread/ -I../null/ -I../null/ testOpenDRIM_ProcessorCoreHardwareThread_SOURCES = testOpenDRIM_ProcessorCoreHardwareThread.cpp testOpenDRIM_ProcessorCoreHardwareThread_LDADD = ../OpenDRIM_ProcessorCoreHardwareThread/libcmpiCPU_OpenDRIM_ProcessorCoreHardwareThreadProvider.la test-OpenDRIM_ProcessorCoreHardwareThread: testOpenDRIM_ProcessorCoreHardwareThread ./testOpenDRIM_ProcessorCoreHardwareThread testOpenDRIM_ProcessorCore_CPPFLAGS = -I../OpenDRIM_ProcessorCore/ testOpenDRIM_ProcessorCore_SOURCES = testOpenDRIM_ProcessorCore.cpp testOpenDRIM_ProcessorCore_LDADD = ../OpenDRIM_ProcessorCore/libcmpiCPU_OpenDRIM_ProcessorCoreProvider.la test-OpenDRIM_ProcessorCore: testOpenDRIM_ProcessorCore ./testOpenDRIM_ProcessorCore testOpenDRIM_HardwareThread_CPPFLAGS = -I../OpenDRIM_HardwareThread/ testOpenDRIM_HardwareThread_SOURCES = testOpenDRIM_HardwareThread.cpp testOpenDRIM_HardwareThread_LDADD = ../OpenDRIM_HardwareThread/libcmpiCPU_OpenDRIM_HardwareThreadProvider.la test-OpenDRIM_HardwareThread: testOpenDRIM_HardwareThread ./testOpenDRIM_HardwareThread # May have to be adjusted for direct invocation testOpenDRIM_ProcessorProcessorCore_CPPFLAGS = -I../OpenDRIM_ProcessorProcessorCore/ -I../null/ -I../null/ testOpenDRIM_ProcessorProcessorCore_SOURCES = testOpenDRIM_ProcessorProcessorCore.cpp testOpenDRIM_ProcessorProcessorCore_LDADD = ../OpenDRIM_ProcessorProcessorCore/libcmpiCPU_OpenDRIM_ProcessorProcessorCoreProvider.la test-OpenDRIM_ProcessorProcessorCore: testOpenDRIM_ProcessorProcessorCore ./testOpenDRIM_ProcessorProcessorCore # May have to be adjusted for direct invocation testOpenDRIM_ComputerSystemProcessor_CPPFLAGS = -I../OpenDRIM_ComputerSystemProcessor/ -I../null/ -I../null/ testOpenDRIM_ComputerSystemProcessor_SOURCES = testOpenDRIM_ComputerSystemProcessor.cpp testOpenDRIM_ComputerSystemProcessor_LDADD = ../OpenDRIM_ComputerSystemProcessor/libcmpiCPU_OpenDRIM_ComputerSystemProcessorProvider.la test-OpenDRIM_ComputerSystemProcessor: testOpenDRIM_ComputerSystemProcessor ./testOpenDRIM_ComputerSystemProcessor # May have to be adjusted for direct invocation testOpenDRIM_AssociatedProcessorCacheMemory_CPPFLAGS = -I../OpenDRIM_AssociatedProcessorCacheMemory/ -I../null/ -I../null/ testOpenDRIM_AssociatedProcessorCacheMemory_SOURCES = testOpenDRIM_AssociatedProcessorCacheMemory.cpp testOpenDRIM_AssociatedProcessorCacheMemory_LDADD = ../OpenDRIM_AssociatedProcessorCacheMemory/libcmpiCPU_OpenDRIM_AssociatedProcessorCacheMemoryProvider.la test-OpenDRIM_AssociatedProcessorCacheMemory: testOpenDRIM_AssociatedProcessorCacheMemory ./testOpenDRIM_AssociatedProcessorCacheMemory opendrim-lmp-cpu-1.1.0~ppa/test/testOpenDRIM_AssociatedProcessorCacheMemory.cpp0000644000175000017500000001363211400667756030467 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_AssociatedProcessorCacheMemory.h" #include "OpenDRIM_AssociatedProcessorCacheMemoryAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_AssociatedProcessorCacheMemory& instance) { os << " [OpenDRIM_AssociatedProcessorCacheMemory]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); ToStringInt("Level", Level, Level_isNULL); ToString("OtherLevelDescription", OtherLevelDescription, OtherLevelDescription_isNULL); ToStringInt("WritePolicy", WritePolicy, WritePolicy_isNULL); ToString("OtherWritePolicyDescription", OtherWritePolicyDescription, OtherWritePolicyDescription_isNULL); ToStringInt("CacheType", CacheType, CacheType_isNULL); ToString("OtherCacheTypeDescription", OtherCacheTypeDescription, OtherCacheTypeDescription_isNULL); ToString("LineSize", LineSize, LineSize_isNULL); ToStringInt("ReplacementPolicy", ReplacementPolicy, ReplacementPolicy_isNULL); ToString("OtherReplacementPolicyDescription", OtherReplacementPolicyDescription, OtherReplacementPolicyDescription_isNULL); ToStringInt("ReadPolicy", ReadPolicy, ReadPolicy_isNULL); ToString("OtherReadPolicyDescription", OtherReadPolicyDescription, OtherReadPolicyDescription_isNULL); ToString("FlushTimer", FlushTimer, FlushTimer_isNULL); ToStringInt("Associativity", Associativity, Associativity_isNULL); ToString("OtherAssociativityDescription", OtherAssociativityDescription, OtherAssociativityDescription_isNULL); os << " [\\OpenDRIM_AssociatedProcessorCacheMemory]" << endl; return os; } int main() { string errorMessage; int errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-cpu-1.1.0~ppa/test/testOpenDRIM_ProcessorCore.cpp0000644000175000017500000001444711400667756025170 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ProcessorCore.h" #include "OpenDRIM_ProcessorCoreAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_ProcessorCore& instance) { os << " [OpenDRIM_ProcessorCore]" << endl; ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstallDate", InstallDate, InstallDate_isNULL); ToString("Name", Name, Name_isNULL); ToStringArrayInt("OperationalStatus", OperationalStatus, OperationalStatus_isNULL); ToStringArray("StatusDescriptions", StatusDescriptions, StatusDescriptions_isNULL); ToString("Status", Status, Status_isNULL); ToStringInt("HealthState", HealthState, HealthState_isNULL); ToStringInt("PrimaryStatus", PrimaryStatus, PrimaryStatus_isNULL); ToStringInt("DetailedStatus", DetailedStatus, DetailedStatus_isNULL); ToStringInt("OperatingStatus", OperatingStatus, OperatingStatus_isNULL); ToStringInt("CommunicationStatus", CommunicationStatus, CommunicationStatus_isNULL); ToStringInt("EnabledState", EnabledState, EnabledState_isNULL); ToString("OtherEnabledState", OtherEnabledState, OtherEnabledState_isNULL); ToStringInt("RequestedState", RequestedState, RequestedState_isNULL); ToStringInt("EnabledDefault", EnabledDefault, EnabledDefault_isNULL); ToString("TimeOfLastStateChange", TimeOfLastStateChange, TimeOfLastStateChange_isNULL); ToStringArrayInt("AvailableRequestedStates", AvailableRequestedStates, AvailableRequestedStates_isNULL); ToStringInt("TransitioningToState", TransitioningToState, TransitioningToState_isNULL); ToString("InstanceID", InstanceID, InstanceID_isNULL); ToStringInt("CoreEnabledState", CoreEnabledState, CoreEnabledState_isNULL); ToStringArrayInt("Characteristics", Characteristics, Characteristics_isNULL); ToStringInt("LoadPercentage", LoadPercentage, LoadPercentage_isNULL); ToString("MaxClockSpeed", MaxClockSpeed, MaxClockSpeed_isNULL); ToString("CurrentClockSpeed", CurrentClockSpeed, CurrentClockSpeed_isNULL); os << " [\\OpenDRIM_ProcessorCore]" << endl; return os; } int main() { string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorCore_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = CPU_OpenDRIM_ProcessorCore_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = CPU_OpenDRIM_ProcessorCore_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = CPU_OpenDRIM_ProcessorCore_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = CPU_OpenDRIM_ProcessorCore_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-cpu-1.1.0~ppa/test/testOpenDRIM_AssociatedProcessorCoreCacheMemory.cpp0000644000175000017500000001371211400667756031277 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_AssociatedProcessorCoreCacheMemory.h" #include "OpenDRIM_AssociatedProcessorCoreCacheMemoryAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_AssociatedProcessorCoreCacheMemory& instance) { os << " [OpenDRIM_AssociatedProcessorCoreCacheMemory]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); ToStringInt("Level", Level, Level_isNULL); ToString("OtherLevelDescription", OtherLevelDescription, OtherLevelDescription_isNULL); ToStringInt("WritePolicy", WritePolicy, WritePolicy_isNULL); ToString("OtherWritePolicyDescription", OtherWritePolicyDescription, OtherWritePolicyDescription_isNULL); ToStringInt("CacheType", CacheType, CacheType_isNULL); ToString("OtherCacheTypeDescription", OtherCacheTypeDescription, OtherCacheTypeDescription_isNULL); ToString("LineSize", LineSize, LineSize_isNULL); ToStringInt("ReplacementPolicy", ReplacementPolicy, ReplacementPolicy_isNULL); ToString("OtherReplacementPolicyDescription", OtherReplacementPolicyDescription, OtherReplacementPolicyDescription_isNULL); ToStringInt("ReadPolicy", ReadPolicy, ReadPolicy_isNULL); ToString("OtherReadPolicyDescription", OtherReadPolicyDescription, OtherReadPolicyDescription_isNULL); ToString("FlushTimer", FlushTimer, FlushTimer_isNULL); ToStringInt("Associativity", Associativity, Associativity_isNULL); ToString("OtherAssociativityDescription", OtherAssociativityDescription, OtherAssociativityDescription_isNULL); os << " [\\OpenDRIM_AssociatedProcessorCoreCacheMemory]" << endl; return os; } int main() { string errorMessage; int errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = CPU_OpenDRIM_AssociatedProcessorCoreCacheMemory_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-cpu-1.1.0~ppa/test/testOpenDRIM_HardwareThread.cpp0000644000175000017500000001401111400667756025250 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_HardwareThread.h" #include "OpenDRIM_HardwareThreadAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_HardwareThread& instance) { os << " [OpenDRIM_HardwareThread]" << endl; ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstallDate", InstallDate, InstallDate_isNULL); ToString("Name", Name, Name_isNULL); ToStringArrayInt("OperationalStatus", OperationalStatus, OperationalStatus_isNULL); ToStringArray("StatusDescriptions", StatusDescriptions, StatusDescriptions_isNULL); ToString("Status", Status, Status_isNULL); ToStringInt("HealthState", HealthState, HealthState_isNULL); ToStringInt("PrimaryStatus", PrimaryStatus, PrimaryStatus_isNULL); ToStringInt("DetailedStatus", DetailedStatus, DetailedStatus_isNULL); ToStringInt("OperatingStatus", OperatingStatus, OperatingStatus_isNULL); ToStringInt("CommunicationStatus", CommunicationStatus, CommunicationStatus_isNULL); ToStringInt("EnabledState", EnabledState, EnabledState_isNULL); ToString("OtherEnabledState", OtherEnabledState, OtherEnabledState_isNULL); ToStringInt("RequestedState", RequestedState, RequestedState_isNULL); ToStringInt("EnabledDefault", EnabledDefault, EnabledDefault_isNULL); ToString("TimeOfLastStateChange", TimeOfLastStateChange, TimeOfLastStateChange_isNULL); ToStringArrayInt("AvailableRequestedStates", AvailableRequestedStates, AvailableRequestedStates_isNULL); ToStringInt("TransitioningToState", TransitioningToState, TransitioningToState_isNULL); ToString("InstanceID", InstanceID, InstanceID_isNULL); ToStringInt("LoadPercentage", LoadPercentage, LoadPercentage_isNULL); os << " [\\OpenDRIM_HardwareThread]" << endl; return os; } int main() { string errorMessage; int errorCode = CPU_OpenDRIM_HardwareThread_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = CPU_OpenDRIM_HardwareThread_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = CPU_OpenDRIM_HardwareThread_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = CPU_OpenDRIM_HardwareThread_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = CPU_OpenDRIM_HardwareThread_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-cpu-1.1.0~ppa/test/testOpenDRIM_ComputerSystemProcessor.cpp0000644000175000017500000001140411400667756027271 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ComputerSystemProcessor.h" #include "OpenDRIM_ComputerSystemProcessorAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_ComputerSystemProcessor& instance) { os << " [OpenDRIM_ComputerSystemProcessor]" << endl; ToStringRef("GroupComponent", GroupComponent, GroupComponent_isNULL); ToStringRef("PartComponent", PartComponent, PartComponent_isNULL); os << " [\\OpenDRIM_ComputerSystemProcessor]" << endl; return os; } int main() { string errorMessage; int errorCode = CPU_OpenDRIM_ComputerSystemProcessor_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = CPU_OpenDRIM_ComputerSystemProcessor_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = CPU_OpenDRIM_ComputerSystemProcessor_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = CPU_OpenDRIM_ComputerSystemProcessor_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = CPU_OpenDRIM_ComputerSystemProcessor_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-cpu-1.1.0~ppa/test/testOpenDRIM_ProcessorConformsToProfile.cpp0000644000175000017500000001146711400667756027711 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ProcessorConformsToProfile.h" #include "OpenDRIM_ProcessorConformsToProfileAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_ProcessorConformsToProfile& instance) { os << " [OpenDRIM_ProcessorConformsToProfile]" << endl; ToStringRef("ConformantStandard", ConformantStandard, ConformantStandard_isNULL); ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL); os << " [\\OpenDRIM_ProcessorConformsToProfile]" << endl; return os; } int main() { string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = CPU_OpenDRIM_ProcessorConformsToProfile_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-cpu-1.1.0~ppa/test/testOpenDRIM_RegisteredCPUProfile.cpp0000644000175000017500000001250311400667756026355 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredCPUProfile.h" #include "OpenDRIM_RegisteredCPUProfileAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_RegisteredCPUProfile& instance) { os << " [OpenDRIM_RegisteredCPUProfile]" << endl; ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstanceID", InstanceID, InstanceID_isNULL); ToStringInt("RegisteredOrganization", RegisteredOrganization, RegisteredOrganization_isNULL); ToString("OtherRegisteredOrganization", OtherRegisteredOrganization, OtherRegisteredOrganization_isNULL); ToString("RegisteredName", RegisteredName, RegisteredName_isNULL); ToString("RegisteredVersion", RegisteredVersion, RegisteredVersion_isNULL); ToStringArrayInt("AdvertiseTypes", AdvertiseTypes, AdvertiseTypes_isNULL); ToStringArray("AdvertiseTypeDescriptions", AdvertiseTypeDescriptions, AdvertiseTypeDescriptions_isNULL); os << " [\\OpenDRIM_RegisteredCPUProfile]" << endl; return os; } int main() { string errorMessage; int errorCode = CPU_OpenDRIM_RegisteredCPUProfile_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = CPU_OpenDRIM_RegisteredCPUProfile_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = CPU_OpenDRIM_RegisteredCPUProfile_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = CPU_OpenDRIM_RegisteredCPUProfile_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = CPU_OpenDRIM_RegisteredCPUProfile_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-cpu-1.1.0~ppa/test/testOpenDRIM_ProcessorCoreHardwareThread.cpp0000644000175000017500000001146411400667756027772 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ProcessorCoreHardwareThread.h" #include "OpenDRIM_ProcessorCoreHardwareThreadAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_ProcessorCoreHardwareThread& instance) { os << " [OpenDRIM_ProcessorCoreHardwareThread]" << endl; ToStringRef("GroupComponent", GroupComponent, GroupComponent_isNULL); ToStringRef("PartComponent", PartComponent, PartComponent_isNULL); os << " [\\OpenDRIM_ProcessorCoreHardwareThread]" << endl; return os; } int main() { string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-cpu-1.1.0~ppa/test/testOpenDRIM_CacheMemory.cpp0000644000175000017500000002341011400667756024562 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_CacheMemory.h" #include "OpenDRIM_CacheMemoryAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_CacheMemory& instance) { os << " [OpenDRIM_CacheMemory]" << endl; ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstallDate", InstallDate, InstallDate_isNULL); ToStringArrayInt("OperationalStatus", OperationalStatus, OperationalStatus_isNULL); ToStringArray("StatusDescriptions", StatusDescriptions, StatusDescriptions_isNULL); ToString("Status", Status, Status_isNULL); ToStringInt("HealthState", HealthState, HealthState_isNULL); ToStringInt("PrimaryStatus", PrimaryStatus, PrimaryStatus_isNULL); ToStringInt("DetailedStatus", DetailedStatus, DetailedStatus_isNULL); ToStringInt("OperatingStatus", OperatingStatus, OperatingStatus_isNULL); ToStringInt("CommunicationStatus", CommunicationStatus, CommunicationStatus_isNULL); ToStringInt("EnabledState", EnabledState, EnabledState_isNULL); ToString("OtherEnabledState", OtherEnabledState, OtherEnabledState_isNULL); ToStringInt("RequestedState", RequestedState, RequestedState_isNULL); ToStringInt("EnabledDefault", EnabledDefault, EnabledDefault_isNULL); ToString("TimeOfLastStateChange", TimeOfLastStateChange, TimeOfLastStateChange_isNULL); ToStringArrayInt("AvailableRequestedStates", AvailableRequestedStates, AvailableRequestedStates_isNULL); ToStringInt("TransitioningToState", TransitioningToState, TransitioningToState_isNULL); ToString("SystemCreationClassName", SystemCreationClassName, SystemCreationClassName_isNULL); ToString("SystemName", SystemName, SystemName_isNULL); ToString("CreationClassName", CreationClassName, CreationClassName_isNULL); ToString("DeviceID", DeviceID, DeviceID_isNULL); ToString("PowerManagementSupported", PowerManagementSupported, PowerManagementSupported_isNULL); ToStringArrayInt("PowerManagementCapabilities", PowerManagementCapabilities, PowerManagementCapabilities_isNULL); ToStringInt("Availability", Availability, Availability_isNULL); ToStringInt("StatusInfo", StatusInfo, StatusInfo_isNULL); ToString("LastErrorCode", LastErrorCode, LastErrorCode_isNULL); ToString("ErrorDescription", ErrorDescription, ErrorDescription_isNULL); ToString("ErrorCleared", ErrorCleared, ErrorCleared_isNULL); ToStringArray("OtherIdentifyingInfo", OtherIdentifyingInfo, OtherIdentifyingInfo_isNULL); ToString("PowerOnHours", PowerOnHours, PowerOnHours_isNULL); ToString("TotalPowerOnHours", TotalPowerOnHours, TotalPowerOnHours_isNULL); ToStringArray("IdentifyingDescriptions", IdentifyingDescriptions, IdentifyingDescriptions_isNULL); ToStringArrayInt("AdditionalAvailability", AdditionalAvailability, AdditionalAvailability_isNULL); ToString("MaxQuiesceTime", MaxQuiesceTime, MaxQuiesceTime_isNULL); ToStringInt("LocationIndicator", LocationIndicator, LocationIndicator_isNULL); ToStringInt("DataOrganization", DataOrganization, DataOrganization_isNULL); ToString("Purpose", Purpose, Purpose_isNULL); ToStringInt("Access", Access, Access_isNULL); ToString("BlockSize", BlockSize, BlockSize_isNULL); ToString("NumberOfBlocks", NumberOfBlocks, NumberOfBlocks_isNULL); ToString("ConsumableBlocks", ConsumableBlocks, ConsumableBlocks_isNULL); ToString("IsBasedOnUnderlyingRedundancy", IsBasedOnUnderlyingRedundancy, IsBasedOnUnderlyingRedundancy_isNULL); ToString("SequentialAccess", SequentialAccess, SequentialAccess_isNULL); ToStringArrayInt("ExtentStatus", ExtentStatus, ExtentStatus_isNULL); ToString("NoSinglePointOfFailure", NoSinglePointOfFailure, NoSinglePointOfFailure_isNULL); ToStringInt("DataRedundancy", DataRedundancy, DataRedundancy_isNULL); ToStringInt("PackageRedundancy", PackageRedundancy, PackageRedundancy_isNULL); ToStringInt("DeltaReservation", DeltaReservation, DeltaReservation_isNULL); ToString("Primordial", Primordial, Primordial_isNULL); ToString("Name", Name, Name_isNULL); ToStringInt("NameFormat", NameFormat, NameFormat_isNULL); ToStringInt("NameNamespace", NameNamespace, NameNamespace_isNULL); ToString("OtherNameNamespace", OtherNameNamespace, OtherNameNamespace_isNULL); ToString("OtherNameFormat", OtherNameFormat, OtherNameFormat_isNULL); ToStringInt("Usage", Usage, Usage_isNULL); ToString("OtherUsageDescription", OtherUsageDescription, OtherUsageDescription_isNULL); ToStringArrayInt("ClientSettableUsage", ClientSettableUsage, ClientSettableUsage_isNULL); ToString("Volatile", Volatile, Volatile_isNULL); ToString("ErrorMethodology", ErrorMethodology, ErrorMethodology_isNULL); ToString("StartingAddress", StartingAddress, StartingAddress_isNULL); ToString("EndingAddress", EndingAddress, EndingAddress_isNULL); ToStringInt("ErrorInfo", ErrorInfo, ErrorInfo_isNULL); ToString("OtherErrorDescription", OtherErrorDescription, OtherErrorDescription_isNULL); ToString("CorrectableError", CorrectableError, CorrectableError_isNULL); ToString("ErrorTime", ErrorTime, ErrorTime_isNULL); ToStringInt("ErrorAccess", ErrorAccess, ErrorAccess_isNULL); ToString("ErrorTransferSize", ErrorTransferSize, ErrorTransferSize_isNULL); ToStringArrayInt("ErrorData", ErrorData, ErrorData_isNULL); ToStringInt("ErrorDataOrder", ErrorDataOrder, ErrorDataOrder_isNULL); ToString("ErrorAddress", ErrorAddress, ErrorAddress_isNULL); ToString("SystemLevelAddress", SystemLevelAddress, SystemLevelAddress_isNULL); ToString("ErrorResolution", ErrorResolution, ErrorResolution_isNULL); ToStringArrayInt("AdditionalErrorData", AdditionalErrorData, AdditionalErrorData_isNULL); os << " [\\OpenDRIM_CacheMemory]" << endl; return os; } int main() { string errorMessage; int errorCode = CPU_OpenDRIM_CacheMemory_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = CPU_OpenDRIM_CacheMemory_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = CPU_OpenDRIM_CacheMemory_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = CPU_OpenDRIM_CacheMemory_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = CPU_OpenDRIM_CacheMemory_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-cpu-1.1.0~ppa/test/testOpenDRIM_Processor.cpp0000644000175000017500000002024011400667756024343 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_Processor.h" #include "OpenDRIM_ProcessorAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_Processor& instance) { os << " [OpenDRIM_Processor]" << endl; ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstallDate", InstallDate, InstallDate_isNULL); ToString("Name", Name, Name_isNULL); ToStringArrayInt("OperationalStatus", OperationalStatus, OperationalStatus_isNULL); ToStringArray("StatusDescriptions", StatusDescriptions, StatusDescriptions_isNULL); ToString("Status", Status, Status_isNULL); ToStringInt("HealthState", HealthState, HealthState_isNULL); ToStringInt("PrimaryStatus", PrimaryStatus, PrimaryStatus_isNULL); ToStringInt("DetailedStatus", DetailedStatus, DetailedStatus_isNULL); ToStringInt("OperatingStatus", OperatingStatus, OperatingStatus_isNULL); ToStringInt("CommunicationStatus", CommunicationStatus, CommunicationStatus_isNULL); ToStringInt("EnabledState", EnabledState, EnabledState_isNULL); ToString("OtherEnabledState", OtherEnabledState, OtherEnabledState_isNULL); ToStringInt("RequestedState", RequestedState, RequestedState_isNULL); ToStringInt("EnabledDefault", EnabledDefault, EnabledDefault_isNULL); ToString("TimeOfLastStateChange", TimeOfLastStateChange, TimeOfLastStateChange_isNULL); ToStringArrayInt("AvailableRequestedStates", AvailableRequestedStates, AvailableRequestedStates_isNULL); ToStringInt("TransitioningToState", TransitioningToState, TransitioningToState_isNULL); ToString("SystemCreationClassName", SystemCreationClassName, SystemCreationClassName_isNULL); ToString("SystemName", SystemName, SystemName_isNULL); ToString("CreationClassName", CreationClassName, CreationClassName_isNULL); ToString("DeviceID", DeviceID, DeviceID_isNULL); ToString("PowerManagementSupported", PowerManagementSupported, PowerManagementSupported_isNULL); ToStringArrayInt("PowerManagementCapabilities", PowerManagementCapabilities, PowerManagementCapabilities_isNULL); ToStringInt("Availability", Availability, Availability_isNULL); ToStringInt("StatusInfo", StatusInfo, StatusInfo_isNULL); ToString("LastErrorCode", LastErrorCode, LastErrorCode_isNULL); ToString("ErrorDescription", ErrorDescription, ErrorDescription_isNULL); ToString("ErrorCleared", ErrorCleared, ErrorCleared_isNULL); ToStringArray("OtherIdentifyingInfo", OtherIdentifyingInfo, OtherIdentifyingInfo_isNULL); ToString("PowerOnHours", PowerOnHours, PowerOnHours_isNULL); ToString("TotalPowerOnHours", TotalPowerOnHours, TotalPowerOnHours_isNULL); ToStringArray("IdentifyingDescriptions", IdentifyingDescriptions, IdentifyingDescriptions_isNULL); ToStringArrayInt("AdditionalAvailability", AdditionalAvailability, AdditionalAvailability_isNULL); ToString("MaxQuiesceTime", MaxQuiesceTime, MaxQuiesceTime_isNULL); ToStringInt("LocationIndicator", LocationIndicator, LocationIndicator_isNULL); ToString("Role", Role, Role_isNULL); ToStringInt("Family", Family, Family_isNULL); ToString("OtherFamilyDescription", OtherFamilyDescription, OtherFamilyDescription_isNULL); ToStringInt("UpgradeMethod", UpgradeMethod, UpgradeMethod_isNULL); ToString("MaxClockSpeed", MaxClockSpeed, MaxClockSpeed_isNULL); ToString("CurrentClockSpeed", CurrentClockSpeed, CurrentClockSpeed_isNULL); ToStringInt("DataWidth", DataWidth, DataWidth_isNULL); ToStringInt("AddressWidth", AddressWidth, AddressWidth_isNULL); ToStringInt("LoadPercentage", LoadPercentage, LoadPercentage_isNULL); ToString("Stepping", Stepping, Stepping_isNULL); ToString("UniqueID", UniqueID, UniqueID_isNULL); ToStringInt("CPUStatus", CPUStatus, CPUStatus_isNULL); ToString("ExternalBusClockSpeed", ExternalBusClockSpeed, ExternalBusClockSpeed_isNULL); ToStringArrayInt("Characteristics", Characteristics, Characteristics_isNULL); ToStringInt("NumberOfEnabledCores", NumberOfEnabledCores, NumberOfEnabledCores_isNULL); os << " [\\OpenDRIM_Processor]" << endl; return os; } int main() { string errorMessage; int errorCode = CPU_OpenDRIM_Processor_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = CPU_OpenDRIM_Processor_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = CPU_OpenDRIM_Processor_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = CPU_OpenDRIM_Processor_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = CPU_OpenDRIM_Processor_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-cpu-1.1.0~ppa/acinclude.m40000644000175000017500000002122711400667756020543 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ AC_DEFUN([SHOW_COPYRIGHT], [ echo "################################################################################# # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# " ] ) AC_DEFUN([CHECK_CIMSERVER], [ AC_MSG_CHECKING(for CIM servers) if test x"$CIMSERVER" == x then AC_MSG_ERROR([[please define the CIMSERVER variable (see ./configure --help)]]) fi if test "$CIMSERVER" != pegasus && test "$CIMSERVER" != sfcb && test "$CIMSERVER" != openwbem then AC_MSG_ERROR([[please define the CIMSERVER variable (see ./configure --help)]]) fi if test "$CIMSERVER" == pegasus then if !( command -v cimmof > /dev/null ) then AC_MSG_ERROR([[no. the Pegasus mof compiler could not be found (cimmof)]]) fi fi if test "$CIMSERVER" == openwbem then if !( command -v owmofc > /dev/null) then AC_MSG_ERROR([[no. the OpenWBEM mof compiler could not be found (owmofc)]]) fi fi if test "$CIMSERVER" == sfcb then if !( command -v sfcbd > /dev/null ) then AC_MSG_ERROR([[no. the SBLIM sfcb deamon could not be found (sfcbd)]]) fi if !( command -v sfcbstage > /dev/null ) then AC_MSG_ERROR([[no. the SBLIM mof stager could not be found (sfcbstage)]]) fi if !( command -v sfcbrepos > /dev/null ) then AC_MSG_ERROR([[no. the SBLIM repository builder could no be found (sfcbrepos)]]) fi fi if test "$CIMSERVER" == pegasus then if test x"$prefix" == xNONE then if test "$HW" == X86_64 || test "$HW" == IA64 then PROVIDERDIR_TMP=/usr/lib64/Pegasus/providers COMMONLIBDIR_TMP=/usr/lib64 OPENDRIMCOMMONLIBDIR_TMP=/usr/lib64 else PROVIDERDIR_TMP=/usr/lib/Pegasus/providers COMMONLIBDIR_TMP=/usr/lib OPENDRIMCOMMONLIBDIR_TMP=/usr/lib fi OPENDRIMCOMMONINCLUDE_TMP=/usr/include/OpenDRIM else if test "$HW" == X86_64 || test "$HW" == IA64 then PROVIDERDIR_TMP=$prefix/lib64/Pegasus/providers COMMONLIBDIR_TMP=$prefix/lib64 OPENDRIMCOMMONLIBDIR_TMP=$prefix/lib64 else PROVIDERDIR_TMP=$prefix/lib/Pegasus/providers COMMONLIBDIR_TMP=$prefix/lib OPENDRIMCOMMONLIBDIR_TMP=$prefix/lib fi OPENDRIMCOMMONINCLUDE_TMP=$prefix/include/OpenDRIM fi if test x"$PEGASUS_HOME" != x then PROVIDERDIR_TMP=$PEGASUS_HOME/lib COMMONLIBDIR_TMP=$PEGASUS_HOME/lib OPENDRIMCOMMONLIBDIR_TMP=$PEGASUS_HOME/lib OPENDRIMCOMMONINCLUDE_TMP=$PEGASUS_HOME/include/OpenDRIM fi fi if test "$CIMSERVER" == sfcb then if test x"$prefix" == xNONE then PROVIDERDIR_TMP=$ac_default_prefix/lib/cmpi COMMONLIBDIR_TMP=$ac_default_prefix/lib OPENDRIMCOMMONLIBDIR_TMP=$ac_default_prefix/lib OPENDRIMCOMMONINCLUDE_TMP=$ac_default_prefix/include/OpenDRIM else PROVIDERDIR_TMP=$prefix/lib/cmpi COMMONLIBDIR_TMP=$prefix/lib OPENDRIMCOMMONLIBDIR_TMP=$prefix/lib OPENDRIMCOMMONINCLUDE_TMP=$prefix/include/OpenDRIM fi fi if test "$CIMSERVER" == openwbem then if test x"$prefix" == xNONE then if test "$HW" == X86_64 || test "$HW" == IA64 then PROVIDERDIR_TMP=/usr/lib64/openwbem/cmpiproviders COMMONLIBDIR_TMP=/usr/lib64 OPENDRIMCOMMONLIBDIR_TMP=/usr/lib64 else PROVIDERDIR_TMP=/usr/lib/openwbem/cmpiproviders COMMONLIBDIR_TMP=/usr/lib OPENDRIMCOMMONLIBDIR_TMP=/usr/lib fi OPENDRIMCOMMONINCLUDE_TMP=/usr/include/OpenDRIM else PROVIDERDIR_TMP=$prefix/lib/openwbem/cmpiproviders COMMONLIBDIR_TMP=$prefix/lib OPENDRIMCOMMONLIBDIR_TMP=$prefix/lib OPENDRIMCOMMONINCLUDE_TMP=$prefix/include/OpenDRIM fi fi if test x"$PROVIDERDIR" = x then PROVIDERDIR=$PROVIDERDIR_TMP fi if test x"$COMMONLIBDIR" = x then COMMONLIBDIR=$COMMONLIBDIR_TMP fi if test x"$OPENDRIMCOMMONLIBDIR" = x then OPENDRIMCOMMONLIBDIR=$OPENDRIMCOMMONLIBDIR_TMP fi if test x"$OPENDRIMCOMMONINCLUDE" = x then OPENDRIMCOMMONINCLUDE=$OPENDRIMCOMMONINCLUDE_TMP fi TEMP_CPPFLAGS="$CPPFLAGS -D_REENTRANT" CFLAGS="-Wall -Wunused -fPIC -O2 $CFLAGS" CXXFLAGS="-Wall -Wunused -fPIC -fno-rtti -fno-exceptions -O2 $CXXFLAGS" LDFLAGS="$LDFLAGS -L. -L$PROVIDERDIR -L$COMMONLIBDIR" AC_MSG_RESULT(yes) ] ) AC_DEFUN([CHECK_CIMNAMESPACE], [ if test x"$CIMNAMESPACE" == x then CIMNAMESPACE=root/cimv2 fi TEMP_CPPFLAGS="$TEMP_CPPFLAGS -D_NAMESPACE=\\\"$CIMNAMESPACE\\\"" ] ) AC_DEFUN([CHECK_INTEROPNAMESPACE], [ if test x"$INTEROPNAMESPACE" == x then if test "$CIMSERVER" == pegasus then INTEROPNAMESPACE=Interop fi if test "$CIMSERVER" == openwbem then INTEROPNAMESPACE=root/Interop fi if test "$CIMSERVER" == sfcb then INTEROPNAMESPACE=Interop fi fi TEMP_CPPFLAGS="$TEMP_CPPFLAGS -D_INTEROP_NAMESPACE=\\\"$INTEROPNAMESPACE\\\"" ] ) AC_DEFUN([CHECK_OPENDRIMCOMMONHEADERS], [ AC_MSG_CHECKING(for OpenDRIM Common headers) _HEADERS="Common.h Datastore.h CMPIBroking.h Association.h Indication.h Instance.h Objectpath.h Transtype.h" for _HEADER in $_HEADERS do if !( test -e $OPENDRIMCOMMONINCLUDE/$_HEADER ) then AC_MSG_ERROR([[no. Could not find OpenDRIM Common headers:] $_HEADER]) fi done AC_MSG_RESULT(yes) ] ) AC_DEFUN([CHECK_OPENDRIMCOMMONLIBRARY], [ AC_MSG_CHECKING(for OpenDRIM Common library) if test -e $OPENDRIMCOMMONLIBDIR/libopendrim.so then AC_MSG_RESULT(yes) else AC_MSG_ERROR([[no. The OpenDRIM Common library could not be found (libopendrim.so)]]) fi ] ) AC_DEFUN([_CHECK_CMPIHEADERS], [ AC_MSG_CHECKING($1) AC_TRY_LINK( [ #include #include #include ], [ CMPIBroker broker; CMPIStatus status = {CMPI_RC_OK, NULL}; CMPIString *s = CMNewString(&broker, "TEST", &status); ], [ have_CMPI=yes ], [ have_CMPI=no ]) ]) AC_DEFUN([CHECK_CMPIHEADERS], [ AC_MSG_CHECKING(for CMPI headers) CPPFLAGS="$TEMP_CPPFLAGS -DCMPI_PLATFORM_LINUX_GENERIC_GNU -I$OPENDRIMCOMMONINCLUDE/cmpi" _CHECK_CMPIHEADERS($OPENDRIMCOMMONINCLUDE) if test "$have_CMPI" == "yes" then CPPFLAGS="$TEMP_CPPFLAGS" AC_MSG_RESULT(yes) else _CHECK_CMPIHEADERS(standard) if test "$have_CMPI" == "yes" then CPPFLAGS="$TEMP_CPPFLAGS" AC_MSG_RESULT(yes) fi fi if test "$have_CMPI" == "no" then AC_MSG_ERROR([[no. The CMPI headers could not be found (cmpidt.h, cmpimacs.h, cmpift.h)]]) fi ] ) opendrim-lmp-cpu-1.1.0~ppa/Common/0000755000175000017500000000000011400667756017576 5ustar guillaumeguillaumeopendrim-lmp-cpu-1.1.0~ppa/Common/Makefile.am0000644000175000017500000000346111400667756021636 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ commonlibdir = @COMMONLIBDIR@ commonlib_LTLIBRARIES = libcmpiCPU_Common.la libcmpiCPU_Common_la_SOURCES = CPU_Common.cpp libcmpiCPU_Common_la_LDFLAGS = -avoid-version libcmpiCPU_Common_la_LIBADD = -lopendrim noinst_HEADERS = CPU_Common.h opendrim-lmp-cpu-1.1.0~ppa/Common/CPU_Common.h0000644000175000017500000001042511400667756021710 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CPU_COMMON_H_ #define CPU_COMMON_H_ #include // CacheAccess/Core: cache memory can be shared between multiple cores // Family Model Stepping Registers CacheAccess/Core (shared / independant / none) const static char* _GenuineIntel_CPUs[][5] = { // Genuine Intel(R) CPU {"6", "14", "8", "x86", "shared"},\ // Intel(R) Core(TM)2 CPU {"6", "15", "6", "ia64", "shared"},\ // Intel(R) Pentium(R) 4 CPU {"15", "2", "9", "x86", "none"},\ // Intel(R) Xeon(TM) CPU {"15", "6", "4", "ia64", "independant"} }; // Family Model Stepping Registers CacheAccess/Core (shared / independant / none) const static char* _AuthenticAMD_Processors[][5] = { // AMD-K7(tm) Processor {"6", "1", "2", "x86", "none"},\ // mobile AMD Athlon(tm) XP {"6", "8", "0", "x86", "none"},\ // Dual Core AMD Opteron(tm) Processor {"15", "33", "2", "x86_64", "independant"},\ // AMD Athlon(tm) 64 Processor {"15", "47", "2", "x86_64", "none"},\ // AMD Athlon(tm) 64 X2 Dual Core Processor {"15", "75", "2", "x86_64", "independant"},\ {"15", "67", "3", "x86_64", "independant"} }; typedef struct { unsigned short nb_hardware_thread; vector hardware_thread_load_averages; vector previous_hardware_thread_idle_cputimes; vector previous_hardware_thread_total_cputimes; bool associated_cache_memory; unsigned long long cache_memory_size; // in kHz unsigned long current_freq; unsigned short load_average; } _processor_core; typedef struct { vector<_processor_core> processor_cores; bool associated_cache_memory; // in KBytes unsigned long long cache_memory_size; unsigned short family; unsigned short model; unsigned short stepping; // x86, s390, ppc, x86_64, ia64, generic string architecture; string vendor; string name; unsigned short physical_address_size; unsigned short virtual_address_size; unsigned short load_average; } _processor_topology; string CPU_printProcessors(const vector<_processor_topology>& processors); void CPU_setCoreToDefault(_processor_core& processor_core); void CPU_setTopologyToDefault(_processor_topology& processor_topology); void CPU_findProcessorArchitecture(_processor_topology& topology); int CPU_getProcessors(const string& cpuinfo_path, vector<_processor_topology>& processors, string& errorMessage); int CPU_getLoadAverages(vector<_processor_topology>& new_processors, const vector<_processor_topology>& old_processors, string& errorMessage); #endif /*CPU_COMMON_H_*/ opendrim-lmp-cpu-1.1.0~ppa/Common/CPU_Common.cpp0000644000175000017500000004377011400667756022254 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "CPU_Common.h" string CPU_printProcessors(const vector<_processor_topology>& processors) { _E_; string processors_string; for (unsigned long i = 0; i < processors.size(); i ++) { processors_string += "Processor " + CF_intToStr(i) + ":\n"; for (unsigned long j = 0; j < processors[i].processor_cores.size(); j++) { processors_string += " Core " + CF_intToStr(j) + ":\n"; processors_string += " nb_hardware_thread: " + CF_intToStr(processors[i].processor_cores[j].nb_hardware_thread) + "\n"; for (unsigned long k = 0; k < processors[i].processor_cores[j].nb_hardware_thread; k++) { processors_string += " hardware_thread_load_average: " + CF_intToStr(processors[i].processor_cores[j].hardware_thread_load_averages[k]) + "\n"; processors_string += " previous_hardware_thread_idle_cputime: " + CF_intToStr(processors[i].processor_cores[j].previous_hardware_thread_idle_cputimes[k]) + "\n"; processors_string += " previous_hardware_thread_total_cputime: " + CF_intToStr(processors[i].processor_cores[j].previous_hardware_thread_total_cputimes[k]) + "\n"; } processors_string += " associated_cache_memory: " + CF_boolToStr(processors[i].processor_cores[j].associated_cache_memory) + "\n"; processors_string += " cache_memory_size: " + CF_intToStr(processors[i].processor_cores[j].cache_memory_size) + "\n"; processors_string += " current_freq: " + CF_intToStr(processors[i].processor_cores[j].current_freq) + "\n"; processors_string += " load_average: " + CF_intToStr(processors[i].processor_cores[j].load_average) + "\n"; } processors_string += " associated_cache_memory: " + CF_boolToStr(processors[i].associated_cache_memory) + "\n"; processors_string += " cache_memory_size: " + CF_intToStr(processors[i].cache_memory_size) + "\n"; processors_string += " family: " + CF_intToStr(processors[i].family) + "\n"; processors_string += " model: " + CF_intToStr(processors[i].model) + "\n"; processors_string += " stepping: " + CF_intToStr(processors[i].stepping) + "\n"; processors_string += " architecture: " + processors[i].architecture + "\n"; processors_string += " vendor: " + processors[i].vendor + "\n"; processors_string += " name: " + processors[i].name + "\n"; processors_string += " physical_address_size: " + CF_intToStr(processors[i].physical_address_size) + "\n"; processors_string += " virtual_address_size: " + CF_intToStr(processors[i].virtual_address_size) + "\n"; processors_string += " load_average: " + CF_intToStr(processors[i].load_average) + "\n"; } _L_; return processors_string; } void CPU_setCoreToDefault(_processor_core& processor_core) { _E_; processor_core.nb_hardware_thread = 1; processor_core.hardware_thread_load_averages.clear(); processor_core.previous_hardware_thread_idle_cputimes.clear(); processor_core.previous_hardware_thread_total_cputimes.clear(); processor_core.associated_cache_memory = false; // by default cache is associated with the processor processor_core.cache_memory_size = 0; processor_core.current_freq = 0; processor_core.load_average = 0; _L_; } void CPU_setTopologyToDefault(_processor_topology& processor_topology) { _E_; processor_topology.processor_cores.clear(); processor_topology.associated_cache_memory = true; // by default cache is associated with the processor processor_topology.cache_memory_size = 0; processor_topology.family = 0; processor_topology.model = 0; processor_topology.stepping = 0; processor_topology.architecture = ""; processor_topology.vendor = ""; processor_topology.name = ""; processor_topology.physical_address_size = 0; processor_topology.virtual_address_size = 0; processor_topology.load_average = 0; _L_; } void CPU_findProcessorArchitecture(_processor_topology& topology) { _E_; if (topology.vendor == "AuthenticAMD") { for (unsigned long i = 0; i < sizeof(_AuthenticAMD_Processors)/sizeof(_AuthenticAMD_Processors[0]); i++) { if (topology.family == atoi(_AuthenticAMD_Processors[i][0]) && topology.model == atoi(_AuthenticAMD_Processors[i][1]) && topology.stepping == atoi(_AuthenticAMD_Processors[i][2])) { topology.architecture = _AuthenticAMD_Processors[i][3]; if (_AuthenticAMD_Processors[i][4] == "shared") topology.associated_cache_memory = false; break; } } } if (topology.vendor == "GenuineIntel") { for (unsigned long i = 0; i < sizeof(_GenuineIntel_CPUs)/sizeof(_GenuineIntel_CPUs[0]); i++) { if (topology.family == atoi(_GenuineIntel_CPUs[i][0]) && topology.model == atoi(_GenuineIntel_CPUs[i][1]) && topology.stepping == atoi(_GenuineIntel_CPUs[i][2])) { topology.architecture = _GenuineIntel_CPUs[i][3]; if (_GenuineIntel_CPUs[i][4] == "shared") topology.associated_cache_memory = false; break; } } } _L_; } int CPU_getProcessors(const string& cpuinfo_path, vector<_processor_topology>& processors, string& errorMessage) { _E_; processors.clear(); vector cpuinfo_lines; string stdOut, stdErr; // read the cpu information CF_assert(CF_readTextFileToLines(cpuinfo_path, cpuinfo_lines, 0, errorMessage)); unsigned long nb_core_per_processor = 1; unsigned long nb_hardware_thread_per_core = 1; long nb_core_to_go = -1; long nb_thread_to_go = -1; unsigned long siblings = 1; unsigned long long cache = 0; _processor_topology current_topology; _processor_core current_core; CPU_setTopologyToDefault(current_topology); // guessing what the architecture is // Note: you can install a 32 bit system on a 64 bit architecture which means this info is not reliable #if defined(INTEL) current_topology.architecture = "x86"; #elif defined (X86_64) current_topology.architecture = "x86_64"; #elif defined (IA64) current_topology.architecture = "ia64"; #elif defined (S390) current_topology.architecture = "s390"; #elif defined (PPC) current_topology.architecture = "ppc"; #elif defined (GENERIC) current_topology.architecture = "generic"; #endif CPU_setCoreToDefault(current_core); // for each line of the cpuinfo file for (unsigned long i=0; i < cpuinfo_lines.size(); i++) { // skip empty lines if (cpuinfo_lines[i].size() == 0) continue; // split the line vector cpuinfo_line; CF_splitTextBySpace(cpuinfo_line, CF_untab(cpuinfo_lines[i])); // who knows... if (cpuinfo_line.size() < 2) continue; // found a processor declaration if (cpuinfo_line[0] == "processor") { if (nb_thread_to_go == 0) { // add a core to the topology if (!current_topology.associated_cache_memory) { current_core.associated_cache_memory = true; current_core.cache_memory_size = cache / nb_core_per_processor; } current_core.nb_hardware_thread = nb_hardware_thread_per_core; for (unsigned int j = 0; j < nb_hardware_thread_per_core; j++) { current_core.hardware_thread_load_averages.push_back(0); current_core.previous_hardware_thread_idle_cputimes.push_back(1); current_core.previous_hardware_thread_total_cputimes.push_back(1); } current_topology.processor_cores.push_back(current_core); CPU_setCoreToDefault(current_core); } if (nb_core_to_go == 0 && nb_thread_to_go == 0) { // we're done for this processor if (current_topology.associated_cache_memory) current_topology.cache_memory_size = cache; processors.push_back(current_topology); // reset the processor CPU_setTopologyToDefault(current_topology); nb_core_per_processor = 1; nb_hardware_thread_per_core = 1; nb_core_to_go = -1; nb_thread_to_go = -1; continue; } // go to the next hardware thread if (nb_thread_to_go > 0) { nb_thread_to_go--; continue; } // go to the next core if (nb_thread_to_go == 0 && nb_core_to_go > 0) { nb_thread_to_go = nb_hardware_thread_per_core - 1; nb_core_to_go--; continue; } } // vendor_id if (nb_core_to_go == -1 && nb_thread_to_go ==-1 && cpuinfo_line[0] == "vendor_id") { if (cpuinfo_line.size() < 3) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } current_topology.vendor = cpuinfo_line[2]; continue; } // cpu family if (nb_core_to_go == -1 && nb_thread_to_go ==-1 && cpuinfo_line[0] == "cpu" && cpuinfo_line[1] == "family") { if (cpuinfo_line.size() < 4) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } current_topology.family = atoi(cpuinfo_line[3].c_str()); continue; } // model if (nb_core_to_go == -1 && nb_thread_to_go ==-1 && cpuinfo_line[0] == "model" && cpuinfo_line[1] == ":") { if (cpuinfo_line.size() < 3) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } current_topology.model = atoi(cpuinfo_line[2].c_str()); continue; } // model name if (nb_core_to_go == -1 && nb_thread_to_go ==-1 && cpuinfo_line[0] == "model" && cpuinfo_line[1] == "name") { if (cpuinfo_line.size() < 4) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } for (unsigned int j = 3; j < cpuinfo_line.size(); j++) { current_topology.name += cpuinfo_line[j]; if (j < cpuinfo_line.size() - 1) current_topology.name += " "; } continue; } // stepping if (nb_core_to_go == -1 && nb_thread_to_go ==-1 && cpuinfo_line[0] == "stepping") { if (cpuinfo_line.size() < 3) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } current_topology.stepping = atoi(cpuinfo_line[2].c_str()); // we know which processor it is so let's try to find it in our own list CPU_findProcessorArchitecture(current_topology); continue; } // cpu MHz if (cpuinfo_line[0] == "cpu" && cpuinfo_line[1] == "MHz") { if (cpuinfo_line.size() < 4) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } current_core.current_freq = atof(cpuinfo_line[3].c_str())*1000; continue; } // cache size if (nb_core_to_go == -1 && nb_thread_to_go ==-1 && cpuinfo_line[0] == "cache" && cpuinfo_line[1] == "size") { if (cpuinfo_line.size() < 4) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } cache = atoll(cpuinfo_line[3].c_str()); continue; } // siblings if (nb_core_to_go == -1 && nb_thread_to_go ==-1 && cpuinfo_line[0] == "siblings") { if (cpuinfo_line.size() < 3) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } siblings = atol(cpuinfo_line[2].c_str()); continue; } // cpu cores if (nb_core_to_go == -1 && nb_thread_to_go ==-1 && cpuinfo_line[0] == "cpu" && cpuinfo_line[1] == "cores") { if (cpuinfo_line.size() < 4) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } // information for the current processor (first time we read it... and last) nb_core_per_processor = atol(cpuinfo_line[3].c_str()); nb_hardware_thread_per_core = siblings / nb_core_per_processor; // set the number of cores and hardware threads we should read next nb_core_to_go = nb_core_per_processor - 1; nb_thread_to_go = nb_hardware_thread_per_core - 1; continue; } // address sizes if (nb_core_to_go == nb_core_per_processor - 1 && nb_thread_to_go == nb_hardware_thread_per_core - 1 && cpuinfo_line[0] == "address" && cpuinfo_line[1] == "sizes") { if (cpuinfo_line.size() < 4) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } string rest_of_the_line; for (unsigned int j = 3; j < cpuinfo_line.size(); j++) { rest_of_the_line += cpuinfo_line[j]; if (j < cpuinfo_line.size()-1) rest_of_the_line += " "; } vector rest_of_the_line_elements; CF_splitText(rest_of_the_line_elements, rest_of_the_line, ','); if (rest_of_the_line_elements.size() < 2) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } vector rest_of_the_line_left_element, rest_of_the_line_right_element; CF_splitTextBySpace(rest_of_the_line_left_element, rest_of_the_line_elements[0]); CF_splitTextBySpace(rest_of_the_line_right_element, rest_of_the_line_elements[1]); if (rest_of_the_line_left_element.size() != 3 || rest_of_the_line_right_element.size() != 3) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } current_topology.physical_address_size = atoi(rest_of_the_line_left_element[0].c_str()); current_topology.virtual_address_size = atoi(rest_of_the_line_right_element[0].c_str()); continue; } } // the last core if (!current_topology.associated_cache_memory) { current_core.associated_cache_memory = true; current_core.cache_memory_size = cache / nb_core_per_processor; } current_core.nb_hardware_thread = nb_hardware_thread_per_core; for (unsigned int j = 0; j < nb_hardware_thread_per_core; j++) { current_core.hardware_thread_load_averages.push_back(0); current_core.previous_hardware_thread_idle_cputimes.push_back(1); current_core.previous_hardware_thread_total_cputimes.push_back(1); } current_topology.processor_cores.push_back(current_core); // the last processor if (current_topology.associated_cache_memory) current_topology.cache_memory_size = cache; processors.push_back(current_topology); _L_; return OK; } int CPU_getLoadAverages(vector<_processor_topology>& new_processors, const vector<_processor_topology>& old_processors, string& errorMessage) { _E_; vector proc_stat_lines; // read the cpu information CF_assert(CF_readTextFileToLines("/proc/stat", proc_stat_lines, 0, errorMessage)); unsigned int line_index = 1; for (unsigned int i = 0; i < new_processors.size(); i++) { for (unsigned int j = 0; j < new_processors[i].processor_cores.size(); j++) { for (unsigned int k = 0; k < new_processors[i].processor_cores[j].nb_hardware_thread; k++) { if (line_index >= proc_stat_lines.size()) { errorMessage = "Wrong format (not enough lines): /proc/stat"; return FAILED; } vector proc_stat_line; CF_splitTextBySpace(proc_stat_line, proc_stat_lines[line_index]); // /proc/stat cputime info line should contain at least 8 elemens if (proc_stat_line.size() < 8) { errorMessage = "Wrong format (at line " + CF_intToStr(line_index+1) + "): /proc/stat"; return FAILED; } // get fresh idle and total unsigned long long idle = CF_strToULL(proc_stat_line[4]); unsigned long long total = 0; for (unsigned int l = 1; l < proc_stat_line.size(); l++) { total += CF_strToULL(proc_stat_line[l]); } unsigned long long delta_idle = idle - old_processors[i].processor_cores[j].previous_hardware_thread_idle_cputimes[k]; unsigned long long delta_total = total - old_processors[i].processor_cores[j].previous_hardware_thread_total_cputimes[k]; // compute the new load average for this hardware thread if (delta_total != 0) new_processors[i].processor_cores[j].hardware_thread_load_averages[k] = (unsigned short) ((delta_total - delta_idle)*100/delta_total); else { if (delta_total - delta_idle == 0) new_processors[i].processor_cores[j].hardware_thread_load_averages[k] = 0; else new_processors[i].processor_cores[j].hardware_thread_load_averages[k] = 100; } // set the fresh idle and total new_processors[i].processor_cores[j].previous_hardware_thread_idle_cputimes[k] = idle; new_processors[i].processor_cores[j].previous_hardware_thread_total_cputimes[k] = total; line_index++; } unsigned long long load_average = 0; for (unsigned int k = 0; k < new_processors[i].processor_cores[j].nb_hardware_thread; k++) load_average += new_processors[i].processor_cores[j].hardware_thread_load_averages[k]; new_processors[i].processor_cores[j].load_average = (load_average/(new_processors[i].processor_cores[j].nb_hardware_thread)); } unsigned long long load_average = 0; for (unsigned int j = 0; j < new_processors[i].processor_cores.size(); j++) load_average += new_processors[i].processor_cores[j].load_average; new_processors[i].load_average = (load_average/(new_processors[i].processor_cores.size())); } _L_; return OK; } opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ComputerSystemProcessor/0000755000175000017500000000000011400667756024706 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ComputerSystemProcessor/OpenDRIM_ComputerSystemProcessorAccess.hopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ComputerSystemProcessor/OpenDRIM_ComputerSystemProcessorAccess.h0000644000175000017500000001074111400667756034544 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_COMPUTERSYSTEMPROCESSORACCESS_H_ #define OPENDRIM_COMPUTERSYSTEMPROCESSORACCESS_H_ #include "CPU_Common.h" #include "OpenDRIM_ComputerSystemProcessor.h" #include "assocOpenDRIM_ComputerSystemProcessor.h" int CPU_OpenDRIM_ComputerSystemProcessor_load(const CMPIBroker* broker, string& errorMessage); int CPU_OpenDRIM_ComputerSystemProcessor_unload(string& errorMessage); int CPU_OpenDRIM_ComputerSystemProcessor_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ComputerSystemProcessor_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ComputerSystemProcessor& instance, const char** properties, string& errorMessage); int CPU_OpenDRIM_ComputerSystemProcessor_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemProcessor& newInstance, const OpenDRIM_ComputerSystemProcessor& oldInstance, const char** properties, string& errorMessage); int CPU_OpenDRIM_ComputerSystemProcessor_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemProcessor& instance, string& errorMessage); int CPU_OpenDRIM_ComputerSystemProcessor_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemProcessor& instance, string& errorMessage); int CPU_OpenDRIM_ComputerSystemProcessor_associatorPartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const char** properties, vector& GroupComponent_associatedInstances, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ComputerSystemProcessor_associatorGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const char** properties, vector& PartComponent_associatedInstances, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ComputerSystemProcessor_referencePartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const vector& GroupComponent_instances, vector& OpenDRIM_ComputerSystemProcessor_instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ComputerSystemProcessor_referenceGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const vector& PartComponent_instances, vector& OpenDRIM_ComputerSystemProcessor_instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ComputerSystemProcessor_populate(OpenDRIM_ComputerSystemProcessor& instance, string& errorMessage); #endif /*OPENDRIM_COMPUTERSYSTEMPROCESSORACCESS_H_*/ ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ComputerSystemProcessor/OpenDRIM_ComputerSystemProcessorAccess.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ComputerSystemProcessor/OpenDRIM_ComputerSystemProcessorAccess.c0000644000175000017500000002504111400667756034536 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_ComputerSystemProcessorAccess.h" int CPU_OpenDRIM_ComputerSystemProcessor_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(CPU_CIM_LogicalDevice_load(broker, errorMessage)); CF_assert(CPU_CIM_System_load(broker, errorMessage)); */ // TODO _L_; return OK; } int CPU_OpenDRIM_ComputerSystemProcessor_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(CPU_CIM_LogicalDevice_unload(errorMessage)); CF_assert(CPU_CIM_System_unload(errorMessage)); */ // TODO _L_; return OK; } int CPU_OpenDRIM_ComputerSystemProcessor_isAssociated(const Instance& PartComponent, const Instance& GroupComponent, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int CPU_OpenDRIM_ComputerSystemProcessor_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector subjects; // Only get the instance names CF_assert(CPU_OpenDRIM_ComputerSystemProcessor_enumeratePartComponents(broker, ctx, subjects, NULL, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(CPU_OpenDRIM_ComputerSystemProcessor_enumeratePartComponents(broker, ctx, subjects, NULL, false, errorMessage)); vector::iterator c = subjects.begin(); vector::iterator end = subjects.end(); for (; c != end; ++c) { bool leftToRight = true; vector associatedInstances; CPU_OpenDRIM_ComputerSystemProcessor_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), PartComponent_classnames[0], GroupComponent_classnames[0], PartComponent_role.c_str(), GroupComponent_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(CPU_OpenDRIM_ComputerSystemProcessor_referencePartComponentToGroupComponent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int CPU_OpenDRIM_ComputerSystemProcessor_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ComputerSystemProcessor& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath PartComponent_objectpath; instance.getPartComponent(PartComponent_objectpath); Instance PartComponent_instance; CF_assert(CPU_OpenDRIM_ComputerSystemProcessor_getPartComponent(broker, ctx, PartComponent_objectpath, PartComponent_instance, NULL, errorMessage)); Objectpath GroupComponent_objectpath; instance.getGroupComponent(GroupComponent_objectpath); Instance GroupComponent_instance; CF_assert(CPU_OpenDRIM_ComputerSystemProcessor_getGroupComponent(broker, ctx, GroupComponent_objectpath, GroupComponent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(CPU_OpenDRIM_ComputerSystemProcessor_isAssociated(PartComponent_instance, GroupComponent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int CPU_OpenDRIM_ComputerSystemProcessor_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemProcessor& newInstance, const OpenDRIM_ComputerSystemProcessor& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_ComputerSystemProcessor_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemProcessor& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_ComputerSystemProcessor_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemProcessor& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_ComputerSystemProcessor_associatorPartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const char** properties, vector& GroupComponent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector GroupComponent_instances; if (discriminant=="a") CF_assert(CPU_OpenDRIM_ComputerSystemProcessor_enumerateGroupComponents(broker, ctx, GroupComponent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(CPU_OpenDRIM_ComputerSystemProcessor_enumerateGroupComponents(broker, ctx, GroupComponent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(CPU_OpenDRIM_ComputerSystemProcessor_enumerateGroupComponents(broker, ctx, GroupComponent_instances, properties, false, errorMessage)); } for (size_t i=0; i& PartComponent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector PartComponent_instances; if (discriminant=="a") CF_assert(CPU_OpenDRIM_ComputerSystemProcessor_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(CPU_OpenDRIM_ComputerSystemProcessor_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(CPU_OpenDRIM_ComputerSystemProcessor_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, false, errorMessage)); } for (size_t i=0; i& GroupComponent_instances, vector& OpenDRIM_ComputerSystemProcessor_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < GroupComponent_instances.size(); i++) { OpenDRIM_ComputerSystemProcessor instance; instance.setPartComponent(((Instance) PartComponent_instance).getObjectpath()); instance.setGroupComponent(((Instance) GroupComponent_instances[i]).getObjectpath()); OpenDRIM_ComputerSystemProcessor_instances.push_back(instance); } _L_; return OK; } int CPU_OpenDRIM_ComputerSystemProcessor_referenceGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const vector& PartComponent_instances, vector& OpenDRIM_ComputerSystemProcessor_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < PartComponent_instances.size(); i++) { OpenDRIM_ComputerSystemProcessor instance; instance.setPartComponent(((Instance) PartComponent_instances[i]).getObjectpath()); instance.setGroupComponent(((Instance) GroupComponent_instance).getObjectpath()); OpenDRIM_ComputerSystemProcessor_instances.push_back(instance); } _L_; return OK; } int CPU_OpenDRIM_ComputerSystemProcessor_populate(OpenDRIM_ComputerSystemProcessor& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ComputerSystemProcessor/Makefile.am0000644000175000017500000000502611400667756026745 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiCPU_OpenDRIM_ComputerSystemProcessorProvider.la libcmpiCPU_OpenDRIM_ComputerSystemProcessorProvider_la_SOURCES = OpenDRIM_ComputerSystemProcessorAccess.cpp OpenDRIM_ComputerSystemProcessorProvider.cpp cmpiOpenDRIM_ComputerSystemProcessor.cpp assocOpenDRIM_ComputerSystemProcessor.cpp # May have to be adjusted for direct invocation libcmpiCPU_OpenDRIM_ComputerSystemProcessorProvider_la_CPPFLAGS = -I../CIM_LogicalDevice -I../CIM_System # Uncomment the end for direct invocation, may have to be adjusted libcmpiCPU_OpenDRIM_ComputerSystemProcessorProvider_la_LIBADD = ../Common/libcmpiCPU_Common.la #../CIM_LogicalDevice/libcmpiCPU_CIM_LogicalDeviceProvider.la ../CIM_System/libcmpiCPU_CIM_SystemProvider.la libcmpiCPU_OpenDRIM_ComputerSystemProcessorProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_ComputerSystemProcessor.h OpenDRIM_ComputerSystemProcessor.h OpenDRIM_ComputerSystemProcessorAccess.h opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ComputerSystemProcessor/assocOpenDRIM_ComputerSystemProcessor.h0000644000175000017500000000635711400667756034463 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_COMPUTERSYSTEMPROCESSOR_H_ #define ASSOCOPENDRIM_COMPUTERSYSTEMPROCESSOR_H_ #include "OpenDRIM_ComputerSystemProcessorAccess.h" int CPU_OpenDRIM_ComputerSystemProcessor_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage); int CPU_OpenDRIM_ComputerSystemProcessor_associator(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties, vector& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant); int CPU_OpenDRIM_ComputerSystemProcessor_enumeratePartComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int CPU_OpenDRIM_ComputerSystemProcessor_getPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int CPU_OpenDRIM_ComputerSystemProcessor_enumerateGroupComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int CPU_OpenDRIM_ComputerSystemProcessor_getGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_COMPUTERSYSTEMPROCESSOR_H_*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ComputerSystemProcessor/cmpiOpenDRIM_ComputerSystemProcessor.h0000644000175000017500000000451311400667756034273 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_COMPUTERSYSTEMPROCESSOR_H_ #define CMPIOPENDRIM_COMPUTERSYSTEMPROCESSOR_H_ #include "OpenDRIM_ComputerSystemProcessor.h" CMPIObjectPath* CPU_OpenDRIM_ComputerSystemProcessor_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ComputerSystemProcessor& instance); CMPIInstance* CPU_OpenDRIM_ComputerSystemProcessor_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ComputerSystemProcessor& instance); void CPU_OpenDRIM_ComputerSystemProcessor_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ComputerSystemProcessor& instance); void CPU_OpenDRIM_ComputerSystemProcessor_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ComputerSystemProcessor& instance); #endif /*CMPIOPENDRIM_COMPUTERSYSTEMPROCESSOR_H_*/ ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ComputerSystemProcessor/assocOpenDRIM_ComputerSystemProcessor.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ComputerSystemProcessor/assocOpenDRIM_ComputerSystemProcessor.cp0000644000175000017500000002114311400667756034624 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_ComputerSystemProcessor.h" int CPU_OpenDRIM_ComputerSystemProcessor_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage) { _E_; string _assocClass, _resultClass, _resultRole, _role; assocClass == NULL ? _assocClass = "null" : _assocClass = assocClass; resultClass == NULL ? _resultClass = "null" : _resultClass = resultClass; resultRole == NULL ? _resultRole = "null" : _resultRole = resultRole; role == NULL ? _role = "null" : _role = role; for (unsigned int i=0; i& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant) { _E_; int errorCode = CPU_OpenDRIM_ComputerSystemProcessor_associatorFilter(broker, ctx, cop, knownInstance, assocClass, resultClass, role, resultRole, leftToRight, errorMessage); if (errorCode == -1) return OK; if (errorCode != OK) return errorCode; if (leftToRight) { if (role != NULL && strcasecmp(role, "PartComponent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "GroupComponent") != 0) return OK; CF_assert(CPU_OpenDRIM_ComputerSystemProcessor_associatorPartComponentToGroupComponent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "GroupComponent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "PartComponent") != 0) return OK; CF_assert(CPU_OpenDRIM_ComputerSystemProcessor_associatorGroupComponentToPartComponent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int CPU_OpenDRIM_ComputerSystemProcessor_enumeratePartComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, PartComponent_NAMESPACE, PartComponent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(CPU_CIM_LogicalDevice_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(CPU_CIM_LogicalDevice_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, CPU_CIM_LogicalDevice_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int CPU_OpenDRIM_ComputerSystemProcessor_getPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), PartComponent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), PartComponent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_LogicalDevice _instance; CPU_CIM_LogicalDevice_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(CPU_CIM_LogicalDevice_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, CPU_CIM_LogicalDevice_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int CPU_OpenDRIM_ComputerSystemProcessor_enumerateGroupComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, GroupComponent_NAMESPACE, GroupComponent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(CPU_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(CPU_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, CPU_CIM_System_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int CPU_OpenDRIM_ComputerSystemProcessor_getGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), GroupComponent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), GroupComponent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_System _instance; CPU_CIM_System_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(CPU_CIM_System_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, CPU_CIM_System_toCMPIInstance(broker, _instance)); */ _L_; return OK; } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ComputerSystemProcessor/OpenDRIM_ComputerSystemProcessorProvider.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ComputerSystemProcessor/OpenDRIM_ComputerSystemProcessorProvider0000644000175000017500000004233411400667756034712 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ComputerSystemProcessor.h" #include "OpenDRIM_ComputerSystemProcessorAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define CPU_OpenDRIM_ComputerSystemProcessorProviderSetInstance CPU_OpenDRIM_ComputerSystemProcessorProviderModifyInstance #endif int CPU_OpenDRIM_ComputerSystemProcessor_init(const CMPIBroker* broker); int CPU_OpenDRIM_ComputerSystemProcessor_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_ComputerSystemProcessorProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_ComputerSystemProcessor_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ComputerSystemProcessorProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_ComputerSystemProcessor_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemProcessor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = CPU_OpenDRIM_ComputerSystemProcessor_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ComputerSystemProcessorProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_ComputerSystemProcessor_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemProcessor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = CPU_OpenDRIM_ComputerSystemProcessor_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ComputerSystemProcessorProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ComputerSystemProcessor instance; CPU_OpenDRIM_ComputerSystemProcessor_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_ComputerSystemProcessor_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemProcessor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = CPU_OpenDRIM_ComputerSystemProcessor_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ComputerSystemProcessorProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ComputerSystemProcessor newInstance, oldInstance; CPU_OpenDRIM_ComputerSystemProcessor_toCPP(_broker, ci, newInstance); CPU_OpenDRIM_ComputerSystemProcessor_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = CPU_OpenDRIM_ComputerSystemProcessor_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemProcessor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_ComputerSystemProcessor_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemProcessor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ComputerSystemProcessorProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ComputerSystemProcessor instance; CPU_OpenDRIM_ComputerSystemProcessor_toCPP(_broker, ci, instance); string errorMessage; int errorCode = CPU_OpenDRIM_ComputerSystemProcessor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_ComputerSystemProcessor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_ComputerSystemProcessor_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemProcessor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_ComputerSystemProcessor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemProcessor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = CPU_OpenDRIM_ComputerSystemProcessor_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ComputerSystemProcessorProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ComputerSystemProcessor instance; CPU_OpenDRIM_ComputerSystemProcessor_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_ComputerSystemProcessor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemProcessor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_ComputerSystemProcessor_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemProcessor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ComputerSystemProcessorProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Association Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_ComputerSystemProcessorProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_ComputerSystemProcessor_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ComputerSystemProcessorProviderAssociatorNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_ComputerSystemProcessor_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemProcessor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnObjectPath(rslt, associatedInstances[i].getObjectpath().getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ComputerSystemProcessorProviderAssociators(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_ComputerSystemProcessor_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemProcessor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnInstance(rslt, associatedInstances[i].getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ComputerSystemProcessorProviderReferenceNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_ComputerSystemProcessor_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemProcessor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = CPU_OpenDRIM_ComputerSystemProcessor_referencePartComponentToGroupComponent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = CPU_OpenDRIM_ComputerSystemProcessor_referenceGroupComponentToPartComponent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemProcessor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = CPU_OpenDRIM_ComputerSystemProcessor_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus CPU_OpenDRIM_ComputerSystemProcessorProviderReferences(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_ComputerSystemProcessor_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemProcessor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = CPU_OpenDRIM_ComputerSystemProcessor_referencePartComponentToGroupComponent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = CPU_OpenDRIM_ComputerSystemProcessor_referenceGroupComponentToPartComponent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemProcessor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = CPU_OpenDRIM_ComputerSystemProcessor_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int CPU_OpenDRIM_ComputerSystemProcessor_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = CPU_OpenDRIM_ComputerSystemProcessor_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_ComputerSystemProcessor_init FAILED: " + (string) OpenDRIM_ComputerSystemProcessor_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int CPU_OpenDRIM_ComputerSystemProcessor_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = CPU_OpenDRIM_ComputerSystemProcessor_unload(errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_ComputerSystemProcessor_unload FAILED: " + (string) OpenDRIM_ComputerSystemProcessor_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define CPU_OpenDRIM_ComputerSystemProcessor_INIT if (CPU_OpenDRIM_ComputerSystemProcessor_init(_broker) < 0) return NULL CMInstanceMIStub(CPU_OpenDRIM_ComputerSystemProcessorProvider, CPU_OpenDRIM_ComputerSystemProcessorProvider, _broker, CPU_OpenDRIM_ComputerSystemProcessor_INIT); CMAssociationMIStub(CPU_OpenDRIM_ComputerSystemProcessorProvider, CPU_OpenDRIM_ComputerSystemProcessorProvider, _broker, CPU_OpenDRIM_ComputerSystemProcessor_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ComputerSystemProcessor/OpenDRIM_ComputerSystemProcessor.h0000644000175000017500000000716611400667756033431 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_COMPUTERSYSTEMPROCESSOR_H_ #define OPENDRIM_COMPUTERSYSTEMPROCESSOR_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_LogicalDevice.h" #include "CIM_LogicalDeviceAccess.h" #include "cmpiCIM_System.h" #include "CIM_SystemAccess.h" */ const static char* OpenDRIM_ComputerSystemProcessor_classnames[] = {"OpenDRIM_ComputerSystemProcessor"}; static string OpenDRIM_ComputerSystemProcessor_NAMESPACE = _NAMESPACE; const static string PartComponent_role = "PartComponent"; const static char* PartComponent_classnames[] = {"OpenDRIM_Processor"}; const static string PartComponent_NAMESPACE = _NAMESPACE; const static string GroupComponent_role = "GroupComponent"; const static char* GroupComponent_classnames[] = {"OpenDRIM_ComputerSystem"}; const static string GroupComponent_NAMESPACE = _NAMESPACE; class OpenDRIM_ComputerSystemProcessor { public: Objectpath GroupComponent; bool GroupComponent_isNULL; Objectpath PartComponent; bool PartComponent_isNULL; OpenDRIM_ComputerSystemProcessor() { GroupComponent_isNULL = true; PartComponent_isNULL = true; } ~OpenDRIM_ComputerSystemProcessor() {} string getKeys() const { return CF_toLowCase(".GroupComponent=\"" + CF_quoteString(GroupComponent.toString()) + "\""".PartComponent=\"" + CF_quoteString(PartComponent.toString()) + "\""); } int getGroupComponent(Objectpath& value) const { if (GroupComponent_isNULL==true) return NOT_FOUND; value = GroupComponent; return OK; } int setGroupComponent(const Objectpath& newValue) { GroupComponent = newValue; GroupComponent.setNamespace(GroupComponent_NAMESPACE); GroupComponent_isNULL = false; return OK; } int getPartComponent(Objectpath& value) const { if (PartComponent_isNULL==true) return NOT_FOUND; value = PartComponent; return OK; } int setPartComponent(const Objectpath& newValue) { PartComponent = newValue; PartComponent.setNamespace(PartComponent_NAMESPACE); PartComponent_isNULL = false; return OK; } }; #endif /*OPENDRIM_COMPUTERSYSTEMPROCESSOR_H_*/ ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ComputerSystemProcessor/cmpiOpenDRIM_ComputerSystemProcessor.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ComputerSystemProcessor/cmpiOpenDRIM_ComputerSystemProcessor.cpp0000644000175000017500000000634111400667756034627 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ComputerSystemProcessor.h" CMPIObjectPath* CPU_OpenDRIM_ComputerSystemProcessor_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ComputerSystemProcessor& instance) { _E_; Objectpath op(broker, OpenDRIM_ComputerSystemProcessor_classnames[0], OpenDRIM_ComputerSystemProcessor_NAMESPACE); if (!instance.GroupComponent_isNULL) op.addKey("GroupComponent", instance.GroupComponent); if (!instance.PartComponent_isNULL) op.addKey("PartComponent", instance.PartComponent); _L_; return op.getHdl(); } CMPIInstance* CPU_OpenDRIM_ComputerSystemProcessor_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ComputerSystemProcessor& instance) { _E_; Objectpath op(broker, CPU_OpenDRIM_ComputerSystemProcessor_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void CPU_OpenDRIM_ComputerSystemProcessor_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ComputerSystemProcessor& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("PartComponent", instance.PartComponent) == OK) instance.PartComponent_isNULL = false; if (op.getKey("GroupComponent", instance.GroupComponent) == OK) instance.GroupComponent_isNULL = false; _L_; } void CPU_OpenDRIM_ComputerSystemProcessor_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ComputerSystemProcessor& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("GroupComponent", instance.GroupComponent) == OK) instance.GroupComponent_isNULL = false; if (inst.getProperty("PartComponent", instance.PartComponent) == OK) instance.PartComponent_isNULL = false; _L_; } opendrim-lmp-cpu-1.1.0~ppa/configure.ac0000644000175000017500000001305411400667756020637 0ustar guillaumeguillaume# Process this file with autoconf to produce a configure script. ################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ AC_PREREQ(2.59) AC_COPYRIGHT([[############################################################################### Note: This Copyright statement covers the OpenDRIM original parts of this file. It does NOT concern the parts generated by autoconf. Linux Management Providers (LMP), CPU provider package Copyright (C) 2007 Frederic Desmons, ETRI This program is being developed under the "OpenDRIM" project. The "OpenDRIM" project web page: http://opendrim.sourceforge.net The "OpenDRIM" project mailing list: opendrim@googlegroups.com 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; version 2 of the License. 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ###############################################################################]]) AC_INIT(CPU provider package, -, -) SHOW_COPYRIGHT AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE([foreign]) AC_CANONICAL_HOST case $host_cpu in i*86) HW=INTEL;; s390*) HW=S390;; ppc*) HW=PPC;; x86_64) HW=X86_64;; ia64) HW=IA64;; **) HW=GENERIC;; esac # Configuration AC_ARG_VAR([CIMSERVER],[the target CIM server (pegasus|sfcb|openwbem).]) AC_ARG_VAR([CIMNAMESPACE],[the target CIM namespace (default: root/cimv2)]) AC_ARG_VAR([INTEROPNAMESPACE],[the target interoperability namespace (default: Interop (pegasus and sfcb) or root/Interop (openwbem))]) AC_ARG_VAR([PROVIDERDIR],[the directory where the CMPI providers will be installed.]) AC_ARG_VAR([COMMONLIBDIR],[the directory where the package common libraries will be installed.]) # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_INSTALL AC_PROG_LIBTOOL # Check for CIM server (defined in acinclude.m4) CHECK_CIMSERVER # Check for CIM namespace (defined in acinclude.m4) CHECK_CIMNAMESPACE # Check for interoperability namespace (defined in acinclude.m4) CHECK_INTEROPNAMESPACE # Check for OpenDRIM Common library (defined in acinclude.m4) CHECK_OPENDRIMCOMMONLIBRARY # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([pthread.h]) # Check for CMPI headers (defined in acinclude.m4) CHECK_CMPIHEADERS # Check for OpenDRIM Common headers (defined in acinclude.m4) CHECK_OPENDRIMCOMMONHEADERS # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST AC_C_INLINE AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM AC_CONFIG_FILES([Makefile Common/Makefile OpenDRIM_RegisteredCPUProfile/Makefile OpenDRIM_Processor/Makefile OpenDRIM_CacheMemory/Makefile OpenDRIM_ProcessorConformsToProfile/Makefile OpenDRIM_AssociatedProcessorCoreCacheMemory/Makefile OpenDRIM_ProcessorCoreHardwareThread/Makefile OpenDRIM_ProcessorCore/Makefile OpenDRIM_HardwareThread/Makefile OpenDRIM_ProcessorProcessorCore/Makefile OpenDRIM_ComputerSystemProcessor/Makefile OpenDRIM_AssociatedProcessorCacheMemory/Makefile test/Makefile]) CFLAGS="$CFLAGS -D$HW -DCMPI_PLATFORM_LINUX_GENERIC_GNU -I../Common -I$OPENDRIMCOMMONINCLUDE -I$OPENDRIMCOMMONINCLUDE/cmpi" CPPFLAGS="$CPPFLAGS -D$HW -DCMPI_PLATFORM_LINUX_GENERIC_GNU -I../Common -I$OPENDRIMCOMMONINCLUDE -I$OPENDRIMCOMMONINCLUDE/cmpi" echo "-------------------------------------------------------" echo "CIMSERVER: " $CIMSERVER echo "PROVIDERDIR: " $PROVIDERDIR echo "COMMONLIBDIR: " $COMMONLIBDIR echo "CFLAGS : " $CFLAGS echo "CXXFLAGS : " $CXXFLAGS echo "CPPFLAGS:" $CPPFLAGS echo "-------------------------------------------------------" AC_OUTPUT echo "You may now run make" opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCore/0000755000175000017500000000000011400667756022573 5ustar guillaumeguillaumeopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCore/cmpiOpenDRIM_ProcessorCore.h0000644000175000017500000000475511400667756030055 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_PROCESSORCORE_H_ #define CMPIOPENDRIM_PROCESSORCORE_H_ #include "OpenDRIM_ProcessorCore.h" CMPIObjectPath* CPU_OpenDRIM_ProcessorCore_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ProcessorCore& instance); CMPIInstance* CPU_OpenDRIM_ProcessorCore_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ProcessorCore& instance); void CPU_OpenDRIM_ProcessorCore_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ProcessorCore& instance); void CPU_OpenDRIM_ProcessorCore_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ProcessorCore& instance); void CPU_OpenDRIM_ProcessorCore_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_ProcessorCore_RequestStateChange_In& args); void CPU_OpenDRIM_ProcessorCore_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_ProcessorCore_RequestStateChange_Out& args); #endif /*CMPIOPENDRIM_PROCESSORCORE_H_*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCore/Makefile.am0000644000175000017500000000407611400667756024636 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiCPU_OpenDRIM_ProcessorCoreProvider.la libcmpiCPU_OpenDRIM_ProcessorCoreProvider_la_SOURCES = OpenDRIM_ProcessorCoreAccess.cpp OpenDRIM_ProcessorCoreProvider.cpp cmpiOpenDRIM_ProcessorCore.cpp libcmpiCPU_OpenDRIM_ProcessorCoreProvider_la_LIBADD = ../Common/libcmpiCPU_Common.la libcmpiCPU_OpenDRIM_ProcessorCoreProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_ProcessorCore.h OpenDRIM_ProcessorCore.h OpenDRIM_ProcessorCoreAccess.h opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCore/cmpiOpenDRIM_ProcessorCore.cpp0000644000175000017500000002212511400667756030377 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ProcessorCore.h" CMPIObjectPath* CPU_OpenDRIM_ProcessorCore_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ProcessorCore& instance) { _E_; Objectpath op(broker, OpenDRIM_ProcessorCore_classnames[0], OpenDRIM_ProcessorCore_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* CPU_OpenDRIM_ProcessorCore_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ProcessorCore& instance) { _E_; Objectpath op(broker, CPU_OpenDRIM_ProcessorCore_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.InstallDate_isNULL) ci.setPropertyDatetime("InstallDate", instance.InstallDate); if (!instance.Name_isNULL) ci.setProperty("Name", instance.Name); if (!instance.OperationalStatus_isNULL) ci.setProperty("OperationalStatus", instance.OperationalStatus); if (!instance.StatusDescriptions_isNULL) ci.setProperty("StatusDescriptions", instance.StatusDescriptions); if (!instance.Status_isNULL) ci.setProperty("Status", instance.Status); if (!instance.HealthState_isNULL) ci.setProperty("HealthState", instance.HealthState); if (!instance.PrimaryStatus_isNULL) ci.setProperty("PrimaryStatus", instance.PrimaryStatus); if (!instance.DetailedStatus_isNULL) ci.setProperty("DetailedStatus", instance.DetailedStatus); if (!instance.OperatingStatus_isNULL) ci.setProperty("OperatingStatus", instance.OperatingStatus); if (!instance.CommunicationStatus_isNULL) ci.setProperty("CommunicationStatus", instance.CommunicationStatus); if (!instance.EnabledState_isNULL) ci.setProperty("EnabledState", instance.EnabledState); if (!instance.OtherEnabledState_isNULL) ci.setProperty("OtherEnabledState", instance.OtherEnabledState); if (!instance.RequestedState_isNULL) ci.setProperty("RequestedState", instance.RequestedState); if (!instance.EnabledDefault_isNULL) ci.setProperty("EnabledDefault", instance.EnabledDefault); if (!instance.TimeOfLastStateChange_isNULL) ci.setPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange); if (!instance.AvailableRequestedStates_isNULL) ci.setProperty("AvailableRequestedStates", instance.AvailableRequestedStates); if (!instance.TransitioningToState_isNULL) ci.setProperty("TransitioningToState", instance.TransitioningToState); if (!instance.CoreEnabledState_isNULL) ci.setProperty("CoreEnabledState", instance.CoreEnabledState); if (!instance.Characteristics_isNULL) ci.setProperty("Characteristics", instance.Characteristics); if (!instance.LoadPercentage_isNULL) ci.setProperty("LoadPercentage", instance.LoadPercentage); if (!instance.MaxClockSpeed_isNULL) ci.setProperty("MaxClockSpeed", instance.MaxClockSpeed); if (!instance.CurrentClockSpeed_isNULL) ci.setProperty("CurrentClockSpeed", instance.CurrentClockSpeed); _L_; return ci.getHdl(); } void CPU_OpenDRIM_ProcessorCore_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ProcessorCore& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void CPU_OpenDRIM_ProcessorCore_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ProcessorCore& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getPropertyDatetime("InstallDate", instance.InstallDate) == OK) instance.InstallDate_isNULL = false; if (inst.getProperty("Name", instance.Name) == OK) instance.Name_isNULL = false; if (inst.getProperty("OperationalStatus", instance.OperationalStatus) == OK) instance.OperationalStatus_isNULL = false; if (inst.getProperty("StatusDescriptions", instance.StatusDescriptions) == OK) instance.StatusDescriptions_isNULL = false; if (inst.getProperty("Status", instance.Status) == OK) instance.Status_isNULL = false; if (inst.getProperty("HealthState", instance.HealthState) == OK) instance.HealthState_isNULL = false; if (inst.getProperty("PrimaryStatus", instance.PrimaryStatus) == OK) instance.PrimaryStatus_isNULL = false; if (inst.getProperty("DetailedStatus", instance.DetailedStatus) == OK) instance.DetailedStatus_isNULL = false; if (inst.getProperty("OperatingStatus", instance.OperatingStatus) == OK) instance.OperatingStatus_isNULL = false; if (inst.getProperty("CommunicationStatus", instance.CommunicationStatus) == OK) instance.CommunicationStatus_isNULL = false; if (inst.getProperty("EnabledState", instance.EnabledState) == OK) instance.EnabledState_isNULL = false; if (inst.getProperty("OtherEnabledState", instance.OtherEnabledState) == OK) instance.OtherEnabledState_isNULL = false; if (inst.getProperty("RequestedState", instance.RequestedState) == OK) instance.RequestedState_isNULL = false; if (inst.getProperty("EnabledDefault", instance.EnabledDefault) == OK) instance.EnabledDefault_isNULL = false; if (inst.getPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange) == OK) instance.TimeOfLastStateChange_isNULL = false; if (inst.getProperty("AvailableRequestedStates", instance.AvailableRequestedStates) == OK) instance.AvailableRequestedStates_isNULL = false; if (inst.getProperty("TransitioningToState", instance.TransitioningToState) == OK) instance.TransitioningToState_isNULL = false; if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("CoreEnabledState", instance.CoreEnabledState) == OK) instance.CoreEnabledState_isNULL = false; if (inst.getProperty("Characteristics", instance.Characteristics) == OK) instance.Characteristics_isNULL = false; if (inst.getProperty("LoadPercentage", instance.LoadPercentage) == OK) instance.LoadPercentage_isNULL = false; if (inst.getProperty("MaxClockSpeed", instance.MaxClockSpeed) == OK) instance.MaxClockSpeed_isNULL = false; if (inst.getProperty("CurrentClockSpeed", instance.CurrentClockSpeed) == OK) instance.CurrentClockSpeed_isNULL = false; _L_; } void CPU_OpenDRIM_ProcessorCore_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_ProcessorCore_RequestStateChange_In& args) { _E_; CMPIStatus rc; CMPIData data; unsigned short RequestedState; data = in->ft->getArg(in, "RequestedState", &rc); if (rc.rc == OK) { CT_ToC(data, RequestedState); args.setRequestedState(RequestedState); } Objectpath Job; data = in->ft->getArg(in, "Job", &rc); if (rc.rc == OK) { CT_ToC(broker, data, Job); args.setJob(Job); } string TimeoutPeriod; data = in->ft->getArg(in, "TimeoutPeriod", &rc); if (rc.rc == OK) { CT_ToCDatetime(data, TimeoutPeriod); args.setTimeoutPeriod(TimeoutPeriod); } _L_; } void CPU_OpenDRIM_ProcessorCore_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_ProcessorCore_RequestStateChange_Out& args) { _E_; CMPIValue value; int errorMessage; Objectpath Job; errorMessage = args.getJob(Job); if (errorMessage == OK) { value = CT_toCMPI(Job); out->ft->addArg(out, "Job", &value, CMPI_ref); } _L_; } opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCore/OpenDRIM_ProcessorCoreProvider.cpp0000644000175000017500000003213311400667756031241 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ProcessorCore.h" #include "OpenDRIM_ProcessorCoreAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define CPU_OpenDRIM_ProcessorCoreProviderSetInstance CPU_OpenDRIM_ProcessorCoreProviderModifyInstance #endif int CPU_OpenDRIM_ProcessorCore_init(const CMPIBroker* broker); int CPU_OpenDRIM_ProcessorCore_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_ProcessorCoreProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_ProcessorCore_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorCoreProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorCore_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = CPU_OpenDRIM_ProcessorCore_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorCoreProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorCore_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = CPU_OpenDRIM_ProcessorCore_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorCoreProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ProcessorCore instance; CPU_OpenDRIM_ProcessorCore_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorCore_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = CPU_OpenDRIM_ProcessorCore_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorCoreProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ProcessorCore newInstance, oldInstance; CPU_OpenDRIM_ProcessorCore_toCPP(_broker, ci, newInstance); CPU_OpenDRIM_ProcessorCore_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorCore_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_ProcessorCore_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorCoreProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ProcessorCore instance; CPU_OpenDRIM_ProcessorCore_toCPP(_broker, ci, instance); string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorCore_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_ProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_ProcessorCore_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_ProcessorCore_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = CPU_OpenDRIM_ProcessorCore_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorCoreProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ProcessorCore instance; CPU_OpenDRIM_ProcessorCore_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorCore_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_ProcessorCore_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorCoreProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Method Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_ProcessorCoreProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_ProcessorCore_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorCoreProviderInvokeMethod(CMPIMethodMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* methodName, const CMPIArgs* in, CMPIArgs* out) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ProcessorCore instance; CPU_OpenDRIM_ProcessorCore_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"InstanceID"}; int errorCode = CPU_OpenDRIM_ProcessorCore_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_ProcessorCore_RequestStateChange_In inArgs; CPU_OpenDRIM_ProcessorCore_toCPP(_broker, in, inArgs); OpenDRIM_ProcessorCore_RequestStateChange_Out outArgs; errorCode = CPU_OpenDRIM_ProcessorCore_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCore_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CPU_OpenDRIM_ProcessorCore_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else { errorMessage = (string) OpenDRIM_ProcessorCore_classnames[0] + ": " + "The requested method (" + (string) methodName +") was not found."; CMSetStatusWithChars(_broker, &rc, (CMPIrc) NOT_SUPPORTED, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; CMReturn(CMPI_RC_OK); } /* ---------------------------------------------------------------------------*/ /* End of Method Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int CPU_OpenDRIM_ProcessorCore_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorCore_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_ProcessorCore_init FAILED: " + (string) OpenDRIM_ProcessorCore_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int CPU_OpenDRIM_ProcessorCore_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorCore_unload(errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_ProcessorCore_unload FAILED: " + (string) OpenDRIM_ProcessorCore_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define CPU_OpenDRIM_ProcessorCore_INIT if (CPU_OpenDRIM_ProcessorCore_init(_broker) < 0) return NULL CMInstanceMIStub(CPU_OpenDRIM_ProcessorCoreProvider, CPU_OpenDRIM_ProcessorCoreProvider, _broker, CPU_OpenDRIM_ProcessorCore_INIT); CMMethodMIStub(CPU_OpenDRIM_ProcessorCoreProvider, CPU_OpenDRIM_ProcessorCoreProvider, _broker, CPU_OpenDRIM_ProcessorCore_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCore/OpenDRIM_ProcessorCore.h0000644000175000017500000003242011400667756027172 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PROCESSORCORE_H_ #define OPENDRIM_PROCESSORCORE_H_ #include const static char* OpenDRIM_ProcessorCore_classnames[] = {"OpenDRIM_ProcessorCore"}; static string OpenDRIM_ProcessorCore_NAMESPACE = _NAMESPACE; class OpenDRIM_ProcessorCore { public: string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string InstallDate; bool InstallDate_isNULL; string Name; bool Name_isNULL; vector OperationalStatus; bool OperationalStatus_isNULL; vector StatusDescriptions; bool StatusDescriptions_isNULL; string Status; bool Status_isNULL; unsigned short HealthState; bool HealthState_isNULL; unsigned short PrimaryStatus; bool PrimaryStatus_isNULL; unsigned short DetailedStatus; bool DetailedStatus_isNULL; unsigned short OperatingStatus; bool OperatingStatus_isNULL; unsigned short CommunicationStatus; bool CommunicationStatus_isNULL; unsigned short EnabledState; bool EnabledState_isNULL; string OtherEnabledState; bool OtherEnabledState_isNULL; unsigned short RequestedState; bool RequestedState_isNULL; unsigned short EnabledDefault; bool EnabledDefault_isNULL; string TimeOfLastStateChange; bool TimeOfLastStateChange_isNULL; vector AvailableRequestedStates; bool AvailableRequestedStates_isNULL; unsigned short TransitioningToState; bool TransitioningToState_isNULL; string InstanceID; bool InstanceID_isNULL; unsigned short CoreEnabledState; bool CoreEnabledState_isNULL; vector Characteristics; bool Characteristics_isNULL; unsigned short LoadPercentage; bool LoadPercentage_isNULL; unsigned int MaxClockSpeed; bool MaxClockSpeed_isNULL; unsigned int CurrentClockSpeed; bool CurrentClockSpeed_isNULL; OpenDRIM_ProcessorCore() { Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstallDate_isNULL = true; Name_isNULL = true; OperationalStatus_isNULL = true; StatusDescriptions_isNULL = true; Status_isNULL = true; HealthState_isNULL = true; PrimaryStatus_isNULL = true; DetailedStatus_isNULL = true; OperatingStatus_isNULL = true; CommunicationStatus_isNULL = true; EnabledState_isNULL = true; OtherEnabledState_isNULL = true; RequestedState_isNULL = true; EnabledDefault_isNULL = true; TimeOfLastStateChange_isNULL = true; AvailableRequestedStates_isNULL = true; TransitioningToState_isNULL = true; InstanceID_isNULL = true; CoreEnabledState_isNULL = true; Characteristics_isNULL = true; LoadPercentage_isNULL = true; MaxClockSpeed_isNULL = true; CurrentClockSpeed_isNULL = true; } ~OpenDRIM_ProcessorCore() {} string getKeys() const { return CF_toLowCase(".InstanceID=\"" + CF_quoteString(InstanceID) + "\""); } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getInstallDate(string& value) const { if (InstallDate_isNULL==true) return NOT_FOUND; value = InstallDate; return OK; } int setInstallDate(const string& newValue) { InstallDate = newValue; InstallDate_isNULL = false; return OK; } int getName(string& value) const { if (Name_isNULL==true) return NOT_FOUND; value = Name; return OK; } int setName(const string& newValue) { Name = newValue; Name_isNULL = false; return OK; } int getOperationalStatus(vector& value) const { if (OperationalStatus_isNULL==true) return NOT_FOUND; value = OperationalStatus; return OK; } int setOperationalStatus(const vector& newValue) { OperationalStatus = newValue; OperationalStatus_isNULL = false; return OK; } int getStatusDescriptions(vector& value) const { if (StatusDescriptions_isNULL==true) return NOT_FOUND; value = StatusDescriptions; return OK; } int setStatusDescriptions(const vector& newValue) { StatusDescriptions = newValue; StatusDescriptions_isNULL = false; return OK; } int getStatus(string& value) const { if (Status_isNULL==true) return NOT_FOUND; value = Status; return OK; } int setStatus(const string& newValue) { Status = newValue; Status_isNULL = false; return OK; } int getHealthState(unsigned short& value) const { if (HealthState_isNULL==true) return NOT_FOUND; value = HealthState; return OK; } int setHealthState(const unsigned short& newValue) { HealthState = newValue; HealthState_isNULL = false; return OK; } int getPrimaryStatus(unsigned short& value) const { if (PrimaryStatus_isNULL==true) return NOT_FOUND; value = PrimaryStatus; return OK; } int setPrimaryStatus(const unsigned short& newValue) { PrimaryStatus = newValue; PrimaryStatus_isNULL = false; return OK; } int getDetailedStatus(unsigned short& value) const { if (DetailedStatus_isNULL==true) return NOT_FOUND; value = DetailedStatus; return OK; } int setDetailedStatus(const unsigned short& newValue) { DetailedStatus = newValue; DetailedStatus_isNULL = false; return OK; } int getOperatingStatus(unsigned short& value) const { if (OperatingStatus_isNULL==true) return NOT_FOUND; value = OperatingStatus; return OK; } int setOperatingStatus(const unsigned short& newValue) { OperatingStatus = newValue; OperatingStatus_isNULL = false; return OK; } int getCommunicationStatus(unsigned short& value) const { if (CommunicationStatus_isNULL==true) return NOT_FOUND; value = CommunicationStatus; return OK; } int setCommunicationStatus(const unsigned short& newValue) { CommunicationStatus = newValue; CommunicationStatus_isNULL = false; return OK; } int getEnabledState(unsigned short& value) const { if (EnabledState_isNULL==true) return NOT_FOUND; value = EnabledState; return OK; } int setEnabledState(const unsigned short& newValue) { EnabledState = newValue; EnabledState_isNULL = false; return OK; } int getOtherEnabledState(string& value) const { if (OtherEnabledState_isNULL==true) return NOT_FOUND; value = OtherEnabledState; return OK; } int setOtherEnabledState(const string& newValue) { OtherEnabledState = newValue; OtherEnabledState_isNULL = false; return OK; } int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL==true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getEnabledDefault(unsigned short& value) const { if (EnabledDefault_isNULL==true) return NOT_FOUND; value = EnabledDefault; return OK; } int setEnabledDefault(const unsigned short& newValue) { EnabledDefault = newValue; EnabledDefault_isNULL = false; return OK; } int getTimeOfLastStateChange(string& value) const { if (TimeOfLastStateChange_isNULL==true) return NOT_FOUND; value = TimeOfLastStateChange; return OK; } int setTimeOfLastStateChange(const string& newValue) { TimeOfLastStateChange = newValue; TimeOfLastStateChange_isNULL = false; return OK; } int getAvailableRequestedStates(vector& value) const { if (AvailableRequestedStates_isNULL==true) return NOT_FOUND; value = AvailableRequestedStates; return OK; } int setAvailableRequestedStates(const vector& newValue) { AvailableRequestedStates = newValue; AvailableRequestedStates_isNULL = false; return OK; } int getTransitioningToState(unsigned short& value) const { if (TransitioningToState_isNULL==true) return NOT_FOUND; value = TransitioningToState; return OK; } int setTransitioningToState(const unsigned short& newValue) { TransitioningToState = newValue; TransitioningToState_isNULL = false; return OK; } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getCoreEnabledState(unsigned short& value) const { if (CoreEnabledState_isNULL==true) return NOT_FOUND; value = CoreEnabledState; return OK; } int setCoreEnabledState(const unsigned short& newValue) { CoreEnabledState = newValue; CoreEnabledState_isNULL = false; return OK; } int getCharacteristics(vector& value) const { if (Characteristics_isNULL==true) return NOT_FOUND; value = Characteristics; return OK; } int setCharacteristics(const vector& newValue) { Characteristics = newValue; Characteristics_isNULL = false; return OK; } int getLoadPercentage(unsigned short& value) const { if (LoadPercentage_isNULL==true) return NOT_FOUND; value = LoadPercentage; return OK; } int setLoadPercentage(const unsigned short& newValue) { LoadPercentage = newValue; LoadPercentage_isNULL = false; return OK; } int getMaxClockSpeed(unsigned int& value) const { if (MaxClockSpeed_isNULL==true) return NOT_FOUND; value = MaxClockSpeed; return OK; } int setMaxClockSpeed(const unsigned int& newValue) { MaxClockSpeed = newValue; MaxClockSpeed_isNULL = false; return OK; } int getCurrentClockSpeed(unsigned int& value) const { if (CurrentClockSpeed_isNULL==true) return NOT_FOUND; value = CurrentClockSpeed; return OK; } int setCurrentClockSpeed(const unsigned int& newValue) { CurrentClockSpeed = newValue; CurrentClockSpeed_isNULL = false; return OK; } }; class OpenDRIM_ProcessorCore_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_ProcessorCore_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_ProcessorCore_RequestStateChange_In() {} int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL == true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getJob(Objectpath& value) const { if (Job_isNULL == true) return NOT_FOUND; value = Job; return OK; } int setJob(const Objectpath& newValue) { Job = newValue; Job_isNULL = false; return OK; } int getTimeoutPeriod(string& value) const { if (TimeoutPeriod_isNULL == true) return NOT_FOUND; value = TimeoutPeriod; return OK; } int setTimeoutPeriod(const string& newValue) { TimeoutPeriod = newValue; TimeoutPeriod_isNULL = false; return OK; } }; class OpenDRIM_ProcessorCore_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_ProcessorCore_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_ProcessorCore_RequestStateChange_Out() {} int getJob(Objectpath& value) const { if (Job_isNULL == true) return NOT_FOUND; value = Job; return OK; } int setJob(const Objectpath& newValue) { Job = newValue; Job_isNULL = false; return OK; } }; #endif /*OPENDRIM_PROCESSORCORE_H_*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCore/OpenDRIM_ProcessorCoreAccess.h0000644000175000017500000000657711400667756030332 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PROCESSORCOREACCESS_H_ #define OPENDRIM_PROCESSORCOREACCESS_H_ #include "CPU_Common.h" #include #include "OpenDRIM_ProcessorCore.h" int CPU_OpenDRIM_ProcessorCore_load(const CMPIBroker* broker, string& errorMessage); int CPU_OpenDRIM_ProcessorCore_unload(string& errorMessage); int CPU_OpenDRIM_ProcessorCore_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ProcessorCore_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ProcessorCore& instance, const char** properties, string& errorMessage); int CPU_OpenDRIM_ProcessorCore_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorCore& newInstance, const OpenDRIM_ProcessorCore& oldInstance, const char** properties, string& errorMessage); int CPU_OpenDRIM_ProcessorCore_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorCore& instance, string& errorMessage); int CPU_OpenDRIM_ProcessorCore_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorCore& instance, string& errorMessage); int CPU_OpenDRIM_ProcessorCore_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorCore& instance, unsigned int& returnValue, const OpenDRIM_ProcessorCore_RequestStateChange_In& in, OpenDRIM_ProcessorCore_RequestStateChange_Out& out, string& errorMessage); int CPU_OpenDRIM_ProcessorCore_populate(OpenDRIM_ProcessorCore& instance, const _processor_topology& cpu_info_processor_information, const _processor_core& processor_core, const _processor_information& SMBIOS_processor_information, bool use_SMBIOS, string& errorMessage); #endif /*OPENDRIM_PROCESSORCOREACCESS_H_*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCore/OpenDRIM_ProcessorCoreAccess.cpp0000644000175000017500000002064111400667756030651 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_ProcessorCoreAccess.h" vector<_processor_topology> _previous_cpu_info_processors_information; int CPU_OpenDRIM_ProcessorCore_load(const CMPIBroker* broker, string& errorMessage) { _E_; CF_assert(CPU_getProcessors("/proc/cpuinfo", _previous_cpu_info_processors_information, errorMessage)); CF_assert(CPU_getLoadAverages(_previous_cpu_info_processors_information, _previous_cpu_info_processors_information, errorMessage)); _L_; return OK; } int CPU_OpenDRIM_ProcessorCore_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int CPU_OpenDRIM_ProcessorCore_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; // get info from SMBIOS vector<_processor_information> SMBIOS_processors_information; int errorCode = SMBIOS_getProcessorsInformation(SMBIOS_processors_information, errorMessage); // if we cannot get info from SMBIOS, we'll just use info from cpuinfo bool use_SMBIOS = false; if (errorCode == OK) use_SMBIOS = true; // get info from cpuinfo vector<_processor_topology> cpu_info_processors_information; CF_assert(CPU_getProcessors("/proc/cpuinfo", cpu_info_processors_information, errorMessage)); CF_assert(CPU_getLoadAverages(cpu_info_processors_information, _previous_cpu_info_processors_information, errorMessage)); _previous_cpu_info_processors_information = cpu_info_processors_information; // different processors count... if (cpu_info_processors_information.size() != SMBIOS_processors_information.size()) use_SMBIOS = false; for (unsigned int i = 0; i < cpu_info_processors_information.size(); i++) { _processor_information SMBIOS_processor_information; if (use_SMBIOS) SMBIOS_processor_information = SMBIOS_processors_information[i]; for (unsigned int j = 0; j < cpu_info_processors_information[i].processor_cores.size(); j++) { OpenDRIM_ProcessorCore instance; instance.setInstanceID(CF_intToStr(i) + ":" + CF_intToStr(j)); if (discriminant == "ei") { CF_assert(CPU_OpenDRIM_ProcessorCore_populate(instance, cpu_info_processors_information[i], cpu_info_processors_information[i].processor_cores[j], SMBIOS_processor_information, use_SMBIOS, errorMessage)); } result.push_back(instance); } } _L_; return OK; } int CPU_OpenDRIM_ProcessorCore_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ProcessorCore& instance, const char** properties, string& errorMessage) { _E_; string InstanceID; instance.getInstanceID(InstanceID); vector InstanceID_elements; CF_splitText(InstanceID_elements, InstanceID, ':'); if (InstanceID_elements.size() != 2) return NOT_FOUND; if (!CF_isNumber(InstanceID_elements[0]) || !CF_isNumber(InstanceID_elements[1])) return NOT_FOUND; unsigned int processor_id = atoll(InstanceID_elements[0].c_str()); unsigned int core_id = atoll(InstanceID_elements[1].c_str()); // get info from cpuinfo vector<_processor_topology> cpu_info_processors_information; CF_assert(CPU_getProcessors("/proc/cpuinfo", cpu_info_processors_information, errorMessage)); CF_assert(CPU_getLoadAverages(cpu_info_processors_information, _previous_cpu_info_processors_information, errorMessage)); _previous_cpu_info_processors_information = cpu_info_processors_information; // does this core exists ? if (processor_id >= cpu_info_processors_information.size()) return NOT_FOUND; if (core_id >= cpu_info_processors_information[processor_id].processor_cores.size()) return NOT_FOUND; // get info from SMBIOS vector<_processor_information> SMBIOS_processors_information; int errorCode = SMBIOS_getProcessorsInformation(SMBIOS_processors_information, errorMessage); // if we cannot get info from SMBIOS, we'll just use info from cpuinfo bool use_SMBIOS = false; if (errorCode == OK) use_SMBIOS = true; _processor_information SMBIOS_processor_information; if (use_SMBIOS) SMBIOS_processor_information = SMBIOS_processors_information[processor_id]; // populate the instance CF_assert(CPU_OpenDRIM_ProcessorCore_populate(instance, cpu_info_processors_information[processor_id], cpu_info_processors_information[processor_id].processor_cores[core_id], SMBIOS_processor_information, use_SMBIOS, errorMessage)); _L_; return OK; } int CPU_OpenDRIM_ProcessorCore_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorCore& newInstance, const OpenDRIM_ProcessorCore& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_ProcessorCore_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorCore& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_ProcessorCore_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorCore& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_ProcessorCore_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorCore& instance, unsigned int& returnValue, const OpenDRIM_ProcessorCore_RequestStateChange_In& in, OpenDRIM_ProcessorCore_RequestStateChange_Out& out, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_ProcessorCore_populate(OpenDRIM_ProcessorCore& instance, const _processor_topology& cpu_info_processor_information, const _processor_core& processor_core, const _processor_information& SMBIOS_processor_information, bool use_SMBIOS, string& errorMessage) { _E_; /* * Properties to fill from profile * + Mandatory: * [X] InstanceID * [X] CoreEnabledState * [X] EnabledState * [X] RequestedState * [X] OperationalStatus * [X] HealthState * [X] ElementName */ vector OperationalStatus; int core_num=atoi(instance.InstanceID.substr(instance.InstanceID.find(":")+1).c_str()); // default // we don't support RequestedStateChange() instance.setRequestedState(12); // Not Applicable instance.setEnabledState(5); // Not Applicable if(SMBIOS_processor_information.core_enabled == 0) instance.setCoreEnabledState(0); // unknown else if(core_num < SMBIOS_processor_information.core_enabled) instance.setCoreEnabledState(2); // Core Enabled else instance.setCoreEnabledState(3); // Core Disabled OperationalStatus.push_back(0); // unknown instance.setOperationalStatus(OperationalStatus); instance.setHealthState(0); // unknown // set info from SMBIOS if (use_SMBIOS) instance.setMaxClockSpeed(SMBIOS_processor_information.max_speed); else instance.setMaxClockSpeed(0); // set /proc/cpuinfo info instance.setElementName(cpu_info_processor_information.name + " core"); instance.setCurrentClockSpeed(processor_core.current_freq/1000); // load percentage instance.setLoadPercentage(processor_core.load_average); _L_; return OK; } opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_RegisteredCPUProfile/0000755000175000017500000000000011400667756023771 5ustar guillaumeguillaumeopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_RegisteredCPUProfile/OpenDRIM_RegisteredCPUProfileAccess.h0000644000175000017500000000603311400667756032711 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_REGISTEREDCPUPROFILEACCESS_H_ #define OPENDRIM_REGISTEREDCPUPROFILEACCESS_H_ #include "CPU_Common.h" #include "OpenDRIM_RegisteredCPUProfile.h" int CPU_OpenDRIM_RegisteredCPUProfile_load(const CMPIBroker* broker, string& errorMessage); int CPU_OpenDRIM_RegisteredCPUProfile_unload(string& errorMessage); int CPU_OpenDRIM_RegisteredCPUProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_RegisteredCPUProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_RegisteredCPUProfile& instance, const char** properties, string& errorMessage); int CPU_OpenDRIM_RegisteredCPUProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredCPUProfile& newInstance, const OpenDRIM_RegisteredCPUProfile& oldInstance, const char** properties, string& errorMessage); int CPU_OpenDRIM_RegisteredCPUProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredCPUProfile& instance, string& errorMessage); int CPU_OpenDRIM_RegisteredCPUProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredCPUProfile& instance, string& errorMessage); int CPU_OpenDRIM_RegisteredCPUProfile_populate(OpenDRIM_RegisteredCPUProfile& instance, string& errorMessage); #endif /*OPENDRIM_REGISTEREDCPUPROFILEACCESS_H_*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_RegisteredCPUProfile/Makefile.am0000644000175000017500000000420411400667756026025 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiCPU_OpenDRIM_RegisteredCPUProfileProvider.la libcmpiCPU_OpenDRIM_RegisteredCPUProfileProvider_la_SOURCES = OpenDRIM_RegisteredCPUProfileAccess.cpp OpenDRIM_RegisteredCPUProfileProvider.cpp cmpiOpenDRIM_RegisteredCPUProfile.cpp libcmpiCPU_OpenDRIM_RegisteredCPUProfileProvider_la_LIBADD = ../Common/libcmpiCPU_Common.la libcmpiCPU_OpenDRIM_RegisteredCPUProfileProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_RegisteredCPUProfile.h OpenDRIM_RegisteredCPUProfile.h OpenDRIM_RegisteredCPUProfileAccess.h opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_RegisteredCPUProfile/cmpiOpenDRIM_RegisteredCPUProfile.cpp0000644000175000017500000001156711400667756033003 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredCPUProfile.h" CMPIObjectPath* CPU_OpenDRIM_RegisteredCPUProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RegisteredCPUProfile& instance) { _E_; Objectpath op(broker, OpenDRIM_RegisteredCPUProfile_classnames[0], OpenDRIM_RegisteredCPUProfile_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* CPU_OpenDRIM_RegisteredCPUProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RegisteredCPUProfile& instance) { _E_; Objectpath op(broker, CPU_OpenDRIM_RegisteredCPUProfile_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.RegisteredOrganization_isNULL) ci.setProperty("RegisteredOrganization", instance.RegisteredOrganization); if (!instance.OtherRegisteredOrganization_isNULL) ci.setProperty("OtherRegisteredOrganization", instance.OtherRegisteredOrganization); if (!instance.RegisteredName_isNULL) ci.setProperty("RegisteredName", instance.RegisteredName); if (!instance.RegisteredVersion_isNULL) ci.setProperty("RegisteredVersion", instance.RegisteredVersion); if (!instance.AdvertiseTypes_isNULL) ci.setProperty("AdvertiseTypes", instance.AdvertiseTypes); if (!instance.AdvertiseTypeDescriptions_isNULL) ci.setProperty("AdvertiseTypeDescriptions", instance.AdvertiseTypeDescriptions); _L_; return ci.getHdl(); } void CPU_OpenDRIM_RegisteredCPUProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RegisteredCPUProfile& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void CPU_OpenDRIM_RegisteredCPUProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RegisteredCPUProfile& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("RegisteredOrganization", instance.RegisteredOrganization) == OK) instance.RegisteredOrganization_isNULL = false; if (inst.getProperty("OtherRegisteredOrganization", instance.OtherRegisteredOrganization) == OK) instance.OtherRegisteredOrganization_isNULL = false; if (inst.getProperty("RegisteredName", instance.RegisteredName) == OK) instance.RegisteredName_isNULL = false; if (inst.getProperty("RegisteredVersion", instance.RegisteredVersion) == OK) instance.RegisteredVersion_isNULL = false; if (inst.getProperty("AdvertiseTypes", instance.AdvertiseTypes) == OK) instance.AdvertiseTypes_isNULL = false; if (inst.getProperty("AdvertiseTypeDescriptions", instance.AdvertiseTypeDescriptions) == OK) instance.AdvertiseTypeDescriptions_isNULL = false; _L_; } opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_RegisteredCPUProfile/OpenDRIM_RegisteredCPUProfileProvider.cpp0000644000175000017500000002565011400667756033643 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredCPUProfile.h" #include "OpenDRIM_RegisteredCPUProfileAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define CPU_OpenDRIM_RegisteredCPUProfileProviderSetInstance CPU_OpenDRIM_RegisteredCPUProfileProviderModifyInstance #endif int CPU_OpenDRIM_RegisteredCPUProfile_init(const CMPIBroker* broker); int CPU_OpenDRIM_RegisteredCPUProfile_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_RegisteredCPUProfileProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_RegisteredCPUProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_RegisteredCPUProfileProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_RegisteredCPUProfile_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredCPUProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = CPU_OpenDRIM_RegisteredCPUProfile_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_RegisteredCPUProfileProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_RegisteredCPUProfile_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredCPUProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = CPU_OpenDRIM_RegisteredCPUProfile_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_RegisteredCPUProfileProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredCPUProfile instance; CPU_OpenDRIM_RegisteredCPUProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_RegisteredCPUProfile_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredCPUProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = CPU_OpenDRIM_RegisteredCPUProfile_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_RegisteredCPUProfileProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredCPUProfile newInstance, oldInstance; CPU_OpenDRIM_RegisteredCPUProfile_toCPP(_broker, ci, newInstance); CPU_OpenDRIM_RegisteredCPUProfile_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = CPU_OpenDRIM_RegisteredCPUProfile_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredCPUProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_RegisteredCPUProfile_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredCPUProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_RegisteredCPUProfileProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredCPUProfile instance; CPU_OpenDRIM_RegisteredCPUProfile_toCPP(_broker, ci, instance); string errorMessage; int errorCode = CPU_OpenDRIM_RegisteredCPUProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_RegisteredCPUProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_RegisteredCPUProfile_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredCPUProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_RegisteredCPUProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredCPUProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = CPU_OpenDRIM_RegisteredCPUProfile_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_RegisteredCPUProfileProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredCPUProfile instance; CPU_OpenDRIM_RegisteredCPUProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_RegisteredCPUProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredCPUProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_RegisteredCPUProfile_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredCPUProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_RegisteredCPUProfileProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int CPU_OpenDRIM_RegisteredCPUProfile_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = CPU_OpenDRIM_RegisteredCPUProfile_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_RegisteredCPUProfile_init FAILED: " + (string) OpenDRIM_RegisteredCPUProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int CPU_OpenDRIM_RegisteredCPUProfile_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = CPU_OpenDRIM_RegisteredCPUProfile_unload(errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_RegisteredCPUProfile_unload FAILED: " + (string) OpenDRIM_RegisteredCPUProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define CPU_OpenDRIM_RegisteredCPUProfile_INIT if (CPU_OpenDRIM_RegisteredCPUProfile_init(_broker) < 0) return NULL CMInstanceMIStub(CPU_OpenDRIM_RegisteredCPUProfileProvider, CPU_OpenDRIM_RegisteredCPUProfileProvider, _broker, CPU_OpenDRIM_RegisteredCPUProfile_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_RegisteredCPUProfile/OpenDRIM_RegisteredCPUProfile.h0000644000175000017500000001362111400667756031570 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_REGISTEREDCPUPROFILE_H_ #define OPENDRIM_REGISTEREDCPUPROFILE_H_ #include const static char* OpenDRIM_RegisteredCPUProfile_classnames[] = {"OpenDRIM_RegisteredCPUProfile"}; static string OpenDRIM_RegisteredCPUProfile_NAMESPACE = _INTEROP_NAMESPACE; class OpenDRIM_RegisteredCPUProfile { public: string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string InstanceID; bool InstanceID_isNULL; unsigned short RegisteredOrganization; bool RegisteredOrganization_isNULL; string OtherRegisteredOrganization; bool OtherRegisteredOrganization_isNULL; string RegisteredName; bool RegisteredName_isNULL; string RegisteredVersion; bool RegisteredVersion_isNULL; vector AdvertiseTypes; bool AdvertiseTypes_isNULL; vector AdvertiseTypeDescriptions; bool AdvertiseTypeDescriptions_isNULL; OpenDRIM_RegisteredCPUProfile() { Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstanceID_isNULL = true; RegisteredOrganization_isNULL = true; OtherRegisteredOrganization_isNULL = true; RegisteredName_isNULL = true; RegisteredVersion_isNULL = true; AdvertiseTypes_isNULL = true; AdvertiseTypeDescriptions_isNULL = true; } ~OpenDRIM_RegisteredCPUProfile() {} string getKeys() const { return CF_toLowCase(".InstanceID=\"" + CF_quoteString(InstanceID) + "\""); } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getRegisteredOrganization(unsigned short& value) const { if (RegisteredOrganization_isNULL==true) return NOT_FOUND; value = RegisteredOrganization; return OK; } int setRegisteredOrganization(const unsigned short& newValue) { RegisteredOrganization = newValue; RegisteredOrganization_isNULL = false; return OK; } int getOtherRegisteredOrganization(string& value) const { if (OtherRegisteredOrganization_isNULL==true) return NOT_FOUND; value = OtherRegisteredOrganization; return OK; } int setOtherRegisteredOrganization(const string& newValue) { OtherRegisteredOrganization = newValue; OtherRegisteredOrganization_isNULL = false; return OK; } int getRegisteredName(string& value) const { if (RegisteredName_isNULL==true) return NOT_FOUND; value = RegisteredName; return OK; } int setRegisteredName(const string& newValue) { RegisteredName = newValue; RegisteredName_isNULL = false; return OK; } int getRegisteredVersion(string& value) const { if (RegisteredVersion_isNULL==true) return NOT_FOUND; value = RegisteredVersion; return OK; } int setRegisteredVersion(const string& newValue) { RegisteredVersion = newValue; RegisteredVersion_isNULL = false; return OK; } int getAdvertiseTypes(vector& value) const { if (AdvertiseTypes_isNULL==true) return NOT_FOUND; value = AdvertiseTypes; return OK; } int setAdvertiseTypes(const vector& newValue) { AdvertiseTypes = newValue; AdvertiseTypes_isNULL = false; return OK; } int getAdvertiseTypeDescriptions(vector& value) const { if (AdvertiseTypeDescriptions_isNULL==true) return NOT_FOUND; value = AdvertiseTypeDescriptions; return OK; } int setAdvertiseTypeDescriptions(const vector& newValue) { AdvertiseTypeDescriptions = newValue; AdvertiseTypeDescriptions_isNULL = false; return OK; } }; #endif /*OPENDRIM_REGISTEREDCPUPROFILE_H_*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_RegisteredCPUProfile/OpenDRIM_RegisteredCPUProfileAccess.cpp0000644000175000017500000000753711400667756033256 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_RegisteredCPUProfileAccess.h" const string InstanceID="OpenDRIM:CPU:1.0.0"; int CPU_OpenDRIM_RegisteredCPUProfile_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int CPU_OpenDRIM_RegisteredCPUProfile_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int CPU_OpenDRIM_RegisteredCPUProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; OpenDRIM_RegisteredCPUProfile instance; instance.setInstanceID(InstanceID); if(discriminant=="ei") CF_assert(CPU_OpenDRIM_RegisteredCPUProfile_populate(instance,errorMessage)); result.push_back(instance); _L_; return OK; } int CPU_OpenDRIM_RegisteredCPUProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_RegisteredCPUProfile& instance, const char** properties, string& errorMessage) { _E_; if (instance.InstanceID!=InstanceID) { errorMessage = "No instance"; return NOT_FOUND; } CF_assert(CPU_OpenDRIM_RegisteredCPUProfile_populate(instance,errorMessage)); _L_; return OK; } int CPU_OpenDRIM_RegisteredCPUProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredCPUProfile& newInstance, const OpenDRIM_RegisteredCPUProfile& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_RegisteredCPUProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredCPUProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_RegisteredCPUProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredCPUProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_RegisteredCPUProfile_populate(OpenDRIM_RegisteredCPUProfile& instance, string& errorMessage) { _E_; vector AdvertiseTypes; instance.setRegisteredName("CPU Profile"); instance.setRegisteredVersion("1.0.0"); instance.setRegisteredOrganization(2); // DMTF AdvertiseTypes.push_back(2); // Not Advertised instance.setAdvertiseTypes(AdvertiseTypes); _L_; return OK; } opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_RegisteredCPUProfile/cmpiOpenDRIM_RegisteredCPUProfile.h0000644000175000017500000000444711400667756032447 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_REGISTEREDCPUPROFILE_H_ #define CMPIOPENDRIM_REGISTEREDCPUPROFILE_H_ #include "OpenDRIM_RegisteredCPUProfile.h" CMPIObjectPath* CPU_OpenDRIM_RegisteredCPUProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RegisteredCPUProfile& instance); CMPIInstance* CPU_OpenDRIM_RegisteredCPUProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RegisteredCPUProfile& instance); void CPU_OpenDRIM_RegisteredCPUProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RegisteredCPUProfile& instance); void CPU_OpenDRIM_RegisteredCPUProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RegisteredCPUProfile& instance); #endif /*CMPIOPENDRIM_REGISTEREDCPUPROFILE_H_*/ opendrim-lmp-cpu-1.1.0~ppa/TODO0000644000175000017500000000010111400667756017026 0ustar guillaumeguillaumeTODO for Major.Minor.Revision ========================= // TODO opendrim-lmp-cpu-1.1.0~ppa/INSTALL0000644000175000017500000000677711400667756017420 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ --------------------------------------------------------- BUILD --------------------------------------------------------- ./configure CIMSERVER= // For seeing the possible options: ./configure --help make --------------------------------------------------------- INSTALLATION --------------------------------------------------------- make install // Complile and copy the libraries to the provider library directory make postinstall // Register the providers --------------------------------------------------------- REMOVAL --------------------------------------------------------- make preuninstall // Deregister the providers make uninstall // Delete the libraries from the provider directory --------------------------------------------------------- CLEANUP --------------------------------------------------------- make clean --------------------------------------------------------- DEBUG --------------------------------------------------------- Configure (./configure) the source code with 'CPPFLAGS=-D__DEBUG__'. The debugging information is printed in a file called 'cmpi_prov_debug.txt'. OpenPegasus from source: ----------------------- The file is located in the directory where you executed 'cimserver' (to start the CIM server). OpenPegasus from RPM: -------------------- If Pegasus is installed from RPM the file is located in the '/var/lib/Pegasus/cache' directory. SBLIM sfcb: ---------- The file is located in the directory where you executed 'sfcbd' (to start the CIM server). OpenWBEM: -------- // TODO --------------------------------------------------------- OFFLINE TEST --------------------------------------------------------- make test- If you enabled the debugging information, 'cmpi_prov_debug.txt' is created in the 'test' directory. The test MAY BE impossible to run for associations. If it is the case you have to install the provider package and test the association providers online (CIM server running). opendrim-lmp-cpu-1.1.0~ppa/AUTHORS0000644000175000017500000000023311400667756017414 0ustar guillaumeguillaumeFrederic Desmons, ETRI Rustam Rakhimov Guillaume BOTTEX opendrim-lmp-cpu-1.1.0~ppa/packaging/0000755000175000017500000000000011400667756020272 5ustar guillaumeguillaumeopendrim-lmp-cpu-1.1.0~ppa/packaging/opendrim-lmp-cpu.spec0000644000175000017500000000776011400667756024350 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ %define packageVersion 1 Version: %{version} Release: %{packageVersion}%{?dist} Vendor: OpenDRIM Summary: OpenDRIM CPU Provider Name: opendrim-lmp-cpu Group: Systems Management/Base License: GPL BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root URL: http://opendrim.sourceforge.net Source: %{name}-%{version}.tar.gz BuildRequires: autoconf, tog-pegasus-devel, libopendrim >= 1.1.2 Requires: tog-pegasus, libopendrim >= 1.1.2 %description %global PEGASUS_ARCH_LIB %{_lib} %global COMMONLIBDIR /usr/%PEGASUS_ARCH_LIB %global PROVIDERDIR %COMMONLIBDIR/Pegasus/providers %global OPENDRIM_REG_DIR /usr/share/OpenDRIM %global OPENDRIM_MOF_DIR /usr/share/OpenDRIM/%{name}/mof %global PROVIDER_SCRIPT_POST CPU %global CIMNAMESPACE %{?CIM_NAMESPACE:%{CIM_NAMESPACE}}%{!?CIM_NAMESPACE:root/cimv2} %global CIMSERVER pegasus %global INTEROPNAMESPACE root/interop %prep %setup -q -n %{name}-%{version} %build autoreconf --install --force ./configure CIMSERVER=%CIMSERVER CIMNAMESPACE=%CIMNAMESPACE INTEROPNAMESPACE=%INTEROPNAMESPACE --prefix=/usr make %pre SERVICE='cimserver' if !(ps ax | grep -v grep | grep $SERVICE > /dev/null) then echo "$SERVICE is not running" exit 1 fi %install make install COMMONLIBDIR=$RPM_BUILD_ROOT%COMMONLIBDIR PROVIDERDIR=$RPM_BUILD_ROOT%PROVIDERDIR %{__install} -d -m 744 $RPM_BUILD_ROOT%OPENDRIM_REG_DIR/%{name}/registration %{__install} -p -m 644 registration/*.sh $RPM_BUILD_ROOT%OPENDRIM_REG_DIR/%{name}/registration %{__install} -d -m 744 $RPM_BUILD_ROOT%OPENDRIM_MOF_DIR/ %{__install} -p -m 644 mof/*.mof $RPM_BUILD_ROOT%OPENDRIM_MOF_DIR/ %post %OPENDRIM_REG_DIR/%{name}-%{version}-script/%PROVIDER_SCRIPT_POST.sh %CIMNAMESPACE %{vendor} %CIMSERVER %INTEROPNAMESPACE %{version} %clean [ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT; [ "${RPM_BUILD_DIR}" != "/" ] && %{__rm} -rf ${RPM_BUILD_DIR}/%{name}-%{version}; %preun SERVICE='cimserver' if !(ps ax | grep -v grep | grep $SERVICE > /dev/null) then echo "$SERVICE is not running" exit 1 fi %OPENDRIM_REG_DIR/%{name}-%{version}-script/%PROVIDER_SCRIPT_POST-remove.sh %CIMNAMESPACE %CIMSERVER %INTEROPNAMESPACE %files %defattr(755, root, root, 755) %dir %COMMONLIBDIR %dir %PROVIDERDIR %COMMONLIBDIR/*.so %PROVIDERDIR/*.so %defattr(744, root, root, 755) %dir %OPENDRIM_REG_DIR %dir %OPENDRIM_MOF_DIR %dir %OPENDRIM_REG_DIR/%{name}-%{version}-script %OPENDRIM_REG_DIR/%{name}-%{version}-script/*.sh %OPENDRIM_MOF_DIR/*.mof opendrim-lmp-cpu-1.1.0~ppa/packaging/debian/0000755000175000017500000000000011404347234021502 5ustar guillaumeguillaumeopendrim-lmp-cpu-1.1.0~ppa/packaging/debian/postrm0000644000175000017500000000325311404347234022754 0ustar guillaumeguillaume#!/bin/sh set -e # summary of how this script can be called: # * `remove' # * `purge' # * `upgrade' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # * `disappear' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in purge) rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_RegisteredCPUProfile rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_Processor rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_libMemory rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_ProcessorConformsToProfile rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_AssociatedProcessorCorelibMemory rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_ProcessorCoreHardwareThread rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_ProcessorCore rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_HardwareThread rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_ProcessorProcessorCore rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_ComputerSystemProcessor rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_AssociatedProcessorlibMemory ;; remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 opendrim-lmp-cpu-1.1.0~ppa/packaging/debian/source/0000755000175000017500000000000011400670102022767 5ustar guillaumeguillaumeopendrim-lmp-cpu-1.1.0~ppa/packaging/debian/source/format0000644000175000017500000000001411400670102024175 0ustar guillaumeguillaume3.0 (quilt) opendrim-lmp-cpu-1.1.0~ppa/packaging/debian/copyright0000644000175000017500000000310011400667756023441 0ustar guillaumeguillaumeThis package was debianized by Guillaume BOTTEX on Thu, 27 Aug 2009 16:22:35 +0900. It was downloaded from http://opendrim.sourceforge.net/ Upstream Authors: Frederic Desmons Rustam Rakhimov Guillaume BOTTEX Copyright: Copyright (C) 2007 ETRI Frederic Desmons Copyright (C) 2009 ETRI Rustam Rakhimov Copyright (C) 2009 ETRI Guillaume BOTTEX License: Linux Management Providers (LMP), CPU provider package This program is being developed under the "OpenDRIM" project. The "OpenDRIM" project web page: http://opendrim.sourceforge.net The "OpenDRIM" project mailing list: opendrim@googlegroups.com 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; version 2 of the License. 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. The Debian packaging is copyright 2009, Guillaume BOTTEX and is licensed under the GPL, see `/usr/share/common-licenses/GPL-2'. opendrim-lmp-cpu-1.1.0~ppa/packaging/debian/control0000644000175000017500000000122111404347175023105 0ustar guillaumeguillaumeSource: opendrim-lmp-cpu Priority: optional Section: libs Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Guillaume BOTTEX Build-Depends: debhelper (>= 5), automake, autoconf, libtool, sfcb, libopendrim0-dev (>= 1.1.3), libxml2-dev Standards-Version: 3.8.4 Homepage: http://opendrim.sourceforge.net/ Package: opendrim-lmp-cpu Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, sfcb, libopendrim0 (>= 1.1.3) Description: OpenDRIM CPU provider Provides information about the computer system CPU capabilities. . Compliant with the DMTF CPU Profile v1.0.0 (DSP1022). opendrim-lmp-cpu-1.1.0~ppa/packaging/debian/prerm0000644000175000017500000000240511400667756022565 0ustar guillaumeguillaume#!/bin/sh -e # prerm script for opendrim-lmp-baseserver # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `upgrade' # * `failed-upgrade' # * `remove' `in-favour' # * `deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in remove|upgrade|deconfigure) CIMNAMESPACE=root/cimv2 CIMSERVER=sfcb INTEROPNAMESPACE=root/interop APP_NAME=opendrim-lmp-cpu VERSION=`cat /usr/share/doc/opendrim-lmp-cpu/VERSION` OPENDRIM_REG_DIR=/usr/share/OpenDRIM PROVIDER_SCRIPT_POST=CPU $OPENDRIM_REG_DIR/$APP_NAME/registration/$PROVIDER_SCRIPT_POST-remove.sh $CIMNAMESPACE $CIMSERVER $INTEROPNAMESPACE $OPENDRIM_REG_DIR/$APP_NAME ;; failed-upgrade) ;; *) echo "prerm called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 opendrim-lmp-cpu-1.1.0~ppa/packaging/debian/changelog0000644000175000017500000000024111404347224023350 0ustar guillaumeguillaumeopendrim-lmp-cpu (1.1.0-0ubuntu1) lucid; urgency=low * Initial release -- Guillaume BOTTEX Fri, 11 Jun 2010 14:50:00 +0900 opendrim-lmp-cpu-1.1.0~ppa/packaging/debian/postinst0000644000175000017500000000256211400667756023327 0ustar guillaumeguillaume#!/bin/sh -e # postinst script for opendrim-lmp-baseserver # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in configure) CIMNAMESPACE=root/cimv2 VENDOR=OpenDRIM CIMSERVER=sfcb INTEROPNAMESPACE=root/interop APP_NAME=opendrim-lmp-cpu VERSION=`cat /usr/share/doc/opendrim-lmp-cpu/VERSION` OPENDRIM_REG_DIR=/usr/share/OpenDRIM PROVIDER_SCRIPT_POST=CPU $OPENDRIM_REG_DIR/$APP_NAME/registration/$PROVIDER_SCRIPT_POST.sh $CIMNAMESPACE $VENDOR $CIMSERVER $INTEROPNAMESPACE $VERSION $OPENDRIM_REG_DIR/$APP_NAME ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 opendrim-lmp-cpu-1.1.0~ppa/packaging/debian/install0000644000175000017500000000004711400667756023106 0ustar guillaumeguillaumeusr/lib/cmpi/*.so usr/share/OpenDRIM/* opendrim-lmp-cpu-1.1.0~ppa/packaging/debian/rules0000755000175000017500000000353311400667756022600 0ustar guillaumeguillaume#!/usr/bin/make -f INSTALL = /usr/bin/install -c CONFIGURE_OPTIONS := CIMSERVER=sfcb --prefix=/usr INTEROPNAMESPACE=root/interop COMMONLIBDIR=/usr/lib/cmpi DESTDIR = $(CURDIR)/debian/tmp VERSION = $(shell cat ./VERSION) APP_NAME = opendrim-lmp-cpu OPENDRIM_REG_DIR = /usr/share/OpenDRIM OPENDRIM_MOF_DIR = /usr/share/OpenDRIM/$(APP_NAME)/mof configure: configure-stamp configure-stamp: dh_testdir autoreconf -i --force ./configure $(CONFIGURE_OPTIONS) touch configure-stamp build: build-stamp build-stamp: configure-stamp dh_testdir $(MAKE) #docbook-to-man debian/opendrim-lmp-cpu.sgml > opendrim-lmp-cpu.1 touch $@ clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp [ ! -f Makefile ] || $(MAKE) clean dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs $(MAKE) DESTDIR=$(DESTDIR) install $(INSTALL) -d -m 744 $(DESTDIR)$(OPENDRIM_REG_DIR)/$(APP_NAME)/registration $(INSTALL) -p -m 744 registration/*.sh $(DESTDIR)$(OPENDRIM_REG_DIR)/$(APP_NAME)/registration $(INSTALL) -d -m 744 $(DESTDIR)$(OPENDRIM_MOF_DIR) $(INSTALL) -p -m 644 mof/*.mof $(DESTDIR)$(OPENDRIM_MOF_DIR) # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installexamples dh_install --sourcedir=$(DESTDIR) # dh_installmenu # dh_installdebconf # dh_installlogrotate # dh_installemacsen # dh_installpam # dh_installmime # dh_python # dh_installinit # dh_installcron # dh_installinfo dh_installman dh_link dh_strip dh_compress dh_fixperms # dh_perl # dh_makeshlibs dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure opendrim-lmp-cpu-1.1.0~ppa/packaging/debian/docs0000644000175000017500000000003111400667756022361 0ustar guillaumeguillaumeNEWS README TODO VERSION opendrim-lmp-cpu-1.1.0~ppa/packaging/debian/compat0000644000175000017500000000000211400667756022712 0ustar guillaumeguillaume5 opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_HardwareThread/0000755000175000017500000000000011400667756022670 5ustar guillaumeguillaumeopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_HardwareThread/OpenDRIM_HardwareThreadAccess.h0000644000175000017500000000652011400667756030510 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_HARDWARETHREADACCESS_H_ #define OPENDRIM_HARDWARETHREADACCESS_H_ #include "CPU_Common.h" #include #include "OpenDRIM_HardwareThread.h" int CPU_OpenDRIM_HardwareThread_load(const CMPIBroker* broker, string& errorMessage); int CPU_OpenDRIM_HardwareThread_unload(string& errorMessage); int CPU_OpenDRIM_HardwareThread_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_HardwareThread_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_HardwareThread& instance, const char** properties, string& errorMessage); int CPU_OpenDRIM_HardwareThread_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HardwareThread& newInstance, const OpenDRIM_HardwareThread& oldInstance, const char** properties, string& errorMessage); int CPU_OpenDRIM_HardwareThread_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HardwareThread& instance, string& errorMessage); int CPU_OpenDRIM_HardwareThread_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HardwareThread& instance, string& errorMessage); int CPU_OpenDRIM_HardwareThread_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HardwareThread& instance, unsigned int& returnValue, const OpenDRIM_HardwareThread_RequestStateChange_In& in, OpenDRIM_HardwareThread_RequestStateChange_Out& out, string& errorMessage); int CPU_OpenDRIM_HardwareThread_populate(OpenDRIM_HardwareThread& instance, const _processor_topology& cpu_info_processor_information, unsigned int core_id, unsigned int thread_id, string& errorMessage); #endif /*OPENDRIM_HARDWARETHREADACCESS_H_*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_HardwareThread/OpenDRIM_HardwareThreadAccess.cpp0000644000175000017500000001575011400667756031050 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_HardwareThreadAccess.h" vector<_processor_topology> _previous_cpu_info_processors_information; int CPU_OpenDRIM_HardwareThread_load(const CMPIBroker* broker, string& errorMessage) { _E_; CF_assert(CPU_getProcessors("/proc/cpuinfo", _previous_cpu_info_processors_information, errorMessage)); CF_assert(CPU_getLoadAverages(_previous_cpu_info_processors_information, _previous_cpu_info_processors_information, errorMessage)); _L_; return OK; } int CPU_OpenDRIM_HardwareThread_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int CPU_OpenDRIM_HardwareThread_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; // get info from cpuinfo vector<_processor_topology> cpu_info_processors_information; CF_assert(CPU_getProcessors("/proc/cpuinfo", cpu_info_processors_information, errorMessage)); CF_assert(CPU_getLoadAverages(cpu_info_processors_information, _previous_cpu_info_processors_information, errorMessage)); _previous_cpu_info_processors_information = cpu_info_processors_information; for (unsigned int i = 0; i < cpu_info_processors_information.size(); i++) { for (unsigned int j = 0; j < cpu_info_processors_information[i].processor_cores.size(); j++) { for (unsigned int k = 0; k < cpu_info_processors_information[i].processor_cores[j].nb_hardware_thread; k++) { OpenDRIM_HardwareThread instance; instance.setInstanceID(CF_intToStr(i) + ":" + CF_intToStr(j) + ":" + CF_intToStr(k)); if (discriminant == "ei") { CF_assert(CPU_OpenDRIM_HardwareThread_populate(instance, cpu_info_processors_information[i], j, k, errorMessage)); } result.push_back(instance); } } } _L_; return OK; } int CPU_OpenDRIM_HardwareThread_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_HardwareThread& instance, const char** properties, string& errorMessage) { _E_; string InstanceID; instance.getInstanceID(InstanceID); vector InstanceID_elements; CF_splitText(InstanceID_elements, InstanceID, ':'); if (InstanceID_elements.size() != 3) return NOT_FOUND; if (!CF_isNumber(InstanceID_elements[0]) || !CF_isNumber(InstanceID_elements[1]) || !CF_isNumber(InstanceID_elements[2])) return NOT_FOUND; unsigned int processor_id = atoll(InstanceID_elements[0].c_str()); unsigned int core_id = atoll(InstanceID_elements[1].c_str()); unsigned int thread_id = atoll(InstanceID_elements[2].c_str()); // get info from cpuinfo vector<_processor_topology> cpu_info_processors_information; CF_assert(CPU_getProcessors("/proc/cpuinfo", cpu_info_processors_information, errorMessage)); CF_assert(CPU_getLoadAverages(cpu_info_processors_information, _previous_cpu_info_processors_information, errorMessage)); _previous_cpu_info_processors_information = cpu_info_processors_information; // does this thread exists ? if (processor_id >= cpu_info_processors_information.size()) return NOT_FOUND; if (core_id >= cpu_info_processors_information[processor_id].processor_cores.size()) return NOT_FOUND; if (thread_id >= cpu_info_processors_information[processor_id].processor_cores[core_id].nb_hardware_thread) return NOT_FOUND; // populate the instance CF_assert(CPU_OpenDRIM_HardwareThread_populate(instance, cpu_info_processors_information[processor_id], core_id, thread_id, errorMessage)); _L_; return OK; } int CPU_OpenDRIM_HardwareThread_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HardwareThread& newInstance, const OpenDRIM_HardwareThread& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_HardwareThread_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HardwareThread& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_HardwareThread_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HardwareThread& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_HardwareThread_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HardwareThread& instance, unsigned int& returnValue, const OpenDRIM_HardwareThread_RequestStateChange_In& in, OpenDRIM_HardwareThread_RequestStateChange_Out& out, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_HardwareThread_populate(OpenDRIM_HardwareThread& instance, const _processor_topology& cpu_info_processor_information, unsigned int core_id, unsigned int thread_id, string& errorMessage) { _E_; /* * Properties to fill from profile * + Mandatory: * [X] InstanceID * [X] EnabledState * [X] RequestedState * [X] OperationalStatus * [X] HealthState * [X] ElementName */ vector OperationalStatus; // default // we don't support RequestedStateChange() instance.setRequestedState(12); // Not Applicable instance.setEnabledState(5); // Not Applicable OperationalStatus.push_back(0); // unknown instance.setOperationalStatus(OperationalStatus); instance.setHealthState(0); // unknown // set info from /proc/cpuinfo instance.setElementName(cpu_info_processor_information.name + " core hardware thread"); // load percentage instance.setLoadPercentage(cpu_info_processor_information.processor_cores[core_id].hardware_thread_load_averages[thread_id]); _L_; return OK; } opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_HardwareThread/Makefile.am0000644000175000017500000000411011400667756024720 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiCPU_OpenDRIM_HardwareThreadProvider.la libcmpiCPU_OpenDRIM_HardwareThreadProvider_la_SOURCES = OpenDRIM_HardwareThreadAccess.cpp OpenDRIM_HardwareThreadProvider.cpp cmpiOpenDRIM_HardwareThread.cpp libcmpiCPU_OpenDRIM_HardwareThreadProvider_la_LIBADD = ../Common/libcmpiCPU_Common.la libcmpiCPU_OpenDRIM_HardwareThreadProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_HardwareThread.h OpenDRIM_HardwareThread.h OpenDRIM_HardwareThreadAccess.h opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_HardwareThread/cmpiOpenDRIM_HardwareThread.cpp0000644000175000017500000002035311400667756030572 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_HardwareThread.h" CMPIObjectPath* CPU_OpenDRIM_HardwareThread_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_HardwareThread& instance) { _E_; Objectpath op(broker, OpenDRIM_HardwareThread_classnames[0], OpenDRIM_HardwareThread_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* CPU_OpenDRIM_HardwareThread_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_HardwareThread& instance) { _E_; Objectpath op(broker, CPU_OpenDRIM_HardwareThread_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.InstallDate_isNULL) ci.setPropertyDatetime("InstallDate", instance.InstallDate); if (!instance.Name_isNULL) ci.setProperty("Name", instance.Name); if (!instance.OperationalStatus_isNULL) ci.setProperty("OperationalStatus", instance.OperationalStatus); if (!instance.StatusDescriptions_isNULL) ci.setProperty("StatusDescriptions", instance.StatusDescriptions); if (!instance.Status_isNULL) ci.setProperty("Status", instance.Status); if (!instance.HealthState_isNULL) ci.setProperty("HealthState", instance.HealthState); if (!instance.PrimaryStatus_isNULL) ci.setProperty("PrimaryStatus", instance.PrimaryStatus); if (!instance.DetailedStatus_isNULL) ci.setProperty("DetailedStatus", instance.DetailedStatus); if (!instance.OperatingStatus_isNULL) ci.setProperty("OperatingStatus", instance.OperatingStatus); if (!instance.CommunicationStatus_isNULL) ci.setProperty("CommunicationStatus", instance.CommunicationStatus); if (!instance.EnabledState_isNULL) ci.setProperty("EnabledState", instance.EnabledState); if (!instance.OtherEnabledState_isNULL) ci.setProperty("OtherEnabledState", instance.OtherEnabledState); if (!instance.RequestedState_isNULL) ci.setProperty("RequestedState", instance.RequestedState); if (!instance.EnabledDefault_isNULL) ci.setProperty("EnabledDefault", instance.EnabledDefault); if (!instance.TimeOfLastStateChange_isNULL) ci.setPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange); if (!instance.AvailableRequestedStates_isNULL) ci.setProperty("AvailableRequestedStates", instance.AvailableRequestedStates); if (!instance.TransitioningToState_isNULL) ci.setProperty("TransitioningToState", instance.TransitioningToState); if (!instance.LoadPercentage_isNULL) ci.setProperty("LoadPercentage", instance.LoadPercentage); _L_; return ci.getHdl(); } void CPU_OpenDRIM_HardwareThread_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_HardwareThread& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void CPU_OpenDRIM_HardwareThread_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_HardwareThread& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getPropertyDatetime("InstallDate", instance.InstallDate) == OK) instance.InstallDate_isNULL = false; if (inst.getProperty("Name", instance.Name) == OK) instance.Name_isNULL = false; if (inst.getProperty("OperationalStatus", instance.OperationalStatus) == OK) instance.OperationalStatus_isNULL = false; if (inst.getProperty("StatusDescriptions", instance.StatusDescriptions) == OK) instance.StatusDescriptions_isNULL = false; if (inst.getProperty("Status", instance.Status) == OK) instance.Status_isNULL = false; if (inst.getProperty("HealthState", instance.HealthState) == OK) instance.HealthState_isNULL = false; if (inst.getProperty("PrimaryStatus", instance.PrimaryStatus) == OK) instance.PrimaryStatus_isNULL = false; if (inst.getProperty("DetailedStatus", instance.DetailedStatus) == OK) instance.DetailedStatus_isNULL = false; if (inst.getProperty("OperatingStatus", instance.OperatingStatus) == OK) instance.OperatingStatus_isNULL = false; if (inst.getProperty("CommunicationStatus", instance.CommunicationStatus) == OK) instance.CommunicationStatus_isNULL = false; if (inst.getProperty("EnabledState", instance.EnabledState) == OK) instance.EnabledState_isNULL = false; if (inst.getProperty("OtherEnabledState", instance.OtherEnabledState) == OK) instance.OtherEnabledState_isNULL = false; if (inst.getProperty("RequestedState", instance.RequestedState) == OK) instance.RequestedState_isNULL = false; if (inst.getProperty("EnabledDefault", instance.EnabledDefault) == OK) instance.EnabledDefault_isNULL = false; if (inst.getPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange) == OK) instance.TimeOfLastStateChange_isNULL = false; if (inst.getProperty("AvailableRequestedStates", instance.AvailableRequestedStates) == OK) instance.AvailableRequestedStates_isNULL = false; if (inst.getProperty("TransitioningToState", instance.TransitioningToState) == OK) instance.TransitioningToState_isNULL = false; if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("LoadPercentage", instance.LoadPercentage) == OK) instance.LoadPercentage_isNULL = false; _L_; } void CPU_OpenDRIM_HardwareThread_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_HardwareThread_RequestStateChange_In& args) { _E_; CMPIStatus rc; CMPIData data; unsigned short RequestedState; data = in->ft->getArg(in, "RequestedState", &rc); if (rc.rc == OK) { CT_ToC(data, RequestedState); args.setRequestedState(RequestedState); } Objectpath Job; data = in->ft->getArg(in, "Job", &rc); if (rc.rc == OK) { CT_ToC(broker, data, Job); args.setJob(Job); } string TimeoutPeriod; data = in->ft->getArg(in, "TimeoutPeriod", &rc); if (rc.rc == OK) { CT_ToCDatetime(data, TimeoutPeriod); args.setTimeoutPeriod(TimeoutPeriod); } _L_; } void CPU_OpenDRIM_HardwareThread_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_HardwareThread_RequestStateChange_Out& args) { _E_; CMPIValue value; int errorMessage; Objectpath Job; errorMessage = args.getJob(Job); if (errorMessage == OK) { value = CT_toCMPI(Job); out->ft->addArg(out, "Job", &value, CMPI_ref); } _L_; } opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_HardwareThread/OpenDRIM_HardwareThreadProvider.cpp0000644000175000017500000003225311400667756031436 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_HardwareThread.h" #include "OpenDRIM_HardwareThreadAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define CPU_OpenDRIM_HardwareThreadProviderSetInstance CPU_OpenDRIM_HardwareThreadProviderModifyInstance #endif int CPU_OpenDRIM_HardwareThread_init(const CMPIBroker* broker); int CPU_OpenDRIM_HardwareThread_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_HardwareThreadProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_HardwareThread_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_HardwareThreadProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_HardwareThread_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = CPU_OpenDRIM_HardwareThread_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_HardwareThreadProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_HardwareThread_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = CPU_OpenDRIM_HardwareThread_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_HardwareThreadProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_HardwareThread instance; CPU_OpenDRIM_HardwareThread_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_HardwareThread_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = CPU_OpenDRIM_HardwareThread_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_HardwareThreadProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_HardwareThread newInstance, oldInstance; CPU_OpenDRIM_HardwareThread_toCPP(_broker, ci, newInstance); CPU_OpenDRIM_HardwareThread_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = CPU_OpenDRIM_HardwareThread_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_HardwareThread_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_HardwareThreadProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_HardwareThread instance; CPU_OpenDRIM_HardwareThread_toCPP(_broker, ci, instance); string errorMessage; int errorCode = CPU_OpenDRIM_HardwareThread_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_HardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_HardwareThread_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_HardwareThread_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = CPU_OpenDRIM_HardwareThread_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_HardwareThreadProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_HardwareThread instance; CPU_OpenDRIM_HardwareThread_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_HardwareThread_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_HardwareThread_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_HardwareThreadProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Method Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_HardwareThreadProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_HardwareThread_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_HardwareThreadProviderInvokeMethod(CMPIMethodMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* methodName, const CMPIArgs* in, CMPIArgs* out) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_HardwareThread instance; CPU_OpenDRIM_HardwareThread_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"InstanceID"}; int errorCode = CPU_OpenDRIM_HardwareThread_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_HardwareThread_RequestStateChange_In inArgs; CPU_OpenDRIM_HardwareThread_toCPP(_broker, in, inArgs); OpenDRIM_HardwareThread_RequestStateChange_Out outArgs; errorCode = CPU_OpenDRIM_HardwareThread_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CPU_OpenDRIM_HardwareThread_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else { errorMessage = (string) OpenDRIM_HardwareThread_classnames[0] + ": " + "The requested method (" + (string) methodName +") was not found."; CMSetStatusWithChars(_broker, &rc, (CMPIrc) NOT_SUPPORTED, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; CMReturn(CMPI_RC_OK); } /* ---------------------------------------------------------------------------*/ /* End of Method Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int CPU_OpenDRIM_HardwareThread_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = CPU_OpenDRIM_HardwareThread_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_HardwareThread_init FAILED: " + (string) OpenDRIM_HardwareThread_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int CPU_OpenDRIM_HardwareThread_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = CPU_OpenDRIM_HardwareThread_unload(errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_HardwareThread_unload FAILED: " + (string) OpenDRIM_HardwareThread_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define CPU_OpenDRIM_HardwareThread_INIT if (CPU_OpenDRIM_HardwareThread_init(_broker) < 0) return NULL CMInstanceMIStub(CPU_OpenDRIM_HardwareThreadProvider, CPU_OpenDRIM_HardwareThreadProvider, _broker, CPU_OpenDRIM_HardwareThread_INIT); CMMethodMIStub(CPU_OpenDRIM_HardwareThreadProvider, CPU_OpenDRIM_HardwareThreadProvider, _broker, CPU_OpenDRIM_HardwareThread_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_HardwareThread/cmpiOpenDRIM_HardwareThread.h0000644000175000017500000000477511400667756030251 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_HARDWARETHREAD_H_ #define CMPIOPENDRIM_HARDWARETHREAD_H_ #include "OpenDRIM_HardwareThread.h" CMPIObjectPath* CPU_OpenDRIM_HardwareThread_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_HardwareThread& instance); CMPIInstance* CPU_OpenDRIM_HardwareThread_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_HardwareThread& instance); void CPU_OpenDRIM_HardwareThread_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_HardwareThread& instance); void CPU_OpenDRIM_HardwareThread_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_HardwareThread& instance); void CPU_OpenDRIM_HardwareThread_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_HardwareThread_RequestStateChange_In& args); void CPU_OpenDRIM_HardwareThread_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_HardwareThread_RequestStateChange_Out& args); #endif /*CMPIOPENDRIM_HARDWARETHREAD_H_*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_HardwareThread/OpenDRIM_HardwareThread.h0000644000175000017500000002734211400667756027373 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_HARDWARETHREAD_H_ #define OPENDRIM_HARDWARETHREAD_H_ #include const static char* OpenDRIM_HardwareThread_classnames[] = {"OpenDRIM_HardwareThread"}; static string OpenDRIM_HardwareThread_NAMESPACE = _NAMESPACE; class OpenDRIM_HardwareThread { public: string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string InstallDate; bool InstallDate_isNULL; string Name; bool Name_isNULL; vector OperationalStatus; bool OperationalStatus_isNULL; vector StatusDescriptions; bool StatusDescriptions_isNULL; string Status; bool Status_isNULL; unsigned short HealthState; bool HealthState_isNULL; unsigned short PrimaryStatus; bool PrimaryStatus_isNULL; unsigned short DetailedStatus; bool DetailedStatus_isNULL; unsigned short OperatingStatus; bool OperatingStatus_isNULL; unsigned short CommunicationStatus; bool CommunicationStatus_isNULL; unsigned short EnabledState; bool EnabledState_isNULL; string OtherEnabledState; bool OtherEnabledState_isNULL; unsigned short RequestedState; bool RequestedState_isNULL; unsigned short EnabledDefault; bool EnabledDefault_isNULL; string TimeOfLastStateChange; bool TimeOfLastStateChange_isNULL; vector AvailableRequestedStates; bool AvailableRequestedStates_isNULL; unsigned short TransitioningToState; bool TransitioningToState_isNULL; string InstanceID; bool InstanceID_isNULL; unsigned short LoadPercentage; bool LoadPercentage_isNULL; OpenDRIM_HardwareThread() { Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstallDate_isNULL = true; Name_isNULL = true; OperationalStatus_isNULL = true; StatusDescriptions_isNULL = true; Status_isNULL = true; HealthState_isNULL = true; PrimaryStatus_isNULL = true; DetailedStatus_isNULL = true; OperatingStatus_isNULL = true; CommunicationStatus_isNULL = true; EnabledState_isNULL = true; OtherEnabledState_isNULL = true; RequestedState_isNULL = true; EnabledDefault_isNULL = true; TimeOfLastStateChange_isNULL = true; AvailableRequestedStates_isNULL = true; TransitioningToState_isNULL = true; InstanceID_isNULL = true; LoadPercentage_isNULL = true; } ~OpenDRIM_HardwareThread() {} string getKeys() const { return CF_toLowCase(".InstanceID=\"" + CF_quoteString(InstanceID) + "\""); } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getInstallDate(string& value) const { if (InstallDate_isNULL==true) return NOT_FOUND; value = InstallDate; return OK; } int setInstallDate(const string& newValue) { InstallDate = newValue; InstallDate_isNULL = false; return OK; } int getName(string& value) const { if (Name_isNULL==true) return NOT_FOUND; value = Name; return OK; } int setName(const string& newValue) { Name = newValue; Name_isNULL = false; return OK; } int getOperationalStatus(vector& value) const { if (OperationalStatus_isNULL==true) return NOT_FOUND; value = OperationalStatus; return OK; } int setOperationalStatus(const vector& newValue) { OperationalStatus = newValue; OperationalStatus_isNULL = false; return OK; } int getStatusDescriptions(vector& value) const { if (StatusDescriptions_isNULL==true) return NOT_FOUND; value = StatusDescriptions; return OK; } int setStatusDescriptions(const vector& newValue) { StatusDescriptions = newValue; StatusDescriptions_isNULL = false; return OK; } int getStatus(string& value) const { if (Status_isNULL==true) return NOT_FOUND; value = Status; return OK; } int setStatus(const string& newValue) { Status = newValue; Status_isNULL = false; return OK; } int getHealthState(unsigned short& value) const { if (HealthState_isNULL==true) return NOT_FOUND; value = HealthState; return OK; } int setHealthState(const unsigned short& newValue) { HealthState = newValue; HealthState_isNULL = false; return OK; } int getPrimaryStatus(unsigned short& value) const { if (PrimaryStatus_isNULL==true) return NOT_FOUND; value = PrimaryStatus; return OK; } int setPrimaryStatus(const unsigned short& newValue) { PrimaryStatus = newValue; PrimaryStatus_isNULL = false; return OK; } int getDetailedStatus(unsigned short& value) const { if (DetailedStatus_isNULL==true) return NOT_FOUND; value = DetailedStatus; return OK; } int setDetailedStatus(const unsigned short& newValue) { DetailedStatus = newValue; DetailedStatus_isNULL = false; return OK; } int getOperatingStatus(unsigned short& value) const { if (OperatingStatus_isNULL==true) return NOT_FOUND; value = OperatingStatus; return OK; } int setOperatingStatus(const unsigned short& newValue) { OperatingStatus = newValue; OperatingStatus_isNULL = false; return OK; } int getCommunicationStatus(unsigned short& value) const { if (CommunicationStatus_isNULL==true) return NOT_FOUND; value = CommunicationStatus; return OK; } int setCommunicationStatus(const unsigned short& newValue) { CommunicationStatus = newValue; CommunicationStatus_isNULL = false; return OK; } int getEnabledState(unsigned short& value) const { if (EnabledState_isNULL==true) return NOT_FOUND; value = EnabledState; return OK; } int setEnabledState(const unsigned short& newValue) { EnabledState = newValue; EnabledState_isNULL = false; return OK; } int getOtherEnabledState(string& value) const { if (OtherEnabledState_isNULL==true) return NOT_FOUND; value = OtherEnabledState; return OK; } int setOtherEnabledState(const string& newValue) { OtherEnabledState = newValue; OtherEnabledState_isNULL = false; return OK; } int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL==true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getEnabledDefault(unsigned short& value) const { if (EnabledDefault_isNULL==true) return NOT_FOUND; value = EnabledDefault; return OK; } int setEnabledDefault(const unsigned short& newValue) { EnabledDefault = newValue; EnabledDefault_isNULL = false; return OK; } int getTimeOfLastStateChange(string& value) const { if (TimeOfLastStateChange_isNULL==true) return NOT_FOUND; value = TimeOfLastStateChange; return OK; } int setTimeOfLastStateChange(const string& newValue) { TimeOfLastStateChange = newValue; TimeOfLastStateChange_isNULL = false; return OK; } int getAvailableRequestedStates(vector& value) const { if (AvailableRequestedStates_isNULL==true) return NOT_FOUND; value = AvailableRequestedStates; return OK; } int setAvailableRequestedStates(const vector& newValue) { AvailableRequestedStates = newValue; AvailableRequestedStates_isNULL = false; return OK; } int getTransitioningToState(unsigned short& value) const { if (TransitioningToState_isNULL==true) return NOT_FOUND; value = TransitioningToState; return OK; } int setTransitioningToState(const unsigned short& newValue) { TransitioningToState = newValue; TransitioningToState_isNULL = false; return OK; } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getLoadPercentage(unsigned short& value) const { if (LoadPercentage_isNULL==true) return NOT_FOUND; value = LoadPercentage; return OK; } int setLoadPercentage(const unsigned short& newValue) { LoadPercentage = newValue; LoadPercentage_isNULL = false; return OK; } }; class OpenDRIM_HardwareThread_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_HardwareThread_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_HardwareThread_RequestStateChange_In() {} int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL == true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getJob(Objectpath& value) const { if (Job_isNULL == true) return NOT_FOUND; value = Job; return OK; } int setJob(const Objectpath& newValue) { Job = newValue; Job_isNULL = false; return OK; } int getTimeoutPeriod(string& value) const { if (TimeoutPeriod_isNULL == true) return NOT_FOUND; value = TimeoutPeriod; return OK; } int setTimeoutPeriod(const string& newValue) { TimeoutPeriod = newValue; TimeoutPeriod_isNULL = false; return OK; } }; class OpenDRIM_HardwareThread_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_HardwareThread_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_HardwareThread_RequestStateChange_Out() {} int getJob(Objectpath& value) const { if (Job_isNULL == true) return NOT_FOUND; value = Job; return OK; } int setJob(const Objectpath& newValue) { Job = newValue; Job_isNULL = false; return OK; } }; #endif /*OPENDRIM_HARDWARETHREAD_H_*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCoreHardwareThread/0000755000175000017500000000000011400667756025401 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCoreHardwareThread/OpenDRIM_ProcessorCoreHardwareThreadProvider.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCoreHardwareThread/OpenDRIM_ProcessorCoreHardwareThread0000644000175000017500000004310411400667756034361 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ProcessorCoreHardwareThread.h" #include "OpenDRIM_ProcessorCoreHardwareThreadAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define CPU_OpenDRIM_ProcessorCoreHardwareThreadProviderSetInstance CPU_OpenDRIM_ProcessorCoreHardwareThreadProviderModifyInstance #endif int CPU_OpenDRIM_ProcessorCoreHardwareThread_init(const CMPIBroker* broker); int CPU_OpenDRIM_ProcessorCoreHardwareThread_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_ProcessorCoreHardwareThreadProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorCoreHardwareThreadProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCoreHardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = CPU_OpenDRIM_ProcessorCoreHardwareThread_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorCoreHardwareThreadProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCoreHardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = CPU_OpenDRIM_ProcessorCoreHardwareThread_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorCoreHardwareThreadProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ProcessorCoreHardwareThread instance; CPU_OpenDRIM_ProcessorCoreHardwareThread_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCoreHardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = CPU_OpenDRIM_ProcessorCoreHardwareThread_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorCoreHardwareThreadProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ProcessorCoreHardwareThread newInstance, oldInstance; CPU_OpenDRIM_ProcessorCoreHardwareThread_toCPP(_broker, ci, newInstance); CPU_OpenDRIM_ProcessorCoreHardwareThread_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCoreHardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCoreHardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorCoreHardwareThreadProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ProcessorCoreHardwareThread instance; CPU_OpenDRIM_ProcessorCoreHardwareThread_toCPP(_broker, ci, instance); string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_ProcessorCoreHardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCoreHardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCoreHardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = CPU_OpenDRIM_ProcessorCoreHardwareThread_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorCoreHardwareThreadProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ProcessorCoreHardwareThread instance; CPU_OpenDRIM_ProcessorCoreHardwareThread_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCoreHardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCoreHardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorCoreHardwareThreadProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Association Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_ProcessorCoreHardwareThreadProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorCoreHardwareThreadProviderAssociatorNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCoreHardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnObjectPath(rslt, associatedInstances[i].getObjectpath().getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorCoreHardwareThreadProviderAssociators(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCoreHardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnInstance(rslt, associatedInstances[i].getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorCoreHardwareThreadProviderReferenceNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCoreHardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_referencePartComponentToGroupComponent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_referenceGroupComponentToPartComponent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCoreHardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = CPU_OpenDRIM_ProcessorCoreHardwareThread_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorCoreHardwareThreadProviderReferences(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCoreHardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_referencePartComponentToGroupComponent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_referenceGroupComponentToPartComponent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorCoreHardwareThread_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = CPU_OpenDRIM_ProcessorCoreHardwareThread_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int CPU_OpenDRIM_ProcessorCoreHardwareThread_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_ProcessorCoreHardwareThread_init FAILED: " + (string) OpenDRIM_ProcessorCoreHardwareThread_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int CPU_OpenDRIM_ProcessorCoreHardwareThread_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_unload(errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_ProcessorCoreHardwareThread_unload FAILED: " + (string) OpenDRIM_ProcessorCoreHardwareThread_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define CPU_OpenDRIM_ProcessorCoreHardwareThread_INIT if (CPU_OpenDRIM_ProcessorCoreHardwareThread_init(_broker) < 0) return NULL CMInstanceMIStub(CPU_OpenDRIM_ProcessorCoreHardwareThreadProvider, CPU_OpenDRIM_ProcessorCoreHardwareThreadProvider, _broker, CPU_OpenDRIM_ProcessorCoreHardwareThread_INIT); CMAssociationMIStub(CPU_OpenDRIM_ProcessorCoreHardwareThreadProvider, CPU_OpenDRIM_ProcessorCoreHardwareThreadProvider, _broker, CPU_OpenDRIM_ProcessorCoreHardwareThread_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCoreHardwareThread/Makefile.am0000644000175000017500000000514111400667756027436 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiCPU_OpenDRIM_ProcessorCoreHardwareThreadProvider.la libcmpiCPU_OpenDRIM_ProcessorCoreHardwareThreadProvider_la_SOURCES = OpenDRIM_ProcessorCoreHardwareThreadAccess.cpp OpenDRIM_ProcessorCoreHardwareThreadProvider.cpp cmpiOpenDRIM_ProcessorCoreHardwareThread.cpp assocOpenDRIM_ProcessorCoreHardwareThread.cpp # May have to be adjusted for direct invocation libcmpiCPU_OpenDRIM_ProcessorCoreHardwareThreadProvider_la_CPPFLAGS = -I../CIM_ManagedElement -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiCPU_OpenDRIM_ProcessorCoreHardwareThreadProvider_la_LIBADD = ../Common/libcmpiCPU_Common.la #../CIM_ManagedElement/libcmpiCPU_CIM_ManagedElementProvider.la ../CIM_ManagedElement/libcmpiCPU_CIM_ManagedElementProvider.la libcmpiCPU_OpenDRIM_ProcessorCoreHardwareThreadProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_ProcessorCoreHardwareThread.h OpenDRIM_ProcessorCoreHardwareThread.h OpenDRIM_ProcessorCoreHardwareThreadAccess.h ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCoreHardwareThread/OpenDRIM_ProcessorCoreHardwareThreadAccess.hopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCoreHardwareThread/OpenDRIM_ProcessorCoreHardwareThread0000644000175000017500000001112111400667756034353 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PROCESSORCOREHARDWARETHREADACCESS_H_ #define OPENDRIM_PROCESSORCOREHARDWARETHREADACCESS_H_ #include "CPU_Common.h" #include "OpenDRIM_ProcessorCoreHardwareThread.h" #include "assocOpenDRIM_ProcessorCoreHardwareThread.h" int CPU_OpenDRIM_ProcessorCoreHardwareThread_load(const CMPIBroker* broker, string& errorMessage); int CPU_OpenDRIM_ProcessorCoreHardwareThread_unload(string& errorMessage); int CPU_OpenDRIM_ProcessorCoreHardwareThread_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ProcessorCoreHardwareThread_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ProcessorCoreHardwareThread& instance, const char** properties, string& errorMessage); int CPU_OpenDRIM_ProcessorCoreHardwareThread_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorCoreHardwareThread& newInstance, const OpenDRIM_ProcessorCoreHardwareThread& oldInstance, const char** properties, string& errorMessage); int CPU_OpenDRIM_ProcessorCoreHardwareThread_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorCoreHardwareThread& instance, string& errorMessage); int CPU_OpenDRIM_ProcessorCoreHardwareThread_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorCoreHardwareThread& instance, string& errorMessage); int CPU_OpenDRIM_ProcessorCoreHardwareThread_associatorPartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const char** properties, vector& GroupComponent_associatedInstances, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ProcessorCoreHardwareThread_associatorGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const char** properties, vector& PartComponent_associatedInstances, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ProcessorCoreHardwareThread_referencePartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const vector& GroupComponent_instances, vector& OpenDRIM_ProcessorCoreHardwareThread_instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ProcessorCoreHardwareThread_referenceGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const vector& PartComponent_instances, vector& OpenDRIM_ProcessorCoreHardwareThread_instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_ProcessorCoreHardwareThread_populate(OpenDRIM_ProcessorCoreHardwareThread& instance, string& errorMessage); #endif /*OPENDRIM_PROCESSORCOREHARDWARETHREADACCESS_H_*/ ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCoreHardwareThread/assocOpenDRIM_ProcessorCoreHardwareThread.hopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCoreHardwareThread/assocOpenDRIM_ProcessorCoreHardwareT0000644000175000017500000000642711400667756034415 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_PROCESSORCOREHARDWARETHREAD_H_ #define ASSOCOPENDRIM_PROCESSORCOREHARDWARETHREAD_H_ #include "OpenDRIM_ProcessorCoreHardwareThreadAccess.h" int CPU_OpenDRIM_ProcessorCoreHardwareThread_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage); int CPU_OpenDRIM_ProcessorCoreHardwareThread_associator(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties, vector& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant); int CPU_OpenDRIM_ProcessorCoreHardwareThread_enumeratePartComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int CPU_OpenDRIM_ProcessorCoreHardwareThread_getPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int CPU_OpenDRIM_ProcessorCoreHardwareThread_enumerateGroupComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int CPU_OpenDRIM_ProcessorCoreHardwareThread_getGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_PROCESSORCOREHARDWARETHREAD_H_*/ ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCoreHardwareThread/OpenDRIM_ProcessorCoreHardwareThread.hopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCoreHardwareThread/OpenDRIM_ProcessorCoreHardwareThread0000644000175000017500000000726011400667756034364 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PROCESSORCOREHARDWARETHREAD_H_ #define OPENDRIM_PROCESSORCOREHARDWARETHREAD_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_ManagedElement.h" #include "CIM_ManagedElementAccess.h" #include "cmpiCIM_ManagedElement.h" #include "CIM_ManagedElementAccess.h" */ const static char* OpenDRIM_ProcessorCoreHardwareThread_classnames[] = {"OpenDRIM_ProcessorCoreHardwareThread"}; static string OpenDRIM_ProcessorCoreHardwareThread_NAMESPACE = _NAMESPACE; const static string PartComponent_role = "PartComponent"; const static char* PartComponent_classnames[] = {"OpenDRIM_HardwareThread"}; const static string PartComponent_NAMESPACE = _NAMESPACE; const static string GroupComponent_role = "GroupComponent"; const static char* GroupComponent_classnames[] = {"OpenDRIM_ProcessorCore"}; const static string GroupComponent_NAMESPACE = _NAMESPACE; class OpenDRIM_ProcessorCoreHardwareThread { public: Objectpath GroupComponent; bool GroupComponent_isNULL; Objectpath PartComponent; bool PartComponent_isNULL; OpenDRIM_ProcessorCoreHardwareThread() { GroupComponent_isNULL = true; PartComponent_isNULL = true; } ~OpenDRIM_ProcessorCoreHardwareThread() {} string getKeys() const { return CF_toLowCase(".GroupComponent=\"" + CF_quoteString(GroupComponent.toString()) + "\""".PartComponent=\"" + CF_quoteString(PartComponent.toString()) + "\""); } int getGroupComponent(Objectpath& value) const { if (GroupComponent_isNULL==true) return NOT_FOUND; value = GroupComponent; return OK; } int setGroupComponent(const Objectpath& newValue) { GroupComponent = newValue; GroupComponent.setNamespace(GroupComponent_NAMESPACE); GroupComponent_isNULL = false; return OK; } int getPartComponent(Objectpath& value) const { if (PartComponent_isNULL==true) return NOT_FOUND; value = PartComponent; return OK; } int setPartComponent(const Objectpath& newValue) { PartComponent = newValue; PartComponent.setNamespace(PartComponent_NAMESPACE); PartComponent_isNULL = false; return OK; } }; #endif /*OPENDRIM_PROCESSORCOREHARDWARETHREAD_H_*/ ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCoreHardwareThread/OpenDRIM_ProcessorCoreHardwareThreadAccess.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCoreHardwareThread/OpenDRIM_ProcessorCoreHardwareThread0000644000175000017500000003043311400667756034362 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_ProcessorCoreHardwareThreadAccess.h" int CPU_OpenDRIM_ProcessorCoreHardwareThread_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(CPU_CIM_ManagedElement_load(broker, errorMessage)); CF_assert(CPU_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int CPU_OpenDRIM_ProcessorCoreHardwareThread_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(CPU_CIM_ManagedElement_unload(errorMessage)); CF_assert(CPU_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int CPU_OpenDRIM_ProcessorCoreHardwareThread_isAssociated(const Instance& PartComponent, const Instance& GroupComponent, bool& isAssociated, string& errorMessage) { _E_; // Determine if the association can be established or not isAssociated=false; string core_instance_id; string thread_instance_id; GroupComponent.getProperty("InstanceID", core_instance_id); PartComponent.getProperty("InstanceID", thread_instance_id); // processor core InstanceID must contain 2 numerical values seperated by ':' vector core_instance_id_elements; CF_splitText(core_instance_id_elements, core_instance_id, ':'); if (core_instance_id_elements.size() != 2) return OK; if (!CF_isNumber(core_instance_id_elements[0]) || !CF_isNumber(core_instance_id_elements[1])) return OK; unsigned int first_core_instance_id_element = atoll(core_instance_id_elements[0].c_str()); unsigned int second_core_instance_id_element = atoll(core_instance_id_elements[1].c_str()); // hardware thread InstanceID must contain 3 numerical values seperated by ':' vector thread_instance_id_elements; CF_splitText(thread_instance_id_elements, thread_instance_id, ':'); if (thread_instance_id_elements.size() != 3) return OK; if (!CF_isNumber(thread_instance_id_elements[0]) || !CF_isNumber(thread_instance_id_elements[1]) || !CF_isNumber(thread_instance_id_elements[2])) return OK; unsigned int first_thread_instance_id_element = atoll(thread_instance_id_elements[0].c_str()); unsigned int second_thread_instance_id_element = atoll(thread_instance_id_elements[1].c_str()); // the first element and the second element of the thread InstanceID must match the core InstanceID if (first_thread_instance_id_element == first_core_instance_id_element && second_thread_instance_id_element == second_core_instance_id_element) isAssociated = true; _L_; return OK; } int CPU_OpenDRIM_ProcessorCoreHardwareThread_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector subjects; // Only get the instance names CF_assert(CPU_OpenDRIM_ProcessorCoreHardwareThread_enumeratePartComponents(broker, ctx, subjects, NULL, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(CPU_OpenDRIM_ProcessorCoreHardwareThread_enumeratePartComponents(broker, ctx, subjects, NULL, false, errorMessage)); vector::iterator c = subjects.begin(); vector::iterator end = subjects.end(); for (; c != end; ++c) { bool leftToRight = true; vector associatedInstances; CPU_OpenDRIM_ProcessorCoreHardwareThread_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), PartComponent_classnames[0], GroupComponent_classnames[0], PartComponent_role.c_str(), GroupComponent_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(CPU_OpenDRIM_ProcessorCoreHardwareThread_referencePartComponentToGroupComponent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int CPU_OpenDRIM_ProcessorCoreHardwareThread_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ProcessorCoreHardwareThread& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath PartComponent_objectpath; instance.getPartComponent(PartComponent_objectpath); Instance PartComponent_instance; CF_assert(CPU_OpenDRIM_ProcessorCoreHardwareThread_getPartComponent(broker, ctx, PartComponent_objectpath, PartComponent_instance, NULL, errorMessage)); Objectpath GroupComponent_objectpath; instance.getGroupComponent(GroupComponent_objectpath); Instance GroupComponent_instance; CF_assert(CPU_OpenDRIM_ProcessorCoreHardwareThread_getGroupComponent(broker, ctx, GroupComponent_objectpath, GroupComponent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(CPU_OpenDRIM_ProcessorCoreHardwareThread_isAssociated(PartComponent_instance, GroupComponent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int CPU_OpenDRIM_ProcessorCoreHardwareThread_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorCoreHardwareThread& newInstance, const OpenDRIM_ProcessorCoreHardwareThread& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_ProcessorCoreHardwareThread_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorCoreHardwareThread& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_ProcessorCoreHardwareThread_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorCoreHardwareThread& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_ProcessorCoreHardwareThread_associatorPartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const char** properties, vector& GroupComponent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector GroupComponent_instances; if (discriminant=="a") CF_assert(CPU_OpenDRIM_ProcessorCoreHardwareThread_enumerateGroupComponents(broker, ctx, GroupComponent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(CPU_OpenDRIM_ProcessorCoreHardwareThread_enumerateGroupComponents(broker, ctx, GroupComponent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(CPU_OpenDRIM_ProcessorCoreHardwareThread_enumerateGroupComponents(broker, ctx, GroupComponent_instances, properties, false, errorMessage)); } for (size_t i=0; i& PartComponent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector PartComponent_instances; if (discriminant=="a") CF_assert(CPU_OpenDRIM_ProcessorCoreHardwareThread_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(CPU_OpenDRIM_ProcessorCoreHardwareThread_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(CPU_OpenDRIM_ProcessorCoreHardwareThread_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, false, errorMessage)); } for (size_t i=0; i& GroupComponent_instances, vector& OpenDRIM_ProcessorCoreHardwareThread_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < GroupComponent_instances.size(); i++) { OpenDRIM_ProcessorCoreHardwareThread instance; instance.setPartComponent(((Instance) PartComponent_instance).getObjectpath()); instance.setGroupComponent(((Instance) GroupComponent_instances[i]).getObjectpath()); OpenDRIM_ProcessorCoreHardwareThread_instances.push_back(instance); } _L_; return OK; } int CPU_OpenDRIM_ProcessorCoreHardwareThread_referenceGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const vector& PartComponent_instances, vector& OpenDRIM_ProcessorCoreHardwareThread_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < PartComponent_instances.size(); i++) { OpenDRIM_ProcessorCoreHardwareThread instance; instance.setPartComponent(((Instance) PartComponent_instances[i]).getObjectpath()); instance.setGroupComponent(((Instance) GroupComponent_instance).getObjectpath()); OpenDRIM_ProcessorCoreHardwareThread_instances.push_back(instance); } _L_; return OK; } int CPU_OpenDRIM_ProcessorCoreHardwareThread_populate(OpenDRIM_ProcessorCoreHardwareThread& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCoreHardwareThread/cmpiOpenDRIM_ProcessorCoreHardwareThread.hopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCoreHardwareThread/cmpiOpenDRIM_ProcessorCoreHardwareTh0000644000175000017500000000457311400667756034405 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_PROCESSORCOREHARDWARETHREAD_H_ #define CMPIOPENDRIM_PROCESSORCOREHARDWARETHREAD_H_ #include "OpenDRIM_ProcessorCoreHardwareThread.h" CMPIObjectPath* CPU_OpenDRIM_ProcessorCoreHardwareThread_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ProcessorCoreHardwareThread& instance); CMPIInstance* CPU_OpenDRIM_ProcessorCoreHardwareThread_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ProcessorCoreHardwareThread& instance); void CPU_OpenDRIM_ProcessorCoreHardwareThread_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ProcessorCoreHardwareThread& instance); void CPU_OpenDRIM_ProcessorCoreHardwareThread_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ProcessorCoreHardwareThread& instance); #endif /*CMPIOPENDRIM_PROCESSORCOREHARDWARETHREAD_H_*/ ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCoreHardwareThread/cmpiOpenDRIM_ProcessorCoreHardwareThread.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCoreHardwareThread/cmpiOpenDRIM_ProcessorCoreHardwareTh0000644000175000017500000000642111400667756034377 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ProcessorCoreHardwareThread.h" CMPIObjectPath* CPU_OpenDRIM_ProcessorCoreHardwareThread_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ProcessorCoreHardwareThread& instance) { _E_; Objectpath op(broker, OpenDRIM_ProcessorCoreHardwareThread_classnames[0], OpenDRIM_ProcessorCoreHardwareThread_NAMESPACE); if (!instance.GroupComponent_isNULL) op.addKey("GroupComponent", instance.GroupComponent); if (!instance.PartComponent_isNULL) op.addKey("PartComponent", instance.PartComponent); _L_; return op.getHdl(); } CMPIInstance* CPU_OpenDRIM_ProcessorCoreHardwareThread_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ProcessorCoreHardwareThread& instance) { _E_; Objectpath op(broker, CPU_OpenDRIM_ProcessorCoreHardwareThread_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void CPU_OpenDRIM_ProcessorCoreHardwareThread_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ProcessorCoreHardwareThread& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("PartComponent", instance.PartComponent) == OK) instance.PartComponent_isNULL = false; if (op.getKey("GroupComponent", instance.GroupComponent) == OK) instance.GroupComponent_isNULL = false; _L_; } void CPU_OpenDRIM_ProcessorCoreHardwareThread_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ProcessorCoreHardwareThread& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("GroupComponent", instance.GroupComponent) == OK) instance.GroupComponent_isNULL = false; if (inst.getProperty("PartComponent", instance.PartComponent) == OK) instance.PartComponent_isNULL = false; _L_; } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCoreHardwareThread/assocOpenDRIM_ProcessorCoreHardwareThread.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_ProcessorCoreHardwareThread/assocOpenDRIM_ProcessorCoreHardwareT0000644000175000017500000002135311400667756034410 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_ProcessorCoreHardwareThread.h" int CPU_OpenDRIM_ProcessorCoreHardwareThread_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage) { _E_; string _assocClass, _resultClass, _resultRole, _role; assocClass == NULL ? _assocClass = "null" : _assocClass = assocClass; resultClass == NULL ? _resultClass = "null" : _resultClass = resultClass; resultRole == NULL ? _resultRole = "null" : _resultRole = resultRole; role == NULL ? _role = "null" : _role = role; for (unsigned int i=0; i& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant) { _E_; int errorCode = CPU_OpenDRIM_ProcessorCoreHardwareThread_associatorFilter(broker, ctx, cop, knownInstance, assocClass, resultClass, role, resultRole, leftToRight, errorMessage); if (errorCode == -1) return OK; if (errorCode != OK) return errorCode; if (leftToRight) { if (role != NULL && strcasecmp(role, "PartComponent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "GroupComponent") != 0) return OK; CF_assert(CPU_OpenDRIM_ProcessorCoreHardwareThread_associatorPartComponentToGroupComponent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "GroupComponent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "PartComponent") != 0) return OK; CF_assert(CPU_OpenDRIM_ProcessorCoreHardwareThread_associatorGroupComponentToPartComponent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int CPU_OpenDRIM_ProcessorCoreHardwareThread_enumeratePartComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, PartComponent_NAMESPACE, PartComponent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(CPU_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(CPU_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, CPU_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int CPU_OpenDRIM_ProcessorCoreHardwareThread_getPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), PartComponent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), PartComponent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_ManagedElement _instance; CPU_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(CPU_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, CPU_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int CPU_OpenDRIM_ProcessorCoreHardwareThread_enumerateGroupComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, GroupComponent_NAMESPACE, GroupComponent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(CPU_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(CPU_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, CPU_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int CPU_OpenDRIM_ProcessorCoreHardwareThread_getGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), GroupComponent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), GroupComponent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_ManagedElement _instance; CPU_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(CPU_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, CPU_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-cpu-1.1.0~ppa/mof/0000755000175000017500000000000011400667756017127 5ustar guillaumeguillaumeopendrim-lmp-cpu-1.1.0~ppa/mof/OpenDRIM_ProcessorProcessorCore.mof0000644000175000017500000000340311400667756025757 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), CPU provider package // Copyright (C) 2007 Frederic Desmons, ETRI // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // 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; version 2 // of the License. // // 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, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Rakhimov Rustam, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Association, Aggregation(true), Provider("cmpi:cmpiCPU_OpenDRIM_ProcessorProcessorCoreProvider")] class OpenDRIM_ProcessorProcessorCore:CIM_ConcreteComponent { }; opendrim-lmp-cpu-1.1.0~ppa/mof/OpenDRIM_AssociatedProcessorCoreCacheMemory.mof0000644000175000017500000000341311400667756030175 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), CPU provider package // Copyright (C) 2007 Frederic Desmons, ETRI // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // 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; version 2 // of the License. // // 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, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Rakhimov Rustam, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Association, Provider("cmpi:cmpiCPU_OpenDRIM_AssociatedProcessorCoreCacheMemoryProvider")] class OpenDRIM_AssociatedProcessorCoreCacheMemory:CIM_AssociatedCacheMemory { }; opendrim-lmp-cpu-1.1.0~ppa/mof/OpenDRIM_Processor.mof0000644000175000017500000000327711400667756023257 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), CPU provider package // Copyright (C) 2007 Frederic Desmons, ETRI // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // 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; version 2 // of the License. // // 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, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Rakhimov Rustam, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Provider("cmpi:cmpiCPU_OpenDRIM_ProcessorProvider")] class OpenDRIM_Processor:CIM_Processor { }; opendrim-lmp-cpu-1.1.0~ppa/mof/OpenDRIM_AssociatedProcessorCacheMemory.mof0000644000175000017500000000340311400667756027363 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), CPU provider package // Copyright (C) 2007 Frederic Desmons, ETRI // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // 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; version 2 // of the License. // // 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, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Rakhimov Rustam, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Association, Provider("cmpi:cmpiCPU_OpenDRIM_AssociatedProcessorCacheMemoryProvider")] class OpenDRIM_AssociatedProcessorCacheMemory:CIM_AssociatedCacheMemory { }; opendrim-lmp-cpu-1.1.0~ppa/mof/OpenDRIM_ComputerSystemProcessor.mof0000644000175000017500000000340011400667756026167 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), CPU provider package // Copyright (C) 2007 Frederic Desmons, ETRI // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // 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; version 2 // of the License. // // 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, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Rakhimov Rustam, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Association, Aggregation(true), Provider("cmpi:cmpiCPU_OpenDRIM_ComputerSystemProcessorProvider")] class OpenDRIM_ComputerSystemProcessor:CIM_SystemDevice { }; opendrim-lmp-cpu-1.1.0~ppa/mof/OpenDRIM_ProcessorCoreHardwareThread.mof0000644000175000017500000000341511400667756026670 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), CPU provider package // Copyright (C) 2007 Frederic Desmons, ETRI // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // 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; version 2 // of the License. // // 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, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Rakhimov Rustam, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Association, Aggregation(true), Provider("cmpi:cmpiCPU_OpenDRIM_ProcessorCoreHardwareThreadProvider")] class OpenDRIM_ProcessorCoreHardwareThread:CIM_ConcreteComponent { }; opendrim-lmp-cpu-1.1.0~ppa/mof/OpenDRIM_HardwareThread.mof0000644000175000017500000000331611400667756024157 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), CPU provider package // Copyright (C) 2007 Frederic Desmons, ETRI // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // 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; version 2 // of the License. // // 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, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Rakhimov Rustam, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Provider("cmpi:cmpiCPU_OpenDRIM_HardwareThreadProvider")] class OpenDRIM_HardwareThread:CIM_HardwareThread { }; opendrim-lmp-cpu-1.1.0~ppa/mof/OpenDRIM_RegisteredCPUProfile.mof0000644000175000017500000000333511400667756025261 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), CPU provider package // Copyright (C) 2007 Frederic Desmons, ETRI // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // 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; version 2 // of the License. // // 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, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Rakhimov Rustam, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Provider("cmpi:cmpiCPU_OpenDRIM_RegisteredCPUProfileProvider")] class OpenDRIM_RegisteredCPUProfile:CIM_RegisteredProfile { }; opendrim-lmp-cpu-1.1.0~ppa/mof/OpenDRIM_ProcessorCore.mof0000644000175000017500000000340011400667756024054 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), CPU provider package // Copyright (C) 2007 Frederic Desmons, ETRI // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // 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; version 2 // of the License. // // 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, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Rakhimov Rustam, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Provider("cmpi:cmpiCPU_OpenDRIM_ProcessorCoreProvider")] class OpenDRIM_ProcessorCore:CIM_ProcessorCore { uint32 MaxClockSpeed; uint32 CurrentClockSpeed; }; opendrim-lmp-cpu-1.1.0~ppa/mof/OpenDRIM_ProcessorConformsToProfile.mof0000644000175000017500000000337611400667756026612 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), CPU provider package // Copyright (C) 2007 Frederic Desmons, ETRI // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // 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; version 2 // of the License. // // 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, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Rakhimov Rustam, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Association, Provider("cmpi:cmpiCPU_OpenDRIM_ProcessorConformsToProfileProvider")] class OpenDRIM_ProcessorConformsToProfile:CIM_ElementConformsToProfile { }; opendrim-lmp-cpu-1.1.0~ppa/mof/OpenDRIM_CacheMemory.mof0000644000175000017500000000330011400667756023457 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), CPU provider package // Copyright (C) 2007 Frederic Desmons, ETRI // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // 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; version 2 // of the License. // // 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, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Rakhimov Rustam, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Provider("cmpi:cmpiCPU_OpenDRIM_CacheMemoryProvider")] class OpenDRIM_CacheMemory:CIM_Memory { }; opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_Processor/0000755000175000017500000000000011400667756021762 5ustar guillaumeguillaumeopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_Processor/OpenDRIM_ProcessorProvider.cpp0000644000175000017500000004115311400667756027621 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_Processor.h" #include "OpenDRIM_ProcessorAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define CPU_OpenDRIM_ProcessorProviderSetInstance CPU_OpenDRIM_ProcessorProviderModifyInstance #endif int CPU_OpenDRIM_Processor_init(const CMPIBroker* broker); int CPU_OpenDRIM_Processor_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_ProcessorProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_Processor_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_Processor_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = CPU_OpenDRIM_Processor_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_Processor_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = CPU_OpenDRIM_Processor_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_Processor instance; CPU_OpenDRIM_Processor_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_Processor_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = CPU_OpenDRIM_Processor_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_Processor newInstance, oldInstance; CPU_OpenDRIM_Processor_toCPP(_broker, ci, newInstance); CPU_OpenDRIM_Processor_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = CPU_OpenDRIM_Processor_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_Processor_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_Processor instance; CPU_OpenDRIM_Processor_toCPP(_broker, ci, instance); string errorMessage; int errorCode = CPU_OpenDRIM_Processor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_Processor_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_Processor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = CPU_OpenDRIM_Processor_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_Processor instance; CPU_OpenDRIM_Processor_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_Processor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_Processor_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Method Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_ProcessorProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_Processor_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_ProcessorProviderInvokeMethod(CMPIMethodMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* methodName, const CMPIArgs* in, CMPIArgs* out) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_Processor instance; CPU_OpenDRIM_Processor_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"DeviceID", "SystemCreationClassName", "SystemName", "CreationClassName"}; int errorCode = CPU_OpenDRIM_Processor_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_Processor_RequestStateChange_In inArgs; CPU_OpenDRIM_Processor_toCPP(_broker, in, inArgs); OpenDRIM_Processor_RequestStateChange_Out outArgs; errorCode = CPU_OpenDRIM_Processor_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CPU_OpenDRIM_Processor_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SetPowerState") { unsigned int returnValue; OpenDRIM_Processor_SetPowerState_In inArgs; CPU_OpenDRIM_Processor_toCPP(_broker, in, inArgs); errorCode = CPU_OpenDRIM_Processor_SetPowerState(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="Reset") { unsigned int returnValue; errorCode = CPU_OpenDRIM_Processor_Reset(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="EnableDevice") { unsigned int returnValue; OpenDRIM_Processor_EnableDevice_In inArgs; CPU_OpenDRIM_Processor_toCPP(_broker, in, inArgs); errorCode = CPU_OpenDRIM_Processor_EnableDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="OnlineDevice") { unsigned int returnValue; OpenDRIM_Processor_OnlineDevice_In inArgs; CPU_OpenDRIM_Processor_toCPP(_broker, in, inArgs); errorCode = CPU_OpenDRIM_Processor_OnlineDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="QuiesceDevice") { unsigned int returnValue; OpenDRIM_Processor_QuiesceDevice_In inArgs; CPU_OpenDRIM_Processor_toCPP(_broker, in, inArgs); errorCode = CPU_OpenDRIM_Processor_QuiesceDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SaveProperties") { unsigned int returnValue; errorCode = CPU_OpenDRIM_Processor_SaveProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="RestoreProperties") { unsigned int returnValue; errorCode = CPU_OpenDRIM_Processor_RestoreProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else { errorMessage = (string) OpenDRIM_Processor_classnames[0] + ": " + "The requested method (" + (string) methodName +") was not found."; CMSetStatusWithChars(_broker, &rc, (CMPIrc) NOT_SUPPORTED, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; CMReturn(CMPI_RC_OK); } /* ---------------------------------------------------------------------------*/ /* End of Method Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int CPU_OpenDRIM_Processor_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = CPU_OpenDRIM_Processor_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_Processor_init FAILED: " + (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int CPU_OpenDRIM_Processor_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = CPU_OpenDRIM_Processor_unload(errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_Processor_unload FAILED: " + (string) OpenDRIM_Processor_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define CPU_OpenDRIM_Processor_INIT if (CPU_OpenDRIM_Processor_init(_broker) < 0) return NULL CMInstanceMIStub(CPU_OpenDRIM_ProcessorProvider, CPU_OpenDRIM_ProcessorProvider, _broker, CPU_OpenDRIM_Processor_INIT); CMMethodMIStub(CPU_OpenDRIM_ProcessorProvider, CPU_OpenDRIM_ProcessorProvider, _broker, CPU_OpenDRIM_Processor_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_Processor/Makefile.am0000644000175000017500000000402611400667756024020 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiCPU_OpenDRIM_ProcessorProvider.la libcmpiCPU_OpenDRIM_ProcessorProvider_la_SOURCES = OpenDRIM_ProcessorAccess.cpp OpenDRIM_ProcessorProvider.cpp cmpiOpenDRIM_Processor.cpp libcmpiCPU_OpenDRIM_ProcessorProvider_la_LIBADD = ../Common/libcmpiCPU_Common.la libcmpiCPU_OpenDRIM_ProcessorProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_Processor.h OpenDRIM_Processor.h OpenDRIM_ProcessorAccess.h opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_Processor/OpenDRIM_ProcessorAccess.h0000644000175000017500000001121711400667756026673 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PROCESSORACCESS_H_ #define OPENDRIM_PROCESSORACCESS_H_ #include "CPU_Common.h" #include #include "OpenDRIM_Processor.h" int CPU_OpenDRIM_Processor_load(const CMPIBroker* broker, string& errorMessage); int CPU_OpenDRIM_Processor_unload(string& errorMessage); int CPU_OpenDRIM_Processor_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_Processor_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_Processor& instance, const char** properties, string& errorMessage); int CPU_OpenDRIM_Processor_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& newInstance, const OpenDRIM_Processor& oldInstance, const char** properties, string& errorMessage); int CPU_OpenDRIM_Processor_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& instance, string& errorMessage); int CPU_OpenDRIM_Processor_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& instance, string& errorMessage); int CPU_OpenDRIM_Processor_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& instance, unsigned int& returnValue, const OpenDRIM_Processor_RequestStateChange_In& in, OpenDRIM_Processor_RequestStateChange_Out& out, string& errorMessage); int CPU_OpenDRIM_Processor_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& instance, unsigned int& returnValue, const OpenDRIM_Processor_SetPowerState_In& in, string& errorMessage); int CPU_OpenDRIM_Processor_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& instance, unsigned int& returnValue, string& errorMessage); int CPU_OpenDRIM_Processor_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& instance, unsigned int& returnValue, const OpenDRIM_Processor_EnableDevice_In& in, string& errorMessage); int CPU_OpenDRIM_Processor_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& instance, unsigned int& returnValue, const OpenDRIM_Processor_OnlineDevice_In& in, string& errorMessage); int CPU_OpenDRIM_Processor_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& instance, unsigned int& returnValue, const OpenDRIM_Processor_QuiesceDevice_In& in, string& errorMessage); int CPU_OpenDRIM_Processor_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& instance, unsigned int& returnValue, string& errorMessage); int CPU_OpenDRIM_Processor_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& instance, unsigned int& returnValue, string& errorMessage); int CPU_OpenDRIM_Processor_populate(OpenDRIM_Processor& instance, const _processor_topology& cpu_info_processor_information, const _processor_information& SMBIOS_processor_information, bool use_SMBIOS, string& errorMessage); #endif /*OPENDRIM_PROCESSORACCESS_H_*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_Processor/cmpiOpenDRIM_Processor.cpp0000644000175000017500000004103411400667756026755 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_Processor.h" CMPIObjectPath* CPU_OpenDRIM_Processor_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_Processor& instance) { _E_; Objectpath op(broker, OpenDRIM_Processor_classnames[0], OpenDRIM_Processor_NAMESPACE); if (!instance.SystemCreationClassName_isNULL) op.addKey("SystemCreationClassName", instance.SystemCreationClassName); if (!instance.SystemName_isNULL) op.addKey("SystemName", instance.SystemName); if (!instance.CreationClassName_isNULL) op.addKey("CreationClassName", instance.CreationClassName); if (!instance.DeviceID_isNULL) op.addKey("DeviceID", instance.DeviceID); _L_; return op.getHdl(); } CMPIInstance* CPU_OpenDRIM_Processor_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_Processor& instance) { _E_; Objectpath op(broker, CPU_OpenDRIM_Processor_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.InstallDate_isNULL) ci.setPropertyDatetime("InstallDate", instance.InstallDate); if (!instance.Name_isNULL) ci.setProperty("Name", instance.Name); if (!instance.OperationalStatus_isNULL) ci.setProperty("OperationalStatus", instance.OperationalStatus); if (!instance.StatusDescriptions_isNULL) ci.setProperty("StatusDescriptions", instance.StatusDescriptions); if (!instance.Status_isNULL) ci.setProperty("Status", instance.Status); if (!instance.HealthState_isNULL) ci.setProperty("HealthState", instance.HealthState); if (!instance.PrimaryStatus_isNULL) ci.setProperty("PrimaryStatus", instance.PrimaryStatus); if (!instance.DetailedStatus_isNULL) ci.setProperty("DetailedStatus", instance.DetailedStatus); if (!instance.OperatingStatus_isNULL) ci.setProperty("OperatingStatus", instance.OperatingStatus); if (!instance.CommunicationStatus_isNULL) ci.setProperty("CommunicationStatus", instance.CommunicationStatus); if (!instance.EnabledState_isNULL) ci.setProperty("EnabledState", instance.EnabledState); if (!instance.OtherEnabledState_isNULL) ci.setProperty("OtherEnabledState", instance.OtherEnabledState); if (!instance.RequestedState_isNULL) ci.setProperty("RequestedState", instance.RequestedState); if (!instance.EnabledDefault_isNULL) ci.setProperty("EnabledDefault", instance.EnabledDefault); if (!instance.TimeOfLastStateChange_isNULL) ci.setPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange); if (!instance.AvailableRequestedStates_isNULL) ci.setProperty("AvailableRequestedStates", instance.AvailableRequestedStates); if (!instance.TransitioningToState_isNULL) ci.setProperty("TransitioningToState", instance.TransitioningToState); if (!instance.PowerManagementSupported_isNULL) ci.setProperty("PowerManagementSupported", instance.PowerManagementSupported); if (!instance.PowerManagementCapabilities_isNULL) ci.setProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities); if (!instance.Availability_isNULL) ci.setProperty("Availability", instance.Availability); if (!instance.StatusInfo_isNULL) ci.setProperty("StatusInfo", instance.StatusInfo); if (!instance.LastErrorCode_isNULL) ci.setProperty("LastErrorCode", instance.LastErrorCode); if (!instance.ErrorDescription_isNULL) ci.setProperty("ErrorDescription", instance.ErrorDescription); if (!instance.ErrorCleared_isNULL) ci.setProperty("ErrorCleared", instance.ErrorCleared); if (!instance.OtherIdentifyingInfo_isNULL) ci.setProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo); if (!instance.PowerOnHours_isNULL) ci.setProperty("PowerOnHours", instance.PowerOnHours); if (!instance.TotalPowerOnHours_isNULL) ci.setProperty("TotalPowerOnHours", instance.TotalPowerOnHours); if (!instance.IdentifyingDescriptions_isNULL) ci.setProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions); if (!instance.AdditionalAvailability_isNULL) ci.setProperty("AdditionalAvailability", instance.AdditionalAvailability); if (!instance.MaxQuiesceTime_isNULL) ci.setProperty("MaxQuiesceTime", instance.MaxQuiesceTime); if (!instance.LocationIndicator_isNULL) ci.setProperty("LocationIndicator", instance.LocationIndicator); if (!instance.Role_isNULL) ci.setProperty("Role", instance.Role); if (!instance.Family_isNULL) ci.setProperty("Family", instance.Family); if (!instance.OtherFamilyDescription_isNULL) ci.setProperty("OtherFamilyDescription", instance.OtherFamilyDescription); if (!instance.UpgradeMethod_isNULL) ci.setProperty("UpgradeMethod", instance.UpgradeMethod); if (!instance.MaxClockSpeed_isNULL) ci.setProperty("MaxClockSpeed", instance.MaxClockSpeed); if (!instance.CurrentClockSpeed_isNULL) ci.setProperty("CurrentClockSpeed", instance.CurrentClockSpeed); if (!instance.DataWidth_isNULL) ci.setProperty("DataWidth", instance.DataWidth); if (!instance.AddressWidth_isNULL) ci.setProperty("AddressWidth", instance.AddressWidth); if (!instance.LoadPercentage_isNULL) ci.setProperty("LoadPercentage", instance.LoadPercentage); if (!instance.Stepping_isNULL) ci.setProperty("Stepping", instance.Stepping); if (!instance.UniqueID_isNULL) ci.setProperty("UniqueID", instance.UniqueID); if (!instance.CPUStatus_isNULL) ci.setProperty("CPUStatus", instance.CPUStatus); if (!instance.ExternalBusClockSpeed_isNULL) ci.setProperty("ExternalBusClockSpeed", instance.ExternalBusClockSpeed); if (!instance.Characteristics_isNULL) ci.setProperty("Characteristics", instance.Characteristics); if (!instance.NumberOfEnabledCores_isNULL) ci.setProperty("NumberOfEnabledCores", instance.NumberOfEnabledCores); _L_; return ci.getHdl(); } void CPU_OpenDRIM_Processor_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_Processor& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (op.getKey("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (op.getKey("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (op.getKey("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; _L_; } void CPU_OpenDRIM_Processor_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_Processor& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getPropertyDatetime("InstallDate", instance.InstallDate) == OK) instance.InstallDate_isNULL = false; if (inst.getProperty("Name", instance.Name) == OK) instance.Name_isNULL = false; if (inst.getProperty("OperationalStatus", instance.OperationalStatus) == OK) instance.OperationalStatus_isNULL = false; if (inst.getProperty("StatusDescriptions", instance.StatusDescriptions) == OK) instance.StatusDescriptions_isNULL = false; if (inst.getProperty("Status", instance.Status) == OK) instance.Status_isNULL = false; if (inst.getProperty("HealthState", instance.HealthState) == OK) instance.HealthState_isNULL = false; if (inst.getProperty("PrimaryStatus", instance.PrimaryStatus) == OK) instance.PrimaryStatus_isNULL = false; if (inst.getProperty("DetailedStatus", instance.DetailedStatus) == OK) instance.DetailedStatus_isNULL = false; if (inst.getProperty("OperatingStatus", instance.OperatingStatus) == OK) instance.OperatingStatus_isNULL = false; if (inst.getProperty("CommunicationStatus", instance.CommunicationStatus) == OK) instance.CommunicationStatus_isNULL = false; if (inst.getProperty("EnabledState", instance.EnabledState) == OK) instance.EnabledState_isNULL = false; if (inst.getProperty("OtherEnabledState", instance.OtherEnabledState) == OK) instance.OtherEnabledState_isNULL = false; if (inst.getProperty("RequestedState", instance.RequestedState) == OK) instance.RequestedState_isNULL = false; if (inst.getProperty("EnabledDefault", instance.EnabledDefault) == OK) instance.EnabledDefault_isNULL = false; if (inst.getPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange) == OK) instance.TimeOfLastStateChange_isNULL = false; if (inst.getProperty("AvailableRequestedStates", instance.AvailableRequestedStates) == OK) instance.AvailableRequestedStates_isNULL = false; if (inst.getProperty("TransitioningToState", instance.TransitioningToState) == OK) instance.TransitioningToState_isNULL = false; if (inst.getProperty("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (inst.getProperty("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (inst.getProperty("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; if (inst.getProperty("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (inst.getProperty("PowerManagementSupported", instance.PowerManagementSupported) == OK) instance.PowerManagementSupported_isNULL = false; if (inst.getProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities) == OK) instance.PowerManagementCapabilities_isNULL = false; if (inst.getProperty("Availability", instance.Availability) == OK) instance.Availability_isNULL = false; if (inst.getProperty("StatusInfo", instance.StatusInfo) == OK) instance.StatusInfo_isNULL = false; if (inst.getProperty("LastErrorCode", instance.LastErrorCode) == OK) instance.LastErrorCode_isNULL = false; if (inst.getProperty("ErrorDescription", instance.ErrorDescription) == OK) instance.ErrorDescription_isNULL = false; if (inst.getProperty("ErrorCleared", instance.ErrorCleared) == OK) instance.ErrorCleared_isNULL = false; if (inst.getProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo) == OK) instance.OtherIdentifyingInfo_isNULL = false; if (inst.getProperty("PowerOnHours", instance.PowerOnHours) == OK) instance.PowerOnHours_isNULL = false; if (inst.getProperty("TotalPowerOnHours", instance.TotalPowerOnHours) == OK) instance.TotalPowerOnHours_isNULL = false; if (inst.getProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions) == OK) instance.IdentifyingDescriptions_isNULL = false; if (inst.getProperty("AdditionalAvailability", instance.AdditionalAvailability) == OK) instance.AdditionalAvailability_isNULL = false; if (inst.getProperty("MaxQuiesceTime", instance.MaxQuiesceTime) == OK) instance.MaxQuiesceTime_isNULL = false; if (inst.getProperty("LocationIndicator", instance.LocationIndicator) == OK) instance.LocationIndicator_isNULL = false; if (inst.getProperty("Role", instance.Role) == OK) instance.Role_isNULL = false; if (inst.getProperty("Family", instance.Family) == OK) instance.Family_isNULL = false; if (inst.getProperty("OtherFamilyDescription", instance.OtherFamilyDescription) == OK) instance.OtherFamilyDescription_isNULL = false; if (inst.getProperty("UpgradeMethod", instance.UpgradeMethod) == OK) instance.UpgradeMethod_isNULL = false; if (inst.getProperty("MaxClockSpeed", instance.MaxClockSpeed) == OK) instance.MaxClockSpeed_isNULL = false; if (inst.getProperty("CurrentClockSpeed", instance.CurrentClockSpeed) == OK) instance.CurrentClockSpeed_isNULL = false; if (inst.getProperty("DataWidth", instance.DataWidth) == OK) instance.DataWidth_isNULL = false; if (inst.getProperty("AddressWidth", instance.AddressWidth) == OK) instance.AddressWidth_isNULL = false; if (inst.getProperty("LoadPercentage", instance.LoadPercentage) == OK) instance.LoadPercentage_isNULL = false; if (inst.getProperty("Stepping", instance.Stepping) == OK) instance.Stepping_isNULL = false; if (inst.getProperty("UniqueID", instance.UniqueID) == OK) instance.UniqueID_isNULL = false; if (inst.getProperty("CPUStatus", instance.CPUStatus) == OK) instance.CPUStatus_isNULL = false; if (inst.getProperty("ExternalBusClockSpeed", instance.ExternalBusClockSpeed) == OK) instance.ExternalBusClockSpeed_isNULL = false; if (inst.getProperty("Characteristics", instance.Characteristics) == OK) instance.Characteristics_isNULL = false; if (inst.getProperty("NumberOfEnabledCores", instance.NumberOfEnabledCores) == OK) instance.NumberOfEnabledCores_isNULL = false; _L_; } void CPU_OpenDRIM_Processor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Processor_RequestStateChange_In& args) { _E_; CMPIStatus rc; CMPIData data; unsigned short RequestedState; data = in->ft->getArg(in, "RequestedState", &rc); if (rc.rc == OK) { CT_ToC(data, RequestedState); args.setRequestedState(RequestedState); } Objectpath Job; data = in->ft->getArg(in, "Job", &rc); if (rc.rc == OK) { CT_ToC(broker, data, Job); args.setJob(Job); } string TimeoutPeriod; data = in->ft->getArg(in, "TimeoutPeriod", &rc); if (rc.rc == OK) { CT_ToCDatetime(data, TimeoutPeriod); args.setTimeoutPeriod(TimeoutPeriod); } _L_; } void CPU_OpenDRIM_Processor_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_Processor_RequestStateChange_Out& args) { _E_; CMPIValue value; int errorMessage; Objectpath Job; errorMessage = args.getJob(Job); if (errorMessage == OK) { value = CT_toCMPI(Job); out->ft->addArg(out, "Job", &value, CMPI_ref); } _L_; } void CPU_OpenDRIM_Processor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Processor_SetPowerState_In& args) { _E_; CMPIStatus rc; CMPIData data; unsigned short PowerState; data = in->ft->getArg(in, "PowerState", &rc); if (rc.rc == OK) { CT_ToC(data, PowerState); args.setPowerState(PowerState); } string Time; data = in->ft->getArg(in, "Time", &rc); if (rc.rc == OK) { CT_ToCDatetime(data, Time); args.setTime(Time); } _L_; } void CPU_OpenDRIM_Processor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Processor_EnableDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Enabled; data = in->ft->getArg(in, "Enabled", &rc); if (rc.rc == OK) { CT_ToC(data, Enabled); args.setEnabled(Enabled); } _L_; } void CPU_OpenDRIM_Processor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Processor_OnlineDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Online; data = in->ft->getArg(in, "Online", &rc); if (rc.rc == OK) { CT_ToC(data, Online); args.setOnline(Online); } _L_; } void CPU_OpenDRIM_Processor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Processor_QuiesceDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Quiesce; data = in->ft->getArg(in, "Quiesce", &rc); if (rc.rc == OK) { CT_ToC(data, Quiesce); args.setQuiesce(Quiesce); } _L_; } opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_Processor/OpenDRIM_Processor.h0000644000175000017500000006316111400667756025556 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PROCESSOR_H_ #define OPENDRIM_PROCESSOR_H_ #include const static char* OpenDRIM_Processor_classnames[] = {"OpenDRIM_Processor"}; static string OpenDRIM_Processor_NAMESPACE = _NAMESPACE; class OpenDRIM_Processor { public: string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string InstallDate; bool InstallDate_isNULL; string Name; bool Name_isNULL; vector OperationalStatus; bool OperationalStatus_isNULL; vector StatusDescriptions; bool StatusDescriptions_isNULL; string Status; bool Status_isNULL; unsigned short HealthState; bool HealthState_isNULL; unsigned short PrimaryStatus; bool PrimaryStatus_isNULL; unsigned short DetailedStatus; bool DetailedStatus_isNULL; unsigned short OperatingStatus; bool OperatingStatus_isNULL; unsigned short CommunicationStatus; bool CommunicationStatus_isNULL; unsigned short EnabledState; bool EnabledState_isNULL; string OtherEnabledState; bool OtherEnabledState_isNULL; unsigned short RequestedState; bool RequestedState_isNULL; unsigned short EnabledDefault; bool EnabledDefault_isNULL; string TimeOfLastStateChange; bool TimeOfLastStateChange_isNULL; vector AvailableRequestedStates; bool AvailableRequestedStates_isNULL; unsigned short TransitioningToState; bool TransitioningToState_isNULL; string SystemCreationClassName; bool SystemCreationClassName_isNULL; string SystemName; bool SystemName_isNULL; string CreationClassName; bool CreationClassName_isNULL; string DeviceID; bool DeviceID_isNULL; bool PowerManagementSupported; bool PowerManagementSupported_isNULL; vector PowerManagementCapabilities; bool PowerManagementCapabilities_isNULL; unsigned short Availability; bool Availability_isNULL; unsigned short StatusInfo; bool StatusInfo_isNULL; unsigned int LastErrorCode; bool LastErrorCode_isNULL; string ErrorDescription; bool ErrorDescription_isNULL; bool ErrorCleared; bool ErrorCleared_isNULL; vector OtherIdentifyingInfo; bool OtherIdentifyingInfo_isNULL; unsigned long long PowerOnHours; bool PowerOnHours_isNULL; unsigned long long TotalPowerOnHours; bool TotalPowerOnHours_isNULL; vector IdentifyingDescriptions; bool IdentifyingDescriptions_isNULL; vector AdditionalAvailability; bool AdditionalAvailability_isNULL; unsigned long long MaxQuiesceTime; bool MaxQuiesceTime_isNULL; unsigned short LocationIndicator; bool LocationIndicator_isNULL; string Role; bool Role_isNULL; unsigned short Family; bool Family_isNULL; string OtherFamilyDescription; bool OtherFamilyDescription_isNULL; unsigned short UpgradeMethod; bool UpgradeMethod_isNULL; unsigned int MaxClockSpeed; bool MaxClockSpeed_isNULL; unsigned int CurrentClockSpeed; bool CurrentClockSpeed_isNULL; unsigned short DataWidth; bool DataWidth_isNULL; unsigned short AddressWidth; bool AddressWidth_isNULL; unsigned short LoadPercentage; bool LoadPercentage_isNULL; string Stepping; bool Stepping_isNULL; string UniqueID; bool UniqueID_isNULL; unsigned short CPUStatus; bool CPUStatus_isNULL; unsigned int ExternalBusClockSpeed; bool ExternalBusClockSpeed_isNULL; vector Characteristics; bool Characteristics_isNULL; unsigned short NumberOfEnabledCores; bool NumberOfEnabledCores_isNULL; OpenDRIM_Processor() { Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstallDate_isNULL = true; Name_isNULL = true; OperationalStatus_isNULL = true; StatusDescriptions_isNULL = true; Status_isNULL = true; HealthState_isNULL = true; PrimaryStatus_isNULL = true; DetailedStatus_isNULL = true; OperatingStatus_isNULL = true; CommunicationStatus_isNULL = true; EnabledState_isNULL = true; OtherEnabledState_isNULL = true; RequestedState_isNULL = true; EnabledDefault_isNULL = true; TimeOfLastStateChange_isNULL = true; AvailableRequestedStates_isNULL = true; TransitioningToState_isNULL = true; SystemCreationClassName_isNULL = true; SystemName_isNULL = true; CreationClassName_isNULL = true; DeviceID_isNULL = true; PowerManagementSupported_isNULL = true; PowerManagementCapabilities_isNULL = true; Availability_isNULL = true; StatusInfo_isNULL = true; LastErrorCode_isNULL = true; ErrorDescription_isNULL = true; ErrorCleared_isNULL = true; OtherIdentifyingInfo_isNULL = true; PowerOnHours_isNULL = true; TotalPowerOnHours_isNULL = true; IdentifyingDescriptions_isNULL = true; AdditionalAvailability_isNULL = true; MaxQuiesceTime_isNULL = true; LocationIndicator_isNULL = true; Role_isNULL = true; Family_isNULL = true; OtherFamilyDescription_isNULL = true; UpgradeMethod_isNULL = true; MaxClockSpeed_isNULL = true; CurrentClockSpeed_isNULL = true; DataWidth_isNULL = true; AddressWidth_isNULL = true; LoadPercentage_isNULL = true; Stepping_isNULL = true; UniqueID_isNULL = true; CPUStatus_isNULL = true; ExternalBusClockSpeed_isNULL = true; Characteristics_isNULL = true; NumberOfEnabledCores_isNULL = true; } ~OpenDRIM_Processor() {} string getKeys() const { return CF_toLowCase(".SystemCreationClassName=\"" + CF_quoteString(SystemCreationClassName) + "\""".SystemName=\"" + CF_quoteString(SystemName) + "\""".CreationClassName=\"" + CF_quoteString(CreationClassName) + "\""".DeviceID=\"" + CF_quoteString(DeviceID) + "\""); } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getInstallDate(string& value) const { if (InstallDate_isNULL==true) return NOT_FOUND; value = InstallDate; return OK; } int setInstallDate(const string& newValue) { InstallDate = newValue; InstallDate_isNULL = false; return OK; } int getName(string& value) const { if (Name_isNULL==true) return NOT_FOUND; value = Name; return OK; } int setName(const string& newValue) { Name = newValue; Name_isNULL = false; return OK; } int getOperationalStatus(vector& value) const { if (OperationalStatus_isNULL==true) return NOT_FOUND; value = OperationalStatus; return OK; } int setOperationalStatus(const vector& newValue) { OperationalStatus = newValue; OperationalStatus_isNULL = false; return OK; } int getStatusDescriptions(vector& value) const { if (StatusDescriptions_isNULL==true) return NOT_FOUND; value = StatusDescriptions; return OK; } int setStatusDescriptions(const vector& newValue) { StatusDescriptions = newValue; StatusDescriptions_isNULL = false; return OK; } int getStatus(string& value) const { if (Status_isNULL==true) return NOT_FOUND; value = Status; return OK; } int setStatus(const string& newValue) { Status = newValue; Status_isNULL = false; return OK; } int getHealthState(unsigned short& value) const { if (HealthState_isNULL==true) return NOT_FOUND; value = HealthState; return OK; } int setHealthState(const unsigned short& newValue) { HealthState = newValue; HealthState_isNULL = false; return OK; } int getPrimaryStatus(unsigned short& value) const { if (PrimaryStatus_isNULL==true) return NOT_FOUND; value = PrimaryStatus; return OK; } int setPrimaryStatus(const unsigned short& newValue) { PrimaryStatus = newValue; PrimaryStatus_isNULL = false; return OK; } int getDetailedStatus(unsigned short& value) const { if (DetailedStatus_isNULL==true) return NOT_FOUND; value = DetailedStatus; return OK; } int setDetailedStatus(const unsigned short& newValue) { DetailedStatus = newValue; DetailedStatus_isNULL = false; return OK; } int getOperatingStatus(unsigned short& value) const { if (OperatingStatus_isNULL==true) return NOT_FOUND; value = OperatingStatus; return OK; } int setOperatingStatus(const unsigned short& newValue) { OperatingStatus = newValue; OperatingStatus_isNULL = false; return OK; } int getCommunicationStatus(unsigned short& value) const { if (CommunicationStatus_isNULL==true) return NOT_FOUND; value = CommunicationStatus; return OK; } int setCommunicationStatus(const unsigned short& newValue) { CommunicationStatus = newValue; CommunicationStatus_isNULL = false; return OK; } int getEnabledState(unsigned short& value) const { if (EnabledState_isNULL==true) return NOT_FOUND; value = EnabledState; return OK; } int setEnabledState(const unsigned short& newValue) { EnabledState = newValue; EnabledState_isNULL = false; return OK; } int getOtherEnabledState(string& value) const { if (OtherEnabledState_isNULL==true) return NOT_FOUND; value = OtherEnabledState; return OK; } int setOtherEnabledState(const string& newValue) { OtherEnabledState = newValue; OtherEnabledState_isNULL = false; return OK; } int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL==true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getEnabledDefault(unsigned short& value) const { if (EnabledDefault_isNULL==true) return NOT_FOUND; value = EnabledDefault; return OK; } int setEnabledDefault(const unsigned short& newValue) { EnabledDefault = newValue; EnabledDefault_isNULL = false; return OK; } int getTimeOfLastStateChange(string& value) const { if (TimeOfLastStateChange_isNULL==true) return NOT_FOUND; value = TimeOfLastStateChange; return OK; } int setTimeOfLastStateChange(const string& newValue) { TimeOfLastStateChange = newValue; TimeOfLastStateChange_isNULL = false; return OK; } int getAvailableRequestedStates(vector& value) const { if (AvailableRequestedStates_isNULL==true) return NOT_FOUND; value = AvailableRequestedStates; return OK; } int setAvailableRequestedStates(const vector& newValue) { AvailableRequestedStates = newValue; AvailableRequestedStates_isNULL = false; return OK; } int getTransitioningToState(unsigned short& value) const { if (TransitioningToState_isNULL==true) return NOT_FOUND; value = TransitioningToState; return OK; } int setTransitioningToState(const unsigned short& newValue) { TransitioningToState = newValue; TransitioningToState_isNULL = false; return OK; } int getSystemCreationClassName(string& value) const { if (SystemCreationClassName_isNULL==true) return NOT_FOUND; value = SystemCreationClassName; return OK; } int setSystemCreationClassName(const string& newValue) { SystemCreationClassName = newValue; SystemCreationClassName_isNULL = false; return OK; } int getSystemName(string& value) const { if (SystemName_isNULL==true) return NOT_FOUND; value = SystemName; return OK; } int setSystemName(const string& newValue) { SystemName = newValue; SystemName_isNULL = false; return OK; } int getCreationClassName(string& value) const { if (CreationClassName_isNULL==true) return NOT_FOUND; value = CreationClassName; return OK; } int setCreationClassName(const string& newValue) { CreationClassName = newValue; CreationClassName_isNULL = false; return OK; } int getDeviceID(string& value) const { if (DeviceID_isNULL==true) return NOT_FOUND; value = DeviceID; return OK; } int setDeviceID(const string& newValue) { DeviceID = newValue; DeviceID_isNULL = false; return OK; } int getPowerManagementSupported(bool& value) const { if (PowerManagementSupported_isNULL==true) return NOT_FOUND; value = PowerManagementSupported; return OK; } int setPowerManagementSupported(const bool& newValue) { PowerManagementSupported = newValue; PowerManagementSupported_isNULL = false; return OK; } int getPowerManagementCapabilities(vector& value) const { if (PowerManagementCapabilities_isNULL==true) return NOT_FOUND; value = PowerManagementCapabilities; return OK; } int setPowerManagementCapabilities(const vector& newValue) { PowerManagementCapabilities = newValue; PowerManagementCapabilities_isNULL = false; return OK; } int getAvailability(unsigned short& value) const { if (Availability_isNULL==true) return NOT_FOUND; value = Availability; return OK; } int setAvailability(const unsigned short& newValue) { Availability = newValue; Availability_isNULL = false; return OK; } int getStatusInfo(unsigned short& value) const { if (StatusInfo_isNULL==true) return NOT_FOUND; value = StatusInfo; return OK; } int setStatusInfo(const unsigned short& newValue) { StatusInfo = newValue; StatusInfo_isNULL = false; return OK; } int getLastErrorCode(unsigned int& value) const { if (LastErrorCode_isNULL==true) return NOT_FOUND; value = LastErrorCode; return OK; } int setLastErrorCode(const unsigned int& newValue) { LastErrorCode = newValue; LastErrorCode_isNULL = false; return OK; } int getErrorDescription(string& value) const { if (ErrorDescription_isNULL==true) return NOT_FOUND; value = ErrorDescription; return OK; } int setErrorDescription(const string& newValue) { ErrorDescription = newValue; ErrorDescription_isNULL = false; return OK; } int getErrorCleared(bool& value) const { if (ErrorCleared_isNULL==true) return NOT_FOUND; value = ErrorCleared; return OK; } int setErrorCleared(const bool& newValue) { ErrorCleared = newValue; ErrorCleared_isNULL = false; return OK; } int getOtherIdentifyingInfo(vector& value) const { if (OtherIdentifyingInfo_isNULL==true) return NOT_FOUND; value = OtherIdentifyingInfo; return OK; } int setOtherIdentifyingInfo(const vector& newValue) { OtherIdentifyingInfo = newValue; OtherIdentifyingInfo_isNULL = false; return OK; } int getPowerOnHours(unsigned long long& value) const { if (PowerOnHours_isNULL==true) return NOT_FOUND; value = PowerOnHours; return OK; } int setPowerOnHours(const unsigned long long& newValue) { PowerOnHours = newValue; PowerOnHours_isNULL = false; return OK; } int getTotalPowerOnHours(unsigned long long& value) const { if (TotalPowerOnHours_isNULL==true) return NOT_FOUND; value = TotalPowerOnHours; return OK; } int setTotalPowerOnHours(const unsigned long long& newValue) { TotalPowerOnHours = newValue; TotalPowerOnHours_isNULL = false; return OK; } int getIdentifyingDescriptions(vector& value) const { if (IdentifyingDescriptions_isNULL==true) return NOT_FOUND; value = IdentifyingDescriptions; return OK; } int setIdentifyingDescriptions(const vector& newValue) { IdentifyingDescriptions = newValue; IdentifyingDescriptions_isNULL = false; return OK; } int getAdditionalAvailability(vector& value) const { if (AdditionalAvailability_isNULL==true) return NOT_FOUND; value = AdditionalAvailability; return OK; } int setAdditionalAvailability(const vector& newValue) { AdditionalAvailability = newValue; AdditionalAvailability_isNULL = false; return OK; } int getMaxQuiesceTime(unsigned long long& value) const { if (MaxQuiesceTime_isNULL==true) return NOT_FOUND; value = MaxQuiesceTime; return OK; } int setMaxQuiesceTime(const unsigned long long& newValue) { MaxQuiesceTime = newValue; MaxQuiesceTime_isNULL = false; return OK; } int getLocationIndicator(unsigned short& value) const { if (LocationIndicator_isNULL==true) return NOT_FOUND; value = LocationIndicator; return OK; } int setLocationIndicator(const unsigned short& newValue) { LocationIndicator = newValue; LocationIndicator_isNULL = false; return OK; } int getRole(string& value) const { if (Role_isNULL==true) return NOT_FOUND; value = Role; return OK; } int setRole(const string& newValue) { Role = newValue; Role_isNULL = false; return OK; } int getFamily(unsigned short& value) const { if (Family_isNULL==true) return NOT_FOUND; value = Family; return OK; } int setFamily(const unsigned short& newValue) { Family = newValue; Family_isNULL = false; return OK; } int getOtherFamilyDescription(string& value) const { if (OtherFamilyDescription_isNULL==true) return NOT_FOUND; value = OtherFamilyDescription; return OK; } int setOtherFamilyDescription(const string& newValue) { OtherFamilyDescription = newValue; OtherFamilyDescription_isNULL = false; return OK; } int getUpgradeMethod(unsigned short& value) const { if (UpgradeMethod_isNULL==true) return NOT_FOUND; value = UpgradeMethod; return OK; } int setUpgradeMethod(const unsigned short& newValue) { UpgradeMethod = newValue; UpgradeMethod_isNULL = false; return OK; } int getMaxClockSpeed(unsigned int& value) const { if (MaxClockSpeed_isNULL==true) return NOT_FOUND; value = MaxClockSpeed; return OK; } int setMaxClockSpeed(const unsigned int& newValue) { MaxClockSpeed = newValue; MaxClockSpeed_isNULL = false; return OK; } int getCurrentClockSpeed(unsigned int& value) const { if (CurrentClockSpeed_isNULL==true) return NOT_FOUND; value = CurrentClockSpeed; return OK; } int setCurrentClockSpeed(const unsigned int& newValue) { CurrentClockSpeed = newValue; CurrentClockSpeed_isNULL = false; return OK; } int getDataWidth(unsigned short& value) const { if (DataWidth_isNULL==true) return NOT_FOUND; value = DataWidth; return OK; } int setDataWidth(const unsigned short& newValue) { DataWidth = newValue; DataWidth_isNULL = false; return OK; } int getAddressWidth(unsigned short& value) const { if (AddressWidth_isNULL==true) return NOT_FOUND; value = AddressWidth; return OK; } int setAddressWidth(const unsigned short& newValue) { AddressWidth = newValue; AddressWidth_isNULL = false; return OK; } int getLoadPercentage(unsigned short& value) const { if (LoadPercentage_isNULL==true) return NOT_FOUND; value = LoadPercentage; return OK; } int setLoadPercentage(const unsigned short& newValue) { LoadPercentage = newValue; LoadPercentage_isNULL = false; return OK; } int getStepping(string& value) const { if (Stepping_isNULL==true) return NOT_FOUND; value = Stepping; return OK; } int setStepping(const string& newValue) { Stepping = newValue; Stepping_isNULL = false; return OK; } int getUniqueID(string& value) const { if (UniqueID_isNULL==true) return NOT_FOUND; value = UniqueID; return OK; } int setUniqueID(const string& newValue) { UniqueID = newValue; UniqueID_isNULL = false; return OK; } int getCPUStatus(unsigned short& value) const { if (CPUStatus_isNULL==true) return NOT_FOUND; value = CPUStatus; return OK; } int setCPUStatus(const unsigned short& newValue) { CPUStatus = newValue; CPUStatus_isNULL = false; return OK; } int getExternalBusClockSpeed(unsigned int& value) const { if (ExternalBusClockSpeed_isNULL==true) return NOT_FOUND; value = ExternalBusClockSpeed; return OK; } int setExternalBusClockSpeed(const unsigned int& newValue) { ExternalBusClockSpeed = newValue; ExternalBusClockSpeed_isNULL = false; return OK; } int getCharacteristics(vector& value) const { if (Characteristics_isNULL==true) return NOT_FOUND; value = Characteristics; return OK; } int setCharacteristics(const vector& newValue) { Characteristics = newValue; Characteristics_isNULL = false; return OK; } int getNumberOfEnabledCores(unsigned short& value) const { if (NumberOfEnabledCores_isNULL==true) return NOT_FOUND; value = NumberOfEnabledCores; return OK; } int setNumberOfEnabledCores(const unsigned short& newValue) { NumberOfEnabledCores = newValue; NumberOfEnabledCores_isNULL = false; return OK; } }; class OpenDRIM_Processor_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_Processor_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_Processor_RequestStateChange_In() {} int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL == true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getJob(Objectpath& value) const { if (Job_isNULL == true) return NOT_FOUND; value = Job; return OK; } int setJob(const Objectpath& newValue) { Job = newValue; Job_isNULL = false; return OK; } int getTimeoutPeriod(string& value) const { if (TimeoutPeriod_isNULL == true) return NOT_FOUND; value = TimeoutPeriod; return OK; } int setTimeoutPeriod(const string& newValue) { TimeoutPeriod = newValue; TimeoutPeriod_isNULL = false; return OK; } }; class OpenDRIM_Processor_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_Processor_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_Processor_RequestStateChange_Out() {} int getJob(Objectpath& value) const { if (Job_isNULL == true) return NOT_FOUND; value = Job; return OK; } int setJob(const Objectpath& newValue) { Job = newValue; Job_isNULL = false; return OK; } }; class OpenDRIM_Processor_SetPowerState_In { public: unsigned short PowerState; bool PowerState_isNULL; string Time; bool Time_isNULL; OpenDRIM_Processor_SetPowerState_In() { PowerState_isNULL = true; Time_isNULL = true; } ~OpenDRIM_Processor_SetPowerState_In() {} int getPowerState(unsigned short& value) const { if (PowerState_isNULL == true) return NOT_FOUND; value = PowerState; return OK; } int setPowerState(const unsigned short& newValue) { PowerState = newValue; PowerState_isNULL = false; return OK; } int getTime(string& value) const { if (Time_isNULL == true) return NOT_FOUND; value = Time; return OK; } int setTime(const string& newValue) { Time = newValue; Time_isNULL = false; return OK; } }; class OpenDRIM_Processor_EnableDevice_In { public: bool Enabled; bool Enabled_isNULL; OpenDRIM_Processor_EnableDevice_In() { Enabled_isNULL = true; } ~OpenDRIM_Processor_EnableDevice_In() {} int getEnabled(bool& value) const { if (Enabled_isNULL == true) return NOT_FOUND; value = Enabled; return OK; } int setEnabled(const bool& newValue) { Enabled = newValue; Enabled_isNULL = false; return OK; } }; class OpenDRIM_Processor_OnlineDevice_In { public: bool Online; bool Online_isNULL; OpenDRIM_Processor_OnlineDevice_In() { Online_isNULL = true; } ~OpenDRIM_Processor_OnlineDevice_In() {} int getOnline(bool& value) const { if (Online_isNULL == true) return NOT_FOUND; value = Online; return OK; } int setOnline(const bool& newValue) { Online = newValue; Online_isNULL = false; return OK; } }; class OpenDRIM_Processor_QuiesceDevice_In { public: bool Quiesce; bool Quiesce_isNULL; OpenDRIM_Processor_QuiesceDevice_In() { Quiesce_isNULL = true; } ~OpenDRIM_Processor_QuiesceDevice_In() {} int getQuiesce(bool& value) const { if (Quiesce_isNULL == true) return NOT_FOUND; value = Quiesce; return OK; } int setQuiesce(const bool& newValue) { Quiesce = newValue; Quiesce_isNULL = false; return OK; } }; #endif /*OPENDRIM_PROCESSOR_H_*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_Processor/cmpiOpenDRIM_Processor.h0000644000175000017500000000563711400667756026433 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_PROCESSOR_H_ #define CMPIOPENDRIM_PROCESSOR_H_ #include "OpenDRIM_Processor.h" CMPIObjectPath* CPU_OpenDRIM_Processor_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_Processor& instance); CMPIInstance* CPU_OpenDRIM_Processor_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_Processor& instance); void CPU_OpenDRIM_Processor_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_Processor& instance); void CPU_OpenDRIM_Processor_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_Processor& instance); void CPU_OpenDRIM_Processor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Processor_RequestStateChange_In& args); void CPU_OpenDRIM_Processor_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_Processor_RequestStateChange_Out& args); void CPU_OpenDRIM_Processor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Processor_SetPowerState_In& args); void CPU_OpenDRIM_Processor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Processor_EnableDevice_In& args); void CPU_OpenDRIM_Processor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Processor_OnlineDevice_In& args); void CPU_OpenDRIM_Processor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Processor_QuiesceDevice_In& args); #endif /*CMPIOPENDRIM_PROCESSOR_H_*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_Processor/OpenDRIM_ProcessorAccess.cpp0000644000175000017500000003175511400667756027237 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_ProcessorAccess.h" string _SystemName; vector<_processor_topology> _previous_cpu_info_processors_information; int CPU_OpenDRIM_Processor_load(const CMPIBroker* broker, string& errorMessage) { _E_; CF_assert(CPU_getProcessors("/proc/cpuinfo", _previous_cpu_info_processors_information, errorMessage)); CF_assert(CPU_getLoadAverages(_previous_cpu_info_processors_information, _previous_cpu_info_processors_information, errorMessage)); CF_assert(CF_getSystemName(_SystemName, errorMessage)); /* int errorCode=CF_getMachineIP(_SystemName, errorMessage); if (errorCode!=OK) return errorCode; */ _L_; return OK; } int CPU_OpenDRIM_Processor_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int CPU_OpenDRIM_Processor_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; // get info from SMBIOS vector<_processor_information> SMBIOS_processors_information; int errorCode = SMBIOS_getProcessorsInformation(SMBIOS_processors_information, errorMessage); // if we cannot get info from SMBIOS, we'll just use info from cpuinfo bool use_SMBIOS = false; if (errorCode == OK) use_SMBIOS = true; // get info from cpuinfo vector<_processor_topology> cpu_info_processors_information; CF_assert(CPU_getProcessors("/proc/cpuinfo", cpu_info_processors_information, errorMessage)); CF_assert(CPU_getLoadAverages(cpu_info_processors_information, _previous_cpu_info_processors_information, errorMessage)); _previous_cpu_info_processors_information = cpu_info_processors_information; // different processors count... if (cpu_info_processors_information.size() != SMBIOS_processors_information.size()) use_SMBIOS = false; for (unsigned int i = 0; i < cpu_info_processors_information.size(); i++) { OpenDRIM_Processor instance; instance.setSystemName(_SystemName); instance.setSystemCreationClassName("OpenDRIM_ComputerSystem"); instance.setCreationClassName("OpenDRIM_Processor"); instance.setDeviceID(CF_intToStr(i)); if (discriminant == "ei") { _processor_information SMBIOS_processor_information; if (use_SMBIOS) SMBIOS_processor_information = SMBIOS_processors_information[i]; CF_assert(CPU_OpenDRIM_Processor_populate(instance, cpu_info_processors_information[i], SMBIOS_processor_information, use_SMBIOS, errorMessage)); } result.push_back(instance); } _L_; return OK; } int CPU_OpenDRIM_Processor_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_Processor& instance, const char** properties, string& errorMessage) { _E_; string SystemName, SystemCreationClassName, CreationClassName, DeviceID; instance.getSystemName(SystemName); instance.getSystemCreationClassName(SystemCreationClassName); instance.getCreationClassName(CreationClassName); instance.getDeviceID(DeviceID); if (!CF_strCmpNoCase(SystemName, _SystemName) || !CF_strCmpNoCase(SystemCreationClassName, "OpenDRIM_ComputerSystem") || !CF_strCmpNoCase(CreationClassName, "OpenDRIM_Processor")) return NOT_FOUND; if (!CF_isNumber(DeviceID)) return NOT_FOUND; // get info from cpuinfo vector<_processor_topology> cpu_info_processors_information; CF_assert(CPU_getProcessors("/proc/cpuinfo", cpu_info_processors_information, errorMessage)); CF_assert(CPU_getLoadAverages(cpu_info_processors_information, _previous_cpu_info_processors_information, errorMessage)); _previous_cpu_info_processors_information = cpu_info_processors_information; unsigned int _DeviceID = atoll(DeviceID.c_str()); if (_DeviceID >= cpu_info_processors_information.size()) return NOT_FOUND; // get info from SMBIOS vector<_processor_information> SMBIOS_processors_information; int errorCode = SMBIOS_getProcessorsInformation(SMBIOS_processors_information, errorMessage); // if we cannot get info from SMBIOS, we'll just use info from cpuinfo bool use_SMBIOS = false; if (errorCode == OK) use_SMBIOS = true; // different processors count... if (cpu_info_processors_information.size() != SMBIOS_processors_information.size()) use_SMBIOS = false; _processor_information SMBIOS_processor_information; if (use_SMBIOS) SMBIOS_processor_information = SMBIOS_processors_information[_DeviceID]; CF_assert(CPU_OpenDRIM_Processor_populate(instance, cpu_info_processors_information[_DeviceID], SMBIOS_processor_information, use_SMBIOS, errorMessage)); _L_; return OK; } int CPU_OpenDRIM_Processor_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& newInstance, const OpenDRIM_Processor& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_Processor_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_Processor_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_Processor_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& instance, unsigned int& returnValue, const OpenDRIM_Processor_RequestStateChange_In& in, OpenDRIM_Processor_RequestStateChange_Out& out, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_Processor_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& instance, unsigned int& returnValue, const OpenDRIM_Processor_SetPowerState_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_Processor_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_Processor_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& instance, unsigned int& returnValue, const OpenDRIM_Processor_EnableDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_Processor_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& instance, unsigned int& returnValue, const OpenDRIM_Processor_OnlineDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_Processor_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& instance, unsigned int& returnValue, const OpenDRIM_Processor_QuiesceDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_Processor_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_Processor_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Processor& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_Processor_populate(OpenDRIM_Processor& instance, const _processor_topology& cpu_info_processor_information, const _processor_information& SMBIOS_processor_information, bool use_SMBIOS, string& errorMessage) { _E_; /* * Properties to fill from profile * + Mandatory: * [X] SystemCreationClassName * [X] SystemName * [X] CreationClassName * [X] DeviceID * [X] Family * [X] CurrentClockSpeed * [X] MaxClockSpeed * [X] ExternalBusClockSpeed * [X] CPUStatus * [X] EnabledState * [X] RequestedState * [X] OperationalStatus * [X] HealthState * [X] ElementName * + Optional: * [X] LoadPercentage */ // default settings in case SMBIOS didn't give results instance.setFamily(2); // unknown instance.setExternalBusClockSpeed(0); instance.setCPUStatus(0); // unknown instance.setUpgradeMethod(2); // unknown instance.setNumberOfEnabledCores(1); // default 1 core // set SMBIOS info first if (use_SMBIOS) { instance.setFamily(SMBIOS_processor_information.processor_family); instance.setExternalBusClockSpeed(SMBIOS_processor_information.external_clock); instance.setCPUStatus(SMBIOS_processor_information.status); instance.setUpgradeMethod(SMBIOS_processor_information.processor_upgrade); instance.setCharacteristics(SMBIOS_processor_information.processor_characteristics); if (SMBIOS_processor_information.core_enabled != 0) instance.setNumberOfEnabledCores(SMBIOS_processor_information.core_enabled); instance.setExternalBusClockSpeed(SMBIOS_processor_information.external_clock); instance.setMaxClockSpeed(SMBIOS_processor_information.max_speed); instance.setCurrentClockSpeed(SMBIOS_processor_information.current_speed); } // we don't support RequestedStateChange() instance.setRequestedState(12); if (instance.CPUStatus == 0) { // Unknown instance.setEnabledState(0); // unknown vector OperationalStatus; OperationalStatus.push_back(0); // unknown instance.setOperationalStatus(OperationalStatus); instance.setHealthState(0); // unknown } else if (instance.CPUStatus == 1) { // CPU Enabled instance.setEnabledState(2); // enabled vector OperationalStatus; OperationalStatus.push_back(2); // OK OperationalStatus.push_back(11); // in service instance.setOperationalStatus(OperationalStatus); instance.setHealthState(5); // OK } else if (instance.CPUStatus == 2) { // CPU Disabled by User via BIOS Setup instance.setEnabledState(3); // disabled vector OperationalStatus; OperationalStatus.push_back(2); // OK OperationalStatus.push_back(10); // stopped instance.setOperationalStatus(OperationalStatus); instance.setHealthState(5); // OK } else if (instance.CPUStatus == 3) { // CPU Disabled By BIOS (POST Error) instance.setEnabledState(3); // disabled vector OperationalStatus; OperationalStatus.push_back(6); // error OperationalStatus.push_back(10); // stopped instance.setOperationalStatus(OperationalStatus); instance.setHealthState(25); // critical failure } else if (instance.CPUStatus == 4) { // CPU is Idle instance.setEnabledState(6); // enabled but offline vector OperationalStatus; OperationalStatus.push_back(2); // OK OperationalStatus.push_back(15); // dormant instance.setOperationalStatus(OperationalStatus); instance.setHealthState(5); // OK } else if (instance.CPUStatus == 7) { // Other instance.setEnabledState(1); // other vector OperationalStatus; OperationalStatus.push_back(0); // unknown instance.setOperationalStatus(OperationalStatus); instance.setHealthState(0); // unknown } else { // default instance.setEnabledState(0); // unknown vector OperationalStatus; OperationalStatus.push_back(0); // unknown instance.setOperationalStatus(OperationalStatus); instance.setHealthState(0); // unknown } // set /proc/cpuinfo info now... instance.setElementName(cpu_info_processor_information.name); instance.setDescription(cpu_info_processor_information.vendor + " " + cpu_info_processor_information.architecture + " family " + CF_intToStr(cpu_info_processor_information.family) + " model " + CF_intToStr(cpu_info_processor_information.model) + " stepping " + CF_intToStr(cpu_info_processor_information.stepping)); // load percentage instance.setLoadPercentage(cpu_info_processor_information.load_average); _L_; return OK; } opendrim-lmp-cpu-1.1.0~ppa/mof.generation/0000755000175000017500000000000011400667756021261 5ustar guillaumeguillaumeopendrim-lmp-cpu-1.1.0~ppa/mof.generation/OpenDRIM_ProcessorProcessorCore.mof0000644000175000017500000000026611400667756030115 0ustar guillaumeguillaume[Association, Aggregation] class OpenDRIM_ProcessorProcessorCore { [Key, Aggregate] OpenDRIM_Processor REF GroupComponent; [Key] OpenDRIM_ProcessorCore REF PartComponent; }; opendrim-lmp-cpu-1.1.0~ppa/mof.generation/OpenDRIM_SystemProcessorVoltageSensor.mof0000644000175000017500000000031211400667756031315 0ustar guillaumeguillaume[Association, Aggregation] class OpenDRIM_SystemProcessorVoltageSensor { [Key, Aggregate] OpenDRIM_ComputerSystem REF GroupComponent; [Key] OpenDRIM_ProcessorVoltageSensor REF PartComponent; }; opendrim-lmp-cpu-1.1.0~ppa/mof.generation/OpenDRIM_AssociatedProcessorCoreCacheMemory.mof0000644000175000017500000000043511400667756032330 0ustar guillaumeguillaume[Association] class OpenDRIM_AssociatedProcessorCoreCacheMemory { [Key] OpenDRIM_ProcessorCore REF Antecedent; [Key] OpenDRIM_ProcessorCoreCacheMemory REF Dependent; uint16 Level; uint16 WritePolicy; uint16 CacheType; uint16 ReadPolicy; uint16 Associativity; }; opendrim-lmp-cpu-1.1.0~ppa/mof.generation/OpenDRIM_Processor.mof0000644000175000017500000000123511400667756025401 0ustar guillaumeguillaumeclass OpenDRIM_Processor { [Key] string CreationClassName; [Key] string DeviceID; [key] string SystemCreationClassName; [key] string SystemName; // deprecated to OpenDRIM_ProcessorCore.MaxClockSpeed //real32 MaxClockSpeed; // deprecated to OpenDRIM_ProcessorCore.CurrentClockSpeed //real32 CurrentClockSpeed; uint16 Family; uint32 ExternalBusClockSpeed; uint16 CPUStatus; uint16 EnabledState; uint16 RequestedState; uint16 LoadPercentage; uint16 OperationalStatus[]; uint16 HealthState; string ElementName; string Description; uint16 UpgradeMethod; uint16 Characteristics[]; uint16 NumberOfEnabledCores; };opendrim-lmp-cpu-1.1.0~ppa/mof.generation/OpenDRIM_AssociatedProcessorCacheMemory.mof0000644000175000017500000000042111400667756031512 0ustar guillaumeguillaume[Association] class OpenDRIM_AssociatedProcessorCacheMemory { [Key] OpenDRIM_Processor REF Antecedent; [Key] OpenDRIM_ProcessorCacheMemory REF Dependent; uint16 Level; uint16 WritePolicy; uint16 CacheType; uint16 ReadPolicy; uint16 Associativity; }; opendrim-lmp-cpu-1.1.0~ppa/mof.generation/OpenDRIM_ProcessorCacheMemory.mof0000644000175000017500000000053411400667756027517 0ustar guillaumeguillaumeclass OpenDRIM_ProcessorCacheMemory { [Key] string SystemCreationClassName; [Key] string CreationClassName; [Key] string SystemName; [Key] string DeviceID; uint64 BlockSize; uint64 NumberOfBlocks; uint16 EnabledState; uint16 RequestedState; uint16 HealthState; uint16 OperationalStatus[]; string ElementName; }; opendrim-lmp-cpu-1.1.0~ppa/mof.generation/OpenDRIM_ComputerSystemProcessor.mof0000644000175000017500000000027011400667756030323 0ustar guillaumeguillaume[Association, Aggregation] class OpenDRIM_ComputerSystemProcessor { [Key, Aggregate] OpenDRIM_ComputerSystem REF GroupComponent; [Key] OpenDRIM_Processor REF PartComponent; }; opendrim-lmp-cpu-1.1.0~ppa/mof.generation/CPU.mof0000644000175000017500000000173111400667756022415 0ustar guillaumeguillaume#pragma include ("OpenDRIM_Processor.mof") #pragma include ("OpenDRIM_ProcessorCore.mof") #pragma include ("OpenDRIM_HardwareThread.mof") #pragma include ("OpenDRIM_ProcessorCacheMemory.mof") #pragma include ("OpenDRIM_ProcessorCoreCacheMemory.mof") #pragma include ("OpenDRIM_RegisteredCPUProfile.mof") #pragma include ("OpenDRIM_RegisteredSensorsProfile.mof") #pragma include ("OpenDRIM_ProcessorVoltageSensor.mof") #pragma include ("OpenDRIM_ComputerSystemProcessor.mof") #pragma include ("OpenDRIM_ProcessorProcessorCore.mof") #pragma include ("OpenDRIM_ProcessorCoreHardwareThread.mof") #pragma include ("OpenDRIM_AssociatedProcessorCacheMemory.mof") #pragma include ("OpenDRIM_AssociatedProcessorCoreCacheMemory.mof") #pragma include ("OpenDRIM_AssociatedProcessorVoltageSensor.mof") #pragma include ("OpenDRIM_SystemProcessorVoltageSensor.mof") #pragma include ("OpenDRIM_ProcessorConformsToProfile.mof") #pragma include ("OpenDRIM_ProcessorVoltageSensorConformsToProfile.mof") opendrim-lmp-cpu-1.1.0~ppa/mof.generation/OpenDRIM_RegisteredSensorsProfile.mof0000644000175000017500000000034311400667756030414 0ustar guillaumeguillaumeclass OpenDRIM_RegisteredSensorsProfile : CIM_RegisteredProfile { //[Key] //string InstanceID; //string RegisteredName; //string RegisteredVersion; //uint16 RegisteredOrganization; //uint16 AdvertiseTypes[]; }; opendrim-lmp-cpu-1.1.0~ppa/mof.generation/OpenDRIM_ProcessorCoreHardwareThread.mof0000644000175000017500000000030011400667756031010 0ustar guillaumeguillaume[Association, Aggregation] class OpenDRIM_ProcessorCoreHardwareThread { [Key, Aggregate] OpenDRIM_ProcessorCore REF GroupComponent; [Key] OpenDRIM_HardwareThread REF PartComponent; }; opendrim-lmp-cpu-1.1.0~ppa/mof.generation/OpenDRIM_ProcessorCoreCacheMemory.mof0000644000175000017500000000054111400667756030326 0ustar guillaumeguillaumeclass OpenDRIM_ProcessorCoreCacheMemory { [Key] string SystemCreationClassName; [Key] string CreationClassName; [Key] string SystemName; [Key] string DeviceID; uint64 BlockSize; uint64 NumberOfBlocks; uint16 EnabledState; uint16 RequestedState; uint16 HealthState; uint16 OperationalStatus[]; string ElementName; }; opendrim-lmp-cpu-1.1.0~ppa/mof.generation/OpenDRIM_AssociatedProcessorVoltageSensor.mof0000644000175000017500000000025111400667756032112 0ustar guillaumeguillaume[Association] class OpenDRIM_AssociatedProcessorVoltageSensor { [Key] OpenDRIM_Processor REF Antecedent; [Key] OpenDRIM_ProcessorVoltageSensor REF Dependent; }; opendrim-lmp-cpu-1.1.0~ppa/mof.generation/OpenDRIM_HardwareThread.mof0000644000175000017500000000033111400667756026303 0ustar guillaumeguillaumeclass OpenDRIM_HardwareThread { [Key] string InstanceID; uint16 LoadPercentage; uint16 EnabledState; uint16 RequestedState; uint16 OperationalStatus[]; uint16 HealthState; string ElementName; }; opendrim-lmp-cpu-1.1.0~ppa/mof.generation/OpenDRIM_RegisteredCPUProfile.mof0000644000175000017500000000033711400667756027412 0ustar guillaumeguillaumeclass OpenDRIM_RegisteredCPUProfile : CIM_RegisteredProfile { //[Key] //string InstanceID; //string RegisteredName; //string RegisteredVersion; //uint16 RegisteredOrganization; //uint16 AdvertiseTypes[]; }; opendrim-lmp-cpu-1.1.0~ppa/mof.generation/OpenDRIM_ProcessorVoltageSensorConformsToProfile.mof0000644000175000017500000000044611400667756033453 0ustar guillaumeguillaume[Association] class OpenDRIM_ProcessorVoltageSensorConformsToProfile : CIM_ElementConformsToProfile{ [Key, Override("ConformantStandard")] OpenDRIM_RegisteredSensorsProfile REF ConformantStandard; [Key, Override("ManagedElement")] OpenDRIM_ProcessorVoltageSensor REF ManagedElement; }; opendrim-lmp-cpu-1.1.0~ppa/mof.generation/OpenDRIM_ProcessorCore.mof0000644000175000017500000000053211400667756026211 0ustar guillaumeguillaumeclass OpenDRIM_ProcessorCore { [Key] string InstanceID; uint16 CoreEnabledState; uint16 EnabledState; uint16 RequestedState; uint16 OperationalStatus[]; uint16 HealthState; uint16 LoadPercentage; string ElementName; // added to CIM schema uint32 MaxClockSpeed; // added to CIM schema uint32 CurrentClockSpeed; }; opendrim-lmp-cpu-1.1.0~ppa/mof.generation/OpenDRIM_ProcessorConformsToProfile.mof0000644000175000017500000000041111400667756030727 0ustar guillaumeguillaume[Association] class OpenDRIM_ProcessorConformsToProfile : CIM_ElementConformsToProfile { [Key, Override("ConformantStandard")] OpenDRIM_RegisteredCPUProfile REF ConformantStandard; [Key, Override("ManagedElement")] OpenDRIM_Processor REF ManagedElement; }; opendrim-lmp-cpu-1.1.0~ppa/mof.generation/OpenDRIM_ProcessorVoltageSensor.mof0000644000175000017500000000102611400667756030113 0ustar guillaumeguillaumeclass OpenDRIM_ProcessorVoltageSensor { [Key] string SystemCreationClassName; [Key] string CreationClassName; [Key] string SystemName; [Key] string DeviceID; uint16 SupportedThresholds[]; uint16 SettableThresholds[]; uint16 SensorType; string PossibleStates[]; string CurrentState; string ElementName; uint16 EnabledState; uint16 RequestedState; uint16 OperationalStatus[]; uint16 HealthState; uint16 RateUnits; sint32 CurrentReading; uint16 BaseUnits; sint32 UnitModifier; }; opendrim-lmp-cpu-1.1.0~ppa/COPYING0000644000175000017500000004310311400667756017402 0ustar guillaumeguillaume GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 2 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. opendrim-lmp-cpu-1.1.0~ppa/NEWS0000644000175000017500000000043611400667756017050 0ustar guillaumeguillaumeChanges in 1.1.0 ========================= // TODO Changes in 1.0.1 ========================= - Removing the smbios.h and smbios.cpp files. - Now needs the SMBIOS library. Changes in 1.0.0 ========================= // TODO Initial Release 0.5.0 ========================= // TODO opendrim-lmp-cpu-1.1.0~ppa/LICENSE0000644000175000017500000000307511400667756017360 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCacheMemory/0000755000175000017500000000000011400667756026077 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCacheMemory/OpenDRIM_AssociatedProcessorCacheMemoryAccess.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCacheMemory/OpenDRIM_AssociatedProcessorCache0000644000175000017500000003433411400667756034371 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_AssociatedProcessorCacheMemoryAccess.h" #include int CPU_OpenDRIM_AssociatedProcessorCacheMemory_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(CPU_CIM_Memory_load(broker, errorMessage)); CF_assert(CPU_CIM_LogicalElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCacheMemory_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(CPU_CIM_Memory_unload(errorMessage)); CF_assert(CPU_CIM_LogicalElement_unload(errorMessage)); */ // TODO _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCacheMemory_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // Determine if the association can be established or not isAssociated=false; string processor_device_id; string memory_device_id; Dependent.getProperty("DeviceID", processor_device_id); Antecedent.getProperty("DeviceID", memory_device_id); // processor DeviceID must be numerical if (!CF_isNumber(processor_device_id)) return OK; unsigned int _processor_device_id = atoll(processor_device_id.c_str()); // memory DeviceID must contain 2 numerical values seperated by ':' vector memory_device_id_elements; CF_splitText(memory_device_id_elements, memory_device_id, ':'); if (memory_device_id_elements.size() != 2) return OK; if (!CF_isNumber(memory_device_id_elements[0]) || memory_device_id_elements[1][0]!='L') return OK; unsigned int first_memory_device_id_element = atoll(memory_device_id_elements[0].c_str()); // the first element of the memory DeviceID must match the processor DeviceID if (first_memory_device_id_element == _processor_device_id) isAssociated=true; _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCacheMemory_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector subjects; // Only get the instance names CF_assert(CPU_OpenDRIM_AssociatedProcessorCacheMemory_enumerateAntecedents(broker, ctx, subjects, NULL, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(CPU_OpenDRIM_AssociatedProcessorCacheMemory_enumerateAntecedents(broker, ctx, subjects, NULL, false, errorMessage)); vector::iterator c = subjects.begin(); vector::iterator end = subjects.end(); for (; c != end; ++c) { bool leftToRight = true; vector associatedInstances; CPU_OpenDRIM_AssociatedProcessorCacheMemory_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), Antecedent_classnames[0], Dependent_classnames[0], Antecedent_role.c_str(), Dependent_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(CPU_OpenDRIM_AssociatedProcessorCacheMemory_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCacheMemory_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_AssociatedProcessorCacheMemory& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath Antecedent_objectpath; instance.getAntecedent(Antecedent_objectpath); Instance Antecedent_instance; CF_assert(CPU_OpenDRIM_AssociatedProcessorCacheMemory_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(CPU_OpenDRIM_AssociatedProcessorCacheMemory_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(CPU_OpenDRIM_AssociatedProcessorCacheMemory_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } CF_assert(CPU_OpenDRIM_AssociatedProcessorCacheMemory_populate(instance, errorMessage)); _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCacheMemory_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedProcessorCacheMemory& newInstance, const OpenDRIM_AssociatedProcessorCacheMemory& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_AssociatedProcessorCacheMemory_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedProcessorCacheMemory& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_AssociatedProcessorCacheMemory_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedProcessorCacheMemory& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_AssociatedProcessorCacheMemory_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector Dependent_instances; if (discriminant=="a") CF_assert(CPU_OpenDRIM_AssociatedProcessorCacheMemory_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(CPU_OpenDRIM_AssociatedProcessorCacheMemory_enumerateDependents(broker, ctx, Dependent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(CPU_OpenDRIM_AssociatedProcessorCacheMemory_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Antecedent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector Antecedent_instances; if (discriminant=="a") CF_assert(CPU_OpenDRIM_AssociatedProcessorCacheMemory_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(CPU_OpenDRIM_AssociatedProcessorCacheMemory_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(CPU_OpenDRIM_AssociatedProcessorCacheMemory_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_AssociatedProcessorCacheMemory_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < Dependent_instances.size(); i++) { OpenDRIM_AssociatedProcessorCacheMemory instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); if (discriminant == "r") { CF_assert(CPU_OpenDRIM_AssociatedProcessorCacheMemory_populate(instance, errorMessage)); } OpenDRIM_AssociatedProcessorCacheMemory_instances.push_back(instance); } _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCacheMemory_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_AssociatedProcessorCacheMemory_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < Antecedent_instances.size(); i++) { OpenDRIM_AssociatedProcessorCacheMemory instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); if (discriminant == "r") { CF_assert(CPU_OpenDRIM_AssociatedProcessorCacheMemory_populate(instance, errorMessage)); } OpenDRIM_AssociatedProcessorCacheMemory_instances.push_back(instance); } _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCacheMemory_populate(OpenDRIM_AssociatedProcessorCacheMemory& instance, string& errorMessage) { _E_; /* * Properties to fill from profile * + Mandatory: * [X] Level * [X] WritePolicy * [X] CacheType * [X] ReadPolicy * [X] Associativity */ Objectpath Antecedent; instance.getAntecedent(Antecedent); string memory_device_id; Antecedent.getKey("DeviceID", memory_device_id); // memory DeviceID must contain 2 numerical values seperated by ':' vector memory_device_id_elements; CF_splitText(memory_device_id_elements, memory_device_id, ':'); if (memory_device_id_elements.size() != 2) return OK; if (!CF_isNumber(memory_device_id_elements[0]) || memory_device_id_elements[1][0]!='L') return OK; unsigned int processor_id = atoll(memory_device_id_elements[0].c_str()); unsigned int level = atoll(memory_device_id_elements[1].substr(1).c_str()); // get info from SMBIOS vector<_processor_information> SMBIOS_processors_information; int errorCode = SMBIOS_getProcessorsInformation(SMBIOS_processors_information, errorMessage); // if we cannot get info from SMBIOS, we'll just use info from cpuinfo bool use_SMBIOS = false; if (errorCode == OK) use_SMBIOS = true; if (!use_SMBIOS) return OK; if (processor_id >= SMBIOS_processors_information.size()) return OK; if (level == 2) { if (!SMBIOS_processors_information[processor_id].has_l2_cache) return OK; instance.setWritePolicy(SMBIOS_processors_information[processor_id].l2_cache.operational_mode); instance.setCacheType(SMBIOS_processors_information[processor_id].l2_cache.system_cache_type); instance.setReadPolicy(0); // unknown instance.setAssociativity(SMBIOS_processors_information[processor_id].l2_cache.associativity); // smbios gives a wrong level information so we'd rather rely on the cache handles //instance.setLevel(SMBIOS_processors_information[processor_id].l2_cache.cache_level); instance.setLevel(4); } if (level == 3) { if (!SMBIOS_processors_information[processor_id].has_l3_cache) return OK; instance.setWritePolicy(SMBIOS_processors_information[processor_id].l3_cache.operational_mode); instance.setCacheType(SMBIOS_processors_information[processor_id].l3_cache.system_cache_type); instance.setReadPolicy(0); // unknown instance.setAssociativity(SMBIOS_processors_information[processor_id].l3_cache.associativity); // smbios gives a wrong level information so we'd rather rely on the cache handles //instance.setLevel(SMBIOS_processors_information[processor_id].l3_cache.cache_level); instance.setLevel(5); } _L_; return OK; } opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCacheMemory/Makefile.am0000644000175000017500000000515511400667756030141 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiCPU_OpenDRIM_AssociatedProcessorCacheMemoryProvider.la libcmpiCPU_OpenDRIM_AssociatedProcessorCacheMemoryProvider_la_SOURCES = OpenDRIM_AssociatedProcessorCacheMemoryAccess.cpp OpenDRIM_AssociatedProcessorCacheMemoryProvider.cpp cmpiOpenDRIM_AssociatedProcessorCacheMemory.cpp assocOpenDRIM_AssociatedProcessorCacheMemory.cpp # May have to be adjusted for direct invocation libcmpiCPU_OpenDRIM_AssociatedProcessorCacheMemoryProvider_la_CPPFLAGS = -I../CIM_Memory -I../CIM_LogicalElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiCPU_OpenDRIM_AssociatedProcessorCacheMemoryProvider_la_LIBADD = ../Common/libcmpiCPU_Common.la #../CIM_Memory/libcmpiCPU_CIM_MemoryProvider.la ../CIM_LogicalElement/libcmpiCPU_CIM_LogicalElementProvider.la libcmpiCPU_OpenDRIM_AssociatedProcessorCacheMemoryProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_AssociatedProcessorCacheMemory.h OpenDRIM_AssociatedProcessorCacheMemory.h OpenDRIM_AssociatedProcessorCacheMemoryAccess.h ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCacheMemory/cmpiOpenDRIM_AssociatedProcessorCacheMemory.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCacheMemory/cmpiOpenDRIM_AssociatedProcessorC0000644000175000017500000001471711400667756034424 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_AssociatedProcessorCacheMemory.h" CMPIObjectPath* CPU_OpenDRIM_AssociatedProcessorCacheMemory_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_AssociatedProcessorCacheMemory& instance) { _E_; Objectpath op(broker, OpenDRIM_AssociatedProcessorCacheMemory_classnames[0], OpenDRIM_AssociatedProcessorCacheMemory_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* CPU_OpenDRIM_AssociatedProcessorCacheMemory_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_AssociatedProcessorCacheMemory& instance) { _E_; Objectpath op(broker, CPU_OpenDRIM_AssociatedProcessorCacheMemory_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.Level_isNULL) ci.setProperty("Level", instance.Level); if (!instance.OtherLevelDescription_isNULL) ci.setProperty("OtherLevelDescription", instance.OtherLevelDescription); if (!instance.WritePolicy_isNULL) ci.setProperty("WritePolicy", instance.WritePolicy); if (!instance.OtherWritePolicyDescription_isNULL) ci.setProperty("OtherWritePolicyDescription", instance.OtherWritePolicyDescription); if (!instance.CacheType_isNULL) ci.setProperty("CacheType", instance.CacheType); if (!instance.OtherCacheTypeDescription_isNULL) ci.setProperty("OtherCacheTypeDescription", instance.OtherCacheTypeDescription); if (!instance.LineSize_isNULL) ci.setProperty("LineSize", instance.LineSize); if (!instance.ReplacementPolicy_isNULL) ci.setProperty("ReplacementPolicy", instance.ReplacementPolicy); if (!instance.OtherReplacementPolicyDescription_isNULL) ci.setProperty("OtherReplacementPolicyDescription", instance.OtherReplacementPolicyDescription); if (!instance.ReadPolicy_isNULL) ci.setProperty("ReadPolicy", instance.ReadPolicy); if (!instance.OtherReadPolicyDescription_isNULL) ci.setProperty("OtherReadPolicyDescription", instance.OtherReadPolicyDescription); if (!instance.FlushTimer_isNULL) ci.setProperty("FlushTimer", instance.FlushTimer); if (!instance.Associativity_isNULL) ci.setProperty("Associativity", instance.Associativity); if (!instance.OtherAssociativityDescription_isNULL) ci.setProperty("OtherAssociativityDescription", instance.OtherAssociativityDescription); _L_; return ci.getHdl(); } void CPU_OpenDRIM_AssociatedProcessorCacheMemory_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_AssociatedProcessorCacheMemory& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("Antecedent", instance.Antecedent) == OK) instance.Antecedent_isNULL = false; if (op.getKey("Dependent", instance.Dependent) == OK) instance.Dependent_isNULL = false; _L_; } void CPU_OpenDRIM_AssociatedProcessorCacheMemory_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_AssociatedProcessorCacheMemory& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Antecedent", instance.Antecedent) == OK) instance.Antecedent_isNULL = false; if (inst.getProperty("Dependent", instance.Dependent) == OK) instance.Dependent_isNULL = false; if (inst.getProperty("Level", instance.Level) == OK) instance.Level_isNULL = false; if (inst.getProperty("OtherLevelDescription", instance.OtherLevelDescription) == OK) instance.OtherLevelDescription_isNULL = false; if (inst.getProperty("WritePolicy", instance.WritePolicy) == OK) instance.WritePolicy_isNULL = false; if (inst.getProperty("OtherWritePolicyDescription", instance.OtherWritePolicyDescription) == OK) instance.OtherWritePolicyDescription_isNULL = false; if (inst.getProperty("CacheType", instance.CacheType) == OK) instance.CacheType_isNULL = false; if (inst.getProperty("OtherCacheTypeDescription", instance.OtherCacheTypeDescription) == OK) instance.OtherCacheTypeDescription_isNULL = false; if (inst.getProperty("LineSize", instance.LineSize) == OK) instance.LineSize_isNULL = false; if (inst.getProperty("ReplacementPolicy", instance.ReplacementPolicy) == OK) instance.ReplacementPolicy_isNULL = false; if (inst.getProperty("OtherReplacementPolicyDescription", instance.OtherReplacementPolicyDescription) == OK) instance.OtherReplacementPolicyDescription_isNULL = false; if (inst.getProperty("ReadPolicy", instance.ReadPolicy) == OK) instance.ReadPolicy_isNULL = false; if (inst.getProperty("OtherReadPolicyDescription", instance.OtherReadPolicyDescription) == OK) instance.OtherReadPolicyDescription_isNULL = false; if (inst.getProperty("FlushTimer", instance.FlushTimer) == OK) instance.FlushTimer_isNULL = false; if (inst.getProperty("Associativity", instance.Associativity) == OK) instance.Associativity_isNULL = false; if (inst.getProperty("OtherAssociativityDescription", instance.OtherAssociativityDescription) == OK) instance.OtherAssociativityDescription_isNULL = false; _L_; } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCacheMemory/OpenDRIM_AssociatedProcessorCacheMemory.hopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCacheMemory/OpenDRIM_AssociatedProcessorCache0000644000175000017500000002211611400667756034364 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_ASSOCIATEDPROCESSORCACHEMEMORY_H_ #define OPENDRIM_ASSOCIATEDPROCESSORCACHEMEMORY_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_Memory.h" #include "CIM_MemoryAccess.h" #include "cmpiCIM_LogicalElement.h" #include "CIM_LogicalElementAccess.h" */ const static char* OpenDRIM_AssociatedProcessorCacheMemory_classnames[] = {"OpenDRIM_AssociatedProcessorCacheMemory"}; static string OpenDRIM_AssociatedProcessorCacheMemory_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"OpenDRIM_CacheMemory"}; const static string Antecedent_NAMESPACE = _NAMESPACE; const static string Dependent_role = "Dependent"; const static char* Dependent_classnames[] = {"OpenDRIM_Processor"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_AssociatedProcessorCacheMemory { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; unsigned short Level; bool Level_isNULL; string OtherLevelDescription; bool OtherLevelDescription_isNULL; unsigned short WritePolicy; bool WritePolicy_isNULL; string OtherWritePolicyDescription; bool OtherWritePolicyDescription_isNULL; unsigned short CacheType; bool CacheType_isNULL; string OtherCacheTypeDescription; bool OtherCacheTypeDescription_isNULL; unsigned int LineSize; bool LineSize_isNULL; unsigned short ReplacementPolicy; bool ReplacementPolicy_isNULL; string OtherReplacementPolicyDescription; bool OtherReplacementPolicyDescription_isNULL; unsigned short ReadPolicy; bool ReadPolicy_isNULL; string OtherReadPolicyDescription; bool OtherReadPolicyDescription_isNULL; unsigned int FlushTimer; bool FlushTimer_isNULL; unsigned short Associativity; bool Associativity_isNULL; string OtherAssociativityDescription; bool OtherAssociativityDescription_isNULL; OpenDRIM_AssociatedProcessorCacheMemory() { Antecedent_isNULL = true; Dependent_isNULL = true; Level_isNULL = true; OtherLevelDescription_isNULL = true; WritePolicy_isNULL = true; OtherWritePolicyDescription_isNULL = true; CacheType_isNULL = true; OtherCacheTypeDescription_isNULL = true; LineSize_isNULL = true; ReplacementPolicy_isNULL = true; OtherReplacementPolicyDescription_isNULL = true; ReadPolicy_isNULL = true; OtherReadPolicyDescription_isNULL = true; FlushTimer_isNULL = true; Associativity_isNULL = true; OtherAssociativityDescription_isNULL = true; } ~OpenDRIM_AssociatedProcessorCacheMemory() {} string getKeys() const { return CF_toLowCase(".Antecedent=\"" + CF_quoteString(Antecedent.toString()) + "\""".Dependent=\"" + CF_quoteString(Dependent.toString()) + "\""); } int getAntecedent(Objectpath& value) const { if (Antecedent_isNULL==true) return NOT_FOUND; value = Antecedent; return OK; } int setAntecedent(const Objectpath& newValue) { Antecedent = newValue; Antecedent.setNamespace(Antecedent_NAMESPACE); Antecedent_isNULL = false; return OK; } int getDependent(Objectpath& value) const { if (Dependent_isNULL==true) return NOT_FOUND; value = Dependent; return OK; } int setDependent(const Objectpath& newValue) { Dependent = newValue; Dependent.setNamespace(Dependent_NAMESPACE); Dependent_isNULL = false; return OK; } int getLevel(unsigned short& value) const { if (Level_isNULL==true) return NOT_FOUND; value = Level; return OK; } int setLevel(const unsigned short& newValue) { Level = newValue; Level_isNULL = false; return OK; } int getOtherLevelDescription(string& value) const { if (OtherLevelDescription_isNULL==true) return NOT_FOUND; value = OtherLevelDescription; return OK; } int setOtherLevelDescription(const string& newValue) { OtherLevelDescription = newValue; OtherLevelDescription_isNULL = false; return OK; } int getWritePolicy(unsigned short& value) const { if (WritePolicy_isNULL==true) return NOT_FOUND; value = WritePolicy; return OK; } int setWritePolicy(const unsigned short& newValue) { WritePolicy = newValue; WritePolicy_isNULL = false; return OK; } int getOtherWritePolicyDescription(string& value) const { if (OtherWritePolicyDescription_isNULL==true) return NOT_FOUND; value = OtherWritePolicyDescription; return OK; } int setOtherWritePolicyDescription(const string& newValue) { OtherWritePolicyDescription = newValue; OtherWritePolicyDescription_isNULL = false; return OK; } int getCacheType(unsigned short& value) const { if (CacheType_isNULL==true) return NOT_FOUND; value = CacheType; return OK; } int setCacheType(const unsigned short& newValue) { CacheType = newValue; CacheType_isNULL = false; return OK; } int getOtherCacheTypeDescription(string& value) const { if (OtherCacheTypeDescription_isNULL==true) return NOT_FOUND; value = OtherCacheTypeDescription; return OK; } int setOtherCacheTypeDescription(const string& newValue) { OtherCacheTypeDescription = newValue; OtherCacheTypeDescription_isNULL = false; return OK; } int getLineSize(unsigned int& value) const { if (LineSize_isNULL==true) return NOT_FOUND; value = LineSize; return OK; } int setLineSize(const unsigned int& newValue) { LineSize = newValue; LineSize_isNULL = false; return OK; } int getReplacementPolicy(unsigned short& value) const { if (ReplacementPolicy_isNULL==true) return NOT_FOUND; value = ReplacementPolicy; return OK; } int setReplacementPolicy(const unsigned short& newValue) { ReplacementPolicy = newValue; ReplacementPolicy_isNULL = false; return OK; } int getOtherReplacementPolicyDescription(string& value) const { if (OtherReplacementPolicyDescription_isNULL==true) return NOT_FOUND; value = OtherReplacementPolicyDescription; return OK; } int setOtherReplacementPolicyDescription(const string& newValue) { OtherReplacementPolicyDescription = newValue; OtherReplacementPolicyDescription_isNULL = false; return OK; } int getReadPolicy(unsigned short& value) const { if (ReadPolicy_isNULL==true) return NOT_FOUND; value = ReadPolicy; return OK; } int setReadPolicy(const unsigned short& newValue) { ReadPolicy = newValue; ReadPolicy_isNULL = false; return OK; } int getOtherReadPolicyDescription(string& value) const { if (OtherReadPolicyDescription_isNULL==true) return NOT_FOUND; value = OtherReadPolicyDescription; return OK; } int setOtherReadPolicyDescription(const string& newValue) { OtherReadPolicyDescription = newValue; OtherReadPolicyDescription_isNULL = false; return OK; } int getFlushTimer(unsigned int& value) const { if (FlushTimer_isNULL==true) return NOT_FOUND; value = FlushTimer; return OK; } int setFlushTimer(const unsigned int& newValue) { FlushTimer = newValue; FlushTimer_isNULL = false; return OK; } int getAssociativity(unsigned short& value) const { if (Associativity_isNULL==true) return NOT_FOUND; value = Associativity; return OK; } int setAssociativity(const unsigned short& newValue) { Associativity = newValue; Associativity_isNULL = false; return OK; } int getOtherAssociativityDescription(string& value) const { if (OtherAssociativityDescription_isNULL==true) return NOT_FOUND; value = OtherAssociativityDescription; return OK; } int setOtherAssociativityDescription(const string& newValue) { OtherAssociativityDescription = newValue; OtherAssociativityDescription_isNULL = false; return OK; } }; #endif /*OPENDRIM_ASSOCIATEDPROCESSORCACHEMEMORY_H_*/ ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCacheMemory/assocOpenDRIM_AssociatedProcessorCacheMemory.hopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCacheMemory/assocOpenDRIM_AssociatedProcessor0000644000175000017500000000644511400667756034500 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_ASSOCIATEDPROCESSORCACHEMEMORY_H_ #define ASSOCOPENDRIM_ASSOCIATEDPROCESSORCACHEMEMORY_H_ #include "OpenDRIM_AssociatedProcessorCacheMemoryAccess.h" int CPU_OpenDRIM_AssociatedProcessorCacheMemory_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage); int CPU_OpenDRIM_AssociatedProcessorCacheMemory_associator(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties, vector& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant); int CPU_OpenDRIM_AssociatedProcessorCacheMemory_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int CPU_OpenDRIM_AssociatedProcessorCacheMemory_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int CPU_OpenDRIM_AssociatedProcessorCacheMemory_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int CPU_OpenDRIM_AssociatedProcessorCacheMemory_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_ASSOCIATEDPROCESSORCACHEMEMORY_H_*/ ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCacheMemory/cmpiOpenDRIM_AssociatedProcessorCacheMemory.hopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCacheMemory/cmpiOpenDRIM_AssociatedProcessorC0000644000175000017500000000463711400667756034424 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_ASSOCIATEDPROCESSORCACHEMEMORY_H_ #define CMPIOPENDRIM_ASSOCIATEDPROCESSORCACHEMEMORY_H_ #include "OpenDRIM_AssociatedProcessorCacheMemory.h" CMPIObjectPath* CPU_OpenDRIM_AssociatedProcessorCacheMemory_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_AssociatedProcessorCacheMemory& instance); CMPIInstance* CPU_OpenDRIM_AssociatedProcessorCacheMemory_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_AssociatedProcessorCacheMemory& instance); void CPU_OpenDRIM_AssociatedProcessorCacheMemory_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_AssociatedProcessorCacheMemory& instance); void CPU_OpenDRIM_AssociatedProcessorCacheMemory_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_AssociatedProcessorCacheMemory& instance); #endif /*CMPIOPENDRIM_ASSOCIATEDPROCESSORCACHEMEMORY_H_*/ ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCacheMemory/OpenDRIM_AssociatedProcessorCacheMemoryAccess.hopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCacheMemory/OpenDRIM_AssociatedProcessorCache0000644000175000017500000001114511400667756034364 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_ASSOCIATEDPROCESSORCACHEMEMORYACCESS_H_ #define OPENDRIM_ASSOCIATEDPROCESSORCACHEMEMORYACCESS_H_ #include "CPU_Common.h" #include "OpenDRIM_AssociatedProcessorCacheMemory.h" #include "assocOpenDRIM_AssociatedProcessorCacheMemory.h" int CPU_OpenDRIM_AssociatedProcessorCacheMemory_load(const CMPIBroker* broker, string& errorMessage); int CPU_OpenDRIM_AssociatedProcessorCacheMemory_unload(string& errorMessage); int CPU_OpenDRIM_AssociatedProcessorCacheMemory_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_AssociatedProcessorCacheMemory_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_AssociatedProcessorCacheMemory& instance, const char** properties, string& errorMessage); int CPU_OpenDRIM_AssociatedProcessorCacheMemory_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedProcessorCacheMemory& newInstance, const OpenDRIM_AssociatedProcessorCacheMemory& oldInstance, const char** properties, string& errorMessage); int CPU_OpenDRIM_AssociatedProcessorCacheMemory_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedProcessorCacheMemory& instance, string& errorMessage); int CPU_OpenDRIM_AssociatedProcessorCacheMemory_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedProcessorCacheMemory& instance, string& errorMessage); int CPU_OpenDRIM_AssociatedProcessorCacheMemory_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_AssociatedProcessorCacheMemory_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_AssociatedProcessorCacheMemory_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_AssociatedProcessorCacheMemory_instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_AssociatedProcessorCacheMemory_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_AssociatedProcessorCacheMemory_instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_AssociatedProcessorCacheMemory_populate(OpenDRIM_AssociatedProcessorCacheMemory& instance, string& errorMessage); #endif /*OPENDRIM_ASSOCIATEDPROCESSORCACHEMEMORYACCESS_H_*/ ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCacheMemory/OpenDRIM_AssociatedProcessorCacheMemoryProvider.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCacheMemory/OpenDRIM_AssociatedProcessorCache0000644000175000017500000004346211400667756034373 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_AssociatedProcessorCacheMemory.h" #include "OpenDRIM_AssociatedProcessorCacheMemoryAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define CPU_OpenDRIM_AssociatedProcessorCacheMemoryProviderSetInstance CPU_OpenDRIM_AssociatedProcessorCacheMemoryProviderModifyInstance #endif int CPU_OpenDRIM_AssociatedProcessorCacheMemory_init(const CMPIBroker* broker); int CPU_OpenDRIM_AssociatedProcessorCacheMemory_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_AssociatedProcessorCacheMemoryProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCacheMemoryProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = CPU_OpenDRIM_AssociatedProcessorCacheMemory_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCacheMemoryProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = CPU_OpenDRIM_AssociatedProcessorCacheMemory_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCacheMemoryProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_AssociatedProcessorCacheMemory instance; CPU_OpenDRIM_AssociatedProcessorCacheMemory_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = CPU_OpenDRIM_AssociatedProcessorCacheMemory_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCacheMemoryProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_AssociatedProcessorCacheMemory newInstance, oldInstance; CPU_OpenDRIM_AssociatedProcessorCacheMemory_toCPP(_broker, ci, newInstance); CPU_OpenDRIM_AssociatedProcessorCacheMemory_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCacheMemoryProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_AssociatedProcessorCacheMemory instance; CPU_OpenDRIM_AssociatedProcessorCacheMemory_toCPP(_broker, ci, instance); string errorMessage; int errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_AssociatedProcessorCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = CPU_OpenDRIM_AssociatedProcessorCacheMemory_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCacheMemoryProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_AssociatedProcessorCacheMemory instance; CPU_OpenDRIM_AssociatedProcessorCacheMemory_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCacheMemoryProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Association Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_AssociatedProcessorCacheMemoryProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCacheMemoryProviderAssociatorNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnObjectPath(rslt, associatedInstances[i].getObjectpath().getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCacheMemoryProviderAssociators(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnInstance(rslt, associatedInstances[i].getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCacheMemoryProviderReferenceNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = CPU_OpenDRIM_AssociatedProcessorCacheMemory_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus CPU_OpenDRIM_AssociatedProcessorCacheMemoryProviderReferences(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorCacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = CPU_OpenDRIM_AssociatedProcessorCacheMemory_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int CPU_OpenDRIM_AssociatedProcessorCacheMemory_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_AssociatedProcessorCacheMemory_init FAILED: " + (string) OpenDRIM_AssociatedProcessorCacheMemory_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCacheMemory_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_unload(errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_AssociatedProcessorCacheMemory_unload FAILED: " + (string) OpenDRIM_AssociatedProcessorCacheMemory_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define CPU_OpenDRIM_AssociatedProcessorCacheMemory_INIT if (CPU_OpenDRIM_AssociatedProcessorCacheMemory_init(_broker) < 0) return NULL CMInstanceMIStub(CPU_OpenDRIM_AssociatedProcessorCacheMemoryProvider, CPU_OpenDRIM_AssociatedProcessorCacheMemoryProvider, _broker, CPU_OpenDRIM_AssociatedProcessorCacheMemory_INIT); CMAssociationMIStub(CPU_OpenDRIM_AssociatedProcessorCacheMemoryProvider, CPU_OpenDRIM_AssociatedProcessorCacheMemoryProvider, _broker, CPU_OpenDRIM_AssociatedProcessorCacheMemory_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCacheMemory/assocOpenDRIM_AssociatedProcessorCacheMemory.cppopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_AssociatedProcessorCacheMemory/assocOpenDRIM_AssociatedProcessor0000644000175000017500000002113311400667756034467 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_AssociatedProcessorCacheMemory.h" int CPU_OpenDRIM_AssociatedProcessorCacheMemory_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage) { _E_; string _assocClass, _resultClass, _resultRole, _role; assocClass == NULL ? _assocClass = "null" : _assocClass = assocClass; resultClass == NULL ? _resultClass = "null" : _resultClass = resultClass; resultRole == NULL ? _resultRole = "null" : _resultRole = resultRole; role == NULL ? _role = "null" : _role = role; for (unsigned int i=0; i& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant) { _E_; int errorCode = CPU_OpenDRIM_AssociatedProcessorCacheMemory_associatorFilter(broker, ctx, cop, knownInstance, assocClass, resultClass, role, resultRole, leftToRight, errorMessage); if (errorCode == -1) return OK; if (errorCode != OK) return errorCode; if (leftToRight) { if (role != NULL && strcasecmp(role, "Antecedent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "Dependent") != 0) return OK; CF_assert(CPU_OpenDRIM_AssociatedProcessorCacheMemory_associatorAntecedentToDependent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "Dependent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "Antecedent") != 0) return OK; CF_assert(CPU_OpenDRIM_AssociatedProcessorCacheMemory_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCacheMemory_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, Antecedent_NAMESPACE, Antecedent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(CPU_CIM_Memory_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(CPU_CIM_Memory_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, CPU_CIM_Memory_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCacheMemory_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Antecedent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Antecedent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_Memory _instance; CPU_CIM_Memory_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(CPU_CIM_Memory_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, CPU_CIM_Memory_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCacheMemory_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, Dependent_NAMESPACE, Dependent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(CPU_CIM_LogicalElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(CPU_CIM_LogicalElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, CPU_CIM_LogicalElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int CPU_OpenDRIM_AssociatedProcessorCacheMemory_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Dependent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Dependent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_LogicalElement _instance; CPU_CIM_LogicalElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(CPU_CIM_LogicalElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, CPU_CIM_LogicalElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_CacheMemory/0000755000175000017500000000000011400667756022177 5ustar guillaumeguillaumeopendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_CacheMemory/cmpiOpenDRIM_CacheMemory.h0000644000175000017500000000571711400667756027064 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_CACHEMEMORY_H_ #define CMPIOPENDRIM_CACHEMEMORY_H_ #include "OpenDRIM_CacheMemory.h" CMPIObjectPath* CPU_OpenDRIM_CacheMemory_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_CacheMemory& instance); CMPIInstance* CPU_OpenDRIM_CacheMemory_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_CacheMemory& instance); void CPU_OpenDRIM_CacheMemory_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_CacheMemory& instance); void CPU_OpenDRIM_CacheMemory_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_CacheMemory& instance); void CPU_OpenDRIM_CacheMemory_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_CacheMemory_RequestStateChange_In& args); void CPU_OpenDRIM_CacheMemory_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_CacheMemory_RequestStateChange_Out& args); void CPU_OpenDRIM_CacheMemory_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_CacheMemory_SetPowerState_In& args); void CPU_OpenDRIM_CacheMemory_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_CacheMemory_EnableDevice_In& args); void CPU_OpenDRIM_CacheMemory_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_CacheMemory_OnlineDevice_In& args); void CPU_OpenDRIM_CacheMemory_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_CacheMemory_QuiesceDevice_In& args); #endif /*CMPIOPENDRIM_CACHEMEMORY_H_*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_CacheMemory/Makefile.am0000644000175000017500000000405211400667756024234 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiCPU_OpenDRIM_CacheMemoryProvider.la libcmpiCPU_OpenDRIM_CacheMemoryProvider_la_SOURCES = OpenDRIM_CacheMemoryAccess.cpp OpenDRIM_CacheMemoryProvider.cpp cmpiOpenDRIM_CacheMemory.cpp libcmpiCPU_OpenDRIM_CacheMemoryProvider_la_LIBADD = ../Common/libcmpiCPU_Common.la libcmpiCPU_OpenDRIM_CacheMemoryProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_CacheMemory.h OpenDRIM_CacheMemory.h OpenDRIM_CacheMemoryAccess.h opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_CacheMemory/OpenDRIM_CacheMemoryAccess.cpp0000644000175000017500000002464211400667756027666 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_CacheMemoryAccess.h" const string systemCreationClassName="OpenDRIM_ComputerSystem"; const string creationClassName="OpenDRIM_CacheMemory"; string systemName; vector<_processor_information> SMBIOS_processors_information; vector<_processor_topology> cpu_info_processors_information; vector DeviceIDs; int CPU_OpenDRIM_CacheMemory_load(const CMPIBroker* broker, string& errorMessage) { _E_; CF_assert(CF_getSystemName(systemName, errorMessage)); // get info from SMBIOS CF_assert(SMBIOS_getProcessorsInformation(SMBIOS_processors_information, errorMessage)); // get info from cpuinfo CF_assert(CPU_getProcessors("/proc/cpuinfo", cpu_info_processors_information, errorMessage)); // different processors count... if (cpu_info_processors_information.size() != SMBIOS_processors_information.size()) { errorMessage = "Different processor count"; return ERROR; } // We create l1 and l2 cache instances for (unsigned int i = 0; i < cpu_info_processors_information.size(); i++) { cout << "Associated processor memory: " << cpu_info_processors_information[i].associated_cache_memory << endl; for (unsigned int j = 0; j < cpu_info_processors_information[i].processor_cores.size(); j++) { cout << "Associated core memory: " << cpu_info_processors_information[i].processor_cores[j].associated_cache_memory << endl; // L1 cache if (SMBIOS_processors_information[i].has_l1_cache) DeviceIDs.push_back(CF_intToStr(i) + ":" + CF_intToStr(j) +":L1"); // l2 cache if (SMBIOS_processors_information[i].has_l2_cache && cpu_info_processors_information[i].processor_cores[j].associated_cache_memory) DeviceIDs.push_back(CF_intToStr(i) + ":" + CF_intToStr(j) + ":L2"); } // Cache associated with processors // l2 cache if (SMBIOS_processors_information[i].has_l2_cache && cpu_info_processors_information[i].associated_cache_memory) DeviceIDs.push_back(CF_intToStr(i) + ":L2"); // l3 cache if (SMBIOS_processors_information[i].has_l3_cache) DeviceIDs.push_back(CF_intToStr(i) + ":L3"); } _L_; return OK; } int CPU_OpenDRIM_CacheMemory_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int CPU_OpenDRIM_CacheMemory_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; for(unsigned int i=0;i::size_type index; if (instance.SystemCreationClassName != systemCreationClassName || instance.CreationClassName != creationClassName || instance.SystemName != systemName || !CF_foundInList(instance.DeviceID, DeviceIDs, index)) { errorMessage = "No instance"; return NOT_FOUND; } int processor_num, level; processor_num = atoi(instance.DeviceID.substr(0,instance.DeviceID.find_first_of(":")).c_str()); level = atoi(instance.DeviceID.substr(instance.DeviceID.find_last_of(":")+2).c_str()); CF_assert(CPU_OpenDRIM_CacheMemory_populate(instance, cpu_info_processors_information[processor_num], SMBIOS_processors_information[processor_num], level, errorMessage)); _L_; return OK; } int CPU_OpenDRIM_CacheMemory_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& newInstance, const OpenDRIM_CacheMemory& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_CacheMemory_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_CacheMemory_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_CacheMemory_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& instance, unsigned int& returnValue, const OpenDRIM_CacheMemory_RequestStateChange_In& in, OpenDRIM_CacheMemory_RequestStateChange_Out& out, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_CacheMemory_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& instance, unsigned int& returnValue, const OpenDRIM_CacheMemory_SetPowerState_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_CacheMemory_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_CacheMemory_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& instance, unsigned int& returnValue, const OpenDRIM_CacheMemory_EnableDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_CacheMemory_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& instance, unsigned int& returnValue, const OpenDRIM_CacheMemory_OnlineDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_CacheMemory_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& instance, unsigned int& returnValue, const OpenDRIM_CacheMemory_QuiesceDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_CacheMemory_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_CacheMemory_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int CPU_OpenDRIM_CacheMemory_populate(OpenDRIM_CacheMemory& instance, const _processor_topology& cpu_info_processor_information, const _processor_information& SMBIOS_processor_information, int level, string& errorMessage) { _E_; /* * Properties to fill from profile * + Mandatory: * [X] SystemCreationClassName * [X] CreationClassName * [X] SystemName * [X] DeviceID * [X] BlockSize * [X] NumberOfBlocks * [X] EnabledState * [X] RequestedState * [X] HealthState * [X] OperationalStatus * [X] ElementName */ vector OperationalStatus; // default // we don't support RequestedStateChange() instance.setRequestedState(12); // Not Applicable instance.setEnabledState(5); // Not Applicable OperationalStatus.push_back(0); // unknown instance.setOperationalStatus(OperationalStatus); instance.setHealthState(0); // unknown if (level == 1) { instance.setBlockSize(SMBIOS_processor_information.l1_cache.granularity); instance.setNumberOfBlocks((SMBIOS_processor_information.l1_cache.installed_size)/(cpu_info_processor_information.processor_cores.size())); } else if (level == 2) { if(!cpu_info_processor_information.associated_cache_memory) { instance.setBlockSize(SMBIOS_processor_information.l2_cache.granularity); instance.setNumberOfBlocks((SMBIOS_processor_information.l2_cache.installed_size)/(cpu_info_processor_information.processor_cores.size())); } else { instance.setBlockSize(SMBIOS_processor_information.l2_cache.granularity); instance.setNumberOfBlocks(SMBIOS_processor_information.l2_cache.installed_size); } } else if (level == 3) { instance.setBlockSize(SMBIOS_processor_information.l3_cache.granularity); instance.setNumberOfBlocks(SMBIOS_processor_information.l3_cache.installed_size); } // set info from /proc/cpuinfo if(level == 1 || (level ==2 && !cpu_info_processor_information.associated_cache_memory)) instance.setElementName(cpu_info_processor_information.name + " core level " + CF_intToStr(level) + " cache memory"); else instance.setElementName(cpu_info_processor_information.name + " level " + CF_intToStr(level) + " cache memory"); _L_; return OK; } opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_CacheMemory/OpenDRIM_CacheMemoryProvider.cpp0000644000175000017500000004146711400667756030263 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_CacheMemory.h" #include "OpenDRIM_CacheMemoryAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define CPU_OpenDRIM_CacheMemoryProviderSetInstance CPU_OpenDRIM_CacheMemoryProviderModifyInstance #endif int CPU_OpenDRIM_CacheMemory_init(const CMPIBroker* broker); int CPU_OpenDRIM_CacheMemory_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_CacheMemoryProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_CacheMemory_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_CacheMemoryProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_CacheMemory_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = CPU_OpenDRIM_CacheMemory_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_CacheMemoryProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = CPU_OpenDRIM_CacheMemory_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = CPU_OpenDRIM_CacheMemory_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_CacheMemoryProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_CacheMemory instance; CPU_OpenDRIM_CacheMemory_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_CacheMemory_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = CPU_OpenDRIM_CacheMemory_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_CacheMemoryProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_CacheMemory newInstance, oldInstance; CPU_OpenDRIM_CacheMemory_toCPP(_broker, ci, newInstance); CPU_OpenDRIM_CacheMemory_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = CPU_OpenDRIM_CacheMemory_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_CacheMemory_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_CacheMemoryProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_CacheMemory instance; CPU_OpenDRIM_CacheMemory_toCPP(_broker, ci, instance); string errorMessage; int errorCode = CPU_OpenDRIM_CacheMemory_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_CacheMemory_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_CacheMemory_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = CPU_OpenDRIM_CacheMemory_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_CacheMemoryProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_CacheMemory instance; CPU_OpenDRIM_CacheMemory_toCPP(_broker, cop, instance); string errorMessage; int errorCode = CPU_OpenDRIM_CacheMemory_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = CPU_OpenDRIM_CacheMemory_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus CPU_OpenDRIM_CacheMemoryProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Method Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus CPU_OpenDRIM_CacheMemoryProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = CPU_OpenDRIM_CacheMemory_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus CPU_OpenDRIM_CacheMemoryProviderInvokeMethod(CMPIMethodMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* methodName, const CMPIArgs* in, CMPIArgs* out) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_CacheMemory instance; CPU_OpenDRIM_CacheMemory_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"DeviceID", "SystemCreationClassName", "SystemName", "CreationClassName"}; int errorCode = CPU_OpenDRIM_CacheMemory_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_CacheMemory_RequestStateChange_In inArgs; CPU_OpenDRIM_CacheMemory_toCPP(_broker, in, inArgs); OpenDRIM_CacheMemory_RequestStateChange_Out outArgs; errorCode = CPU_OpenDRIM_CacheMemory_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CPU_OpenDRIM_CacheMemory_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SetPowerState") { unsigned int returnValue; OpenDRIM_CacheMemory_SetPowerState_In inArgs; CPU_OpenDRIM_CacheMemory_toCPP(_broker, in, inArgs); errorCode = CPU_OpenDRIM_CacheMemory_SetPowerState(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="Reset") { unsigned int returnValue; errorCode = CPU_OpenDRIM_CacheMemory_Reset(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="EnableDevice") { unsigned int returnValue; OpenDRIM_CacheMemory_EnableDevice_In inArgs; CPU_OpenDRIM_CacheMemory_toCPP(_broker, in, inArgs); errorCode = CPU_OpenDRIM_CacheMemory_EnableDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="OnlineDevice") { unsigned int returnValue; OpenDRIM_CacheMemory_OnlineDevice_In inArgs; CPU_OpenDRIM_CacheMemory_toCPP(_broker, in, inArgs); errorCode = CPU_OpenDRIM_CacheMemory_OnlineDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="QuiesceDevice") { unsigned int returnValue; OpenDRIM_CacheMemory_QuiesceDevice_In inArgs; CPU_OpenDRIM_CacheMemory_toCPP(_broker, in, inArgs); errorCode = CPU_OpenDRIM_CacheMemory_QuiesceDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SaveProperties") { unsigned int returnValue; errorCode = CPU_OpenDRIM_CacheMemory_SaveProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="RestoreProperties") { unsigned int returnValue; errorCode = CPU_OpenDRIM_CacheMemory_RestoreProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else { errorMessage = (string) OpenDRIM_CacheMemory_classnames[0] + ": " + "The requested method (" + (string) methodName +") was not found."; CMSetStatusWithChars(_broker, &rc, (CMPIrc) NOT_SUPPORTED, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; CMReturn(CMPI_RC_OK); } /* ---------------------------------------------------------------------------*/ /* End of Method Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int CPU_OpenDRIM_CacheMemory_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = CPU_OpenDRIM_CacheMemory_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_CacheMemory_init FAILED: " + (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int CPU_OpenDRIM_CacheMemory_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = CPU_OpenDRIM_CacheMemory_unload(errorMessage); if (errorCode != OK) { errorMessage += "CPU_OpenDRIM_CacheMemory_unload FAILED: " + (string) OpenDRIM_CacheMemory_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define CPU_OpenDRIM_CacheMemory_INIT if (CPU_OpenDRIM_CacheMemory_init(_broker) < 0) return NULL CMInstanceMIStub(CPU_OpenDRIM_CacheMemoryProvider, CPU_OpenDRIM_CacheMemoryProvider, _broker, CPU_OpenDRIM_CacheMemory_INIT); CMMethodMIStub(CPU_OpenDRIM_CacheMemoryProvider, CPU_OpenDRIM_CacheMemoryProvider, _broker, CPU_OpenDRIM_CacheMemory_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_CacheMemory/OpenDRIM_CacheMemoryAccess.h0000644000175000017500000001133211400667756027323 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_CACHEMEMORYACCESS_H_ #define OPENDRIM_CACHEMEMORYACCESS_H_ #include "CPU_Common.h" #include #include "OpenDRIM_CacheMemory.h" int CPU_OpenDRIM_CacheMemory_load(const CMPIBroker* broker, string& errorMessage); int CPU_OpenDRIM_CacheMemory_unload(string& errorMessage); int CPU_OpenDRIM_CacheMemory_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int CPU_OpenDRIM_CacheMemory_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_CacheMemory& instance, const char** properties, string& errorMessage); int CPU_OpenDRIM_CacheMemory_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& newInstance, const OpenDRIM_CacheMemory& oldInstance, const char** properties, string& errorMessage); int CPU_OpenDRIM_CacheMemory_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& instance, string& errorMessage); int CPU_OpenDRIM_CacheMemory_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& instance, string& errorMessage); int CPU_OpenDRIM_CacheMemory_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& instance, unsigned int& returnValue, const OpenDRIM_CacheMemory_RequestStateChange_In& in, OpenDRIM_CacheMemory_RequestStateChange_Out& out, string& errorMessage); int CPU_OpenDRIM_CacheMemory_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& instance, unsigned int& returnValue, const OpenDRIM_CacheMemory_SetPowerState_In& in, string& errorMessage); int CPU_OpenDRIM_CacheMemory_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& instance, unsigned int& returnValue, string& errorMessage); int CPU_OpenDRIM_CacheMemory_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& instance, unsigned int& returnValue, const OpenDRIM_CacheMemory_EnableDevice_In& in, string& errorMessage); int CPU_OpenDRIM_CacheMemory_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& instance, unsigned int& returnValue, const OpenDRIM_CacheMemory_OnlineDevice_In& in, string& errorMessage); int CPU_OpenDRIM_CacheMemory_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& instance, unsigned int& returnValue, const OpenDRIM_CacheMemory_QuiesceDevice_In& in, string& errorMessage); int CPU_OpenDRIM_CacheMemory_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& instance, unsigned int& returnValue, string& errorMessage); int CPU_OpenDRIM_CacheMemory_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_CacheMemory& instance, unsigned int& returnValue, string& errorMessage); int CPU_OpenDRIM_CacheMemory_populate(OpenDRIM_CacheMemory& instance, const _processor_topology& cpu_info_processor_information, const _processor_information& SMBIOS_processor_information, int level, string& errorMessage); #endif /*OPENDRIM_CACHEMEMORYACCESS_H_*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_CacheMemory/OpenDRIM_CacheMemory.h0000644000175000017500000010407611400667756026211 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_CACHEMEMORY_H_ #define OPENDRIM_CACHEMEMORY_H_ #include const static char* OpenDRIM_CacheMemory_classnames[] = {"OpenDRIM_CacheMemory"}; static string OpenDRIM_CacheMemory_NAMESPACE = _NAMESPACE; class OpenDRIM_CacheMemory { public: string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string InstallDate; bool InstallDate_isNULL; vector OperationalStatus; bool OperationalStatus_isNULL; vector StatusDescriptions; bool StatusDescriptions_isNULL; string Status; bool Status_isNULL; unsigned short HealthState; bool HealthState_isNULL; unsigned short PrimaryStatus; bool PrimaryStatus_isNULL; unsigned short DetailedStatus; bool DetailedStatus_isNULL; unsigned short OperatingStatus; bool OperatingStatus_isNULL; unsigned short CommunicationStatus; bool CommunicationStatus_isNULL; unsigned short EnabledState; bool EnabledState_isNULL; string OtherEnabledState; bool OtherEnabledState_isNULL; unsigned short RequestedState; bool RequestedState_isNULL; unsigned short EnabledDefault; bool EnabledDefault_isNULL; string TimeOfLastStateChange; bool TimeOfLastStateChange_isNULL; vector AvailableRequestedStates; bool AvailableRequestedStates_isNULL; unsigned short TransitioningToState; bool TransitioningToState_isNULL; string SystemCreationClassName; bool SystemCreationClassName_isNULL; string SystemName; bool SystemName_isNULL; string CreationClassName; bool CreationClassName_isNULL; string DeviceID; bool DeviceID_isNULL; bool PowerManagementSupported; bool PowerManagementSupported_isNULL; vector PowerManagementCapabilities; bool PowerManagementCapabilities_isNULL; unsigned short Availability; bool Availability_isNULL; unsigned short StatusInfo; bool StatusInfo_isNULL; unsigned int LastErrorCode; bool LastErrorCode_isNULL; string ErrorDescription; bool ErrorDescription_isNULL; bool ErrorCleared; bool ErrorCleared_isNULL; vector OtherIdentifyingInfo; bool OtherIdentifyingInfo_isNULL; unsigned long long PowerOnHours; bool PowerOnHours_isNULL; unsigned long long TotalPowerOnHours; bool TotalPowerOnHours_isNULL; vector IdentifyingDescriptions; bool IdentifyingDescriptions_isNULL; vector AdditionalAvailability; bool AdditionalAvailability_isNULL; unsigned long long MaxQuiesceTime; bool MaxQuiesceTime_isNULL; unsigned short LocationIndicator; bool LocationIndicator_isNULL; unsigned short DataOrganization; bool DataOrganization_isNULL; string Purpose; bool Purpose_isNULL; unsigned short Access; bool Access_isNULL; unsigned long long BlockSize; bool BlockSize_isNULL; unsigned long long NumberOfBlocks; bool NumberOfBlocks_isNULL; unsigned long long ConsumableBlocks; bool ConsumableBlocks_isNULL; bool IsBasedOnUnderlyingRedundancy; bool IsBasedOnUnderlyingRedundancy_isNULL; bool SequentialAccess; bool SequentialAccess_isNULL; vector ExtentStatus; bool ExtentStatus_isNULL; bool NoSinglePointOfFailure; bool NoSinglePointOfFailure_isNULL; unsigned short DataRedundancy; bool DataRedundancy_isNULL; unsigned short PackageRedundancy; bool PackageRedundancy_isNULL; unsigned char DeltaReservation; bool DeltaReservation_isNULL; bool Primordial; bool Primordial_isNULL; string Name; bool Name_isNULL; unsigned short NameFormat; bool NameFormat_isNULL; unsigned short NameNamespace; bool NameNamespace_isNULL; string OtherNameNamespace; bool OtherNameNamespace_isNULL; string OtherNameFormat; bool OtherNameFormat_isNULL; unsigned short Usage; bool Usage_isNULL; string OtherUsageDescription; bool OtherUsageDescription_isNULL; vector ClientSettableUsage; bool ClientSettableUsage_isNULL; bool Volatile; bool Volatile_isNULL; string ErrorMethodology; bool ErrorMethodology_isNULL; unsigned long long StartingAddress; bool StartingAddress_isNULL; unsigned long long EndingAddress; bool EndingAddress_isNULL; unsigned short ErrorInfo; bool ErrorInfo_isNULL; string OtherErrorDescription; bool OtherErrorDescription_isNULL; bool CorrectableError; bool CorrectableError_isNULL; string ErrorTime; bool ErrorTime_isNULL; unsigned short ErrorAccess; bool ErrorAccess_isNULL; unsigned int ErrorTransferSize; bool ErrorTransferSize_isNULL; vector ErrorData; bool ErrorData_isNULL; unsigned short ErrorDataOrder; bool ErrorDataOrder_isNULL; unsigned long long ErrorAddress; bool ErrorAddress_isNULL; bool SystemLevelAddress; bool SystemLevelAddress_isNULL; unsigned long long ErrorResolution; bool ErrorResolution_isNULL; vector AdditionalErrorData; bool AdditionalErrorData_isNULL; OpenDRIM_CacheMemory() { Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstallDate_isNULL = true; OperationalStatus_isNULL = true; StatusDescriptions_isNULL = true; Status_isNULL = true; HealthState_isNULL = true; PrimaryStatus_isNULL = true; DetailedStatus_isNULL = true; OperatingStatus_isNULL = true; CommunicationStatus_isNULL = true; EnabledState_isNULL = true; OtherEnabledState_isNULL = true; RequestedState_isNULL = true; EnabledDefault_isNULL = true; TimeOfLastStateChange_isNULL = true; AvailableRequestedStates_isNULL = true; TransitioningToState_isNULL = true; SystemCreationClassName_isNULL = true; SystemName_isNULL = true; CreationClassName_isNULL = true; DeviceID_isNULL = true; PowerManagementSupported_isNULL = true; PowerManagementCapabilities_isNULL = true; Availability_isNULL = true; StatusInfo_isNULL = true; LastErrorCode_isNULL = true; ErrorDescription_isNULL = true; ErrorCleared_isNULL = true; OtherIdentifyingInfo_isNULL = true; PowerOnHours_isNULL = true; TotalPowerOnHours_isNULL = true; IdentifyingDescriptions_isNULL = true; AdditionalAvailability_isNULL = true; MaxQuiesceTime_isNULL = true; LocationIndicator_isNULL = true; DataOrganization_isNULL = true; Purpose_isNULL = true; Access_isNULL = true; BlockSize_isNULL = true; NumberOfBlocks_isNULL = true; ConsumableBlocks_isNULL = true; IsBasedOnUnderlyingRedundancy_isNULL = true; SequentialAccess_isNULL = true; ExtentStatus_isNULL = true; NoSinglePointOfFailure_isNULL = true; DataRedundancy_isNULL = true; PackageRedundancy_isNULL = true; DeltaReservation_isNULL = true; Primordial_isNULL = true; Name_isNULL = true; NameFormat_isNULL = true; NameNamespace_isNULL = true; OtherNameNamespace_isNULL = true; OtherNameFormat_isNULL = true; Usage_isNULL = true; OtherUsageDescription_isNULL = true; ClientSettableUsage_isNULL = true; Volatile_isNULL = true; ErrorMethodology_isNULL = true; StartingAddress_isNULL = true; EndingAddress_isNULL = true; ErrorInfo_isNULL = true; OtherErrorDescription_isNULL = true; CorrectableError_isNULL = true; ErrorTime_isNULL = true; ErrorAccess_isNULL = true; ErrorTransferSize_isNULL = true; ErrorData_isNULL = true; ErrorDataOrder_isNULL = true; ErrorAddress_isNULL = true; SystemLevelAddress_isNULL = true; ErrorResolution_isNULL = true; AdditionalErrorData_isNULL = true; } ~OpenDRIM_CacheMemory() {} string getKeys() const { return CF_toLowCase(".SystemCreationClassName=\"" + CF_quoteString(SystemCreationClassName) + "\""".SystemName=\"" + CF_quoteString(SystemName) + "\""".CreationClassName=\"" + CF_quoteString(CreationClassName) + "\""".DeviceID=\"" + CF_quoteString(DeviceID) + "\""); } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getInstallDate(string& value) const { if (InstallDate_isNULL==true) return NOT_FOUND; value = InstallDate; return OK; } int setInstallDate(const string& newValue) { InstallDate = newValue; InstallDate_isNULL = false; return OK; } int getOperationalStatus(vector& value) const { if (OperationalStatus_isNULL==true) return NOT_FOUND; value = OperationalStatus; return OK; } int setOperationalStatus(const vector& newValue) { OperationalStatus = newValue; OperationalStatus_isNULL = false; return OK; } int getStatusDescriptions(vector& value) const { if (StatusDescriptions_isNULL==true) return NOT_FOUND; value = StatusDescriptions; return OK; } int setStatusDescriptions(const vector& newValue) { StatusDescriptions = newValue; StatusDescriptions_isNULL = false; return OK; } int getStatus(string& value) const { if (Status_isNULL==true) return NOT_FOUND; value = Status; return OK; } int setStatus(const string& newValue) { Status = newValue; Status_isNULL = false; return OK; } int getHealthState(unsigned short& value) const { if (HealthState_isNULL==true) return NOT_FOUND; value = HealthState; return OK; } int setHealthState(const unsigned short& newValue) { HealthState = newValue; HealthState_isNULL = false; return OK; } int getPrimaryStatus(unsigned short& value) const { if (PrimaryStatus_isNULL==true) return NOT_FOUND; value = PrimaryStatus; return OK; } int setPrimaryStatus(const unsigned short& newValue) { PrimaryStatus = newValue; PrimaryStatus_isNULL = false; return OK; } int getDetailedStatus(unsigned short& value) const { if (DetailedStatus_isNULL==true) return NOT_FOUND; value = DetailedStatus; return OK; } int setDetailedStatus(const unsigned short& newValue) { DetailedStatus = newValue; DetailedStatus_isNULL = false; return OK; } int getOperatingStatus(unsigned short& value) const { if (OperatingStatus_isNULL==true) return NOT_FOUND; value = OperatingStatus; return OK; } int setOperatingStatus(const unsigned short& newValue) { OperatingStatus = newValue; OperatingStatus_isNULL = false; return OK; } int getCommunicationStatus(unsigned short& value) const { if (CommunicationStatus_isNULL==true) return NOT_FOUND; value = CommunicationStatus; return OK; } int setCommunicationStatus(const unsigned short& newValue) { CommunicationStatus = newValue; CommunicationStatus_isNULL = false; return OK; } int getEnabledState(unsigned short& value) const { if (EnabledState_isNULL==true) return NOT_FOUND; value = EnabledState; return OK; } int setEnabledState(const unsigned short& newValue) { EnabledState = newValue; EnabledState_isNULL = false; return OK; } int getOtherEnabledState(string& value) const { if (OtherEnabledState_isNULL==true) return NOT_FOUND; value = OtherEnabledState; return OK; } int setOtherEnabledState(const string& newValue) { OtherEnabledState = newValue; OtherEnabledState_isNULL = false; return OK; } int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL==true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getEnabledDefault(unsigned short& value) const { if (EnabledDefault_isNULL==true) return NOT_FOUND; value = EnabledDefault; return OK; } int setEnabledDefault(const unsigned short& newValue) { EnabledDefault = newValue; EnabledDefault_isNULL = false; return OK; } int getTimeOfLastStateChange(string& value) const { if (TimeOfLastStateChange_isNULL==true) return NOT_FOUND; value = TimeOfLastStateChange; return OK; } int setTimeOfLastStateChange(const string& newValue) { TimeOfLastStateChange = newValue; TimeOfLastStateChange_isNULL = false; return OK; } int getAvailableRequestedStates(vector& value) const { if (AvailableRequestedStates_isNULL==true) return NOT_FOUND; value = AvailableRequestedStates; return OK; } int setAvailableRequestedStates(const vector& newValue) { AvailableRequestedStates = newValue; AvailableRequestedStates_isNULL = false; return OK; } int getTransitioningToState(unsigned short& value) const { if (TransitioningToState_isNULL==true) return NOT_FOUND; value = TransitioningToState; return OK; } int setTransitioningToState(const unsigned short& newValue) { TransitioningToState = newValue; TransitioningToState_isNULL = false; return OK; } int getSystemCreationClassName(string& value) const { if (SystemCreationClassName_isNULL==true) return NOT_FOUND; value = SystemCreationClassName; return OK; } int setSystemCreationClassName(const string& newValue) { SystemCreationClassName = newValue; SystemCreationClassName_isNULL = false; return OK; } int getSystemName(string& value) const { if (SystemName_isNULL==true) return NOT_FOUND; value = SystemName; return OK; } int setSystemName(const string& newValue) { SystemName = newValue; SystemName_isNULL = false; return OK; } int getCreationClassName(string& value) const { if (CreationClassName_isNULL==true) return NOT_FOUND; value = CreationClassName; return OK; } int setCreationClassName(const string& newValue) { CreationClassName = newValue; CreationClassName_isNULL = false; return OK; } int getDeviceID(string& value) const { if (DeviceID_isNULL==true) return NOT_FOUND; value = DeviceID; return OK; } int setDeviceID(const string& newValue) { DeviceID = newValue; DeviceID_isNULL = false; return OK; } int getPowerManagementSupported(bool& value) const { if (PowerManagementSupported_isNULL==true) return NOT_FOUND; value = PowerManagementSupported; return OK; } int setPowerManagementSupported(const bool& newValue) { PowerManagementSupported = newValue; PowerManagementSupported_isNULL = false; return OK; } int getPowerManagementCapabilities(vector& value) const { if (PowerManagementCapabilities_isNULL==true) return NOT_FOUND; value = PowerManagementCapabilities; return OK; } int setPowerManagementCapabilities(const vector& newValue) { PowerManagementCapabilities = newValue; PowerManagementCapabilities_isNULL = false; return OK; } int getAvailability(unsigned short& value) const { if (Availability_isNULL==true) return NOT_FOUND; value = Availability; return OK; } int setAvailability(const unsigned short& newValue) { Availability = newValue; Availability_isNULL = false; return OK; } int getStatusInfo(unsigned short& value) const { if (StatusInfo_isNULL==true) return NOT_FOUND; value = StatusInfo; return OK; } int setStatusInfo(const unsigned short& newValue) { StatusInfo = newValue; StatusInfo_isNULL = false; return OK; } int getLastErrorCode(unsigned int& value) const { if (LastErrorCode_isNULL==true) return NOT_FOUND; value = LastErrorCode; return OK; } int setLastErrorCode(const unsigned int& newValue) { LastErrorCode = newValue; LastErrorCode_isNULL = false; return OK; } int getErrorDescription(string& value) const { if (ErrorDescription_isNULL==true) return NOT_FOUND; value = ErrorDescription; return OK; } int setErrorDescription(const string& newValue) { ErrorDescription = newValue; ErrorDescription_isNULL = false; return OK; } int getErrorCleared(bool& value) const { if (ErrorCleared_isNULL==true) return NOT_FOUND; value = ErrorCleared; return OK; } int setErrorCleared(const bool& newValue) { ErrorCleared = newValue; ErrorCleared_isNULL = false; return OK; } int getOtherIdentifyingInfo(vector& value) const { if (OtherIdentifyingInfo_isNULL==true) return NOT_FOUND; value = OtherIdentifyingInfo; return OK; } int setOtherIdentifyingInfo(const vector& newValue) { OtherIdentifyingInfo = newValue; OtherIdentifyingInfo_isNULL = false; return OK; } int getPowerOnHours(unsigned long long& value) const { if (PowerOnHours_isNULL==true) return NOT_FOUND; value = PowerOnHours; return OK; } int setPowerOnHours(const unsigned long long& newValue) { PowerOnHours = newValue; PowerOnHours_isNULL = false; return OK; } int getTotalPowerOnHours(unsigned long long& value) const { if (TotalPowerOnHours_isNULL==true) return NOT_FOUND; value = TotalPowerOnHours; return OK; } int setTotalPowerOnHours(const unsigned long long& newValue) { TotalPowerOnHours = newValue; TotalPowerOnHours_isNULL = false; return OK; } int getIdentifyingDescriptions(vector& value) const { if (IdentifyingDescriptions_isNULL==true) return NOT_FOUND; value = IdentifyingDescriptions; return OK; } int setIdentifyingDescriptions(const vector& newValue) { IdentifyingDescriptions = newValue; IdentifyingDescriptions_isNULL = false; return OK; } int getAdditionalAvailability(vector& value) const { if (AdditionalAvailability_isNULL==true) return NOT_FOUND; value = AdditionalAvailability; return OK; } int setAdditionalAvailability(const vector& newValue) { AdditionalAvailability = newValue; AdditionalAvailability_isNULL = false; return OK; } int getMaxQuiesceTime(unsigned long long& value) const { if (MaxQuiesceTime_isNULL==true) return NOT_FOUND; value = MaxQuiesceTime; return OK; } int setMaxQuiesceTime(const unsigned long long& newValue) { MaxQuiesceTime = newValue; MaxQuiesceTime_isNULL = false; return OK; } int getLocationIndicator(unsigned short& value) const { if (LocationIndicator_isNULL==true) return NOT_FOUND; value = LocationIndicator; return OK; } int setLocationIndicator(const unsigned short& newValue) { LocationIndicator = newValue; LocationIndicator_isNULL = false; return OK; } int getDataOrganization(unsigned short& value) const { if (DataOrganization_isNULL==true) return NOT_FOUND; value = DataOrganization; return OK; } int setDataOrganization(const unsigned short& newValue) { DataOrganization = newValue; DataOrganization_isNULL = false; return OK; } int getPurpose(string& value) const { if (Purpose_isNULL==true) return NOT_FOUND; value = Purpose; return OK; } int setPurpose(const string& newValue) { Purpose = newValue; Purpose_isNULL = false; return OK; } int getAccess(unsigned short& value) const { if (Access_isNULL==true) return NOT_FOUND; value = Access; return OK; } int setAccess(const unsigned short& newValue) { Access = newValue; Access_isNULL = false; return OK; } int getBlockSize(unsigned long long& value) const { if (BlockSize_isNULL==true) return NOT_FOUND; value = BlockSize; return OK; } int setBlockSize(const unsigned long long& newValue) { BlockSize = newValue; BlockSize_isNULL = false; return OK; } int getNumberOfBlocks(unsigned long long& value) const { if (NumberOfBlocks_isNULL==true) return NOT_FOUND; value = NumberOfBlocks; return OK; } int setNumberOfBlocks(const unsigned long long& newValue) { NumberOfBlocks = newValue; NumberOfBlocks_isNULL = false; return OK; } int getConsumableBlocks(unsigned long long& value) const { if (ConsumableBlocks_isNULL==true) return NOT_FOUND; value = ConsumableBlocks; return OK; } int setConsumableBlocks(const unsigned long long& newValue) { ConsumableBlocks = newValue; ConsumableBlocks_isNULL = false; return OK; } int getIsBasedOnUnderlyingRedundancy(bool& value) const { if (IsBasedOnUnderlyingRedundancy_isNULL==true) return NOT_FOUND; value = IsBasedOnUnderlyingRedundancy; return OK; } int setIsBasedOnUnderlyingRedundancy(const bool& newValue) { IsBasedOnUnderlyingRedundancy = newValue; IsBasedOnUnderlyingRedundancy_isNULL = false; return OK; } int getSequentialAccess(bool& value) const { if (SequentialAccess_isNULL==true) return NOT_FOUND; value = SequentialAccess; return OK; } int setSequentialAccess(const bool& newValue) { SequentialAccess = newValue; SequentialAccess_isNULL = false; return OK; } int getExtentStatus(vector& value) const { if (ExtentStatus_isNULL==true) return NOT_FOUND; value = ExtentStatus; return OK; } int setExtentStatus(const vector& newValue) { ExtentStatus = newValue; ExtentStatus_isNULL = false; return OK; } int getNoSinglePointOfFailure(bool& value) const { if (NoSinglePointOfFailure_isNULL==true) return NOT_FOUND; value = NoSinglePointOfFailure; return OK; } int setNoSinglePointOfFailure(const bool& newValue) { NoSinglePointOfFailure = newValue; NoSinglePointOfFailure_isNULL = false; return OK; } int getDataRedundancy(unsigned short& value) const { if (DataRedundancy_isNULL==true) return NOT_FOUND; value = DataRedundancy; return OK; } int setDataRedundancy(const unsigned short& newValue) { DataRedundancy = newValue; DataRedundancy_isNULL = false; return OK; } int getPackageRedundancy(unsigned short& value) const { if (PackageRedundancy_isNULL==true) return NOT_FOUND; value = PackageRedundancy; return OK; } int setPackageRedundancy(const unsigned short& newValue) { PackageRedundancy = newValue; PackageRedundancy_isNULL = false; return OK; } int getDeltaReservation(unsigned char& value) const { if (DeltaReservation_isNULL==true) return NOT_FOUND; value = DeltaReservation; return OK; } int setDeltaReservation(const unsigned char& newValue) { DeltaReservation = newValue; DeltaReservation_isNULL = false; return OK; } int getPrimordial(bool& value) const { if (Primordial_isNULL==true) return NOT_FOUND; value = Primordial; return OK; } int setPrimordial(const bool& newValue) { Primordial = newValue; Primordial_isNULL = false; return OK; } int getName(string& value) const { if (Name_isNULL==true) return NOT_FOUND; value = Name; return OK; } int setName(const string& newValue) { Name = newValue; Name_isNULL = false; return OK; } int getNameFormat(unsigned short& value) const { if (NameFormat_isNULL==true) return NOT_FOUND; value = NameFormat; return OK; } int setNameFormat(const unsigned short& newValue) { NameFormat = newValue; NameFormat_isNULL = false; return OK; } int getNameNamespace(unsigned short& value) const { if (NameNamespace_isNULL==true) return NOT_FOUND; value = NameNamespace; return OK; } int setNameNamespace(const unsigned short& newValue) { NameNamespace = newValue; NameNamespace_isNULL = false; return OK; } int getOtherNameNamespace(string& value) const { if (OtherNameNamespace_isNULL==true) return NOT_FOUND; value = OtherNameNamespace; return OK; } int setOtherNameNamespace(const string& newValue) { OtherNameNamespace = newValue; OtherNameNamespace_isNULL = false; return OK; } int getOtherNameFormat(string& value) const { if (OtherNameFormat_isNULL==true) return NOT_FOUND; value = OtherNameFormat; return OK; } int setOtherNameFormat(const string& newValue) { OtherNameFormat = newValue; OtherNameFormat_isNULL = false; return OK; } int getUsage(unsigned short& value) const { if (Usage_isNULL==true) return NOT_FOUND; value = Usage; return OK; } int setUsage(const unsigned short& newValue) { Usage = newValue; Usage_isNULL = false; return OK; } int getOtherUsageDescription(string& value) const { if (OtherUsageDescription_isNULL==true) return NOT_FOUND; value = OtherUsageDescription; return OK; } int setOtherUsageDescription(const string& newValue) { OtherUsageDescription = newValue; OtherUsageDescription_isNULL = false; return OK; } int getClientSettableUsage(vector& value) const { if (ClientSettableUsage_isNULL==true) return NOT_FOUND; value = ClientSettableUsage; return OK; } int setClientSettableUsage(const vector& newValue) { ClientSettableUsage = newValue; ClientSettableUsage_isNULL = false; return OK; } int getVolatile(bool& value) const { if (Volatile_isNULL==true) return NOT_FOUND; value = Volatile; return OK; } int setVolatile(const bool& newValue) { Volatile = newValue; Volatile_isNULL = false; return OK; } int getErrorMethodology(string& value) const { if (ErrorMethodology_isNULL==true) return NOT_FOUND; value = ErrorMethodology; return OK; } int setErrorMethodology(const string& newValue) { ErrorMethodology = newValue; ErrorMethodology_isNULL = false; return OK; } int getStartingAddress(unsigned long long& value) const { if (StartingAddress_isNULL==true) return NOT_FOUND; value = StartingAddress; return OK; } int setStartingAddress(const unsigned long long& newValue) { StartingAddress = newValue; StartingAddress_isNULL = false; return OK; } int getEndingAddress(unsigned long long& value) const { if (EndingAddress_isNULL==true) return NOT_FOUND; value = EndingAddress; return OK; } int setEndingAddress(const unsigned long long& newValue) { EndingAddress = newValue; EndingAddress_isNULL = false; return OK; } int getErrorInfo(unsigned short& value) const { if (ErrorInfo_isNULL==true) return NOT_FOUND; value = ErrorInfo; return OK; } int setErrorInfo(const unsigned short& newValue) { ErrorInfo = newValue; ErrorInfo_isNULL = false; return OK; } int getOtherErrorDescription(string& value) const { if (OtherErrorDescription_isNULL==true) return NOT_FOUND; value = OtherErrorDescription; return OK; } int setOtherErrorDescription(const string& newValue) { OtherErrorDescription = newValue; OtherErrorDescription_isNULL = false; return OK; } int getCorrectableError(bool& value) const { if (CorrectableError_isNULL==true) return NOT_FOUND; value = CorrectableError; return OK; } int setCorrectableError(const bool& newValue) { CorrectableError = newValue; CorrectableError_isNULL = false; return OK; } int getErrorTime(string& value) const { if (ErrorTime_isNULL==true) return NOT_FOUND; value = ErrorTime; return OK; } int setErrorTime(const string& newValue) { ErrorTime = newValue; ErrorTime_isNULL = false; return OK; } int getErrorAccess(unsigned short& value) const { if (ErrorAccess_isNULL==true) return NOT_FOUND; value = ErrorAccess; return OK; } int setErrorAccess(const unsigned short& newValue) { ErrorAccess = newValue; ErrorAccess_isNULL = false; return OK; } int getErrorTransferSize(unsigned int& value) const { if (ErrorTransferSize_isNULL==true) return NOT_FOUND; value = ErrorTransferSize; return OK; } int setErrorTransferSize(const unsigned int& newValue) { ErrorTransferSize = newValue; ErrorTransferSize_isNULL = false; return OK; } int getErrorData(vector& value) const { if (ErrorData_isNULL==true) return NOT_FOUND; value = ErrorData; return OK; } int setErrorData(const vector& newValue) { ErrorData = newValue; ErrorData_isNULL = false; return OK; } int getErrorDataOrder(unsigned short& value) const { if (ErrorDataOrder_isNULL==true) return NOT_FOUND; value = ErrorDataOrder; return OK; } int setErrorDataOrder(const unsigned short& newValue) { ErrorDataOrder = newValue; ErrorDataOrder_isNULL = false; return OK; } int getErrorAddress(unsigned long long& value) const { if (ErrorAddress_isNULL==true) return NOT_FOUND; value = ErrorAddress; return OK; } int setErrorAddress(const unsigned long long& newValue) { ErrorAddress = newValue; ErrorAddress_isNULL = false; return OK; } int getSystemLevelAddress(bool& value) const { if (SystemLevelAddress_isNULL==true) return NOT_FOUND; value = SystemLevelAddress; return OK; } int setSystemLevelAddress(const bool& newValue) { SystemLevelAddress = newValue; SystemLevelAddress_isNULL = false; return OK; } int getErrorResolution(unsigned long long& value) const { if (ErrorResolution_isNULL==true) return NOT_FOUND; value = ErrorResolution; return OK; } int setErrorResolution(const unsigned long long& newValue) { ErrorResolution = newValue; ErrorResolution_isNULL = false; return OK; } int getAdditionalErrorData(vector& value) const { if (AdditionalErrorData_isNULL==true) return NOT_FOUND; value = AdditionalErrorData; return OK; } int setAdditionalErrorData(const vector& newValue) { AdditionalErrorData = newValue; AdditionalErrorData_isNULL = false; return OK; } }; class OpenDRIM_CacheMemory_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_CacheMemory_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_CacheMemory_RequestStateChange_In() {} int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL == true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getJob(Objectpath& value) const { if (Job_isNULL == true) return NOT_FOUND; value = Job; return OK; } int setJob(const Objectpath& newValue) { Job = newValue; Job_isNULL = false; return OK; } int getTimeoutPeriod(string& value) const { if (TimeoutPeriod_isNULL == true) return NOT_FOUND; value = TimeoutPeriod; return OK; } int setTimeoutPeriod(const string& newValue) { TimeoutPeriod = newValue; TimeoutPeriod_isNULL = false; return OK; } }; class OpenDRIM_CacheMemory_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_CacheMemory_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_CacheMemory_RequestStateChange_Out() {} int getJob(Objectpath& value) const { if (Job_isNULL == true) return NOT_FOUND; value = Job; return OK; } int setJob(const Objectpath& newValue) { Job = newValue; Job_isNULL = false; return OK; } }; class OpenDRIM_CacheMemory_SetPowerState_In { public: unsigned short PowerState; bool PowerState_isNULL; string Time; bool Time_isNULL; OpenDRIM_CacheMemory_SetPowerState_In() { PowerState_isNULL = true; Time_isNULL = true; } ~OpenDRIM_CacheMemory_SetPowerState_In() {} int getPowerState(unsigned short& value) const { if (PowerState_isNULL == true) return NOT_FOUND; value = PowerState; return OK; } int setPowerState(const unsigned short& newValue) { PowerState = newValue; PowerState_isNULL = false; return OK; } int getTime(string& value) const { if (Time_isNULL == true) return NOT_FOUND; value = Time; return OK; } int setTime(const string& newValue) { Time = newValue; Time_isNULL = false; return OK; } }; class OpenDRIM_CacheMemory_EnableDevice_In { public: bool Enabled; bool Enabled_isNULL; OpenDRIM_CacheMemory_EnableDevice_In() { Enabled_isNULL = true; } ~OpenDRIM_CacheMemory_EnableDevice_In() {} int getEnabled(bool& value) const { if (Enabled_isNULL == true) return NOT_FOUND; value = Enabled; return OK; } int setEnabled(const bool& newValue) { Enabled = newValue; Enabled_isNULL = false; return OK; } }; class OpenDRIM_CacheMemory_OnlineDevice_In { public: bool Online; bool Online_isNULL; OpenDRIM_CacheMemory_OnlineDevice_In() { Online_isNULL = true; } ~OpenDRIM_CacheMemory_OnlineDevice_In() {} int getOnline(bool& value) const { if (Online_isNULL == true) return NOT_FOUND; value = Online; return OK; } int setOnline(const bool& newValue) { Online = newValue; Online_isNULL = false; return OK; } }; class OpenDRIM_CacheMemory_QuiesceDevice_In { public: bool Quiesce; bool Quiesce_isNULL; OpenDRIM_CacheMemory_QuiesceDevice_In() { Quiesce_isNULL = true; } ~OpenDRIM_CacheMemory_QuiesceDevice_In() {} int getQuiesce(bool& value) const { if (Quiesce_isNULL == true) return NOT_FOUND; value = Quiesce; return OK; } int setQuiesce(const bool& newValue) { Quiesce = newValue; Quiesce_isNULL = false; return OK; } }; #endif /*OPENDRIM_CACHEMEMORY_H_*/ opendrim-lmp-cpu-1.1.0~ppa/OpenDRIM_CacheMemory/cmpiOpenDRIM_CacheMemory.cpp0000644000175000017500000005257611400667756027424 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), CPU provider package # Copyright (C) 2007 Frederic Desmons, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # 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; version 2 # of the License. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Rakhimov Rustam, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_CacheMemory.h" CMPIObjectPath* CPU_OpenDRIM_CacheMemory_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_CacheMemory& instance) { _E_; Objectpath op(broker, OpenDRIM_CacheMemory_classnames[0], OpenDRIM_CacheMemory_NAMESPACE); if (!instance.SystemCreationClassName_isNULL) op.addKey("SystemCreationClassName", instance.SystemCreationClassName); if (!instance.SystemName_isNULL) op.addKey("SystemName", instance.SystemName); if (!instance.CreationClassName_isNULL) op.addKey("CreationClassName", instance.CreationClassName); if (!instance.DeviceID_isNULL) op.addKey("DeviceID", instance.DeviceID); _L_; return op.getHdl(); } CMPIInstance* CPU_OpenDRIM_CacheMemory_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_CacheMemory& instance) { _E_; Objectpath op(broker, CPU_OpenDRIM_CacheMemory_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.InstallDate_isNULL) ci.setPropertyDatetime("InstallDate", instance.InstallDate); if (!instance.OperationalStatus_isNULL) ci.setProperty("OperationalStatus", instance.OperationalStatus); if (!instance.StatusDescriptions_isNULL) ci.setProperty("StatusDescriptions", instance.StatusDescriptions); if (!instance.Status_isNULL) ci.setProperty("Status", instance.Status); if (!instance.HealthState_isNULL) ci.setProperty("HealthState", instance.HealthState); if (!instance.PrimaryStatus_isNULL) ci.setProperty("PrimaryStatus", instance.PrimaryStatus); if (!instance.DetailedStatus_isNULL) ci.setProperty("DetailedStatus", instance.DetailedStatus); if (!instance.OperatingStatus_isNULL) ci.setProperty("OperatingStatus", instance.OperatingStatus); if (!instance.CommunicationStatus_isNULL) ci.setProperty("CommunicationStatus", instance.CommunicationStatus); if (!instance.EnabledState_isNULL) ci.setProperty("EnabledState", instance.EnabledState); if (!instance.OtherEnabledState_isNULL) ci.setProperty("OtherEnabledState", instance.OtherEnabledState); if (!instance.RequestedState_isNULL) ci.setProperty("RequestedState", instance.RequestedState); if (!instance.EnabledDefault_isNULL) ci.setProperty("EnabledDefault", instance.EnabledDefault); if (!instance.TimeOfLastStateChange_isNULL) ci.setPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange); if (!instance.AvailableRequestedStates_isNULL) ci.setProperty("AvailableRequestedStates", instance.AvailableRequestedStates); if (!instance.TransitioningToState_isNULL) ci.setProperty("TransitioningToState", instance.TransitioningToState); if (!instance.PowerManagementSupported_isNULL) ci.setProperty("PowerManagementSupported", instance.PowerManagementSupported); if (!instance.PowerManagementCapabilities_isNULL) ci.setProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities); if (!instance.Availability_isNULL) ci.setProperty("Availability", instance.Availability); if (!instance.StatusInfo_isNULL) ci.setProperty("StatusInfo", instance.StatusInfo); if (!instance.LastErrorCode_isNULL) ci.setProperty("LastErrorCode", instance.LastErrorCode); if (!instance.ErrorDescription_isNULL) ci.setProperty("ErrorDescription", instance.ErrorDescription); if (!instance.ErrorCleared_isNULL) ci.setProperty("ErrorCleared", instance.ErrorCleared); if (!instance.OtherIdentifyingInfo_isNULL) ci.setProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo); if (!instance.PowerOnHours_isNULL) ci.setProperty("PowerOnHours", instance.PowerOnHours); if (!instance.TotalPowerOnHours_isNULL) ci.setProperty("TotalPowerOnHours", instance.TotalPowerOnHours); if (!instance.IdentifyingDescriptions_isNULL) ci.setProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions); if (!instance.AdditionalAvailability_isNULL) ci.setProperty("AdditionalAvailability", instance.AdditionalAvailability); if (!instance.MaxQuiesceTime_isNULL) ci.setProperty("MaxQuiesceTime", instance.MaxQuiesceTime); if (!instance.LocationIndicator_isNULL) ci.setProperty("LocationIndicator", instance.LocationIndicator); if (!instance.DataOrganization_isNULL) ci.setProperty("DataOrganization", instance.DataOrganization); if (!instance.Purpose_isNULL) ci.setProperty("Purpose", instance.Purpose); if (!instance.Access_isNULL) ci.setProperty("Access", instance.Access); if (!instance.BlockSize_isNULL) ci.setProperty("BlockSize", instance.BlockSize); if (!instance.NumberOfBlocks_isNULL) ci.setProperty("NumberOfBlocks", instance.NumberOfBlocks); if (!instance.ConsumableBlocks_isNULL) ci.setProperty("ConsumableBlocks", instance.ConsumableBlocks); if (!instance.IsBasedOnUnderlyingRedundancy_isNULL) ci.setProperty("IsBasedOnUnderlyingRedundancy", instance.IsBasedOnUnderlyingRedundancy); if (!instance.SequentialAccess_isNULL) ci.setProperty("SequentialAccess", instance.SequentialAccess); if (!instance.ExtentStatus_isNULL) ci.setProperty("ExtentStatus", instance.ExtentStatus); if (!instance.NoSinglePointOfFailure_isNULL) ci.setProperty("NoSinglePointOfFailure", instance.NoSinglePointOfFailure); if (!instance.DataRedundancy_isNULL) ci.setProperty("DataRedundancy", instance.DataRedundancy); if (!instance.PackageRedundancy_isNULL) ci.setProperty("PackageRedundancy", instance.PackageRedundancy); if (!instance.DeltaReservation_isNULL) ci.setProperty("DeltaReservation", instance.DeltaReservation); if (!instance.Primordial_isNULL) ci.setProperty("Primordial", instance.Primordial); if (!instance.Name_isNULL) ci.setProperty("Name", instance.Name); if (!instance.NameFormat_isNULL) ci.setProperty("NameFormat", instance.NameFormat); if (!instance.NameNamespace_isNULL) ci.setProperty("NameNamespace", instance.NameNamespace); if (!instance.OtherNameNamespace_isNULL) ci.setProperty("OtherNameNamespace", instance.OtherNameNamespace); if (!instance.OtherNameFormat_isNULL) ci.setProperty("OtherNameFormat", instance.OtherNameFormat); if (!instance.Usage_isNULL) ci.setProperty("Usage", instance.Usage); if (!instance.OtherUsageDescription_isNULL) ci.setProperty("OtherUsageDescription", instance.OtherUsageDescription); if (!instance.ClientSettableUsage_isNULL) ci.setProperty("ClientSettableUsage", instance.ClientSettableUsage); if (!instance.Volatile_isNULL) ci.setProperty("Volatile", instance.Volatile); if (!instance.ErrorMethodology_isNULL) ci.setProperty("ErrorMethodology", instance.ErrorMethodology); if (!instance.StartingAddress_isNULL) ci.setProperty("StartingAddress", instance.StartingAddress); if (!instance.EndingAddress_isNULL) ci.setProperty("EndingAddress", instance.EndingAddress); if (!instance.ErrorInfo_isNULL) ci.setProperty("ErrorInfo", instance.ErrorInfo); if (!instance.OtherErrorDescription_isNULL) ci.setProperty("OtherErrorDescription", instance.OtherErrorDescription); if (!instance.CorrectableError_isNULL) ci.setProperty("CorrectableError", instance.CorrectableError); if (!instance.ErrorTime_isNULL) ci.setPropertyDatetime("ErrorTime", instance.ErrorTime); if (!instance.ErrorAccess_isNULL) ci.setProperty("ErrorAccess", instance.ErrorAccess); if (!instance.ErrorTransferSize_isNULL) ci.setProperty("ErrorTransferSize", instance.ErrorTransferSize); if (!instance.ErrorData_isNULL) ci.setProperty("ErrorData", instance.ErrorData); if (!instance.ErrorDataOrder_isNULL) ci.setProperty("ErrorDataOrder", instance.ErrorDataOrder); if (!instance.ErrorAddress_isNULL) ci.setProperty("ErrorAddress", instance.ErrorAddress); if (!instance.SystemLevelAddress_isNULL) ci.setProperty("SystemLevelAddress", instance.SystemLevelAddress); if (!instance.ErrorResolution_isNULL) ci.setProperty("ErrorResolution", instance.ErrorResolution); if (!instance.AdditionalErrorData_isNULL) ci.setProperty("AdditionalErrorData", instance.AdditionalErrorData); _L_; return ci.getHdl(); } void CPU_OpenDRIM_CacheMemory_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_CacheMemory& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (op.getKey("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (op.getKey("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (op.getKey("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; _L_; } void CPU_OpenDRIM_CacheMemory_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_CacheMemory& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getPropertyDatetime("InstallDate", instance.InstallDate) == OK) instance.InstallDate_isNULL = false; if (inst.getProperty("OperationalStatus", instance.OperationalStatus) == OK) instance.OperationalStatus_isNULL = false; if (inst.getProperty("StatusDescriptions", instance.StatusDescriptions) == OK) instance.StatusDescriptions_isNULL = false; if (inst.getProperty("Status", instance.Status) == OK) instance.Status_isNULL = false; if (inst.getProperty("HealthState", instance.HealthState) == OK) instance.HealthState_isNULL = false; if (inst.getProperty("PrimaryStatus", instance.PrimaryStatus) == OK) instance.PrimaryStatus_isNULL = false; if (inst.getProperty("DetailedStatus", instance.DetailedStatus) == OK) instance.DetailedStatus_isNULL = false; if (inst.getProperty("OperatingStatus", instance.OperatingStatus) == OK) instance.OperatingStatus_isNULL = false; if (inst.getProperty("CommunicationStatus", instance.CommunicationStatus) == OK) instance.CommunicationStatus_isNULL = false; if (inst.getProperty("EnabledState", instance.EnabledState) == OK) instance.EnabledState_isNULL = false; if (inst.getProperty("OtherEnabledState", instance.OtherEnabledState) == OK) instance.OtherEnabledState_isNULL = false; if (inst.getProperty("RequestedState", instance.RequestedState) == OK) instance.RequestedState_isNULL = false; if (inst.getProperty("EnabledDefault", instance.EnabledDefault) == OK) instance.EnabledDefault_isNULL = false; if (inst.getPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange) == OK) instance.TimeOfLastStateChange_isNULL = false; if (inst.getProperty("AvailableRequestedStates", instance.AvailableRequestedStates) == OK) instance.AvailableRequestedStates_isNULL = false; if (inst.getProperty("TransitioningToState", instance.TransitioningToState) == OK) instance.TransitioningToState_isNULL = false; if (inst.getProperty("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (inst.getProperty("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (inst.getProperty("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; if (inst.getProperty("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (inst.getProperty("PowerManagementSupported", instance.PowerManagementSupported) == OK) instance.PowerManagementSupported_isNULL = false; if (inst.getProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities) == OK) instance.PowerManagementCapabilities_isNULL = false; if (inst.getProperty("Availability", instance.Availability) == OK) instance.Availability_isNULL = false; if (inst.getProperty("StatusInfo", instance.StatusInfo) == OK) instance.StatusInfo_isNULL = false; if (inst.getProperty("LastErrorCode", instance.LastErrorCode) == OK) instance.LastErrorCode_isNULL = false; if (inst.getProperty("ErrorDescription", instance.ErrorDescription) == OK) instance.ErrorDescription_isNULL = false; if (inst.getProperty("ErrorCleared", instance.ErrorCleared) == OK) instance.ErrorCleared_isNULL = false; if (inst.getProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo) == OK) instance.OtherIdentifyingInfo_isNULL = false; if (inst.getProperty("PowerOnHours", instance.PowerOnHours) == OK) instance.PowerOnHours_isNULL = false; if (inst.getProperty("TotalPowerOnHours", instance.TotalPowerOnHours) == OK) instance.TotalPowerOnHours_isNULL = false; if (inst.getProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions) == OK) instance.IdentifyingDescriptions_isNULL = false; if (inst.getProperty("AdditionalAvailability", instance.AdditionalAvailability) == OK) instance.AdditionalAvailability_isNULL = false; if (inst.getProperty("MaxQuiesceTime", instance.MaxQuiesceTime) == OK) instance.MaxQuiesceTime_isNULL = false; if (inst.getProperty("LocationIndicator", instance.LocationIndicator) == OK) instance.LocationIndicator_isNULL = false; if (inst.getProperty("DataOrganization", instance.DataOrganization) == OK) instance.DataOrganization_isNULL = false; if (inst.getProperty("Purpose", instance.Purpose) == OK) instance.Purpose_isNULL = false; if (inst.getProperty("Access", instance.Access) == OK) instance.Access_isNULL = false; if (inst.getProperty("BlockSize", instance.BlockSize) == OK) instance.BlockSize_isNULL = false; if (inst.getProperty("NumberOfBlocks", instance.NumberOfBlocks) == OK) instance.NumberOfBlocks_isNULL = false; if (inst.getProperty("ConsumableBlocks", instance.ConsumableBlocks) == OK) instance.ConsumableBlocks_isNULL = false; if (inst.getProperty("IsBasedOnUnderlyingRedundancy", instance.IsBasedOnUnderlyingRedundancy) == OK) instance.IsBasedOnUnderlyingRedundancy_isNULL = false; if (inst.getProperty("SequentialAccess", instance.SequentialAccess) == OK) instance.SequentialAccess_isNULL = false; if (inst.getProperty("ExtentStatus", instance.ExtentStatus) == OK) instance.ExtentStatus_isNULL = false; if (inst.getProperty("NoSinglePointOfFailure", instance.NoSinglePointOfFailure) == OK) instance.NoSinglePointOfFailure_isNULL = false; if (inst.getProperty("DataRedundancy", instance.DataRedundancy) == OK) instance.DataRedundancy_isNULL = false; if (inst.getProperty("PackageRedundancy", instance.PackageRedundancy) == OK) instance.PackageRedundancy_isNULL = false; if (inst.getProperty("DeltaReservation", instance.DeltaReservation) == OK) instance.DeltaReservation_isNULL = false; if (inst.getProperty("Primordial", instance.Primordial) == OK) instance.Primordial_isNULL = false; if (inst.getProperty("Name", instance.Name) == OK) instance.Name_isNULL = false; if (inst.getProperty("NameFormat", instance.NameFormat) == OK) instance.NameFormat_isNULL = false; if (inst.getProperty("NameNamespace", instance.NameNamespace) == OK) instance.NameNamespace_isNULL = false; if (inst.getProperty("OtherNameNamespace", instance.OtherNameNamespace) == OK) instance.OtherNameNamespace_isNULL = false; if (inst.getProperty("OtherNameFormat", instance.OtherNameFormat) == OK) instance.OtherNameFormat_isNULL = false; if (inst.getProperty("Usage", instance.Usage) == OK) instance.Usage_isNULL = false; if (inst.getProperty("OtherUsageDescription", instance.OtherUsageDescription) == OK) instance.OtherUsageDescription_isNULL = false; if (inst.getProperty("ClientSettableUsage", instance.ClientSettableUsage) == OK) instance.ClientSettableUsage_isNULL = false; if (inst.getProperty("Volatile", instance.Volatile) == OK) instance.Volatile_isNULL = false; if (inst.getProperty("ErrorMethodology", instance.ErrorMethodology) == OK) instance.ErrorMethodology_isNULL = false; if (inst.getProperty("StartingAddress", instance.StartingAddress) == OK) instance.StartingAddress_isNULL = false; if (inst.getProperty("EndingAddress", instance.EndingAddress) == OK) instance.EndingAddress_isNULL = false; if (inst.getProperty("ErrorInfo", instance.ErrorInfo) == OK) instance.ErrorInfo_isNULL = false; if (inst.getProperty("OtherErrorDescription", instance.OtherErrorDescription) == OK) instance.OtherErrorDescription_isNULL = false; if (inst.getProperty("CorrectableError", instance.CorrectableError) == OK) instance.CorrectableError_isNULL = false; if (inst.getPropertyDatetime("ErrorTime", instance.ErrorTime) == OK) instance.ErrorTime_isNULL = false; if (inst.getProperty("ErrorAccess", instance.ErrorAccess) == OK) instance.ErrorAccess_isNULL = false; if (inst.getProperty("ErrorTransferSize", instance.ErrorTransferSize) == OK) instance.ErrorTransferSize_isNULL = false; if (inst.getProperty("ErrorData", instance.ErrorData) == OK) instance.ErrorData_isNULL = false; if (inst.getProperty("ErrorDataOrder", instance.ErrorDataOrder) == OK) instance.ErrorDataOrder_isNULL = false; if (inst.getProperty("ErrorAddress", instance.ErrorAddress) == OK) instance.ErrorAddress_isNULL = false; if (inst.getProperty("SystemLevelAddress", instance.SystemLevelAddress) == OK) instance.SystemLevelAddress_isNULL = false; if (inst.getProperty("ErrorResolution", instance.ErrorResolution) == OK) instance.ErrorResolution_isNULL = false; if (inst.getProperty("AdditionalErrorData", instance.AdditionalErrorData) == OK) instance.AdditionalErrorData_isNULL = false; _L_; } void CPU_OpenDRIM_CacheMemory_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_CacheMemory_RequestStateChange_In& args) { _E_; CMPIStatus rc; CMPIData data; unsigned short RequestedState; data = in->ft->getArg(in, "RequestedState", &rc); if (rc.rc == OK) { CT_ToC(data, RequestedState); args.setRequestedState(RequestedState); } Objectpath Job; data = in->ft->getArg(in, "Job", &rc); if (rc.rc == OK) { CT_ToC(broker, data, Job); args.setJob(Job); } string TimeoutPeriod; data = in->ft->getArg(in, "TimeoutPeriod", &rc); if (rc.rc == OK) { CT_ToCDatetime(data, TimeoutPeriod); args.setTimeoutPeriod(TimeoutPeriod); } _L_; } void CPU_OpenDRIM_CacheMemory_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_CacheMemory_RequestStateChange_Out& args) { _E_; CMPIValue value; int errorMessage; Objectpath Job; errorMessage = args.getJob(Job); if (errorMessage == OK) { value = CT_toCMPI(Job); out->ft->addArg(out, "Job", &value, CMPI_ref); } _L_; } void CPU_OpenDRIM_CacheMemory_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_CacheMemory_SetPowerState_In& args) { _E_; CMPIStatus rc; CMPIData data; unsigned short PowerState; data = in->ft->getArg(in, "PowerState", &rc); if (rc.rc == OK) { CT_ToC(data, PowerState); args.setPowerState(PowerState); } string Time; data = in->ft->getArg(in, "Time", &rc); if (rc.rc == OK) { CT_ToCDatetime(data, Time); args.setTime(Time); } _L_; } void CPU_OpenDRIM_CacheMemory_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_CacheMemory_EnableDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Enabled; data = in->ft->getArg(in, "Enabled", &rc); if (rc.rc == OK) { CT_ToC(data, Enabled); args.setEnabled(Enabled); } _L_; } void CPU_OpenDRIM_CacheMemory_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_CacheMemory_OnlineDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Online; data = in->ft->getArg(in, "Online", &rc); if (rc.rc == OK) { CT_ToC(data, Online); args.setOnline(Online); } _L_; } void CPU_OpenDRIM_CacheMemory_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_CacheMemory_QuiesceDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Quiesce; data = in->ft->getArg(in, "Quiesce", &rc); if (rc.rc == OK) { CT_ToC(data, Quiesce); args.setQuiesce(Quiesce); } _L_; } opendrim-lmp-cpu-1.1.0~ppa/README0000644000175000017500000000110211400667756017220 0ustar guillaumeguillaume--------------------------------------------------------- REQUIREMENTS --------------------------------------------------------- For compliling: * gcc >= 3.2.0 * cmpi header files >= ver 86 * autoconf >= 2.57 * automake >= 1.5 * libtool (preferably >= 1.8.5) * OpenDRIM Common Library >= 1.1.2 For running: * OpenPegasus >= 2.5.2 OR SBLIM sfcb >= 1.2.0 OR OpenWBEM >= 3.2.2 * Interop package (for sfcb and OpenPegasus only) * In the case of pegasus installed from sources, the PEGASUS_HOME and PEGASUS_ROOT variable MUST be defined! * OpenDRIM Base Server Package >= 1.0.0