opendrim-lmp-ip-1.1.2~ppa/0000755000175000017500000000000011404314132016146 5ustar guillaumeguillaumeopendrim-lmp-ip-1.1.2~ppa/Makefile.am0000644000175000017500000000771211377667034020236 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ################################################################################ VENDOR = OpenDRIM VERSION = $(shell cat ./VERSION) APP_NAME = opendrim-lmp-ip RPM_PACKAGE_DIR = packaging PLATFORM = $(shell rpm --eval %_target_cpu) WORKING_DIR = $(shell pwd) SUBDIRS = Common OpenDRIM_IPProtocolEndpoint OpenDRIM_RegisteredIPProtocolProfile OpenDRIM_Gateway OpenDRIM_IP2ComputerSystem OpenDRIM_IPProtocolConformsToProfile OpenDRIM_IP2Gateway OpenDRIM_Gateway2ComputerSystem test postinstall: registration/IP.sh @CIMNAMESPACE@ $(VENDOR) @CIMSERVER@ @INTEROPNAMESPACE@ $(VERSION) . preuninstall: registration/IP-remove.sh @CIMNAMESPACE@ @CIMSERVER@ @INTEROPNAMESPACE@ . test-OpenDRIM_IP2ComputerSystem: all make -C test test-OpenDRIM_IP2ComputerSystem test-OpenDRIM_IPProtocolConformsToProfile: all make -C test test-OpenDRIM_IPProtocolConformsToProfile test-OpenDRIM_IP2Gateway: all make -C test test-OpenDRIM_IP2Gateway test-OpenDRIM_Gateway2ComputerSystem: all make -C test test-OpenDRIM_Gateway2ComputerSystem test-OpenDRIM_IPProtocolEndpoint: all make -C test test-OpenDRIM_IPProtocolEndpoint test-OpenDRIM_RegisteredIPProtocolProfile: all make -C test test-OpenDRIM_RegisteredIPProtocolProfile test-OpenDRIM_Gateway: all make -C test test-OpenDRIM_Gateway 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-ip-1.1.2~ppa/registration/0000755000175000017500000000000011377667034020705 5ustar guillaumeguillaumeopendrim-lmp-ip-1.1.2~ppa/registration/OpenDRIM_Gateway2ComputerSystem-remove.sh0000755000175000017500000000633311377667034030610 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ################################################################################ if test "$2" = pegasus then cimprovider -d -m IP_OpenDRIM_Gateway2ComputerSystemModule cimprovider -r -m IP_OpenDRIM_Gateway2ComputerSystemModule 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_Gateway2ComputerSystem.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ip-1.1.2~ppa/registration/OpenDRIM_IP2ComputerSystem.sh0000755000175000017500000000632511377667034026225 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_IP2ComputerSystem.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_IP2ComputerSystem provider module"; Name = "IP_OpenDRIM_IP2ComputerSystemModule"; Location = "cmpiIP_OpenDRIM_IP2ComputerSystemProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_IP2ComputerSystem provider"; Name = "IP_OpenDRIM_IP2ComputerSystemProvider"; ProviderModuleName = "IP_OpenDRIM_IP2ComputerSystemModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_IP2ComputerSystem provider capabilities"; ProviderModuleName = "IP_OpenDRIM_IP2ComputerSystemModule"; ProviderName = "IP_OpenDRIM_IP2ComputerSystemProvider"; ClassName = "OpenDRIM_IP2ComputerSystem"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent"}; CapabilityID = "IP_OpenDRIM_IP2ComputerSystem"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_IP2ComputerSystem.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ip-1.1.2~ppa/registration/IP.sh0000755000175000017500000000454411377667034021563 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 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_IP2ComputerSystem.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_IPProtocolConformsToProfile.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_IP2Gateway.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_Gateway2ComputerSystem.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_IPProtocolEndpoint.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_RegisteredIPProtocolProfile.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_Gateway.sh $1 $2 $3 $4 $5 $6 if test "$3" = sfcb then /etc/init.d/sfcb start fi opendrim-lmp-ip-1.1.2~ppa/registration/OpenDRIM_IPProtocolConformsToProfile.sh0000755000175000017500000000714011377667034030270 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_IPProtocolConformsToProfile.mof cimmof -aE -n $4 $6/mof/OpenDRIM_IPProtocolConformsToProfile.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_IPProtocolConformsToProfile provider module"; Name = "IP_OpenDRIM_IPProtocolConformsToProfileModule"; Location = "cmpiIP_OpenDRIM_IPProtocolConformsToProfileProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_IPProtocolConformsToProfile provider"; Name = "IP_OpenDRIM_IPProtocolConformsToProfileProvider"; ProviderModuleName = "IP_OpenDRIM_IPProtocolConformsToProfileModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_IPProtocolConformsToProfile provider capabilities"; ProviderModuleName = "IP_OpenDRIM_IPProtocolConformsToProfileModule"; ProviderName = "IP_OpenDRIM_IPProtocolConformsToProfileProvider"; ClassName = "OpenDRIM_IPProtocolConformsToProfile"; ProviderType = {2, 3}; Namespaces = {"$1", "$4"}; SupportedProperties = {"ConformantStandard", "ManagedElement"}; CapabilityID = "IP_OpenDRIM_IPProtocolConformsToProfile"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_IPProtocolConformsToProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE owmofc -u http://localhost/$4 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ip-1.1.2~ppa/registration/OpenDRIM_IPProtocolEndpoint.sh0000755000175000017500000000761011377667034026440 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_IPProtocolEndpoint.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_IPProtocolEndpoint provider module"; Name = "IP_OpenDRIM_IPProtocolEndpointModule"; Location = "cmpiIP_OpenDRIM_IPProtocolEndpointProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_IPProtocolEndpoint provider"; Name = "IP_OpenDRIM_IPProtocolEndpointProvider"; ProviderModuleName = "IP_OpenDRIM_IPProtocolEndpointModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_IPProtocolEndpoint provider capabilities"; ProviderModuleName = "IP_OpenDRIM_IPProtocolEndpointModule"; ProviderName = "IP_OpenDRIM_IPProtocolEndpointProvider"; ClassName = "OpenDRIM_IPProtocolEndpoint"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"Caption", "ElementName", "InstallDate", "StatusDescriptions", "Status", "HealthState", "PrimaryStatus", "DetailedStatus", "OperatingStatus", "CommunicationStatus", "OtherEnabledState", "RequestedState", "EnabledDefault", "AvailableRequestedStates", "TransitioningToState", "SystemCreationClassName", "SystemName", "CreationClassName", "Name", "Description", "OperationalStatus", "EnabledState", "TimeOfLastStateChange", "NameFormat", "ProtocolType", "OtherTypeDescription", "BroadcastResetSupported", "IPv4Address", "IPv6Address", "Address", "SubnetMask", "PrefixLength", "AddressType", "IPVersionSupport", "ProtocolIFType", "AddressOrigin"}; SupportedMethods = {"RequestStateChange", "BroadcastReset"}; CapabilityID = "IP_OpenDRIM_IPProtocolEndpoint"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_IPProtocolEndpoint.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ip-1.1.2~ppa/registration/OpenDRIM_IPProtocolEndpoint-remove.sh0000755000175000017500000000630311377667034027731 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m IP_OpenDRIM_IPProtocolEndpointModule cimprovider -r -m IP_OpenDRIM_IPProtocolEndpointModule 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_IPProtocolEndpoint.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ip-1.1.2~ppa/registration/OpenDRIM_RegisteredIPProtocolProfile.sh0000755000175000017500000000703211377667034030274 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ################################################################################ if test "$3" = pegasus then cimmof -aE -n $4 $6/mof/OpenDRIM_RegisteredIPProtocolProfile.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_RegisteredIPProtocolProfile provider module"; Name = "IP_OpenDRIM_RegisteredIPProtocolProfileModule"; Location = "cmpiIP_OpenDRIM_RegisteredIPProtocolProfileProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_RegisteredIPProtocolProfile provider"; Name = "IP_OpenDRIM_RegisteredIPProtocolProfileProvider"; ProviderModuleName = "IP_OpenDRIM_RegisteredIPProtocolProfileModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_RegisteredIPProtocolProfile provider capabilities"; ProviderModuleName = "IP_OpenDRIM_RegisteredIPProtocolProfileModule"; ProviderName = "IP_OpenDRIM_RegisteredIPProtocolProfileProvider"; ClassName = "OpenDRIM_RegisteredIPProtocolProfile"; ProviderType = {2}; Namespaces = {"$4"}; SupportedProperties = {"Caption", "Description", "ElementName", "InstanceID", "RegisteredOrganization", "OtherRegisteredOrganization", "RegisteredName", "RegisteredVersion", "AdvertiseTypes", "AdvertiseTypeDescriptions"}; CapabilityID = "IP_OpenDRIM_RegisteredIPProtocolProfile"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_RegisteredIPProtocolProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$4 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ip-1.1.2~ppa/registration/OpenDRIM_IP2ComputerSystem-remove.sh0000755000175000017500000000627611377667034027525 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m IP_OpenDRIM_IP2ComputerSystemModule cimprovider -r -m IP_OpenDRIM_IP2ComputerSystemModule 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_IP2ComputerSystem.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ip-1.1.2~ppa/registration/OpenDRIM_IP2Gateway-remove.sh0000755000175000017500000000617011377667034026114 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m IP_OpenDRIM_IP2GatewayModule cimprovider -r -m IP_OpenDRIM_IP2GatewayModule 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_IP2Gateway.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ip-1.1.2~ppa/registration/IP-remove.sh0000755000175000017500000000455311377667034023056 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 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_Gateway-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_RegisteredIPProtocolProfile-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_IPProtocolEndpoint-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_Gateway2ComputerSystem-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_IP2Gateway-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_IPProtocolConformsToProfile-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_IP2ComputerSystem-remove.sh $1 $2 $3 $4 if test "$2" = sfcb then /etc/init.d/sfcb start fi opendrim-lmp-ip-1.1.2~ppa/registration/OpenDRIM_Gateway2ComputerSystem.sh0000755000175000017500000000643711377667034027322 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_Gateway2ComputerSystem.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_Gateway2ComputerSystem provider module"; Name = "IP_OpenDRIM_Gateway2ComputerSystemModule"; Location = "cmpiIP_OpenDRIM_Gateway2ComputerSystemProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_Gateway2ComputerSystem provider"; Name = "IP_OpenDRIM_Gateway2ComputerSystemProvider"; ProviderModuleName = "IP_OpenDRIM_Gateway2ComputerSystemModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_Gateway2ComputerSystem provider capabilities"; ProviderModuleName = "IP_OpenDRIM_Gateway2ComputerSystemModule"; ProviderName = "IP_OpenDRIM_Gateway2ComputerSystemProvider"; ClassName = "OpenDRIM_Gateway2ComputerSystem"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent"}; CapabilityID = "IP_OpenDRIM_Gateway2ComputerSystem"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_Gateway2ComputerSystem.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ip-1.1.2~ppa/registration/OpenDRIM_IP2Gateway.sh0000755000175000017500000000615611377667034024625 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_IP2Gateway.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_IP2Gateway provider module"; Name = "IP_OpenDRIM_IP2GatewayModule"; Location = "cmpiIP_OpenDRIM_IP2GatewayProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_IP2Gateway provider"; Name = "IP_OpenDRIM_IP2GatewayProvider"; ProviderModuleName = "IP_OpenDRIM_IP2GatewayModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_IP2Gateway provider capabilities"; ProviderModuleName = "IP_OpenDRIM_IP2GatewayModule"; ProviderName = "IP_OpenDRIM_IP2GatewayProvider"; ClassName = "OpenDRIM_IP2Gateway"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent", "IsDefault", "OrderOfAccess"}; CapabilityID = "IP_OpenDRIM_IP2Gateway"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_IP2Gateway.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ip-1.1.2~ppa/registration/OpenDRIM_IPProtocolConformsToProfile-remove.sh0000755000175000017500000001036611377667034031567 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m IP_OpenDRIM_IPProtocolConformsToProfileModule cimprovider -r -m IP_OpenDRIM_IPProtocolConformsToProfileModule 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_IPProtocolConformsToProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE owmofc -u http://localhost/$3 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ip-1.1.2~ppa/registration/OpenDRIM_Gateway-remove.sh0000755000175000017500000000612511377667034025601 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m IP_OpenDRIM_GatewayModule cimprovider -r -m IP_OpenDRIM_GatewayModule 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_Gateway.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ip-1.1.2~ppa/registration/OpenDRIM_RegisteredIPProtocolProfile-remove.sh0000755000175000017500000000640111377667034031566 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ################################################################################ if test "$2" = pegasus then cimprovider -d -m IP_OpenDRIM_RegisteredIPProtocolProfileModule cimprovider -r -m IP_OpenDRIM_RegisteredIPProtocolProfileModule 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_RegisteredIPProtocolProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$3 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ip-1.1.2~ppa/registration/OpenDRIM_Gateway.sh0000755000175000017500000000705011377667034024304 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_Gateway.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_Gateway provider module"; Name = "IP_OpenDRIM_GatewayModule"; Location = "cmpiIP_OpenDRIM_GatewayProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_Gateway provider"; Name = "IP_OpenDRIM_GatewayProvider"; ProviderModuleName = "IP_OpenDRIM_GatewayModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_Gateway provider capabilities"; ProviderModuleName = "IP_OpenDRIM_GatewayModule"; ProviderName = "IP_OpenDRIM_GatewayProvider"; ClassName = "OpenDRIM_Gateway"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"Caption", "Description", "ElementName", "InstallDate", "OperationalStatus", "StatusDescriptions", "Status", "HealthState", "PrimaryStatus", "DetailedStatus", "OperatingStatus", "CommunicationStatus", "EnabledState", "OtherEnabledState", "RequestedState", "EnabledDefault", "TimeOfLastStateChange", "AvailableRequestedStates", "TransitioningToState", "SystemCreationClassName", "SystemName", "CreationClassName", "Name", "AccessInfo", "InfoFormat", "OtherInfoFormatDescription", "AccessContext", "OtherAccessContext"}; SupportedMethods = {"RequestStateChange"}; CapabilityID = "IP_OpenDRIM_Gateway"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_Gateway.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ip-1.1.2~ppa/VERSION0000644000175000017500000000000611377667034017237 0ustar guillaumeguillaume1.1.2 opendrim-lmp-ip-1.1.2~ppa/test/0000755000175000017500000000000011377667034017152 5ustar guillaumeguillaumeopendrim-lmp-ip-1.1.2~ppa/test/Makefile.am0000644000175000017500000001121111377667034021202 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ################################################################################ noinst_PROGRAMS = testOpenDRIM_IP2ComputerSystem testOpenDRIM_IPProtocolConformsToProfile testOpenDRIM_IP2Gateway testOpenDRIM_Gateway2ComputerSystem testOpenDRIM_IPProtocolEndpoint testOpenDRIM_RegisteredIPProtocolProfile testOpenDRIM_Gateway # May have to be adjusted for direct invocation testOpenDRIM_IP2ComputerSystem_CPPFLAGS = -I../OpenDRIM_IP2ComputerSystem/ -I../null/ -I../null/ testOpenDRIM_IP2ComputerSystem_SOURCES = testOpenDRIM_IP2ComputerSystem.cpp testOpenDRIM_IP2ComputerSystem_LDADD = ../OpenDRIM_IP2ComputerSystem/libcmpiIP_OpenDRIM_IP2ComputerSystemProvider.la test-OpenDRIM_IP2ComputerSystem: testOpenDRIM_IP2ComputerSystem ./testOpenDRIM_IP2ComputerSystem # May have to be adjusted for direct invocation testOpenDRIM_IPProtocolConformsToProfile_CPPFLAGS = -I../OpenDRIM_IPProtocolConformsToProfile/ -I../null/ -I../null/ testOpenDRIM_IPProtocolConformsToProfile_SOURCES = testOpenDRIM_IPProtocolConformsToProfile.cpp testOpenDRIM_IPProtocolConformsToProfile_LDADD = ../OpenDRIM_IPProtocolConformsToProfile/libcmpiIP_OpenDRIM_IPProtocolConformsToProfileProvider.la test-OpenDRIM_IPProtocolConformsToProfile: testOpenDRIM_IPProtocolConformsToProfile ./testOpenDRIM_IPProtocolConformsToProfile # May have to be adjusted for direct invocation testOpenDRIM_IP2Gateway_CPPFLAGS = -I../OpenDRIM_IP2Gateway/ -I../null/ -I../null/ testOpenDRIM_IP2Gateway_SOURCES = testOpenDRIM_IP2Gateway.cpp testOpenDRIM_IP2Gateway_LDADD = ../OpenDRIM_IP2Gateway/libcmpiIP_OpenDRIM_IP2GatewayProvider.la test-OpenDRIM_IP2Gateway: testOpenDRIM_IP2Gateway ./testOpenDRIM_IP2Gateway # May have to be adjusted for direct invocation testOpenDRIM_Gateway2ComputerSystem_CPPFLAGS = -I../OpenDRIM_Gateway2ComputerSystem/ -I../null/ -I../null/ testOpenDRIM_Gateway2ComputerSystem_SOURCES = testOpenDRIM_Gateway2ComputerSystem.cpp testOpenDRIM_Gateway2ComputerSystem_LDADD = ../OpenDRIM_Gateway2ComputerSystem/libcmpiIP_OpenDRIM_Gateway2ComputerSystemProvider.la test-OpenDRIM_Gateway2ComputerSystem: testOpenDRIM_Gateway2ComputerSystem ./testOpenDRIM_Gateway2ComputerSystem testOpenDRIM_IPProtocolEndpoint_CPPFLAGS = -I../OpenDRIM_IPProtocolEndpoint/ testOpenDRIM_IPProtocolEndpoint_SOURCES = testOpenDRIM_IPProtocolEndpoint.cpp testOpenDRIM_IPProtocolEndpoint_LDADD = ../OpenDRIM_IPProtocolEndpoint/libcmpiIP_OpenDRIM_IPProtocolEndpointProvider.la test-OpenDRIM_IPProtocolEndpoint: testOpenDRIM_IPProtocolEndpoint ./testOpenDRIM_IPProtocolEndpoint testOpenDRIM_RegisteredIPProtocolProfile_CPPFLAGS = -I../OpenDRIM_RegisteredIPProtocolProfile/ testOpenDRIM_RegisteredIPProtocolProfile_SOURCES = testOpenDRIM_RegisteredIPProtocolProfile.cpp testOpenDRIM_RegisteredIPProtocolProfile_LDADD = ../OpenDRIM_RegisteredIPProtocolProfile/libcmpiIP_OpenDRIM_RegisteredIPProtocolProfileProvider.la test-OpenDRIM_RegisteredIPProtocolProfile: testOpenDRIM_RegisteredIPProtocolProfile ./testOpenDRIM_RegisteredIPProtocolProfile testOpenDRIM_Gateway_CPPFLAGS = -I../OpenDRIM_Gateway/ testOpenDRIM_Gateway_SOURCES = testOpenDRIM_Gateway.cpp testOpenDRIM_Gateway_LDADD = ../OpenDRIM_Gateway/libcmpiIP_OpenDRIM_GatewayProvider.la test-OpenDRIM_Gateway: testOpenDRIM_Gateway ./testOpenDRIM_Gateway opendrim-lmp-ip-1.1.2~ppa/test/testOpenDRIM_IPProtocolConformsToProfile.cpp0000644000175000017500000001135311377667034027603 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #include "cmpiOpenDRIM_IPProtocolConformsToProfile.h" #include "OpenDRIM_IPProtocolConformsToProfileAccess.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_IPProtocolConformsToProfile& instance) { os << " [OpenDRIM_IPProtocolConformsToProfile]" << endl; ToStringRef("ConformantStandard", ConformantStandard, ConformantStandard_isNULL); ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL); os << " [\\OpenDRIM_IPProtocolConformsToProfile]" << endl; return os; } int main() { string errorMessage; int errorCode = IP_OpenDRIM_IPProtocolConformsToProfile_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = IP_OpenDRIM_IPProtocolConformsToProfile_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 = IP_OpenDRIM_IPProtocolConformsToProfile_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 = IP_OpenDRIM_IPProtocolConformsToProfile_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 = IP_OpenDRIM_IPProtocolConformsToProfile_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ip-1.1.2~ppa/test/testOpenDRIM_Gateway2ComputerSystem.cpp0000644000175000017500000001121011377667034026615 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #include "cmpiOpenDRIM_Gateway2ComputerSystem.h" #include "OpenDRIM_Gateway2ComputerSystemAccess.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_Gateway2ComputerSystem& instance) { os << " [OpenDRIM_Gateway2ComputerSystem]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); os << " [\\OpenDRIM_Gateway2ComputerSystem]" << endl; return os; } int main() { string errorMessage; int errorCode = IP_OpenDRIM_Gateway2ComputerSystem_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = IP_OpenDRIM_Gateway2ComputerSystem_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 = IP_OpenDRIM_Gateway2ComputerSystem_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 = IP_OpenDRIM_Gateway2ComputerSystem_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 = IP_OpenDRIM_Gateway2ComputerSystem_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ip-1.1.2~ppa/test/testOpenDRIM_RegisteredIPProtocolProfile.cpp0000644000175000017500000001247711377667034027617 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredIPProtocolProfile.h" #include "OpenDRIM_RegisteredIPProtocolProfileAccess.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_RegisteredIPProtocolProfile& instance) { os << " [OpenDRIM_RegisteredIPProtocolProfile]" << 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_RegisteredIPProtocolProfile]" << endl; return os; } int main() { string errorMessage; int errorCode = IP_OpenDRIM_RegisteredIPProtocolProfile_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = IP_OpenDRIM_RegisteredIPProtocolProfile_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 = IP_OpenDRIM_RegisteredIPProtocolProfile_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 = IP_OpenDRIM_RegisteredIPProtocolProfile_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 = IP_OpenDRIM_RegisteredIPProtocolProfile_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ip-1.1.2~ppa/test/testOpenDRIM_IP2Gateway.cpp0000644000175000017500000001121311377667034024125 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_IP2Gateway.h" #include "OpenDRIM_IP2GatewayAccess.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_IP2Gateway& instance) { os << " [OpenDRIM_IP2Gateway]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); ToString("IsDefault", IsDefault, IsDefault_isNULL); ToStringInt("OrderOfAccess", OrderOfAccess, OrderOfAccess_isNULL); os << " [\\OpenDRIM_IP2Gateway]" << endl; return os; } int main() { string errorMessage; int errorCode = IP_OpenDRIM_IP2Gateway_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = IP_OpenDRIM_IP2Gateway_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 = IP_OpenDRIM_IP2Gateway_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 = IP_OpenDRIM_IP2Gateway_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 = IP_OpenDRIM_IP2Gateway_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ip-1.1.2~ppa/test/testOpenDRIM_IP2ComputerSystem.cpp0000644000175000017500000001114611377667034025534 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_IP2ComputerSystem.h" #include "OpenDRIM_IP2ComputerSystemAccess.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_IP2ComputerSystem& instance) { os << " [OpenDRIM_IP2ComputerSystem]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); os << " [\\OpenDRIM_IP2ComputerSystem]" << endl; return os; } int main() { string errorMessage; int errorCode = IP_OpenDRIM_IP2ComputerSystem_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = IP_OpenDRIM_IP2ComputerSystem_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 = IP_OpenDRIM_IP2ComputerSystem_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 = IP_OpenDRIM_IP2ComputerSystem_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 = IP_OpenDRIM_IP2ComputerSystem_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ip-1.1.2~ppa/test/testOpenDRIM_Gateway.cpp0000644000175000017500000001451311377667034023620 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_Gateway.h" #include "OpenDRIM_GatewayAccess.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_Gateway& instance) { os << " [OpenDRIM_Gateway]" << endl; ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstallDate", InstallDate, InstallDate_isNULL); ToStringArrayInt("OperationalStatus", OperationalStatus, OperationalStatus_isNULL); ToStringArray("StatusDescriptions", StatusDescriptions, StatusDescriptions_isNULL); ToString("Status", Status, Status_isNULL); ToStringInt("HealthState", HealthState, HealthState_isNULL); ToStringInt("PrimaryStatus", PrimaryStatus, PrimaryStatus_isNULL); ToStringInt("DetailedStatus", DetailedStatus, DetailedStatus_isNULL); ToStringInt("OperatingStatus", OperatingStatus, OperatingStatus_isNULL); ToStringInt("CommunicationStatus", CommunicationStatus, CommunicationStatus_isNULL); ToStringInt("EnabledState", EnabledState, EnabledState_isNULL); ToString("OtherEnabledState", OtherEnabledState, OtherEnabledState_isNULL); ToStringInt("RequestedState", RequestedState, RequestedState_isNULL); ToStringInt("EnabledDefault", EnabledDefault, EnabledDefault_isNULL); ToString("TimeOfLastStateChange", TimeOfLastStateChange, TimeOfLastStateChange_isNULL); ToStringArrayInt("AvailableRequestedStates", AvailableRequestedStates, AvailableRequestedStates_isNULL); ToStringInt("TransitioningToState", TransitioningToState, TransitioningToState_isNULL); ToString("SystemCreationClassName", SystemCreationClassName, SystemCreationClassName_isNULL); ToString("SystemName", SystemName, SystemName_isNULL); ToString("CreationClassName", CreationClassName, CreationClassName_isNULL); ToString("Name", Name, Name_isNULL); ToString("AccessInfo", AccessInfo, AccessInfo_isNULL); ToStringInt("InfoFormat", InfoFormat, InfoFormat_isNULL); ToString("OtherInfoFormatDescription", OtherInfoFormatDescription, OtherInfoFormatDescription_isNULL); ToStringInt("AccessContext", AccessContext, AccessContext_isNULL); ToString("OtherAccessContext", OtherAccessContext, OtherAccessContext_isNULL); os << " [\\OpenDRIM_Gateway]" << endl; return os; } int main() { string errorMessage; int errorCode = IP_OpenDRIM_Gateway_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = IP_OpenDRIM_Gateway_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 = IP_OpenDRIM_Gateway_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 = IP_OpenDRIM_Gateway_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 = IP_OpenDRIM_Gateway_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ip-1.1.2~ppa/test/testOpenDRIM_IPProtocolEndpoint.cpp0000644000175000017500000001570211377667034025753 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_IPProtocolEndpoint.h" #include "OpenDRIM_IPProtocolEndpointAccess.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_IPProtocolEndpoint& instance) { os << " [OpenDRIM_IPProtocolEndpoint]" << endl; ToString("Caption", Caption, Caption_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstallDate", InstallDate, InstallDate_isNULL); ToStringArray("StatusDescriptions", StatusDescriptions, StatusDescriptions_isNULL); ToString("Status", Status, Status_isNULL); ToStringInt("HealthState", HealthState, HealthState_isNULL); ToStringInt("PrimaryStatus", PrimaryStatus, PrimaryStatus_isNULL); ToStringInt("DetailedStatus", DetailedStatus, DetailedStatus_isNULL); ToStringInt("OperatingStatus", OperatingStatus, OperatingStatus_isNULL); ToStringInt("CommunicationStatus", CommunicationStatus, CommunicationStatus_isNULL); ToString("OtherEnabledState", OtherEnabledState, OtherEnabledState_isNULL); ToStringInt("RequestedState", RequestedState, RequestedState_isNULL); ToStringInt("EnabledDefault", EnabledDefault, EnabledDefault_isNULL); ToStringArrayInt("AvailableRequestedStates", AvailableRequestedStates, AvailableRequestedStates_isNULL); ToStringInt("TransitioningToState", TransitioningToState, TransitioningToState_isNULL); ToString("SystemCreationClassName", SystemCreationClassName, SystemCreationClassName_isNULL); ToString("SystemName", SystemName, SystemName_isNULL); ToString("CreationClassName", CreationClassName, CreationClassName_isNULL); ToString("Name", Name, Name_isNULL); ToString("Description", Description, Description_isNULL); ToStringArrayInt("OperationalStatus", OperationalStatus, OperationalStatus_isNULL); ToStringInt("EnabledState", EnabledState, EnabledState_isNULL); ToString("TimeOfLastStateChange", TimeOfLastStateChange, TimeOfLastStateChange_isNULL); ToString("NameFormat", NameFormat, NameFormat_isNULL); ToStringInt("ProtocolType", ProtocolType, ProtocolType_isNULL); ToString("OtherTypeDescription", OtherTypeDescription, OtherTypeDescription_isNULL); ToString("BroadcastResetSupported", BroadcastResetSupported, BroadcastResetSupported_isNULL); ToString("IPv4Address", IPv4Address, IPv4Address_isNULL); ToString("IPv6Address", IPv6Address, IPv6Address_isNULL); ToString("Address", Address, Address_isNULL); ToString("SubnetMask", SubnetMask, SubnetMask_isNULL); ToStringInt("PrefixLength", PrefixLength, PrefixLength_isNULL); ToStringInt("AddressType", AddressType, AddressType_isNULL); ToStringInt("IPVersionSupport", IPVersionSupport, IPVersionSupport_isNULL); ToStringInt("ProtocolIFType", ProtocolIFType, ProtocolIFType_isNULL); ToStringInt("AddressOrigin", AddressOrigin, AddressOrigin_isNULL); os << " [\\OpenDRIM_IPProtocolEndpoint]" << endl; return os; } int main() { string errorMessage; int errorCode = IP_OpenDRIM_IPProtocolEndpoint_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = IP_OpenDRIM_IPProtocolEndpoint_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 = IP_OpenDRIM_IPProtocolEndpoint_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 = IP_OpenDRIM_IPProtocolEndpoint_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 = IP_OpenDRIM_IPProtocolEndpoint_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IP2Gateway/0000755000175000017500000000000011377667034021544 5ustar guillaumeguillaumeopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IP2Gateway/OpenDRIM_IP2Gateway.h0000644000175000017500000001004411377667034025265 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_IP2GATEWAY_H_ #define OPENDRIM_IP2GATEWAY_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_RemoteServiceAccessPoint.h" #include "CIM_RemoteServiceAccessPointAccess.h" #include "cmpiCIM_EnabledLogicalElement.h" #include "CIM_EnabledLogicalElementAccess.h" */ const static char* OpenDRIM_IP2Gateway_classnames[] = {"OpenDRIM_IP2Gateway"}; static string OpenDRIM_IP2Gateway_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"OpenDRIM_Gateway"}; const static string Antecedent_NAMESPACE = _NAMESPACE; const static string Dependent_role = "Dependent"; const static char* Dependent_classnames[] = {"OpenDRIM_IPProtocolEndpoint"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_IP2Gateway { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; bool IsDefault; bool IsDefault_isNULL; unsigned short OrderOfAccess; bool OrderOfAccess_isNULL; OpenDRIM_IP2Gateway() { Antecedent_isNULL = true; Dependent_isNULL = true; IsDefault_isNULL = true; OrderOfAccess_isNULL = true; } ~OpenDRIM_IP2Gateway() {} string getKeys() const { return CF_toLowCase(".Antecedent=\"" + CF_quoteString(Antecedent.toString()) + "\""".Dependent=\"" + CF_quoteString(Dependent.toString()) + "\""); } int getAntecedent(Objectpath& value) const { if (Antecedent_isNULL==true) return NOT_FOUND; value = Antecedent; return OK; } int setAntecedent(const Objectpath& newValue) { Antecedent = newValue; Antecedent.setNamespace(Antecedent_NAMESPACE); Antecedent_isNULL = false; return OK; } int getDependent(Objectpath& value) const { if (Dependent_isNULL==true) return NOT_FOUND; value = Dependent; return OK; } int setDependent(const Objectpath& newValue) { Dependent = newValue; Dependent.setNamespace(Dependent_NAMESPACE); Dependent_isNULL = false; return OK; } int getIsDefault(bool& value) const { if (IsDefault_isNULL==true) return NOT_FOUND; value = IsDefault; return OK; } int setIsDefault(const bool& newValue) { IsDefault = newValue; IsDefault_isNULL = false; return OK; } int getOrderOfAccess(unsigned short& value) const { if (OrderOfAccess_isNULL==true) return NOT_FOUND; value = OrderOfAccess; return OK; } int setOrderOfAccess(const unsigned short& newValue) { OrderOfAccess = newValue; OrderOfAccess_isNULL = false; return OK; } }; #endif /*OPENDRIM_IP2GATEWAY_H_*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IP2Gateway/Makefile.am0000644000175000017500000000460711377667034023607 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiIP_OpenDRIM_IP2GatewayProvider.la libcmpiIP_OpenDRIM_IP2GatewayProvider_la_SOURCES = OpenDRIM_IP2GatewayAccess.cpp OpenDRIM_IP2GatewayProvider.cpp cmpiOpenDRIM_IP2Gateway.cpp assocOpenDRIM_IP2Gateway.cpp # May have to be adjusted for direct invocation libcmpiIP_OpenDRIM_IP2GatewayProvider_la_CPPFLAGS = -I../CIM_RemoteServiceAccessPoint -I../CIM_EnabledLogicalElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiIP_OpenDRIM_IP2GatewayProvider_la_LIBADD = ../Common/libcmpiIP_Common.la #../CIM_RemoteServiceAccessPoint/libcmpiIP_CIM_RemoteServiceAccessPointProvider.la ../CIM_EnabledLogicalElement/libcmpiIP_CIM_EnabledLogicalElementProvider.la libcmpiIP_OpenDRIM_IP2GatewayProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_IP2Gateway.h OpenDRIM_IP2Gateway.h OpenDRIM_IP2GatewayAccess.h opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IP2Gateway/assocOpenDRIM_IP2Gateway.h0000644000175000017500000000603611377667034026324 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_IP2GATEWAY_H_ #define ASSOCOPENDRIM_IP2GATEWAY_H_ #include "OpenDRIM_IP2GatewayAccess.h" int IP_OpenDRIM_IP2Gateway_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 IP_OpenDRIM_IP2Gateway_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 IP_OpenDRIM_IP2Gateway_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int IP_OpenDRIM_IP2Gateway_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int IP_OpenDRIM_IP2Gateway_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int IP_OpenDRIM_IP2Gateway_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_IP2GATEWAY_H_*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IP2Gateway/OpenDRIM_IP2GatewayProvider.cpp0000644000175000017500000003766311377667034027353 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_IP2Gateway.h" #include "OpenDRIM_IP2GatewayAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define IP_OpenDRIM_IP2GatewayProviderSetInstance IP_OpenDRIM_IP2GatewayProviderModifyInstance #endif int IP_OpenDRIM_IP2Gateway_init(const CMPIBroker* broker); int IP_OpenDRIM_IP2Gateway_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus IP_OpenDRIM_IP2GatewayProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = IP_OpenDRIM_IP2Gateway_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus IP_OpenDRIM_IP2GatewayProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = IP_OpenDRIM_IP2Gateway_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = IP_OpenDRIM_IP2Gateway_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IP2GatewayProviderEnumInstances(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 = IP_OpenDRIM_IP2Gateway_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = IP_OpenDRIM_IP2Gateway_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IP2GatewayProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_IP2Gateway instance; IP_OpenDRIM_IP2Gateway_toCPP(_broker, cop, instance); string errorMessage; int errorCode = IP_OpenDRIM_IP2Gateway_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = IP_OpenDRIM_IP2Gateway_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IP2GatewayProviderSetInstance(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_IP2Gateway newInstance, oldInstance; IP_OpenDRIM_IP2Gateway_toCPP(_broker, ci, newInstance); IP_OpenDRIM_IP2Gateway_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = IP_OpenDRIM_IP2Gateway_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_IP2Gateway_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IP2GatewayProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_IP2Gateway instance; IP_OpenDRIM_IP2Gateway_toCPP(_broker, ci, instance); string errorMessage; int errorCode = IP_OpenDRIM_IP2Gateway_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_IP2Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_IP2Gateway_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_IP2Gateway_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = IP_OpenDRIM_IP2Gateway_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IP2GatewayProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_IP2Gateway instance; IP_OpenDRIM_IP2Gateway_toCPP(_broker, cop, instance); string errorMessage; int errorCode = IP_OpenDRIM_IP2Gateway_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_IP2Gateway_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IP2GatewayProviderExecQuery(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 IP_OpenDRIM_IP2GatewayProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = IP_OpenDRIM_IP2Gateway_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus IP_OpenDRIM_IP2GatewayProviderAssociatorNames(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 = IP_OpenDRIM_IP2Gateway_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2Gateway_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 IP_OpenDRIM_IP2GatewayProviderAssociators(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 = IP_OpenDRIM_IP2Gateway_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2Gateway_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 IP_OpenDRIM_IP2GatewayProviderReferenceNames(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 = IP_OpenDRIM_IP2Gateway_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = IP_OpenDRIM_IP2Gateway_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = IP_OpenDRIM_IP2Gateway_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = IP_OpenDRIM_IP2Gateway_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus IP_OpenDRIM_IP2GatewayProviderReferences(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 = IP_OpenDRIM_IP2Gateway_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = IP_OpenDRIM_IP2Gateway_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = IP_OpenDRIM_IP2Gateway_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = IP_OpenDRIM_IP2Gateway_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int IP_OpenDRIM_IP2Gateway_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = IP_OpenDRIM_IP2Gateway_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "IP_OpenDRIM_IP2Gateway_init FAILED: " + (string) OpenDRIM_IP2Gateway_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int IP_OpenDRIM_IP2Gateway_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = IP_OpenDRIM_IP2Gateway_unload(errorMessage); if (errorCode != OK) { errorMessage += "IP_OpenDRIM_IP2Gateway_unload FAILED: " + (string) OpenDRIM_IP2Gateway_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define IP_OpenDRIM_IP2Gateway_INIT if (IP_OpenDRIM_IP2Gateway_init(_broker) < 0) return NULL CMInstanceMIStub(IP_OpenDRIM_IP2GatewayProvider, IP_OpenDRIM_IP2GatewayProvider, _broker, IP_OpenDRIM_IP2Gateway_INIT); CMAssociationMIStub(IP_OpenDRIM_IP2GatewayProvider, IP_OpenDRIM_IP2GatewayProvider, _broker, IP_OpenDRIM_IP2Gateway_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IP2Gateway/cmpiOpenDRIM_IP2Gateway.h0000644000175000017500000000416211377667034026142 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_IP2GATEWAY_H_ #define CMPIOPENDRIM_IP2GATEWAY_H_ #include "OpenDRIM_IP2Gateway.h" CMPIObjectPath* IP_OpenDRIM_IP2Gateway_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_IP2Gateway& instance); CMPIInstance* IP_OpenDRIM_IP2Gateway_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_IP2Gateway& instance); void IP_OpenDRIM_IP2Gateway_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_IP2Gateway& instance); void IP_OpenDRIM_IP2Gateway_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_IP2Gateway& instance); #endif /*CMPIOPENDRIM_IP2GATEWAY_H_*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IP2Gateway/OpenDRIM_IP2GatewayAccess.cpp0000644000175000017500000002457511377667034026760 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_IP2GatewayAccess.h" int IP_OpenDRIM_IP2Gateway_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(IP_CIM_RemoteServiceAccessPoint_load(broker, errorMessage)); CF_assert(IP_CIM_EnabledLogicalElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int IP_OpenDRIM_IP2Gateway_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(IP_CIM_RemoteServiceAccessPoint_unload(errorMessage)); CF_assert(IP_CIM_EnabledLogicalElement_unload(errorMessage)); */ // TODO _L_; return OK; } int IP_OpenDRIM_IP2Gateway_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; string gateway_systemName; CF_assert(Antecedent.getProperty("SystemName", gateway_systemName)); string IP_systemName; CF_assert(Dependent.getProperty("SystemName", IP_systemName)); string gateway_name; CF_assert(Antecedent.getProperty("Name", gateway_name)); string IP_name; CF_assert(Dependent.getProperty("Name", IP_name)); if(gateway_systemName==IP_systemName && IP_name==gateway_name) isAssociated=true; else isAssociated=false; _L_; return OK; } int IP_OpenDRIM_IP2Gateway_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(IP_OpenDRIM_IP2Gateway_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(IP_OpenDRIM_IP2Gateway_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; IP_OpenDRIM_IP2Gateway_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(IP_OpenDRIM_IP2Gateway_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int IP_OpenDRIM_IP2Gateway_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_IP2Gateway& 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(IP_OpenDRIM_IP2Gateway_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(IP_OpenDRIM_IP2Gateway_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(IP_OpenDRIM_IP2Gateway_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } CF_assert(IP_OpenDRIM_IP2Gateway_populate(instance, errorMessage)); _L_; return OK; } int IP_OpenDRIM_IP2Gateway_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IP2Gateway& newInstance, const OpenDRIM_IP2Gateway& oldInstance, const char** properties, string& errorMessage) { _E_; _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_IP2Gateway_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IP2Gateway& instance, string& errorMessage) { _E_; _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_IP2Gateway_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IP2Gateway& instance, string& errorMessage) { _E_; _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_IP2Gateway_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(IP_OpenDRIM_IP2Gateway_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(IP_OpenDRIM_IP2Gateway_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(IP_OpenDRIM_IP2Gateway_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(IP_OpenDRIM_IP2Gateway_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(IP_OpenDRIM_IP2Gateway_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(IP_OpenDRIM_IP2Gateway_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_IP2Gateway_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_IP2Gateway instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); if (discriminant == "r") { CF_assert(IP_OpenDRIM_IP2Gateway_populate(instance, errorMessage)); } OpenDRIM_IP2Gateway_instances.push_back(instance); } _L_; return OK; } int IP_OpenDRIM_IP2Gateway_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_IP2Gateway_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_IP2Gateway instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); if (discriminant == "r") { CF_assert(IP_OpenDRIM_IP2Gateway_populate(instance, errorMessage)); } OpenDRIM_IP2Gateway_instances.push_back(instance); } _L_; return OK; } int IP_OpenDRIM_IP2Gateway_populate(OpenDRIM_IP2Gateway& instance, string& errorMessage) { _E_; // Set to default value // as we are in IPv4 we should set this property to 0 (see DMTF profile) instance.setOrderOfAccess(0); _L_; return OK; } opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IP2Gateway/OpenDRIM_IP2GatewayAccess.h0000644000175000017500000000775711377667034026430 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_IP2GATEWAYACCESS_H_ #define OPENDRIM_IP2GATEWAYACCESS_H_ #include "IP_Common.h" #include "OpenDRIM_IP2Gateway.h" #include "assocOpenDRIM_IP2Gateway.h" int IP_OpenDRIM_IP2Gateway_load(const CMPIBroker* broker, string& errorMessage); int IP_OpenDRIM_IP2Gateway_unload(string& errorMessage); int IP_OpenDRIM_IP2Gateway_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int IP_OpenDRIM_IP2Gateway_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_IP2Gateway& instance, const char** properties, string& errorMessage); int IP_OpenDRIM_IP2Gateway_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IP2Gateway& newInstance, const OpenDRIM_IP2Gateway& oldInstance, const char** properties, string& errorMessage); int IP_OpenDRIM_IP2Gateway_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IP2Gateway& instance, string& errorMessage); int IP_OpenDRIM_IP2Gateway_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IP2Gateway& instance, string& errorMessage); int IP_OpenDRIM_IP2Gateway_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int IP_OpenDRIM_IP2Gateway_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int IP_OpenDRIM_IP2Gateway_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_IP2Gateway_instances, const char** properties, string& errorMessage, const string& discriminant); int IP_OpenDRIM_IP2Gateway_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_IP2Gateway_instances, const char** properties, string& errorMessage, const string& discriminant); int IP_OpenDRIM_IP2Gateway_populate(OpenDRIM_IP2Gateway& instance, string& errorMessage); #endif /*OPENDRIM_IP2GATEWAYACCESS_H_*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IP2Gateway/assocOpenDRIM_IP2Gateway.cpp0000644000175000017500000002062311377667034026655 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_IP2Gateway.h" int IP_OpenDRIM_IP2Gateway_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 = IP_OpenDRIM_IP2Gateway_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(IP_OpenDRIM_IP2Gateway_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(IP_OpenDRIM_IP2Gateway_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int IP_OpenDRIM_IP2Gateway_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(IP_CIM_RemoteServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(IP_CIM_RemoteServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, IP_CIM_RemoteServiceAccessPoint_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int IP_OpenDRIM_IP2Gateway_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Antecedent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Antecedent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_RemoteServiceAccessPoint _instance; IP_CIM_RemoteServiceAccessPoint_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(IP_CIM_RemoteServiceAccessPoint_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, IP_CIM_RemoteServiceAccessPoint_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int IP_OpenDRIM_IP2Gateway_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(IP_CIM_EnabledLogicalElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(IP_CIM_EnabledLogicalElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, IP_CIM_EnabledLogicalElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int IP_OpenDRIM_IP2Gateway_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Dependent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Dependent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_EnabledLogicalElement _instance; IP_CIM_EnabledLogicalElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(IP_CIM_EnabledLogicalElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, IP_CIM_EnabledLogicalElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IP2Gateway/cmpiOpenDRIM_IP2Gateway.cpp0000644000175000017500000000651111377667034026475 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_IP2Gateway.h" CMPIObjectPath* IP_OpenDRIM_IP2Gateway_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_IP2Gateway& instance) { _E_; Objectpath op(broker, OpenDRIM_IP2Gateway_classnames[0], OpenDRIM_IP2Gateway_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* IP_OpenDRIM_IP2Gateway_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_IP2Gateway& instance) { _E_; Objectpath op(broker, IP_OpenDRIM_IP2Gateway_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.IsDefault_isNULL) ci.setProperty("IsDefault", instance.IsDefault); if (!instance.OrderOfAccess_isNULL) ci.setProperty("OrderOfAccess", instance.OrderOfAccess); _L_; return ci.getHdl(); } void IP_OpenDRIM_IP2Gateway_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_IP2Gateway& 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 IP_OpenDRIM_IP2Gateway_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_IP2Gateway& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Antecedent", instance.Antecedent) == OK) instance.Antecedent_isNULL = false; if (inst.getProperty("Dependent", instance.Dependent) == OK) instance.Dependent_isNULL = false; if (inst.getProperty("IsDefault", instance.IsDefault) == OK) instance.IsDefault_isNULL = false; if (inst.getProperty("OrderOfAccess", instance.OrderOfAccess) == OK) instance.OrderOfAccess_isNULL = false; _L_; } opendrim-lmp-ip-1.1.2~ppa/acinclude.m40000644000175000017500000002107611377667034020372 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX ################################################################################ AC_DEFUN([SHOW_COPYRIGHT], [ echo "################################################################################# # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public 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-ip-1.1.2~ppa/Common/0000755000175000017500000000000011377667034017423 5ustar guillaumeguillaumeopendrim-lmp-ip-1.1.2~ppa/Common/IP_Common.h0000644000175000017500000000520311377667034021414 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef IP_COMMON_H_ #define IP_COMMON_H_ #include // Define EnabledState Constants #define ES_UNKNOWN 0 #define ES_ENABLE 2 #define ES_DISABLE 3 #define ES_NOT_APPLICABLE 5 #define ES_ENABLED_OFFLINE 6 // Define RequestedState Constants #define RS_UNKNOWN 0 #define RS_NO_CHANGE 5 #define RS_NOT_APPLICABLE 12 // Define EnabledDefault Constants #define ED_ENABLE 2 #define ED_DISABLE 3 // Define AddressOrigin Constants #define AO_UNKNOWN 0 #define AO_STATIC 3 #define AO_DHCP 4 #define AO_BOOTP 5 // Define ProtocolIFType Constants #define IFTYPE_IPv4 4096 static const string DEVICE_BASE_PATH = "/etc/sysconfig/network-scripts/"; static const string DEBIAN_DEVICE_FILE = "/etc/network/interfaces"; // int CF_getGatewayByInterface(vector& gateway,vector& interface,string& errorMessage); // int CF_getIfEnabledState(const string& ifName, unsigned int& enabledState ,string& errorMessage); // int CF_getSubNetMask(const string& ethName, string& mask, string& errorMessage); // int CF_getDefaultGateway(const string& ethName, string& gateway, string& errorMessage); #endif /*IP_COMMON_H_*/ opendrim-lmp-ip-1.1.2~ppa/Common/Makefile.am0000644000175000017500000000336211377667034021463 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ################################################################################ commonlibdir = @COMMONLIBDIR@ commonlib_LTLIBRARIES = libcmpiIP_Common.la libcmpiIP_Common_la_SOURCES = IP_Common.cpp libcmpiIP_Common_la_LDFLAGS = -avoid-version libcmpiIP_Common_la_LIBADD = -lopendrim noinst_HEADERS = IP_Common.h opendrim-lmp-ip-1.1.2~ppa/Common/IP_Common.cpp0000644000175000017500000001043411377667034021751 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "IP_Common.h" int CF_getGatewayByInterface(vector& gateway,vector& interface,string& errorMessage) { vector lines; CF_assert(CF_runCommandToLines("route -n | grep UG",lines,0,errorMessage)); gateway.clear(); interface.clear(); for(unsigned int i=0;i elements; CF_splitTextBySpace(elements,lines[i]); if(elements.size()==8) { gateway.push_back(elements[1]); interface.push_back(elements[7]); } } return OK; } int CF_getIfEnabledState(const string& ifName, unsigned int& enabledState ,string& errorMessage) { string value; string stderr; CF_assert( CF_runCommand("/sbin/ifconfig " + ifName, value, stderr, errorMessage)); if(value.find("UP")!=string::npos) { if(value.find("RUNNING")!=string::npos) enabledState=ES_ENABLE; else enabledState=ES_ENABLED_OFFLINE; } else enabledState=ES_DISABLE; return OK; } int CF_getSubNetMask(const string& ethName, string& mask, string& errorMessage) { string value; CF_assert( CF_runCommandFL("ifconfig "+ethName+" | awk '/HWaddr/{} /inet addr/{print $4}'", value, errorMessage) ); mask = CF_trimText(value); if ( CF_startsWithNoCase(mask, "Mask:") ) mask = mask.substr(5); return OK; } int CF_getDefaultGateway(const string& ethName, string& gateway, string& errorMessage) { string std_out; string std_err; CF_assert(CF_runCommand("route -n | grep UG | grep "+ethName+" | awk '{print $2}'", std_out, std_err, errorMessage)); if(std_out!="") { gateway=std_out.substr(0, std_out.size()-1); return OK; } ifstream ifs; string device_path; string line; if (!CF_isExist(DEVICE_BASE_PATH)) { device_path = DEBIAN_DEVICE_FILE; ifs.open(device_path.c_str(), ifstream::in); if(!ifs) { errorMessage = "Cannot open file: "+device_path; return FAILED; } while (getline(ifs, line)) { vector tokens; CF_splitText(tokens,line," "); if(tokens.size()>1 && tokens[1]==ethName && tokens[0]=="iface") { while(line!="") { getline(ifs, line); line=CF_trimText(line); CF_splitText(tokens,line," "); if(tokens[0]=="gateway") { gateway=tokens[1]; ifs.close(); return OK; } } } } ifs.close(); } else { device_path = DEVICE_BASE_PATH+"ifcfg-"+ethName; ifs.open(device_path.c_str(), ifstream::in); if(!ifs) { errorMessage = "Cannot open file: "+device_path; return OK; } while (getline(ifs, line)) { int idx = line.find_first_of('='); string name = CF_trimText(line.substr(0, idx)); string value = CF_trimText(line.substr(idx+1)); if (name == "GATEWAY") { gateway=value; ifs.close(); return OK; } } ifs.close(); } gateway="0.0.0.0"; return OK; } opendrim-lmp-ip-1.1.2~ppa/configure.ac0000644000175000017500000001245411377667034020467 0ustar guillaumeguillaume# Process this file with autoconf to produce a configure script. ################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 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), IP provider package Copyright (C) 2007 Ilsoo Byun This program is being developed under the "OpenDRIM" project. The "OpenDRIM" project web page: http://opendrim.sourceforge.net The "OpenDRIM" project mailing list: opendrim@googlegroups.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public 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(IP 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_IP2ComputerSystem/Makefile OpenDRIM_IPProtocolConformsToProfile/Makefile OpenDRIM_IP2Gateway/Makefile OpenDRIM_Gateway2ComputerSystem/Makefile OpenDRIM_IPProtocolEndpoint/Makefile OpenDRIM_RegisteredIPProtocolProfile/Makefile OpenDRIM_Gateway/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-ip-1.1.2~ppa/OpenDRIM_IPProtocolEndpoint/0000755000175000017500000000000011377667034023363 5ustar guillaumeguillaumeopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolEndpoint/OpenDRIM_IPProtocolEndpointAccess.cpp0000644000175000017500000002232611377667034032406 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_IPProtocolEndpointAccess.h" #include "Common/IP_Common.h" static const string systemCreationClassName = "OpenDRIM_ComputerSystem"; static const string creationClassName = "OpenDRIM_IPProtocolEndpoint"; static string systemName; int IP_OpenDRIM_IPProtocolEndpoint_load(const CMPIBroker* broker, string& errorMessage) { _E_; CF_assert(CF_getSystemName(systemName, errorMessage)); _L_; return OK; } int IP_OpenDRIM_IPProtocolEndpoint_unload(string& errorMessage) { _E_; // Nothing _L_; return OK; } int IP_OpenDRIM_IPProtocolEndpoint_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; vector eth_names; CF_assert(CF_getEthernetPortNames(eth_names, errorMessage)); //Initialize an instance OpenDRIM_IPProtocolEndpoint instance; instance.setSystemCreationClassName(systemCreationClassName); instance.setSystemName(systemName); instance.setCreationClassName(creationClassName); for(unsigned int i=0;i if_names; vector::size_type index; CF_assert(CF_getEthernetPortNames(if_names, errorMessage)); if (instance.SystemCreationClassName == systemCreationClassName && instance.CreationClassName == creationClassName && instance.SystemName == systemName && CF_foundInList(instance.Name,if_names,index)) { CF_assert(IP_OpenDRIM_IPProtocolEndpoint_populate(instance, errorMessage)); } else { errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int IP_OpenDRIM_IPProtocolEndpoint_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IPProtocolEndpoint& newInstance, const OpenDRIM_IPProtocolEndpoint& oldInstance, const char** properties, string& errorMessage) { _E_; _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_IPProtocolEndpoint_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IPProtocolEndpoint& instance, string& errorMessage) { _E_; _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_IPProtocolEndpoint_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IPProtocolEndpoint& instance, string& errorMessage) { _E_; _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_IPProtocolEndpoint_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IPProtocolEndpoint& instance, unsigned int& returnValue, const OpenDRIM_IPProtocolEndpoint_RequestStateChange_In& in, OpenDRIM_IPProtocolEndpoint_RequestStateChange_Out& out, string& errorMessage) { _E_; _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_IPProtocolEndpoint_BroadcastReset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IPProtocolEndpoint& instance, unsigned int& returnValue, string& errorMessage) { _E_; _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_IPProtocolEndpoint_populate(OpenDRIM_IPProtocolEndpoint& instance, string& errorMessage) { _E_; /* * Properties to fill from profile * + Mandatory: * [X] SystemCreationClassName [KEY] * [X] CreationClassName [KEY] * [X] SystemName [KEY] * [X] Name [KEY] * [X] NameFormat * [X] ProtocolIFType * [X] RequestedState * [X] EnabledState * [X] ElementName * [X] AddressOrigin * + Conditional: * [X] IPv4Address * [X] SubnetMask * + Other: * [X] TimeOfLastStateChange * [X] EnabledDefault */ ifstream ifs; string ip; string subnetmask; unsigned int enabledState; instance.setNameFormat("network-interface-name"); instance.setProtocolIFType(IFTYPE_IPv4); instance.setRequestedState(RS_NOT_APPLICABLE); if(instance.ProtocolIFType==IFTYPE_IPv4) instance.setElementName(instance.Name+" IPv4 Protocol Endpoint"); string ifconfig_str, temp; CF_assert(CF_runCommand("/sbin/ifconfig "+instance.Name, ifconfig_str, temp, errorMessage)); vector ifconfig_parsed; CF_splitText(ifconfig_parsed, ifconfig_str, '\n'); CF_getIfEnabledState(instance.Name,enabledState ,errorMessage); instance.setEnabledState(enabledState); // EnabledDefault // From DMTF Schema: By default, the element is "Enabled" instance.setEnabledDefault(ED_ENABLE); // AddressOrigin // set to default value instance.setAddressOrigin(AO_UNKNOWN); CF_getIP(instance.Name,ip,errorMessage); if(ip!="") instance.setIPv4Address(ip); CF_getSubNetMask(instance.Name,subnetmask,errorMessage); if(subnetmask!="") instance.setSubnetMask(subnetmask); string device_path; string line; if (!CF_isExist(DEVICE_BASE_PATH)) { device_path = DEBIAN_DEVICE_FILE; ifs.open(device_path.c_str(), ifstream::in); if(!ifs) { errorMessage = "Cannot open file: "+device_path; return FAILED; } bool foundAuto=false; while (getline(ifs, line)) { vector tokens; CF_splitText(tokens,line," "); if(tokens.size()>1 && tokens[1]==instance.Name && tokens[0]=="iface") { if(tokens[3]=="static") instance.setAddressOrigin(AO_STATIC); else if(tokens[3]=="dhcp") instance.setAddressOrigin(AO_DHCP); if(ip=="" || subnetmask=="") { while(line!="") { getline(ifs, line); line=CF_trimText(line); CF_splitText(tokens,line," "); if(tokens[0]=="address" && ip=="") instance.setIPv4Address(tokens[1]); else if(tokens[0]=="netmask" && subnetmask=="") instance.setSubnetMask(tokens[1]); } } } else if(tokens.size()>1 && tokens[1]==instance.Name && tokens[0]=="auto") { instance.setEnabledDefault(ED_ENABLE); foundAuto=true; } } ifs.close(); if(!foundAuto) instance.setEnabledDefault(ED_DISABLE); } else { device_path = DEVICE_BASE_PATH+"ifcfg-"+instance.Name; ifs.open(device_path.c_str(), ifstream::in); if(!ifs) { errorMessage = "Cannot open file: "+device_path; return OK; } bool foundBootProto=false; while (getline(ifs, line)) { int idx = line.find_first_of('='); string name = CF_trimText(line.substr(0, idx)); string value = CF_trimText(line.substr(idx+1)); if (name == "BOOTPROTO" && !foundBootProto) // AddressOrigin { if (value == "none" || value == "static") instance.setAddressOrigin(AO_STATIC); else if (value == "dhcp") instance.setAddressOrigin(AO_DHCP); else if (value == "bootp") instance.setAddressOrigin(AO_BOOTP); else instance.setAddressOrigin(AO_UNKNOWN); foundBootProto=true; } else if (name == "ONBOOT") // EnabledDefault { if (value == "yes") instance.setEnabledDefault(ED_ENABLE); else instance.setEnabledDefault(ED_DISABLE); } } if(!foundBootProto) instance.setAddressOrigin(AO_STATIC); ifs.clear(); ifs.seekg (0, ios::beg); while (getline(ifs, line)) { int idx = line.find_first_of('='); string name = CF_trimText(line.substr(0, idx)); string value = CF_trimText(line.substr(idx+1)); if(ip=="" && instance.AddressOrigin==AO_STATIC) { if (name == "IPADDR") instance.setIPv4Address(value); } if(subnetmask=="" && instance.AddressOrigin==AO_STATIC) { if (name == "NETMASK") instance.setSubnetMask(value); } } ifs.close(); } //TimeOfLastStateChange string modifiedTime; CF_assert(CF_lastModified(device_path, modifiedTime, errorMessage)); instance.setTimeOfLastStateChange(modifiedTime); _L_; return OK; } opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolEndpoint/Makefile.am0000644000175000017500000000406211377667034025421 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiIP_OpenDRIM_IPProtocolEndpointProvider.la libcmpiIP_OpenDRIM_IPProtocolEndpointProvider_la_SOURCES = OpenDRIM_IPProtocolEndpointAccess.cpp OpenDRIM_IPProtocolEndpointProvider.cpp cmpiOpenDRIM_IPProtocolEndpoint.cpp libcmpiIP_OpenDRIM_IPProtocolEndpointProvider_la_LIBADD = ../Common/libcmpiIP_Common.la libcmpiIP_OpenDRIM_IPProtocolEndpointProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_IPProtocolEndpoint.h OpenDRIM_IPProtocolEndpoint.h OpenDRIM_IPProtocolEndpointAccess.h opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolEndpoint/cmpiOpenDRIM_IPProtocolEndpoint.h0000644000175000017500000000477611377667034031613 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_IPPROTOCOLENDPOINT_H_ #define CMPIOPENDRIM_IPPROTOCOLENDPOINT_H_ #include "OpenDRIM_IPProtocolEndpoint.h" CMPIObjectPath* IP_OpenDRIM_IPProtocolEndpoint_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_IPProtocolEndpoint& instance); CMPIInstance* IP_OpenDRIM_IPProtocolEndpoint_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_IPProtocolEndpoint& instance); void IP_OpenDRIM_IPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_IPProtocolEndpoint& instance); void IP_OpenDRIM_IPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_IPProtocolEndpoint& instance); void IP_OpenDRIM_IPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_IPProtocolEndpoint_RequestStateChange_In& args); void IP_OpenDRIM_IPProtocolEndpoint_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_IPProtocolEndpoint_RequestStateChange_Out& args); #endif /*CMPIOPENDRIM_IPPROTOCOLENDPOINT_H_*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolEndpoint/OpenDRIM_IPProtocolEndpointProvider.cpp0000644000175000017500000003366311377667034033005 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_IPProtocolEndpoint.h" #include "OpenDRIM_IPProtocolEndpointAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define IP_OpenDRIM_IPProtocolEndpointProviderSetInstance IP_OpenDRIM_IPProtocolEndpointProviderModifyInstance #endif int IP_OpenDRIM_IPProtocolEndpoint_init(const CMPIBroker* broker); int IP_OpenDRIM_IPProtocolEndpoint_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus IP_OpenDRIM_IPProtocolEndpointProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = IP_OpenDRIM_IPProtocolEndpoint_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus IP_OpenDRIM_IPProtocolEndpointProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = IP_OpenDRIM_IPProtocolEndpoint_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = IP_OpenDRIM_IPProtocolEndpoint_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IPProtocolEndpointProviderEnumInstances(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 = IP_OpenDRIM_IPProtocolEndpoint_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = IP_OpenDRIM_IPProtocolEndpoint_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IPProtocolEndpointProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_IPProtocolEndpoint instance; IP_OpenDRIM_IPProtocolEndpoint_toCPP(_broker, cop, instance); string errorMessage; int errorCode = IP_OpenDRIM_IPProtocolEndpoint_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = IP_OpenDRIM_IPProtocolEndpoint_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IPProtocolEndpointProviderSetInstance(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_IPProtocolEndpoint newInstance, oldInstance; IP_OpenDRIM_IPProtocolEndpoint_toCPP(_broker, ci, newInstance); IP_OpenDRIM_IPProtocolEndpoint_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = IP_OpenDRIM_IPProtocolEndpoint_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_IPProtocolEndpoint_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IPProtocolEndpointProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_IPProtocolEndpoint instance; IP_OpenDRIM_IPProtocolEndpoint_toCPP(_broker, ci, instance); string errorMessage; int errorCode = IP_OpenDRIM_IPProtocolEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_IPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_IPProtocolEndpoint_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_IPProtocolEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = IP_OpenDRIM_IPProtocolEndpoint_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IPProtocolEndpointProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_IPProtocolEndpoint instance; IP_OpenDRIM_IPProtocolEndpoint_toCPP(_broker, cop, instance); string errorMessage; int errorCode = IP_OpenDRIM_IPProtocolEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_IPProtocolEndpoint_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IPProtocolEndpointProviderExecQuery(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 IP_OpenDRIM_IPProtocolEndpointProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = IP_OpenDRIM_IPProtocolEndpoint_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus IP_OpenDRIM_IPProtocolEndpointProviderInvokeMethod(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_IPProtocolEndpoint instance; IP_OpenDRIM_IPProtocolEndpoint_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"SystemCreationClassName", "Name", "SystemName", "CreationClassName"}; int errorCode = IP_OpenDRIM_IPProtocolEndpoint_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_IPProtocolEndpoint_RequestStateChange_In inArgs; IP_OpenDRIM_IPProtocolEndpoint_toCPP(_broker, in, inArgs); OpenDRIM_IPProtocolEndpoint_RequestStateChange_Out outArgs; errorCode = IP_OpenDRIM_IPProtocolEndpoint_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } IP_OpenDRIM_IPProtocolEndpoint_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="BroadcastReset") { unsigned int returnValue; errorCode = IP_OpenDRIM_IPProtocolEndpoint_BroadcastReset(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolEndpoint_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_IPProtocolEndpoint_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 IP_OpenDRIM_IPProtocolEndpoint_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = IP_OpenDRIM_IPProtocolEndpoint_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "IP_OpenDRIM_IPProtocolEndpoint_init FAILED: " + (string) OpenDRIM_IPProtocolEndpoint_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int IP_OpenDRIM_IPProtocolEndpoint_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = IP_OpenDRIM_IPProtocolEndpoint_unload(errorMessage); if (errorCode != OK) { errorMessage += "IP_OpenDRIM_IPProtocolEndpoint_unload FAILED: " + (string) OpenDRIM_IPProtocolEndpoint_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define IP_OpenDRIM_IPProtocolEndpoint_INIT if (IP_OpenDRIM_IPProtocolEndpoint_init(_broker) < 0) return NULL CMInstanceMIStub(IP_OpenDRIM_IPProtocolEndpointProvider, IP_OpenDRIM_IPProtocolEndpointProvider, _broker, IP_OpenDRIM_IPProtocolEndpoint_INIT); CMMethodMIStub(IP_OpenDRIM_IPProtocolEndpointProvider, IP_OpenDRIM_IPProtocolEndpointProvider, _broker, IP_OpenDRIM_IPProtocolEndpoint_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolEndpoint/OpenDRIM_IPProtocolEndpointAccess.h0000644000175000017500000000666511377667034032063 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_IPPROTOCOLENDPOINTACCESS_H_ #define OPENDRIM_IPPROTOCOLENDPOINTACCESS_H_ #include "IP_Common.h" #include "OpenDRIM_IPProtocolEndpoint.h" int IP_OpenDRIM_IPProtocolEndpoint_load(const CMPIBroker* broker, string& errorMessage); int IP_OpenDRIM_IPProtocolEndpoint_unload(string& errorMessage); int IP_OpenDRIM_IPProtocolEndpoint_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int IP_OpenDRIM_IPProtocolEndpoint_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_IPProtocolEndpoint& instance, const char** properties, string& errorMessage); int IP_OpenDRIM_IPProtocolEndpoint_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IPProtocolEndpoint& newInstance, const OpenDRIM_IPProtocolEndpoint& oldInstance, const char** properties, string& errorMessage); int IP_OpenDRIM_IPProtocolEndpoint_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IPProtocolEndpoint& instance, string& errorMessage); int IP_OpenDRIM_IPProtocolEndpoint_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IPProtocolEndpoint& instance, string& errorMessage); int IP_OpenDRIM_IPProtocolEndpoint_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IPProtocolEndpoint& instance, unsigned int& returnValue, const OpenDRIM_IPProtocolEndpoint_RequestStateChange_In& in, OpenDRIM_IPProtocolEndpoint_RequestStateChange_Out& out, string& errorMessage); int IP_OpenDRIM_IPProtocolEndpoint_BroadcastReset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IPProtocolEndpoint& instance, unsigned int& returnValue, string& errorMessage); int IP_OpenDRIM_IPProtocolEndpoint_populate(OpenDRIM_IPProtocolEndpoint& instance, string& errorMessage); #endif /*OPENDRIM_IPPROTOCOLENDPOINTACCESS_H_*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolEndpoint/cmpiOpenDRIM_IPProtocolEndpoint.cpp0000644000175000017500000002675011377667034032142 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_IPProtocolEndpoint.h" CMPIObjectPath* IP_OpenDRIM_IPProtocolEndpoint_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_IPProtocolEndpoint& instance) { _E_; Objectpath op(broker, OpenDRIM_IPProtocolEndpoint_classnames[0], OpenDRIM_IPProtocolEndpoint_NAMESPACE); if (!instance.SystemCreationClassName_isNULL) op.addKey("SystemCreationClassName", instance.SystemCreationClassName); if (!instance.SystemName_isNULL) op.addKey("SystemName", instance.SystemName); if (!instance.CreationClassName_isNULL) op.addKey("CreationClassName", instance.CreationClassName); if (!instance.Name_isNULL) op.addKey("Name", instance.Name); _L_; return op.getHdl(); } CMPIInstance* IP_OpenDRIM_IPProtocolEndpoint_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_IPProtocolEndpoint& instance) { _E_; Objectpath op(broker, IP_OpenDRIM_IPProtocolEndpoint_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.InstallDate_isNULL) ci.setPropertyDatetime("InstallDate", instance.InstallDate); if (!instance.StatusDescriptions_isNULL) ci.setProperty("StatusDescriptions", instance.StatusDescriptions); if (!instance.Status_isNULL) ci.setProperty("Status", instance.Status); if (!instance.HealthState_isNULL) ci.setProperty("HealthState", instance.HealthState); if (!instance.PrimaryStatus_isNULL) ci.setProperty("PrimaryStatus", instance.PrimaryStatus); if (!instance.DetailedStatus_isNULL) ci.setProperty("DetailedStatus", instance.DetailedStatus); if (!instance.OperatingStatus_isNULL) ci.setProperty("OperatingStatus", instance.OperatingStatus); if (!instance.CommunicationStatus_isNULL) ci.setProperty("CommunicationStatus", instance.CommunicationStatus); if (!instance.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.AvailableRequestedStates_isNULL) ci.setProperty("AvailableRequestedStates", instance.AvailableRequestedStates); if (!instance.TransitioningToState_isNULL) ci.setProperty("TransitioningToState", instance.TransitioningToState); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.OperationalStatus_isNULL) ci.setProperty("OperationalStatus", instance.OperationalStatus); if (!instance.EnabledState_isNULL) ci.setProperty("EnabledState", instance.EnabledState); if (!instance.TimeOfLastStateChange_isNULL) ci.setPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange); if (!instance.NameFormat_isNULL) ci.setProperty("NameFormat", instance.NameFormat); if (!instance.ProtocolType_isNULL) ci.setProperty("ProtocolType", instance.ProtocolType); if (!instance.OtherTypeDescription_isNULL) ci.setProperty("OtherTypeDescription", instance.OtherTypeDescription); if (!instance.BroadcastResetSupported_isNULL) ci.setProperty("BroadcastResetSupported", instance.BroadcastResetSupported); if (!instance.IPv4Address_isNULL) ci.setProperty("IPv4Address", instance.IPv4Address); if (!instance.IPv6Address_isNULL) ci.setProperty("IPv6Address", instance.IPv6Address); if (!instance.Address_isNULL) ci.setProperty("Address", instance.Address); if (!instance.SubnetMask_isNULL) ci.setProperty("SubnetMask", instance.SubnetMask); if (!instance.PrefixLength_isNULL) ci.setProperty("PrefixLength", instance.PrefixLength); if (!instance.AddressType_isNULL) ci.setProperty("AddressType", instance.AddressType); if (!instance.IPVersionSupport_isNULL) ci.setProperty("IPVersionSupport", instance.IPVersionSupport); if (!instance.ProtocolIFType_isNULL) ci.setProperty("ProtocolIFType", instance.ProtocolIFType); if (!instance.AddressOrigin_isNULL) ci.setProperty("AddressOrigin", instance.AddressOrigin); _L_; return ci.getHdl(); } void IP_OpenDRIM_IPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_IPProtocolEndpoint& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (op.getKey("Name", instance.Name) == OK) instance.Name_isNULL = false; if (op.getKey("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (op.getKey("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; _L_; } void IP_OpenDRIM_IPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_IPProtocolEndpoint& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_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("StatusDescriptions", instance.StatusDescriptions) == OK) instance.StatusDescriptions_isNULL = false; if (inst.getProperty("Status", instance.Status) == OK) instance.Status_isNULL = false; if (inst.getProperty("HealthState", instance.HealthState) == OK) instance.HealthState_isNULL = false; if (inst.getProperty("PrimaryStatus", instance.PrimaryStatus) == OK) instance.PrimaryStatus_isNULL = false; if (inst.getProperty("DetailedStatus", instance.DetailedStatus) == OK) instance.DetailedStatus_isNULL = false; if (inst.getProperty("OperatingStatus", instance.OperatingStatus) == OK) instance.OperatingStatus_isNULL = false; if (inst.getProperty("CommunicationStatus", instance.CommunicationStatus) == OK) instance.CommunicationStatus_isNULL = false; if (inst.getProperty("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.getProperty("AvailableRequestedStates", instance.AvailableRequestedStates) == OK) instance.AvailableRequestedStates_isNULL = false; if (inst.getProperty("TransitioningToState", instance.TransitioningToState) == OK) instance.TransitioningToState_isNULL = false; if (inst.getProperty("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (inst.getProperty("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (inst.getProperty("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; if (inst.getProperty("Name", instance.Name) == OK) instance.Name_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("OperationalStatus", instance.OperationalStatus) == OK) instance.OperationalStatus_isNULL = false; if (inst.getProperty("EnabledState", instance.EnabledState) == OK) instance.EnabledState_isNULL = false; if (inst.getPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange) == OK) instance.TimeOfLastStateChange_isNULL = false; if (inst.getProperty("NameFormat", instance.NameFormat) == OK) instance.NameFormat_isNULL = false; if (inst.getProperty("ProtocolType", instance.ProtocolType) == OK) instance.ProtocolType_isNULL = false; if (inst.getProperty("OtherTypeDescription", instance.OtherTypeDescription) == OK) instance.OtherTypeDescription_isNULL = false; if (inst.getProperty("BroadcastResetSupported", instance.BroadcastResetSupported) == OK) instance.BroadcastResetSupported_isNULL = false; if (inst.getProperty("IPv4Address", instance.IPv4Address) == OK) instance.IPv4Address_isNULL = false; if (inst.getProperty("IPv6Address", instance.IPv6Address) == OK) instance.IPv6Address_isNULL = false; if (inst.getProperty("Address", instance.Address) == OK) instance.Address_isNULL = false; if (inst.getProperty("SubnetMask", instance.SubnetMask) == OK) instance.SubnetMask_isNULL = false; if (inst.getProperty("PrefixLength", instance.PrefixLength) == OK) instance.PrefixLength_isNULL = false; if (inst.getProperty("AddressType", instance.AddressType) == OK) instance.AddressType_isNULL = false; if (inst.getProperty("IPVersionSupport", instance.IPVersionSupport) == OK) instance.IPVersionSupport_isNULL = false; if (inst.getProperty("ProtocolIFType", instance.ProtocolIFType) == OK) instance.ProtocolIFType_isNULL = false; if (inst.getProperty("AddressOrigin", instance.AddressOrigin) == OK) instance.AddressOrigin_isNULL = false; _L_; } void IP_OpenDRIM_IPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_IPProtocolEndpoint_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 IP_OpenDRIM_IPProtocolEndpoint_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_IPProtocolEndpoint_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-ip-1.1.2~ppa/OpenDRIM_IPProtocolEndpoint/OpenDRIM_IPProtocolEndpoint.h0000644000175000017500000004171211377667034030731 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_IPPROTOCOLENDPOINT_H_ #define OPENDRIM_IPPROTOCOLENDPOINT_H_ #include const static char* OpenDRIM_IPProtocolEndpoint_classnames[] = {"OpenDRIM_IPProtocolEndpoint"}; static string OpenDRIM_IPProtocolEndpoint_NAMESPACE = _NAMESPACE; class OpenDRIM_IPProtocolEndpoint { public: string Caption; bool Caption_isNULL; string ElementName; bool ElementName_isNULL; string InstallDate; bool InstallDate_isNULL; vector StatusDescriptions; bool StatusDescriptions_isNULL; string Status; bool Status_isNULL; unsigned short HealthState; bool HealthState_isNULL; unsigned short PrimaryStatus; bool PrimaryStatus_isNULL; unsigned short DetailedStatus; bool DetailedStatus_isNULL; unsigned short OperatingStatus; bool OperatingStatus_isNULL; unsigned short CommunicationStatus; bool CommunicationStatus_isNULL; string OtherEnabledState; bool OtherEnabledState_isNULL; unsigned short RequestedState; bool RequestedState_isNULL; unsigned short EnabledDefault; bool EnabledDefault_isNULL; vector AvailableRequestedStates; bool AvailableRequestedStates_isNULL; unsigned short TransitioningToState; bool TransitioningToState_isNULL; string SystemCreationClassName; bool SystemCreationClassName_isNULL; string SystemName; bool SystemName_isNULL; string CreationClassName; bool CreationClassName_isNULL; string Name; bool Name_isNULL; string Description; bool Description_isNULL; vector OperationalStatus; bool OperationalStatus_isNULL; unsigned short EnabledState; bool EnabledState_isNULL; string TimeOfLastStateChange; bool TimeOfLastStateChange_isNULL; string NameFormat; bool NameFormat_isNULL; unsigned short ProtocolType; bool ProtocolType_isNULL; string OtherTypeDescription; bool OtherTypeDescription_isNULL; bool BroadcastResetSupported; bool BroadcastResetSupported_isNULL; string IPv4Address; bool IPv4Address_isNULL; string IPv6Address; bool IPv6Address_isNULL; string Address; bool Address_isNULL; string SubnetMask; bool SubnetMask_isNULL; unsigned char PrefixLength; bool PrefixLength_isNULL; unsigned short AddressType; bool AddressType_isNULL; unsigned short IPVersionSupport; bool IPVersionSupport_isNULL; unsigned short ProtocolIFType; bool ProtocolIFType_isNULL; unsigned short AddressOrigin; bool AddressOrigin_isNULL; OpenDRIM_IPProtocolEndpoint() { Caption_isNULL = true; ElementName_isNULL = true; InstallDate_isNULL = true; StatusDescriptions_isNULL = true; Status_isNULL = true; HealthState_isNULL = true; PrimaryStatus_isNULL = true; DetailedStatus_isNULL = true; OperatingStatus_isNULL = true; CommunicationStatus_isNULL = true; OtherEnabledState_isNULL = true; RequestedState_isNULL = true; EnabledDefault_isNULL = true; AvailableRequestedStates_isNULL = true; TransitioningToState_isNULL = true; SystemCreationClassName_isNULL = true; SystemName_isNULL = true; CreationClassName_isNULL = true; Name_isNULL = true; Description_isNULL = true; OperationalStatus_isNULL = true; EnabledState_isNULL = true; TimeOfLastStateChange_isNULL = true; NameFormat_isNULL = true; ProtocolType_isNULL = true; OtherTypeDescription_isNULL = true; BroadcastResetSupported_isNULL = true; IPv4Address_isNULL = true; IPv6Address_isNULL = true; Address_isNULL = true; SubnetMask_isNULL = true; PrefixLength_isNULL = true; AddressType_isNULL = true; IPVersionSupport_isNULL = true; ProtocolIFType_isNULL = true; AddressOrigin_isNULL = true; } ~OpenDRIM_IPProtocolEndpoint() {} string getKeys() const { return CF_toLowCase(".SystemCreationClassName=\"" + CF_quoteString(SystemCreationClassName) + "\""".SystemName=\"" + CF_quoteString(SystemName) + "\""".CreationClassName=\"" + CF_quoteString(CreationClassName) + "\""".Name=\"" + CF_quoteString(Name) + "\""); } 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 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 getStatusDescriptions(vector& value) const { if (StatusDescriptions_isNULL==true) return NOT_FOUND; value = StatusDescriptions; return OK; } int setStatusDescriptions(const vector& newValue) { StatusDescriptions = newValue; StatusDescriptions_isNULL = false; return OK; } int getStatus(string& value) const { if (Status_isNULL==true) return NOT_FOUND; value = Status; return OK; } int setStatus(const string& newValue) { Status = newValue; Status_isNULL = false; return OK; } int getHealthState(unsigned short& value) const { if (HealthState_isNULL==true) return NOT_FOUND; value = HealthState; return OK; } int setHealthState(const unsigned short& newValue) { HealthState = newValue; HealthState_isNULL = false; return OK; } int getPrimaryStatus(unsigned short& value) const { if (PrimaryStatus_isNULL==true) return NOT_FOUND; value = PrimaryStatus; return OK; } int setPrimaryStatus(const unsigned short& newValue) { PrimaryStatus = newValue; PrimaryStatus_isNULL = false; return OK; } int getDetailedStatus(unsigned short& value) const { if (DetailedStatus_isNULL==true) return NOT_FOUND; value = DetailedStatus; return OK; } int setDetailedStatus(const unsigned short& newValue) { DetailedStatus = newValue; DetailedStatus_isNULL = false; return OK; } int getOperatingStatus(unsigned short& value) const { if (OperatingStatus_isNULL==true) return NOT_FOUND; value = OperatingStatus; return OK; } int setOperatingStatus(const unsigned short& newValue) { OperatingStatus = newValue; OperatingStatus_isNULL = false; return OK; } int getCommunicationStatus(unsigned short& value) const { if (CommunicationStatus_isNULL==true) return NOT_FOUND; value = CommunicationStatus; return OK; } int setCommunicationStatus(const unsigned short& newValue) { CommunicationStatus = newValue; CommunicationStatus_isNULL = false; return OK; } int 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 getAvailableRequestedStates(vector& value) const { if (AvailableRequestedStates_isNULL==true) return NOT_FOUND; value = AvailableRequestedStates; return OK; } int setAvailableRequestedStates(const vector& newValue) { AvailableRequestedStates = newValue; AvailableRequestedStates_isNULL = false; return OK; } int getTransitioningToState(unsigned short& value) const { if (TransitioningToState_isNULL==true) return NOT_FOUND; value = TransitioningToState; return OK; } int setTransitioningToState(const unsigned short& newValue) { TransitioningToState = newValue; TransitioningToState_isNULL = false; return OK; } int getSystemCreationClassName(string& value) const { if (SystemCreationClassName_isNULL==true) return NOT_FOUND; value = SystemCreationClassName; return OK; } int setSystemCreationClassName(const string& newValue) { SystemCreationClassName = newValue; SystemCreationClassName_isNULL = false; return OK; } int getSystemName(string& value) const { if (SystemName_isNULL==true) return NOT_FOUND; value = SystemName; return OK; } int setSystemName(const string& newValue) { SystemName = newValue; SystemName_isNULL = false; return OK; } int getCreationClassName(string& value) const { if (CreationClassName_isNULL==true) return NOT_FOUND; value = CreationClassName; return OK; } int setCreationClassName(const string& newValue) { CreationClassName = newValue; CreationClassName_isNULL = false; return OK; } int 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 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 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 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 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 getNameFormat(string& value) const { if (NameFormat_isNULL==true) return NOT_FOUND; value = NameFormat; return OK; } int setNameFormat(const string& newValue) { NameFormat = newValue; NameFormat_isNULL = false; return OK; } int getProtocolType(unsigned short& value) const { if (ProtocolType_isNULL==true) return NOT_FOUND; value = ProtocolType; return OK; } int setProtocolType(const unsigned short& newValue) { ProtocolType = newValue; ProtocolType_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 getBroadcastResetSupported(bool& value) const { if (BroadcastResetSupported_isNULL==true) return NOT_FOUND; value = BroadcastResetSupported; return OK; } int setBroadcastResetSupported(const bool& newValue) { BroadcastResetSupported = newValue; BroadcastResetSupported_isNULL = false; return OK; } int getIPv4Address(string& value) const { if (IPv4Address_isNULL==true) return NOT_FOUND; value = IPv4Address; return OK; } int setIPv4Address(const string& newValue) { IPv4Address = newValue; IPv4Address_isNULL = false; return OK; } int getIPv6Address(string& value) const { if (IPv6Address_isNULL==true) return NOT_FOUND; value = IPv6Address; return OK; } int setIPv6Address(const string& newValue) { IPv6Address = newValue; IPv6Address_isNULL = false; return OK; } int getAddress(string& value) const { if (Address_isNULL==true) return NOT_FOUND; value = Address; return OK; } int setAddress(const string& newValue) { Address = newValue; Address_isNULL = false; return OK; } int getSubnetMask(string& value) const { if (SubnetMask_isNULL==true) return NOT_FOUND; value = SubnetMask; return OK; } int setSubnetMask(const string& newValue) { SubnetMask = newValue; SubnetMask_isNULL = false; return OK; } int getPrefixLength(unsigned char& value) const { if (PrefixLength_isNULL==true) return NOT_FOUND; value = PrefixLength; return OK; } int setPrefixLength(const unsigned char& newValue) { PrefixLength = newValue; PrefixLength_isNULL = false; return OK; } int getAddressType(unsigned short& value) const { if (AddressType_isNULL==true) return NOT_FOUND; value = AddressType; return OK; } int setAddressType(const unsigned short& newValue) { AddressType = newValue; AddressType_isNULL = false; return OK; } int getIPVersionSupport(unsigned short& value) const { if (IPVersionSupport_isNULL==true) return NOT_FOUND; value = IPVersionSupport; return OK; } int setIPVersionSupport(const unsigned short& newValue) { IPVersionSupport = newValue; IPVersionSupport_isNULL = false; return OK; } int getProtocolIFType(unsigned short& value) const { if (ProtocolIFType_isNULL==true) return NOT_FOUND; value = ProtocolIFType; return OK; } int setProtocolIFType(const unsigned short& newValue) { ProtocolIFType = newValue; ProtocolIFType_isNULL = false; return OK; } int getAddressOrigin(unsigned short& value) const { if (AddressOrigin_isNULL==true) return NOT_FOUND; value = AddressOrigin; return OK; } int setAddressOrigin(const unsigned short& newValue) { AddressOrigin = newValue; AddressOrigin_isNULL = false; return OK; } }; class OpenDRIM_IPProtocolEndpoint_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_IPProtocolEndpoint_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_IPProtocolEndpoint_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_IPProtocolEndpoint_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_IPProtocolEndpoint_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_IPProtocolEndpoint_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_IPPROTOCOLENDPOINT_H_*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_Gateway2ComputerSystem/0000755000175000017500000000000011377667034024237 5ustar guillaumeguillaumeopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_Gateway2ComputerSystem/cmpiOpenDRIM_Gateway2ComputerSystem.cpp0000644000175000017500000000606511377667034033667 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #include "cmpiOpenDRIM_Gateway2ComputerSystem.h" CMPIObjectPath* IP_OpenDRIM_Gateway2ComputerSystem_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_Gateway2ComputerSystem& instance) { _E_; Objectpath op(broker, OpenDRIM_Gateway2ComputerSystem_classnames[0], OpenDRIM_Gateway2ComputerSystem_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* IP_OpenDRIM_Gateway2ComputerSystem_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_Gateway2ComputerSystem& instance) { _E_; Objectpath op(broker, IP_OpenDRIM_Gateway2ComputerSystem_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void IP_OpenDRIM_Gateway2ComputerSystem_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_Gateway2ComputerSystem& 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 IP_OpenDRIM_Gateway2ComputerSystem_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_Gateway2ComputerSystem& 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_; } ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_Gateway2ComputerSystem/OpenDRIM_Gateway2ComputerSystemProvider.cppopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_Gateway2ComputerSystem/OpenDRIM_Gateway2ComputerSystemProvider.cp0000644000175000017500000004172111377667034034347 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #include "cmpiOpenDRIM_Gateway2ComputerSystem.h" #include "OpenDRIM_Gateway2ComputerSystemAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define IP_OpenDRIM_Gateway2ComputerSystemProviderSetInstance IP_OpenDRIM_Gateway2ComputerSystemProviderModifyInstance #endif int IP_OpenDRIM_Gateway2ComputerSystem_init(const CMPIBroker* broker); int IP_OpenDRIM_Gateway2ComputerSystem_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus IP_OpenDRIM_Gateway2ComputerSystemProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = IP_OpenDRIM_Gateway2ComputerSystem_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus IP_OpenDRIM_Gateway2ComputerSystemProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = IP_OpenDRIM_Gateway2ComputerSystem_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = IP_OpenDRIM_Gateway2ComputerSystem_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_Gateway2ComputerSystemProviderEnumInstances(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 = IP_OpenDRIM_Gateway2ComputerSystem_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = IP_OpenDRIM_Gateway2ComputerSystem_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_Gateway2ComputerSystemProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_Gateway2ComputerSystem instance; IP_OpenDRIM_Gateway2ComputerSystem_toCPP(_broker, cop, instance); string errorMessage; int errorCode = IP_OpenDRIM_Gateway2ComputerSystem_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = IP_OpenDRIM_Gateway2ComputerSystem_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_Gateway2ComputerSystemProviderSetInstance(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_Gateway2ComputerSystem newInstance, oldInstance; IP_OpenDRIM_Gateway2ComputerSystem_toCPP(_broker, ci, newInstance); IP_OpenDRIM_Gateway2ComputerSystem_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = IP_OpenDRIM_Gateway2ComputerSystem_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_Gateway2ComputerSystem_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_Gateway2ComputerSystemProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_Gateway2ComputerSystem instance; IP_OpenDRIM_Gateway2ComputerSystem_toCPP(_broker, ci, instance); string errorMessage; int errorCode = IP_OpenDRIM_Gateway2ComputerSystem_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_Gateway2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_Gateway2ComputerSystem_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_Gateway2ComputerSystem_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = IP_OpenDRIM_Gateway2ComputerSystem_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_Gateway2ComputerSystemProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_Gateway2ComputerSystem instance; IP_OpenDRIM_Gateway2ComputerSystem_toCPP(_broker, cop, instance); string errorMessage; int errorCode = IP_OpenDRIM_Gateway2ComputerSystem_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_Gateway2ComputerSystem_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_Gateway2ComputerSystemProviderExecQuery(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 IP_OpenDRIM_Gateway2ComputerSystemProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = IP_OpenDRIM_Gateway2ComputerSystem_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus IP_OpenDRIM_Gateway2ComputerSystemProviderAssociatorNames(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 = IP_OpenDRIM_Gateway2ComputerSystem_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway2ComputerSystem_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 IP_OpenDRIM_Gateway2ComputerSystemProviderAssociators(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 = IP_OpenDRIM_Gateway2ComputerSystem_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway2ComputerSystem_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 IP_OpenDRIM_Gateway2ComputerSystemProviderReferenceNames(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 = IP_OpenDRIM_Gateway2ComputerSystem_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = IP_OpenDRIM_Gateway2ComputerSystem_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = IP_OpenDRIM_Gateway2ComputerSystem_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = IP_OpenDRIM_Gateway2ComputerSystem_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus IP_OpenDRIM_Gateway2ComputerSystemProviderReferences(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 = IP_OpenDRIM_Gateway2ComputerSystem_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = IP_OpenDRIM_Gateway2ComputerSystem_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = IP_OpenDRIM_Gateway2ComputerSystem_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = IP_OpenDRIM_Gateway2ComputerSystem_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int IP_OpenDRIM_Gateway2ComputerSystem_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = IP_OpenDRIM_Gateway2ComputerSystem_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "IP_OpenDRIM_Gateway2ComputerSystem_init FAILED: " + (string) OpenDRIM_Gateway2ComputerSystem_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int IP_OpenDRIM_Gateway2ComputerSystem_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = IP_OpenDRIM_Gateway2ComputerSystem_unload(errorMessage); if (errorCode != OK) { errorMessage += "IP_OpenDRIM_Gateway2ComputerSystem_unload FAILED: " + (string) OpenDRIM_Gateway2ComputerSystem_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define IP_OpenDRIM_Gateway2ComputerSystem_INIT if (IP_OpenDRIM_Gateway2ComputerSystem_init(_broker) < 0) return NULL CMInstanceMIStub(IP_OpenDRIM_Gateway2ComputerSystemProvider, IP_OpenDRIM_Gateway2ComputerSystemProvider, _broker, IP_OpenDRIM_Gateway2ComputerSystem_INIT); CMAssociationMIStub(IP_OpenDRIM_Gateway2ComputerSystemProvider, IP_OpenDRIM_Gateway2ComputerSystemProvider, _broker, IP_OpenDRIM_Gateway2ComputerSystem_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_Gateway2ComputerSystem/Makefile.am0000644000175000017500000000470311377667034026277 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiIP_OpenDRIM_Gateway2ComputerSystemProvider.la libcmpiIP_OpenDRIM_Gateway2ComputerSystemProvider_la_SOURCES = OpenDRIM_Gateway2ComputerSystemAccess.cpp OpenDRIM_Gateway2ComputerSystemProvider.cpp cmpiOpenDRIM_Gateway2ComputerSystem.cpp assocOpenDRIM_Gateway2ComputerSystem.cpp # May have to be adjusted for direct invocation libcmpiIP_OpenDRIM_Gateway2ComputerSystemProvider_la_CPPFLAGS = -I../CIM_System -I../CIM_ServiceAccessPoint # Uncomment the end for direct invocation, may have to be adjusted libcmpiIP_OpenDRIM_Gateway2ComputerSystemProvider_la_LIBADD = ../Common/libcmpiIP_Common.la #../CIM_System/libcmpiIP_CIM_SystemProvider.la ../CIM_ServiceAccessPoint/libcmpiIP_CIM_ServiceAccessPointProvider.la libcmpiIP_OpenDRIM_Gateway2ComputerSystemProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_Gateway2ComputerSystem.h OpenDRIM_Gateway2ComputerSystem.h OpenDRIM_Gateway2ComputerSystemAccess.h opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_Gateway2ComputerSystem/OpenDRIM_Gateway2ComputerSystemAccess.h0000644000175000017500000001044511377667034033602 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #ifndef OPENDRIM_GATEWAY2COMPUTERSYSTEMACCESS_H_ #define OPENDRIM_GATEWAY2COMPUTERSYSTEMACCESS_H_ #include "IP_Common.h" #include "OpenDRIM_Gateway2ComputerSystem.h" #include "assocOpenDRIM_Gateway2ComputerSystem.h" int IP_OpenDRIM_Gateway2ComputerSystem_load(const CMPIBroker* broker, string& errorMessage); int IP_OpenDRIM_Gateway2ComputerSystem_unload(string& errorMessage); int IP_OpenDRIM_Gateway2ComputerSystem_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int IP_OpenDRIM_Gateway2ComputerSystem_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_Gateway2ComputerSystem& instance, const char** properties, string& errorMessage); int IP_OpenDRIM_Gateway2ComputerSystem_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Gateway2ComputerSystem& newInstance, const OpenDRIM_Gateway2ComputerSystem& oldInstance, const char** properties, string& errorMessage); int IP_OpenDRIM_Gateway2ComputerSystem_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Gateway2ComputerSystem& instance, string& errorMessage); int IP_OpenDRIM_Gateway2ComputerSystem_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Gateway2ComputerSystem& instance, string& errorMessage); int IP_OpenDRIM_Gateway2ComputerSystem_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int IP_OpenDRIM_Gateway2ComputerSystem_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int IP_OpenDRIM_Gateway2ComputerSystem_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_Gateway2ComputerSystem_instances, const char** properties, string& errorMessage, const string& discriminant); int IP_OpenDRIM_Gateway2ComputerSystem_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_Gateway2ComputerSystem_instances, const char** properties, string& errorMessage, const string& discriminant); int IP_OpenDRIM_Gateway2ComputerSystem_populate(OpenDRIM_Gateway2ComputerSystem& instance, string& errorMessage); #endif /*OPENDRIM_GATEWAY2COMPUTERSYSTEMACCESS_H_*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_Gateway2ComputerSystem/OpenDRIM_Gateway2ComputerSystem.h0000644000175000017500000000663211377667034032463 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #ifndef OPENDRIM_GATEWAY2COMPUTERSYSTEM_H_ #define OPENDRIM_GATEWAY2COMPUTERSYSTEM_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_System.h" #include "CIM_SystemAccess.h" #include "cmpiCIM_ServiceAccessPoint.h" #include "CIM_ServiceAccessPointAccess.h" */ const static char* OpenDRIM_Gateway2ComputerSystem_classnames[] = {"OpenDRIM_Gateway2ComputerSystem"}; static string OpenDRIM_Gateway2ComputerSystem_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"OpenDRIM_ComputerSystem"}; const static string Antecedent_NAMESPACE = _NAMESPACE; const static string Dependent_role = "Dependent"; const static char* Dependent_classnames[] = {"OpenDRIM_Gateway"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_Gateway2ComputerSystem { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; OpenDRIM_Gateway2ComputerSystem() { Antecedent_isNULL = true; Dependent_isNULL = true; } ~OpenDRIM_Gateway2ComputerSystem() {} 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_GATEWAY2COMPUTERSYSTEM_H_*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_Gateway2ComputerSystem/cmpiOpenDRIM_Gateway2ComputerSystem.h0000644000175000017500000000435011377667034033327 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #ifndef CMPIOPENDRIM_GATEWAY2COMPUTERSYSTEM_H_ #define CMPIOPENDRIM_GATEWAY2COMPUTERSYSTEM_H_ #include "OpenDRIM_Gateway2ComputerSystem.h" CMPIObjectPath* IP_OpenDRIM_Gateway2ComputerSystem_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_Gateway2ComputerSystem& instance); CMPIInstance* IP_OpenDRIM_Gateway2ComputerSystem_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_Gateway2ComputerSystem& instance); void IP_OpenDRIM_Gateway2ComputerSystem_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_Gateway2ComputerSystem& instance); void IP_OpenDRIM_Gateway2ComputerSystem_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_Gateway2ComputerSystem& instance); #endif /*CMPIOPENDRIM_GATEWAY2COMPUTERSYSTEM_H_*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_Gateway2ComputerSystem/assocOpenDRIM_Gateway2ComputerSystem.h0000644000175000017500000000617411377667034033515 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #ifndef ASSOCOPENDRIM_GATEWAY2COMPUTERSYSTEM_H_ #define ASSOCOPENDRIM_GATEWAY2COMPUTERSYSTEM_H_ #include "OpenDRIM_Gateway2ComputerSystemAccess.h" int IP_OpenDRIM_Gateway2ComputerSystem_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 IP_OpenDRIM_Gateway2ComputerSystem_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 IP_OpenDRIM_Gateway2ComputerSystem_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int IP_OpenDRIM_Gateway2ComputerSystem_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int IP_OpenDRIM_Gateway2ComputerSystem_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int IP_OpenDRIM_Gateway2ComputerSystem_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_GATEWAY2COMPUTERSYSTEM_H_*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_Gateway2ComputerSystem/assocOpenDRIM_Gateway2ComputerSystem.cpp0000644000175000017500000002062111377667034034041 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #include "assocOpenDRIM_Gateway2ComputerSystem.h" int IP_OpenDRIM_Gateway2ComputerSystem_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 = IP_OpenDRIM_Gateway2ComputerSystem_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(IP_OpenDRIM_Gateway2ComputerSystem_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(IP_OpenDRIM_Gateway2ComputerSystem_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int IP_OpenDRIM_Gateway2ComputerSystem_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(IP_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(IP_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, IP_CIM_System_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int IP_OpenDRIM_Gateway2ComputerSystem_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Antecedent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Antecedent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_System _instance; IP_CIM_System_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(IP_CIM_System_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, IP_CIM_System_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int IP_OpenDRIM_Gateway2ComputerSystem_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(IP_CIM_ServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(IP_CIM_ServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, IP_CIM_ServiceAccessPoint_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int IP_OpenDRIM_Gateway2ComputerSystem_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Dependent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Dependent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_ServiceAccessPoint _instance; IP_CIM_ServiceAccessPoint_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(IP_CIM_ServiceAccessPoint_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, IP_CIM_ServiceAccessPoint_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_Gateway2ComputerSystem/OpenDRIM_Gateway2ComputerSystemAccess.cpp0000644000175000017500000002454611377667034034144 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #include "OpenDRIM_Gateway2ComputerSystemAccess.h" int IP_OpenDRIM_Gateway2ComputerSystem_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(IP_CIM_System_load(broker, errorMessage)); CF_assert(IP_CIM_ServiceAccessPoint_load(broker, errorMessage)); */ // TODO _L_; return OK; } int IP_OpenDRIM_Gateway2ComputerSystem_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(IP_CIM_System_unload(errorMessage)); CF_assert(IP_CIM_ServiceAccessPoint_unload(errorMessage)); */ // TODO _L_; return OK; } int IP_OpenDRIM_Gateway2ComputerSystem_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // Determine if the association can be established or not string computerSystem_name; CF_assert(Antecedent.getProperty("Name", computerSystem_name)); string gateway_systemName; CF_assert(Dependent.getProperty("SystemName", gateway_systemName)); if (computerSystem_name==gateway_systemName) isAssociated=true; else isAssociated=false; _L_; return OK; } int IP_OpenDRIM_Gateway2ComputerSystem_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(IP_OpenDRIM_Gateway2ComputerSystem_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(IP_OpenDRIM_Gateway2ComputerSystem_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; IP_OpenDRIM_Gateway2ComputerSystem_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(IP_OpenDRIM_Gateway2ComputerSystem_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int IP_OpenDRIM_Gateway2ComputerSystem_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_Gateway2ComputerSystem& 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(IP_OpenDRIM_Gateway2ComputerSystem_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(IP_OpenDRIM_Gateway2ComputerSystem_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(IP_OpenDRIM_Gateway2ComputerSystem_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int IP_OpenDRIM_Gateway2ComputerSystem_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Gateway2ComputerSystem& newInstance, const OpenDRIM_Gateway2ComputerSystem& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_Gateway2ComputerSystem_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Gateway2ComputerSystem& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_Gateway2ComputerSystem_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Gateway2ComputerSystem& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_Gateway2ComputerSystem_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(IP_OpenDRIM_Gateway2ComputerSystem_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(IP_OpenDRIM_Gateway2ComputerSystem_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(IP_OpenDRIM_Gateway2ComputerSystem_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(IP_OpenDRIM_Gateway2ComputerSystem_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(IP_OpenDRIM_Gateway2ComputerSystem_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(IP_OpenDRIM_Gateway2ComputerSystem_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_Gateway2ComputerSystem_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_Gateway2ComputerSystem instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); OpenDRIM_Gateway2ComputerSystem_instances.push_back(instance); } _L_; return OK; } int IP_OpenDRIM_Gateway2ComputerSystem_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_Gateway2ComputerSystem_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_Gateway2ComputerSystem instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); OpenDRIM_Gateway2ComputerSystem_instances.push_back(instance); } _L_; return OK; } int IP_OpenDRIM_Gateway2ComputerSystem_populate(OpenDRIM_Gateway2ComputerSystem& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-ip-1.1.2~ppa/TODO0000644000175000017500000000010111377667034016653 0ustar guillaumeguillaumeTODO for Major.Minor.Revision ========================= // TODO opendrim-lmp-ip-1.1.2~ppa/INSTALL0000644000175000017500000000670611377667034017235 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 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-ip-1.1.2~ppa/AUTHORS0000644000175000017500000000017411377667034017245 0ustar guillaumeguillaumeIlsoo Byun Guillaume BOTTEX opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolConformsToProfile/0000755000175000017500000000000011377667034025215 5ustar guillaumeguillaumeopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolConformsToProfile/Makefile.am0000644000175000017500000000502411377667034027252 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiIP_OpenDRIM_IPProtocolConformsToProfileProvider.la libcmpiIP_OpenDRIM_IPProtocolConformsToProfileProvider_la_SOURCES = OpenDRIM_IPProtocolConformsToProfileAccess.cpp OpenDRIM_IPProtocolConformsToProfileProvider.cpp cmpiOpenDRIM_IPProtocolConformsToProfile.cpp assocOpenDRIM_IPProtocolConformsToProfile.cpp # May have to be adjusted for direct invocation libcmpiIP_OpenDRIM_IPProtocolConformsToProfileProvider_la_CPPFLAGS = -I../CIM_RegisteredProfile -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiIP_OpenDRIM_IPProtocolConformsToProfileProvider_la_LIBADD = ../Common/libcmpiIP_Common.la #../CIM_RegisteredProfile/libcmpiIP_CIM_RegisteredProfileProvider.la ../CIM_ManagedElement/libcmpiIP_CIM_ManagedElementProvider.la libcmpiIP_OpenDRIM_IPProtocolConformsToProfileProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_IPProtocolConformsToProfile.h OpenDRIM_IPProtocolConformsToProfile.h OpenDRIM_IPProtocolConformsToProfileAccess.h ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolConformsToProfile/cmpiOpenDRIM_IPProtocolConformsToProfile.cppopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolConformsToProfile/cmpiOpenDRIM_IPProtocolConformsToProf0000644000175000017500000000634611377667034034352 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #include "cmpiOpenDRIM_IPProtocolConformsToProfile.h" CMPIObjectPath* IP_OpenDRIM_IPProtocolConformsToProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_IPProtocolConformsToProfile& instance) { _E_; Objectpath op(broker, OpenDRIM_IPProtocolConformsToProfile_classnames[0], OpenDRIM_IPProtocolConformsToProfile_NAMESPACE); if (!instance.ConformantStandard_isNULL) op.addKey("ConformantStandard", instance.ConformantStandard); if (!instance.ManagedElement_isNULL) op.addKey("ManagedElement", instance.ManagedElement); _L_; return op.getHdl(); } CMPIInstance* IP_OpenDRIM_IPProtocolConformsToProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_IPProtocolConformsToProfile& instance) { _E_; Objectpath op(broker, IP_OpenDRIM_IPProtocolConformsToProfile_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void IP_OpenDRIM_IPProtocolConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_IPProtocolConformsToProfile& 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 IP_OpenDRIM_IPProtocolConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_IPProtocolConformsToProfile& 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_; } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolConformsToProfile/OpenDRIM_IPProtocolConformsToProfileAccess.hopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolConformsToProfile/OpenDRIM_IPProtocolConformsToProfileA0000644000175000017500000001103111377667034034257 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #ifndef OPENDRIM_IPPROTOCOLCONFORMSTOPROFILEACCESS_H_ #define OPENDRIM_IPPROTOCOLCONFORMSTOPROFILEACCESS_H_ #include "IP_Common.h" #include "OpenDRIM_IPProtocolConformsToProfile.h" #include "assocOpenDRIM_IPProtocolConformsToProfile.h" int IP_OpenDRIM_IPProtocolConformsToProfile_load(const CMPIBroker* broker, string& errorMessage); int IP_OpenDRIM_IPProtocolConformsToProfile_unload(string& errorMessage); int IP_OpenDRIM_IPProtocolConformsToProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int IP_OpenDRIM_IPProtocolConformsToProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_IPProtocolConformsToProfile& instance, const char** properties, string& errorMessage); int IP_OpenDRIM_IPProtocolConformsToProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IPProtocolConformsToProfile& newInstance, const OpenDRIM_IPProtocolConformsToProfile& oldInstance, const char** properties, string& errorMessage); int IP_OpenDRIM_IPProtocolConformsToProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IPProtocolConformsToProfile& instance, string& errorMessage); int IP_OpenDRIM_IPProtocolConformsToProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IPProtocolConformsToProfile& instance, string& errorMessage); int IP_OpenDRIM_IPProtocolConformsToProfile_associatorConformantStandardToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ConformantStandard_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant); int IP_OpenDRIM_IPProtocolConformsToProfile_associatorManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const char** properties, vector& ConformantStandard_associatedInstances, string& errorMessage, const string& discriminant); int IP_OpenDRIM_IPProtocolConformsToProfile_referenceConformantStandardToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ConformantStandard_instance, const vector& ManagedElement_instances, vector& OpenDRIM_IPProtocolConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant); int IP_OpenDRIM_IPProtocolConformsToProfile_referenceManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& ConformantStandard_instances, vector& OpenDRIM_IPProtocolConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant); int IP_OpenDRIM_IPProtocolConformsToProfile_populate(OpenDRIM_IPProtocolConformsToProfile& instance, string& errorMessage); #endif /*OPENDRIM_IPPROTOCOLCONFORMSTOPROFILEACCESS_H_*/ ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolConformsToProfile/assocOpenDRIM_IPProtocolConformsToProfile.cppopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolConformsToProfile/assocOpenDRIM_IPProtocolConformsToPro0000644000175000017500000002135111377667034034355 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #include "assocOpenDRIM_IPProtocolConformsToProfile.h" int IP_OpenDRIM_IPProtocolConformsToProfile_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 = IP_OpenDRIM_IPProtocolConformsToProfile_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(IP_OpenDRIM_IPProtocolConformsToProfile_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(IP_OpenDRIM_IPProtocolConformsToProfile_associatorManagedElementToConformantStandard(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int IP_OpenDRIM_IPProtocolConformsToProfile_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(IP_CIM_RegisteredProfile_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(IP_CIM_RegisteredProfile_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, IP_CIM_RegisteredProfile_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int IP_OpenDRIM_IPProtocolConformsToProfile_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; IP_CIM_RegisteredProfile_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(IP_CIM_RegisteredProfile_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, IP_CIM_RegisteredProfile_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int IP_OpenDRIM_IPProtocolConformsToProfile_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(IP_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(IP_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, IP_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int IP_OpenDRIM_IPProtocolConformsToProfile_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; IP_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(IP_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, IP_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolConformsToProfile/OpenDRIM_IPProtocolConformsToProfileAccess.cppopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolConformsToProfile/OpenDRIM_IPProtocolConformsToProfileA0000644000175000017500000002547211377667034034275 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #include "OpenDRIM_IPProtocolConformsToProfileAccess.h" int IP_OpenDRIM_IPProtocolConformsToProfile_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(IP_CIM_RegisteredProfile_load(broker, errorMessage)); CF_assert(IP_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int IP_OpenDRIM_IPProtocolConformsToProfile_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(IP_CIM_RegisteredProfile_unload(errorMessage)); CF_assert(IP_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int IP_OpenDRIM_IPProtocolConformsToProfile_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 IP_OpenDRIM_IPProtocolConformsToProfile_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(IP_OpenDRIM_IPProtocolConformsToProfile_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(IP_OpenDRIM_IPProtocolConformsToProfile_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; IP_OpenDRIM_IPProtocolConformsToProfile_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(IP_OpenDRIM_IPProtocolConformsToProfile_referenceConformantStandardToManagedElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int IP_OpenDRIM_IPProtocolConformsToProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_IPProtocolConformsToProfile& 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(IP_OpenDRIM_IPProtocolConformsToProfile_getConformantStandard(broker, ctx, ConformantStandard_objectpath, ConformantStandard_instance, NULL, errorMessage)); Objectpath ManagedElement_objectpath; instance.getManagedElement(ManagedElement_objectpath); Instance ManagedElement_instance; CF_assert(IP_OpenDRIM_IPProtocolConformsToProfile_getManagedElement(broker, ctx, ManagedElement_objectpath, ManagedElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(IP_OpenDRIM_IPProtocolConformsToProfile_isAssociated(ConformantStandard_instance, ManagedElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int IP_OpenDRIM_IPProtocolConformsToProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IPProtocolConformsToProfile& newInstance, const OpenDRIM_IPProtocolConformsToProfile& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_IPProtocolConformsToProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IPProtocolConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_IPProtocolConformsToProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IPProtocolConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_IPProtocolConformsToProfile_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(IP_OpenDRIM_IPProtocolConformsToProfile_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(IP_OpenDRIM_IPProtocolConformsToProfile_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(IP_OpenDRIM_IPProtocolConformsToProfile_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(IP_OpenDRIM_IPProtocolConformsToProfile_enumerateConformantStandards(broker, ctx, ConformantStandard_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(IP_OpenDRIM_IPProtocolConformsToProfile_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(IP_OpenDRIM_IPProtocolConformsToProfile_enumerateConformantStandards(broker, ctx, ConformantStandard_instances, properties, false, errorMessage)); } for (size_t i=0; i& ManagedElement_instances, vector& OpenDRIM_IPProtocolConformsToProfile_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_IPProtocolConformsToProfile instance; instance.setConformantStandard(((Instance) ConformantStandard_instance).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instances[i]).getObjectpath()); OpenDRIM_IPProtocolConformsToProfile_instances.push_back(instance); } _L_; return OK; } int IP_OpenDRIM_IPProtocolConformsToProfile_referenceManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& ConformantStandard_instances, vector& OpenDRIM_IPProtocolConformsToProfile_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_IPProtocolConformsToProfile instance; instance.setConformantStandard(((Instance) ConformantStandard_instances[i]).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instance).getObjectpath()); OpenDRIM_IPProtocolConformsToProfile_instances.push_back(instance); } _L_; return OK; } int IP_OpenDRIM_IPProtocolConformsToProfile_populate(OpenDRIM_IPProtocolConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolConformsToProfile/cmpiOpenDRIM_IPProtocolConformsToProfile.hopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolConformsToProfile/cmpiOpenDRIM_IPProtocolConformsToProf0000644000175000017500000000444411377667034034347 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #ifndef CMPIOPENDRIM_IPPROTOCOLCONFORMSTOPROFILE_H_ #define CMPIOPENDRIM_IPPROTOCOLCONFORMSTOPROFILE_H_ #include "OpenDRIM_IPProtocolConformsToProfile.h" CMPIObjectPath* IP_OpenDRIM_IPProtocolConformsToProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_IPProtocolConformsToProfile& instance); CMPIInstance* IP_OpenDRIM_IPProtocolConformsToProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_IPProtocolConformsToProfile& instance); void IP_OpenDRIM_IPProtocolConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_IPProtocolConformsToProfile& instance); void IP_OpenDRIM_IPProtocolConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_IPProtocolConformsToProfile& instance); #endif /*CMPIOPENDRIM_IPPROTOCOLCONFORMSTOPROFILE_H_*/ ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolConformsToProfile/assocOpenDRIM_IPProtocolConformsToProfile.hopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolConformsToProfile/assocOpenDRIM_IPProtocolConformsToPro0000644000175000017500000000631011377667034034353 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #ifndef ASSOCOPENDRIM_IPPROTOCOLCONFORMSTOPROFILE_H_ #define ASSOCOPENDRIM_IPPROTOCOLCONFORMSTOPROFILE_H_ #include "OpenDRIM_IPProtocolConformsToProfileAccess.h" int IP_OpenDRIM_IPProtocolConformsToProfile_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 IP_OpenDRIM_IPProtocolConformsToProfile_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 IP_OpenDRIM_IPProtocolConformsToProfile_enumerateConformantStandards(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int IP_OpenDRIM_IPProtocolConformsToProfile_getConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int IP_OpenDRIM_IPProtocolConformsToProfile_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int IP_OpenDRIM_IPProtocolConformsToProfile_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_IPPROTOCOLCONFORMSTOPROFILE_H_*/ ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolConformsToProfile/OpenDRIM_IPProtocolConformsToProfileProvider.cppopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolConformsToProfile/OpenDRIM_IPProtocolConformsToProfileP0000644000175000017500000004270711377667034034314 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #include "cmpiOpenDRIM_IPProtocolConformsToProfile.h" #include "OpenDRIM_IPProtocolConformsToProfileAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define IP_OpenDRIM_IPProtocolConformsToProfileProviderSetInstance IP_OpenDRIM_IPProtocolConformsToProfileProviderModifyInstance #endif int IP_OpenDRIM_IPProtocolConformsToProfile_init(const CMPIBroker* broker); int IP_OpenDRIM_IPProtocolConformsToProfile_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus IP_OpenDRIM_IPProtocolConformsToProfileProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = IP_OpenDRIM_IPProtocolConformsToProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus IP_OpenDRIM_IPProtocolConformsToProfileProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = IP_OpenDRIM_IPProtocolConformsToProfile_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = IP_OpenDRIM_IPProtocolConformsToProfile_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IPProtocolConformsToProfileProviderEnumInstances(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 = IP_OpenDRIM_IPProtocolConformsToProfile_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = IP_OpenDRIM_IPProtocolConformsToProfile_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IPProtocolConformsToProfileProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_IPProtocolConformsToProfile instance; IP_OpenDRIM_IPProtocolConformsToProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = IP_OpenDRIM_IPProtocolConformsToProfile_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = IP_OpenDRIM_IPProtocolConformsToProfile_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IPProtocolConformsToProfileProviderSetInstance(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_IPProtocolConformsToProfile newInstance, oldInstance; IP_OpenDRIM_IPProtocolConformsToProfile_toCPP(_broker, ci, newInstance); IP_OpenDRIM_IPProtocolConformsToProfile_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = IP_OpenDRIM_IPProtocolConformsToProfile_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_IPProtocolConformsToProfile_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IPProtocolConformsToProfileProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_IPProtocolConformsToProfile instance; IP_OpenDRIM_IPProtocolConformsToProfile_toCPP(_broker, ci, instance); string errorMessage; int errorCode = IP_OpenDRIM_IPProtocolConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_IPProtocolConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_IPProtocolConformsToProfile_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_IPProtocolConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = IP_OpenDRIM_IPProtocolConformsToProfile_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IPProtocolConformsToProfileProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_IPProtocolConformsToProfile instance; IP_OpenDRIM_IPProtocolConformsToProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = IP_OpenDRIM_IPProtocolConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_IPProtocolConformsToProfile_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IPProtocolConformsToProfileProviderExecQuery(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 IP_OpenDRIM_IPProtocolConformsToProfileProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = IP_OpenDRIM_IPProtocolConformsToProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus IP_OpenDRIM_IPProtocolConformsToProfileProviderAssociatorNames(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 = IP_OpenDRIM_IPProtocolConformsToProfile_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolConformsToProfile_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 IP_OpenDRIM_IPProtocolConformsToProfileProviderAssociators(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 = IP_OpenDRIM_IPProtocolConformsToProfile_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolConformsToProfile_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 IP_OpenDRIM_IPProtocolConformsToProfileProviderReferenceNames(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 = IP_OpenDRIM_IPProtocolConformsToProfile_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = IP_OpenDRIM_IPProtocolConformsToProfile_referenceConformantStandardToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = IP_OpenDRIM_IPProtocolConformsToProfile_referenceManagedElementToConformantStandard(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = IP_OpenDRIM_IPProtocolConformsToProfile_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus IP_OpenDRIM_IPProtocolConformsToProfileProviderReferences(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 = IP_OpenDRIM_IPProtocolConformsToProfile_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = IP_OpenDRIM_IPProtocolConformsToProfile_referenceConformantStandardToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = IP_OpenDRIM_IPProtocolConformsToProfile_referenceManagedElementToConformantStandard(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IPProtocolConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = IP_OpenDRIM_IPProtocolConformsToProfile_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int IP_OpenDRIM_IPProtocolConformsToProfile_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = IP_OpenDRIM_IPProtocolConformsToProfile_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "IP_OpenDRIM_IPProtocolConformsToProfile_init FAILED: " + (string) OpenDRIM_IPProtocolConformsToProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int IP_OpenDRIM_IPProtocolConformsToProfile_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = IP_OpenDRIM_IPProtocolConformsToProfile_unload(errorMessage); if (errorCode != OK) { errorMessage += "IP_OpenDRIM_IPProtocolConformsToProfile_unload FAILED: " + (string) OpenDRIM_IPProtocolConformsToProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define IP_OpenDRIM_IPProtocolConformsToProfile_INIT if (IP_OpenDRIM_IPProtocolConformsToProfile_init(_broker) < 0) return NULL CMInstanceMIStub(IP_OpenDRIM_IPProtocolConformsToProfileProvider, IP_OpenDRIM_IPProtocolConformsToProfileProvider, _broker, IP_OpenDRIM_IPProtocolConformsToProfile_INIT); CMAssociationMIStub(IP_OpenDRIM_IPProtocolConformsToProfileProvider, IP_OpenDRIM_IPProtocolConformsToProfileProvider, _broker, IP_OpenDRIM_IPProtocolConformsToProfile_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolConformsToProfile/OpenDRIM_IPProtocolConformsToProfile.hopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IPProtocolConformsToProfile/OpenDRIM_IPProtocolConformsToProfile.0000644000175000017500000000733211377667034034245 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #ifndef OPENDRIM_IPPROTOCOLCONFORMSTOPROFILE_H_ #define OPENDRIM_IPPROTOCOLCONFORMSTOPROFILE_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_IPProtocolConformsToProfile_classnames[] = {"OpenDRIM_IPProtocolConformsToProfile"}; static string OpenDRIM_IPProtocolConformsToProfile_NAMESPACE = _INTEROP_NAMESPACE; const static string ConformantStandard_role = "ConformantStandard"; const static char* ConformantStandard_classnames[] = {"OpenDRIM_RegisteredIPProtocolProfile"}; const static string ConformantStandard_NAMESPACE = _INTEROP_NAMESPACE; const static string ManagedElement_role = "ManagedElement"; const static char* ManagedElement_classnames[] = {"OpenDRIM_IPProtocolEndpoint"}; const static string ManagedElement_NAMESPACE = _NAMESPACE; class OpenDRIM_IPProtocolConformsToProfile { public: Objectpath ConformantStandard; bool ConformantStandard_isNULL; Objectpath ManagedElement; bool ManagedElement_isNULL; OpenDRIM_IPProtocolConformsToProfile() { ConformantStandard_isNULL = true; ManagedElement_isNULL = true; } ~OpenDRIM_IPProtocolConformsToProfile() {} 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_IPPROTOCOLCONFORMSTOPROFILE_H_*/ opendrim-lmp-ip-1.1.2~ppa/packaging/0000755000175000017500000000000011377667034020117 5ustar guillaumeguillaumeopendrim-lmp-ip-1.1.2~ppa/packaging/debian/0000755000175000017500000000000011404314127021320 5ustar guillaumeguillaumeopendrim-lmp-ip-1.1.2~ppa/packaging/debian/postrm0000644000175000017500000000256411404314124022573 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_IP2ComputerSystem rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_IPProtocolConformsToProfile rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_IP2Gateway rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_Gateway2ComputerSystem rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_IPProtocolEndpoint rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_RegisteredIPProtocolProfile rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_Gateway ;; 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-ip-1.1.2~ppa/packaging/debian/source/0000755000175000017500000000000011400644331022617 5ustar guillaumeguillaumeopendrim-lmp-ip-1.1.2~ppa/packaging/debian/source/format0000644000175000017500000000001411377670443024045 0ustar guillaumeguillaume3.0 (quilt) opendrim-lmp-ip-1.1.2~ppa/packaging/debian/copyright0000644000175000017500000000301311377667034023271 0ustar guillaumeguillaumeThis package was debianized by Guillaume BOTTEX on Wed, 19 Aug 2009 15:25:25 +0900. It was downloaded from http://opendrim.sourceforge.net/ Upstream Authors: Ilsoo Byun Guillaume BOTTEX Copyright: Copyright (C) 2007 ETRI Ilsoo Byun Copyright (C) 2009 ETRI Guillaume BOTTEX License: Linux Management Providers (LMP), IP 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-ip-1.1.2~ppa/packaging/debian/control0000644000175000017500000000125511404314126022725 0ustar guillaumeguillaumeSource: opendrim-lmp-ip 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-ip Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, sfcb, libopendrim0 (>= 1.1.3), net-tools Description: OpenDRIM IP provider Provides information about the computer system's IP interface capabilities. . Compliant with the DMTF IP Interface Profile v1.0.1 (DSP1036). opendrim-lmp-ip-1.1.2~ppa/packaging/debian/prerm0000644000175000017500000000240211377667034022407 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-ip VERSION=`cat /usr/share/doc/opendrim-lmp-ip/VERSION` OPENDRIM_REG_DIR=/usr/share/OpenDRIM PROVIDER_SCRIPT_POST=IP $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-ip-1.1.2~ppa/packaging/debian/changelog0000644000175000017500000000050411404314127023171 0ustar guillaumeguillaumeopendrim-lmp-ip (1.1.2-0ubuntu1) lucid; urgency=low * New upstream version -- Guillaume BOTTEX Fri, 11 Jun 2010 10:58:00 +0900 opendrim-lmp-ip (1.1.1-0ubuntu1) karmic; urgency=low * Initial release -- Guillaume BOTTEX Wed, 19 Aug 2009 15:25:25 +0900 opendrim-lmp-ip-1.1.2~ppa/packaging/debian/postinst0000644000175000017500000000255711377667034023160 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-ip VERSION=`cat /usr/share/doc/opendrim-lmp-ip/VERSION` OPENDRIM_REG_DIR=/usr/share/OpenDRIM PROVIDER_SCRIPT_POST=IP $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-ip-1.1.2~ppa/packaging/debian/install0000644000175000017500000000004711377667034022733 0ustar guillaumeguillaumeusr/lib/cmpi/*.so usr/share/OpenDRIM/* opendrim-lmp-ip-1.1.2~ppa/packaging/debian/rules0000755000175000017500000000353011377667034022422 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-ip 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-ip.sgml > opendrim-lmp-ip.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-ip-1.1.2~ppa/packaging/debian/docs0000644000175000017500000000003111377667034022206 0ustar guillaumeguillaumeNEWS README TODO VERSION opendrim-lmp-ip-1.1.2~ppa/packaging/debian/compat0000644000175000017500000000000211377667034022537 0ustar guillaumeguillaume5 opendrim-lmp-ip-1.1.2~ppa/packaging/opendrim-lmp-ip.spec0000644000175000017500000000766611377667034024023 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 IP Provider Name: opendrim-lmp-ip 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, net-tools, gawk, grep %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 IP %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-ip-1.1.2~ppa/mof/0000755000175000017500000000000011377667034016754 5ustar guillaumeguillaumeopendrim-lmp-ip-1.1.2~ppa/mof/OpenDRIM_IPProtocolConformsToProfile.mof0000644000175000017500000000330511377667034026502 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), IP provider package // Copyright (C) 2007 Ilsoo Byun // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; version 2 // of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2008 Guillaume BOTTEX, ETRI //################################################################################ [Association, Provider("cmpi:cmpiIP_OpenDRIM_IPProtocolConformsToProfileProvider")] class OpenDRIM_IPProtocolConformsToProfile:CIM_ElementConformsToProfile { }; opendrim-lmp-ip-1.1.2~ppa/mof/OpenDRIM_Gateway.mof0000644000175000017500000000321711377667034022520 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), IP provider package // Copyright (C) 2007 Ilsoo Byun // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; version 2 // of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2008 Guillaume BOTTEX, ETRI //################################################################################ [Provider("cmpi:cmpiIP_OpenDRIM_GatewayProvider")] class OpenDRIM_Gateway:CIM_RemoteServiceAccessPoint { }; opendrim-lmp-ip-1.1.2~ppa/mof/OpenDRIM_Gateway2ComputerSystem.mof0000644000175000017500000000323711377667034025530 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), IP provider package // Copyright (C) 2008 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 , , //################################################################################ [Association, Provider("cmpi:cmpiIP_OpenDRIM_Gateway2ComputerSystemProvider")] class OpenDRIM_Gateway2ComputerSystem:CIM_HostedAccessPoint { }; opendrim-lmp-ip-1.1.2~ppa/mof/OpenDRIM_IPProtocolEndpoint.mof0000644000175000017500000000323711377667034024654 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), IP provider package // Copyright (C) 2007 Ilsoo Byun // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; version 2 // of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2008 Guillaume BOTTEX, ETRI //################################################################################ [Provider("cmpi:cmpiIP_OpenDRIM_IPProtocolEndpointProvider")] class OpenDRIM_IPProtocolEndpoint:CIM_IPProtocolEndpoint { }; opendrim-lmp-ip-1.1.2~ppa/mof/OpenDRIM_IP2ComputerSystem.mof0000644000175000017500000000325211377667034024434 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), IP provider package // Copyright (C) 2007 Ilsoo Byun // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; version 2 // of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2008 Guillaume BOTTEX, ETRI //################################################################################ [Association, Provider("cmpi:cmpiIP_OpenDRIM_IP2ComputerSystemProvider")] class OpenDRIM_IP2ComputerSystem:CIM_HostedAccessPoint { }; opendrim-lmp-ip-1.1.2~ppa/mof/OpenDRIM_IP2Gateway.mof0000644000175000017500000000325111377667034023031 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), IP provider package // Copyright (C) 2007 Ilsoo Byun // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; version 2 // of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2008 Guillaume BOTTEX, ETRI //################################################################################ [Association, Provider("cmpi:cmpiIP_OpenDRIM_IP2GatewayProvider")] class OpenDRIM_IP2Gateway:CIM_RemoteAccessAvailableToElement { }; opendrim-lmp-ip-1.1.2~ppa/mof/OpenDRIM_RegisteredIPProtocolProfile.mof0000644000175000017500000000323311377667034026506 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), IP provider package // Copyright (C) 2008 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 , , //################################################################################ [Provider("cmpi:cmpiIP_OpenDRIM_RegisteredIPProtocolProfileProvider")] class OpenDRIM_RegisteredIPProtocolProfile:CIM_RegisteredProfile { }; opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_RegisteredIPProtocolProfile/0000755000175000017500000000000011377667034025221 5ustar guillaumeguillaumeopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_RegisteredIPProtocolProfile/Makefile.am0000644000175000017500000000416711377667034027265 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiIP_OpenDRIM_RegisteredIPProtocolProfileProvider.la libcmpiIP_OpenDRIM_RegisteredIPProtocolProfileProvider_la_SOURCES = OpenDRIM_RegisteredIPProtocolProfileAccess.cpp OpenDRIM_RegisteredIPProtocolProfileProvider.cpp cmpiOpenDRIM_RegisteredIPProtocolProfile.cpp libcmpiIP_OpenDRIM_RegisteredIPProtocolProfileProvider_la_LIBADD = ../Common/libcmpiIP_Common.la libcmpiIP_OpenDRIM_RegisteredIPProtocolProfileProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_RegisteredIPProtocolProfile.h OpenDRIM_RegisteredIPProtocolProfile.h OpenDRIM_RegisteredIPProtocolProfileAccess.h ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_RegisteredIPProtocolProfile/OpenDRIM_RegisteredIPProtocolProfileAccess.hopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_RegisteredIPProtocolProfile/OpenDRIM_RegisteredIPProtocolProfileA0000644000175000017500000000610411377667034034274 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #ifndef OPENDRIM_REGISTEREDIPPROTOCOLPROFILEACCESS_H_ #define OPENDRIM_REGISTEREDIPPROTOCOLPROFILEACCESS_H_ #include "IP_Common.h" #include "OpenDRIM_RegisteredIPProtocolProfile.h" int IP_OpenDRIM_RegisteredIPProtocolProfile_load(const CMPIBroker* broker, string& errorMessage); int IP_OpenDRIM_RegisteredIPProtocolProfile_unload(string& errorMessage); int IP_OpenDRIM_RegisteredIPProtocolProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int IP_OpenDRIM_RegisteredIPProtocolProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_RegisteredIPProtocolProfile& instance, const char** properties, string& errorMessage); int IP_OpenDRIM_RegisteredIPProtocolProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredIPProtocolProfile& newInstance, const OpenDRIM_RegisteredIPProtocolProfile& oldInstance, const char** properties, string& errorMessage); int IP_OpenDRIM_RegisteredIPProtocolProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredIPProtocolProfile& instance, string& errorMessage); int IP_OpenDRIM_RegisteredIPProtocolProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredIPProtocolProfile& instance, string& errorMessage); int IP_OpenDRIM_RegisteredIPProtocolProfile_populate(OpenDRIM_RegisteredIPProtocolProfile& instance, string& errorMessage); #endif /*OPENDRIM_REGISTEREDIPPROTOCOLPROFILEACCESS_H_*/ ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_RegisteredIPProtocolProfile/OpenDRIM_RegisteredIPProtocolProfile.hopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_RegisteredIPProtocolProfile/OpenDRIM_RegisteredIPProtocolProfile.0000644000175000017500000001357511377667034034263 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #ifndef OPENDRIM_REGISTEREDIPPROTOCOLPROFILE_H_ #define OPENDRIM_REGISTEREDIPPROTOCOLPROFILE_H_ #include const static char* OpenDRIM_RegisteredIPProtocolProfile_classnames[] = {"OpenDRIM_RegisteredIPProtocolProfile"}; static string OpenDRIM_RegisteredIPProtocolProfile_NAMESPACE = _INTEROP_NAMESPACE; class OpenDRIM_RegisteredIPProtocolProfile { 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_RegisteredIPProtocolProfile() { 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_RegisteredIPProtocolProfile() {} 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_REGISTEREDIPPROTOCOLPROFILE_H_*/ ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_RegisteredIPProtocolProfile/cmpiOpenDRIM_RegisteredIPProtocolProfile.hopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_RegisteredIPProtocolProfile/cmpiOpenDRIM_RegisteredIPProtocolProf0000644000175000017500000000444411377667034034357 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #ifndef CMPIOPENDRIM_REGISTEREDIPPROTOCOLPROFILE_H_ #define CMPIOPENDRIM_REGISTEREDIPPROTOCOLPROFILE_H_ #include "OpenDRIM_RegisteredIPProtocolProfile.h" CMPIObjectPath* IP_OpenDRIM_RegisteredIPProtocolProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RegisteredIPProtocolProfile& instance); CMPIInstance* IP_OpenDRIM_RegisteredIPProtocolProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RegisteredIPProtocolProfile& instance); void IP_OpenDRIM_RegisteredIPProtocolProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RegisteredIPProtocolProfile& instance); void IP_OpenDRIM_RegisteredIPProtocolProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RegisteredIPProtocolProfile& instance); #endif /*CMPIOPENDRIM_REGISTEREDIPPROTOCOLPROFILE_H_*/ ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_RegisteredIPProtocolProfile/OpenDRIM_RegisteredIPProtocolProfileAccess.cppopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_RegisteredIPProtocolProfile/OpenDRIM_RegisteredIPProtocolProfileA0000644000175000017500000000754611377667034034307 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #include "OpenDRIM_RegisteredIPProtocolProfileAccess.h" const string InstanceID="OpenDRIM:IPInterface:1.0.1"; int IP_OpenDRIM_RegisteredIPProtocolProfile_load(const CMPIBroker* broker, string& errorMessage) { _E_; _L_; return OK; } int IP_OpenDRIM_RegisteredIPProtocolProfile_unload(string& errorMessage) { _E_; _L_; return OK; } int IP_OpenDRIM_RegisteredIPProtocolProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; OpenDRIM_RegisteredIPProtocolProfile instance; instance.setInstanceID(InstanceID); if(discriminant=="ei") CF_assert(IP_OpenDRIM_RegisteredIPProtocolProfile_populate(instance,errorMessage)); result.push_back(instance); _L_; return OK; } int IP_OpenDRIM_RegisteredIPProtocolProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_RegisteredIPProtocolProfile& instance, const char** properties, string& errorMessage) { _E_; if (instance.InstanceID!=InstanceID) { errorMessage = "No instance"; return NOT_FOUND; } CF_assert(IP_OpenDRIM_RegisteredIPProtocolProfile_populate(instance,errorMessage)); _L_; return OK; } int IP_OpenDRIM_RegisteredIPProtocolProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredIPProtocolProfile& newInstance, const OpenDRIM_RegisteredIPProtocolProfile& oldInstance, const char** properties, string& errorMessage) { _E_; _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_RegisteredIPProtocolProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredIPProtocolProfile& instance, string& errorMessage) { _E_; _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_RegisteredIPProtocolProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredIPProtocolProfile& instance, string& errorMessage) { _E_; _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_RegisteredIPProtocolProfile_populate(OpenDRIM_RegisteredIPProtocolProfile& instance, string& errorMessage) { _E_; vector AdvertiseTypes; instance.setRegisteredName("IP Interface"); instance.setRegisteredVersion("1.0.1"); instance.setRegisteredOrganization(2); // DMTF AdvertiseTypes.push_back(2); // Not Advertised instance.setAdvertiseTypes(AdvertiseTypes); _L_; return OK; } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_RegisteredIPProtocolProfile/cmpiOpenDRIM_RegisteredIPProtocolProfile.cppopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_RegisteredIPProtocolProfile/cmpiOpenDRIM_RegisteredIPProtocolProf0000644000175000017500000001156311377667034034357 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredIPProtocolProfile.h" CMPIObjectPath* IP_OpenDRIM_RegisteredIPProtocolProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RegisteredIPProtocolProfile& instance) { _E_; Objectpath op(broker, OpenDRIM_RegisteredIPProtocolProfile_classnames[0], OpenDRIM_RegisteredIPProtocolProfile_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* IP_OpenDRIM_RegisteredIPProtocolProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RegisteredIPProtocolProfile& instance) { _E_; Objectpath op(broker, IP_OpenDRIM_RegisteredIPProtocolProfile_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 IP_OpenDRIM_RegisteredIPProtocolProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RegisteredIPProtocolProfile& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void IP_OpenDRIM_RegisteredIPProtocolProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RegisteredIPProtocolProfile& 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_; } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_RegisteredIPProtocolProfile/OpenDRIM_RegisteredIPProtocolProfileProvider.cppopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_RegisteredIPProtocolProfile/OpenDRIM_RegisteredIPProtocolProfileP0000644000175000017500000002634311377667034034322 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2008 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 , , ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredIPProtocolProfile.h" #include "OpenDRIM_RegisteredIPProtocolProfileAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define IP_OpenDRIM_RegisteredIPProtocolProfileProviderSetInstance IP_OpenDRIM_RegisteredIPProtocolProfileProviderModifyInstance #endif int IP_OpenDRIM_RegisteredIPProtocolProfile_init(const CMPIBroker* broker); int IP_OpenDRIM_RegisteredIPProtocolProfile_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus IP_OpenDRIM_RegisteredIPProtocolProfileProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = IP_OpenDRIM_RegisteredIPProtocolProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus IP_OpenDRIM_RegisteredIPProtocolProfileProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = IP_OpenDRIM_RegisteredIPProtocolProfile_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredIPProtocolProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = IP_OpenDRIM_RegisteredIPProtocolProfile_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_RegisteredIPProtocolProfileProviderEnumInstances(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 = IP_OpenDRIM_RegisteredIPProtocolProfile_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredIPProtocolProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = IP_OpenDRIM_RegisteredIPProtocolProfile_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_RegisteredIPProtocolProfileProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredIPProtocolProfile instance; IP_OpenDRIM_RegisteredIPProtocolProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = IP_OpenDRIM_RegisteredIPProtocolProfile_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredIPProtocolProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = IP_OpenDRIM_RegisteredIPProtocolProfile_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_RegisteredIPProtocolProfileProviderSetInstance(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_RegisteredIPProtocolProfile newInstance, oldInstance; IP_OpenDRIM_RegisteredIPProtocolProfile_toCPP(_broker, ci, newInstance); IP_OpenDRIM_RegisteredIPProtocolProfile_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = IP_OpenDRIM_RegisteredIPProtocolProfile_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredIPProtocolProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_RegisteredIPProtocolProfile_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredIPProtocolProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_RegisteredIPProtocolProfileProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredIPProtocolProfile instance; IP_OpenDRIM_RegisteredIPProtocolProfile_toCPP(_broker, ci, instance); string errorMessage; int errorCode = IP_OpenDRIM_RegisteredIPProtocolProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_RegisteredIPProtocolProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_RegisteredIPProtocolProfile_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredIPProtocolProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_RegisteredIPProtocolProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredIPProtocolProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = IP_OpenDRIM_RegisteredIPProtocolProfile_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_RegisteredIPProtocolProfileProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredIPProtocolProfile instance; IP_OpenDRIM_RegisteredIPProtocolProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = IP_OpenDRIM_RegisteredIPProtocolProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredIPProtocolProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_RegisteredIPProtocolProfile_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredIPProtocolProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_RegisteredIPProtocolProfileProviderExecQuery(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 IP_OpenDRIM_RegisteredIPProtocolProfile_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = IP_OpenDRIM_RegisteredIPProtocolProfile_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "IP_OpenDRIM_RegisteredIPProtocolProfile_init FAILED: " + (string) OpenDRIM_RegisteredIPProtocolProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int IP_OpenDRIM_RegisteredIPProtocolProfile_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = IP_OpenDRIM_RegisteredIPProtocolProfile_unload(errorMessage); if (errorCode != OK) { errorMessage += "IP_OpenDRIM_RegisteredIPProtocolProfile_unload FAILED: " + (string) OpenDRIM_RegisteredIPProtocolProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define IP_OpenDRIM_RegisteredIPProtocolProfile_INIT if (IP_OpenDRIM_RegisteredIPProtocolProfile_init(_broker) < 0) return NULL CMInstanceMIStub(IP_OpenDRIM_RegisteredIPProtocolProfileProvider, IP_OpenDRIM_RegisteredIPProtocolProfileProvider, _broker, IP_OpenDRIM_RegisteredIPProtocolProfile_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-ip-1.1.2~ppa/COPYING0000644000175000017500000004310311377667034017227 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-ip-1.1.2~ppa/OpenDRIM_Gateway/0000755000175000017500000000000011377667034021231 5ustar guillaumeguillaumeopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_Gateway/cmpiOpenDRIM_Gateway.cpp0000644000175000017500000002336211377667034025652 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_Gateway.h" CMPIObjectPath* IP_OpenDRIM_Gateway_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_Gateway& instance) { _E_; Objectpath op(broker, OpenDRIM_Gateway_classnames[0], OpenDRIM_Gateway_NAMESPACE); if (!instance.SystemCreationClassName_isNULL) op.addKey("SystemCreationClassName", instance.SystemCreationClassName); if (!instance.SystemName_isNULL) op.addKey("SystemName", instance.SystemName); if (!instance.CreationClassName_isNULL) op.addKey("CreationClassName", instance.CreationClassName); if (!instance.Name_isNULL) op.addKey("Name", instance.Name); _L_; return op.getHdl(); } CMPIInstance* IP_OpenDRIM_Gateway_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_Gateway& instance) { _E_; Objectpath op(broker, IP_OpenDRIM_Gateway_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.InstallDate_isNULL) ci.setPropertyDatetime("InstallDate", instance.InstallDate); if (!instance.OperationalStatus_isNULL) ci.setProperty("OperationalStatus", instance.OperationalStatus); if (!instance.StatusDescriptions_isNULL) ci.setProperty("StatusDescriptions", instance.StatusDescriptions); if (!instance.Status_isNULL) ci.setProperty("Status", instance.Status); if (!instance.HealthState_isNULL) ci.setProperty("HealthState", instance.HealthState); if (!instance.PrimaryStatus_isNULL) ci.setProperty("PrimaryStatus", instance.PrimaryStatus); if (!instance.DetailedStatus_isNULL) ci.setProperty("DetailedStatus", instance.DetailedStatus); if (!instance.OperatingStatus_isNULL) ci.setProperty("OperatingStatus", instance.OperatingStatus); if (!instance.CommunicationStatus_isNULL) ci.setProperty("CommunicationStatus", instance.CommunicationStatus); if (!instance.EnabledState_isNULL) ci.setProperty("EnabledState", instance.EnabledState); if (!instance.OtherEnabledState_isNULL) ci.setProperty("OtherEnabledState", instance.OtherEnabledState); if (!instance.RequestedState_isNULL) ci.setProperty("RequestedState", instance.RequestedState); if (!instance.EnabledDefault_isNULL) ci.setProperty("EnabledDefault", instance.EnabledDefault); if (!instance.TimeOfLastStateChange_isNULL) ci.setPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange); if (!instance.AvailableRequestedStates_isNULL) ci.setProperty("AvailableRequestedStates", instance.AvailableRequestedStates); if (!instance.TransitioningToState_isNULL) ci.setProperty("TransitioningToState", instance.TransitioningToState); if (!instance.AccessInfo_isNULL) ci.setProperty("AccessInfo", instance.AccessInfo); if (!instance.InfoFormat_isNULL) ci.setProperty("InfoFormat", instance.InfoFormat); if (!instance.OtherInfoFormatDescription_isNULL) ci.setProperty("OtherInfoFormatDescription", instance.OtherInfoFormatDescription); if (!instance.AccessContext_isNULL) ci.setProperty("AccessContext", instance.AccessContext); if (!instance.OtherAccessContext_isNULL) ci.setProperty("OtherAccessContext", instance.OtherAccessContext); _L_; return ci.getHdl(); } void IP_OpenDRIM_Gateway_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_Gateway& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (op.getKey("Name", instance.Name) == OK) instance.Name_isNULL = false; if (op.getKey("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (op.getKey("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; _L_; } void IP_OpenDRIM_Gateway_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_Gateway& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getPropertyDatetime("InstallDate", instance.InstallDate) == OK) instance.InstallDate_isNULL = false; if (inst.getProperty("OperationalStatus", instance.OperationalStatus) == OK) instance.OperationalStatus_isNULL = false; if (inst.getProperty("StatusDescriptions", instance.StatusDescriptions) == OK) instance.StatusDescriptions_isNULL = false; if (inst.getProperty("Status", instance.Status) == OK) instance.Status_isNULL = false; if (inst.getProperty("HealthState", instance.HealthState) == OK) instance.HealthState_isNULL = false; if (inst.getProperty("PrimaryStatus", instance.PrimaryStatus) == OK) instance.PrimaryStatus_isNULL = false; if (inst.getProperty("DetailedStatus", instance.DetailedStatus) == OK) instance.DetailedStatus_isNULL = false; if (inst.getProperty("OperatingStatus", instance.OperatingStatus) == OK) instance.OperatingStatus_isNULL = false; if (inst.getProperty("CommunicationStatus", instance.CommunicationStatus) == OK) instance.CommunicationStatus_isNULL = false; if (inst.getProperty("EnabledState", instance.EnabledState) == OK) instance.EnabledState_isNULL = false; if (inst.getProperty("OtherEnabledState", instance.OtherEnabledState) == OK) instance.OtherEnabledState_isNULL = false; if (inst.getProperty("RequestedState", instance.RequestedState) == OK) instance.RequestedState_isNULL = false; if (inst.getProperty("EnabledDefault", instance.EnabledDefault) == OK) instance.EnabledDefault_isNULL = false; if (inst.getPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange) == OK) instance.TimeOfLastStateChange_isNULL = false; if (inst.getProperty("AvailableRequestedStates", instance.AvailableRequestedStates) == OK) instance.AvailableRequestedStates_isNULL = false; if (inst.getProperty("TransitioningToState", instance.TransitioningToState) == OK) instance.TransitioningToState_isNULL = false; if (inst.getProperty("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (inst.getProperty("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (inst.getProperty("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; if (inst.getProperty("Name", instance.Name) == OK) instance.Name_isNULL = false; if (inst.getProperty("AccessInfo", instance.AccessInfo) == OK) instance.AccessInfo_isNULL = false; if (inst.getProperty("InfoFormat", instance.InfoFormat) == OK) instance.InfoFormat_isNULL = false; if (inst.getProperty("OtherInfoFormatDescription", instance.OtherInfoFormatDescription) == OK) instance.OtherInfoFormatDescription_isNULL = false; if (inst.getProperty("AccessContext", instance.AccessContext) == OK) instance.AccessContext_isNULL = false; if (inst.getProperty("OtherAccessContext", instance.OtherAccessContext) == OK) instance.OtherAccessContext_isNULL = false; _L_; } void IP_OpenDRIM_Gateway_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Gateway_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 IP_OpenDRIM_Gateway_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_Gateway_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-ip-1.1.2~ppa/OpenDRIM_Gateway/Makefile.am0000644000175000017500000000370411377667034023271 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiIP_OpenDRIM_GatewayProvider.la libcmpiIP_OpenDRIM_GatewayProvider_la_SOURCES = OpenDRIM_GatewayAccess.cpp OpenDRIM_GatewayProvider.cpp cmpiOpenDRIM_Gateway.cpp libcmpiIP_OpenDRIM_GatewayProvider_la_LIBADD = ../Common/libcmpiIP_Common.la libcmpiIP_OpenDRIM_GatewayProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_Gateway.h OpenDRIM_Gateway.h OpenDRIM_GatewayAccess.h opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_Gateway/OpenDRIM_GatewayProvider.cpp0000644000175000017500000003110411377667034026505 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_Gateway.h" #include "OpenDRIM_GatewayAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define IP_OpenDRIM_GatewayProviderSetInstance IP_OpenDRIM_GatewayProviderModifyInstance #endif int IP_OpenDRIM_Gateway_init(const CMPIBroker* broker); int IP_OpenDRIM_Gateway_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus IP_OpenDRIM_GatewayProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = IP_OpenDRIM_Gateway_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus IP_OpenDRIM_GatewayProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = IP_OpenDRIM_Gateway_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = IP_OpenDRIM_Gateway_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_GatewayProviderEnumInstances(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 = IP_OpenDRIM_Gateway_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = IP_OpenDRIM_Gateway_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_GatewayProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_Gateway instance; IP_OpenDRIM_Gateway_toCPP(_broker, cop, instance); string errorMessage; int errorCode = IP_OpenDRIM_Gateway_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = IP_OpenDRIM_Gateway_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_GatewayProviderSetInstance(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_Gateway newInstance, oldInstance; IP_OpenDRIM_Gateway_toCPP(_broker, ci, newInstance); IP_OpenDRIM_Gateway_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = IP_OpenDRIM_Gateway_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_Gateway_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_GatewayProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_Gateway instance; IP_OpenDRIM_Gateway_toCPP(_broker, ci, instance); string errorMessage; int errorCode = IP_OpenDRIM_Gateway_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_Gateway_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_Gateway_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = IP_OpenDRIM_Gateway_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_GatewayProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_Gateway instance; IP_OpenDRIM_Gateway_toCPP(_broker, cop, instance); string errorMessage; int errorCode = IP_OpenDRIM_Gateway_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_Gateway_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_GatewayProviderExecQuery(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 IP_OpenDRIM_GatewayProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = IP_OpenDRIM_Gateway_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus IP_OpenDRIM_GatewayProviderInvokeMethod(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_Gateway instance; IP_OpenDRIM_Gateway_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"SystemCreationClassName", "Name", "SystemName", "CreationClassName"}; int errorCode = IP_OpenDRIM_Gateway_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_Gateway_RequestStateChange_In inArgs; IP_OpenDRIM_Gateway_toCPP(_broker, in, inArgs); OpenDRIM_Gateway_RequestStateChange_Out outArgs; errorCode = IP_OpenDRIM_Gateway_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Gateway_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } IP_OpenDRIM_Gateway_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else { errorMessage = (string) OpenDRIM_Gateway_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 IP_OpenDRIM_Gateway_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = IP_OpenDRIM_Gateway_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "IP_OpenDRIM_Gateway_init FAILED: " + (string) OpenDRIM_Gateway_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int IP_OpenDRIM_Gateway_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = IP_OpenDRIM_Gateway_unload(errorMessage); if (errorCode != OK) { errorMessage += "IP_OpenDRIM_Gateway_unload FAILED: " + (string) OpenDRIM_Gateway_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define IP_OpenDRIM_Gateway_INIT if (IP_OpenDRIM_Gateway_init(_broker) < 0) return NULL CMInstanceMIStub(IP_OpenDRIM_GatewayProvider, IP_OpenDRIM_GatewayProvider, _broker, IP_OpenDRIM_Gateway_INIT); CMMethodMIStub(IP_OpenDRIM_GatewayProvider, IP_OpenDRIM_GatewayProvider, _broker, IP_OpenDRIM_Gateway_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_Gateway/OpenDRIM_GatewayAccess.cpp0000644000175000017500000001177211377667034026125 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_GatewayAccess.h" #include "Common/IP_Common.h" static const string systemCreationClassName = "OpenDRIM_ComputerSystem"; static const string creationClassName = "OpenDRIM_Gateway"; // "OpenDRIM_IPProtocolEndpoint"; static string systemName; int IP_OpenDRIM_Gateway_load(const CMPIBroker* broker, string& errorMessage) { _E_; CF_assert(CF_getSystemName(systemName, errorMessage)); _L_; return OK; } int IP_OpenDRIM_Gateway_unload(string& errorMessage) { _E_; // Nothing _L_; return OK; } int IP_OpenDRIM_Gateway_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; vector eth_names; CF_assert(CF_getEthernetPortNames(eth_names, errorMessage)); //Initialize an instance OpenDRIM_Gateway instance; instance.setSystemCreationClassName(systemCreationClassName); instance.setCreationClassName(creationClassName); instance.setSystemName(systemName); for(unsigned int i=0;i if_names; vector::size_type index; CF_assert(CF_getEthernetPortNames(if_names, errorMessage)); if (instance.SystemCreationClassName == systemCreationClassName && instance.CreationClassName == creationClassName && instance.SystemName == systemName && CF_foundInList(instance.Name,if_names,index)) { CF_assert(IP_OpenDRIM_Gateway_populate(instance,errorMessage)); } else { errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int IP_OpenDRIM_Gateway_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Gateway& newInstance, const OpenDRIM_Gateway& oldInstance, const char** properties, string& errorMessage) { _E_; _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_Gateway_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Gateway& instance, string& errorMessage) { _E_; _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_Gateway_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Gateway& instance, string& errorMessage) { _E_; _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_Gateway_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Gateway& instance, unsigned int& returnValue, const OpenDRIM_Gateway_RequestStateChange_In& in, OpenDRIM_Gateway_RequestStateChange_Out& out, string& errorMessage) { _E_; _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_Gateway_populate(OpenDRIM_Gateway& instance, string& errorMessage) { _E_; /* * Properties to fill from profile * + Mandatory: * [X] SystemCreationClassName [KEY] * [X] CreationClassName [KEY] * [X] SystemName [KEY] * [X] Name [KEY] * [X] AccessContext * [X] AccessInfo * [X] InfoFormat * [X] ElementName */ string gateway; CF_assert(CF_getDefaultGateway(instance.Name,gateway,errorMessage)); instance.setAccessContext(2); // Default Gateway instance.setAccessInfo(gateway); instance.setInfoFormat(3); //IPv4 instance.setElementName(instance.Name+" Default Gateway"); _L_; return OK; } opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_Gateway/OpenDRIM_Gateway.h0000644000175000017500000003406111377667034024444 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_GATEWAY_H_ #define OPENDRIM_GATEWAY_H_ #include const static char* OpenDRIM_Gateway_classnames[] = {"OpenDRIM_Gateway"}; static string OpenDRIM_Gateway_NAMESPACE = _NAMESPACE; class OpenDRIM_Gateway { public: string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string InstallDate; bool InstallDate_isNULL; vector OperationalStatus; bool OperationalStatus_isNULL; vector StatusDescriptions; bool StatusDescriptions_isNULL; string Status; bool Status_isNULL; unsigned short HealthState; bool HealthState_isNULL; unsigned short PrimaryStatus; bool PrimaryStatus_isNULL; unsigned short DetailedStatus; bool DetailedStatus_isNULL; unsigned short OperatingStatus; bool OperatingStatus_isNULL; unsigned short CommunicationStatus; bool CommunicationStatus_isNULL; unsigned short EnabledState; bool EnabledState_isNULL; string OtherEnabledState; bool OtherEnabledState_isNULL; unsigned short RequestedState; bool RequestedState_isNULL; unsigned short EnabledDefault; bool EnabledDefault_isNULL; string TimeOfLastStateChange; bool TimeOfLastStateChange_isNULL; vector AvailableRequestedStates; bool AvailableRequestedStates_isNULL; unsigned short TransitioningToState; bool TransitioningToState_isNULL; string SystemCreationClassName; bool SystemCreationClassName_isNULL; string SystemName; bool SystemName_isNULL; string CreationClassName; bool CreationClassName_isNULL; string Name; bool Name_isNULL; string AccessInfo; bool AccessInfo_isNULL; unsigned short InfoFormat; bool InfoFormat_isNULL; string OtherInfoFormatDescription; bool OtherInfoFormatDescription_isNULL; unsigned short AccessContext; bool AccessContext_isNULL; string OtherAccessContext; bool OtherAccessContext_isNULL; OpenDRIM_Gateway() { Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstallDate_isNULL = true; OperationalStatus_isNULL = true; StatusDescriptions_isNULL = true; Status_isNULL = true; HealthState_isNULL = true; PrimaryStatus_isNULL = true; DetailedStatus_isNULL = true; OperatingStatus_isNULL = true; CommunicationStatus_isNULL = true; EnabledState_isNULL = true; OtherEnabledState_isNULL = true; RequestedState_isNULL = true; EnabledDefault_isNULL = true; TimeOfLastStateChange_isNULL = true; AvailableRequestedStates_isNULL = true; TransitioningToState_isNULL = true; SystemCreationClassName_isNULL = true; SystemName_isNULL = true; CreationClassName_isNULL = true; Name_isNULL = true; AccessInfo_isNULL = true; InfoFormat_isNULL = true; OtherInfoFormatDescription_isNULL = true; AccessContext_isNULL = true; OtherAccessContext_isNULL = true; } ~OpenDRIM_Gateway() {} string getKeys() const { return CF_toLowCase(".SystemCreationClassName=\"" + CF_quoteString(SystemCreationClassName) + "\""".SystemName=\"" + CF_quoteString(SystemName) + "\""".CreationClassName=\"" + CF_quoteString(CreationClassName) + "\""".Name=\"" + CF_quoteString(Name) + "\""); } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getInstallDate(string& value) const { if (InstallDate_isNULL==true) return NOT_FOUND; value = InstallDate; return OK; } int setInstallDate(const string& newValue) { InstallDate = newValue; InstallDate_isNULL = false; return OK; } int getOperationalStatus(vector& value) const { if (OperationalStatus_isNULL==true) return NOT_FOUND; value = OperationalStatus; return OK; } int setOperationalStatus(const vector& newValue) { OperationalStatus = newValue; OperationalStatus_isNULL = false; return OK; } int getStatusDescriptions(vector& value) const { if (StatusDescriptions_isNULL==true) return NOT_FOUND; value = StatusDescriptions; return OK; } int setStatusDescriptions(const vector& newValue) { StatusDescriptions = newValue; StatusDescriptions_isNULL = false; return OK; } int getStatus(string& value) const { if (Status_isNULL==true) return NOT_FOUND; value = Status; return OK; } int setStatus(const string& newValue) { Status = newValue; Status_isNULL = false; return OK; } int getHealthState(unsigned short& value) const { if (HealthState_isNULL==true) return NOT_FOUND; value = HealthState; return OK; } int setHealthState(const unsigned short& newValue) { HealthState = newValue; HealthState_isNULL = false; return OK; } int getPrimaryStatus(unsigned short& value) const { if (PrimaryStatus_isNULL==true) return NOT_FOUND; value = PrimaryStatus; return OK; } int setPrimaryStatus(const unsigned short& newValue) { PrimaryStatus = newValue; PrimaryStatus_isNULL = false; return OK; } int getDetailedStatus(unsigned short& value) const { if (DetailedStatus_isNULL==true) return NOT_FOUND; value = DetailedStatus; return OK; } int setDetailedStatus(const unsigned short& newValue) { DetailedStatus = newValue; DetailedStatus_isNULL = false; return OK; } int getOperatingStatus(unsigned short& value) const { if (OperatingStatus_isNULL==true) return NOT_FOUND; value = OperatingStatus; return OK; } int setOperatingStatus(const unsigned short& newValue) { OperatingStatus = newValue; OperatingStatus_isNULL = false; return OK; } int getCommunicationStatus(unsigned short& value) const { if (CommunicationStatus_isNULL==true) return NOT_FOUND; value = CommunicationStatus; return OK; } int setCommunicationStatus(const unsigned short& newValue) { CommunicationStatus = newValue; CommunicationStatus_isNULL = false; return OK; } int getEnabledState(unsigned short& value) const { if (EnabledState_isNULL==true) return NOT_FOUND; value = EnabledState; return OK; } int setEnabledState(const unsigned short& newValue) { EnabledState = newValue; EnabledState_isNULL = false; return OK; } int getOtherEnabledState(string& value) const { if (OtherEnabledState_isNULL==true) return NOT_FOUND; value = OtherEnabledState; return OK; } int setOtherEnabledState(const string& newValue) { OtherEnabledState = newValue; OtherEnabledState_isNULL = false; return OK; } int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL==true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getEnabledDefault(unsigned short& value) const { if (EnabledDefault_isNULL==true) return NOT_FOUND; value = EnabledDefault; return OK; } int setEnabledDefault(const unsigned short& newValue) { EnabledDefault = newValue; EnabledDefault_isNULL = false; return OK; } int getTimeOfLastStateChange(string& value) const { if (TimeOfLastStateChange_isNULL==true) return NOT_FOUND; value = TimeOfLastStateChange; return OK; } int setTimeOfLastStateChange(const string& newValue) { TimeOfLastStateChange = newValue; TimeOfLastStateChange_isNULL = false; return OK; } int getAvailableRequestedStates(vector& value) const { if (AvailableRequestedStates_isNULL==true) return NOT_FOUND; value = AvailableRequestedStates; return OK; } int setAvailableRequestedStates(const vector& newValue) { AvailableRequestedStates = newValue; AvailableRequestedStates_isNULL = false; return OK; } int getTransitioningToState(unsigned short& value) const { if (TransitioningToState_isNULL==true) return NOT_FOUND; value = TransitioningToState; return OK; } int setTransitioningToState(const unsigned short& newValue) { TransitioningToState = newValue; TransitioningToState_isNULL = false; return OK; } int getSystemCreationClassName(string& value) const { if (SystemCreationClassName_isNULL==true) return NOT_FOUND; value = SystemCreationClassName; return OK; } int setSystemCreationClassName(const string& newValue) { SystemCreationClassName = newValue; SystemCreationClassName_isNULL = false; return OK; } int getSystemName(string& value) const { if (SystemName_isNULL==true) return NOT_FOUND; value = SystemName; return OK; } int setSystemName(const string& newValue) { SystemName = newValue; SystemName_isNULL = false; return OK; } int getCreationClassName(string& value) const { if (CreationClassName_isNULL==true) return NOT_FOUND; value = CreationClassName; return OK; } int setCreationClassName(const string& newValue) { CreationClassName = newValue; CreationClassName_isNULL = false; return OK; } int 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 getAccessInfo(string& value) const { if (AccessInfo_isNULL==true) return NOT_FOUND; value = AccessInfo; return OK; } int setAccessInfo(const string& newValue) { AccessInfo = newValue; AccessInfo_isNULL = false; return OK; } int getInfoFormat(unsigned short& value) const { if (InfoFormat_isNULL==true) return NOT_FOUND; value = InfoFormat; return OK; } int setInfoFormat(const unsigned short& newValue) { InfoFormat = newValue; InfoFormat_isNULL = false; return OK; } int getOtherInfoFormatDescription(string& value) const { if (OtherInfoFormatDescription_isNULL==true) return NOT_FOUND; value = OtherInfoFormatDescription; return OK; } int setOtherInfoFormatDescription(const string& newValue) { OtherInfoFormatDescription = newValue; OtherInfoFormatDescription_isNULL = false; return OK; } int getAccessContext(unsigned short& value) const { if (AccessContext_isNULL==true) return NOT_FOUND; value = AccessContext; return OK; } int setAccessContext(const unsigned short& newValue) { AccessContext = newValue; AccessContext_isNULL = false; return OK; } int getOtherAccessContext(string& value) const { if (OtherAccessContext_isNULL==true) return NOT_FOUND; value = OtherAccessContext; return OK; } int setOtherAccessContext(const string& newValue) { OtherAccessContext = newValue; OtherAccessContext_isNULL = false; return OK; } }; class OpenDRIM_Gateway_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_Gateway_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_Gateway_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_Gateway_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_Gateway_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_Gateway_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_GATEWAY_H_*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_Gateway/OpenDRIM_GatewayAccess.h0000644000175000017500000000575711377667034025600 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_GATEWAYACCESS_H_ #define OPENDRIM_GATEWAYACCESS_H_ #include "IP_Common.h" #include "OpenDRIM_Gateway.h" int IP_OpenDRIM_Gateway_load(const CMPIBroker* broker, string& errorMessage); int IP_OpenDRIM_Gateway_unload(string& errorMessage); int IP_OpenDRIM_Gateway_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int IP_OpenDRIM_Gateway_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_Gateway& instance, const char** properties, string& errorMessage); int IP_OpenDRIM_Gateway_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Gateway& newInstance, const OpenDRIM_Gateway& oldInstance, const char** properties, string& errorMessage); int IP_OpenDRIM_Gateway_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Gateway& instance, string& errorMessage); int IP_OpenDRIM_Gateway_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Gateway& instance, string& errorMessage); int IP_OpenDRIM_Gateway_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Gateway& instance, unsigned int& returnValue, const OpenDRIM_Gateway_RequestStateChange_In& in, OpenDRIM_Gateway_RequestStateChange_Out& out, string& errorMessage); int IP_OpenDRIM_Gateway_populate(OpenDRIM_Gateway& instance, string& errorMessage); #endif /*OPENDRIM_GATEWAYACCESS_H_*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_Gateway/cmpiOpenDRIM_Gateway.h0000644000175000017500000000451611377667034025317 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_GATEWAY_H_ #define CMPIOPENDRIM_GATEWAY_H_ #include "OpenDRIM_Gateway.h" CMPIObjectPath* IP_OpenDRIM_Gateway_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_Gateway& instance); CMPIInstance* IP_OpenDRIM_Gateway_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_Gateway& instance); void IP_OpenDRIM_Gateway_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_Gateway& instance); void IP_OpenDRIM_Gateway_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_Gateway& instance); void IP_OpenDRIM_Gateway_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Gateway_RequestStateChange_In& args); void IP_OpenDRIM_Gateway_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_Gateway_RequestStateChange_Out& args); #endif /*CMPIOPENDRIM_GATEWAY_H_*/ opendrim-lmp-ip-1.1.2~ppa/NEWS0000644000175000017500000000047111404314132016647 0ustar guillaumeguillaumeChanges in 1.1.2 ========================= - Code adjustement Changes in 1.1.0 ========================= Provider conformed to DMTF Base Server Profile 1.0.0 + Code update and fixes added + RPM spec file added + make pkg-src and pkg-rpm commands added Initial Release 1.0.0 ========================= // TODO opendrim-lmp-ip-1.1.2~ppa/LICENSE0000644000175000017500000000300411377667034017175 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ################################################################################ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IP2ComputerSystem/0000755000175000017500000000000011377667034023146 5ustar guillaumeguillaumeopendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IP2ComputerSystem/assocOpenDRIM_IP2ComputerSystem.h0000644000175000017500000000614411377667034031330 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_IP2COMPUTERSYSTEM_H_ #define ASSOCOPENDRIM_IP2COMPUTERSYSTEM_H_ #include "OpenDRIM_IP2ComputerSystemAccess.h" int IP_OpenDRIM_IP2ComputerSystem_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 IP_OpenDRIM_IP2ComputerSystem_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 IP_OpenDRIM_IP2ComputerSystem_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int IP_OpenDRIM_IP2ComputerSystem_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int IP_OpenDRIM_IP2ComputerSystem_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int IP_OpenDRIM_IP2ComputerSystem_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_IP2COMPUTERSYSTEM_H_*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IP2ComputerSystem/OpenDRIM_IP2ComputerSystemAccess.cpp0000644000175000017500000002421411377667034031752 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_IP2ComputerSystemAccess.h" int IP_OpenDRIM_IP2ComputerSystem_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(IP_CIM_System_load(broker, errorMessage)); CF_assert(IP_CIM_ServiceAccessPoint_load(broker, errorMessage)); */ // TODO _L_; return OK; } int IP_OpenDRIM_IP2ComputerSystem_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(IP_CIM_System_unload(errorMessage)); CF_assert(IP_CIM_ServiceAccessPoint_unload(errorMessage)); */ // TODO _L_; return OK; } int IP_OpenDRIM_IP2ComputerSystem_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // Determine if the association can be established or not string computerSystem_name; CF_assert(Antecedent.getProperty("Name", computerSystem_name)); string IP_systemName; CF_assert(Dependent.getProperty("SystemName", IP_systemName)); if (computerSystem_name==IP_systemName) isAssociated=true; else isAssociated=false; _L_; return OK; } int IP_OpenDRIM_IP2ComputerSystem_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(IP_OpenDRIM_IP2ComputerSystem_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(IP_OpenDRIM_IP2ComputerSystem_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; IP_OpenDRIM_IP2ComputerSystem_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(IP_OpenDRIM_IP2ComputerSystem_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int IP_OpenDRIM_IP2ComputerSystem_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_IP2ComputerSystem& 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(IP_OpenDRIM_IP2ComputerSystem_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(IP_OpenDRIM_IP2ComputerSystem_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(IP_OpenDRIM_IP2ComputerSystem_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int IP_OpenDRIM_IP2ComputerSystem_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IP2ComputerSystem& newInstance, const OpenDRIM_IP2ComputerSystem& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_IP2ComputerSystem_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IP2ComputerSystem& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_IP2ComputerSystem_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IP2ComputerSystem& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int IP_OpenDRIM_IP2ComputerSystem_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(IP_OpenDRIM_IP2ComputerSystem_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(IP_OpenDRIM_IP2ComputerSystem_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(IP_OpenDRIM_IP2ComputerSystem_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(IP_OpenDRIM_IP2ComputerSystem_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(IP_OpenDRIM_IP2ComputerSystem_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(IP_OpenDRIM_IP2ComputerSystem_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_IP2ComputerSystem_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_IP2ComputerSystem instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); OpenDRIM_IP2ComputerSystem_instances.push_back(instance); } _L_; return OK; } int IP_OpenDRIM_IP2ComputerSystem_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_IP2ComputerSystem_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_IP2ComputerSystem instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); OpenDRIM_IP2ComputerSystem_instances.push_back(instance); } _L_; return OK; } int IP_OpenDRIM_IP2ComputerSystem_populate(OpenDRIM_IP2ComputerSystem& instance, string& errorMessage) { _E_; _L_; return OK; } opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IP2ComputerSystem/Makefile.am0000644000175000017500000000463411377667034025211 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiIP_OpenDRIM_IP2ComputerSystemProvider.la libcmpiIP_OpenDRIM_IP2ComputerSystemProvider_la_SOURCES = OpenDRIM_IP2ComputerSystemAccess.cpp OpenDRIM_IP2ComputerSystemProvider.cpp cmpiOpenDRIM_IP2ComputerSystem.cpp assocOpenDRIM_IP2ComputerSystem.cpp # May have to be adjusted for direct invocation libcmpiIP_OpenDRIM_IP2ComputerSystemProvider_la_CPPFLAGS = -I../CIM_System -I../CIM_ServiceAccessPoint # Uncomment the end for direct invocation, may have to be adjusted libcmpiIP_OpenDRIM_IP2ComputerSystemProvider_la_LIBADD = ../Common/libcmpiIP_Common.la #../CIM_System/libcmpiIP_CIM_SystemProvider.la ../CIM_ServiceAccessPoint/libcmpiIP_CIM_ServiceAccessPointProvider.la libcmpiIP_OpenDRIM_IP2ComputerSystemProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_IP2ComputerSystem.h OpenDRIM_IP2ComputerSystem.h OpenDRIM_IP2ComputerSystemAccess.h opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IP2ComputerSystem/OpenDRIM_IP2ComputerSystem.h0000644000175000017500000000662211377667034030300 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_IP2COMPUTERSYSTEM_H_ #define OPENDRIM_IP2COMPUTERSYSTEM_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_System.h" #include "CIM_SystemAccess.h" #include "cmpiCIM_ServiceAccessPoint.h" #include "CIM_ServiceAccessPointAccess.h" */ const static char* OpenDRIM_IP2ComputerSystem_classnames[] = {"OpenDRIM_IP2ComputerSystem"}; static string OpenDRIM_IP2ComputerSystem_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"OpenDRIM_ComputerSystem"}; const static string Antecedent_NAMESPACE = _NAMESPACE; const static string Dependent_role = "Dependent"; const static char* Dependent_classnames[] = {"OpenDRIM_IPProtocolEndpoint"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_IP2ComputerSystem { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; OpenDRIM_IP2ComputerSystem() { Antecedent_isNULL = true; Dependent_isNULL = true; } ~OpenDRIM_IP2ComputerSystem() {} 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_IP2COMPUTERSYSTEM_H_*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IP2ComputerSystem/cmpiOpenDRIM_IP2ComputerSystem.cpp0000644000175000017500000000602311377667034031477 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_IP2ComputerSystem.h" CMPIObjectPath* IP_OpenDRIM_IP2ComputerSystem_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_IP2ComputerSystem& instance) { _E_; Objectpath op(broker, OpenDRIM_IP2ComputerSystem_classnames[0], OpenDRIM_IP2ComputerSystem_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* IP_OpenDRIM_IP2ComputerSystem_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_IP2ComputerSystem& instance) { _E_; Objectpath op(broker, IP_OpenDRIM_IP2ComputerSystem_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void IP_OpenDRIM_IP2ComputerSystem_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_IP2ComputerSystem& 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 IP_OpenDRIM_IP2ComputerSystem_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_IP2ComputerSystem& 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-ip-1.1.2~ppa/OpenDRIM_IP2ComputerSystem/assocOpenDRIM_IP2ComputerSystem.cpp0000644000175000017500000002053311377667034031661 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_IP2ComputerSystem.h" int IP_OpenDRIM_IP2ComputerSystem_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 = IP_OpenDRIM_IP2ComputerSystem_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(IP_OpenDRIM_IP2ComputerSystem_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(IP_OpenDRIM_IP2ComputerSystem_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int IP_OpenDRIM_IP2ComputerSystem_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(IP_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(IP_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, IP_CIM_System_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int IP_OpenDRIM_IP2ComputerSystem_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Antecedent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Antecedent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_System _instance; IP_CIM_System_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(IP_CIM_System_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, IP_CIM_System_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int IP_OpenDRIM_IP2ComputerSystem_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(IP_CIM_ServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(IP_CIM_ServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, IP_CIM_ServiceAccessPoint_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int IP_OpenDRIM_IP2ComputerSystem_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Dependent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Dependent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_ServiceAccessPoint _instance; IP_CIM_ServiceAccessPoint_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(IP_CIM_ServiceAccessPoint_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, IP_CIM_ServiceAccessPoint_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IP2ComputerSystem/cmpiOpenDRIM_IP2ComputerSystem.h0000644000175000017500000000430611377667034031146 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_IP2COMPUTERSYSTEM_H_ #define CMPIOPENDRIM_IP2COMPUTERSYSTEM_H_ #include "OpenDRIM_IP2ComputerSystem.h" CMPIObjectPath* IP_OpenDRIM_IP2ComputerSystem_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_IP2ComputerSystem& instance); CMPIInstance* IP_OpenDRIM_IP2ComputerSystem_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_IP2ComputerSystem& instance); void IP_OpenDRIM_IP2ComputerSystem_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_IP2ComputerSystem& instance); void IP_OpenDRIM_IP2ComputerSystem_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_IP2ComputerSystem& instance); #endif /*CMPIOPENDRIM_IP2COMPUTERSYSTEM_H_*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IP2ComputerSystem/OpenDRIM_IP2ComputerSystemProvider.cpp0000644000175000017500000004105111377667034032341 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_IP2ComputerSystem.h" #include "OpenDRIM_IP2ComputerSystemAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define IP_OpenDRIM_IP2ComputerSystemProviderSetInstance IP_OpenDRIM_IP2ComputerSystemProviderModifyInstance #endif int IP_OpenDRIM_IP2ComputerSystem_init(const CMPIBroker* broker); int IP_OpenDRIM_IP2ComputerSystem_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus IP_OpenDRIM_IP2ComputerSystemProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = IP_OpenDRIM_IP2ComputerSystem_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus IP_OpenDRIM_IP2ComputerSystemProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = IP_OpenDRIM_IP2ComputerSystem_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = IP_OpenDRIM_IP2ComputerSystem_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IP2ComputerSystemProviderEnumInstances(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 = IP_OpenDRIM_IP2ComputerSystem_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = IP_OpenDRIM_IP2ComputerSystem_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IP2ComputerSystemProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_IP2ComputerSystem instance; IP_OpenDRIM_IP2ComputerSystem_toCPP(_broker, cop, instance); string errorMessage; int errorCode = IP_OpenDRIM_IP2ComputerSystem_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = IP_OpenDRIM_IP2ComputerSystem_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IP2ComputerSystemProviderSetInstance(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_IP2ComputerSystem newInstance, oldInstance; IP_OpenDRIM_IP2ComputerSystem_toCPP(_broker, ci, newInstance); IP_OpenDRIM_IP2ComputerSystem_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = IP_OpenDRIM_IP2ComputerSystem_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_IP2ComputerSystem_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IP2ComputerSystemProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_IP2ComputerSystem instance; IP_OpenDRIM_IP2ComputerSystem_toCPP(_broker, ci, instance); string errorMessage; int errorCode = IP_OpenDRIM_IP2ComputerSystem_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_IP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_IP2ComputerSystem_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_IP2ComputerSystem_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = IP_OpenDRIM_IP2ComputerSystem_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IP2ComputerSystemProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_IP2ComputerSystem instance; IP_OpenDRIM_IP2ComputerSystem_toCPP(_broker, cop, instance); string errorMessage; int errorCode = IP_OpenDRIM_IP2ComputerSystem_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = IP_OpenDRIM_IP2ComputerSystem_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus IP_OpenDRIM_IP2ComputerSystemProviderExecQuery(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 IP_OpenDRIM_IP2ComputerSystemProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = IP_OpenDRIM_IP2ComputerSystem_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus IP_OpenDRIM_IP2ComputerSystemProviderAssociatorNames(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 = IP_OpenDRIM_IP2ComputerSystem_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2ComputerSystem_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 IP_OpenDRIM_IP2ComputerSystemProviderAssociators(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 = IP_OpenDRIM_IP2ComputerSystem_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2ComputerSystem_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 IP_OpenDRIM_IP2ComputerSystemProviderReferenceNames(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 = IP_OpenDRIM_IP2ComputerSystem_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = IP_OpenDRIM_IP2ComputerSystem_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = IP_OpenDRIM_IP2ComputerSystem_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = IP_OpenDRIM_IP2ComputerSystem_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus IP_OpenDRIM_IP2ComputerSystemProviderReferences(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 = IP_OpenDRIM_IP2ComputerSystem_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = IP_OpenDRIM_IP2ComputerSystem_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = IP_OpenDRIM_IP2ComputerSystem_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_IP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = IP_OpenDRIM_IP2ComputerSystem_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int IP_OpenDRIM_IP2ComputerSystem_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = IP_OpenDRIM_IP2ComputerSystem_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "IP_OpenDRIM_IP2ComputerSystem_init FAILED: " + (string) OpenDRIM_IP2ComputerSystem_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int IP_OpenDRIM_IP2ComputerSystem_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = IP_OpenDRIM_IP2ComputerSystem_unload(errorMessage); if (errorCode != OK) { errorMessage += "IP_OpenDRIM_IP2ComputerSystem_unload FAILED: " + (string) OpenDRIM_IP2ComputerSystem_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define IP_OpenDRIM_IP2ComputerSystem_INIT if (IP_OpenDRIM_IP2ComputerSystem_init(_broker) < 0) return NULL CMInstanceMIStub(IP_OpenDRIM_IP2ComputerSystemProvider, IP_OpenDRIM_IP2ComputerSystemProvider, _broker, IP_OpenDRIM_IP2ComputerSystem_INIT); CMAssociationMIStub(IP_OpenDRIM_IP2ComputerSystemProvider, IP_OpenDRIM_IP2ComputerSystemProvider, _broker, IP_OpenDRIM_IP2ComputerSystem_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-ip-1.1.2~ppa/OpenDRIM_IP2ComputerSystem/OpenDRIM_IP2ComputerSystemAccess.h0000644000175000017500000001026311377667034031416 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), IP provider package # Copyright (C) 2007 Ilsoo Byun # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2008 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_IP2COMPUTERSYSTEMACCESS_H_ #define OPENDRIM_IP2COMPUTERSYSTEMACCESS_H_ #include "IP_Common.h" #include "OpenDRIM_IP2ComputerSystem.h" #include "assocOpenDRIM_IP2ComputerSystem.h" int IP_OpenDRIM_IP2ComputerSystem_load(const CMPIBroker* broker, string& errorMessage); int IP_OpenDRIM_IP2ComputerSystem_unload(string& errorMessage); int IP_OpenDRIM_IP2ComputerSystem_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int IP_OpenDRIM_IP2ComputerSystem_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_IP2ComputerSystem& instance, const char** properties, string& errorMessage); int IP_OpenDRIM_IP2ComputerSystem_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IP2ComputerSystem& newInstance, const OpenDRIM_IP2ComputerSystem& oldInstance, const char** properties, string& errorMessage); int IP_OpenDRIM_IP2ComputerSystem_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IP2ComputerSystem& instance, string& errorMessage); int IP_OpenDRIM_IP2ComputerSystem_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_IP2ComputerSystem& instance, string& errorMessage); int IP_OpenDRIM_IP2ComputerSystem_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int IP_OpenDRIM_IP2ComputerSystem_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int IP_OpenDRIM_IP2ComputerSystem_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_IP2ComputerSystem_instances, const char** properties, string& errorMessage, const string& discriminant); int IP_OpenDRIM_IP2ComputerSystem_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_IP2ComputerSystem_instances, const char** properties, string& errorMessage, const string& discriminant); int IP_OpenDRIM_IP2ComputerSystem_populate(OpenDRIM_IP2ComputerSystem& instance, string& errorMessage); #endif /*OPENDRIM_IP2COMPUTERSYSTEMACCESS_H_*/ opendrim-lmp-ip-1.1.2~ppa/README0000644000175000017500000000103311377667034017050 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!