opendrim-lmp-os-1.1.0~ppa/0000755000175000017500000000000011400673710016163 5ustar guillaumeguillaumeopendrim-lmp-os-1.1.0~ppa/Makefile.am0000644000175000017500000001144511400673710020224 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ VENDOR = OpenDRIM VERSION = $(shell cat ./VERSION) APP_NAME = opendrim-lmp-os RPM_PACKAGE_DIR = packaging PLATFORM = $(shell rpm --eval %_target_cpu) WORKING_DIR = $(shell pwd) SUBDIRS = Common OpenDRIM_OperatingSystemCurrentRunLevel OpenDRIM_OperatingSystem OpenDRIM_RegisteredOSProfile OpenDRIM_OperatingSystemDefaultRunLevel OpenDRIM_OperatingSystemLoadAverages OpenDRIM_BootOSFromFS OpenDRIM_InstalledOS OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel OpenDRIM_OSConformsToProfile OpenDRIM_RunningOS OpenDRIM_OperatingSystemStatistics OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel test postinstall: registration/OS.sh @CIMNAMESPACE@ $(VENDOR) @CIMSERVER@ @INTEROPNAMESPACE@ $(VERSION) . preuninstall: registration/OS-remove.sh @CIMNAMESPACE@ @CIMSERVER@ @INTEROPNAMESPACE@ . test-OpenDRIM_BootOSFromFS: all make -C test test-OpenDRIM_BootOSFromFS test-OpenDRIM_InstalledOS: all make -C test test-OpenDRIM_InstalledOS test-OpenDRIM_OperatingSystemCurrentRunLevel: all make -C test test-OpenDRIM_OperatingSystemCurrentRunLevel test-OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel: all make -C test test-OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel test-OpenDRIM_OSConformsToProfile: all make -C test test-OpenDRIM_OSConformsToProfile test-OpenDRIM_OperatingSystem: all make -C test test-OpenDRIM_OperatingSystem test-OpenDRIM_RegisteredOSProfile: all make -C test test-OpenDRIM_RegisteredOSProfile test-OpenDRIM_RunningOS: all make -C test test-OpenDRIM_RunningOS test-OpenDRIM_OperatingSystemStatistics: all make -C test test-OpenDRIM_OperatingSystemStatistics test-OpenDRIM_OperatingSystemDefaultRunLevel: all make -C test test-OpenDRIM_OperatingSystemDefaultRunLevel test-OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel: all make -C test test-OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel test-OpenDRIM_OperatingSystemLoadAverages: all make -C test test-OpenDRIM_OperatingSystemLoadAverages 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-os-1.1.0~ppa/registration/0000755000175000017500000000000011400673710020675 5ustar guillaumeguillaumeopendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_OperatingSystemDefaultRunLevel.sh0000755000175000017500000000712611400673710031016 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_OperatingSystemDefaultRunLevel.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_OperatingSystemDefaultRunLevel provider module"; Name = "OS_OpenDRIM_OperatingSystemDefaultRunLevelModule"; Location = "cmpiOS_OpenDRIM_OperatingSystemDefaultRunLevelProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_OperatingSystemDefaultRunLevel provider"; Name = "OS_OpenDRIM_OperatingSystemDefaultRunLevelProvider"; ProviderModuleName = "OS_OpenDRIM_OperatingSystemDefaultRunLevelModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_OperatingSystemDefaultRunLevel provider capabilities"; ProviderModuleName = "OS_OpenDRIM_OperatingSystemDefaultRunLevelModule"; ProviderName = "OS_OpenDRIM_OperatingSystemDefaultRunLevelProvider"; ClassName = "OpenDRIM_OperatingSystemDefaultRunLevel"; ProviderType = {2}; Namespaces = {"$1"}; SupportedProperties = {"Caption", "Description", "InstanceID", "ElementName", "ConfigurationName", "ChangeableType", "Value"}; CapabilityID = "OS_OpenDRIM_OperatingSystemDefaultRunLevel"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_OperatingSystemDefaultRunLevel.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_OperatingSystem.sh0000755000175000017500000001015211400673710026025 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_OperatingSystem.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_OperatingSystem provider module"; Name = "OS_OpenDRIM_OperatingSystemModule"; Location = "cmpiOS_OpenDRIM_OperatingSystemProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_OperatingSystem provider"; Name = "OS_OpenDRIM_OperatingSystemProvider"; ProviderModuleName = "OS_OpenDRIM_OperatingSystemModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_OperatingSystem provider capabilities"; ProviderModuleName = "OS_OpenDRIM_OperatingSystemModule"; ProviderName = "OS_OpenDRIM_OperatingSystemProvider"; ClassName = "OpenDRIM_OperatingSystem"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"InstanceID", "Caption", "Description", "ElementName", "InstallDate", "OperationalStatus", "StatusDescriptions", "Status", "HealthState", "CommunicationStatus", "DetailedStatus", "OperatingStatus", "PrimaryStatus", "EnabledState", "OtherEnabledState", "RequestedState", "EnabledDefault", "TimeOfLastStateChange", "AvailableRequestedStates", "TransitioningToState", "CSCreationClassName", "CSName", "CreationClassName", "Name", "OSType", "OtherTypeDescription", "Version", "LastBootUpTime", "LocalDateTime", "CurrentTimeZone", "NumberOfLicensedUsers", "NumberOfUsers", "NumberOfProcesses", "MaxNumberOfProcesses", "TotalSwapSpaceSize", "TotalVirtualMemorySize", "FreeVirtualMemory", "FreePhysicalMemory", "TotalVisibleMemorySize", "SizeStoredInPagingFiles", "FreeSpaceInPagingFiles", "MaxProcessMemorySize", "Distributed", "MaxProcessesPerUser"}; SupportedMethods = {"RequestStateChange", "Shutdown", "Reboot"}; CapabilityID = "OS_OpenDRIM_OperatingSystem"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_OperatingSystem.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_BootOSFromFS.sh0000755000175000017500000000630311400673710025115 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_BootOSFromFS.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_BootOSFromFS provider module"; Name = "OS_OpenDRIM_BootOSFromFSModule"; Location = "cmpiOS_OpenDRIM_BootOSFromFSProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_BootOSFromFS provider"; Name = "OS_OpenDRIM_BootOSFromFSProvider"; ProviderModuleName = "OS_OpenDRIM_BootOSFromFSModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_BootOSFromFS provider capabilities"; ProviderModuleName = "OS_OpenDRIM_BootOSFromFSModule"; ProviderName = "OS_OpenDRIM_BootOSFromFSProvider"; ClassName = "OpenDRIM_BootOSFromFS"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent"}; CapabilityID = "OS_OpenDRIM_BootOSFromFS"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_BootOSFromFS.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_OperatingSystemDefaultRunLevel-remove.sh0000755000175000017500000000660311400673710032310 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m OS_OpenDRIM_OperatingSystemDefaultRunLevelModule cimprovider -r -m OS_OpenDRIM_OperatingSystemDefaultRunLevelModule 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_OperatingSystemDefaultRunLevel.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_BootOSFromFS-remove.sh0000755000175000017500000000633311400673710026413 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m OS_OpenDRIM_BootOSFromFSModule cimprovider -r -m OS_OpenDRIM_BootOSFromFSModule 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_BootOSFromFS.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_OperatingSystemStatistics.sh0000755000175000017500000000666311400673710030114 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_OperatingSystemStatistics.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_OperatingSystemStatistics provider module"; Name = "OS_OpenDRIM_OperatingSystemStatisticsModule"; Location = "cmpiOS_OpenDRIM_OperatingSystemStatisticsProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_OperatingSystemStatistics provider"; Name = "OS_OpenDRIM_OperatingSystemStatisticsProvider"; ProviderModuleName = "OS_OpenDRIM_OperatingSystemStatisticsModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_OperatingSystemStatistics provider capabilities"; ProviderModuleName = "OS_OpenDRIM_OperatingSystemStatisticsModule"; ProviderName = "OS_OpenDRIM_OperatingSystemStatisticsProvider"; ClassName = "OpenDRIM_OperatingSystemStatistics"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Stats", "Element"}; CapabilityID = "OS_OpenDRIM_OperatingSystemStatistics"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_OperatingSystemStatistics.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_OperatingSystemCurrentRunLevel-remove.sh0000755000175000017500000000660311400673710032346 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m OS_OpenDRIM_OperatingSystemCurrentRunLevelModule cimprovider -r -m OS_OpenDRIM_OperatingSystemCurrentRunLevelModule 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_OperatingSystemCurrentRunLevel.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_RunningOS-remove.sh0000755000175000017500000000627511400673710026060 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m OS_OpenDRIM_RunningOSModule cimprovider -r -m OS_OpenDRIM_RunningOSModule 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_RunningOS.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_OperatingSystem-remove.sh0000755000175000017500000000636411400673710027332 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m OS_OpenDRIM_OperatingSystemModule cimprovider -r -m OS_OpenDRIM_OperatingSystemModule 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_OperatingSystem.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OS.sh0000755000175000017500000000547311400673710021566 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, 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_BootOSFromFS.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_InstalledOS.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_OperatingSystemCurrentRunLevel.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_OSConformsToProfile.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_OperatingSystem.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_RegisteredOSProfile.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_RunningOS.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_OperatingSystemStatistics.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_OperatingSystemDefaultRunLevel.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_OperatingSystemLoadAverages.sh $1 $2 $3 $4 $5 $6 if test "$3" = sfcb then /etc/init.d/sfcb start fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_RunningOS.sh0000755000175000017500000000621211400673710024554 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_RunningOS.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_RunningOS provider module"; Name = "OS_OpenDRIM_RunningOSModule"; Location = "cmpiOS_OpenDRIM_RunningOSProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_RunningOS provider"; Name = "OS_OpenDRIM_RunningOSProvider"; ProviderModuleName = "OS_OpenDRIM_RunningOSModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_RunningOS provider capabilities"; ProviderModuleName = "OS_OpenDRIM_RunningOSModule"; ProviderName = "OS_OpenDRIM_RunningOSProvider"; ClassName = "OpenDRIM_RunningOS"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent"}; CapabilityID = "OS_OpenDRIM_RunningOS"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_RunningOS.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_OperatingSystemCurrentRunLevel.sh0000755000175000017500000000712611400673710031054 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_OperatingSystemCurrentRunLevel.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_OperatingSystemCurrentRunLevel provider module"; Name = "OS_OpenDRIM_OperatingSystemCurrentRunLevelModule"; Location = "cmpiOS_OpenDRIM_OperatingSystemCurrentRunLevelProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_OperatingSystemCurrentRunLevel provider"; Name = "OS_OpenDRIM_OperatingSystemCurrentRunLevelProvider"; ProviderModuleName = "OS_OpenDRIM_OperatingSystemCurrentRunLevelModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_OperatingSystemCurrentRunLevel provider capabilities"; ProviderModuleName = "OS_OpenDRIM_OperatingSystemCurrentRunLevelModule"; ProviderName = "OS_OpenDRIM_OperatingSystemCurrentRunLevelProvider"; ClassName = "OpenDRIM_OperatingSystemCurrentRunLevel"; ProviderType = {2}; Namespaces = {"$1"}; SupportedProperties = {"Caption", "Description", "InstanceID", "ElementName", "ConfigurationName", "ChangeableType", "Value"}; CapabilityID = "OS_OpenDRIM_OperatingSystemCurrentRunLevel"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_OperatingSystemCurrentRunLevel.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_OperatingSystemLoadAverages-remove.sh0000755000175000017500000000654511400673710031611 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m OS_OpenDRIM_OperatingSystemLoadAveragesModule cimprovider -r -m OS_OpenDRIM_OperatingSystemLoadAveragesModule 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_OperatingSystemLoadAverages.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel-remove.shopendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel-remove0000755000175000017500000000704511400673710034756 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelModule cimprovider -r -m OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelModule 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_OperatingSystemOperatingSystemDefaultRunLevel.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_OperatingSystemLoadAverages.sh0000755000175000017500000000700511400673710030306 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_OperatingSystemLoadAverages.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_OperatingSystemLoadAverages provider module"; Name = "OS_OpenDRIM_OperatingSystemLoadAveragesModule"; Location = "cmpiOS_OpenDRIM_OperatingSystemLoadAveragesProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_OperatingSystemLoadAverages provider"; Name = "OS_OpenDRIM_OperatingSystemLoadAveragesProvider"; ProviderModuleName = "OS_OpenDRIM_OperatingSystemLoadAveragesModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_OperatingSystemLoadAverages provider capabilities"; ProviderModuleName = "OS_OpenDRIM_OperatingSystemLoadAveragesModule"; ProviderName = "OS_OpenDRIM_OperatingSystemLoadAveragesProvider"; ClassName = "OpenDRIM_OperatingSystemLoadAverages"; ProviderType = {2}; Namespaces = {"$1"}; SupportedProperties = {"InstanceID", "Caption", "Description", "ElementName", "Name", "LoadAverages"}; CapabilityID = "OS_OpenDRIM_OperatingSystemLoadAverages"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_OperatingSystemLoadAverages.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.sh0000755000175000017500000000760711400673710034100 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel provider module"; Name = "OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelModule"; Location = "cmpiOS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel provider"; Name = "OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProvider"; ProviderModuleName = "OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel provider capabilities"; ProviderModuleName = "OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelModule"; ProviderName = "OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProvider"; ClassName = "OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"ManagedElement", "SettingData", "IsDefault", "IsCurrent", "IsNext", "IsMinimum", "IsMaximum", "IsPending"}; CapabilityID = "OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_RegisteredOSProfile.sh0000755000175000017500000000663011400673710026556 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $4 $6/mof/OpenDRIM_RegisteredOSProfile.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_RegisteredOSProfile provider module"; Name = "OS_OpenDRIM_RegisteredOSProfileModule"; Location = "cmpiOS_OpenDRIM_RegisteredOSProfileProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_RegisteredOSProfile provider"; Name = "OS_OpenDRIM_RegisteredOSProfileProvider"; ProviderModuleName = "OS_OpenDRIM_RegisteredOSProfileModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_RegisteredOSProfile provider capabilities"; ProviderModuleName = "OS_OpenDRIM_RegisteredOSProfileModule"; ProviderName = "OS_OpenDRIM_RegisteredOSProfileProvider"; ClassName = "OpenDRIM_RegisteredOSProfile"; ProviderType = {2}; Namespaces = {"$4"}; SupportedProperties = {"Caption", "Description", "ElementName", "InstanceID", "RegisteredOrganization", "OtherRegisteredOrganization", "RegisteredName", "RegisteredVersion", "AdvertiseTypes", "AdvertiseTypeDescriptions"}; CapabilityID = "OS_OpenDRIM_RegisteredOSProfile"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_RegisteredOSProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$4 $OUTFILE rm -f $OUTFILE fi ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel-remove.shopendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel-remove0000755000175000017500000000704511400673710035014 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelModule cimprovider -r -m OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelModule 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_OperatingSystemOperatingSystemCurrentRunLevel.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_RegisteredOSProfile-remove.sh0000755000175000017500000000631111400673710030045 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m OS_OpenDRIM_RegisteredOSProfileModule cimprovider -r -m OS_OpenDRIM_RegisteredOSProfileModule 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_RegisteredOSProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$3 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_InstalledOS-remove.sh0000755000175000017500000000632111400673710026347 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m OS_OpenDRIM_InstalledOSModule cimprovider -r -m OS_OpenDRIM_InstalledOSModule 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_InstalledOS.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_OSConformsToProfile.sh0000755000175000017500000000667111400673710026557 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_OSConformsToProfile.mof cimmof -aE -n $4 $6/mof/OpenDRIM_OSConformsToProfile.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_OSConformsToProfile provider module"; Name = "OS_OpenDRIM_OSConformsToProfileModule"; Location = "cmpiOS_OpenDRIM_OSConformsToProfileProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_OSConformsToProfile provider"; Name = "OS_OpenDRIM_OSConformsToProfileProvider"; ProviderModuleName = "OS_OpenDRIM_OSConformsToProfileModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_OSConformsToProfile provider capabilities"; ProviderModuleName = "OS_OpenDRIM_OSConformsToProfileModule"; ProviderName = "OS_OpenDRIM_OSConformsToProfileProvider"; ClassName = "OpenDRIM_OSConformsToProfile"; ProviderType = {2, 3}; Namespaces = {"$1", "$4"}; SupportedProperties = {"ConformantStandard", "ManagedElement"}; CapabilityID = "OS_OpenDRIM_OSConformsToProfile"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_OSConformsToProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE owmofc -u http://localhost/$4 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_OperatingSystemStatistics-remove.sh0000755000175000017500000000653511400673710031405 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m OS_OpenDRIM_OperatingSystemStatisticsModule cimprovider -r -m OS_OpenDRIM_OperatingSystemStatisticsModule 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_OperatingSystemStatistics.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.sh0000755000175000017500000000760711400673710034136 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel provider module"; Name = "OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelModule"; Location = "cmpiOS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel provider"; Name = "OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProvider"; ProviderModuleName = "OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel provider capabilities"; ProviderModuleName = "OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelModule"; ProviderName = "OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProvider"; ClassName = "OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"ManagedElement", "SettingData", "IsDefault", "IsCurrent", "IsNext", "IsMinimum", "IsMaximum", "IsPending"}; CapabilityID = "OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OS-remove.sh0000755000175000017500000000550711400673710023057 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, 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_OperatingSystemLoadAverages-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_OperatingSystemDefaultRunLevel-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_OperatingSystemStatistics-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_RunningOS-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_RegisteredOSProfile-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_OperatingSystem-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_OSConformsToProfile-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_OperatingSystemCurrentRunLevel-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_InstalledOS-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_BootOSFromFS-remove.sh $1 $2 $3 $4 if test "$2" = sfcb then /etc/init.d/sfcb start fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_InstalledOS.sh0000755000175000017500000000630511400673710025056 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_InstalledOS.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_InstalledOS provider module"; Name = "OS_OpenDRIM_InstalledOSModule"; Location = "cmpiOS_OpenDRIM_InstalledOSProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_InstalledOS provider"; Name = "OS_OpenDRIM_InstalledOSProvider"; ProviderModuleName = "OS_OpenDRIM_InstalledOSModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_InstalledOS provider capabilities"; ProviderModuleName = "OS_OpenDRIM_InstalledOSModule"; ProviderName = "OS_OpenDRIM_InstalledOSProvider"; ClassName = "OpenDRIM_InstalledOS"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"GroupComponent", "PartComponent", "PrimaryOS"}; CapabilityID = "OS_OpenDRIM_InstalledOS"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_InstalledOS.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/registration/OpenDRIM_OSConformsToProfile-remove.sh0000755000175000017500000001023111400673710030035 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m OS_OpenDRIM_OSConformsToProfileModule cimprovider -r -m OS_OpenDRIM_OSConformsToProfileModule 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_OSConformsToProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE owmofc -u http://localhost/$3 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemStatistics/0000755000175000017500000000000011400673710025030 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemStatistics/OpenDRIM_OperatingSystemStatisticsAccess.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemStatistics/OpenDRIM_OperatingSystemStatisticsAcces0000644000175000017500000002417111400673710034564 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_OperatingSystemStatisticsAccess.h" int OS_OpenDRIM_OperatingSystemStatistics_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(OS_OpenDRIM_OperatingSystem_load(broker, errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystemLoadAverages_load(broker, errorMessage)); */ // TODO _L_; return OK; } int OS_OpenDRIM_OperatingSystemStatistics_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(OS_OpenDRIM_OperatingSystem_unload(errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystemLoadAverages_unload(errorMessage)); */ // TODO _L_; return OK; } int OS_OpenDRIM_OperatingSystemStatistics_isAssociated(const Instance& Element, const Instance& Stats, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int OS_OpenDRIM_OperatingSystemStatistics_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(OS_OpenDRIM_OperatingSystemStatistics_enumerateElements(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(OS_OpenDRIM_OperatingSystemStatistics_enumerateElements(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; OS_OpenDRIM_OperatingSystemStatistics_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), Element_classnames[0], Stats_classnames[0], Element_role.c_str(), Stats_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(OS_OpenDRIM_OperatingSystemStatistics_referenceElementToStats(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int OS_OpenDRIM_OperatingSystemStatistics_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_OperatingSystemStatistics& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath Element_objectpath; instance.getElement(Element_objectpath); Instance Element_instance; CF_assert(OS_OpenDRIM_OperatingSystemStatistics_getElement(broker, ctx, Element_objectpath, Element_instance, NULL, errorMessage)); Objectpath Stats_objectpath; instance.getStats(Stats_objectpath); Instance Stats_instance; CF_assert(OS_OpenDRIM_OperatingSystemStatistics_getStats(broker, ctx, Stats_objectpath, Stats_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(OS_OpenDRIM_OperatingSystemStatistics_isAssociated(Element_instance, Stats_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int OS_OpenDRIM_OperatingSystemStatistics_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemStatistics& newInstance, const OpenDRIM_OperatingSystemStatistics& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OperatingSystemStatistics_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemStatistics& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OperatingSystemStatistics_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemStatistics& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OperatingSystemStatistics_associatorElementToStats(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Element_instance, const char** properties, vector& Stats_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector Stats_instances; if (discriminant=="a") CF_assert(OS_OpenDRIM_OperatingSystemStatistics_enumerateStatss(broker, ctx, Stats_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(OS_OpenDRIM_OperatingSystemStatistics_enumerateStatss(broker, ctx, Stats_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(OS_OpenDRIM_OperatingSystemStatistics_enumerateStatss(broker, ctx, Stats_instances, properties, false, errorMessage)); } for (size_t i=0; i& Element_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector Element_instances; if (discriminant=="a") CF_assert(OS_OpenDRIM_OperatingSystemStatistics_enumerateElements(broker, ctx, Element_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(OS_OpenDRIM_OperatingSystemStatistics_enumerateElements(broker, ctx, Element_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(OS_OpenDRIM_OperatingSystemStatistics_enumerateElements(broker, ctx, Element_instances, properties, false, errorMessage)); } for (size_t i=0; i& Stats_instances, vector& OpenDRIM_OperatingSystemStatistics_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 < Stats_instances.size(); i++) { OpenDRIM_OperatingSystemStatistics instance; instance.setElement(((Instance) Element_instance).getObjectpath()); instance.setStats(((Instance) Stats_instances[i]).getObjectpath()); OpenDRIM_OperatingSystemStatistics_instances.push_back(instance); } _L_; return OK; } int OS_OpenDRIM_OperatingSystemStatistics_referenceStatsToElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Stats_instance, const vector& Element_instances, vector& OpenDRIM_OperatingSystemStatistics_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 < Element_instances.size(); i++) { OpenDRIM_OperatingSystemStatistics instance; instance.setElement(((Instance) Element_instances[i]).getObjectpath()); instance.setStats(((Instance) Stats_instance).getObjectpath()); OpenDRIM_OperatingSystemStatistics_instances.push_back(instance); } _L_; return OK; } int OS_OpenDRIM_OperatingSystemStatistics_populate(OpenDRIM_OperatingSystemStatistics& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemStatistics/Makefile.am0000644000175000017500000000515511400673710027072 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiOS_OpenDRIM_OperatingSystemStatisticsProvider.la libcmpiOS_OpenDRIM_OperatingSystemStatisticsProvider_la_SOURCES = OpenDRIM_OperatingSystemStatisticsAccess.cpp OpenDRIM_OperatingSystemStatisticsProvider.cpp cmpiOpenDRIM_OperatingSystemStatistics.cpp assocOpenDRIM_OperatingSystemStatistics.cpp # May have to be adjusted for direct invocation libcmpiOS_OpenDRIM_OperatingSystemStatisticsProvider_la_CPPFLAGS = -I../CIM_ManagedElement -I../CIM_StatisticalInformation # Uncomment the end for direct invocation, may have to be adjusted libcmpiOS_OpenDRIM_OperatingSystemStatisticsProvider_la_LIBADD = ../Common/libcmpiOS_Common.la #../CIM_ManagedElement/libcmpiOS_CIM_ManagedElementProvider.la ../CIM_StatisticalInformation/libcmpiOS_CIM_StatisticalInformationProvider.la libcmpiOS_OpenDRIM_OperatingSystemStatisticsProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_OperatingSystemStatistics.h OpenDRIM_OperatingSystemStatistics.h OpenDRIM_OperatingSystemStatisticsAccess.h ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemStatistics/cmpiOpenDRIM_OperatingSystemStatistics.hopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemStatistics/cmpiOpenDRIM_OperatingSystemStatistics.0000644000175000017500000000456311400673710034557 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_OPERATINGSYSTEMSTATISTICS_H_ #define CMPIOPENDRIM_OPERATINGSYSTEMSTATISTICS_H_ #include "OpenDRIM_OperatingSystemStatistics.h" CMPIObjectPath* OS_OpenDRIM_OperatingSystemStatistics_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_OperatingSystemStatistics& instance); CMPIInstance* OS_OpenDRIM_OperatingSystemStatistics_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_OperatingSystemStatistics& instance); void OS_OpenDRIM_OperatingSystemStatistics_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_OperatingSystemStatistics& instance); void OS_OpenDRIM_OperatingSystemStatistics_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_OperatingSystemStatistics& instance); #endif /*CMPIOPENDRIM_OPERATINGSYSTEMSTATISTICS_H_*/ ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemStatistics/OpenDRIM_OperatingSystemStatisticsAccess.hopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemStatistics/OpenDRIM_OperatingSystemStatisticsAcces0000644000175000017500000001065011400673710034561 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_OPERATINGSYSTEMSTATISTICSACCESS_H_ #define OPENDRIM_OPERATINGSYSTEMSTATISTICSACCESS_H_ #include "OS_Common.h" #include "OpenDRIM_OperatingSystemStatistics.h" #include "assocOpenDRIM_OperatingSystemStatistics.h" int OS_OpenDRIM_OperatingSystemStatistics_load(const CMPIBroker* broker, string& errorMessage); int OS_OpenDRIM_OperatingSystemStatistics_unload(string& errorMessage); int OS_OpenDRIM_OperatingSystemStatistics_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OperatingSystemStatistics_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_OperatingSystemStatistics& instance, const char** properties, string& errorMessage); int OS_OpenDRIM_OperatingSystemStatistics_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemStatistics& newInstance, const OpenDRIM_OperatingSystemStatistics& oldInstance, const char** properties, string& errorMessage); int OS_OpenDRIM_OperatingSystemStatistics_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemStatistics& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystemStatistics_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemStatistics& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystemStatistics_associatorElementToStats(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Element_instance, const char** properties, vector& Stats_associatedInstances, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OperatingSystemStatistics_associatorStatsToElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Stats_instance, const char** properties, vector& Element_associatedInstances, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OperatingSystemStatistics_referenceElementToStats(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Element_instance, const vector& Stats_instances, vector& OpenDRIM_OperatingSystemStatistics_instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OperatingSystemStatistics_referenceStatsToElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Stats_instance, const vector& Element_instances, vector& OpenDRIM_OperatingSystemStatistics_instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OperatingSystemStatistics_populate(OpenDRIM_OperatingSystemStatistics& instance, string& errorMessage); #endif /*OPENDRIM_OPERATINGSYSTEMSTATISTICSACCESS_H_*/ ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemStatistics/assocOpenDRIM_OperatingSystemStatistics.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemStatistics/assocOpenDRIM_OperatingSystemStatistics0000644000175000017500000002123111400673710034650 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_OperatingSystemStatistics.h" int OS_OpenDRIM_OperatingSystemStatistics_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 = OS_OpenDRIM_OperatingSystemStatistics_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, "Element") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "Stats") != 0) return OK; CF_assert(OS_OpenDRIM_OperatingSystemStatistics_associatorElementToStats(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "Stats") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "Element") != 0) return OK; CF_assert(OS_OpenDRIM_OperatingSystemStatistics_associatorStatsToElement(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int OS_OpenDRIM_OperatingSystemStatistics_enumerateElements(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, Element_NAMESPACE, Element_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(OS_OpenDRIM_OperatingSystem_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(OS_OpenDRIM_OperatingSystem_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, OS_OpenDRIM_OperatingSystem_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int OS_OpenDRIM_OperatingSystemStatistics_getElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Element_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Element_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* OpenDRIM_OperatingSystem _instance; OS_OpenDRIM_OperatingSystem_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(OS_OpenDRIM_OperatingSystem_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, OS_OpenDRIM_OperatingSystem_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int OS_OpenDRIM_OperatingSystemStatistics_enumerateStatss(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, Stats_NAMESPACE, Stats_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(OS_OpenDRIM_OperatingSystemLoadAverages_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(OS_OpenDRIM_OperatingSystemLoadAverages_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, OS_OpenDRIM_OperatingSystemLoadAverages_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int OS_OpenDRIM_OperatingSystemStatistics_getStats(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Stats_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Stats_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* OpenDRIM_OperatingSystemLoadAverages _instance; OS_OpenDRIM_OperatingSystemLoadAverages_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(OS_OpenDRIM_OperatingSystemLoadAverages_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, OS_OpenDRIM_OperatingSystemLoadAverages_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemStatistics/OpenDRIM_OperatingSystemStatistics.h0000644000175000017500000000676211400673710034061 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_OPERATINGSYSTEMSTATISTICS_H_ #define OPENDRIM_OPERATINGSYSTEMSTATISTICS_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiOpenDRIM_OperatingSystem.h" #include "OpenDRIM_OperatingSystemAccess.h" #include "cmpiOpenDRIM_OperatingSystemLoadAverages.h" #include "OpenDRIM_OperatingSystemLoadAveragesAccess.h" */ const static char* OpenDRIM_OperatingSystemStatistics_classnames[] = {"OpenDRIM_OperatingSystemStatistics"}; static string OpenDRIM_OperatingSystemStatistics_NAMESPACE = _NAMESPACE; const static string Element_role = "Element"; const static char* Element_classnames[] = {"OpenDRIM_OperatingSystem"}; const static string Element_NAMESPACE = _NAMESPACE; const static string Stats_role = "Stats"; const static char* Stats_classnames[] = {"OpenDRIM_OperatingSystemLoadAverages"}; const static string Stats_NAMESPACE = _NAMESPACE; class OpenDRIM_OperatingSystemStatistics { public: Objectpath Stats; bool Stats_isNULL; Objectpath Element; bool Element_isNULL; OpenDRIM_OperatingSystemStatistics() { Stats_isNULL = true; Element_isNULL = true; } ~OpenDRIM_OperatingSystemStatistics() {} string getKeys() const { return CF_toLowCase(".Stats=\"" + CF_quoteString(Stats.toString()) + "\""".Element=\"" + CF_quoteString(Element.toString()) + "\""); } int getStats(Objectpath& value) const { if (Stats_isNULL==true) return NOT_FOUND; value = Stats; return OK; } int setStats(const Objectpath& newValue) { Stats = newValue; Stats.setNamespace(Stats_NAMESPACE); Stats_isNULL = false; return OK; } int getElement(Objectpath& value) const { if (Element_isNULL==true) return NOT_FOUND; value = Element; return OK; } int setElement(const Objectpath& newValue) { Element = newValue; Element.setNamespace(Element_NAMESPACE); Element_isNULL = false; return OK; } }; #endif /*OPENDRIM_OPERATINGSYSTEMSTATISTICS_H_*/ ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemStatistics/OpenDRIM_OperatingSystemStatisticsProvider.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemStatistics/OpenDRIM_OperatingSystemStatisticsProvi0000644000175000017500000004245211400673710034647 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystemStatistics.h" #include "OpenDRIM_OperatingSystemStatisticsAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define OS_OpenDRIM_OperatingSystemStatisticsProviderSetInstance OS_OpenDRIM_OperatingSystemStatisticsProviderModifyInstance #endif int OS_OpenDRIM_OperatingSystemStatistics_init(const CMPIBroker* broker); int OS_OpenDRIM_OperatingSystemStatistics_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus OS_OpenDRIM_OperatingSystemStatisticsProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = OS_OpenDRIM_OperatingSystemStatistics_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemStatisticsProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemStatistics_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemStatistics_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = OS_OpenDRIM_OperatingSystemStatistics_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemStatisticsProviderEnumInstances(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 = OS_OpenDRIM_OperatingSystemStatistics_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemStatistics_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = OS_OpenDRIM_OperatingSystemStatistics_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemStatisticsProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystemStatistics instance; OS_OpenDRIM_OperatingSystemStatistics_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemStatistics_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemStatistics_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = OS_OpenDRIM_OperatingSystemStatistics_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemStatisticsProviderSetInstance(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_OperatingSystemStatistics newInstance, oldInstance; OS_OpenDRIM_OperatingSystemStatistics_toCPP(_broker, ci, newInstance); OS_OpenDRIM_OperatingSystemStatistics_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemStatistics_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemStatistics_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemStatistics_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemStatistics_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemStatisticsProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystemStatistics instance; OS_OpenDRIM_OperatingSystemStatistics_toCPP(_broker, ci, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemStatistics_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_OperatingSystemStatistics_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemStatistics_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemStatistics_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemStatistics_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemStatistics_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = OS_OpenDRIM_OperatingSystemStatistics_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemStatisticsProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystemStatistics instance; OS_OpenDRIM_OperatingSystemStatistics_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemStatistics_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemStatistics_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemStatistics_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemStatistics_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemStatisticsProviderExecQuery(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 OS_OpenDRIM_OperatingSystemStatisticsProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = OS_OpenDRIM_OperatingSystemStatistics_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemStatisticsProviderAssociatorNames(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 = OS_OpenDRIM_OperatingSystemStatistics_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemStatistics_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 OS_OpenDRIM_OperatingSystemStatisticsProviderAssociators(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 = OS_OpenDRIM_OperatingSystemStatistics_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemStatistics_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 OS_OpenDRIM_OperatingSystemStatisticsProviderReferenceNames(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 = OS_OpenDRIM_OperatingSystemStatistics_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemStatistics_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = OS_OpenDRIM_OperatingSystemStatistics_referenceElementToStats(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = OS_OpenDRIM_OperatingSystemStatistics_referenceStatsToElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemStatistics_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = OS_OpenDRIM_OperatingSystemStatistics_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemStatisticsProviderReferences(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 = OS_OpenDRIM_OperatingSystemStatistics_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemStatistics_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = OS_OpenDRIM_OperatingSystemStatistics_referenceElementToStats(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = OS_OpenDRIM_OperatingSystemStatistics_referenceStatsToElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemStatistics_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = OS_OpenDRIM_OperatingSystemStatistics_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int OS_OpenDRIM_OperatingSystemStatistics_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemStatistics_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_OperatingSystemStatistics_init FAILED: " + (string) OpenDRIM_OperatingSystemStatistics_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int OS_OpenDRIM_OperatingSystemStatistics_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemStatistics_unload(errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_OperatingSystemStatistics_unload FAILED: " + (string) OpenDRIM_OperatingSystemStatistics_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define OS_OpenDRIM_OperatingSystemStatistics_INIT if (OS_OpenDRIM_OperatingSystemStatistics_init(_broker) < 0) return NULL CMInstanceMIStub(OS_OpenDRIM_OperatingSystemStatisticsProvider, OS_OpenDRIM_OperatingSystemStatisticsProvider, _broker, OS_OpenDRIM_OperatingSystemStatistics_INIT); CMAssociationMIStub(OS_OpenDRIM_OperatingSystemStatisticsProvider, OS_OpenDRIM_OperatingSystemStatisticsProvider, _broker, OS_OpenDRIM_OperatingSystemStatistics_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemStatistics/cmpiOpenDRIM_OperatingSystemStatistics.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemStatistics/cmpiOpenDRIM_OperatingSystemStatistics.0000644000175000017500000000620111400673710034546 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystemStatistics.h" CMPIObjectPath* OS_OpenDRIM_OperatingSystemStatistics_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_OperatingSystemStatistics& instance) { _E_; Objectpath op(broker, OpenDRIM_OperatingSystemStatistics_classnames[0], OpenDRIM_OperatingSystemStatistics_NAMESPACE); if (!instance.Stats_isNULL) op.addKey("Stats", instance.Stats); if (!instance.Element_isNULL) op.addKey("Element", instance.Element); _L_; return op.getHdl(); } CMPIInstance* OS_OpenDRIM_OperatingSystemStatistics_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_OperatingSystemStatistics& instance) { _E_; Objectpath op(broker, OS_OpenDRIM_OperatingSystemStatistics_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void OS_OpenDRIM_OperatingSystemStatistics_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_OperatingSystemStatistics& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("Element", instance.Element) == OK) instance.Element_isNULL = false; if (op.getKey("Stats", instance.Stats) == OK) instance.Stats_isNULL = false; _L_; } void OS_OpenDRIM_OperatingSystemStatistics_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_OperatingSystemStatistics& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Stats", instance.Stats) == OK) instance.Stats_isNULL = false; if (inst.getProperty("Element", instance.Element) == OK) instance.Element_isNULL = false; _L_; } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemStatistics/assocOpenDRIM_OperatingSystemStatistics.hopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemStatistics/assocOpenDRIM_OperatingSystemStatistics0000644000175000017500000000636311400673710034661 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_OPERATINGSYSTEMSTATISTICS_H_ #define ASSOCOPENDRIM_OPERATINGSYSTEMSTATISTICS_H_ #include "OpenDRIM_OperatingSystemStatisticsAccess.h" int OS_OpenDRIM_OperatingSystemStatistics_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 OS_OpenDRIM_OperatingSystemStatistics_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 OS_OpenDRIM_OperatingSystemStatistics_enumerateElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int OS_OpenDRIM_OperatingSystemStatistics_getElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int OS_OpenDRIM_OperatingSystemStatistics_enumerateStatss(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int OS_OpenDRIM_OperatingSystemStatistics_getStats(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_OPERATINGSYSTEMSTATISTICS_H_*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_RegisteredOSProfile/0000755000175000017500000000000011400673710023500 5ustar guillaumeguillaumeopendrim-lmp-os-1.1.0~ppa/OpenDRIM_RegisteredOSProfile/Makefile.am0000644000175000017500000000407511400673710025542 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiOS_OpenDRIM_RegisteredOSProfileProvider.la libcmpiOS_OpenDRIM_RegisteredOSProfileProvider_la_SOURCES = OpenDRIM_RegisteredOSProfileAccess.cpp OpenDRIM_RegisteredOSProfileProvider.cpp cmpiOpenDRIM_RegisteredOSProfile.cpp libcmpiOS_OpenDRIM_RegisteredOSProfileProvider_la_LIBADD = ../Common/libcmpiOS_Common.la libcmpiOS_OpenDRIM_RegisteredOSProfileProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_RegisteredOSProfile.h OpenDRIM_RegisteredOSProfile.h OpenDRIM_RegisteredOSProfileAccess.h opendrim-lmp-os-1.1.0~ppa/OpenDRIM_RegisteredOSProfile/cmpiOpenDRIM_RegisteredOSProfile.cpp0000644000175000017500000001146011400673710032374 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ################################################################################*/ #include "cmpiOpenDRIM_RegisteredOSProfile.h" CMPIObjectPath* OS_OpenDRIM_RegisteredOSProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RegisteredOSProfile& instance) { _E_; Objectpath op(broker, OpenDRIM_RegisteredOSProfile_classnames[0], OpenDRIM_RegisteredOSProfile_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* OS_OpenDRIM_RegisteredOSProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RegisteredOSProfile& instance) { _E_; Objectpath op(broker, OS_OpenDRIM_RegisteredOSProfile_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 OS_OpenDRIM_RegisteredOSProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RegisteredOSProfile& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void OS_OpenDRIM_RegisteredOSProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RegisteredOSProfile& 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-os-1.1.0~ppa/OpenDRIM_RegisteredOSProfile/OpenDRIM_RegisteredOSProfileProvider.cpp0000644000175000017500000002541011400673710033236 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ################################################################################*/ #include "cmpiOpenDRIM_RegisteredOSProfile.h" #include "OpenDRIM_RegisteredOSProfileAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define OS_OpenDRIM_RegisteredOSProfileProviderSetInstance OS_OpenDRIM_RegisteredOSProfileProviderModifyInstance #endif int OS_OpenDRIM_RegisteredOSProfile_init(const CMPIBroker* broker); int OS_OpenDRIM_RegisteredOSProfile_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus OS_OpenDRIM_RegisteredOSProfileProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = OS_OpenDRIM_RegisteredOSProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus OS_OpenDRIM_RegisteredOSProfileProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = OS_OpenDRIM_RegisteredOSProfile_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredOSProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = OS_OpenDRIM_RegisteredOSProfile_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_RegisteredOSProfileProviderEnumInstances(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 = OS_OpenDRIM_RegisteredOSProfile_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredOSProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = OS_OpenDRIM_RegisteredOSProfile_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_RegisteredOSProfileProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredOSProfile instance; OS_OpenDRIM_RegisteredOSProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_RegisteredOSProfile_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredOSProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = OS_OpenDRIM_RegisteredOSProfile_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_RegisteredOSProfileProviderSetInstance(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_RegisteredOSProfile newInstance, oldInstance; OS_OpenDRIM_RegisteredOSProfile_toCPP(_broker, ci, newInstance); OS_OpenDRIM_RegisteredOSProfile_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = OS_OpenDRIM_RegisteredOSProfile_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredOSProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_RegisteredOSProfile_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredOSProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_RegisteredOSProfileProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredOSProfile instance; OS_OpenDRIM_RegisteredOSProfile_toCPP(_broker, ci, instance); string errorMessage; int errorCode = OS_OpenDRIM_RegisteredOSProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_RegisteredOSProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_RegisteredOSProfile_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredOSProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_RegisteredOSProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredOSProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = OS_OpenDRIM_RegisteredOSProfile_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_RegisteredOSProfileProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredOSProfile instance; OS_OpenDRIM_RegisteredOSProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_RegisteredOSProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredOSProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_RegisteredOSProfile_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredOSProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_RegisteredOSProfileProviderExecQuery(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 OS_OpenDRIM_RegisteredOSProfile_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = OS_OpenDRIM_RegisteredOSProfile_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_RegisteredOSProfile_init FAILED: " + (string) OpenDRIM_RegisteredOSProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int OS_OpenDRIM_RegisteredOSProfile_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = OS_OpenDRIM_RegisteredOSProfile_unload(errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_RegisteredOSProfile_unload FAILED: " + (string) OpenDRIM_RegisteredOSProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define OS_OpenDRIM_RegisteredOSProfile_INIT if (OS_OpenDRIM_RegisteredOSProfile_init(_broker) < 0) return NULL CMInstanceMIStub(OS_OpenDRIM_RegisteredOSProfileProvider, OS_OpenDRIM_RegisteredOSProfileProvider, _broker, OS_OpenDRIM_RegisteredOSProfile_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_RegisteredOSProfile/OpenDRIM_RegisteredOSProfileAccess.h0000644000175000017500000000607511400673710032320 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ################################################################################*/ #ifndef OPENDRIM_REGISTEREDOSPROFILEACCESS_H_ #define OPENDRIM_REGISTEREDOSPROFILEACCESS_H_ #include "OS_Common.h" #include "OpenDRIM_RegisteredOSProfile.h" int OS_OpenDRIM_RegisteredOSProfile_load(const CMPIBroker* broker, string& errorMessage); int OS_OpenDRIM_RegisteredOSProfile_unload(string& errorMessage); int OS_OpenDRIM_RegisteredOSProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_RegisteredOSProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_RegisteredOSProfile& instance, const char** properties, string& errorMessage); int OS_OpenDRIM_RegisteredOSProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredOSProfile& newInstance, const OpenDRIM_RegisteredOSProfile& oldInstance, const char** properties, string& errorMessage); int OS_OpenDRIM_RegisteredOSProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredOSProfile& instance, string& errorMessage); int OS_OpenDRIM_RegisteredOSProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredOSProfile& instance, string& errorMessage); int OS_OpenDRIM_RegisteredOSProfile_populate(OpenDRIM_RegisteredOSProfile& instance, string& errorMessage); int OS_OpenDRIM_RegisteredOSProfile_getInstanceInfo(OpenDRIM_RegisteredOSProfile& instance, string& errorMessage); #endif /*OPENDRIM_REGISTEREDOSPROFILEACCESS_H_*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_RegisteredOSProfile/OpenDRIM_RegisteredOSProfileAccess.cpp0000644000175000017500000000773611400673710032660 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ################################################################################*/ #include "OpenDRIM_RegisteredOSProfileAccess.h" const string _InstanceID="OpenDRIM:OS:1.0.0"; int OS_OpenDRIM_RegisteredOSProfile_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int OS_OpenDRIM_RegisteredOSProfile_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int OS_OpenDRIM_RegisteredOSProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; OpenDRIM_RegisteredOSProfile instance; instance.setInstanceID(_InstanceID); if (discriminant == "ei") CF_assert(OS_OpenDRIM_RegisteredOSProfile_populate(instance, errorMessage)); result.push_back(instance); _L_; return OK; } int OS_OpenDRIM_RegisteredOSProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_RegisteredOSProfile& instance, const char** properties, string& errorMessage) { _E_; string InstanceID; instance.getInstanceID(InstanceID); if (!CF_strCmpNoCase(InstanceID, _InstanceID)) { errorMessage="No Instance"; return NOT_FOUND; } CF_assert(OS_OpenDRIM_RegisteredOSProfile_populate(instance, errorMessage)); _L_; return OK; } int OS_OpenDRIM_RegisteredOSProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredOSProfile& newInstance, const OpenDRIM_RegisteredOSProfile& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_RegisteredOSProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredOSProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_RegisteredOSProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredOSProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_RegisteredOSProfile_populate(OpenDRIM_RegisteredOSProfile& instance, string& errorMessage) { _E_; vector AdvertiseTypes; //Registred name of profile which is listed in Standard instance.setRegisteredName("OS Status"); //Registred version of Profile instance.setRegisteredVersion("1.0.0"); //OS Profile Registred organization - 2 (DMTF) instance.setRegisteredOrganization(2); AdvertiseTypes.push_back(2); // Not Advertised instance.setAdvertiseTypes(AdvertiseTypes); _L_; return OK; } opendrim-lmp-os-1.1.0~ppa/OpenDRIM_RegisteredOSProfile/OpenDRIM_RegisteredOSProfile.h0000644000175000017500000001352211400673710031171 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ################################################################################*/ #ifndef OPENDRIM_REGISTEREDOSPROFILE_H_ #define OPENDRIM_REGISTEREDOSPROFILE_H_ #include const static char* OpenDRIM_RegisteredOSProfile_classnames[] = {"OpenDRIM_RegisteredOSProfile"}; static string OpenDRIM_RegisteredOSProfile_NAMESPACE = _INTEROP_NAMESPACE; class OpenDRIM_RegisteredOSProfile { 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_RegisteredOSProfile() { 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_RegisteredOSProfile() {} 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_REGISTEREDOSPROFILE_H_*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_RegisteredOSProfile/cmpiOpenDRIM_RegisteredOSProfile.h0000644000175000017500000000434111400673710032041 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ################################################################################*/ #ifndef CMPIOPENDRIM_REGISTEREDOSPROFILE_H_ #define CMPIOPENDRIM_REGISTEREDOSPROFILE_H_ #include "OpenDRIM_RegisteredOSProfile.h" CMPIObjectPath* OS_OpenDRIM_RegisteredOSProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RegisteredOSProfile& instance); CMPIInstance* OS_OpenDRIM_RegisteredOSProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RegisteredOSProfile& instance); void OS_OpenDRIM_RegisteredOSProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RegisteredOSProfile& instance); void OS_OpenDRIM_RegisteredOSProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RegisteredOSProfile& instance); #endif /*CMPIOPENDRIM_REGISTEREDOSPROFILE_H_*/ opendrim-lmp-os-1.1.0~ppa/VERSION0000644000175000017500000000000611400673710017227 0ustar guillaumeguillaume1.1.0 opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemDefaultRunLevel/0000755000175000017500000000000011400673710025737 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemDefaultRunLevel/cmpiOpenDRIM_OperatingSystemDefaultRunLevel.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemDefaultRunLevel/cmpiOpenDRIM_OperatingSystemDefaul0000644000175000017500000001020311400673710034442 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystemDefaultRunLevel.h" CMPIObjectPath* OS_OpenDRIM_OperatingSystemDefaultRunLevel_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_OperatingSystemDefaultRunLevel& instance) { _E_; Objectpath op(broker, OpenDRIM_OperatingSystemDefaultRunLevel_classnames[0], OpenDRIM_OperatingSystemDefaultRunLevel_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* OS_OpenDRIM_OperatingSystemDefaultRunLevel_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_OperatingSystemDefaultRunLevel& instance) { _E_; Objectpath op(broker, OS_OpenDRIM_OperatingSystemDefaultRunLevel_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.ConfigurationName_isNULL) ci.setProperty("ConfigurationName", instance.ConfigurationName); if (!instance.ChangeableType_isNULL) ci.setProperty("ChangeableType", instance.ChangeableType); if (!instance.Value_isNULL) ci.setProperty("Value", instance.Value); _L_; return ci.getHdl(); } void OS_OpenDRIM_OperatingSystemDefaultRunLevel_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_OperatingSystemDefaultRunLevel& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void OS_OpenDRIM_OperatingSystemDefaultRunLevel_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_OperatingSystemDefaultRunLevel& 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("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getProperty("ConfigurationName", instance.ConfigurationName) == OK) instance.ConfigurationName_isNULL = false; if (inst.getProperty("ChangeableType", instance.ChangeableType) == OK) instance.ChangeableType_isNULL = false; if (inst.getProperty("Value", instance.Value) == OK) instance.Value_isNULL = false; _L_; } opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemDefaultRunLevel/Makefile.am0000644000175000017500000000436711400673710030005 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiOS_OpenDRIM_OperatingSystemDefaultRunLevelProvider.la libcmpiOS_OpenDRIM_OperatingSystemDefaultRunLevelProvider_la_SOURCES = OpenDRIM_OperatingSystemDefaultRunLevelAccess.cpp OpenDRIM_OperatingSystemDefaultRunLevelProvider.cpp cmpiOpenDRIM_OperatingSystemDefaultRunLevel.cpp libcmpiOS_OpenDRIM_OperatingSystemDefaultRunLevelProvider_la_LIBADD = ../Common/libcmpiOS_Common.la libcmpiOS_OpenDRIM_OperatingSystemDefaultRunLevelProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_OperatingSystemDefaultRunLevel.h OpenDRIM_OperatingSystemDefaultRunLevel.h OpenDRIM_OperatingSystemDefaultRunLevelAccess.h ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemDefaultRunLevel/OpenDRIM_OperatingSystemDefaultRunLevelAccess.hopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemDefaultRunLevel/OpenDRIM_OperatingSystemDefaultRun0000644000175000017500000000710311400673710034447 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_OPERATINGSYSTEMDEFAULTRUNLEVELACCESS_H_ #define OPENDRIM_OPERATINGSYSTEMDEFAULTRUNLEVELACCESS_H_ #include "OS_Common.h" #include "OpenDRIM_OperatingSystemDefaultRunLevel.h" int OS_OpenDRIM_OperatingSystemDefaultRunLevel_load(const CMPIBroker* broker, string& errorMessage); int OS_OpenDRIM_OperatingSystemDefaultRunLevel_unload(string& errorMessage); int OS_OpenDRIM_OperatingSystemDefaultRunLevel_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OperatingSystemDefaultRunLevel_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_OperatingSystemDefaultRunLevel& instance, const char** properties, string& errorMessage); int OS_OpenDRIM_OperatingSystemDefaultRunLevel_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemDefaultRunLevel& newInstance, const OpenDRIM_OperatingSystemDefaultRunLevel& oldInstance, const char** properties, string& errorMessage); int OS_OpenDRIM_OperatingSystemDefaultRunLevel_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemDefaultRunLevel& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystemDefaultRunLevel_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemDefaultRunLevel& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystemDefaultRunLevel_populate(OpenDRIM_OperatingSystemDefaultRunLevel& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystemDefaultRunLevel_getInstanceInfo(OpenDRIM_OperatingSystemDefaultRunLevel& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystemDefaultRunLevel_getValue(unsigned char& Value, string& errorMessage); int OS_OpenDRIM_OperatingSystemDefaultRunLevel_setValue(const unsigned char& newValue, string& errorMessage); #endif /*OPENDRIM_OPERATINGSYSTEMDEFAULTRUNLEVELACCESS_H_*/ ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemDefaultRunLevel/OpenDRIM_OperatingSystemDefaultRunLevelAccess.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemDefaultRunLevel/OpenDRIM_OperatingSystemDefaultRun0000644000175000017500000001420411400673710034447 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_OperatingSystemDefaultRunLevelAccess.h" string _InstanceID; const string _ElementName = "DefaultRunLevel"; int OS_OpenDRIM_OperatingSystemDefaultRunLevel_load(const CMPIBroker* broker, string& errorMessage) { _E_; CF_assert(CF_getSystemName(_InstanceID, errorMessage)); _InstanceID = "OpenDRIM_OperatingSystem:" + _InstanceID + ":DefaultRunLevel"; _L_; return OK; } int OS_OpenDRIM_OperatingSystemDefaultRunLevel_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int OS_OpenDRIM_OperatingSystemDefaultRunLevel_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; OpenDRIM_OperatingSystemDefaultRunLevel instance; instance.setInstanceID(_InstanceID); if (discriminant == "ei") { CF_assert(OS_OpenDRIM_OperatingSystemDefaultRunLevel_getInstanceInfo(instance, errorMessage)); } result.push_back(instance); _L_; return OK; } int OS_OpenDRIM_OperatingSystemDefaultRunLevel_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_OperatingSystemDefaultRunLevel& instance, const char** properties, string& errorMessage) { _E_; string InstanceID; instance.getInstanceID(InstanceID); if (!CF_strCmpNoCase(InstanceID, _InstanceID)) return NOT_FOUND; CF_assert(OS_OpenDRIM_OperatingSystemDefaultRunLevel_getInstanceInfo(instance, errorMessage)); _L_; return OK; } int OS_OpenDRIM_OperatingSystemDefaultRunLevel_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemDefaultRunLevel& newInstance, const OpenDRIM_OperatingSystemDefaultRunLevel& oldInstance, const char** properties, string& errorMessage) { _E_; unsigned char oldValue, newValue; oldInstance.getValue(oldValue); if (newInstance.getValue(newValue) != NOT_FOUND && oldValue != newValue) { CF_assert(OS_OpenDRIM_OperatingSystemDefaultRunLevel_setValue(newValue, errorMessage)); } _L_; return OK; } int OS_OpenDRIM_OperatingSystemDefaultRunLevel_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemDefaultRunLevel& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OperatingSystemDefaultRunLevel_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemDefaultRunLevel& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OperatingSystemDefaultRunLevel_populate(OpenDRIM_OperatingSystemDefaultRunLevel& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } int OS_OpenDRIM_OperatingSystemDefaultRunLevel_getInstanceInfo(OpenDRIM_OperatingSystemDefaultRunLevel& instance, string& errorMessage) { _E_; instance.setElementName(_ElementName); instance.setChangeableType(2); unsigned char Value; CF_assert(OS_OpenDRIM_OperatingSystemDefaultRunLevel_getValue(Value, errorMessage)); instance.setValue(Value); _L_; return OK; } int OS_OpenDRIM_OperatingSystemDefaultRunLevel_getValue(unsigned char& Value, string& errorMessage) { _E_; string inittab; CF_assert(CF_readTextFile("/etc/inittab", inittab, errorMessage)); vector inittab_lines; CF_splitText(inittab_lines, inittab, '\n'); for (size_t i=0; i < inittab_lines.size(); i++) { if (inittab_lines[i].size()==0 || inittab_lines[i].substr(0, 1) == "#" || inittab_lines[i].find(":initdefault:") == string::npos) continue; vector inittab_line; CF_splitText(inittab_line, inittab_lines[i], ':'); if (inittab_line.size() < 4) { errorMessage = "Wrong format (at line " + CF_intToStr((unsigned long) i) + "): /etc/inittab"; return FAILED; } Value = atoi(inittab_line[1].c_str()); break; } _L_; return OK; } int OS_OpenDRIM_OperatingSystemDefaultRunLevel_setValue(const unsigned char& newValue, string& errorMessage) { _E_; if (newValue > 5 || newValue < 1) { errorMessage = "Invalid property value (1 <= Value <= 5): Value"; return FAILED; } string inittab, updated_inittab; CF_assert(CF_readTextFile("/etc/inittab", inittab, errorMessage)); vector inittab_lines; CF_splitText(inittab_lines, inittab, '\n'); for (size_t i=0; i < inittab_lines.size(); i++) { if (inittab_lines[i].size()==0 || inittab_lines[i].substr(0, 1) == "#" || inittab_lines[i].find(":initdefault:") == string::npos) { updated_inittab += inittab_lines[i] + "\n"; continue; } updated_inittab += "id:" + CF_intToStr(newValue) + ":initdefault:\n"; } CF_assert(CF_writeTextFile("/etc/inittab", updated_inittab, errorMessage)); _L_; return OK; } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemDefaultRunLevel/OpenDRIM_OperatingSystemDefaultRunLevel.hopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemDefaultRunLevel/OpenDRIM_OperatingSystemDefaultRun0000644000175000017500000001103011400673710034441 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_OPERATINGSYSTEMDEFAULTRUNLEVEL_H_ #define OPENDRIM_OPERATINGSYSTEMDEFAULTRUNLEVEL_H_ #include const static char* OpenDRIM_OperatingSystemDefaultRunLevel_classnames[] = {"OpenDRIM_OperatingSystemDefaultRunLevel"}; static string OpenDRIM_OperatingSystemDefaultRunLevel_NAMESPACE = _NAMESPACE; class OpenDRIM_OperatingSystemDefaultRunLevel { public: string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string InstanceID; bool InstanceID_isNULL; string ElementName; bool ElementName_isNULL; string ConfigurationName; bool ConfigurationName_isNULL; unsigned short ChangeableType; bool ChangeableType_isNULL; unsigned char Value; bool Value_isNULL; OpenDRIM_OperatingSystemDefaultRunLevel() { Caption_isNULL = true; Description_isNULL = true; InstanceID_isNULL = true; ElementName_isNULL = true; ConfigurationName_isNULL = true; ChangeableType_isNULL = true; Value_isNULL = true; } ~OpenDRIM_OperatingSystemDefaultRunLevel() {} 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 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 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 getConfigurationName(string& value) const { if (ConfigurationName_isNULL==true) return NOT_FOUND; value = ConfigurationName; return OK; } int setConfigurationName(const string& newValue) { ConfigurationName = newValue; ConfigurationName_isNULL = false; return OK; } int getChangeableType(unsigned short& value) const { if (ChangeableType_isNULL==true) return NOT_FOUND; value = ChangeableType; return OK; } int setChangeableType(const unsigned short& newValue) { ChangeableType = newValue; ChangeableType_isNULL = false; return OK; } int getValue(unsigned char& value) const { if (Value_isNULL==true) return NOT_FOUND; value = Value; return OK; } int setValue(const unsigned char& newValue) { Value = newValue; Value_isNULL = false; return OK; } }; #endif /*OPENDRIM_OPERATINGSYSTEMDEFAULTRUNLEVEL_H_*/ ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemDefaultRunLevel/cmpiOpenDRIM_OperatingSystemDefaultRunLevel.hopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemDefaultRunLevel/cmpiOpenDRIM_OperatingSystemDefaul0000644000175000017500000000465711400673710034462 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_OPERATINGSYSTEMDEFAULTRUNLEVEL_H_ #define CMPIOPENDRIM_OPERATINGSYSTEMDEFAULTRUNLEVEL_H_ #include "OpenDRIM_OperatingSystemDefaultRunLevel.h" CMPIObjectPath* OS_OpenDRIM_OperatingSystemDefaultRunLevel_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_OperatingSystemDefaultRunLevel& instance); CMPIInstance* OS_OpenDRIM_OperatingSystemDefaultRunLevel_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_OperatingSystemDefaultRunLevel& instance); void OS_OpenDRIM_OperatingSystemDefaultRunLevel_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_OperatingSystemDefaultRunLevel& instance); void OS_OpenDRIM_OperatingSystemDefaultRunLevel_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_OperatingSystemDefaultRunLevel& instance); #endif /*CMPIOPENDRIM_OPERATINGSYSTEMDEFAULTRUNLEVEL_H_*/ ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemDefaultRunLevel/OpenDRIM_OperatingSystemDefaultRunLevelProvider.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemDefaultRunLevel/OpenDRIM_OperatingSystemDefaultRun0000644000175000017500000002700711400673710034454 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystemDefaultRunLevel.h" #include "OpenDRIM_OperatingSystemDefaultRunLevelAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define OS_OpenDRIM_OperatingSystemDefaultRunLevelProviderSetInstance OS_OpenDRIM_OperatingSystemDefaultRunLevelProviderModifyInstance #endif int OS_OpenDRIM_OperatingSystemDefaultRunLevel_init(const CMPIBroker* broker); int OS_OpenDRIM_OperatingSystemDefaultRunLevel_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus OS_OpenDRIM_OperatingSystemDefaultRunLevelProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = OS_OpenDRIM_OperatingSystemDefaultRunLevel_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemDefaultRunLevelProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemDefaultRunLevel_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = OS_OpenDRIM_OperatingSystemDefaultRunLevel_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemDefaultRunLevelProviderEnumInstances(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 = OS_OpenDRIM_OperatingSystemDefaultRunLevel_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = OS_OpenDRIM_OperatingSystemDefaultRunLevel_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemDefaultRunLevelProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystemDefaultRunLevel instance; OS_OpenDRIM_OperatingSystemDefaultRunLevel_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemDefaultRunLevel_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = OS_OpenDRIM_OperatingSystemDefaultRunLevel_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemDefaultRunLevelProviderSetInstance(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_OperatingSystemDefaultRunLevel newInstance, oldInstance; OS_OpenDRIM_OperatingSystemDefaultRunLevel_toCPP(_broker, ci, newInstance); OS_OpenDRIM_OperatingSystemDefaultRunLevel_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemDefaultRunLevel_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemDefaultRunLevel_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemDefaultRunLevelProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystemDefaultRunLevel instance; OS_OpenDRIM_OperatingSystemDefaultRunLevel_toCPP(_broker, ci, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemDefaultRunLevel_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_OperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemDefaultRunLevel_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemDefaultRunLevel_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = OS_OpenDRIM_OperatingSystemDefaultRunLevel_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemDefaultRunLevelProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystemDefaultRunLevel instance; OS_OpenDRIM_OperatingSystemDefaultRunLevel_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemDefaultRunLevel_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemDefaultRunLevel_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemDefaultRunLevelProviderExecQuery(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 OS_OpenDRIM_OperatingSystemDefaultRunLevel_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemDefaultRunLevel_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_OperatingSystemDefaultRunLevel_init FAILED: " + (string) OpenDRIM_OperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int OS_OpenDRIM_OperatingSystemDefaultRunLevel_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemDefaultRunLevel_unload(errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_OperatingSystemDefaultRunLevel_unload FAILED: " + (string) OpenDRIM_OperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define OS_OpenDRIM_OperatingSystemDefaultRunLevel_INIT if (OS_OpenDRIM_OperatingSystemDefaultRunLevel_init(_broker) < 0) return NULL CMInstanceMIStub(OS_OpenDRIM_OperatingSystemDefaultRunLevelProvider, OS_OpenDRIM_OperatingSystemDefaultRunLevelProvider, _broker, OS_OpenDRIM_OperatingSystemDefaultRunLevel_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystem/0000755000175000017500000000000011400673710022755 5ustar guillaumeguillaumeopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystem/Makefile.am0000644000175000017500000000414111400673710025011 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiOS_OpenDRIM_OperatingSystemProvider.la libcmpiOS_OpenDRIM_OperatingSystemProvider_la_SOURCES = OpenDRIM_OperatingSystemAccess.cpp OpenDRIM_OperatingSystemProvider.cpp cmpiOpenDRIM_OperatingSystem.cpp libcmpiOS_OpenDRIM_OperatingSystemProvider_la_LIBADD = ../Common/libcmpiOS_Common.la libcmpiOS_OpenDRIM_OperatingSystemProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_OperatingSystem.h OpenDRIM_OperatingSystem.h OpenDRIM_OperatingSystemAccess.h opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystem/cmpiOpenDRIM_OperatingSystem.h0000644000175000017500000000503311400673710030572 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_OPERATINGSYSTEM_H_ #define CMPIOPENDRIM_OPERATINGSYSTEM_H_ #include "OpenDRIM_OperatingSystem.h" CMPIObjectPath* OS_OpenDRIM_OperatingSystem_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_OperatingSystem& instance); CMPIInstance* OS_OpenDRIM_OperatingSystem_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_OperatingSystem& instance); void OS_OpenDRIM_OperatingSystem_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_OperatingSystem& instance); void OS_OpenDRIM_OperatingSystem_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_OperatingSystem& instance); void OS_OpenDRIM_OperatingSystem_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_OperatingSystem_RequestStateChange_In& args); void OS_OpenDRIM_OperatingSystem_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_OperatingSystem_RequestStateChange_Out& args); #endif /*CMPIOPENDRIM_OPERATINGSYSTEM_H_*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystem/OpenDRIM_OperatingSystem.h0000644000175000017500000005105611400673710027727 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_OPERATINGSYSTEM_H_ #define OPENDRIM_OPERATINGSYSTEM_H_ #include const static char* OpenDRIM_OperatingSystem_classnames[] = {"OpenDRIM_OperatingSystem"}; static string OpenDRIM_OperatingSystem_NAMESPACE = _NAMESPACE; class OpenDRIM_OperatingSystem { public: string InstanceID; bool InstanceID_isNULL; 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 CommunicationStatus; bool CommunicationStatus_isNULL; unsigned short DetailedStatus; bool DetailedStatus_isNULL; unsigned short OperatingStatus; bool OperatingStatus_isNULL; unsigned short PrimaryStatus; bool PrimaryStatus_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 CSCreationClassName; bool CSCreationClassName_isNULL; string CSName; bool CSName_isNULL; string CreationClassName; bool CreationClassName_isNULL; string Name; bool Name_isNULL; unsigned short OSType; bool OSType_isNULL; string OtherTypeDescription; bool OtherTypeDescription_isNULL; string Version; bool Version_isNULL; string LastBootUpTime; bool LastBootUpTime_isNULL; string LocalDateTime; bool LocalDateTime_isNULL; short CurrentTimeZone; bool CurrentTimeZone_isNULL; unsigned int NumberOfLicensedUsers; bool NumberOfLicensedUsers_isNULL; unsigned int NumberOfUsers; bool NumberOfUsers_isNULL; unsigned int NumberOfProcesses; bool NumberOfProcesses_isNULL; unsigned int MaxNumberOfProcesses; bool MaxNumberOfProcesses_isNULL; unsigned long long TotalSwapSpaceSize; bool TotalSwapSpaceSize_isNULL; unsigned long long TotalVirtualMemorySize; bool TotalVirtualMemorySize_isNULL; unsigned long long FreeVirtualMemory; bool FreeVirtualMemory_isNULL; unsigned long long FreePhysicalMemory; bool FreePhysicalMemory_isNULL; unsigned long long TotalVisibleMemorySize; bool TotalVisibleMemorySize_isNULL; unsigned long long SizeStoredInPagingFiles; bool SizeStoredInPagingFiles_isNULL; unsigned long long FreeSpaceInPagingFiles; bool FreeSpaceInPagingFiles_isNULL; unsigned long long MaxProcessMemorySize; bool MaxProcessMemorySize_isNULL; bool Distributed; bool Distributed_isNULL; unsigned int MaxProcessesPerUser; bool MaxProcessesPerUser_isNULL; OpenDRIM_OperatingSystem() { InstanceID_isNULL = true; Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstallDate_isNULL = true; OperationalStatus_isNULL = true; StatusDescriptions_isNULL = true; Status_isNULL = true; HealthState_isNULL = true; CommunicationStatus_isNULL = true; DetailedStatus_isNULL = true; OperatingStatus_isNULL = true; PrimaryStatus_isNULL = true; EnabledState_isNULL = true; OtherEnabledState_isNULL = true; RequestedState_isNULL = true; EnabledDefault_isNULL = true; TimeOfLastStateChange_isNULL = true; AvailableRequestedStates_isNULL = true; TransitioningToState_isNULL = true; CSCreationClassName_isNULL = true; CSName_isNULL = true; CreationClassName_isNULL = true; Name_isNULL = true; OSType_isNULL = true; OtherTypeDescription_isNULL = true; Version_isNULL = true; LastBootUpTime_isNULL = true; LocalDateTime_isNULL = true; CurrentTimeZone_isNULL = true; NumberOfLicensedUsers_isNULL = true; NumberOfUsers_isNULL = true; NumberOfProcesses_isNULL = true; MaxNumberOfProcesses_isNULL = true; TotalSwapSpaceSize_isNULL = true; TotalVirtualMemorySize_isNULL = true; FreeVirtualMemory_isNULL = true; FreePhysicalMemory_isNULL = true; TotalVisibleMemorySize_isNULL = true; SizeStoredInPagingFiles_isNULL = true; FreeSpaceInPagingFiles_isNULL = true; MaxProcessMemorySize_isNULL = true; Distributed_isNULL = true; MaxProcessesPerUser_isNULL = true; } ~OpenDRIM_OperatingSystem() {} string getKeys() const { return CF_toLowCase(".CSCreationClassName=\"" + CF_quoteString(CSCreationClassName) + "\""".CSName=\"" + CF_quoteString(CSName) + "\""".CreationClassName=\"" + CF_quoteString(CreationClassName) + "\""".Name=\"" + CF_quoteString(Name) + "\""); } 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 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 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 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 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 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 getCSCreationClassName(string& value) const { if (CSCreationClassName_isNULL==true) return NOT_FOUND; value = CSCreationClassName; return OK; } int setCSCreationClassName(const string& newValue) { CSCreationClassName = newValue; CSCreationClassName_isNULL = false; return OK; } int getCSName(string& value) const { if (CSName_isNULL==true) return NOT_FOUND; value = CSName; return OK; } int setCSName(const string& newValue) { CSName = newValue; CSName_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 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 getOSType(unsigned short& value) const { if (OSType_isNULL==true) return NOT_FOUND; value = OSType; return OK; } int setOSType(const unsigned short& newValue) { OSType = newValue; OSType_isNULL = false; return OK; } int getOtherTypeDescription(string& value) const { if (OtherTypeDescription_isNULL==true) return NOT_FOUND; value = OtherTypeDescription; return OK; } int setOtherTypeDescription(const string& newValue) { OtherTypeDescription = newValue; OtherTypeDescription_isNULL = false; return OK; } int getVersion(string& value) const { if (Version_isNULL==true) return NOT_FOUND; value = Version; return OK; } int setVersion(const string& newValue) { Version = newValue; Version_isNULL = false; return OK; } int getLastBootUpTime(string& value) const { if (LastBootUpTime_isNULL==true) return NOT_FOUND; value = LastBootUpTime; return OK; } int setLastBootUpTime(const string& newValue) { LastBootUpTime = newValue; LastBootUpTime_isNULL = false; return OK; } int getLocalDateTime(string& value) const { if (LocalDateTime_isNULL==true) return NOT_FOUND; value = LocalDateTime; return OK; } int setLocalDateTime(const string& newValue) { LocalDateTime = newValue; LocalDateTime_isNULL = false; return OK; } int getCurrentTimeZone(short& value) const { if (CurrentTimeZone_isNULL==true) return NOT_FOUND; value = CurrentTimeZone; return OK; } int setCurrentTimeZone(const short& newValue) { CurrentTimeZone = newValue; CurrentTimeZone_isNULL = false; return OK; } int getNumberOfLicensedUsers(unsigned int& value) const { if (NumberOfLicensedUsers_isNULL==true) return NOT_FOUND; value = NumberOfLicensedUsers; return OK; } int setNumberOfLicensedUsers(const unsigned int& newValue) { NumberOfLicensedUsers = newValue; NumberOfLicensedUsers_isNULL = false; return OK; } int getNumberOfUsers(unsigned int& value) const { if (NumberOfUsers_isNULL==true) return NOT_FOUND; value = NumberOfUsers; return OK; } int setNumberOfUsers(const unsigned int& newValue) { NumberOfUsers = newValue; NumberOfUsers_isNULL = false; return OK; } int getNumberOfProcesses(unsigned int& value) const { if (NumberOfProcesses_isNULL==true) return NOT_FOUND; value = NumberOfProcesses; return OK; } int setNumberOfProcesses(const unsigned int& newValue) { NumberOfProcesses = newValue; NumberOfProcesses_isNULL = false; return OK; } int getMaxNumberOfProcesses(unsigned int& value) const { if (MaxNumberOfProcesses_isNULL==true) return NOT_FOUND; value = MaxNumberOfProcesses; return OK; } int setMaxNumberOfProcesses(const unsigned int& newValue) { MaxNumberOfProcesses = newValue; MaxNumberOfProcesses_isNULL = false; return OK; } int getTotalSwapSpaceSize(unsigned long long& value) const { if (TotalSwapSpaceSize_isNULL==true) return NOT_FOUND; value = TotalSwapSpaceSize; return OK; } int setTotalSwapSpaceSize(const unsigned long long& newValue) { TotalSwapSpaceSize = newValue; TotalSwapSpaceSize_isNULL = false; return OK; } int getTotalVirtualMemorySize(unsigned long long& value) const { if (TotalVirtualMemorySize_isNULL==true) return NOT_FOUND; value = TotalVirtualMemorySize; return OK; } int setTotalVirtualMemorySize(const unsigned long long& newValue) { TotalVirtualMemorySize = newValue; TotalVirtualMemorySize_isNULL = false; return OK; } int getFreeVirtualMemory(unsigned long long& value) const { if (FreeVirtualMemory_isNULL==true) return NOT_FOUND; value = FreeVirtualMemory; return OK; } int setFreeVirtualMemory(const unsigned long long& newValue) { FreeVirtualMemory = newValue; FreeVirtualMemory_isNULL = false; return OK; } int getFreePhysicalMemory(unsigned long long& value) const { if (FreePhysicalMemory_isNULL==true) return NOT_FOUND; value = FreePhysicalMemory; return OK; } int setFreePhysicalMemory(const unsigned long long& newValue) { FreePhysicalMemory = newValue; FreePhysicalMemory_isNULL = false; return OK; } int getTotalVisibleMemorySize(unsigned long long& value) const { if (TotalVisibleMemorySize_isNULL==true) return NOT_FOUND; value = TotalVisibleMemorySize; return OK; } int setTotalVisibleMemorySize(const unsigned long long& newValue) { TotalVisibleMemorySize = newValue; TotalVisibleMemorySize_isNULL = false; return OK; } int getSizeStoredInPagingFiles(unsigned long long& value) const { if (SizeStoredInPagingFiles_isNULL==true) return NOT_FOUND; value = SizeStoredInPagingFiles; return OK; } int setSizeStoredInPagingFiles(const unsigned long long& newValue) { SizeStoredInPagingFiles = newValue; SizeStoredInPagingFiles_isNULL = false; return OK; } int getFreeSpaceInPagingFiles(unsigned long long& value) const { if (FreeSpaceInPagingFiles_isNULL==true) return NOT_FOUND; value = FreeSpaceInPagingFiles; return OK; } int setFreeSpaceInPagingFiles(const unsigned long long& newValue) { FreeSpaceInPagingFiles = newValue; FreeSpaceInPagingFiles_isNULL = false; return OK; } int getMaxProcessMemorySize(unsigned long long& value) const { if (MaxProcessMemorySize_isNULL==true) return NOT_FOUND; value = MaxProcessMemorySize; return OK; } int setMaxProcessMemorySize(const unsigned long long& newValue) { MaxProcessMemorySize = newValue; MaxProcessMemorySize_isNULL = false; return OK; } int getDistributed(bool& value) const { if (Distributed_isNULL==true) return NOT_FOUND; value = Distributed; return OK; } int setDistributed(const bool& newValue) { Distributed = newValue; Distributed_isNULL = false; return OK; } int getMaxProcessesPerUser(unsigned int& value) const { if (MaxProcessesPerUser_isNULL==true) return NOT_FOUND; value = MaxProcessesPerUser; return OK; } int setMaxProcessesPerUser(const unsigned int& newValue) { MaxProcessesPerUser = newValue; MaxProcessesPerUser_isNULL = false; return OK; } }; class OpenDRIM_OperatingSystem_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_OperatingSystem_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_OperatingSystem_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_OperatingSystem_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_OperatingSystem_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_OperatingSystem_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_OPERATINGSYSTEM_H_*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystem/OpenDRIM_OperatingSystemAccess.cpp0000644000175000017500000003766211400673710031413 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_OperatingSystemAccess.h" #include static string _CSCreationClassName = "OpenDRIM_ComputerSystem"; static string _CSName; static string _Name; static string _Version; static unsigned long _MaxNumberOfProcesses; static unsigned long _MaxProcessMemorySize; static string _ElementName; static unsigned long _DateOfInstallation; static unsigned long _NumberOfLogicalCPU; static short int _CurrentTimeZone; int OS_OpenDRIM_OperatingSystem_load(const CMPIBroker* broker, string& errorMessage) { _E_; CF_assert(CF_getOSName(_Name, errorMessage)); CF_assert(CF_getSystemName(_CSName, errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystem_getVersion(_Version, errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystem_getMaxNumberOfProcesses(_MaxNumberOfProcesses, errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystem_getMaxProcessMemorySize(_MaxProcessMemorySize, errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystem_getElementName(_ElementName, errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystem_getDateOfInstallation(_DateOfInstallation, errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystem_getNumberOfLogicalCPU(_NumberOfLogicalCPU, errorMessage)); _L_; return OK; } int OS_OpenDRIM_OperatingSystem_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int OS_OpenDRIM_OperatingSystem_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; OpenDRIM_OperatingSystem instance; instance.setCSCreationClassName(_CSCreationClassName); instance.setCSName(_CSName); instance.setName(_Name); instance.setCreationClassName(OpenDRIM_OperatingSystem_classnames[0]); if (discriminant == "ei") { CF_assert(OS_OpenDRIM_OperatingSystem_getOperatingSystemInfo(instance, errorMessage)); } result.push_back(instance); _L_; return OK; } int OS_OpenDRIM_OperatingSystem_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_OperatingSystem& instance, const char** properties, string& errorMessage) { _E_; string CSCreationClassName, CSName, Name, CreationClassName; instance.getCreationClassName(CreationClassName); instance.getCSName(CSName); instance.getName(Name); instance.getCSCreationClassName(CSCreationClassName); if (!CF_strCmpNoCase(OpenDRIM_OperatingSystem_classnames[0], CreationClassName) || !CF_strCmpNoCase(CSName, _CSName) || !CF_strCmpNoCase(Name, _Name) || !CF_strCmpNoCase(CSCreationClassName, _CSCreationClassName)) return NOT_FOUND; CF_assert(OS_OpenDRIM_OperatingSystem_getOperatingSystemInfo(instance, errorMessage)); _L_; return OK; } int OS_OpenDRIM_OperatingSystem_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystem& newInstance, const OpenDRIM_OperatingSystem& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OperatingSystem_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystem& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OperatingSystem_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystem& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OperatingSystem_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystem& instance, unsigned int& returnValue, const OpenDRIM_OperatingSystem_RequestStateChange_In& in, OpenDRIM_OperatingSystem_RequestStateChange_Out& out, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OperatingSystem_Shutdown(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystem& instance, unsigned int& returnValue, string& errorMessage) { _E_; string stdOut, stdErr; int errorCode = CF_runCommand("/sbin/shutdown 3 &", stdOut, stdErr, errorMessage); if (stdErr.find("shutdown: already running.") != string::npos) { returnValue = 2; return OK; } if (errorCode!=OK) { returnValue = 3; return OK; } returnValue = 0; _L_; return OK; } int OS_OpenDRIM_OperatingSystem_Reboot(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystem& instance, unsigned int& returnValue, string& errorMessage) { _E_; string stdOut, stdErr; int errorCode = CF_runCommand("/sbin/shutdown -r 3 &", stdOut, stdErr, errorMessage); if (stdErr.find("shutdown: already running.") != string::npos) { returnValue = 2; return OK; } if (errorCode!=OK) { returnValue = 3; return OK; } returnValue = 0; _L_; return OK; } int OS_OpenDRIM_OperatingSystem_populate(OpenDRIM_OperatingSystem& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } int OS_OpenDRIM_OperatingSystem_getOperatingSystemInfo(OpenDRIM_OperatingSystem& instance, string& errorMessage) { _E_; instance.setVersion(_Version); instance.setOSType(36); _CurrentTimeZone = CF_getCurrentTimeZone(); instance.setCurrentTimeZone(_CurrentTimeZone); instance.setLocalDateTime(CF_toLocalTime(CF_getUTCTime(), _CurrentTimeZone)); string LastBootUpTime; CF_assert(OS_OpenDRIM_OperatingSystem_getLastBootUpTime(LastBootUpTime, errorMessage)); instance.setLastBootUpTime(LastBootUpTime); instance.setMaxNumberOfProcesses(_MaxNumberOfProcesses); unsigned long NumberOfUsers, NumberOfProcesses; CF_assert(OS_OpenDRIM_OperatingSystem_getNumberOfUsers(NumberOfUsers, errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystem_getNumberOfProcesses(NumberOfProcesses, errorMessage)); instance.setNumberOfLicensedUsers(0); instance.setNumberOfUsers(NumberOfUsers); instance.setNumberOfProcesses(NumberOfProcesses); instance.setMaxNumberOfProcesses(_MaxNumberOfProcesses); instance.setMaxProcessMemorySize(_MaxProcessMemorySize); instance.setElementName(_ElementName); unsigned long MaxProcessPerUser; OS_OpenDRIM_OperatingSystem_getMaxProcessPerUser(MaxProcessPerUser, errorMessage); instance.setMaxProcessesPerUser(MaxProcessPerUser); instance.setInstallDate(CF_toLocalTime(_DateOfInstallation, _CurrentTimeZone)); bool shutting_down, stressed, rebooting; CF_assert(OS_OpenDRIM_OperatingSystem_isShuttingDown(shutting_down, errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystem_isRebooting(rebooting, errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystem_isStressed(stressed, errorMessage)); vector OperationalStatus; instance.setEnabledState(2); // Enabled instance.setRequestedState(2); // Enabled instance.setPrimaryStatus(1); // OK instance.setDetailedStatus(1); // No Additional Information instance.setHealthState(5); // OK if (shutting_down) { instance.setEnabledState(4); // Shutting down instance.setRequestedState(4); // Shutdown OperationalStatus.push_back(9); // Stopping } if (rebooting) instance.setRequestedState(10); // Reboot if (stressed) { instance.setPrimaryStatus(2); // Degraded instance.setDetailedStatus(2); // Stressed OperationalStatus.push_back(3); // Degraded OperationalStatus.push_back(4); // Stressed instance.setHealthState(10); // Degraded/Warning } else OperationalStatus.push_back(2); // OK instance.setOperationalStatus(OperationalStatus); CF_assert(OS_OpenDRIM_OperatingSystem_getMemoryInfo(instance, errorMessage)); _L_; return OK; } int OS_OpenDRIM_OperatingSystem_getVersion(string& Version, string& errorMessage) { _E_; CF_assert(CF_runCommandFL("uname -r", Version, errorMessage)); _L_; return OK; } int OS_OpenDRIM_OperatingSystem_getLastBootUpTime(string& LastBootUpTime, string& errorMessage) { _E_; string who; CF_assert(CF_runCommandFL("LANG=en_US.UTF-8 /usr/bin/who -b", who, errorMessage)); vector who_line; CF_splitTextBySpace(who_line, CF_trimText(who)); if (who_line.size() != 4 || who_line[2].size() != 10 || who_line[3].size() != 5) { errorMessage = "Wrong format: /usr/bin/who -b output"; return FAILED; } LastBootUpTime = who_line[2].substr(0, 4) + who_line[2].substr(5, 2) + who_line[2].substr(8, 2) + who_line[3].substr(0, 2) + who_line[3].substr(3, 2) + "00.000000"; CF_addTimeZone(LastBootUpTime, _CurrentTimeZone); _L_; return OK; } int OS_OpenDRIM_OperatingSystem_getNumberOfUsers(unsigned long& NumberOfUsers, string& errorMessage) { _E_; NumberOfUsers=0; string passwd; CF_assert(CF_readTextFile("/etc/passwd", passwd, errorMessage)); vector passwd_lines; CF_splitText(passwd_lines, passwd, '\n'); for (size_t i=0; i passwd_line; CF_splitText(passwd_line, passwd_lines[i], ':'); if (passwd_line.size()!=7) { errorMessage="Wrong format (at line "+CF_intToStr((unsigned long) i+1)+"): /etc/passwd"; return FAILED; } if (passwd_line[6] != "/sbin/nologin" && CF_strToUL(passwd_line[2]) >= 500) NumberOfUsers++; } _L_; return OK; } int OS_OpenDRIM_OperatingSystem_getNumberOfProcesses(unsigned long& NumberOfProcesses, string& errorMessage) { _E_; string ps; CF_assert(CF_runCommandFL("/bin/ps -e | /usr/bin/wc -l", ps, errorMessage)); NumberOfProcesses = CF_strToUL(ps); _L_; return OK; } int OS_OpenDRIM_OperatingSystem_getMaxNumberOfProcesses(unsigned long& MaxNumberOfProcesses, string& errorMessage) { _E_; string pid_max; CF_assert(CF_readTextFileFL("/proc/sys/kernel/pid_max", pid_max, errorMessage)); MaxNumberOfProcesses = CF_strToUL(pid_max); _L_; return OK; } int OS_OpenDRIM_OperatingSystem_getMaxProcessMemorySize(unsigned long& MaxProcessMemorySize, string& errorMessage) { _E_; struct rlimit rlim; getrlimit(RLIMIT_AS, &rlim); MaxProcessMemorySize = rlim.rlim_max; _L_; return OK; } int OS_OpenDRIM_OperatingSystem_getMaxProcessPerUser(unsigned long& MaxProcessPerUser, string& errorMessage) { _E_; string ulimit; CF_assert(CF_runCommandFL("ulimit -u", ulimit, errorMessage)); MaxProcessPerUser = CF_strToUL(ulimit); _L_; return OK; } int OS_OpenDRIM_OperatingSystem_getElementName(string& ElementName, string& errorMessage) { _E_; string release_file; if (CF_runCommandFL("ls /etc | grep -E -e \".+-release$\"", release_file, errorMessage)!=OK || release_file.size()==0) { ElementName="Unknown"; return OK; } else { CF_assert(CF_readTextFileFL("/etc/"+release_file, ElementName, errorMessage)); } _L_; return OK; } int OS_OpenDRIM_OperatingSystem_getDateOfInstallation(unsigned long& DateOfInstallation, string& errorMessage) { _E_; string find; CF_assert(CF_runCommandFL("/usr/bin/find /etc/ -maxdepth 1 -type f -name *-release*", find, errorMessage)); if (find.size()<=13) { DateOfInstallation = 0; return OK; } string rpm; CF_assert(CF_runCommandFL("/bin/rpm -q --queryformat '%{INSTALLTIME:datetime}' "+find.substr(5, string::npos), rpm, errorMessage)); if (rpm.find("not installed")!=string::npos) { DateOfInstallation = 0; return OK; } DateOfInstallation = CF_strToUL(rpm); _L_; return OK; } int OS_OpenDRIM_OperatingSystem_isShuttingDown(bool& shutting_down, string& errorMessage) { _E_; string ps; shutting_down=false; CF_assert(CF_runCommandFL("/bin/ps -C shutdown,halt,poweroff --no-heading -o cmd", ps, errorMessage)); if (ps.size()>0) { shutting_down=true; if (ps.find("shutdown")!=string::npos && ps.find("-r")!=string::npos) shutting_down=false; } _L_; return OK; } int OS_OpenDRIM_OperatingSystem_isRebooting(bool& rebooting, string& errorMessage) { _E_; string ps; rebooting=false; CF_assert(CF_runCommandFL("/bin/ps -C shutdown,reboot --no-heading -o cmd", ps, errorMessage)); if (ps.size()>0) { rebooting=true; if (ps.find("shutdown")!=string::npos && ps.find("-r")==string::npos) rebooting=false; } _L_; return OK; } int OS_OpenDRIM_OperatingSystem_isStressed(bool& stressed, string& errorMessage) { _E_; stressed=false; string loadavg; CF_assert(CF_readTextFileFL("/proc/loadavg", loadavg, errorMessage)); vector loadavg_elements; CF_splitTextBySpace(loadavg_elements, loadavg); if (loadavg_elements.size() < 3) { errorMessage = "Wrong format: /proc/loadavg"; return FAILED; } if (atof(loadavg_elements[2].c_str()) > _NumberOfLogicalCPU) stressed=true; _L_; return OK; } int OS_OpenDRIM_OperatingSystem_getNumberOfLogicalCPU(unsigned long& NumberOfLogicalCPU, string& errorMessage) { _E_; vector stat_lines; CF_assert(CF_runCommandToLines("cat /proc/stat | grep cpu", stat_lines, 0, errorMessage)); NumberOfLogicalCPU=stat_lines.size()-2; _L_; return OK; } int OS_OpenDRIM_OperatingSystem_getMemoryInfo(OpenDRIM_OperatingSystem& instance, string& errorMessage) { _E_; vector meminfo; CF_assert(CF_readTextFileToLines("/proc/meminfo", meminfo, 0, errorMessage)); unsigned long long TotalSwapSpaceSize, FreePhysicalMemory, TotalVisibleMemorySize, FreeSpaceInPagingFiles; bool TotalSwapSpaceSize_isNULL = true; bool FreePhysicalMemory_isNULL = true; bool TotalVisibleMemorySize_isNULL = true; bool FreeSpaceInPagingFiles_isNULL = true; for (size_t i=0; i meminfo_line; CF_splitTextBySpace(meminfo_line, meminfo[i]); if (meminfo_line.size()<2) continue; if (meminfo_line[0]=="MemTotal:") { TotalVisibleMemorySize = CF_strToULL(meminfo_line[1])*(1024/1000); TotalVisibleMemorySize_isNULL = false; } else if (meminfo_line[0]=="MemFree:") { FreePhysicalMemory = CF_strToULL(meminfo_line[1])*(1024/1000); FreePhysicalMemory_isNULL = false; } else if (meminfo_line[0]=="SwapTotal:") { TotalSwapSpaceSize = CF_strToULL(meminfo_line[1])*(1024/1000); TotalSwapSpaceSize_isNULL = false; } else if (meminfo_line[0]=="SwapFree:") { FreeSpaceInPagingFiles = CF_strToULL(meminfo_line[1])*(1024/1000); FreeSpaceInPagingFiles_isNULL = false; } } if (!TotalVisibleMemorySize_isNULL) instance.setTotalVisibleMemorySize(TotalVisibleMemorySize); if (!FreePhysicalMemory_isNULL) instance.setFreePhysicalMemory(FreePhysicalMemory); if (!TotalSwapSpaceSize_isNULL) instance.setTotalSwapSpaceSize(TotalSwapSpaceSize); if (!FreeSpaceInPagingFiles_isNULL) instance.setFreeSpaceInPagingFiles(FreeSpaceInPagingFiles); if (!TotalVisibleMemorySize_isNULL && !TotalSwapSpaceSize_isNULL) instance.setTotalVirtualMemorySize(TotalSwapSpaceSize+TotalVisibleMemorySize); if (!FreePhysicalMemory_isNULL && !FreeSpaceInPagingFiles_isNULL) instance.setFreeVirtualMemory(FreePhysicalMemory + FreeSpaceInPagingFiles); if (!TotalSwapSpaceSize_isNULL && !FreeSpaceInPagingFiles_isNULL) instance.setSizeStoredInPagingFiles(TotalSwapSpaceSize-FreeSpaceInPagingFiles); _L_; return OK; } opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystem/cmpiOpenDRIM_OperatingSystem.cpp0000644000175000017500000003304111400673710031125 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystem.h" CMPIObjectPath* OS_OpenDRIM_OperatingSystem_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_OperatingSystem& instance) { _E_; Objectpath op(broker, OpenDRIM_OperatingSystem_classnames[0], OpenDRIM_OperatingSystem_NAMESPACE); if (!instance.CSCreationClassName_isNULL) op.addKey("CSCreationClassName", instance.CSCreationClassName); if (!instance.CSName_isNULL) op.addKey("CSName", instance.CSName); if (!instance.CreationClassName_isNULL) op.addKey("CreationClassName", instance.CreationClassName); if (!instance.Name_isNULL) op.addKey("Name", instance.Name); _L_; return op.getHdl(); } CMPIInstance* OS_OpenDRIM_OperatingSystem_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_OperatingSystem& instance) { _E_; Objectpath op(broker, OS_OpenDRIM_OperatingSystem_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.InstanceID_isNULL) ci.setProperty("InstanceID", instance.InstanceID); 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.CommunicationStatus_isNULL) ci.setProperty("CommunicationStatus", instance.CommunicationStatus); if (!instance.DetailedStatus_isNULL) ci.setProperty("DetailedStatus", instance.DetailedStatus); if (!instance.OperatingStatus_isNULL) ci.setProperty("OperatingStatus", instance.OperatingStatus); if (!instance.PrimaryStatus_isNULL) ci.setProperty("PrimaryStatus", instance.PrimaryStatus); 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.OSType_isNULL) ci.setProperty("OSType", instance.OSType); if (!instance.OtherTypeDescription_isNULL) ci.setProperty("OtherTypeDescription", instance.OtherTypeDescription); if (!instance.Version_isNULL) ci.setProperty("Version", instance.Version); if (!instance.LastBootUpTime_isNULL) ci.setPropertyDatetime("LastBootUpTime", instance.LastBootUpTime); if (!instance.LocalDateTime_isNULL) ci.setPropertyDatetime("LocalDateTime", instance.LocalDateTime); if (!instance.CurrentTimeZone_isNULL) ci.setProperty("CurrentTimeZone", instance.CurrentTimeZone); if (!instance.NumberOfLicensedUsers_isNULL) ci.setProperty("NumberOfLicensedUsers", instance.NumberOfLicensedUsers); if (!instance.NumberOfUsers_isNULL) ci.setProperty("NumberOfUsers", instance.NumberOfUsers); if (!instance.NumberOfProcesses_isNULL) ci.setProperty("NumberOfProcesses", instance.NumberOfProcesses); if (!instance.MaxNumberOfProcesses_isNULL) ci.setProperty("MaxNumberOfProcesses", instance.MaxNumberOfProcesses); if (!instance.TotalSwapSpaceSize_isNULL) ci.setProperty("TotalSwapSpaceSize", instance.TotalSwapSpaceSize); if (!instance.TotalVirtualMemorySize_isNULL) ci.setProperty("TotalVirtualMemorySize", instance.TotalVirtualMemorySize); if (!instance.FreeVirtualMemory_isNULL) ci.setProperty("FreeVirtualMemory", instance.FreeVirtualMemory); if (!instance.FreePhysicalMemory_isNULL) ci.setProperty("FreePhysicalMemory", instance.FreePhysicalMemory); if (!instance.TotalVisibleMemorySize_isNULL) ci.setProperty("TotalVisibleMemorySize", instance.TotalVisibleMemorySize); if (!instance.SizeStoredInPagingFiles_isNULL) ci.setProperty("SizeStoredInPagingFiles", instance.SizeStoredInPagingFiles); if (!instance.FreeSpaceInPagingFiles_isNULL) ci.setProperty("FreeSpaceInPagingFiles", instance.FreeSpaceInPagingFiles); if (!instance.MaxProcessMemorySize_isNULL) ci.setProperty("MaxProcessMemorySize", instance.MaxProcessMemorySize); if (!instance.Distributed_isNULL) ci.setProperty("Distributed", instance.Distributed); if (!instance.MaxProcessesPerUser_isNULL) ci.setProperty("MaxProcessesPerUser", instance.MaxProcessesPerUser); _L_; return ci.getHdl(); } void OS_OpenDRIM_OperatingSystem_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_OperatingSystem& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("Name", instance.Name) == OK) instance.Name_isNULL = false; if (op.getKey("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; if (op.getKey("CSCreationClassName", instance.CSCreationClassName) == OK) instance.CSCreationClassName_isNULL = false; if (op.getKey("CSName", instance.CSName) == OK) instance.CSName_isNULL = false; _L_; } void OS_OpenDRIM_OperatingSystem_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_OperatingSystem& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; 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("CommunicationStatus", instance.CommunicationStatus) == OK) instance.CommunicationStatus_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("PrimaryStatus", instance.PrimaryStatus) == OK) instance.PrimaryStatus_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("CSCreationClassName", instance.CSCreationClassName) == OK) instance.CSCreationClassName_isNULL = false; if (inst.getProperty("CSName", instance.CSName) == OK) instance.CSName_isNULL = false; if (inst.getProperty("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; if (inst.getProperty("Name", instance.Name) == OK) instance.Name_isNULL = false; if (inst.getProperty("OSType", instance.OSType) == OK) instance.OSType_isNULL = false; if (inst.getProperty("OtherTypeDescription", instance.OtherTypeDescription) == OK) instance.OtherTypeDescription_isNULL = false; if (inst.getProperty("Version", instance.Version) == OK) instance.Version_isNULL = false; if (inst.getPropertyDatetime("LastBootUpTime", instance.LastBootUpTime) == OK) instance.LastBootUpTime_isNULL = false; if (inst.getPropertyDatetime("LocalDateTime", instance.LocalDateTime) == OK) instance.LocalDateTime_isNULL = false; if (inst.getProperty("CurrentTimeZone", instance.CurrentTimeZone) == OK) instance.CurrentTimeZone_isNULL = false; if (inst.getProperty("NumberOfLicensedUsers", instance.NumberOfLicensedUsers) == OK) instance.NumberOfLicensedUsers_isNULL = false; if (inst.getProperty("NumberOfUsers", instance.NumberOfUsers) == OK) instance.NumberOfUsers_isNULL = false; if (inst.getProperty("NumberOfProcesses", instance.NumberOfProcesses) == OK) instance.NumberOfProcesses_isNULL = false; if (inst.getProperty("MaxNumberOfProcesses", instance.MaxNumberOfProcesses) == OK) instance.MaxNumberOfProcesses_isNULL = false; if (inst.getProperty("TotalSwapSpaceSize", instance.TotalSwapSpaceSize) == OK) instance.TotalSwapSpaceSize_isNULL = false; if (inst.getProperty("TotalVirtualMemorySize", instance.TotalVirtualMemorySize) == OK) instance.TotalVirtualMemorySize_isNULL = false; if (inst.getProperty("FreeVirtualMemory", instance.FreeVirtualMemory) == OK) instance.FreeVirtualMemory_isNULL = false; if (inst.getProperty("FreePhysicalMemory", instance.FreePhysicalMemory) == OK) instance.FreePhysicalMemory_isNULL = false; if (inst.getProperty("TotalVisibleMemorySize", instance.TotalVisibleMemorySize) == OK) instance.TotalVisibleMemorySize_isNULL = false; if (inst.getProperty("SizeStoredInPagingFiles", instance.SizeStoredInPagingFiles) == OK) instance.SizeStoredInPagingFiles_isNULL = false; if (inst.getProperty("FreeSpaceInPagingFiles", instance.FreeSpaceInPagingFiles) == OK) instance.FreeSpaceInPagingFiles_isNULL = false; if (inst.getProperty("MaxProcessMemorySize", instance.MaxProcessMemorySize) == OK) instance.MaxProcessMemorySize_isNULL = false; if (inst.getProperty("Distributed", instance.Distributed) == OK) instance.Distributed_isNULL = false; if (inst.getProperty("MaxProcessesPerUser", instance.MaxProcessesPerUser) == OK) instance.MaxProcessesPerUser_isNULL = false; _L_; } void OS_OpenDRIM_OperatingSystem_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_OperatingSystem_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 OS_OpenDRIM_OperatingSystem_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_OperatingSystem_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-os-1.1.0~ppa/OpenDRIM_OperatingSystem/OpenDRIM_OperatingSystemAccess.h0000644000175000017500000001215311400673710031044 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_OPERATINGSYSTEMACCESS_H_ #define OPENDRIM_OPERATINGSYSTEMACCESS_H_ #include "OS_Common.h" #include "OpenDRIM_OperatingSystem.h" int OS_OpenDRIM_OperatingSystem_load(const CMPIBroker* broker, string& errorMessage); int OS_OpenDRIM_OperatingSystem_unload(string& errorMessage); int OS_OpenDRIM_OperatingSystem_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OperatingSystem_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_OperatingSystem& instance, const char** properties, string& errorMessage); int OS_OpenDRIM_OperatingSystem_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystem& newInstance, const OpenDRIM_OperatingSystem& oldInstance, const char** properties, string& errorMessage); int OS_OpenDRIM_OperatingSystem_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystem& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystem_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystem& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystem_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystem& instance, unsigned int& returnValue, const OpenDRIM_OperatingSystem_RequestStateChange_In& in, OpenDRIM_OperatingSystem_RequestStateChange_Out& out, string& errorMessage); int OS_OpenDRIM_OperatingSystem_Shutdown(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystem& instance, unsigned int& returnValue, string& errorMessage); int OS_OpenDRIM_OperatingSystem_Reboot(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystem& instance, unsigned int& returnValue, string& errorMessage); int OS_OpenDRIM_OperatingSystem_populate(OpenDRIM_OperatingSystem& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystem_getOperatingSystemInfo(OpenDRIM_OperatingSystem& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystem_getVersion(string& Version, string& errorMessage); int OS_OpenDRIM_OperatingSystem_getLastBootUpTime(string& LastBootUpTime, string& errorMessage); int OS_OpenDRIM_OperatingSystem_getNumberOfUsers(unsigned long& NumberOfUsers, string& errorMessage); int OS_OpenDRIM_OperatingSystem_getNumberOfProcesses(unsigned long& NumberOfProcesses, string& errorMessage); int OS_OpenDRIM_OperatingSystem_getMaxNumberOfProcesses(unsigned long& MaxNumberOfProcesses, string& errorMessage); int OS_OpenDRIM_OperatingSystem_getMaxProcessMemorySize(unsigned long& MaxProcessMemorySize, string& errorMessage); int OS_OpenDRIM_OperatingSystem_getMaxProcessPerUser(unsigned long& MaxProcessPerUser, string& errorMessage); int OS_OpenDRIM_OperatingSystem_getElementName(string& ElementName, string& errorMessage); int OS_OpenDRIM_OperatingSystem_getDateOfInstallation(unsigned long& DateOfInstallation, string& errorMessage); int OS_OpenDRIM_OperatingSystem_isShuttingDown(bool& shutting_down, string& errorMessage); int OS_OpenDRIM_OperatingSystem_isRebooting(bool& rebooting, string& errorMessage); int OS_OpenDRIM_OperatingSystem_isStressed(bool& stressed, string& errorMessage); int OS_OpenDRIM_OperatingSystem_getNumberOfLogicalCPU(unsigned long& NumberOfLogicalCPU, string& errorMessage); int OS_OpenDRIM_OperatingSystem_getMemoryInfo(OpenDRIM_OperatingSystem& instance, string& errorMessage); #endif /*OPENDRIM_OPERATINGSYSTEMACCESS_H_*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystem/OpenDRIM_OperatingSystemProvider.cpp0000644000175000017500000003433711400673710032000 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystem.h" #include "OpenDRIM_OperatingSystemAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define OS_OpenDRIM_OperatingSystemProviderSetInstance OS_OpenDRIM_OperatingSystemProviderModifyInstance #endif int OS_OpenDRIM_OperatingSystem_init(const CMPIBroker* broker); int OS_OpenDRIM_OperatingSystem_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus OS_OpenDRIM_OperatingSystemProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = OS_OpenDRIM_OperatingSystem_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystem_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = OS_OpenDRIM_OperatingSystem_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemProviderEnumInstances(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 = OS_OpenDRIM_OperatingSystem_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = OS_OpenDRIM_OperatingSystem_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystem instance; OS_OpenDRIM_OperatingSystem_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystem_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = OS_OpenDRIM_OperatingSystem_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemProviderSetInstance(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_OperatingSystem newInstance, oldInstance; OS_OpenDRIM_OperatingSystem_toCPP(_broker, ci, newInstance); OS_OpenDRIM_OperatingSystem_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystem_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystem_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystem instance; OS_OpenDRIM_OperatingSystem_toCPP(_broker, ci, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystem_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_OperatingSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystem_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystem_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = OS_OpenDRIM_OperatingSystem_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystem instance; OS_OpenDRIM_OperatingSystem_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystem_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystem_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemProviderExecQuery(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 OS_OpenDRIM_OperatingSystemProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = OS_OpenDRIM_OperatingSystem_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemProviderInvokeMethod(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_OperatingSystem instance; OS_OpenDRIM_OperatingSystem_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"Name", "CreationClassName", "CSCreationClassName", "CSName"}; int errorCode = OS_OpenDRIM_OperatingSystem_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_OperatingSystem_RequestStateChange_In inArgs; OS_OpenDRIM_OperatingSystem_toCPP(_broker, in, inArgs); OpenDRIM_OperatingSystem_RequestStateChange_Out outArgs; errorCode = OS_OpenDRIM_OperatingSystem_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } OS_OpenDRIM_OperatingSystem_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="Shutdown") { unsigned int returnValue; errorCode = OS_OpenDRIM_OperatingSystem_Shutdown(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystem_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 =="Reboot") { unsigned int returnValue; errorCode = OS_OpenDRIM_OperatingSystem_Reboot(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystem_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_OperatingSystem_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 OS_OpenDRIM_OperatingSystem_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystem_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_OperatingSystem_init FAILED: " + (string) OpenDRIM_OperatingSystem_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int OS_OpenDRIM_OperatingSystem_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystem_unload(errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_OperatingSystem_unload FAILED: " + (string) OpenDRIM_OperatingSystem_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define OS_OpenDRIM_OperatingSystem_INIT if (OS_OpenDRIM_OperatingSystem_init(_broker) < 0) return NULL CMInstanceMIStub(OS_OpenDRIM_OperatingSystemProvider, OS_OpenDRIM_OperatingSystemProvider, _broker, OS_OpenDRIM_OperatingSystem_INIT); CMMethodMIStub(OS_OpenDRIM_OperatingSystemProvider, OS_OpenDRIM_OperatingSystemProvider, _broker, OS_OpenDRIM_OperatingSystem_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OSConformsToProfile/0000755000175000017500000000000011400673710023474 5ustar guillaumeguillaumeopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OSConformsToProfile/cmpiOpenDRIM_OSConformsToProfile.cpp0000644000175000017500000000624111400673710032365 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OSConformsToProfile.h" CMPIObjectPath* OS_OpenDRIM_OSConformsToProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_OSConformsToProfile& instance) { _E_; Objectpath op(broker, OpenDRIM_OSConformsToProfile_classnames[0], OpenDRIM_OSConformsToProfile_NAMESPACE); if (!instance.ConformantStandard_isNULL) op.addKey("ConformantStandard", instance.ConformantStandard); if (!instance.ManagedElement_isNULL) op.addKey("ManagedElement", instance.ManagedElement); _L_; return op.getHdl(); } CMPIInstance* OS_OpenDRIM_OSConformsToProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_OSConformsToProfile& instance) { _E_; Objectpath op(broker, OS_OpenDRIM_OSConformsToProfile_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void OS_OpenDRIM_OSConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_OSConformsToProfile& 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 OS_OpenDRIM_OSConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_OSConformsToProfile& 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-os-1.1.0~ppa/OpenDRIM_OSConformsToProfile/Makefile.am0000644000175000017500000000471011400673710025532 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiOS_OpenDRIM_OSConformsToProfileProvider.la libcmpiOS_OpenDRIM_OSConformsToProfileProvider_la_SOURCES = OpenDRIM_OSConformsToProfileAccess.cpp OpenDRIM_OSConformsToProfileProvider.cpp cmpiOpenDRIM_OSConformsToProfile.cpp assocOpenDRIM_OSConformsToProfile.cpp # May have to be adjusted for direct invocation libcmpiOS_OpenDRIM_OSConformsToProfileProvider_la_CPPFLAGS = -I../CIM_RegisteredProfile -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiOS_OpenDRIM_OSConformsToProfileProvider_la_LIBADD = ../Common/libcmpiOS_Common.la #../CIM_RegisteredProfile/libcmpiOS_CIM_RegisteredProfileProvider.la ../CIM_ManagedElement/libcmpiOS_CIM_ManagedElementProvider.la libcmpiOS_OpenDRIM_OSConformsToProfileProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_OSConformsToProfile.h OpenDRIM_OSConformsToProfile.h OpenDRIM_OSConformsToProfileAccess.h opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OSConformsToProfile/OpenDRIM_OSConformsToProfileProvider.cpp0000644000175000017500000004142211400673710033227 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OSConformsToProfile.h" #include "OpenDRIM_OSConformsToProfileAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define OS_OpenDRIM_OSConformsToProfileProviderSetInstance OS_OpenDRIM_OSConformsToProfileProviderModifyInstance #endif int OS_OpenDRIM_OSConformsToProfile_init(const CMPIBroker* broker); int OS_OpenDRIM_OSConformsToProfile_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus OS_OpenDRIM_OSConformsToProfileProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = OS_OpenDRIM_OSConformsToProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus OS_OpenDRIM_OSConformsToProfileProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = OS_OpenDRIM_OSConformsToProfile_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OSConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = OS_OpenDRIM_OSConformsToProfile_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OSConformsToProfileProviderEnumInstances(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 = OS_OpenDRIM_OSConformsToProfile_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OSConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = OS_OpenDRIM_OSConformsToProfile_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OSConformsToProfileProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OSConformsToProfile instance; OS_OpenDRIM_OSConformsToProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_OSConformsToProfile_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OSConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = OS_OpenDRIM_OSConformsToProfile_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OSConformsToProfileProviderSetInstance(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_OSConformsToProfile newInstance, oldInstance; OS_OpenDRIM_OSConformsToProfile_toCPP(_broker, ci, newInstance); OS_OpenDRIM_OSConformsToProfile_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = OS_OpenDRIM_OSConformsToProfile_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OSConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OSConformsToProfile_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OSConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OSConformsToProfileProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OSConformsToProfile instance; OS_OpenDRIM_OSConformsToProfile_toCPP(_broker, ci, instance); string errorMessage; int errorCode = OS_OpenDRIM_OSConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_OSConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OSConformsToProfile_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OSConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OSConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OSConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = OS_OpenDRIM_OSConformsToProfile_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OSConformsToProfileProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OSConformsToProfile instance; OS_OpenDRIM_OSConformsToProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_OSConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OSConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OSConformsToProfile_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OSConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OSConformsToProfileProviderExecQuery(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 OS_OpenDRIM_OSConformsToProfileProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = OS_OpenDRIM_OSConformsToProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus OS_OpenDRIM_OSConformsToProfileProviderAssociatorNames(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 = OS_OpenDRIM_OSConformsToProfile_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OSConformsToProfile_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 OS_OpenDRIM_OSConformsToProfileProviderAssociators(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 = OS_OpenDRIM_OSConformsToProfile_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OSConformsToProfile_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 OS_OpenDRIM_OSConformsToProfileProviderReferenceNames(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 = OS_OpenDRIM_OSConformsToProfile_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OSConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = OS_OpenDRIM_OSConformsToProfile_referenceConformantStandardToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = OS_OpenDRIM_OSConformsToProfile_referenceManagedElementToConformantStandard(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OSConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = OS_OpenDRIM_OSConformsToProfile_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus OS_OpenDRIM_OSConformsToProfileProviderReferences(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 = OS_OpenDRIM_OSConformsToProfile_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OSConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = OS_OpenDRIM_OSConformsToProfile_referenceConformantStandardToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = OS_OpenDRIM_OSConformsToProfile_referenceManagedElementToConformantStandard(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OSConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = OS_OpenDRIM_OSConformsToProfile_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int OS_OpenDRIM_OSConformsToProfile_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = OS_OpenDRIM_OSConformsToProfile_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_OSConformsToProfile_init FAILED: " + (string) OpenDRIM_OSConformsToProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int OS_OpenDRIM_OSConformsToProfile_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = OS_OpenDRIM_OSConformsToProfile_unload(errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_OSConformsToProfile_unload FAILED: " + (string) OpenDRIM_OSConformsToProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define OS_OpenDRIM_OSConformsToProfile_INIT if (OS_OpenDRIM_OSConformsToProfile_init(_broker) < 0) return NULL CMInstanceMIStub(OS_OpenDRIM_OSConformsToProfileProvider, OS_OpenDRIM_OSConformsToProfileProvider, _broker, OS_OpenDRIM_OSConformsToProfile_INIT); CMAssociationMIStub(OS_OpenDRIM_OSConformsToProfileProvider, OS_OpenDRIM_OSConformsToProfileProvider, _broker, OS_OpenDRIM_OSConformsToProfile_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OSConformsToProfile/OpenDRIM_OSConformsToProfileAccess.cpp0000644000175000017500000002476511400673710032651 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_OSConformsToProfileAccess.h" int OS_OpenDRIM_OSConformsToProfile_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(OS_CIM_RegisteredProfile_load(broker, errorMessage)); CF_assert(OS_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int OS_OpenDRIM_OSConformsToProfile_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(OS_CIM_RegisteredProfile_unload(errorMessage)); CF_assert(OS_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int OS_OpenDRIM_OSConformsToProfile_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 OS_OpenDRIM_OSConformsToProfile_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(OS_OpenDRIM_OSConformsToProfile_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(OS_OpenDRIM_OSConformsToProfile_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; OS_OpenDRIM_OSConformsToProfile_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(OS_OpenDRIM_OSConformsToProfile_referenceConformantStandardToManagedElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int OS_OpenDRIM_OSConformsToProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_OSConformsToProfile& 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(OS_OpenDRIM_OSConformsToProfile_getConformantStandard(broker, ctx, ConformantStandard_objectpath, ConformantStandard_instance, NULL, errorMessage)); Objectpath ManagedElement_objectpath; instance.getManagedElement(ManagedElement_objectpath); Instance ManagedElement_instance; CF_assert(OS_OpenDRIM_OSConformsToProfile_getManagedElement(broker, ctx, ManagedElement_objectpath, ManagedElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(OS_OpenDRIM_OSConformsToProfile_isAssociated(ConformantStandard_instance, ManagedElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int OS_OpenDRIM_OSConformsToProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OSConformsToProfile& newInstance, const OpenDRIM_OSConformsToProfile& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OSConformsToProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OSConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OSConformsToProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OSConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OSConformsToProfile_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(OS_OpenDRIM_OSConformsToProfile_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(OS_OpenDRIM_OSConformsToProfile_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(OS_OpenDRIM_OSConformsToProfile_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(OS_OpenDRIM_OSConformsToProfile_enumerateConformantStandards(broker, ctx, ConformantStandard_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(OS_OpenDRIM_OSConformsToProfile_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(OS_OpenDRIM_OSConformsToProfile_enumerateConformantStandards(broker, ctx, ConformantStandard_instances, properties, false, errorMessage)); } for (size_t i=0; i& ManagedElement_instances, vector& OpenDRIM_OSConformsToProfile_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_OSConformsToProfile instance; instance.setConformantStandard(((Instance) ConformantStandard_instance).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instances[i]).getObjectpath()); OpenDRIM_OSConformsToProfile_instances.push_back(instance); } _L_; return OK; } int OS_OpenDRIM_OSConformsToProfile_referenceManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& ConformantStandard_instances, vector& OpenDRIM_OSConformsToProfile_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_OSConformsToProfile instance; instance.setConformantStandard(((Instance) ConformantStandard_instances[i]).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instance).getObjectpath()); OpenDRIM_OSConformsToProfile_instances.push_back(instance); } _L_; return OK; } int OS_OpenDRIM_OSConformsToProfile_populate(OpenDRIM_OSConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OSConformsToProfile/OpenDRIM_OSConformsToProfileAccess.h0000644000175000017500000001052411400673710032302 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_OSCONFORMSTOPROFILEACCESS_H_ #define OPENDRIM_OSCONFORMSTOPROFILEACCESS_H_ #include "OS_Common.h" #include "OpenDRIM_OSConformsToProfile.h" #include "assocOpenDRIM_OSConformsToProfile.h" int OS_OpenDRIM_OSConformsToProfile_load(const CMPIBroker* broker, string& errorMessage); int OS_OpenDRIM_OSConformsToProfile_unload(string& errorMessage); int OS_OpenDRIM_OSConformsToProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OSConformsToProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_OSConformsToProfile& instance, const char** properties, string& errorMessage); int OS_OpenDRIM_OSConformsToProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OSConformsToProfile& newInstance, const OpenDRIM_OSConformsToProfile& oldInstance, const char** properties, string& errorMessage); int OS_OpenDRIM_OSConformsToProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OSConformsToProfile& instance, string& errorMessage); int OS_OpenDRIM_OSConformsToProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OSConformsToProfile& instance, string& errorMessage); int OS_OpenDRIM_OSConformsToProfile_associatorConformantStandardToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ConformantStandard_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OSConformsToProfile_associatorManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const char** properties, vector& ConformantStandard_associatedInstances, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OSConformsToProfile_referenceConformantStandardToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ConformantStandard_instance, const vector& ManagedElement_instances, vector& OpenDRIM_OSConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OSConformsToProfile_referenceManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& ConformantStandard_instances, vector& OpenDRIM_OSConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OSConformsToProfile_populate(OpenDRIM_OSConformsToProfile& instance, string& errorMessage); #endif /*OPENDRIM_OSCONFORMSTOPROFILEACCESS_H_*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OSConformsToProfile/OpenDRIM_OSConformsToProfile.h0000644000175000017500000000724211400673710031163 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_OSCONFORMSTOPROFILE_H_ #define OPENDRIM_OSCONFORMSTOPROFILE_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_OSConformsToProfile_classnames[] = {"OpenDRIM_OSConformsToProfile"}; static string OpenDRIM_OSConformsToProfile_NAMESPACE = _INTEROP_NAMESPACE; const static string ConformantStandard_role = "ConformantStandard"; const static char* ConformantStandard_classnames[] = {"OpenDRIM_RegisteredOSProfile"}; const static string ConformantStandard_NAMESPACE = _INTEROP_NAMESPACE; const static string ManagedElement_role = "ManagedElement"; const static char* ManagedElement_classnames[] = {"OpenDRIM_OperatingSystem"}; const static string ManagedElement_NAMESPACE = _NAMESPACE; class OpenDRIM_OSConformsToProfile { public: Objectpath ConformantStandard; bool ConformantStandard_isNULL; Objectpath ManagedElement; bool ManagedElement_isNULL; OpenDRIM_OSConformsToProfile() { ConformantStandard_isNULL = true; ManagedElement_isNULL = true; } ~OpenDRIM_OSConformsToProfile() {} 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_OSCONFORMSTOPROFILE_H_*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OSConformsToProfile/assocOpenDRIM_OSConformsToProfile.h0000644000175000017500000000622311400673710032212 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_OSCONFORMSTOPROFILE_H_ #define ASSOCOPENDRIM_OSCONFORMSTOPROFILE_H_ #include "OpenDRIM_OSConformsToProfileAccess.h" int OS_OpenDRIM_OSConformsToProfile_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 OS_OpenDRIM_OSConformsToProfile_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 OS_OpenDRIM_OSConformsToProfile_enumerateConformantStandards(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int OS_OpenDRIM_OSConformsToProfile_getConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int OS_OpenDRIM_OSConformsToProfile_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int OS_OpenDRIM_OSConformsToProfile_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_OSCONFORMSTOPROFILE_H_*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OSConformsToProfile/assocOpenDRIM_OSConformsToProfile.cpp0000644000175000017500000002120411400673710032541 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_OSConformsToProfile.h" int OS_OpenDRIM_OSConformsToProfile_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 = OS_OpenDRIM_OSConformsToProfile_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(OS_OpenDRIM_OSConformsToProfile_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(OS_OpenDRIM_OSConformsToProfile_associatorManagedElementToConformantStandard(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int OS_OpenDRIM_OSConformsToProfile_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(OS_CIM_RegisteredProfile_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(OS_CIM_RegisteredProfile_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, OS_CIM_RegisteredProfile_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int OS_OpenDRIM_OSConformsToProfile_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; OS_CIM_RegisteredProfile_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(OS_CIM_RegisteredProfile_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, OS_CIM_RegisteredProfile_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int OS_OpenDRIM_OSConformsToProfile_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(OS_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(OS_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, OS_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int OS_OpenDRIM_OSConformsToProfile_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; OS_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(OS_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, OS_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OSConformsToProfile/cmpiOpenDRIM_OSConformsToProfile.h0000644000175000017500000000433711400673710032036 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_OSCONFORMSTOPROFILE_H_ #define CMPIOPENDRIM_OSCONFORMSTOPROFILE_H_ #include "OpenDRIM_OSConformsToProfile.h" CMPIObjectPath* OS_OpenDRIM_OSConformsToProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_OSConformsToProfile& instance); CMPIInstance* OS_OpenDRIM_OSConformsToProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_OSConformsToProfile& instance); void OS_OpenDRIM_OSConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_OSConformsToProfile& instance); void OS_OpenDRIM_OSConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_OSConformsToProfile& instance); #endif /*CMPIOPENDRIM_OSCONFORMSTOPROFILE_H_*/ opendrim-lmp-os-1.1.0~ppa/test/0000755000175000017500000000000011400673710017142 5ustar guillaumeguillaumeopendrim-lmp-os-1.1.0~ppa/test/testOpenDRIM_InstalledOS.cpp0000644000175000017500000001127011400673710024365 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_InstalledOS.h" #include "OpenDRIM_InstalledOSAccess.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_InstalledOS& instance) { os << " [OpenDRIM_InstalledOS]" << endl; ToStringRef("GroupComponent", GroupComponent, GroupComponent_isNULL); ToStringRef("PartComponent", PartComponent, PartComponent_isNULL); ToString("PrimaryOS", PrimaryOS, PrimaryOS_isNULL); os << " [\\OpenDRIM_InstalledOS]" << endl; return os; } int main() { string errorMessage; int errorCode = OS_OpenDRIM_InstalledOS_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = OS_OpenDRIM_InstalledOS_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 = OS_OpenDRIM_InstalledOS_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 = OS_OpenDRIM_InstalledOS_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 = OS_OpenDRIM_InstalledOS_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-os-1.1.0~ppa/test/Makefile.am0000644000175000017500000001725311400673710021206 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ noinst_PROGRAMS = testOpenDRIM_BootOSFromFS testOpenDRIM_InstalledOS testOpenDRIM_OperatingSystemCurrentRunLevel testOpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel testOpenDRIM_OSConformsToProfile testOpenDRIM_OperatingSystem testOpenDRIM_RegisteredOSProfile testOpenDRIM_RunningOS testOpenDRIM_OperatingSystemStatistics testOpenDRIM_OperatingSystemDefaultRunLevel testOpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel testOpenDRIM_OperatingSystemLoadAverages # May have to be adjusted for direct invocation testOpenDRIM_BootOSFromFS_CPPFLAGS = -I../OpenDRIM_BootOSFromFS/ -I../null/ -I../null/ testOpenDRIM_BootOSFromFS_SOURCES = testOpenDRIM_BootOSFromFS.cpp testOpenDRIM_BootOSFromFS_LDADD = ../OpenDRIM_BootOSFromFS/libcmpiOS_OpenDRIM_BootOSFromFSProvider.la test-OpenDRIM_BootOSFromFS: testOpenDRIM_BootOSFromFS ./testOpenDRIM_BootOSFromFS # May have to be adjusted for direct invocation testOpenDRIM_InstalledOS_CPPFLAGS = -I../OpenDRIM_InstalledOS/ -I../null/ -I../null/ testOpenDRIM_InstalledOS_SOURCES = testOpenDRIM_InstalledOS.cpp testOpenDRIM_InstalledOS_LDADD = ../OpenDRIM_InstalledOS/libcmpiOS_OpenDRIM_InstalledOSProvider.la test-OpenDRIM_InstalledOS: testOpenDRIM_InstalledOS ./testOpenDRIM_InstalledOS testOpenDRIM_OperatingSystemCurrentRunLevel_CPPFLAGS = -I../OpenDRIM_OperatingSystemCurrentRunLevel/ testOpenDRIM_OperatingSystemCurrentRunLevel_SOURCES = testOpenDRIM_OperatingSystemCurrentRunLevel.cpp testOpenDRIM_OperatingSystemCurrentRunLevel_LDADD = ../OpenDRIM_OperatingSystemCurrentRunLevel/libcmpiOS_OpenDRIM_OperatingSystemCurrentRunLevelProvider.la test-OpenDRIM_OperatingSystemCurrentRunLevel: testOpenDRIM_OperatingSystemCurrentRunLevel ./testOpenDRIM_OperatingSystemCurrentRunLevel # May have to be adjusted for direct invocation testOpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_CPPFLAGS = -I../OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/ -I../null/ -I../null/ testOpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_SOURCES = testOpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.cpp testOpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_LDADD = ../OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/libcmpiOS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProvider.la test-OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel: testOpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel ./testOpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel # May have to be adjusted for direct invocation testOpenDRIM_OSConformsToProfile_CPPFLAGS = -I../OpenDRIM_OSConformsToProfile/ -I../null/ -I../null/ testOpenDRIM_OSConformsToProfile_SOURCES = testOpenDRIM_OSConformsToProfile.cpp testOpenDRIM_OSConformsToProfile_LDADD = ../OpenDRIM_OSConformsToProfile/libcmpiOS_OpenDRIM_OSConformsToProfileProvider.la test-OpenDRIM_OSConformsToProfile: testOpenDRIM_OSConformsToProfile ./testOpenDRIM_OSConformsToProfile testOpenDRIM_OperatingSystem_CPPFLAGS = -I../OpenDRIM_OperatingSystem/ testOpenDRIM_OperatingSystem_SOURCES = testOpenDRIM_OperatingSystem.cpp testOpenDRIM_OperatingSystem_LDADD = ../OpenDRIM_OperatingSystem/libcmpiOS_OpenDRIM_OperatingSystemProvider.la test-OpenDRIM_OperatingSystem: testOpenDRIM_OperatingSystem ./testOpenDRIM_OperatingSystem testOpenDRIM_RegisteredOSProfile_CPPFLAGS = -I../OpenDRIM_RegisteredOSProfile/ testOpenDRIM_RegisteredOSProfile_SOURCES = testOpenDRIM_RegisteredOSProfile.cpp testOpenDRIM_RegisteredOSProfile_LDADD = ../OpenDRIM_RegisteredOSProfile/libcmpiOS_OpenDRIM_RegisteredOSProfileProvider.la test-OpenDRIM_RegisteredOSProfile: testOpenDRIM_RegisteredOSProfile ./testOpenDRIM_RegisteredOSProfile # May have to be adjusted for direct invocation testOpenDRIM_RunningOS_CPPFLAGS = -I../OpenDRIM_RunningOS/ -I../null/ -I../null/ testOpenDRIM_RunningOS_SOURCES = testOpenDRIM_RunningOS.cpp testOpenDRIM_RunningOS_LDADD = ../OpenDRIM_RunningOS/libcmpiOS_OpenDRIM_RunningOSProvider.la test-OpenDRIM_RunningOS: testOpenDRIM_RunningOS ./testOpenDRIM_RunningOS # May have to be adjusted for direct invocation testOpenDRIM_OperatingSystemStatistics_CPPFLAGS = -I../OpenDRIM_OperatingSystemStatistics/ -I../null/ -I../null/ testOpenDRIM_OperatingSystemStatistics_SOURCES = testOpenDRIM_OperatingSystemStatistics.cpp testOpenDRIM_OperatingSystemStatistics_LDADD = ../OpenDRIM_OperatingSystemStatistics/libcmpiOS_OpenDRIM_OperatingSystemStatisticsProvider.la test-OpenDRIM_OperatingSystemStatistics: testOpenDRIM_OperatingSystemStatistics ./testOpenDRIM_OperatingSystemStatistics testOpenDRIM_OperatingSystemDefaultRunLevel_CPPFLAGS = -I../OpenDRIM_OperatingSystemDefaultRunLevel/ testOpenDRIM_OperatingSystemDefaultRunLevel_SOURCES = testOpenDRIM_OperatingSystemDefaultRunLevel.cpp testOpenDRIM_OperatingSystemDefaultRunLevel_LDADD = ../OpenDRIM_OperatingSystemDefaultRunLevel/libcmpiOS_OpenDRIM_OperatingSystemDefaultRunLevelProvider.la test-OpenDRIM_OperatingSystemDefaultRunLevel: testOpenDRIM_OperatingSystemDefaultRunLevel ./testOpenDRIM_OperatingSystemDefaultRunLevel # May have to be adjusted for direct invocation testOpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_CPPFLAGS = -I../OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/ -I../null/ -I../null/ testOpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_SOURCES = testOpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.cpp testOpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_LDADD = ../OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/libcmpiOS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProvider.la test-OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel: testOpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel ./testOpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel testOpenDRIM_OperatingSystemLoadAverages_CPPFLAGS = -I../OpenDRIM_OperatingSystemLoadAverages/ testOpenDRIM_OperatingSystemLoadAverages_SOURCES = testOpenDRIM_OperatingSystemLoadAverages.cpp testOpenDRIM_OperatingSystemLoadAverages_LDADD = ../OpenDRIM_OperatingSystemLoadAverages/libcmpiOS_OpenDRIM_OperatingSystemLoadAveragesProvider.la test-OpenDRIM_OperatingSystemLoadAverages: testOpenDRIM_OperatingSystemLoadAverages ./testOpenDRIM_OperatingSystemLoadAverages opendrim-lmp-os-1.1.0~ppa/test/testOpenDRIM_RegisteredOSProfile.cpp0000644000175000017500000001237411400673710026072 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ################################################################################*/ #include "cmpiOpenDRIM_RegisteredOSProfile.h" #include "OpenDRIM_RegisteredOSProfileAccess.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_RegisteredOSProfile& instance) { os << " [OpenDRIM_RegisteredOSProfile]" << 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_RegisteredOSProfile]" << endl; return os; } int main() { string errorMessage; int errorCode = OS_OpenDRIM_RegisteredOSProfile_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = OS_OpenDRIM_RegisteredOSProfile_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 = OS_OpenDRIM_RegisteredOSProfile_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 = OS_OpenDRIM_RegisteredOSProfile_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 = OS_OpenDRIM_RegisteredOSProfile_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-os-1.1.0~ppa/test/testOpenDRIM_OperatingSystemDefaultRunLevel.cpp0000644000175000017500000001217111400673710030324 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystemDefaultRunLevel.h" #include "OpenDRIM_OperatingSystemDefaultRunLevelAccess.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_OperatingSystemDefaultRunLevel& instance) { os << " [OpenDRIM_OperatingSystemDefaultRunLevel]" << endl; ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("ConfigurationName", ConfigurationName, ConfigurationName_isNULL); ToStringInt("ChangeableType", ChangeableType, ChangeableType_isNULL); ToStringInt("Value", Value, Value_isNULL); os << " [\\OpenDRIM_OperatingSystemDefaultRunLevel]" << endl; return os; } int main() { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemDefaultRunLevel_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = OS_OpenDRIM_OperatingSystemDefaultRunLevel_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 = OS_OpenDRIM_OperatingSystemDefaultRunLevel_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 = OS_OpenDRIM_OperatingSystemDefaultRunLevel_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 = OS_OpenDRIM_OperatingSystemDefaultRunLevel_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-os-1.1.0~ppa/test/testOpenDRIM_OperatingSystem.cpp0000644000175000017500000001725511400673710025352 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystem.h" #include "OpenDRIM_OperatingSystemAccess.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_OperatingSystem& instance) { os << " [OpenDRIM_OperatingSystem]" << endl; ToString("InstanceID", InstanceID, InstanceID_isNULL); 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("CommunicationStatus", CommunicationStatus, CommunicationStatus_isNULL); ToStringInt("DetailedStatus", DetailedStatus, DetailedStatus_isNULL); ToStringInt("OperatingStatus", OperatingStatus, OperatingStatus_isNULL); ToStringInt("PrimaryStatus", PrimaryStatus, PrimaryStatus_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("CSCreationClassName", CSCreationClassName, CSCreationClassName_isNULL); ToString("CSName", CSName, CSName_isNULL); ToString("CreationClassName", CreationClassName, CreationClassName_isNULL); ToString("Name", Name, Name_isNULL); ToStringInt("OSType", OSType, OSType_isNULL); ToString("OtherTypeDescription", OtherTypeDescription, OtherTypeDescription_isNULL); ToString("Version", Version, Version_isNULL); ToString("LastBootUpTime", LastBootUpTime, LastBootUpTime_isNULL); ToString("LocalDateTime", LocalDateTime, LocalDateTime_isNULL); ToStringInt("CurrentTimeZone", CurrentTimeZone, CurrentTimeZone_isNULL); ToString("NumberOfLicensedUsers", NumberOfLicensedUsers, NumberOfLicensedUsers_isNULL); ToString("NumberOfUsers", NumberOfUsers, NumberOfUsers_isNULL); ToString("NumberOfProcesses", NumberOfProcesses, NumberOfProcesses_isNULL); ToString("MaxNumberOfProcesses", MaxNumberOfProcesses, MaxNumberOfProcesses_isNULL); ToString("TotalSwapSpaceSize", TotalSwapSpaceSize, TotalSwapSpaceSize_isNULL); ToString("TotalVirtualMemorySize", TotalVirtualMemorySize, TotalVirtualMemorySize_isNULL); ToString("FreeVirtualMemory", FreeVirtualMemory, FreeVirtualMemory_isNULL); ToString("FreePhysicalMemory", FreePhysicalMemory, FreePhysicalMemory_isNULL); ToString("TotalVisibleMemorySize", TotalVisibleMemorySize, TotalVisibleMemorySize_isNULL); ToString("SizeStoredInPagingFiles", SizeStoredInPagingFiles, SizeStoredInPagingFiles_isNULL); ToString("FreeSpaceInPagingFiles", FreeSpaceInPagingFiles, FreeSpaceInPagingFiles_isNULL); ToString("MaxProcessMemorySize", MaxProcessMemorySize, MaxProcessMemorySize_isNULL); ToString("Distributed", Distributed, Distributed_isNULL); ToString("MaxProcessesPerUser", MaxProcessesPerUser, MaxProcessesPerUser_isNULL); os << " [\\OpenDRIM_OperatingSystem]" << endl; return os; } int main() { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystem_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = OS_OpenDRIM_OperatingSystem_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 = OS_OpenDRIM_OperatingSystem_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 = OS_OpenDRIM_OperatingSystem_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 = OS_OpenDRIM_OperatingSystem_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-os-1.1.0~ppa/test/testOpenDRIM_BootOSFromFS.cpp0000644000175000017500000001116711400673710024433 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_BootOSFromFS.h" #include "OpenDRIM_BootOSFromFSAccess.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_BootOSFromFS& instance) { os << " [OpenDRIM_BootOSFromFS]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); os << " [\\OpenDRIM_BootOSFromFS]" << endl; return os; } int main() { string errorMessage; int errorCode = OS_OpenDRIM_BootOSFromFS_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = OS_OpenDRIM_BootOSFromFS_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 = OS_OpenDRIM_BootOSFromFS_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 = OS_OpenDRIM_BootOSFromFS_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 = OS_OpenDRIM_BootOSFromFS_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-os-1.1.0~ppa/test/testOpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.cpp0000644000175000017500000001253411400673710033443 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.h" #include "OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelAccess.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_OperatingSystemOperatingSystemCurrentRunLevel& instance) { os << " [OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel]" << endl; ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL); ToStringRef("SettingData", SettingData, SettingData_isNULL); ToStringInt("IsDefault", IsDefault, IsDefault_isNULL); ToStringInt("IsCurrent", IsCurrent, IsCurrent_isNULL); ToStringInt("IsNext", IsNext, IsNext_isNULL); ToStringInt("IsMinimum", IsMinimum, IsMinimum_isNULL); ToStringInt("IsMaximum", IsMaximum, IsMaximum_isNULL); ToStringInt("IsPending", IsPending, IsPending_isNULL); os << " [\\OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel]" << endl; return os; } int main() { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_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 = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_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 = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_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 = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-os-1.1.0~ppa/test/testOpenDRIM_RunningOS.cpp0000644000175000017500000001112311400673710024063 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_RunningOS.h" #include "OpenDRIM_RunningOSAccess.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_RunningOS& instance) { os << " [OpenDRIM_RunningOS]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); os << " [\\OpenDRIM_RunningOS]" << endl; return os; } int main() { string errorMessage; int errorCode = OS_OpenDRIM_RunningOS_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = OS_OpenDRIM_RunningOS_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 = OS_OpenDRIM_RunningOS_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 = OS_OpenDRIM_RunningOS_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 = OS_OpenDRIM_RunningOS_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-os-1.1.0~ppa/test/testOpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.cpp0000644000175000017500000001253411400673710033405 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.h" #include "OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelAccess.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_OperatingSystemOperatingSystemDefaultRunLevel& instance) { os << " [OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel]" << endl; ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL); ToStringRef("SettingData", SettingData, SettingData_isNULL); ToStringInt("IsDefault", IsDefault, IsDefault_isNULL); ToStringInt("IsCurrent", IsCurrent, IsCurrent_isNULL); ToStringInt("IsNext", IsNext, IsNext_isNULL); ToStringInt("IsMinimum", IsMinimum, IsMinimum_isNULL); ToStringInt("IsMaximum", IsMaximum, IsMaximum_isNULL); ToStringInt("IsPending", IsPending, IsPending_isNULL); os << " [\\OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel]" << endl; return os; } int main() { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_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 = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_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 = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_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 = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-os-1.1.0~ppa/test/testOpenDRIM_OSConformsToProfile.cpp0000644000175000017500000001125011400673710026056 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Khahramon NURIDDINOV, TUIT # # 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 Guillaume BOTTEX, ETRI ################################################################################*/ #include "cmpiOpenDRIM_OSConformsToProfile.h" #include "OpenDRIM_OSConformsToProfileAccess.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_OSConformsToProfile& instance) { os << " [OpenDRIM_OSConformsToProfile]" << endl; ToStringRef("ConformantStandard", ConformantStandard, ConformantStandard_isNULL); ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL); os << " [\\OpenDRIM_OSConformsToProfile]" << endl; return os; } int main() { string errorMessage; int errorCode = OS_OpenDRIM_OSConformsToProfile_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = OS_OpenDRIM_OSConformsToProfile_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 = OS_OpenDRIM_OSConformsToProfile_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 = OS_OpenDRIM_OSConformsToProfile_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 = OS_OpenDRIM_OSConformsToProfile_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-os-1.1.0~ppa/test/testOpenDRIM_OperatingSystemLoadAverages.cpp0000644000175000017500000001177611400673710027632 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystemLoadAverages.h" #include "OpenDRIM_OperatingSystemLoadAveragesAccess.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_OperatingSystemLoadAverages& instance) { os << " [OpenDRIM_OperatingSystemLoadAverages]" << endl; ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("Name", Name, Name_isNULL); ToStringArray("LoadAverages", LoadAverages, LoadAverages_isNULL); os << " [\\OpenDRIM_OperatingSystemLoadAverages]" << endl; return os; } int main() { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemLoadAverages_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = OS_OpenDRIM_OperatingSystemLoadAverages_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 = OS_OpenDRIM_OperatingSystemLoadAverages_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 = OS_OpenDRIM_OperatingSystemLoadAverages_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 = OS_OpenDRIM_OperatingSystemLoadAverages_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-os-1.1.0~ppa/test/testOpenDRIM_OperatingSystemCurrentRunLevel.cpp0000644000175000017500000001217111400673710030362 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystemCurrentRunLevel.h" #include "OpenDRIM_OperatingSystemCurrentRunLevelAccess.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_OperatingSystemCurrentRunLevel& instance) { os << " [OpenDRIM_OperatingSystemCurrentRunLevel]" << endl; ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("ConfigurationName", ConfigurationName, ConfigurationName_isNULL); ToStringInt("ChangeableType", ChangeableType, ChangeableType_isNULL); ToStringInt("Value", Value, Value_isNULL); os << " [\\OpenDRIM_OperatingSystemCurrentRunLevel]" << endl; return os; } int main() { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemCurrentRunLevel_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = OS_OpenDRIM_OperatingSystemCurrentRunLevel_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 = OS_OpenDRIM_OperatingSystemCurrentRunLevel_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 = OS_OpenDRIM_OperatingSystemCurrentRunLevel_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 = OS_OpenDRIM_OperatingSystemCurrentRunLevel_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-os-1.1.0~ppa/test/testOpenDRIM_OperatingSystemStatistics.cpp0000644000175000017500000001137611400673710027423 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystemStatistics.h" #include "OpenDRIM_OperatingSystemStatisticsAccess.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_OperatingSystemStatistics& instance) { os << " [OpenDRIM_OperatingSystemStatistics]" << endl; ToStringRef("Stats", Stats, Stats_isNULL); ToStringRef("Element", Element, Element_isNULL); os << " [\\OpenDRIM_OperatingSystemStatistics]" << endl; return os; } int main() { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemStatistics_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = OS_OpenDRIM_OperatingSystemStatistics_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 = OS_OpenDRIM_OperatingSystemStatistics_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 = OS_OpenDRIM_OperatingSystemStatistics_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 = OS_OpenDRIM_OperatingSystemStatistics_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-os-1.1.0~ppa/acinclude.m40000644000175000017500000002123411400673710020356 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ AC_DEFUN([SHOW_COPYRIGHT], [ echo "################################################################################# # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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-os-1.1.0~ppa/Common/0000755000175000017500000000000011400673710017413 5ustar guillaumeguillaumeopendrim-lmp-os-1.1.0~ppa/Common/Makefile.am0000644000175000017500000000347711400673710021462 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ commonlibdir = @COMMONLIBDIR@ commonlib_LTLIBRARIES = libcmpiOS_Common.la libcmpiOS_Common_la_SOURCES = OS_Common.cpp libcmpiOS_Common_la_LDFLAGS = -avoid-version libcmpiOS_Common_la_LIBADD = -lopendrim noinst_HEADERS = OS_Common.h opendrim-lmp-os-1.1.0~ppa/Common/OS_Common.h0000644000175000017500000000325411400673710021421 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OS_COMMON_H_ #define OS_COMMON_H_ #include #endif /*OS_COMMON_H_*/ opendrim-lmp-os-1.1.0~ppa/Common/OS_Common.cpp0000644000175000017500000000315311400673710021752 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OS_Common.h" opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemLoadAverages/0000755000175000017500000000000011400673710025233 5ustar guillaumeguillaumeopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemLoadAverages/Makefile.am0000644000175000017500000000433111400673710027270 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiOS_OpenDRIM_OperatingSystemLoadAveragesProvider.la libcmpiOS_OpenDRIM_OperatingSystemLoadAveragesProvider_la_SOURCES = OpenDRIM_OperatingSystemLoadAveragesAccess.cpp OpenDRIM_OperatingSystemLoadAveragesProvider.cpp cmpiOpenDRIM_OperatingSystemLoadAverages.cpp libcmpiOS_OpenDRIM_OperatingSystemLoadAveragesProvider_la_LIBADD = ../Common/libcmpiOS_Common.la libcmpiOS_OpenDRIM_OperatingSystemLoadAveragesProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_OperatingSystemLoadAverages.h OpenDRIM_OperatingSystemLoadAverages.h OpenDRIM_OperatingSystemLoadAveragesAccess.h ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemLoadAverages/cmpiOpenDRIM_OperatingSystemLoadAverages.hopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemLoadAverages/cmpiOpenDRIM_OperatingSystemLoadAvera0000644000175000017500000000461311400673710034404 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_OPERATINGSYSTEMLOADAVERAGES_H_ #define CMPIOPENDRIM_OPERATINGSYSTEMLOADAVERAGES_H_ #include "OpenDRIM_OperatingSystemLoadAverages.h" CMPIObjectPath* OS_OpenDRIM_OperatingSystemLoadAverages_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_OperatingSystemLoadAverages& instance); CMPIInstance* OS_OpenDRIM_OperatingSystemLoadAverages_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_OperatingSystemLoadAverages& instance); void OS_OpenDRIM_OperatingSystemLoadAverages_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_OperatingSystemLoadAverages& instance); void OS_OpenDRIM_OperatingSystemLoadAverages_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_OperatingSystemLoadAverages& instance); #endif /*CMPIOPENDRIM_OPERATINGSYSTEMLOADAVERAGES_H_*/ ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemLoadAverages/OpenDRIM_OperatingSystemLoadAveragesAccess.hopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemLoadAverages/OpenDRIM_OperatingSystemLoadAveragesA0000644000175000017500000000643411400673710034336 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_OPERATINGSYSTEMLOADAVERAGESACCESS_H_ #define OPENDRIM_OPERATINGSYSTEMLOADAVERAGESACCESS_H_ #include "OS_Common.h" #include "OpenDRIM_OperatingSystemLoadAverages.h" int OS_OpenDRIM_OperatingSystemLoadAverages_load(const CMPIBroker* broker, string& errorMessage); int OS_OpenDRIM_OperatingSystemLoadAverages_unload(string& errorMessage); int OS_OpenDRIM_OperatingSystemLoadAverages_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OperatingSystemLoadAverages_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_OperatingSystemLoadAverages& instance, const char** properties, string& errorMessage); int OS_OpenDRIM_OperatingSystemLoadAverages_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemLoadAverages& newInstance, const OpenDRIM_OperatingSystemLoadAverages& oldInstance, const char** properties, string& errorMessage); int OS_OpenDRIM_OperatingSystemLoadAverages_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemLoadAverages& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystemLoadAverages_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemLoadAverages& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystemLoadAverages_populate(OpenDRIM_OperatingSystemLoadAverages& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystemLoadAverages_getLoadAverages(vector& LoadAverages, string& errorMessage); #endif /*OPENDRIM_OPERATINGSYSTEMLOADAVERAGESACCESS_H_*/ ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemLoadAverages/OpenDRIM_OperatingSystemLoadAverages.hopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemLoadAverages/OpenDRIM_OperatingSystemLoadAverages.0000644000175000017500000001007211400673710034304 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_OPERATINGSYSTEMLOADAVERAGES_H_ #define OPENDRIM_OPERATINGSYSTEMLOADAVERAGES_H_ #include const static char* OpenDRIM_OperatingSystemLoadAverages_classnames[] = {"OpenDRIM_OperatingSystemLoadAverages"}; static string OpenDRIM_OperatingSystemLoadAverages_NAMESPACE = _NAMESPACE; class OpenDRIM_OperatingSystemLoadAverages { public: string InstanceID; bool InstanceID_isNULL; string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string Name; bool Name_isNULL; vector LoadAverages; bool LoadAverages_isNULL; OpenDRIM_OperatingSystemLoadAverages() { InstanceID_isNULL = true; Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; Name_isNULL = true; LoadAverages_isNULL = true; } ~OpenDRIM_OperatingSystemLoadAverages() {} string getKeys() const { return CF_toLowCase(".Name=\"" + CF_quoteString(Name) + "\""); } 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 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 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 getLoadAverages(vector& value) const { if (LoadAverages_isNULL==true) return NOT_FOUND; value = LoadAverages; return OK; } int setLoadAverages(const vector& newValue) { LoadAverages = newValue; LoadAverages_isNULL = false; return OK; } }; #endif /*OPENDRIM_OPERATINGSYSTEMLOADAVERAGES_H_*/ ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemLoadAverages/OpenDRIM_OperatingSystemLoadAveragesAccess.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemLoadAverages/OpenDRIM_OperatingSystemLoadAveragesA0000644000175000017500000001071511400673710034333 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_OperatingSystemLoadAveragesAccess.h" const string _Name = "LoadAverages"; int OS_OpenDRIM_OperatingSystemLoadAverages_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int OS_OpenDRIM_OperatingSystemLoadAverages_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int OS_OpenDRIM_OperatingSystemLoadAverages_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; OpenDRIM_OperatingSystemLoadAverages instance; instance.setName(_Name); if (discriminant == "ei") { vector LoadAverages; CF_assert(OS_OpenDRIM_OperatingSystemLoadAverages_getLoadAverages(LoadAverages, errorMessage)); instance.setLoadAverages(LoadAverages); } result.push_back(instance); _L_; return OK; } int OS_OpenDRIM_OperatingSystemLoadAverages_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_OperatingSystemLoadAverages& instance, const char** properties, string& errorMessage) { _E_; string Name; instance.getName(Name); if (!CF_strCmpNoCase(Name, _Name)) return NOT_FOUND; vector LoadAverages; CF_assert(OS_OpenDRIM_OperatingSystemLoadAverages_getLoadAverages(LoadAverages, errorMessage)); instance.setLoadAverages(LoadAverages); _L_; return OK; } int OS_OpenDRIM_OperatingSystemLoadAverages_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemLoadAverages& newInstance, const OpenDRIM_OperatingSystemLoadAverages& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OperatingSystemLoadAverages_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemLoadAverages& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OperatingSystemLoadAverages_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemLoadAverages& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OperatingSystemLoadAverages_populate(OpenDRIM_OperatingSystemLoadAverages& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } int OS_OpenDRIM_OperatingSystemLoadAverages_getLoadAverages(vector& LoadAverages, string& errorMessage) { _E_; string loadavg; CF_assert(CF_readTextFile("/proc/loadavg", loadavg, errorMessage)); vector loadavg_elements; CF_splitTextBySpace(loadavg_elements, loadavg); if (loadavg_elements.size() < 5) { errorMessage = "Wrong format: /proc/loadavg"; return FAILED; } LoadAverages.push_back(atof(loadavg_elements[0].c_str())); LoadAverages.push_back(atof(loadavg_elements[1].c_str())); LoadAverages.push_back(atof(loadavg_elements[2].c_str())); _L_; return OK; } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemLoadAverages/OpenDRIM_OperatingSystemLoadAveragesProvider.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemLoadAverages/OpenDRIM_OperatingSystemLoadAveragesP0000644000175000017500000002651211400673710034354 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystemLoadAverages.h" #include "OpenDRIM_OperatingSystemLoadAveragesAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define OS_OpenDRIM_OperatingSystemLoadAveragesProviderSetInstance OS_OpenDRIM_OperatingSystemLoadAveragesProviderModifyInstance #endif int OS_OpenDRIM_OperatingSystemLoadAverages_init(const CMPIBroker* broker); int OS_OpenDRIM_OperatingSystemLoadAverages_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus OS_OpenDRIM_OperatingSystemLoadAveragesProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = OS_OpenDRIM_OperatingSystemLoadAverages_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemLoadAveragesProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemLoadAverages_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemLoadAverages_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = OS_OpenDRIM_OperatingSystemLoadAverages_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemLoadAveragesProviderEnumInstances(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 = OS_OpenDRIM_OperatingSystemLoadAverages_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemLoadAverages_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = OS_OpenDRIM_OperatingSystemLoadAverages_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemLoadAveragesProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystemLoadAverages instance; OS_OpenDRIM_OperatingSystemLoadAverages_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemLoadAverages_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemLoadAverages_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = OS_OpenDRIM_OperatingSystemLoadAverages_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemLoadAveragesProviderSetInstance(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_OperatingSystemLoadAverages newInstance, oldInstance; OS_OpenDRIM_OperatingSystemLoadAverages_toCPP(_broker, ci, newInstance); OS_OpenDRIM_OperatingSystemLoadAverages_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemLoadAverages_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemLoadAverages_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemLoadAverages_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemLoadAverages_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemLoadAveragesProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystemLoadAverages instance; OS_OpenDRIM_OperatingSystemLoadAverages_toCPP(_broker, ci, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemLoadAverages_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_OperatingSystemLoadAverages_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemLoadAverages_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemLoadAverages_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemLoadAverages_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemLoadAverages_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = OS_OpenDRIM_OperatingSystemLoadAverages_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemLoadAveragesProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystemLoadAverages instance; OS_OpenDRIM_OperatingSystemLoadAverages_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemLoadAverages_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemLoadAverages_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemLoadAverages_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemLoadAverages_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemLoadAveragesProviderExecQuery(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 OS_OpenDRIM_OperatingSystemLoadAverages_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemLoadAverages_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_OperatingSystemLoadAverages_init FAILED: " + (string) OpenDRIM_OperatingSystemLoadAverages_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int OS_OpenDRIM_OperatingSystemLoadAverages_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemLoadAverages_unload(errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_OperatingSystemLoadAverages_unload FAILED: " + (string) OpenDRIM_OperatingSystemLoadAverages_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define OS_OpenDRIM_OperatingSystemLoadAverages_INIT if (OS_OpenDRIM_OperatingSystemLoadAverages_init(_broker) < 0) return NULL CMInstanceMIStub(OS_OpenDRIM_OperatingSystemLoadAveragesProvider, OS_OpenDRIM_OperatingSystemLoadAveragesProvider, _broker, OS_OpenDRIM_OperatingSystemLoadAverages_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemLoadAverages/cmpiOpenDRIM_OperatingSystemLoadAverages.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemLoadAverages/cmpiOpenDRIM_OperatingSystemLoadAvera0000644000175000017500000000752211400673710034406 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystemLoadAverages.h" CMPIObjectPath* OS_OpenDRIM_OperatingSystemLoadAverages_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_OperatingSystemLoadAverages& instance) { _E_; Objectpath op(broker, OpenDRIM_OperatingSystemLoadAverages_classnames[0], OpenDRIM_OperatingSystemLoadAverages_NAMESPACE); if (!instance.Name_isNULL) op.addKey("Name", instance.Name); _L_; return op.getHdl(); } CMPIInstance* OS_OpenDRIM_OperatingSystemLoadAverages_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_OperatingSystemLoadAverages& instance) { _E_; Objectpath op(broker, OS_OpenDRIM_OperatingSystemLoadAverages_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.InstanceID_isNULL) ci.setProperty("InstanceID", instance.InstanceID); 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.LoadAverages_isNULL) ci.setProperty("LoadAverages", instance.LoadAverages); _L_; return ci.getHdl(); } void OS_OpenDRIM_OperatingSystemLoadAverages_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_OperatingSystemLoadAverages& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("Name", instance.Name) == OK) instance.Name_isNULL = false; _L_; } void OS_OpenDRIM_OperatingSystemLoadAverages_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_OperatingSystemLoadAverages& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; 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("Name", instance.Name) == OK) instance.Name_isNULL = false; if (inst.getProperty("LoadAverages", instance.LoadAverages) == OK) instance.LoadAverages_isNULL = false; _L_; } opendrim-lmp-os-1.1.0~ppa/configure.ac0000644000175000017500000001317511400673710020460 0ustar guillaumeguillaume# Process this file with autoconf to produce a configure script. ################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, 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), OS provider package Copyright (C) 2007 Ilsoo Byun, 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(OS 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_BootOSFromFS/Makefile OpenDRIM_InstalledOS/Makefile OpenDRIM_OperatingSystemCurrentRunLevel/Makefile OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/Makefile OpenDRIM_OSConformsToProfile/Makefile OpenDRIM_OperatingSystem/Makefile OpenDRIM_RegisteredOSProfile/Makefile OpenDRIM_RunningOS/Makefile OpenDRIM_OperatingSystemStatistics/Makefile OpenDRIM_OperatingSystemDefaultRunLevel/Makefile OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/Makefile OpenDRIM_OperatingSystemLoadAverages/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-os-1.1.0~ppa/OpenDRIM_BootOSFromFS/0000755000175000017500000000000011400673710022042 5ustar guillaumeguillaumeopendrim-lmp-os-1.1.0~ppa/OpenDRIM_BootOSFromFS/assocOpenDRIM_BootOSFromFS.cpp0000644000175000017500000002066011400673710027462 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_BootOSFromFS.h" int OS_OpenDRIM_BootOSFromFS_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 = OS_OpenDRIM_BootOSFromFS_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(OS_OpenDRIM_BootOSFromFS_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(OS_OpenDRIM_BootOSFromFS_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int OS_OpenDRIM_BootOSFromFS_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(OS_OpenDRIM_FileSystem_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(OS_OpenDRIM_FileSystem_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, OS_OpenDRIM_FileSystem_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int OS_OpenDRIM_BootOSFromFS_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 */ /* OpenDRIM_FileSystem _instance; OS_OpenDRIM_FileSystem_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(OS_OpenDRIM_FileSystem_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, OS_OpenDRIM_FileSystem_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int OS_OpenDRIM_BootOSFromFS_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(OS_OpenDRIM_OperatingSystem_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(OS_OpenDRIM_OperatingSystem_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, OS_OpenDRIM_OperatingSystem_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int OS_OpenDRIM_BootOSFromFS_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 */ /* OpenDRIM_OperatingSystem _instance; OS_OpenDRIM_OperatingSystem_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(OS_OpenDRIM_OperatingSystem_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, OS_OpenDRIM_OperatingSystem_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-os-1.1.0~ppa/OpenDRIM_BootOSFromFS/Makefile.am0000644000175000017500000000466011400673710024104 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiOS_OpenDRIM_BootOSFromFSProvider.la libcmpiOS_OpenDRIM_BootOSFromFSProvider_la_SOURCES = OpenDRIM_BootOSFromFSAccess.cpp OpenDRIM_BootOSFromFSProvider.cpp cmpiOpenDRIM_BootOSFromFS.cpp assocOpenDRIM_BootOSFromFS.cpp # May have to be adjusted for direct invocation libcmpiOS_OpenDRIM_BootOSFromFSProvider_la_CPPFLAGS = -I../CIM_FileSystem -I../CIM_OperatingSystem # Uncomment the end for direct invocation, may have to be adjusted libcmpiOS_OpenDRIM_BootOSFromFSProvider_la_LIBADD = ../Common/libcmpiOS_Common.la #../CIM_FileSystem/libcmpiOS_CIM_FileSystemProvider.la ../CIM_OperatingSystem/libcmpiOS_CIM_OperatingSystemProvider.la libcmpiOS_OpenDRIM_BootOSFromFSProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_BootOSFromFS.h OpenDRIM_BootOSFromFS.h OpenDRIM_BootOSFromFSAccess.h opendrim-lmp-os-1.1.0~ppa/OpenDRIM_BootOSFromFS/cmpiOpenDRIM_BootOSFromFS.cpp0000644000175000017500000000604411400673710027302 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_BootOSFromFS.h" CMPIObjectPath* OS_OpenDRIM_BootOSFromFS_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_BootOSFromFS& instance) { _E_; Objectpath op(broker, OpenDRIM_BootOSFromFS_classnames[0], OpenDRIM_BootOSFromFS_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* OS_OpenDRIM_BootOSFromFS_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_BootOSFromFS& instance) { _E_; Objectpath op(broker, OS_OpenDRIM_BootOSFromFS_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void OS_OpenDRIM_BootOSFromFS_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_BootOSFromFS& 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 OS_OpenDRIM_BootOSFromFS_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_BootOSFromFS& 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; _L_; } opendrim-lmp-os-1.1.0~ppa/OpenDRIM_BootOSFromFS/OpenDRIM_BootOSFromFSProvider.cpp0000644000175000017500000004026411400673710030146 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_BootOSFromFS.h" #include "OpenDRIM_BootOSFromFSAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define OS_OpenDRIM_BootOSFromFSProviderSetInstance OS_OpenDRIM_BootOSFromFSProviderModifyInstance #endif int OS_OpenDRIM_BootOSFromFS_init(const CMPIBroker* broker); int OS_OpenDRIM_BootOSFromFS_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus OS_OpenDRIM_BootOSFromFSProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = OS_OpenDRIM_BootOSFromFS_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus OS_OpenDRIM_BootOSFromFSProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = OS_OpenDRIM_BootOSFromFS_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BootOSFromFS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = OS_OpenDRIM_BootOSFromFS_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_BootOSFromFSProviderEnumInstances(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 = OS_OpenDRIM_BootOSFromFS_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BootOSFromFS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = OS_OpenDRIM_BootOSFromFS_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_BootOSFromFSProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_BootOSFromFS instance; OS_OpenDRIM_BootOSFromFS_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_BootOSFromFS_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BootOSFromFS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = OS_OpenDRIM_BootOSFromFS_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_BootOSFromFSProviderSetInstance(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_BootOSFromFS newInstance, oldInstance; OS_OpenDRIM_BootOSFromFS_toCPP(_broker, ci, newInstance); OS_OpenDRIM_BootOSFromFS_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = OS_OpenDRIM_BootOSFromFS_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BootOSFromFS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_BootOSFromFS_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BootOSFromFS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_BootOSFromFSProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_BootOSFromFS instance; OS_OpenDRIM_BootOSFromFS_toCPP(_broker, ci, instance); string errorMessage; int errorCode = OS_OpenDRIM_BootOSFromFS_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_BootOSFromFS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_BootOSFromFS_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BootOSFromFS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_BootOSFromFS_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BootOSFromFS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = OS_OpenDRIM_BootOSFromFS_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_BootOSFromFSProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_BootOSFromFS instance; OS_OpenDRIM_BootOSFromFS_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_BootOSFromFS_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BootOSFromFS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_BootOSFromFS_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BootOSFromFS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_BootOSFromFSProviderExecQuery(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 OS_OpenDRIM_BootOSFromFSProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = OS_OpenDRIM_BootOSFromFS_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus OS_OpenDRIM_BootOSFromFSProviderAssociatorNames(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 = OS_OpenDRIM_BootOSFromFS_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BootOSFromFS_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 OS_OpenDRIM_BootOSFromFSProviderAssociators(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 = OS_OpenDRIM_BootOSFromFS_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BootOSFromFS_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 OS_OpenDRIM_BootOSFromFSProviderReferenceNames(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 = OS_OpenDRIM_BootOSFromFS_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BootOSFromFS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = OS_OpenDRIM_BootOSFromFS_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = OS_OpenDRIM_BootOSFromFS_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BootOSFromFS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = OS_OpenDRIM_BootOSFromFS_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus OS_OpenDRIM_BootOSFromFSProviderReferences(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 = OS_OpenDRIM_BootOSFromFS_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BootOSFromFS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = OS_OpenDRIM_BootOSFromFS_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = OS_OpenDRIM_BootOSFromFS_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BootOSFromFS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = OS_OpenDRIM_BootOSFromFS_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int OS_OpenDRIM_BootOSFromFS_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = OS_OpenDRIM_BootOSFromFS_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_BootOSFromFS_init FAILED: " + (string) OpenDRIM_BootOSFromFS_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int OS_OpenDRIM_BootOSFromFS_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = OS_OpenDRIM_BootOSFromFS_unload(errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_BootOSFromFS_unload FAILED: " + (string) OpenDRIM_BootOSFromFS_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define OS_OpenDRIM_BootOSFromFS_INIT if (OS_OpenDRIM_BootOSFromFS_init(_broker) < 0) return NULL CMInstanceMIStub(OS_OpenDRIM_BootOSFromFSProvider, OS_OpenDRIM_BootOSFromFSProvider, _broker, OS_OpenDRIM_BootOSFromFS_INIT); CMAssociationMIStub(OS_OpenDRIM_BootOSFromFSProvider, OS_OpenDRIM_BootOSFromFSProvider, _broker, OS_OpenDRIM_BootOSFromFS_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_BootOSFromFS/cmpiOpenDRIM_BootOSFromFS.h0000644000175000017500000000432711400673710026751 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_BOOTOSFROMFS_H_ #define CMPIOPENDRIM_BOOTOSFROMFS_H_ #include "OpenDRIM_BootOSFromFS.h" CMPIObjectPath* OS_OpenDRIM_BootOSFromFS_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_BootOSFromFS& instance); CMPIInstance* OS_OpenDRIM_BootOSFromFS_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_BootOSFromFS& instance); void OS_OpenDRIM_BootOSFromFS_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_BootOSFromFS& instance); void OS_OpenDRIM_BootOSFromFS_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_BootOSFromFS& instance); #endif /*CMPIOPENDRIM_BOOTOSFROMFS_H_*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_BootOSFromFS/OpenDRIM_BootOSFromFSAccess.cpp0000644000175000017500000002343411400673710027555 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_BootOSFromFSAccess.h" int OS_OpenDRIM_BootOSFromFS_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(OS_CIM_FileSystem_load(broker, errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystem_load(broker, errorMessage)); */ // TODO _L_; return OK; } int OS_OpenDRIM_BootOSFromFS_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(OS_CIM_FileSystem_unload(errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystem_unload(errorMessage)); */ // TODO _L_; return OK; } int OS_OpenDRIM_BootOSFromFS_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int OS_OpenDRIM_BootOSFromFS_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(OS_OpenDRIM_BootOSFromFS_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(OS_OpenDRIM_BootOSFromFS_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; OS_OpenDRIM_BootOSFromFS_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(OS_OpenDRIM_BootOSFromFS_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int OS_OpenDRIM_BootOSFromFS_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_BootOSFromFS& 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(OS_OpenDRIM_BootOSFromFS_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(OS_OpenDRIM_BootOSFromFS_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(OS_OpenDRIM_BootOSFromFS_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int OS_OpenDRIM_BootOSFromFS_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BootOSFromFS& newInstance, const OpenDRIM_BootOSFromFS& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_BootOSFromFS_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BootOSFromFS& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_BootOSFromFS_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BootOSFromFS& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_BootOSFromFS_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(OS_OpenDRIM_BootOSFromFS_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(OS_OpenDRIM_BootOSFromFS_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(OS_OpenDRIM_BootOSFromFS_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(OS_OpenDRIM_BootOSFromFS_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(OS_OpenDRIM_BootOSFromFS_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(OS_OpenDRIM_BootOSFromFS_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_BootOSFromFS_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_BootOSFromFS instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); OpenDRIM_BootOSFromFS_instances.push_back(instance); } _L_; return OK; } int OS_OpenDRIM_BootOSFromFS_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_BootOSFromFS_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_BootOSFromFS instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); OpenDRIM_BootOSFromFS_instances.push_back(instance); } _L_; return OK; } int OS_OpenDRIM_BootOSFromFS_populate(OpenDRIM_BootOSFromFS& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-os-1.1.0~ppa/OpenDRIM_BootOSFromFS/OpenDRIM_BootOSFromFSAccess.h0000644000175000017500000001016411400673710027216 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_BOOTOSFROMFSACCESS_H_ #define OPENDRIM_BOOTOSFROMFSACCESS_H_ #include "OS_Common.h" #include "OpenDRIM_BootOSFromFS.h" #include "assocOpenDRIM_BootOSFromFS.h" int OS_OpenDRIM_BootOSFromFS_load(const CMPIBroker* broker, string& errorMessage); int OS_OpenDRIM_BootOSFromFS_unload(string& errorMessage); int OS_OpenDRIM_BootOSFromFS_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_BootOSFromFS_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_BootOSFromFS& instance, const char** properties, string& errorMessage); int OS_OpenDRIM_BootOSFromFS_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BootOSFromFS& newInstance, const OpenDRIM_BootOSFromFS& oldInstance, const char** properties, string& errorMessage); int OS_OpenDRIM_BootOSFromFS_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BootOSFromFS& instance, string& errorMessage); int OS_OpenDRIM_BootOSFromFS_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BootOSFromFS& instance, string& errorMessage); int OS_OpenDRIM_BootOSFromFS_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int OS_OpenDRIM_BootOSFromFS_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int OS_OpenDRIM_BootOSFromFS_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_BootOSFromFS_instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_BootOSFromFS_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_BootOSFromFS_instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_BootOSFromFS_populate(OpenDRIM_BootOSFromFS& instance, string& errorMessage); #endif /*OPENDRIM_BOOTOSFROMFSACCESS_H_*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_BootOSFromFS/assocOpenDRIM_BootOSFromFS.h0000644000175000017500000000617711400673710027136 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_BOOTOSFROMFS_H_ #define ASSOCOPENDRIM_BOOTOSFROMFS_H_ #include "OpenDRIM_BootOSFromFSAccess.h" int OS_OpenDRIM_BootOSFromFS_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 OS_OpenDRIM_BootOSFromFS_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 OS_OpenDRIM_BootOSFromFS_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int OS_OpenDRIM_BootOSFromFS_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int OS_OpenDRIM_BootOSFromFS_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int OS_OpenDRIM_BootOSFromFS_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_BOOTOSFROMFS_H_*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_BootOSFromFS/OpenDRIM_BootOSFromFS.h0000644000175000017500000000666711400673710026111 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_BOOTOSFROMFS_H_ #define OPENDRIM_BOOTOSFROMFS_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_FileSystem.h" #include "CIM_FileSystemAccess.h" #include "cmpiOpenDRIM_OperatingSystem.h" #include "OpenDRIM_OperatingSystemAccess.h" */ const static char* OpenDRIM_BootOSFromFS_classnames[] = {"OpenDRIM_BootOSFromFS"}; static string OpenDRIM_BootOSFromFS_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"OpenDRIM_FileSystem"}; const static string Antecedent_NAMESPACE = _NAMESPACE; const static string Dependent_role = "Dependent"; const static char* Dependent_classnames[] = {"OpenDRIM_OperatingSystem"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_BootOSFromFS { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; OpenDRIM_BootOSFromFS() { Antecedent_isNULL = true; Dependent_isNULL = true; } ~OpenDRIM_BootOSFromFS() {} 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; } }; #endif /*OPENDRIM_BOOTOSFROMFS_H_*/ opendrim-lmp-os-1.1.0~ppa/TODO0000644000175000017500000000010111400673710016643 0ustar guillaumeguillaumeTODO for Major.Minor.Revision ========================= // TODO opendrim-lmp-os-1.1.0~ppa/INSTALL0000644000175000017500000000702311400673710017216 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, 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-os-1.1.0~ppa/AUTHORS0000644000175000017500000000022511400673710017232 0ustar guillaumeguillaumeIlsoo Byun, ETRI Khahramon NURIDDINOV Guillaume BOTTEX opendrim-lmp-os-1.1.0~ppa/OpenDRIM_RunningOS/0000755000175000017500000000000011400673710021502 5ustar guillaumeguillaumeopendrim-lmp-os-1.1.0~ppa/OpenDRIM_RunningOS/Makefile.am0000644000175000017500000000463011400673710023541 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiOS_OpenDRIM_RunningOSProvider.la libcmpiOS_OpenDRIM_RunningOSProvider_la_SOURCES = OpenDRIM_RunningOSAccess.cpp OpenDRIM_RunningOSProvider.cpp cmpiOpenDRIM_RunningOS.cpp assocOpenDRIM_RunningOS.cpp # May have to be adjusted for direct invocation libcmpiOS_OpenDRIM_RunningOSProvider_la_CPPFLAGS = -I../CIM_OperatingSystem -I../CIM_ComputerSystem # Uncomment the end for direct invocation, may have to be adjusted libcmpiOS_OpenDRIM_RunningOSProvider_la_LIBADD = ../Common/libcmpiOS_Common.la #../CIM_OperatingSystem/libcmpiOS_CIM_OperatingSystemProvider.la ../CIM_ComputerSystem/libcmpiOS_CIM_ComputerSystemProvider.la libcmpiOS_OpenDRIM_RunningOSProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_RunningOS.h OpenDRIM_RunningOS.h OpenDRIM_RunningOSAccess.h opendrim-lmp-os-1.1.0~ppa/OpenDRIM_RunningOS/OpenDRIM_RunningOSProvider.cpp0000644000175000017500000003764611400673710027260 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_RunningOS.h" #include "OpenDRIM_RunningOSAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define OS_OpenDRIM_RunningOSProviderSetInstance OS_OpenDRIM_RunningOSProviderModifyInstance #endif int OS_OpenDRIM_RunningOS_init(const CMPIBroker* broker); int OS_OpenDRIM_RunningOS_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus OS_OpenDRIM_RunningOSProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = OS_OpenDRIM_RunningOS_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus OS_OpenDRIM_RunningOSProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = OS_OpenDRIM_RunningOS_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RunningOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = OS_OpenDRIM_RunningOS_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_RunningOSProviderEnumInstances(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 = OS_OpenDRIM_RunningOS_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RunningOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = OS_OpenDRIM_RunningOS_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_RunningOSProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RunningOS instance; OS_OpenDRIM_RunningOS_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_RunningOS_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RunningOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = OS_OpenDRIM_RunningOS_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_RunningOSProviderSetInstance(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_RunningOS newInstance, oldInstance; OS_OpenDRIM_RunningOS_toCPP(_broker, ci, newInstance); OS_OpenDRIM_RunningOS_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = OS_OpenDRIM_RunningOS_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RunningOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_RunningOS_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RunningOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_RunningOSProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RunningOS instance; OS_OpenDRIM_RunningOS_toCPP(_broker, ci, instance); string errorMessage; int errorCode = OS_OpenDRIM_RunningOS_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_RunningOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_RunningOS_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RunningOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_RunningOS_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RunningOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = OS_OpenDRIM_RunningOS_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_RunningOSProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RunningOS instance; OS_OpenDRIM_RunningOS_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_RunningOS_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RunningOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_RunningOS_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RunningOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_RunningOSProviderExecQuery(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 OS_OpenDRIM_RunningOSProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = OS_OpenDRIM_RunningOS_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus OS_OpenDRIM_RunningOSProviderAssociatorNames(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 = OS_OpenDRIM_RunningOS_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RunningOS_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 OS_OpenDRIM_RunningOSProviderAssociators(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 = OS_OpenDRIM_RunningOS_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RunningOS_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 OS_OpenDRIM_RunningOSProviderReferenceNames(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 = OS_OpenDRIM_RunningOS_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RunningOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = OS_OpenDRIM_RunningOS_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = OS_OpenDRIM_RunningOS_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RunningOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = OS_OpenDRIM_RunningOS_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus OS_OpenDRIM_RunningOSProviderReferences(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 = OS_OpenDRIM_RunningOS_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RunningOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = OS_OpenDRIM_RunningOS_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = OS_OpenDRIM_RunningOS_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RunningOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = OS_OpenDRIM_RunningOS_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int OS_OpenDRIM_RunningOS_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = OS_OpenDRIM_RunningOS_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_RunningOS_init FAILED: " + (string) OpenDRIM_RunningOS_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int OS_OpenDRIM_RunningOS_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = OS_OpenDRIM_RunningOS_unload(errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_RunningOS_unload FAILED: " + (string) OpenDRIM_RunningOS_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define OS_OpenDRIM_RunningOS_INIT if (OS_OpenDRIM_RunningOS_init(_broker) < 0) return NULL CMInstanceMIStub(OS_OpenDRIM_RunningOSProvider, OS_OpenDRIM_RunningOSProvider, _broker, OS_OpenDRIM_RunningOS_INIT); CMAssociationMIStub(OS_OpenDRIM_RunningOSProvider, OS_OpenDRIM_RunningOSProvider, _broker, OS_OpenDRIM_RunningOS_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_RunningOS/assocOpenDRIM_RunningOS.cpp0000644000175000017500000002064111400673710026561 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_RunningOS.h" int OS_OpenDRIM_RunningOS_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 = OS_OpenDRIM_RunningOS_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(OS_OpenDRIM_RunningOS_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(OS_OpenDRIM_RunningOS_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int OS_OpenDRIM_RunningOS_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(OS_OpenDRIM_OperatingSystem_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(OS_OpenDRIM_OperatingSystem_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, OS_OpenDRIM_OperatingSystem_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int OS_OpenDRIM_RunningOS_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 */ /* OpenDRIM_OperatingSystem _instance; OS_OpenDRIM_OperatingSystem_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(OS_OpenDRIM_OperatingSystem_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, OS_OpenDRIM_OperatingSystem_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int OS_OpenDRIM_RunningOS_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(OS_OpenDRIM_ComputerSystem_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(OS_OpenDRIM_ComputerSystem_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, OS_OpenDRIM_ComputerSystem_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int OS_OpenDRIM_RunningOS_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 */ /* OpenDRIM_ComputerSystem _instance; OS_OpenDRIM_ComputerSystem_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(OS_OpenDRIM_ComputerSystem_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, OS_OpenDRIM_ComputerSystem_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-os-1.1.0~ppa/OpenDRIM_RunningOS/OpenDRIM_RunningOSAccess.h0000644000175000017500000001004011400673710026307 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_RUNNINGOSACCESS_H_ #define OPENDRIM_RUNNINGOSACCESS_H_ #include "OS_Common.h" #include "OpenDRIM_RunningOS.h" #include "assocOpenDRIM_RunningOS.h" int OS_OpenDRIM_RunningOS_load(const CMPIBroker* broker, string& errorMessage); int OS_OpenDRIM_RunningOS_unload(string& errorMessage); int OS_OpenDRIM_RunningOS_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_RunningOS_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_RunningOS& instance, const char** properties, string& errorMessage); int OS_OpenDRIM_RunningOS_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RunningOS& newInstance, const OpenDRIM_RunningOS& oldInstance, const char** properties, string& errorMessage); int OS_OpenDRIM_RunningOS_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RunningOS& instance, string& errorMessage); int OS_OpenDRIM_RunningOS_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RunningOS& instance, string& errorMessage); int OS_OpenDRIM_RunningOS_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int OS_OpenDRIM_RunningOS_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int OS_OpenDRIM_RunningOS_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_RunningOS_instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_RunningOS_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_RunningOS_instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_RunningOS_populate(OpenDRIM_RunningOS& instance, string& errorMessage); #endif /*OPENDRIM_RUNNINGOSACCESS_H_*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_RunningOS/OpenDRIM_RunningOSAccess.cpp0000644000175000017500000002323611400673710026655 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_RunningOSAccess.h" int OS_OpenDRIM_RunningOS_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(OS_CIM_ComputerSystem_load(broker, errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystem_load(broker, errorMessage)); */ // TODO _L_; return OK; } int OS_OpenDRIM_RunningOS_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(OS_CIM_ComputerSystem_unload(errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystem_unload(errorMessage)); */ // TODO _L_; return OK; } int OS_OpenDRIM_RunningOS_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int OS_OpenDRIM_RunningOS_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(OS_OpenDRIM_RunningOS_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(OS_OpenDRIM_RunningOS_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; OS_OpenDRIM_RunningOS_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(OS_OpenDRIM_RunningOS_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int OS_OpenDRIM_RunningOS_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_RunningOS& 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(OS_OpenDRIM_RunningOS_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(OS_OpenDRIM_RunningOS_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(OS_OpenDRIM_RunningOS_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int OS_OpenDRIM_RunningOS_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RunningOS& newInstance, const OpenDRIM_RunningOS& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_RunningOS_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RunningOS& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_RunningOS_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RunningOS& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_RunningOS_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(OS_OpenDRIM_RunningOS_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(OS_OpenDRIM_RunningOS_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(OS_OpenDRIM_RunningOS_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(OS_OpenDRIM_RunningOS_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(OS_OpenDRIM_RunningOS_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(OS_OpenDRIM_RunningOS_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_RunningOS_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_RunningOS instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); OpenDRIM_RunningOS_instances.push_back(instance); } _L_; return OK; } int OS_OpenDRIM_RunningOS_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_RunningOS_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_RunningOS instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); OpenDRIM_RunningOS_instances.push_back(instance); } _L_; return OK; } int OS_OpenDRIM_RunningOS_populate(OpenDRIM_RunningOS& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-os-1.1.0~ppa/OpenDRIM_RunningOS/assocOpenDRIM_RunningOS.h0000644000175000017500000000614111400673710026225 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_RUNNINGOS_H_ #define ASSOCOPENDRIM_RUNNINGOS_H_ #include "OpenDRIM_RunningOSAccess.h" int OS_OpenDRIM_RunningOS_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 OS_OpenDRIM_RunningOS_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 OS_OpenDRIM_RunningOS_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int OS_OpenDRIM_RunningOS_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int OS_OpenDRIM_RunningOS_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int OS_OpenDRIM_RunningOS_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_RUNNINGOS_H_*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_RunningOS/cmpiOpenDRIM_RunningOS.h0000644000175000017500000000426311400673710026050 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_RUNNINGOS_H_ #define CMPIOPENDRIM_RUNNINGOS_H_ #include "OpenDRIM_RunningOS.h" CMPIObjectPath* OS_OpenDRIM_RunningOS_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RunningOS& instance); CMPIInstance* OS_OpenDRIM_RunningOS_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RunningOS& instance); void OS_OpenDRIM_RunningOS_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RunningOS& instance); void OS_OpenDRIM_RunningOS_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RunningOS& instance); #endif /*CMPIOPENDRIM_RUNNINGOS_H_*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_RunningOS/OpenDRIM_RunningOS.h0000644000175000017500000000665011400673710025201 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_RUNNINGOS_H_ #define OPENDRIM_RUNNINGOS_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_ComputerSystem.h" #include "CIM_ComputerSystemAccess.h" #include "cmpiOpenDRIM_OperatingSystem.h" #include "OpenDRIM_OperatingSystemAccess.h" */ const static char* OpenDRIM_RunningOS_classnames[] = {"OpenDRIM_RunningOS"}; static string OpenDRIM_RunningOS_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"OpenDRIM_OperatingSystem"}; const static string Antecedent_NAMESPACE = _NAMESPACE; const static string Dependent_role = "Dependent"; const static char* Dependent_classnames[] = {"OpenDRIM_ComputerSystem"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_RunningOS { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; OpenDRIM_RunningOS() { Antecedent_isNULL = true; Dependent_isNULL = true; } ~OpenDRIM_RunningOS() {} 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; } }; #endif /*OPENDRIM_RUNNINGOS_H_*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_RunningOS/cmpiOpenDRIM_RunningOS.cpp0000644000175000017500000000600011400673710026372 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_RunningOS.h" CMPIObjectPath* OS_OpenDRIM_RunningOS_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RunningOS& instance) { _E_; Objectpath op(broker, OpenDRIM_RunningOS_classnames[0], OpenDRIM_RunningOS_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* OS_OpenDRIM_RunningOS_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RunningOS& instance) { _E_; Objectpath op(broker, OS_OpenDRIM_RunningOS_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void OS_OpenDRIM_RunningOS_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RunningOS& 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 OS_OpenDRIM_RunningOS_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RunningOS& 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; _L_; } opendrim-lmp-os-1.1.0~ppa/packaging/0000755000175000017500000000000011400673710020107 5ustar guillaumeguillaumeopendrim-lmp-os-1.1.0~ppa/packaging/debian/0000755000175000017500000000000011404347761021341 5ustar guillaumeguillaumeopendrim-lmp-os-1.1.0~ppa/packaging/debian/postrm0000644000175000017500000000344111404347761022612 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_BootOSFromFS rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_InstalledOS rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_OperatingSystemCurrentRunLevel rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_OSConformsToProfile rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_OperatingSystem rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_RegisteredOSProfile rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_RunningOS rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_OperatingSystemStatistics rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_OperatingSystemDefaultRunLevel rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_OperatingSystemLoadAverages ;; 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-os-1.1.0~ppa/packaging/debian/source/0000755000175000017500000000000011400673710022631 5ustar guillaumeguillaumeopendrim-lmp-os-1.1.0~ppa/packaging/debian/source/format0000644000175000017500000000001411400673710024037 0ustar guillaumeguillaume3.0 (quilt) opendrim-lmp-os-1.1.0~ppa/packaging/debian/copyright0000644000175000017500000000312311400673710023263 0ustar guillaumeguillaumeThis package was debianized by Guillaume BOTTEX on Tue, 15 Sep 2009 15:17:02 +0900. It was downloaded from http://opendrim.sourceforge.net/ Upstream Authors: Ilsoo Byun Khahramon NURIDDINOV Guillaume BOTTEX Copyright: Copyright (C) 2007 ETRI Ilsoo Byun Copyright (C) 2009 ETRI Guillaume BOTTEX Copyright (C) 2009 ETRI Khahramon NURIDDINOV License: Linux Management Providers (LMP), OS 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-os-1.1.0~ppa/packaging/debian/control0000644000175000017500000000122511404347754022746 0ustar guillaumeguillaumeSource: opendrim-lmp-os 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-os Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, sfcb, libopendrim0 (>= 1.1.3) Description: OpenDRIM OS provider Provides information about the computer system's OS capabilities. . Compliant with the DMTF OS Status Profile v1.0.0 (DSP1029). opendrim-lmp-os-1.1.0~ppa/packaging/debian/prerm0000644000175000017500000000240211400673710022377 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-os VERSION=`cat /usr/share/doc/opendrim-lmp-os/VERSION` OPENDRIM_REG_DIR=/usr/share/OpenDRIM PROVIDER_SCRIPT_POST=OS $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-os-1.1.0~ppa/packaging/debian/changelog0000644000175000017500000000024011404347740023204 0ustar guillaumeguillaumeopendrim-lmp-os (1.1.0-0ubuntu1) lucid; urgency=low * Initial release -- Guillaume BOTTEX Fri, 11 Jun 2010 14:55:00 +0900 opendrim-lmp-os-1.1.0~ppa/packaging/debian/postinst0000644000175000017500000000255711400673710023150 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-os VERSION=`cat /usr/share/doc/opendrim-lmp-os/VERSION` OPENDRIM_REG_DIR=/usr/share/OpenDRIM PROVIDER_SCRIPT_POST=OS $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-os-1.1.0~ppa/packaging/debian/install0000644000175000017500000000004711400673710022723 0ustar guillaumeguillaumeusr/lib/cmpi/*.so usr/share/OpenDRIM/* opendrim-lmp-os-1.1.0~ppa/packaging/debian/rules0000755000175000017500000000353011400673710022412 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-os 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-os.sgml > opendrim-lmp-os.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-os-1.1.0~ppa/packaging/debian/docs0000644000175000017500000000003111400673710022176 0ustar guillaumeguillaumeNEWS README TODO VERSION opendrim-lmp-os-1.1.0~ppa/packaging/debian/compat0000644000175000017500000000000211400673710022527 0ustar guillaumeguillaume5 opendrim-lmp-os-1.1.0~ppa/packaging/opendrim-lmp-os.spec0000644000175000017500000000763611400673710024021 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2009 Guillaume BOTTEX, 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 , , ################################################################################ %define packageVersion 1 Version: %{version} Release: %{packageVersion}%{?dist} Vendor: OpenDRIM Summary: OpenDRIM OS Provider Name: opendrim-lmp-os 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.1 Requires: tog-pegasus, libopendrim >= 1.1.1 %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 OS %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-os-1.1.0~ppa/OpenDRIM_OperatingSystemCurrentRunLevel/0000755000175000017500000000000011400673710025775 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemCurrentRunLevel/OpenDRIM_OperatingSystemCurrentRunLevelProvider.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemCurrentRunLevel/OpenDRIM_OperatingSystemCurrentRun0000644000175000017500000002700711400673710034550 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystemCurrentRunLevel.h" #include "OpenDRIM_OperatingSystemCurrentRunLevelAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define OS_OpenDRIM_OperatingSystemCurrentRunLevelProviderSetInstance OS_OpenDRIM_OperatingSystemCurrentRunLevelProviderModifyInstance #endif int OS_OpenDRIM_OperatingSystemCurrentRunLevel_init(const CMPIBroker* broker); int OS_OpenDRIM_OperatingSystemCurrentRunLevel_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus OS_OpenDRIM_OperatingSystemCurrentRunLevelProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = OS_OpenDRIM_OperatingSystemCurrentRunLevel_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemCurrentRunLevelProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemCurrentRunLevel_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = OS_OpenDRIM_OperatingSystemCurrentRunLevel_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemCurrentRunLevelProviderEnumInstances(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 = OS_OpenDRIM_OperatingSystemCurrentRunLevel_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = OS_OpenDRIM_OperatingSystemCurrentRunLevel_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemCurrentRunLevelProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystemCurrentRunLevel instance; OS_OpenDRIM_OperatingSystemCurrentRunLevel_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemCurrentRunLevel_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = OS_OpenDRIM_OperatingSystemCurrentRunLevel_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemCurrentRunLevelProviderSetInstance(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_OperatingSystemCurrentRunLevel newInstance, oldInstance; OS_OpenDRIM_OperatingSystemCurrentRunLevel_toCPP(_broker, ci, newInstance); OS_OpenDRIM_OperatingSystemCurrentRunLevel_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemCurrentRunLevel_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemCurrentRunLevel_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemCurrentRunLevelProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystemCurrentRunLevel instance; OS_OpenDRIM_OperatingSystemCurrentRunLevel_toCPP(_broker, ci, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemCurrentRunLevel_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_OperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemCurrentRunLevel_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemCurrentRunLevel_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = OS_OpenDRIM_OperatingSystemCurrentRunLevel_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemCurrentRunLevelProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystemCurrentRunLevel instance; OS_OpenDRIM_OperatingSystemCurrentRunLevel_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemCurrentRunLevel_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemCurrentRunLevel_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemCurrentRunLevelProviderExecQuery(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 OS_OpenDRIM_OperatingSystemCurrentRunLevel_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemCurrentRunLevel_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_OperatingSystemCurrentRunLevel_init FAILED: " + (string) OpenDRIM_OperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int OS_OpenDRIM_OperatingSystemCurrentRunLevel_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemCurrentRunLevel_unload(errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_OperatingSystemCurrentRunLevel_unload FAILED: " + (string) OpenDRIM_OperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define OS_OpenDRIM_OperatingSystemCurrentRunLevel_INIT if (OS_OpenDRIM_OperatingSystemCurrentRunLevel_init(_broker) < 0) return NULL CMInstanceMIStub(OS_OpenDRIM_OperatingSystemCurrentRunLevelProvider, OS_OpenDRIM_OperatingSystemCurrentRunLevelProvider, _broker, OS_OpenDRIM_OperatingSystemCurrentRunLevel_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemCurrentRunLevel/Makefile.am0000644000175000017500000000436711400673710030043 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiOS_OpenDRIM_OperatingSystemCurrentRunLevelProvider.la libcmpiOS_OpenDRIM_OperatingSystemCurrentRunLevelProvider_la_SOURCES = OpenDRIM_OperatingSystemCurrentRunLevelAccess.cpp OpenDRIM_OperatingSystemCurrentRunLevelProvider.cpp cmpiOpenDRIM_OperatingSystemCurrentRunLevel.cpp libcmpiOS_OpenDRIM_OperatingSystemCurrentRunLevelProvider_la_LIBADD = ../Common/libcmpiOS_Common.la libcmpiOS_OpenDRIM_OperatingSystemCurrentRunLevelProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_OperatingSystemCurrentRunLevel.h OpenDRIM_OperatingSystemCurrentRunLevel.h OpenDRIM_OperatingSystemCurrentRunLevelAccess.h ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemCurrentRunLevel/OpenDRIM_OperatingSystemCurrentRunLevelAccess.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemCurrentRunLevel/OpenDRIM_OperatingSystemCurrentRun0000644000175000017500000001256111400673710034547 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_OperatingSystemCurrentRunLevelAccess.h" string _InstanceID; const string _ElementName = "CurrentRunLevel"; int OS_OpenDRIM_OperatingSystemCurrentRunLevel_load(const CMPIBroker* broker, string& errorMessage) { _E_; CF_assert(CF_getSystemName(_InstanceID, errorMessage)); _InstanceID = "OpenDRIM_OperatingSystem:" + _InstanceID + ":CurrentRunLevel"; _L_; return OK; } int OS_OpenDRIM_OperatingSystemCurrentRunLevel_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int OS_OpenDRIM_OperatingSystemCurrentRunLevel_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; OpenDRIM_OperatingSystemCurrentRunLevel instance; instance.setInstanceID(_InstanceID); if (discriminant == "ei") { CF_assert(OS_OpenDRIM_OperatingSystemCurrentRunLevel_getInstanceInfo(instance, errorMessage)); } result.push_back(instance); _L_; return OK; } int OS_OpenDRIM_OperatingSystemCurrentRunLevel_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_OperatingSystemCurrentRunLevel& instance, const char** properties, string& errorMessage) { _E_; string InstanceID; instance.getInstanceID(InstanceID); if (!CF_strCmpNoCase(InstanceID, _InstanceID)) return NOT_FOUND; CF_assert(OS_OpenDRIM_OperatingSystemCurrentRunLevel_getInstanceInfo(instance, errorMessage)); _L_; return OK; } int OS_OpenDRIM_OperatingSystemCurrentRunLevel_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemCurrentRunLevel& newInstance, const OpenDRIM_OperatingSystemCurrentRunLevel& oldInstance, const char** properties, string& errorMessage) { _E_; unsigned char newValue, oldValue; oldInstance.getValue(oldValue); if (newInstance.getValue(newValue) == OK && newValue != oldValue) { CF_assert(OS_OpenDRIM_OperatingSystemCurrentRunLevel_setValue(newValue, errorMessage)); } _L_; return OK; } int OS_OpenDRIM_OperatingSystemCurrentRunLevel_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemCurrentRunLevel& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OperatingSystemCurrentRunLevel_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemCurrentRunLevel& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OperatingSystemCurrentRunLevel_populate(OpenDRIM_OperatingSystemCurrentRunLevel& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } int OS_OpenDRIM_OperatingSystemCurrentRunLevel_getInstanceInfo(OpenDRIM_OperatingSystemCurrentRunLevel& instance, string& errorMessage) { _E_; instance.setElementName(_ElementName); instance.setChangeableType(1); unsigned char Value; CF_assert(OS_OpenDRIM_OperatingSystemCurrentRunLevel_getValue(Value, errorMessage)); instance.setValue(Value); _L_; return OK; } int OS_OpenDRIM_OperatingSystemCurrentRunLevel_getValue(unsigned char& Value, string& errorMessage) { _E_; string runlevel, stdErr; CF_assert(CF_runCommand("/sbin/runlevel", runlevel, stdErr, errorMessage)); vector runlevel_elements; CF_splitTextBySpace(runlevel_elements, runlevel); if (runlevel_elements.size() < 2) { errorMessage = "Wrong level: /sbin/runlevel"; return FAILED; } Value = atoi(runlevel_elements[1].c_str()); _L_; return OK; } int OS_OpenDRIM_OperatingSystemCurrentRunLevel_setValue(const unsigned char& newValue, string& errorMessage) { _E_; if (newValue > 6) { errorMessage = "Invalid property value (0 <= Value <= 6): Value"; return FAILED; } string stdOut, stdErr; CF_assert(CF_runCommand("/sbin/telinit " + CF_intToStr(newValue), stdOut, stdErr, errorMessage)); _L_; return OK; } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemCurrentRunLevel/cmpiOpenDRIM_OperatingSystemCurrentRunLevel.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemCurrentRunLevel/cmpiOpenDRIM_OperatingSystemCurren0000644000175000017500000001020311400673710034536 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystemCurrentRunLevel.h" CMPIObjectPath* OS_OpenDRIM_OperatingSystemCurrentRunLevel_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_OperatingSystemCurrentRunLevel& instance) { _E_; Objectpath op(broker, OpenDRIM_OperatingSystemCurrentRunLevel_classnames[0], OpenDRIM_OperatingSystemCurrentRunLevel_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* OS_OpenDRIM_OperatingSystemCurrentRunLevel_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_OperatingSystemCurrentRunLevel& instance) { _E_; Objectpath op(broker, OS_OpenDRIM_OperatingSystemCurrentRunLevel_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.ConfigurationName_isNULL) ci.setProperty("ConfigurationName", instance.ConfigurationName); if (!instance.ChangeableType_isNULL) ci.setProperty("ChangeableType", instance.ChangeableType); if (!instance.Value_isNULL) ci.setProperty("Value", instance.Value); _L_; return ci.getHdl(); } void OS_OpenDRIM_OperatingSystemCurrentRunLevel_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_OperatingSystemCurrentRunLevel& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void OS_OpenDRIM_OperatingSystemCurrentRunLevel_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_OperatingSystemCurrentRunLevel& 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("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getProperty("ConfigurationName", instance.ConfigurationName) == OK) instance.ConfigurationName_isNULL = false; if (inst.getProperty("ChangeableType", instance.ChangeableType) == OK) instance.ChangeableType_isNULL = false; if (inst.getProperty("Value", instance.Value) == OK) instance.Value_isNULL = false; _L_; } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemCurrentRunLevel/cmpiOpenDRIM_OperatingSystemCurrentRunLevel.hopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemCurrentRunLevel/cmpiOpenDRIM_OperatingSystemCurren0000644000175000017500000000465711400673710034556 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_OPERATINGSYSTEMCURRENTRUNLEVEL_H_ #define CMPIOPENDRIM_OPERATINGSYSTEMCURRENTRUNLEVEL_H_ #include "OpenDRIM_OperatingSystemCurrentRunLevel.h" CMPIObjectPath* OS_OpenDRIM_OperatingSystemCurrentRunLevel_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_OperatingSystemCurrentRunLevel& instance); CMPIInstance* OS_OpenDRIM_OperatingSystemCurrentRunLevel_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_OperatingSystemCurrentRunLevel& instance); void OS_OpenDRIM_OperatingSystemCurrentRunLevel_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_OperatingSystemCurrentRunLevel& instance); void OS_OpenDRIM_OperatingSystemCurrentRunLevel_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_OperatingSystemCurrentRunLevel& instance); #endif /*CMPIOPENDRIM_OPERATINGSYSTEMCURRENTRUNLEVEL_H_*/ ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemCurrentRunLevel/OpenDRIM_OperatingSystemCurrentRunLevelAccess.hopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemCurrentRunLevel/OpenDRIM_OperatingSystemCurrentRun0000644000175000017500000000710311400673710034543 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_OPERATINGSYSTEMCURRENTRUNLEVELACCESS_H_ #define OPENDRIM_OPERATINGSYSTEMCURRENTRUNLEVELACCESS_H_ #include "OS_Common.h" #include "OpenDRIM_OperatingSystemCurrentRunLevel.h" int OS_OpenDRIM_OperatingSystemCurrentRunLevel_load(const CMPIBroker* broker, string& errorMessage); int OS_OpenDRIM_OperatingSystemCurrentRunLevel_unload(string& errorMessage); int OS_OpenDRIM_OperatingSystemCurrentRunLevel_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OperatingSystemCurrentRunLevel_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_OperatingSystemCurrentRunLevel& instance, const char** properties, string& errorMessage); int OS_OpenDRIM_OperatingSystemCurrentRunLevel_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemCurrentRunLevel& newInstance, const OpenDRIM_OperatingSystemCurrentRunLevel& oldInstance, const char** properties, string& errorMessage); int OS_OpenDRIM_OperatingSystemCurrentRunLevel_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemCurrentRunLevel& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystemCurrentRunLevel_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemCurrentRunLevel& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystemCurrentRunLevel_populate(OpenDRIM_OperatingSystemCurrentRunLevel& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystemCurrentRunLevel_getInstanceInfo(OpenDRIM_OperatingSystemCurrentRunLevel& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystemCurrentRunLevel_getValue(unsigned char& Value, string& errorMessage); int OS_OpenDRIM_OperatingSystemCurrentRunLevel_setValue(const unsigned char& newValue, string& errorMessage); #endif /*OPENDRIM_OPERATINGSYSTEMCURRENTRUNLEVELACCESS_H_*/ ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemCurrentRunLevel/OpenDRIM_OperatingSystemCurrentRunLevel.hopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemCurrentRunLevel/OpenDRIM_OperatingSystemCurrentRun0000644000175000017500000001103011400673710034535 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_OPERATINGSYSTEMCURRENTRUNLEVEL_H_ #define OPENDRIM_OPERATINGSYSTEMCURRENTRUNLEVEL_H_ #include const static char* OpenDRIM_OperatingSystemCurrentRunLevel_classnames[] = {"OpenDRIM_OperatingSystemCurrentRunLevel"}; static string OpenDRIM_OperatingSystemCurrentRunLevel_NAMESPACE = _NAMESPACE; class OpenDRIM_OperatingSystemCurrentRunLevel { public: string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string InstanceID; bool InstanceID_isNULL; string ElementName; bool ElementName_isNULL; string ConfigurationName; bool ConfigurationName_isNULL; unsigned short ChangeableType; bool ChangeableType_isNULL; unsigned char Value; bool Value_isNULL; OpenDRIM_OperatingSystemCurrentRunLevel() { Caption_isNULL = true; Description_isNULL = true; InstanceID_isNULL = true; ElementName_isNULL = true; ConfigurationName_isNULL = true; ChangeableType_isNULL = true; Value_isNULL = true; } ~OpenDRIM_OperatingSystemCurrentRunLevel() {} 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 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 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 getConfigurationName(string& value) const { if (ConfigurationName_isNULL==true) return NOT_FOUND; value = ConfigurationName; return OK; } int setConfigurationName(const string& newValue) { ConfigurationName = newValue; ConfigurationName_isNULL = false; return OK; } int getChangeableType(unsigned short& value) const { if (ChangeableType_isNULL==true) return NOT_FOUND; value = ChangeableType; return OK; } int setChangeableType(const unsigned short& newValue) { ChangeableType = newValue; ChangeableType_isNULL = false; return OK; } int getValue(unsigned char& value) const { if (Value_isNULL==true) return NOT_FOUND; value = Value; return OK; } int setValue(const unsigned char& newValue) { Value = newValue; Value_isNULL = false; return OK; } }; #endif /*OPENDRIM_OPERATINGSYSTEMCURRENTRUNLEVEL_H_*/ opendrim-lmp-os-1.1.0~ppa/mof/0000755000175000017500000000000011400673710016744 5ustar guillaumeguillaumeopendrim-lmp-os-1.1.0~ppa/mof/OpenDRIM_OperatingSystemStatistics.mof0000644000175000017500000000340111400673710026312 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), OS provider package // Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Association, Provider("cmpi:cmpiOS_OpenDRIM_OperatingSystemStatisticsProvider")] class OpenDRIM_OperatingSystemStatistics:CIM_Statistics { }; opendrim-lmp-os-1.1.0~ppa/mof/OpenDRIM_OperatingSystemLoadAverages.mof0000644000175000017500000000410311400673710026515 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), OS provider package // Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Provider("cmpi:cmpiOS_OpenDRIM_OperatingSystemLoadAveragesProvider")] class OpenDRIM_OperatingSystemLoadAverages:CIM_StatisticalInformation { [Key(true), Override("Name")] string Name; [Description("A set of 3 real numbers separated by comma, which defines as, the number of processes waiting in the run-queue (to compete for CPU processing) plus the number currently executing over the last 1, 5, and 15 minutes respectively.")] real32 LoadAverages[]; }; opendrim-lmp-os-1.1.0~ppa/mof/OpenDRIM_OperatingSystemCurrentRunLevel.mof0000644000175000017500000000365711400673710027274 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), OS provider package // Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Provider("cmpi:cmpiOS_OpenDRIM_OperatingSystemCurrentRunLevelProvider")] class OpenDRIM_OperatingSystemCurrentRunLevel:CIM_SettingData { [ValueMap{"0", "1", "2", "3", "4", "5", "6"}, Values{"Halt", "Single user mode", "Multiuser, without NFS", "Full multiuser mode", "Unused", "X11", "Reboot"}] uint8 Value; }; opendrim-lmp-os-1.1.0~ppa/mof/OpenDRIM_OSConformsToProfile.mof0000644000175000017500000000326611400673710024767 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), OS provider package // Copyright (C) 2009 Khahramon NURIDDINOV, TUIT // // 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 Guillaume BOTTEX, ETRI //################################################################################ [Association, Provider("cmpi:cmpiOS_OpenDRIM_OSConformsToProfileProvider")] class OpenDRIM_OSConformsToProfile:CIM_ElementConformsToProfile { }; opendrim-lmp-os-1.1.0~ppa/mof/OpenDRIM_RegisteredOSProfile.mof0000644000175000017500000000324111400673710024764 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), OS provider package // Copyright (C) 2009 Khahramon NURIDDINOV, TUIT // // 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 Guillaume BOTTEX, ETRI //################################################################################ [Provider("cmpi:cmpiOS_OpenDRIM_RegisteredOSProfileProvider")] class OpenDRIM_RegisteredOSProfile:CIM_RegisteredProfile { }; opendrim-lmp-os-1.1.0~ppa/mof/OpenDRIM_OperatingSystemDefaultRunLevel.mof0000644000175000017500000000360411400673710027226 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), OS provider package // Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Provider("cmpi:cmpiOS_OpenDRIM_OperatingSystemDefaultRunLevelProvider")] class OpenDRIM_OperatingSystemDefaultRunLevel:CIM_SettingData { [ValueMap{"1", "2", "3", "5"}, Values{"Single user mode", "Multiuser, without NFS", "Full multiuser mode", "X11"}] uint8 Value; }; opendrim-lmp-os-1.1.0~ppa/mof/OpenDRIM_OperatingSystem.mof0000644000175000017500000000403411400673710024242 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), OS provider package // Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Provider("cmpi:cmpiOS_OpenDRIM_OperatingSystemProvider")] class OpenDRIM_OperatingSystem:CIM_OperatingSystem { [Override("Shutdown"), ValueMap{"0", "1", "2", "3"}, Values{"OK", "Not supported", "Shutdown/Reboot already initiated", "Failed"}] uint32 Shutdown(); [Override("Reboot"), ValueMap{"0", "1", "2", "3"}, Values{"OK", "Not supported", "Shutdown/Reboot already initiated", "Failed"}] uint32 Reboot(); }; opendrim-lmp-os-1.1.0~ppa/mof/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.mof0000644000175000017500000000346111400673710032305 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), OS provider package // Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Association, Provider("cmpi:cmpiOS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProvider")] class OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel:CIM_ElementSettingData { }; opendrim-lmp-os-1.1.0~ppa/mof/OpenDRIM_BootOSFromFS.mof0000644000175000017500000000335111400673710023330 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), OS provider package // Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Association, Provider("cmpi:cmpiOS_OpenDRIM_BootOSFromFSProvider")] class OpenDRIM_BootOSFromFS:CIM_BootOSFromFS { }; opendrim-lmp-os-1.1.0~ppa/mof/OpenDRIM_RunningOS.mof0000644000175000017500000000334011400673710022766 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), OS provider package // Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Association, Provider("cmpi:cmpiOS_OpenDRIM_RunningOSProvider")] class OpenDRIM_RunningOS:CIM_RunningOS { }; opendrim-lmp-os-1.1.0~ppa/mof/OpenDRIM_InstalledOS.mof0000644000175000017500000000341611400673710023271 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), OS provider package // Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Association, Aggregation(true), Composition(true), Provider("cmpi:cmpiOS_OpenDRIM_InstalledOSProvider")] class OpenDRIM_InstalledOS:CIM_InstalledOS { }; opendrim-lmp-os-1.1.0~ppa/mof/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.mof0000644000175000017500000000346111400673710032343 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), OS provider package // Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Association, Provider("cmpi:cmpiOS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProvider")] class OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel:CIM_ElementSettingData { }; opendrim-lmp-os-1.1.0~ppa/OpenDRIM_InstalledOS/0000755000175000017500000000000011400673710022001 5ustar guillaumeguillaumeopendrim-lmp-os-1.1.0~ppa/OpenDRIM_InstalledOS/Makefile.am0000644000175000017500000000466011400673710024043 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiOS_OpenDRIM_InstalledOSProvider.la libcmpiOS_OpenDRIM_InstalledOSProvider_la_SOURCES = OpenDRIM_InstalledOSAccess.cpp OpenDRIM_InstalledOSProvider.cpp cmpiOpenDRIM_InstalledOS.cpp assocOpenDRIM_InstalledOS.cpp # May have to be adjusted for direct invocation libcmpiOS_OpenDRIM_InstalledOSProvider_la_CPPFLAGS = -I../CIM_OperatingSystem -I../CIM_ComputerSystem # Uncomment the end for direct invocation, may have to be adjusted libcmpiOS_OpenDRIM_InstalledOSProvider_la_LIBADD = ../Common/libcmpiOS_Common.la #../CIM_OperatingSystem/libcmpiOS_CIM_OperatingSystemProvider.la ../CIM_ComputerSystem/libcmpiOS_CIM_ComputerSystemProvider.la libcmpiOS_OpenDRIM_InstalledOSProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_InstalledOS.h OpenDRIM_InstalledOS.h OpenDRIM_InstalledOSAccess.h opendrim-lmp-os-1.1.0~ppa/OpenDRIM_InstalledOS/OpenDRIM_InstalledOSProvider.cpp0000644000175000017500000004017211400673710030042 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_InstalledOS.h" #include "OpenDRIM_InstalledOSAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define OS_OpenDRIM_InstalledOSProviderSetInstance OS_OpenDRIM_InstalledOSProviderModifyInstance #endif int OS_OpenDRIM_InstalledOS_init(const CMPIBroker* broker); int OS_OpenDRIM_InstalledOS_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus OS_OpenDRIM_InstalledOSProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = OS_OpenDRIM_InstalledOS_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus OS_OpenDRIM_InstalledOSProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = OS_OpenDRIM_InstalledOS_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_InstalledOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = OS_OpenDRIM_InstalledOS_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_InstalledOSProviderEnumInstances(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 = OS_OpenDRIM_InstalledOS_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_InstalledOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = OS_OpenDRIM_InstalledOS_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_InstalledOSProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_InstalledOS instance; OS_OpenDRIM_InstalledOS_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_InstalledOS_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_InstalledOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = OS_OpenDRIM_InstalledOS_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_InstalledOSProviderSetInstance(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_InstalledOS newInstance, oldInstance; OS_OpenDRIM_InstalledOS_toCPP(_broker, ci, newInstance); OS_OpenDRIM_InstalledOS_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = OS_OpenDRIM_InstalledOS_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_InstalledOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_InstalledOS_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_InstalledOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_InstalledOSProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_InstalledOS instance; OS_OpenDRIM_InstalledOS_toCPP(_broker, ci, instance); string errorMessage; int errorCode = OS_OpenDRIM_InstalledOS_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_InstalledOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_InstalledOS_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_InstalledOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_InstalledOS_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_InstalledOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = OS_OpenDRIM_InstalledOS_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_InstalledOSProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_InstalledOS instance; OS_OpenDRIM_InstalledOS_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_InstalledOS_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_InstalledOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_InstalledOS_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_InstalledOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_InstalledOSProviderExecQuery(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 OS_OpenDRIM_InstalledOSProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = OS_OpenDRIM_InstalledOS_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus OS_OpenDRIM_InstalledOSProviderAssociatorNames(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 = OS_OpenDRIM_InstalledOS_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_InstalledOS_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 OS_OpenDRIM_InstalledOSProviderAssociators(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 = OS_OpenDRIM_InstalledOS_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_InstalledOS_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 OS_OpenDRIM_InstalledOSProviderReferenceNames(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 = OS_OpenDRIM_InstalledOS_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_InstalledOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = OS_OpenDRIM_InstalledOS_referencePartComponentToGroupComponent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = OS_OpenDRIM_InstalledOS_referenceGroupComponentToPartComponent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_InstalledOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = OS_OpenDRIM_InstalledOS_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus OS_OpenDRIM_InstalledOSProviderReferences(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 = OS_OpenDRIM_InstalledOS_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_InstalledOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = OS_OpenDRIM_InstalledOS_referencePartComponentToGroupComponent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = OS_OpenDRIM_InstalledOS_referenceGroupComponentToPartComponent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_InstalledOS_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = OS_OpenDRIM_InstalledOS_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int OS_OpenDRIM_InstalledOS_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = OS_OpenDRIM_InstalledOS_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_InstalledOS_init FAILED: " + (string) OpenDRIM_InstalledOS_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int OS_OpenDRIM_InstalledOS_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = OS_OpenDRIM_InstalledOS_unload(errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_InstalledOS_unload FAILED: " + (string) OpenDRIM_InstalledOS_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define OS_OpenDRIM_InstalledOS_INIT if (OS_OpenDRIM_InstalledOS_init(_broker) < 0) return NULL CMInstanceMIStub(OS_OpenDRIM_InstalledOSProvider, OS_OpenDRIM_InstalledOSProvider, _broker, OS_OpenDRIM_InstalledOS_INIT); CMAssociationMIStub(OS_OpenDRIM_InstalledOSProvider, OS_OpenDRIM_InstalledOSProvider, _broker, OS_OpenDRIM_InstalledOS_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_InstalledOS/cmpiOpenDRIM_InstalledOS.cpp0000644000175000017500000000643111400673710027200 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_InstalledOS.h" CMPIObjectPath* OS_OpenDRIM_InstalledOS_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_InstalledOS& instance) { _E_; Objectpath op(broker, OpenDRIM_InstalledOS_classnames[0], OpenDRIM_InstalledOS_NAMESPACE); if (!instance.GroupComponent_isNULL) op.addKey("GroupComponent", instance.GroupComponent); if (!instance.PartComponent_isNULL) op.addKey("PartComponent", instance.PartComponent); _L_; return op.getHdl(); } CMPIInstance* OS_OpenDRIM_InstalledOS_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_InstalledOS& instance) { _E_; Objectpath op(broker, OS_OpenDRIM_InstalledOS_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.PrimaryOS_isNULL) ci.setProperty("PrimaryOS", instance.PrimaryOS); _L_; return ci.getHdl(); } void OS_OpenDRIM_InstalledOS_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_InstalledOS& 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 OS_OpenDRIM_InstalledOS_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_InstalledOS& 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; if (inst.getProperty("PrimaryOS", instance.PrimaryOS) == OK) instance.PrimaryOS_isNULL = false; _L_; } opendrim-lmp-os-1.1.0~ppa/OpenDRIM_InstalledOS/assocOpenDRIM_InstalledOS.h0000644000175000017500000000620511400673710027024 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_INSTALLEDOS_H_ #define ASSOCOPENDRIM_INSTALLEDOS_H_ #include "OpenDRIM_InstalledOSAccess.h" int OS_OpenDRIM_InstalledOS_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 OS_OpenDRIM_InstalledOS_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 OS_OpenDRIM_InstalledOS_enumeratePartComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int OS_OpenDRIM_InstalledOS_getPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int OS_OpenDRIM_InstalledOS_enumerateGroupComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int OS_OpenDRIM_InstalledOS_getGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_INSTALLEDOS_H_*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_InstalledOS/OpenDRIM_InstalledOSAccess.cpp0000644000175000017500000002450411400673710027452 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_InstalledOSAccess.h" int OS_OpenDRIM_InstalledOS_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(OS_CIM_ComputerSystem_load(broker, errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystem_load(broker, errorMessage)); */ // TODO _L_; return OK; } int OS_OpenDRIM_InstalledOS_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(OS_CIM_ComputerSystem_unload(errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystem_unload(errorMessage)); */ // TODO _L_; return OK; } int OS_OpenDRIM_InstalledOS_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 OS_OpenDRIM_InstalledOS_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(OS_OpenDRIM_InstalledOS_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(OS_OpenDRIM_InstalledOS_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; OS_OpenDRIM_InstalledOS_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(OS_OpenDRIM_InstalledOS_referencePartComponentToGroupComponent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int OS_OpenDRIM_InstalledOS_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_InstalledOS& 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(OS_OpenDRIM_InstalledOS_getPartComponent(broker, ctx, PartComponent_objectpath, PartComponent_instance, NULL, errorMessage)); Objectpath GroupComponent_objectpath; instance.getGroupComponent(GroupComponent_objectpath); Instance GroupComponent_instance; CF_assert(OS_OpenDRIM_InstalledOS_getGroupComponent(broker, ctx, GroupComponent_objectpath, GroupComponent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(OS_OpenDRIM_InstalledOS_isAssociated(PartComponent_instance, GroupComponent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } CF_assert(OS_OpenDRIM_InstalledOS_populate(instance, errorMessage)); _L_; return OK; } int OS_OpenDRIM_InstalledOS_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_InstalledOS& newInstance, const OpenDRIM_InstalledOS& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_InstalledOS_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_InstalledOS& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_InstalledOS_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_InstalledOS& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_InstalledOS_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(OS_OpenDRIM_InstalledOS_enumerateGroupComponents(broker, ctx, GroupComponent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(OS_OpenDRIM_InstalledOS_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(OS_OpenDRIM_InstalledOS_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(OS_OpenDRIM_InstalledOS_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(OS_OpenDRIM_InstalledOS_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(OS_OpenDRIM_InstalledOS_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, false, errorMessage)); } for (size_t i=0; i& GroupComponent_instances, vector& OpenDRIM_InstalledOS_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_InstalledOS instance; instance.setPartComponent(((Instance) PartComponent_instance).getObjectpath()); instance.setGroupComponent(((Instance) GroupComponent_instances[i]).getObjectpath()); if (discriminant == "r") { CF_assert(OS_OpenDRIM_InstalledOS_populate(instance, errorMessage)); } OpenDRIM_InstalledOS_instances.push_back(instance); } _L_; return OK; } int OS_OpenDRIM_InstalledOS_referenceGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const vector& PartComponent_instances, vector& OpenDRIM_InstalledOS_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_InstalledOS instance; instance.setPartComponent(((Instance) PartComponent_instances[i]).getObjectpath()); instance.setGroupComponent(((Instance) GroupComponent_instance).getObjectpath()); if (discriminant == "r") { CF_assert(OS_OpenDRIM_InstalledOS_populate(instance, errorMessage)); } OpenDRIM_InstalledOS_instances.push_back(instance); } _L_; return OK; } int OS_OpenDRIM_InstalledOS_populate(OpenDRIM_InstalledOS& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-os-1.1.0~ppa/OpenDRIM_InstalledOS/cmpiOpenDRIM_InstalledOS.h0000644000175000017500000000431311400673710026642 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_INSTALLEDOS_H_ #define CMPIOPENDRIM_INSTALLEDOS_H_ #include "OpenDRIM_InstalledOS.h" CMPIObjectPath* OS_OpenDRIM_InstalledOS_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_InstalledOS& instance); CMPIInstance* OS_OpenDRIM_InstalledOS_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_InstalledOS& instance); void OS_OpenDRIM_InstalledOS_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_InstalledOS& instance); void OS_OpenDRIM_InstalledOS_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_InstalledOS& instance); #endif /*CMPIOPENDRIM_INSTALLEDOS_H_*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_InstalledOS/assocOpenDRIM_InstalledOS.cpp0000644000175000017500000002110011400673710027346 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_InstalledOS.h" int OS_OpenDRIM_InstalledOS_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 = OS_OpenDRIM_InstalledOS_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(OS_OpenDRIM_InstalledOS_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(OS_OpenDRIM_InstalledOS_associatorGroupComponentToPartComponent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int OS_OpenDRIM_InstalledOS_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(OS_OpenDRIM_OperatingSystem_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(OS_OpenDRIM_OperatingSystem_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, OS_OpenDRIM_OperatingSystem_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int OS_OpenDRIM_InstalledOS_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 */ /* OpenDRIM_OperatingSystem _instance; OS_OpenDRIM_OperatingSystem_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(OS_OpenDRIM_OperatingSystem_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, OS_OpenDRIM_OperatingSystem_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int OS_OpenDRIM_InstalledOS_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(OS_OpenDRIM_ComputerSystem_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(OS_OpenDRIM_ComputerSystem_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, OS_OpenDRIM_ComputerSystem_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int OS_OpenDRIM_InstalledOS_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 */ /* OpenDRIM_ComputerSystem _instance; OS_OpenDRIM_ComputerSystem_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(OS_OpenDRIM_ComputerSystem_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, OS_OpenDRIM_ComputerSystem_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-os-1.1.0~ppa/OpenDRIM_InstalledOS/OpenDRIM_InstalledOSAccess.h0000644000175000017500000001023011400673710027106 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_INSTALLEDOSACCESS_H_ #define OPENDRIM_INSTALLEDOSACCESS_H_ #include "OS_Common.h" #include "OpenDRIM_InstalledOS.h" #include "assocOpenDRIM_InstalledOS.h" int OS_OpenDRIM_InstalledOS_load(const CMPIBroker* broker, string& errorMessage); int OS_OpenDRIM_InstalledOS_unload(string& errorMessage); int OS_OpenDRIM_InstalledOS_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_InstalledOS_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_InstalledOS& instance, const char** properties, string& errorMessage); int OS_OpenDRIM_InstalledOS_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_InstalledOS& newInstance, const OpenDRIM_InstalledOS& oldInstance, const char** properties, string& errorMessage); int OS_OpenDRIM_InstalledOS_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_InstalledOS& instance, string& errorMessage); int OS_OpenDRIM_InstalledOS_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_InstalledOS& instance, string& errorMessage); int OS_OpenDRIM_InstalledOS_associatorPartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const char** properties, vector& GroupComponent_associatedInstances, string& errorMessage, const string& discriminant); int OS_OpenDRIM_InstalledOS_associatorGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const char** properties, vector& PartComponent_associatedInstances, string& errorMessage, const string& discriminant); int OS_OpenDRIM_InstalledOS_referencePartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const vector& GroupComponent_instances, vector& OpenDRIM_InstalledOS_instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_InstalledOS_referenceGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const vector& PartComponent_instances, vector& OpenDRIM_InstalledOS_instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_InstalledOS_populate(OpenDRIM_InstalledOS& instance, string& errorMessage); #endif /*OPENDRIM_INSTALLEDOSACCESS_H_*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_InstalledOS/OpenDRIM_InstalledOS.h0000644000175000017500000000757011400673710026001 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_INSTALLEDOS_H_ #define OPENDRIM_INSTALLEDOS_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_ComputerSystem.h" #include "CIM_ComputerSystemAccess.h" #include "cmpiOpenDRIM_OperatingSystem.h" #include "OpenDRIM_OperatingSystemAccess.h" */ const static char* OpenDRIM_InstalledOS_classnames[] = {"OpenDRIM_InstalledOS"}; static string OpenDRIM_InstalledOS_NAMESPACE = _NAMESPACE; const static string PartComponent_role = "PartComponent"; const static char* PartComponent_classnames[] = {"OpenDRIM_OperatingSystem"}; 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_InstalledOS { public: Objectpath GroupComponent; bool GroupComponent_isNULL; Objectpath PartComponent; bool PartComponent_isNULL; bool PrimaryOS; bool PrimaryOS_isNULL; OpenDRIM_InstalledOS() { GroupComponent_isNULL = true; PartComponent_isNULL = true; PrimaryOS_isNULL = true; } ~OpenDRIM_InstalledOS() {} 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; } int getPrimaryOS(bool& value) const { if (PrimaryOS_isNULL==true) return NOT_FOUND; value = PrimaryOS; return OK; } int setPrimaryOS(const bool& newValue) { PrimaryOS = newValue; PrimaryOS_isNULL = false; return OK; } }; #endif /*OPENDRIM_INSTALLEDOS_H_*/ opendrim-lmp-os-1.1.0~ppa/mof.generation/0000755000175000017500000000000011400673710021076 5ustar guillaumeguillaumeopendrim-lmp-os-1.1.0~ppa/mof.generation/OpenDRIM_OperatingSystemStatistics.mof0000644000175000017500000000025011400673710030443 0ustar guillaumeguillaume[Association] class OpenDRIM_OperatingSystemStatistics { [Key] OpenDRIM_OperatingSystem REF Element; [Key] OpenDRIM_OperatingSystemLoadAverages REF Stats; }; opendrim-lmp-os-1.1.0~ppa/mof.generation/OpenDRIM_OperatingSystemLoadAverages.mof0000644000175000017500000000054111400673710030651 0ustar guillaumeguillaumeclass OpenDRIM_OperatingSystemLoadAverages { [Key] string Name; [Description("A set of 3 real numbers separated by comma, which defines as, the number of processes waiting " "in the run-queue (to compete for CPU processing) plus the number currently executing over the last " "1, 5, and 15 minutes respectively.")] real32 LoadAverages[]; }; opendrim-lmp-os-1.1.0~ppa/mof.generation/OpenDRIM_OperatingSystemCurrentRunLevel.mof0000644000175000017500000000046611400673710031421 0ustar guillaumeguillaumeclass OpenDRIM_OperatingSystemCurrentRunLevel { [Key] string InstanceID; string ElementName; uint16 ChangeableType; [ValueMap {"0", "1", "2", "3", "4", "5", "6"}, Values {"Halt", "Single user mode", "Multiuser, without NFS", "Full multiuser mode", "Unused", "X11", "Reboot"}] uint8 Value; }; opendrim-lmp-os-1.1.0~ppa/mof.generation/OS.mof0000644000175000017500000000111511400673710022120 0ustar guillaumeguillaume#pragma include ("OpenDRIM_OperatingSystem.mof") #pragma include ("OpenDRIM_OperatingSystemLoadAverages.mof") #pragma include ("OpenDRIM_OperatingSystemCurrentRunLevel.mof") #pragma include ("OpenDRIM_OperatingSystemDefaultRunLevel.mof") #pragma include ("OpenDRIM_InstalledOS.mof") #pragma include ("OpenDRIM_RunningOS.mof") #pragma include ("OpenDRIM_BootOSFromFS.mof") #pragma include ("OpenDRIM_OperatingSystemStatistics.mof") #pragma include ("OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.mof") #pragma include ("OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.mof") opendrim-lmp-os-1.1.0~ppa/mof.generation/OpenDRIM_OperatingSystemDefaultRunLevel.mof0000644000175000017500000000050211400673710031352 0ustar guillaumeguillaumeclass OpenDRIM_OperatingSystemDefaultRunLevel { [Key] string InstanceID; string ElementName; uint16 ChangeableType; [ValueMap {"1", "2", "3", "4", "5"}, Values {"Single user mode", "Multiuser without network", "Full multiuser mode (text console)", "Unused", "Full multiuser mode (GUI)"}] uint8 Value; }; opendrim-lmp-os-1.1.0~ppa/mof.generation/OpenDRIM_OperatingSystem.mof0000644000175000017500000000254611400673710026402 0ustar guillaumeguillaumeclass OpenDRIM_OperatingSystem { [Key] string CSCreationClassName; [Key] string CSName; [Key] string CreationClassName; [Key] string Name; string Version; datetime LastBootUpTime; string ElementName; datetime LocalDateTime; datetime InstallTime; uint16 OSType; sint16 CurrentTimeZone; uint32 NumberOfLicensedUsers; uint32 NumberOfUsers; uint32 NumberOfProcesses; uint32 MaxNumberOfProcesses; uint64 TotalSwapSpaceSize; uint64 TotalVirtualMemorySize; uint64 FreeVirtualMemory; uint64 FreePhysicalMemory; uint64 TotalVisibleMemorySize; uint64 SizeStoredInPagingFiles; uint64 FreeSpaceInPagingFiles; uint64 MaxProcessMemorySize; uint32 MaxProcessesPerUser; // 2: Enabled, 4: Shutting down uint16 EnabledState; // 2: Enabled, 4: Shutdown, 10: Reboot uint16 RequestedState; // 1: OK, 2: Degraded uint16 PrimaryStatus; // 1: No additional Information, 2: Stressed uint16 DetailedStatus; // 2: OK, 3: Degraded, 4: Stressed, 9: Stopping uint16 OperationalStatus[]; // 5: OK, 10: Degraded/Warning uint16 HealthState; [ValueMap{"0", "1", "2", "3"}, Values{"OK", "Not supported", "Shutdown/Reboot already initiated", "Failed"}] uint32 Shutdown(); [ValueMap{"0", "1", "2", "3"}, Values{"OK", "Not supported", "Shutdown/Reboot already initiated", "Failed"}] uint32 Reboot(); }; opendrim-lmp-os-1.1.0~ppa/mof.generation/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.mof0000644000175000017500000000037611400673710034441 0ustar guillaumeguillaume[Association] class OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel { [Key] OpenDRIM_OperatingSystem REF ManagedElement; [Key] OpenDRIM_OperatingSystemDefaultRunLevel REF SettingData; // 1 uint16 IsDefault; // 2 uint16 IsCurrent; }; opendrim-lmp-os-1.1.0~ppa/mof.generation/OpenDRIM_BootOSFromFS.mof0000644000175000017500000000021611400673710025457 0ustar guillaumeguillaume[Association] class OpenDRIM_BootOSFromFS { [Key] OpenDRIM_FileSystem REF Antecedent; [Key] OpenDRIM_OperatingSystem REF Dependent; }; opendrim-lmp-os-1.1.0~ppa/mof.generation/OpenDRIM_RunningOS.mof0000644000175000017500000000022211400673710025114 0ustar guillaumeguillaume[Association] class OpenDRIM_RunningOS { [Key] OpenDRIM_OperatingSystem REF Antecedent; [Key] OpenDRIM_ComputerSystem REF Dependent; }; opendrim-lmp-os-1.1.0~ppa/mof.generation/OpenDRIM_InstalledOS.mof0000644000175000017500000000030011400673710025410 0ustar guillaumeguillaume[Association, Aggregation, Composition] class OpenDRIM_InstalledOS { [Key, Aggregate] OpenDRIM_ComputerSystem REF GroupComponent; [Key] OpenDRIM_OperatingSystem REF PartComponent; }; opendrim-lmp-os-1.1.0~ppa/mof.generation/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.mof0000644000175000017500000000037611400673710034477 0ustar guillaumeguillaume[Association] class OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel { [Key] OpenDRIM_OperatingSystem REF ManagedElement; [Key] OpenDRIM_OperatingSystemCurrentRunLevel REF SettingData; // 1 uint16 IsCurrent; // 2 uint16 IsDefault; }; opendrim-lmp-os-1.1.0~ppa/COPYING0000644000175000017500000004310311400673710017217 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-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/0000755000175000017500000000000011400673710031015 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProvider.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/OpenDRIM_OperatingS0000644000175000017500000004614611400673710034463 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.h" #include "OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProviderSetInstance OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProviderModifyInstance #endif int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_init(const CMPIBroker* broker); int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProviderEnumInstances(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 = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel instance; OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProviderSetInstance(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_OperatingSystemOperatingSystemDefaultRunLevel newInstance, oldInstance; OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_toCPP(_broker, ci, newInstance); OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel instance; OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_toCPP(_broker, ci, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel instance; OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProviderExecQuery(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 OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProviderAssociatorNames(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 = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_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 OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProviderAssociators(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 = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_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 OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProviderReferenceNames(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 = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_referenceSettingDataToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_referenceManagedElementToSettingData(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProviderReferences(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 = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_referenceSettingDataToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_referenceManagedElementToSettingData(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_init FAILED: " + (string) OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_unload(errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_unload FAILED: " + (string) OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_INIT if (OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_init(_broker) < 0) return NULL CMInstanceMIStub(OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProvider, OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProvider, _broker, OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_INIT); CMAssociationMIStub(OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProvider, OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProvider, _broker, OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/Makefile.am0000644000175000017500000000547411400673710033063 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiOS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProvider.la libcmpiOS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProvider_la_SOURCES = OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelAccess.cpp OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProvider.cpp cmpiOpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.cpp assocOpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.cpp # May have to be adjusted for direct invocation libcmpiOS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProvider_la_CPPFLAGS = -I../CIM_SettingData -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiOS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProvider_la_LIBADD = ../Common/libcmpiOS_Common.la #../CIM_SettingData/libcmpiOS_CIM_SettingDataProvider.la ../CIM_ManagedElement/libcmpiOS_CIM_ManagedElementProvider.la libcmpiOS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.h OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.h OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelAccess.h ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.hopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/OpenDRIM_OperatingS0000644000175000017500000001355111400673710034455 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMDEFAULTRUNLEVEL_H_ #define OPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMDEFAULTRUNLEVEL_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiOpenDRIM_OperatingSystemDefaultRunLevel.h" #include "OpenDRIM_OperatingSystemDefaultRunLevelAccess.h" #include "cmpiOpenDRIM_OperatingSystem.h" #include "OpenDRIM_OperatingSystemAccess.h" */ const static char* OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_classnames[] = {"OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel"}; static string OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_NAMESPACE = _NAMESPACE; const static string SettingData_role = "SettingData"; const static char* SettingData_classnames[] = {"OpenDRIM_OperatingSystemDefaultRunLevel"}; const static string SettingData_NAMESPACE = _NAMESPACE; const static string ManagedElement_role = "ManagedElement"; const static char* ManagedElement_classnames[] = {"OpenDRIM_OperatingSystem"}; const static string ManagedElement_NAMESPACE = _NAMESPACE; class OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel { public: Objectpath ManagedElement; bool ManagedElement_isNULL; Objectpath SettingData; bool SettingData_isNULL; unsigned short IsDefault; bool IsDefault_isNULL; unsigned short IsCurrent; bool IsCurrent_isNULL; unsigned short IsNext; bool IsNext_isNULL; unsigned short IsMinimum; bool IsMinimum_isNULL; unsigned short IsMaximum; bool IsMaximum_isNULL; unsigned short IsPending; bool IsPending_isNULL; OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel() { ManagedElement_isNULL = true; SettingData_isNULL = true; IsDefault_isNULL = true; IsCurrent_isNULL = true; IsNext_isNULL = true; IsMinimum_isNULL = true; IsMaximum_isNULL = true; IsPending_isNULL = true; } ~OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel() {} string getKeys() const { return CF_toLowCase(".ManagedElement=\"" + CF_quoteString(ManagedElement.toString()) + "\""".SettingData=\"" + CF_quoteString(SettingData.toString()) + "\""); } 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; } int getSettingData(Objectpath& value) const { if (SettingData_isNULL==true) return NOT_FOUND; value = SettingData; return OK; } int setSettingData(const Objectpath& newValue) { SettingData = newValue; SettingData.setNamespace(SettingData_NAMESPACE); SettingData_isNULL = false; return OK; } int getIsDefault(unsigned short& value) const { if (IsDefault_isNULL==true) return NOT_FOUND; value = IsDefault; return OK; } int setIsDefault(const unsigned short& newValue) { IsDefault = newValue; IsDefault_isNULL = false; return OK; } int getIsCurrent(unsigned short& value) const { if (IsCurrent_isNULL==true) return NOT_FOUND; value = IsCurrent; return OK; } int setIsCurrent(const unsigned short& newValue) { IsCurrent = newValue; IsCurrent_isNULL = false; return OK; } int getIsNext(unsigned short& value) const { if (IsNext_isNULL==true) return NOT_FOUND; value = IsNext; return OK; } int setIsNext(const unsigned short& newValue) { IsNext = newValue; IsNext_isNULL = false; return OK; } int getIsMinimum(unsigned short& value) const { if (IsMinimum_isNULL==true) return NOT_FOUND; value = IsMinimum; return OK; } int setIsMinimum(const unsigned short& newValue) { IsMinimum = newValue; IsMinimum_isNULL = false; return OK; } int getIsMaximum(unsigned short& value) const { if (IsMaximum_isNULL==true) return NOT_FOUND; value = IsMaximum; return OK; } int setIsMaximum(const unsigned short& newValue) { IsMaximum = newValue; IsMaximum_isNULL = false; return OK; } int getIsPending(unsigned short& value) const { if (IsPending_isNULL==true) return NOT_FOUND; value = IsPending; return OK; } int setIsPending(const unsigned short& newValue) { IsPending = newValue; IsPending_isNULL = false; return OK; } }; #endif /*OPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMDEFAULTRUNLEVEL_H_*/ ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/assocOpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.hopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/assocOpenDRIM_Opera0000644000175000017500000000672511400673710034506 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMDEFAULTRUNLEVEL_H_ #define ASSOCOPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMDEFAULTRUNLEVEL_H_ #include "OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelAccess.h" int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_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 OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_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 OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_enumerateSettingDatas(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_getSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMDEFAULTRUNLEVEL_H_*/ ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/cmpiOpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/cmpiOpenDRIM_Operat0000644000175000017500000001105211400673710034477 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.h" CMPIObjectPath* OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel& instance) { _E_; Objectpath op(broker, OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_classnames[0], OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_NAMESPACE); if (!instance.ManagedElement_isNULL) op.addKey("ManagedElement", instance.ManagedElement); if (!instance.SettingData_isNULL) op.addKey("SettingData", instance.SettingData); _L_; return op.getHdl(); } CMPIInstance* OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel& instance) { _E_; Objectpath op(broker, OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.IsDefault_isNULL) ci.setProperty("IsDefault", instance.IsDefault); if (!instance.IsCurrent_isNULL) ci.setProperty("IsCurrent", instance.IsCurrent); if (!instance.IsNext_isNULL) ci.setProperty("IsNext", instance.IsNext); if (!instance.IsMinimum_isNULL) ci.setProperty("IsMinimum", instance.IsMinimum); if (!instance.IsMaximum_isNULL) ci.setProperty("IsMaximum", instance.IsMaximum); if (!instance.IsPending_isNULL) ci.setProperty("IsPending", instance.IsPending); _L_; return ci.getHdl(); } void OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("SettingData", instance.SettingData) == OK) instance.SettingData_isNULL = false; if (op.getKey("ManagedElement", instance.ManagedElement) == OK) instance.ManagedElement_isNULL = false; _L_; } void OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("ManagedElement", instance.ManagedElement) == OK) instance.ManagedElement_isNULL = false; if (inst.getProperty("SettingData", instance.SettingData) == OK) instance.SettingData_isNULL = false; if (inst.getProperty("IsDefault", instance.IsDefault) == OK) instance.IsDefault_isNULL = false; if (inst.getProperty("IsCurrent", instance.IsCurrent) == OK) instance.IsCurrent_isNULL = false; if (inst.getProperty("IsNext", instance.IsNext) == OK) instance.IsNext_isNULL = false; if (inst.getProperty("IsMinimum", instance.IsMinimum) == OK) instance.IsMinimum_isNULL = false; if (inst.getProperty("IsMaximum", instance.IsMaximum) == OK) instance.IsMaximum_isNULL = false; if (inst.getProperty("IsPending", instance.IsPending) == OK) instance.IsPending_isNULL = false; _L_; } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelAccess.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/OpenDRIM_OperatingS0000644000175000017500000002761311400673710034461 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelAccess.h" int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(OS_OpenDRIM_OperatingSystemDefaultRunLevel_load(broker, errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystem_load(broker, errorMessage)); */ // TODO _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(OS_OpenDRIM_OperatingSystemDefaultRunLevel_unload(errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystem_unload(errorMessage)); */ // TODO _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_isAssociated(const Instance& SettingData, const Instance& ManagedElement, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_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(OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_enumerateSettingDatas(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(OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_enumerateSettingDatas(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; OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), SettingData_classnames[0], ManagedElement_classnames[0], SettingData_role.c_str(), ManagedElement_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_referenceSettingDataToManagedElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath SettingData_objectpath; instance.getSettingData(SettingData_objectpath); Instance SettingData_instance; CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_getSettingData(broker, ctx, SettingData_objectpath, SettingData_instance, NULL, errorMessage)); Objectpath ManagedElement_objectpath; instance.getManagedElement(ManagedElement_objectpath); Instance ManagedElement_instance; CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_getManagedElement(broker, ctx, ManagedElement_objectpath, ManagedElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_isAssociated(SettingData_instance, ManagedElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_populate(instance, errorMessage)); _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel& newInstance, const OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_associatorSettingDataToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& SettingData_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(OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_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(OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); } for (size_t i=0; i& SettingData_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector SettingData_instances; if (discriminant=="a") CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_enumerateSettingDatas(broker, ctx, SettingData_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_enumerateSettingDatas(broker, ctx, SettingData_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(OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_enumerateSettingDatas(broker, ctx, SettingData_instances, properties, false, errorMessage)); } for (size_t i=0; i& ManagedElement_instances, vector& OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_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_OperatingSystemOperatingSystemDefaultRunLevel instance; instance.setSettingData(((Instance) SettingData_instance).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instances[i]).getObjectpath()); if (discriminant == "r") { CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_populate(instance, errorMessage)); } OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_instances.push_back(instance); } _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_referenceManagedElementToSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& SettingData_instances, vector& OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_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 < SettingData_instances.size(); i++) { OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel instance; instance.setSettingData(((Instance) SettingData_instances[i]).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instance).getObjectpath()); if (discriminant == "r") { CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_populate(instance, errorMessage)); } OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_instances.push_back(instance); } _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_populate(OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel& instance, string& errorMessage) { _E_; instance.setIsDefault(1); instance.setIsCurrent(2); _L_; return OK; } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/assocOpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/assocOpenDRIM_Opera0000644000175000017500000002230111400673710034472 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.h" int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_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 = OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_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, "SettingData") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "ManagedElement") != 0) return OK; CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_associatorSettingDataToManagedElement(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "ManagedElement") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "SettingData") != 0) return OK; CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_associatorManagedElementToSettingData(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_enumerateSettingDatas(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, SettingData_NAMESPACE, SettingData_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(OS_OpenDRIM_OperatingSystemDefaultRunLevel_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(OS_OpenDRIM_OperatingSystemDefaultRunLevel_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, OS_OpenDRIM_OperatingSystemDefaultRunLevel_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_getSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), SettingData_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), SettingData_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* OpenDRIM_OperatingSystemDefaultRunLevel _instance; OS_OpenDRIM_OperatingSystemDefaultRunLevel_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(OS_OpenDRIM_OperatingSystemDefaultRunLevel_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, OS_OpenDRIM_OperatingSystemDefaultRunLevel_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_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(OS_OpenDRIM_OperatingSystem_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(OS_OpenDRIM_OperatingSystem_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, OS_OpenDRIM_OperatingSystem_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_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 */ /* OpenDRIM_OperatingSystem _instance; OS_OpenDRIM_OperatingSystem_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(OS_OpenDRIM_OperatingSystem_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, OS_OpenDRIM_OperatingSystem_toCMPIInstance(broker, _instance)); */ _L_; return OK; } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevelAccess.hopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/OpenDRIM_OperatingS0000644000175000017500000001210011400673710034442 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMDEFAULTRUNLEVELACCESS_H_ #define OPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMDEFAULTRUNLEVELACCESS_H_ #include "OS_Common.h" #include "OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.h" #include "assocOpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.h" int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_load(const CMPIBroker* broker, string& errorMessage); int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_unload(string& errorMessage); int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel& instance, const char** properties, string& errorMessage); int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel& newInstance, const OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel& oldInstance, const char** properties, string& errorMessage); int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_associatorSettingDataToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& SettingData_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_associatorManagedElementToSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const char** properties, vector& SettingData_associatedInstances, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_referenceSettingDataToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& SettingData_instance, const vector& ManagedElement_instances, vector& OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_referenceManagedElementToSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& SettingData_instances, vector& OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_populate(OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel& instance, string& errorMessage); #endif /*OPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMDEFAULTRUNLEVELACCESS_H_*/ ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/cmpiOpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.hopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel/cmpiOpenDRIM_Operat0000644000175000017500000000514311400673710034503 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMDEFAULTRUNLEVEL_H_ #define CMPIOPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMDEFAULTRUNLEVEL_H_ #include "OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel.h" CMPIObjectPath* OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel& instance); CMPIInstance* OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel& instance); void OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel& instance); void OS_OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_OperatingSystemOperatingSystemDefaultRunLevel& instance); #endif /*CMPIOPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMDEFAULTRUNLEVEL_H_*/ opendrim-lmp-os-1.1.0~ppa/NEWS0000644000175000017500000000015611400673710016664 0ustar guillaumeguillaumeChanges in 1.1.0 ========================= // TODO Initial Release 1.0.0 ========================= // TODO opendrim-lmp-os-1.1.0~ppa/LICENSE0000644000175000017500000000312111400673710017165 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/0000755000175000017500000000000011400673710031053 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/assocOpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/assocOpenDRIM_Opera0000644000175000017500000002230111400673710034530 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.h" int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_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 = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_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, "SettingData") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "ManagedElement") != 0) return OK; CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_associatorSettingDataToManagedElement(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "ManagedElement") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "SettingData") != 0) return OK; CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_associatorManagedElementToSettingData(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_enumerateSettingDatas(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, SettingData_NAMESPACE, SettingData_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(OS_OpenDRIM_OperatingSystemCurrentRunLevel_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(OS_OpenDRIM_OperatingSystemCurrentRunLevel_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, OS_OpenDRIM_OperatingSystemCurrentRunLevel_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_getSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), SettingData_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), SettingData_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* OpenDRIM_OperatingSystemCurrentRunLevel _instance; OS_OpenDRIM_OperatingSystemCurrentRunLevel_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(OS_OpenDRIM_OperatingSystemCurrentRunLevel_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, OS_OpenDRIM_OperatingSystemCurrentRunLevel_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_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(OS_OpenDRIM_OperatingSystem_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(OS_OpenDRIM_OperatingSystem_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, OS_OpenDRIM_OperatingSystem_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_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 */ /* OpenDRIM_OperatingSystem _instance; OS_OpenDRIM_OperatingSystem_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(OS_OpenDRIM_OperatingSystem_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, OS_OpenDRIM_OperatingSystem_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/Makefile.am0000644000175000017500000000547411400673710033121 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiOS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProvider.la libcmpiOS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProvider_la_SOURCES = OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelAccess.cpp OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProvider.cpp cmpiOpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.cpp assocOpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.cpp # May have to be adjusted for direct invocation libcmpiOS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProvider_la_CPPFLAGS = -I../CIM_SettingData -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiOS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProvider_la_LIBADD = ../Common/libcmpiOS_Common.la #../CIM_SettingData/libcmpiOS_CIM_SettingDataProvider.la ../CIM_ManagedElement/libcmpiOS_CIM_ManagedElementProvider.la libcmpiOS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.h OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.h OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelAccess.h ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.hopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/OpenDRIM_OperatingS0000644000175000017500000001355111400673710034513 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMCURRENTRUNLEVEL_H_ #define OPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMCURRENTRUNLEVEL_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiOpenDRIM_OperatingSystemCurrentRunLevel.h" #include "OpenDRIM_OperatingSystemCurrentRunLevelAccess.h" #include "cmpiOpenDRIM_OperatingSystem.h" #include "OpenDRIM_OperatingSystemAccess.h" */ const static char* OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_classnames[] = {"OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel"}; static string OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_NAMESPACE = _NAMESPACE; const static string SettingData_role = "SettingData"; const static char* SettingData_classnames[] = {"OpenDRIM_OperatingSystemCurrentRunLevel"}; const static string SettingData_NAMESPACE = _NAMESPACE; const static string ManagedElement_role = "ManagedElement"; const static char* ManagedElement_classnames[] = {"OpenDRIM_OperatingSystem"}; const static string ManagedElement_NAMESPACE = _NAMESPACE; class OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel { public: Objectpath ManagedElement; bool ManagedElement_isNULL; Objectpath SettingData; bool SettingData_isNULL; unsigned short IsDefault; bool IsDefault_isNULL; unsigned short IsCurrent; bool IsCurrent_isNULL; unsigned short IsNext; bool IsNext_isNULL; unsigned short IsMinimum; bool IsMinimum_isNULL; unsigned short IsMaximum; bool IsMaximum_isNULL; unsigned short IsPending; bool IsPending_isNULL; OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel() { ManagedElement_isNULL = true; SettingData_isNULL = true; IsDefault_isNULL = true; IsCurrent_isNULL = true; IsNext_isNULL = true; IsMinimum_isNULL = true; IsMaximum_isNULL = true; IsPending_isNULL = true; } ~OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel() {} string getKeys() const { return CF_toLowCase(".ManagedElement=\"" + CF_quoteString(ManagedElement.toString()) + "\""".SettingData=\"" + CF_quoteString(SettingData.toString()) + "\""); } 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; } int getSettingData(Objectpath& value) const { if (SettingData_isNULL==true) return NOT_FOUND; value = SettingData; return OK; } int setSettingData(const Objectpath& newValue) { SettingData = newValue; SettingData.setNamespace(SettingData_NAMESPACE); SettingData_isNULL = false; return OK; } int getIsDefault(unsigned short& value) const { if (IsDefault_isNULL==true) return NOT_FOUND; value = IsDefault; return OK; } int setIsDefault(const unsigned short& newValue) { IsDefault = newValue; IsDefault_isNULL = false; return OK; } int getIsCurrent(unsigned short& value) const { if (IsCurrent_isNULL==true) return NOT_FOUND; value = IsCurrent; return OK; } int setIsCurrent(const unsigned short& newValue) { IsCurrent = newValue; IsCurrent_isNULL = false; return OK; } int getIsNext(unsigned short& value) const { if (IsNext_isNULL==true) return NOT_FOUND; value = IsNext; return OK; } int setIsNext(const unsigned short& newValue) { IsNext = newValue; IsNext_isNULL = false; return OK; } int getIsMinimum(unsigned short& value) const { if (IsMinimum_isNULL==true) return NOT_FOUND; value = IsMinimum; return OK; } int setIsMinimum(const unsigned short& newValue) { IsMinimum = newValue; IsMinimum_isNULL = false; return OK; } int getIsMaximum(unsigned short& value) const { if (IsMaximum_isNULL==true) return NOT_FOUND; value = IsMaximum; return OK; } int setIsMaximum(const unsigned short& newValue) { IsMaximum = newValue; IsMaximum_isNULL = false; return OK; } int getIsPending(unsigned short& value) const { if (IsPending_isNULL==true) return NOT_FOUND; value = IsPending; return OK; } int setIsPending(const unsigned short& newValue) { IsPending = newValue; IsPending_isNULL = false; return OK; } }; #endif /*OPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMCURRENTRUNLEVEL_H_*/ ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/cmpiOpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.hopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/cmpiOpenDRIM_Operat0000644000175000017500000000514311400673710034541 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMCURRENTRUNLEVEL_H_ #define CMPIOPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMCURRENTRUNLEVEL_H_ #include "OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.h" CMPIObjectPath* OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel& instance); CMPIInstance* OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel& instance); void OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel& instance); void OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel& instance); #endif /*CMPIOPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMCURRENTRUNLEVEL_H_*/ ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelAccess.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/OpenDRIM_OperatingS0000644000175000017500000002762511400673710034522 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelAccess.h" int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(OS_OpenDRIM_OperatingSystemCurrentRunLevel_load(broker, errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystem_load(broker, errorMessage)); */ // TODO _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(OS_OpenDRIM_OperatingSystemCurrentRunLevel_unload(errorMessage)); CF_assert(OS_OpenDRIM_OperatingSystem_unload(errorMessage)); */ // TODO _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_isAssociated(const Instance& SettingData, const Instance& ManagedElement, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_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(OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_enumerateSettingDatas(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(OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_enumerateSettingDatas(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; OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), SettingData_classnames[0], ManagedElement_classnames[0], SettingData_role.c_str(), ManagedElement_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_referenceSettingDataToManagedElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath SettingData_objectpath; instance.getSettingData(SettingData_objectpath); Instance SettingData_instance; CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_getSettingData(broker, ctx, SettingData_objectpath, SettingData_instance, NULL, errorMessage)); Objectpath ManagedElement_objectpath; instance.getManagedElement(ManagedElement_objectpath); Instance ManagedElement_instance; CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_getManagedElement(broker, ctx, ManagedElement_objectpath, ManagedElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_isAssociated(SettingData_instance, ManagedElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_populate(instance, errorMessage)); _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel& newInstance, const OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_associatorSettingDataToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& SettingData_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(OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_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(OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); } for (size_t i=0; i& SettingData_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector SettingData_instances; if (discriminant=="a") CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_enumerateSettingDatas(broker, ctx, SettingData_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_enumerateSettingDatas(broker, ctx, SettingData_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(OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_enumerateSettingDatas(broker, ctx, SettingData_instances, properties, false, errorMessage)); } for (size_t i=0; i& ManagedElement_instances, vector& OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_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_OperatingSystemOperatingSystemCurrentRunLevel instance; instance.setSettingData(((Instance) SettingData_instance).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instances[i]).getObjectpath()); if (discriminant == "r") { CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_populate(instance, errorMessage)); } OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_instances.push_back(instance); } _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_referenceManagedElementToSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& SettingData_instances, vector& OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_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 < SettingData_instances.size(); i++) { OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel instance; instance.setSettingData(((Instance) SettingData_instances[i]).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instance).getObjectpath()); if (discriminant == "r") { CF_assert(OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_populate(instance, errorMessage)); } OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_instances.push_back(instance); } _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_populate(OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel& instance, string& errorMessage) { _E_; instance.setIsCurrent(1); instance.setIsDefault(2); _L_; return OK; } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelAccess.hopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/OpenDRIM_OperatingS0000644000175000017500000001210011400673710034500 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMCURRENTRUNLEVELACCESS_H_ #define OPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMCURRENTRUNLEVELACCESS_H_ #include "OS_Common.h" #include "OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.h" #include "assocOpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.h" int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_load(const CMPIBroker* broker, string& errorMessage); int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_unload(string& errorMessage); int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel& instance, const char** properties, string& errorMessage); int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel& newInstance, const OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel& oldInstance, const char** properties, string& errorMessage); int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel& instance, string& errorMessage); int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_associatorSettingDataToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& SettingData_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_associatorManagedElementToSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const char** properties, vector& SettingData_associatedInstances, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_referenceSettingDataToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& SettingData_instance, const vector& ManagedElement_instances, vector& OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_referenceManagedElementToSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& SettingData_instances, vector& OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_instances, const char** properties, string& errorMessage, const string& discriminant); int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_populate(OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel& instance, string& errorMessage); #endif /*OPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMCURRENTRUNLEVELACCESS_H_*/ ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/cmpiOpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/cmpiOpenDRIM_Operat0000644000175000017500000001105211400673710034535 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.h" CMPIObjectPath* OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel& instance) { _E_; Objectpath op(broker, OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_classnames[0], OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_NAMESPACE); if (!instance.ManagedElement_isNULL) op.addKey("ManagedElement", instance.ManagedElement); if (!instance.SettingData_isNULL) op.addKey("SettingData", instance.SettingData); _L_; return op.getHdl(); } CMPIInstance* OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel& instance) { _E_; Objectpath op(broker, OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.IsDefault_isNULL) ci.setProperty("IsDefault", instance.IsDefault); if (!instance.IsCurrent_isNULL) ci.setProperty("IsCurrent", instance.IsCurrent); if (!instance.IsNext_isNULL) ci.setProperty("IsNext", instance.IsNext); if (!instance.IsMinimum_isNULL) ci.setProperty("IsMinimum", instance.IsMinimum); if (!instance.IsMaximum_isNULL) ci.setProperty("IsMaximum", instance.IsMaximum); if (!instance.IsPending_isNULL) ci.setProperty("IsPending", instance.IsPending); _L_; return ci.getHdl(); } void OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("SettingData", instance.SettingData) == OK) instance.SettingData_isNULL = false; if (op.getKey("ManagedElement", instance.ManagedElement) == OK) instance.ManagedElement_isNULL = false; _L_; } void OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("ManagedElement", instance.ManagedElement) == OK) instance.ManagedElement_isNULL = false; if (inst.getProperty("SettingData", instance.SettingData) == OK) instance.SettingData_isNULL = false; if (inst.getProperty("IsDefault", instance.IsDefault) == OK) instance.IsDefault_isNULL = false; if (inst.getProperty("IsCurrent", instance.IsCurrent) == OK) instance.IsCurrent_isNULL = false; if (inst.getProperty("IsNext", instance.IsNext) == OK) instance.IsNext_isNULL = false; if (inst.getProperty("IsMinimum", instance.IsMinimum) == OK) instance.IsMinimum_isNULL = false; if (inst.getProperty("IsMaximum", instance.IsMaximum) == OK) instance.IsMaximum_isNULL = false; if (inst.getProperty("IsPending", instance.IsPending) == OK) instance.IsPending_isNULL = false; _L_; } ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProvider.cppopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/OpenDRIM_OperatingS0000644000175000017500000004614611400673710034521 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.h" #include "OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProviderSetInstance OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProviderModifyInstance #endif int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_init(const CMPIBroker* broker); int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProviderEnumInstances(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 = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel instance; OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProviderSetInstance(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_OperatingSystemOperatingSystemCurrentRunLevel newInstance, oldInstance; OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_toCPP(_broker, ci, newInstance); OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel instance; OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_toCPP(_broker, ci, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel instance; OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_toCPP(_broker, cop, instance); string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProviderExecQuery(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 OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProviderAssociatorNames(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 = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_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 OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProviderAssociators(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 = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_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 OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProviderReferenceNames(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 = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_referenceSettingDataToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_referenceManagedElementToSettingData(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProviderReferences(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 = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_referenceSettingDataToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_referenceManagedElementToSettingData(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_init FAILED: " + (string) OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_unload(errorMessage); if (errorCode != OK) { errorMessage += "OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_unload FAILED: " + (string) OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_INIT if (OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_init(_broker) < 0) return NULL CMInstanceMIStub(OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProvider, OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProvider, _broker, OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_INIT); CMAssociationMIStub(OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProvider, OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelProvider, _broker, OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/assocOpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel.hopendrim-lmp-os-1.1.0~ppa/OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel/assocOpenDRIM_Opera0000644000175000017500000000672511400673710034544 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), OS provider package # Copyright (C) 2007 Ilsoo Byun, 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 Khahramon NURIDDINOV, TUIT # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMCURRENTRUNLEVEL_H_ #define ASSOCOPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMCURRENTRUNLEVEL_H_ #include "OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevelAccess.h" int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_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 OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_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 OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_enumerateSettingDatas(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_getSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int OS_OpenDRIM_OperatingSystemOperatingSystemCurrentRunLevel_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_OPERATINGSYSTEMOPERATINGSYSTEMCURRENTRUNLEVEL_H_*/ opendrim-lmp-os-1.1.0~ppa/README0000644000175000017500000000103311400673710017040 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.1 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!