opendrim-lmp-pci-1.0.0~ppa/0000755000175000017500000000000011400674237016321 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIPortGroup/0000755000175000017500000000000011400674237022253 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIPortGroup/OpenDRIM_PCIPortGroupProvider.cpp0000644000175000017500000002455011400674237030432 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIPortGroup.h" #include "OpenDRIM_PCIPortGroupAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PCI_OpenDRIM_PCIPortGroupProviderSetInstance PCI_OpenDRIM_PCIPortGroupProviderModifyInstance #endif int PCI_OpenDRIM_PCIPortGroup_init(const CMPIBroker* broker); int PCI_OpenDRIM_PCIPortGroup_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PCI_OpenDRIM_PCIPortGroupProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_PCIPortGroup_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIPortGroupProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PCI_OpenDRIM_PCIPortGroup_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPortGroup_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_PCIPortGroup_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIPortGroupProviderEnumInstances(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 = PCI_OpenDRIM_PCIPortGroup_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPortGroup_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PCI_OpenDRIM_PCIPortGroup_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIPortGroupProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIPortGroup instance; PCI_OpenDRIM_PCIPortGroup_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIPortGroup_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPortGroup_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PCI_OpenDRIM_PCIPortGroup_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIPortGroupProviderSetInstance(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_PCIPortGroup newInstance, oldInstance; PCI_OpenDRIM_PCIPortGroup_toCPP(_broker, ci, newInstance); PCI_OpenDRIM_PCIPortGroup_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIPortGroup_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPortGroup_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIPortGroup_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPortGroup_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIPortGroupProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIPortGroup instance; PCI_OpenDRIM_PCIPortGroup_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIPortGroup_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_PCIPortGroup_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIPortGroup_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPortGroup_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIPortGroup_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPortGroup_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PCI_OpenDRIM_PCIPortGroup_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIPortGroupProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIPortGroup instance; PCI_OpenDRIM_PCIPortGroup_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIPortGroup_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPortGroup_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIPortGroup_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPortGroup_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIPortGroupProviderExecQuery(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 PCI_OpenDRIM_PCIPortGroup_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PCI_OpenDRIM_PCIPortGroup_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_PCIPortGroup_init FAILED: " + (string) OpenDRIM_PCIPortGroup_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PCI_OpenDRIM_PCIPortGroup_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PCI_OpenDRIM_PCIPortGroup_unload(errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_PCIPortGroup_unload FAILED: " + (string) OpenDRIM_PCIPortGroup_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PCI_OpenDRIM_PCIPortGroup_INIT if (PCI_OpenDRIM_PCIPortGroup_init(_broker) < 0) return NULL CMInstanceMIStub(PCI_OpenDRIM_PCIPortGroupProvider, PCI_OpenDRIM_PCIPortGroupProvider, _broker, PCI_OpenDRIM_PCIPortGroup_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIPortGroup/Makefile.am0000644000175000017500000000375211400674237024316 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPCI_OpenDRIM_PCIPortGroupProvider.la libcmpiPCI_OpenDRIM_PCIPortGroupProvider_la_SOURCES = OpenDRIM_PCIPortGroupAccess.cpp OpenDRIM_PCIPortGroupProvider.cpp cmpiOpenDRIM_PCIPortGroup.cpp libcmpiPCI_OpenDRIM_PCIPortGroupProvider_la_LIBADD = ../Common/libcmpiPCI_Common.la libcmpiPCI_OpenDRIM_PCIPortGroupProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_PCIPortGroup.h OpenDRIM_PCIPortGroup.h OpenDRIM_PCIPortGroupAccess.h opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIPortGroup/OpenDRIM_PCIPortGroupAccess.h0000644000175000017500000000547311400674237027511 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PCIPORTGROUPACCESS_H_ #define OPENDRIM_PCIPORTGROUPACCESS_H_ #include "PCI_Common.h" #include "OpenDRIM_PCIPortGroup.h" int PCI_OpenDRIM_PCIPortGroup_load(const CMPIBroker* broker, string& errorMessage); int PCI_OpenDRIM_PCIPortGroup_unload(string& errorMessage); int PCI_OpenDRIM_PCIPortGroup_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCIPortGroup_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PCIPortGroup& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCIPortGroup_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPortGroup& newInstance, const OpenDRIM_PCIPortGroup& oldInstance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCIPortGroup_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPortGroup& instance, string& errorMessage); int PCI_OpenDRIM_PCIPortGroup_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPortGroup& instance, string& errorMessage); int PCI_OpenDRIM_PCIPortGroup_populate(OpenDRIM_PCIPortGroup& instance, string& errorMessage); #endif /*OPENDRIM_PCIPORTGROUPACCESS_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIPortGroup/cmpiOpenDRIM_PCIPortGroup.h0000644000175000017500000000417711400674237027240 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_PCIPORTGROUP_H_ #define CMPIOPENDRIM_PCIPORTGROUP_H_ #include "OpenDRIM_PCIPortGroup.h" CMPIObjectPath* PCI_OpenDRIM_PCIPortGroup_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PCIPortGroup& instance); CMPIInstance* PCI_OpenDRIM_PCIPortGroup_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PCIPortGroup& instance); void PCI_OpenDRIM_PCIPortGroup_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PCIPortGroup& instance); void PCI_OpenDRIM_PCIPortGroup_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PCIPortGroup& instance); #endif /*CMPIOPENDRIM_PCIPORTGROUP_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIPortGroup/OpenDRIM_PCIPortGroupAccess.cpp0000644000175000017500000000573311400674237030043 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_PCIPortGroupAccess.h" int PCI_OpenDRIM_PCIPortGroup_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int PCI_OpenDRIM_PCIPortGroup_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int PCI_OpenDRIM_PCIPortGroup_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; _L_; return OK; } int PCI_OpenDRIM_PCIPortGroup_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PCIPortGroup& instance, const char** properties, string& errorMessage) { _E_; _L_; return OK; } int PCI_OpenDRIM_PCIPortGroup_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPortGroup& newInstance, const OpenDRIM_PCIPortGroup& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIPortGroup_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPortGroup& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIPortGroup_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPortGroup& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIPortGroup_populate(OpenDRIM_PCIPortGroup& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIPortGroup/cmpiOpenDRIM_PCIPortGroup.cpp0000644000175000017500000000774311400674237027575 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIPortGroup.h" CMPIObjectPath* PCI_OpenDRIM_PCIPortGroup_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PCIPortGroup& instance) { _E_; Objectpath op(broker, OpenDRIM_PCIPortGroup_classnames[0], OpenDRIM_PCIPortGroup_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* PCI_OpenDRIM_PCIPortGroup_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PCIPortGroup& instance) { _E_; Objectpath op(broker, PCI_OpenDRIM_PCIPortGroup_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.Name_isNULL) ci.setProperty("Name", instance.Name); if (!instance.NameFormat_isNULL) ci.setProperty("NameFormat", instance.NameFormat); if (!instance.OtherNameFormat_isNULL) ci.setProperty("OtherNameFormat", instance.OtherNameFormat); if (!instance.BusNumber_isNULL) ci.setProperty("BusNumber", instance.BusNumber); _L_; return ci.getHdl(); } void PCI_OpenDRIM_PCIPortGroup_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PCIPortGroup& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void PCI_OpenDRIM_PCIPortGroup_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PCIPortGroup& 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("Name", instance.Name) == OK) instance.Name_isNULL = false; if (inst.getProperty("NameFormat", instance.NameFormat) == OK) instance.NameFormat_isNULL = false; if (inst.getProperty("OtherNameFormat", instance.OtherNameFormat) == OK) instance.OtherNameFormat_isNULL = false; if (inst.getProperty("BusNumber", instance.BusNumber) == OK) instance.BusNumber_isNULL = false; _L_; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIPortGroup/OpenDRIM_PCIPortGroup.h0000644000175000017500000001077711400674237026372 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PCIPORTGROUP_H_ #define OPENDRIM_PCIPORTGROUP_H_ #include const static char* OpenDRIM_PCIPortGroup_classnames[] = {"OpenDRIM_PCIPortGroup"}; static string OpenDRIM_PCIPortGroup_NAMESPACE = _NAMESPACE; class OpenDRIM_PCIPortGroup { public: string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string InstanceID; bool InstanceID_isNULL; string Name; bool Name_isNULL; string NameFormat; bool NameFormat_isNULL; string OtherNameFormat; bool OtherNameFormat_isNULL; unsigned char BusNumber; bool BusNumber_isNULL; OpenDRIM_PCIPortGroup() { Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstanceID_isNULL = true; Name_isNULL = true; NameFormat_isNULL = true; OtherNameFormat_isNULL = true; BusNumber_isNULL = true; } ~OpenDRIM_PCIPortGroup() {} 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 getName(string& value) const { if (Name_isNULL==true) return NOT_FOUND; value = Name; return OK; } int setName(const string& newValue) { Name = newValue; Name_isNULL = false; return OK; } int getNameFormat(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 getOtherNameFormat(string& value) const { if (OtherNameFormat_isNULL==true) return NOT_FOUND; value = OtherNameFormat; return OK; } int setOtherNameFormat(const string& newValue) { OtherNameFormat = newValue; OtherNameFormat_isNULL = false; return OK; } int getBusNumber(unsigned char& value) const { if (BusNumber_isNULL==true) return NOT_FOUND; value = BusNumber; return OK; } int setBusNumber(const unsigned char& newValue) { BusNumber = newValue; BusNumber_isNULL = false; return OK; } }; #endif /*OPENDRIM_PCIPORTGROUP_H_*/ opendrim-lmp-pci-1.0.0~ppa/Makefile.am0000644000175000017500000001145511400674237020363 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### VENDOR = OpenDRIM VERSION = $(shell cat ./VERSION) APP_NAME = opendrim-lmp-pci RPM_PACKAGE_DIR = packaging PLATFORM = $(shell rpm --eval %_target_cpu) WORKING_DIR = $(shell pwd) SUBDIRS = Common OpenDRIM_PCIeSwitch OpenDRIM_RegisteredPCIProfile OpenDRIM_PCIPort OpenDRIM_PCIBridge OpenDRIM_EnabledPCICapabilities OpenDRIM_PCIDevice OpenDRIM_ConcretePCIIdentity OpenDRIM_PCIPortGroup OpenDRIM_PCIDeviceConformsToProfile OpenDRIM_PCIDeviceConnection OpenDRIM_ComputerSystemPCIDevice OpenDRIM_PCIDeviceControlledByPCIPort OpenDRIM_PCICapabilities OpenDRIM_MemberOfPCICollection OpenDRIM_HostedPCICollection test postinstall: registration/PCI.sh @CIMNAMESPACE@ $(VENDOR) @CIMSERVER@ @INTEROPNAMESPACE@ $(VERSION) . preuninstall: registration/PCI-remove.sh @CIMNAMESPACE@ @CIMSERVER@ @INTEROPNAMESPACE@ . test-OpenDRIM_PCIeSwitch: all make -C test test-OpenDRIM_PCIeSwitch test-OpenDRIM_PCIDeviceConnection: all make -C test test-OpenDRIM_PCIDeviceConnection test-OpenDRIM_RegisteredPCIProfile: all make -C test test-OpenDRIM_RegisteredPCIProfile test-OpenDRIM_PCIPort: all make -C test test-OpenDRIM_PCIPort test-OpenDRIM_ComputerSystemPCIDevice: all make -C test test-OpenDRIM_ComputerSystemPCIDevice test-OpenDRIM_PCIBridge: all make -C test test-OpenDRIM_PCIBridge test-OpenDRIM_PCIDeviceControlledByPCIPort: all make -C test test-OpenDRIM_PCIDeviceControlledByPCIPort test-OpenDRIM_PCICapabilities: all make -C test test-OpenDRIM_PCICapabilities test-OpenDRIM_EnabledPCICapabilities: all make -C test test-OpenDRIM_EnabledPCICapabilities test-OpenDRIM_MemberOfPCICollection: all make -C test test-OpenDRIM_MemberOfPCICollection test-OpenDRIM_PCIDevice: all make -C test test-OpenDRIM_PCIDevice test-OpenDRIM_ConcretePCIIdentity: all make -C test test-OpenDRIM_ConcretePCIIdentity test-OpenDRIM_PCIPortGroup: all make -C test test-OpenDRIM_PCIPortGroup test-OpenDRIM_PCIDeviceConformsToProfile: all make -C test test-OpenDRIM_PCIDeviceConformsToProfile test-OpenDRIM_HostedPCICollection: all make -C test test-OpenDRIM_HostedPCICollection 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-pci-1.0.0~ppa/OpenDRIM_MemberOfPCICollection/0000755000175000017500000000000011400674237024022 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_MemberOfPCICollection/OpenDRIM_MemberOfPCICollection.h0000644000175000017500000000654711400674237031710 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_MEMBEROFPCICOLLECTION_H_ #define OPENDRIM_MEMBEROFPCICOLLECTION_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_ManagedElement.h" #include "CIM_ManagedElementAccess.h" #include "cmpiCIM_Collection.h" #include "CIM_CollectionAccess.h" */ const static char* OpenDRIM_MemberOfPCICollection_classnames[] = {"OpenDRIM_MemberOfPCICollection"}; static string OpenDRIM_MemberOfPCICollection_NAMESPACE = _NAMESPACE; const static string Member_role = "Member"; const static char* Member_classnames[] = {"OpenDRIM_PCIPort"}; const static string Member_NAMESPACE = _NAMESPACE; const static string Collection_role = "Collection"; const static char* Collection_classnames[] = {"OpenDRIM_PCIPortGroup"}; const static string Collection_NAMESPACE = _NAMESPACE; class OpenDRIM_MemberOfPCICollection { public: Objectpath Collection; bool Collection_isNULL; Objectpath Member; bool Member_isNULL; OpenDRIM_MemberOfPCICollection() { Collection_isNULL = true; Member_isNULL = true; } ~OpenDRIM_MemberOfPCICollection() {} string getKeys() const { return CF_toLowCase(".Collection=\"" + CF_quoteString(Collection.toString()) + "\""".Member=\"" + CF_quoteString(Member.toString()) + "\""); } int getCollection(Objectpath& value) const { if (Collection_isNULL==true) return NOT_FOUND; value = Collection; return OK; } int setCollection(const Objectpath& newValue) { Collection = newValue; Collection.setNamespace(Collection_NAMESPACE); Collection_isNULL = false; return OK; } int getMember(Objectpath& value) const { if (Member_isNULL==true) return NOT_FOUND; value = Member; return OK; } int setMember(const Objectpath& newValue) { Member = newValue; Member.setNamespace(Member_NAMESPACE); Member_isNULL = false; return OK; } }; #endif /*OPENDRIM_MEMBEROFPCICOLLECTION_H_*/ ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_MemberOfPCICollection/OpenDRIM_MemberOfPCICollectionProvider.cppopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_MemberOfPCICollection/OpenDRIM_MemberOfPCICollectionProvider.cpp0000644000175000017500000004166411400674237033755 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_MemberOfPCICollection.h" #include "OpenDRIM_MemberOfPCICollectionAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PCI_OpenDRIM_MemberOfPCICollectionProviderSetInstance PCI_OpenDRIM_MemberOfPCICollectionProviderModifyInstance #endif int PCI_OpenDRIM_MemberOfPCICollection_init(const CMPIBroker* broker); int PCI_OpenDRIM_MemberOfPCICollection_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PCI_OpenDRIM_MemberOfPCICollectionProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_MemberOfPCICollection_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_MemberOfPCICollectionProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PCI_OpenDRIM_MemberOfPCICollection_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_MemberOfPCICollection_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_MemberOfPCICollectionProviderEnumInstances(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 = PCI_OpenDRIM_MemberOfPCICollection_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PCI_OpenDRIM_MemberOfPCICollection_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_MemberOfPCICollectionProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_MemberOfPCICollection instance; PCI_OpenDRIM_MemberOfPCICollection_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_MemberOfPCICollection_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PCI_OpenDRIM_MemberOfPCICollection_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_MemberOfPCICollectionProviderSetInstance(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_MemberOfPCICollection newInstance, oldInstance; PCI_OpenDRIM_MemberOfPCICollection_toCPP(_broker, ci, newInstance); PCI_OpenDRIM_MemberOfPCICollection_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PCI_OpenDRIM_MemberOfPCICollection_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_MemberOfPCICollection_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_MemberOfPCICollectionProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_MemberOfPCICollection instance; PCI_OpenDRIM_MemberOfPCICollection_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PCI_OpenDRIM_MemberOfPCICollection_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_MemberOfPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_MemberOfPCICollection_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_MemberOfPCICollection_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PCI_OpenDRIM_MemberOfPCICollection_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_MemberOfPCICollectionProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_MemberOfPCICollection instance; PCI_OpenDRIM_MemberOfPCICollection_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_MemberOfPCICollection_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_MemberOfPCICollection_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_MemberOfPCICollectionProviderExecQuery(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 PCI_OpenDRIM_MemberOfPCICollectionProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_MemberOfPCICollection_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_MemberOfPCICollectionProviderAssociatorNames(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 = PCI_OpenDRIM_MemberOfPCICollection_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPCICollection_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 PCI_OpenDRIM_MemberOfPCICollectionProviderAssociators(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 = PCI_OpenDRIM_MemberOfPCICollection_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPCICollection_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 PCI_OpenDRIM_MemberOfPCICollectionProviderReferenceNames(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 = PCI_OpenDRIM_MemberOfPCICollection_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PCI_OpenDRIM_MemberOfPCICollection_referenceMemberToCollection(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = PCI_OpenDRIM_MemberOfPCICollection_referenceCollectionToMember(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_MemberOfPCICollection_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus PCI_OpenDRIM_MemberOfPCICollectionProviderReferences(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 = PCI_OpenDRIM_MemberOfPCICollection_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PCI_OpenDRIM_MemberOfPCICollection_referenceMemberToCollection(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = PCI_OpenDRIM_MemberOfPCICollection_referenceCollectionToMember(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = PCI_OpenDRIM_MemberOfPCICollection_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int PCI_OpenDRIM_MemberOfPCICollection_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PCI_OpenDRIM_MemberOfPCICollection_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_MemberOfPCICollection_init FAILED: " + (string) OpenDRIM_MemberOfPCICollection_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PCI_OpenDRIM_MemberOfPCICollection_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PCI_OpenDRIM_MemberOfPCICollection_unload(errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_MemberOfPCICollection_unload FAILED: " + (string) OpenDRIM_MemberOfPCICollection_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PCI_OpenDRIM_MemberOfPCICollection_INIT if (PCI_OpenDRIM_MemberOfPCICollection_init(_broker) < 0) return NULL CMInstanceMIStub(PCI_OpenDRIM_MemberOfPCICollectionProvider, PCI_OpenDRIM_MemberOfPCICollectionProvider, _broker, PCI_OpenDRIM_MemberOfPCICollection_INIT); CMAssociationMIStub(PCI_OpenDRIM_MemberOfPCICollectionProvider, PCI_OpenDRIM_MemberOfPCICollectionProvider, _broker, PCI_OpenDRIM_MemberOfPCICollection_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_MemberOfPCICollection/Makefile.am0000644000175000017500000000470311400674237026062 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPCI_OpenDRIM_MemberOfPCICollectionProvider.la libcmpiPCI_OpenDRIM_MemberOfPCICollectionProvider_la_SOURCES = OpenDRIM_MemberOfPCICollectionAccess.cpp OpenDRIM_MemberOfPCICollectionProvider.cpp cmpiOpenDRIM_MemberOfPCICollection.cpp assocOpenDRIM_MemberOfPCICollection.cpp # May have to be adjusted for direct invocation libcmpiPCI_OpenDRIM_MemberOfPCICollectionProvider_la_CPPFLAGS = -I../CIM_ManagedElement -I../CIM_Collection # Uncomment the end for direct invocation, may have to be adjusted libcmpiPCI_OpenDRIM_MemberOfPCICollectionProvider_la_LIBADD = ../Common/libcmpiPCI_Common.la #../CIM_ManagedElement/libcmpiPCI_CIM_ManagedElementProvider.la ../CIM_Collection/libcmpiPCI_CIM_CollectionProvider.la libcmpiPCI_OpenDRIM_MemberOfPCICollectionProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_MemberOfPCICollection.h OpenDRIM_MemberOfPCICollection.h OpenDRIM_MemberOfPCICollectionAccess.h opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_MemberOfPCICollection/assocOpenDRIM_MemberOfPCICollection.cpp0000644000175000017500000002056311400674237033266 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_MemberOfPCICollection.h" int PCI_OpenDRIM_MemberOfPCICollection_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 = PCI_OpenDRIM_MemberOfPCICollection_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, "Member") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "Collection") != 0) return OK; CF_assert(PCI_OpenDRIM_MemberOfPCICollection_associatorMemberToCollection(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "Collection") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "Member") != 0) return OK; CF_assert(PCI_OpenDRIM_MemberOfPCICollection_associatorCollectionToMember(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int PCI_OpenDRIM_MemberOfPCICollection_enumerateMembers(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, Member_NAMESPACE, Member_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PCI_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PCI_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PCI_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PCI_OpenDRIM_MemberOfPCICollection_getMember(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Member_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Member_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_ManagedElement _instance; PCI_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PCI_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PCI_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int PCI_OpenDRIM_MemberOfPCICollection_enumerateCollections(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, Collection_NAMESPACE, Collection_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PCI_CIM_Collection_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PCI_CIM_Collection_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PCI_CIM_Collection_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PCI_OpenDRIM_MemberOfPCICollection_getCollection(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Collection_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Collection_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_Collection _instance; PCI_CIM_Collection_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PCI_CIM_Collection_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PCI_CIM_Collection_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_MemberOfPCICollection/cmpiOpenDRIM_MemberOfPCICollection.cpp0000644000175000017500000000603611400674237033105 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_MemberOfPCICollection.h" CMPIObjectPath* PCI_OpenDRIM_MemberOfPCICollection_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_MemberOfPCICollection& instance) { _E_; Objectpath op(broker, OpenDRIM_MemberOfPCICollection_classnames[0], OpenDRIM_MemberOfPCICollection_NAMESPACE); if (!instance.Collection_isNULL) op.addKey("Collection", instance.Collection); if (!instance.Member_isNULL) op.addKey("Member", instance.Member); _L_; return op.getHdl(); } CMPIInstance* PCI_OpenDRIM_MemberOfPCICollection_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_MemberOfPCICollection& instance) { _E_; Objectpath op(broker, PCI_OpenDRIM_MemberOfPCICollection_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void PCI_OpenDRIM_MemberOfPCICollection_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_MemberOfPCICollection& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("Member", instance.Member) == OK) instance.Member_isNULL = false; if (op.getKey("Collection", instance.Collection) == OK) instance.Collection_isNULL = false; _L_; } void PCI_OpenDRIM_MemberOfPCICollection_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_MemberOfPCICollection& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Collection", instance.Collection) == OK) instance.Collection_isNULL = false; if (inst.getProperty("Member", instance.Member) == OK) instance.Member_isNULL = false; _L_; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_MemberOfPCICollection/OpenDRIM_MemberOfPCICollectionAccess.cpp0000644000175000017500000002374711400674237033366 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_MemberOfPCICollectionAccess.h" int PCI_OpenDRIM_MemberOfPCICollection_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PCI_CIM_ManagedElement_load(broker, errorMessage)); CF_assert(PCI_CIM_Collection_load(broker, errorMessage)); */ // TODO _L_; return OK; } int PCI_OpenDRIM_MemberOfPCICollection_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PCI_CIM_ManagedElement_unload(errorMessage)); CF_assert(PCI_CIM_Collection_unload(errorMessage)); */ // TODO _L_; return OK; } int PCI_OpenDRIM_MemberOfPCICollection_isAssociated(const Instance& Member, const Instance& Collection, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int PCI_OpenDRIM_MemberOfPCICollection_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(PCI_OpenDRIM_MemberOfPCICollection_enumerateMembers(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(PCI_OpenDRIM_MemberOfPCICollection_enumerateMembers(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; PCI_OpenDRIM_MemberOfPCICollection_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), Member_classnames[0], Collection_classnames[0], Member_role.c_str(), Collection_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(PCI_OpenDRIM_MemberOfPCICollection_referenceMemberToCollection(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int PCI_OpenDRIM_MemberOfPCICollection_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_MemberOfPCICollection& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath Member_objectpath; instance.getMember(Member_objectpath); Instance Member_instance; CF_assert(PCI_OpenDRIM_MemberOfPCICollection_getMember(broker, ctx, Member_objectpath, Member_instance, NULL, errorMessage)); Objectpath Collection_objectpath; instance.getCollection(Collection_objectpath); Instance Collection_instance; CF_assert(PCI_OpenDRIM_MemberOfPCICollection_getCollection(broker, ctx, Collection_objectpath, Collection_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(PCI_OpenDRIM_MemberOfPCICollection_isAssociated(Member_instance, Collection_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int PCI_OpenDRIM_MemberOfPCICollection_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_MemberOfPCICollection& newInstance, const OpenDRIM_MemberOfPCICollection& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_MemberOfPCICollection_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_MemberOfPCICollection& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_MemberOfPCICollection_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_MemberOfPCICollection& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_MemberOfPCICollection_associatorMemberToCollection(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Member_instance, const char** properties, vector& Collection_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector Collection_instances; if (discriminant=="a") CF_assert(PCI_OpenDRIM_MemberOfPCICollection_enumerateCollections(broker, ctx, Collection_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PCI_OpenDRIM_MemberOfPCICollection_enumerateCollections(broker, ctx, Collection_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(PCI_OpenDRIM_MemberOfPCICollection_enumerateCollections(broker, ctx, Collection_instances, properties, false, errorMessage)); } for (size_t i=0; i& Member_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector Member_instances; if (discriminant=="a") CF_assert(PCI_OpenDRIM_MemberOfPCICollection_enumerateMembers(broker, ctx, Member_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PCI_OpenDRIM_MemberOfPCICollection_enumerateMembers(broker, ctx, Member_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(PCI_OpenDRIM_MemberOfPCICollection_enumerateMembers(broker, ctx, Member_instances, properties, false, errorMessage)); } for (size_t i=0; i& Collection_instances, vector& OpenDRIM_MemberOfPCICollection_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 < Collection_instances.size(); i++) { OpenDRIM_MemberOfPCICollection instance; instance.setMember(((Instance) Member_instance).getObjectpath()); instance.setCollection(((Instance) Collection_instances[i]).getObjectpath()); OpenDRIM_MemberOfPCICollection_instances.push_back(instance); } _L_; return OK; } int PCI_OpenDRIM_MemberOfPCICollection_referenceCollectionToMember(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Collection_instance, const vector& Member_instances, vector& OpenDRIM_MemberOfPCICollection_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 < Member_instances.size(); i++) { OpenDRIM_MemberOfPCICollection instance; instance.setMember(((Instance) Member_instances[i]).getObjectpath()); instance.setCollection(((Instance) Collection_instance).getObjectpath()); OpenDRIM_MemberOfPCICollection_instances.push_back(instance); } _L_; return OK; } int PCI_OpenDRIM_MemberOfPCICollection_populate(OpenDRIM_MemberOfPCICollection& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_MemberOfPCICollection/assocOpenDRIM_MemberOfPCICollection.h0000644000175000017500000000617511400674237032736 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_MEMBEROFPCICOLLECTION_H_ #define ASSOCOPENDRIM_MEMBEROFPCICOLLECTION_H_ #include "OpenDRIM_MemberOfPCICollectionAccess.h" int PCI_OpenDRIM_MemberOfPCICollection_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 PCI_OpenDRIM_MemberOfPCICollection_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 PCI_OpenDRIM_MemberOfPCICollection_enumerateMembers(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PCI_OpenDRIM_MemberOfPCICollection_getMember(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_MemberOfPCICollection_enumerateCollections(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PCI_OpenDRIM_MemberOfPCICollection_getCollection(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_MEMBEROFPCICOLLECTION_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_MemberOfPCICollection/OpenDRIM_MemberOfPCICollectionAccess.h0000644000175000017500000001041111400674237033013 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_MEMBEROFPCICOLLECTIONACCESS_H_ #define OPENDRIM_MEMBEROFPCICOLLECTIONACCESS_H_ #include "PCI_Common.h" #include "OpenDRIM_MemberOfPCICollection.h" #include "assocOpenDRIM_MemberOfPCICollection.h" int PCI_OpenDRIM_MemberOfPCICollection_load(const CMPIBroker* broker, string& errorMessage); int PCI_OpenDRIM_MemberOfPCICollection_unload(string& errorMessage); int PCI_OpenDRIM_MemberOfPCICollection_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_MemberOfPCICollection_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_MemberOfPCICollection& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_MemberOfPCICollection_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_MemberOfPCICollection& newInstance, const OpenDRIM_MemberOfPCICollection& oldInstance, const char** properties, string& errorMessage); int PCI_OpenDRIM_MemberOfPCICollection_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_MemberOfPCICollection& instance, string& errorMessage); int PCI_OpenDRIM_MemberOfPCICollection_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_MemberOfPCICollection& instance, string& errorMessage); int PCI_OpenDRIM_MemberOfPCICollection_associatorMemberToCollection(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Member_instance, const char** properties, vector& Collection_associatedInstances, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_MemberOfPCICollection_associatorCollectionToMember(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Collection_instance, const char** properties, vector& Member_associatedInstances, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_MemberOfPCICollection_referenceMemberToCollection(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Member_instance, const vector& Collection_instances, vector& OpenDRIM_MemberOfPCICollection_instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_MemberOfPCICollection_referenceCollectionToMember(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Collection_instance, const vector& Member_instances, vector& OpenDRIM_MemberOfPCICollection_instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_MemberOfPCICollection_populate(OpenDRIM_MemberOfPCICollection& instance, string& errorMessage); #endif /*OPENDRIM_MEMBEROFPCICOLLECTIONACCESS_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_MemberOfPCICollection/cmpiOpenDRIM_MemberOfPCICollection.h0000644000175000017500000000435311400674237032552 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_MEMBEROFPCICOLLECTION_H_ #define CMPIOPENDRIM_MEMBEROFPCICOLLECTION_H_ #include "OpenDRIM_MemberOfPCICollection.h" CMPIObjectPath* PCI_OpenDRIM_MemberOfPCICollection_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_MemberOfPCICollection& instance); CMPIInstance* PCI_OpenDRIM_MemberOfPCICollection_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_MemberOfPCICollection& instance); void PCI_OpenDRIM_MemberOfPCICollection_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_MemberOfPCICollection& instance); void PCI_OpenDRIM_MemberOfPCICollection_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_MemberOfPCICollection& instance); #endif /*CMPIOPENDRIM_MEMBEROFPCICOLLECTION_H_*/ opendrim-lmp-pci-1.0.0~ppa/registration/0000755000175000017500000000000011400674237021033 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_PCIBridge-remove.sh0000755000175000017500000000614511400674237026060 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m PCI_OpenDRIM_PCIBridgeModule cimprovider -r -m PCI_OpenDRIM_PCIBridgeModule 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_PCIBridge.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_PCIDeviceConformsToProfile-remove.sh0000755000175000017500000001034611400674237031414 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m PCI_OpenDRIM_PCIDeviceConformsToProfileModule cimprovider -r -m PCI_OpenDRIM_PCIDeviceConformsToProfileModule 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_PCIDeviceConformsToProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE owmofc -u http://localhost/$3 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_PCIeSwitch.sh0000755000175000017500000001062411400674237024774 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_PCIeSwitch.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_PCIeSwitch provider module"; Name = "PCI_OpenDRIM_PCIeSwitchModule"; Location = "cmpiPCI_OpenDRIM_PCIeSwitchProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_PCIeSwitch provider"; Name = "PCI_OpenDRIM_PCIeSwitchProvider"; ProviderModuleName = "PCI_OpenDRIM_PCIeSwitchModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_PCIeSwitch provider capabilities"; ProviderModuleName = "PCI_OpenDRIM_PCIeSwitchModule"; ProviderName = "PCI_OpenDRIM_PCIeSwitchProvider"; ClassName = "OpenDRIM_PCIeSwitch"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"InstanceID", "Caption", "Description", "ElementName", "InstallDate", "Name", "OperationalStatus", "StatusDescriptions", "Status", "HealthState", "CommunicationStatus", "DetailedStatus", "OperatingStatus", "PrimaryStatus", "EnabledState", "OtherEnabledState", "RequestedState", "EnabledDefault", "TimeOfLastStateChange", "AvailableRequestedStates", "TransitioningToState", "SystemCreationClassName", "SystemName", "CreationClassName", "DeviceID", "PowerManagementSupported", "PowerManagementCapabilities", "Availability", "StatusInfo", "LastErrorCode", "ErrorDescription", "ErrorCleared", "OtherIdentifyingInfo", "PowerOnHours", "TotalPowerOnHours", "IdentifyingDescriptions", "AdditionalAvailability", "MaxQuiesceTime", "TimeOfLastReset", "ProtocolSupported", "MaxNumberControlled", "ProtocolDescription", "CommandRegister", "Capabilities", "CapabilityDescriptions", "DeviceSelectTiming", "ClassCode", "CacheLineSize", "LatencyTimer", "InterruptPin", "ExpansionROMBaseAddress", "SelfTestEnabled", "BaseAddress", "SubsystemID", "SubsystemVendorID", "MinGrantTime", "MaxLatency", "BusNumber", "DeviceNumber", "FunctionNumber", "PCIDeviceID", "VendorID", "RevisionID", "NumberOfPorts", "SecondaryBusNumbers"}; SupportedMethods = {"RequestStateChange", "SetPowerState", "Reset", "EnableDevice", "OnlineDevice", "QuiesceDevice", "SaveProperties", "RestoreProperties", "BISTExecution"}; CapabilityID = "PCI_OpenDRIM_PCIeSwitch"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_PCIeSwitch.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_PCIBridge.sh0000755000175000017500000001125711400674237024565 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_PCIBridge.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_PCIBridge provider module"; Name = "PCI_OpenDRIM_PCIBridgeModule"; Location = "cmpiPCI_OpenDRIM_PCIBridgeProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_PCIBridge provider"; Name = "PCI_OpenDRIM_PCIBridgeProvider"; ProviderModuleName = "PCI_OpenDRIM_PCIBridgeModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_PCIBridge provider capabilities"; ProviderModuleName = "PCI_OpenDRIM_PCIBridgeModule"; ProviderName = "PCI_OpenDRIM_PCIBridgeProvider"; ClassName = "OpenDRIM_PCIBridge"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"InstanceID", "Caption", "Description", "ElementName", "InstallDate", "Name", "OperationalStatus", "StatusDescriptions", "Status", "HealthState", "CommunicationStatus", "DetailedStatus", "OperatingStatus", "PrimaryStatus", "EnabledState", "OtherEnabledState", "RequestedState", "EnabledDefault", "TimeOfLastStateChange", "AvailableRequestedStates", "TransitioningToState", "SystemCreationClassName", "SystemName", "CreationClassName", "DeviceID", "PowerManagementSupported", "PowerManagementCapabilities", "Availability", "StatusInfo", "LastErrorCode", "ErrorDescription", "ErrorCleared", "OtherIdentifyingInfo", "PowerOnHours", "TotalPowerOnHours", "IdentifyingDescriptions", "AdditionalAvailability", "MaxQuiesceTime", "TimeOfLastReset", "ProtocolSupported", "MaxNumberControlled", "ProtocolDescription", "CommandRegister", "Capabilities", "CapabilityDescriptions", "DeviceSelectTiming", "ClassCode", "CacheLineSize", "LatencyTimer", "InterruptPin", "ExpansionROMBaseAddress", "SelfTestEnabled", "BaseAddress", "SubsystemID", "SubsystemVendorID", "MinGrantTime", "MaxLatency", "BusNumber", "DeviceNumber", "FunctionNumber", "PCIDeviceID", "VendorID", "RevisionID", "BridgeType", "SecondaryLatencyTimer", "SubordinateBusNumber", "SecondayBusNumber", "PrimaryBusNumber", "SecondaryStatusRegister", "SecondaryBusDeviceSelectTiming", "IOLimit", "IOBase", "MemoryLimit", "MemoryBase", "PrefetchMemoryLimit", "PrefetchMemoryBase", "PrefetchLimitUpper32", "PrefetchBaseUpper32", "IOLimitUpper16", "IOBaseUpper16"}; SupportedMethods = {"RequestStateChange", "SetPowerState", "Reset", "EnableDevice", "OnlineDevice", "QuiesceDevice", "SaveProperties", "RestoreProperties", "BISTExecution"}; CapabilityID = "PCI_OpenDRIM_PCIBridge"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_PCIBridge.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_PCIDeviceConformsToProfile.sh0000755000175000017500000000711211400674237030116 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_PCIDeviceConformsToProfile.mof cimmof -aE -n $4 $6/mof/OpenDRIM_PCIDeviceConformsToProfile.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_PCIDeviceConformsToProfile provider module"; Name = "PCI_OpenDRIM_PCIDeviceConformsToProfileModule"; Location = "cmpiPCI_OpenDRIM_PCIDeviceConformsToProfileProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_PCIDeviceConformsToProfile provider"; Name = "PCI_OpenDRIM_PCIDeviceConformsToProfileProvider"; ProviderModuleName = "PCI_OpenDRIM_PCIDeviceConformsToProfileModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_PCIDeviceConformsToProfile provider capabilities"; ProviderModuleName = "PCI_OpenDRIM_PCIDeviceConformsToProfileModule"; ProviderName = "PCI_OpenDRIM_PCIDeviceConformsToProfileProvider"; ClassName = "OpenDRIM_PCIDeviceConformsToProfile"; ProviderType = {2, 3}; Namespaces = {"$1", "$4"}; SupportedProperties = {"ConformantStandard", "ManagedElement"}; CapabilityID = "PCI_OpenDRIM_PCIDeviceConformsToProfile"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_PCIDeviceConformsToProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE owmofc -u http://localhost/$4 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_PCICapabilities.sh0000755000175000017500000000631011400674237025754 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_PCICapabilities.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_PCICapabilities provider module"; Name = "PCI_OpenDRIM_PCICapabilitiesModule"; Location = "cmpiPCI_OpenDRIM_PCICapabilitiesProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_PCICapabilities provider"; Name = "PCI_OpenDRIM_PCICapabilitiesProvider"; ProviderModuleName = "PCI_OpenDRIM_PCICapabilitiesModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_PCICapabilities provider capabilities"; ProviderModuleName = "PCI_OpenDRIM_PCICapabilitiesModule"; ProviderName = "PCI_OpenDRIM_PCICapabilitiesProvider"; ClassName = "OpenDRIM_PCICapabilities"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"ManagedElement", "Capabilities", "Characteristics"}; CapabilityID = "PCI_OpenDRIM_PCICapabilities"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_PCICapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_PCIPortGroup.sh0000755000175000017500000000627011400674237025331 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_PCIPortGroup.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_PCIPortGroup provider module"; Name = "PCI_OpenDRIM_PCIPortGroupModule"; Location = "cmpiPCI_OpenDRIM_PCIPortGroupProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_PCIPortGroup provider"; Name = "PCI_OpenDRIM_PCIPortGroupProvider"; ProviderModuleName = "PCI_OpenDRIM_PCIPortGroupModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_PCIPortGroup provider capabilities"; ProviderModuleName = "PCI_OpenDRIM_PCIPortGroupModule"; ProviderName = "PCI_OpenDRIM_PCIPortGroupProvider"; ClassName = "OpenDRIM_PCIPortGroup"; ProviderType = {2}; Namespaces = {"$1"}; SupportedProperties = {"Caption", "Description", "ElementName", "InstanceID", "Name", "NameFormat", "OtherNameFormat", "BusNumber"}; CapabilityID = "PCI_OpenDRIM_PCIPortGroup"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_PCIPortGroup.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_EnabledPCICapabilities.sh0000755000175000017500000000664011400674237027235 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_EnabledPCICapabilities.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_EnabledPCICapabilities provider module"; Name = "PCI_OpenDRIM_EnabledPCICapabilitiesModule"; Location = "cmpiPCI_OpenDRIM_EnabledPCICapabilitiesProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_EnabledPCICapabilities provider"; Name = "PCI_OpenDRIM_EnabledPCICapabilitiesProvider"; ProviderModuleName = "PCI_OpenDRIM_EnabledPCICapabilitiesModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_EnabledPCICapabilities provider capabilities"; ProviderModuleName = "PCI_OpenDRIM_EnabledPCICapabilitiesModule"; ProviderName = "PCI_OpenDRIM_EnabledPCICapabilitiesProvider"; ClassName = "OpenDRIM_EnabledPCICapabilities"; ProviderType = {2}; Namespaces = {"$1"}; SupportedProperties = {"Caption", "Description", "InstanceID", "ElementName", "ElementNameEditSupported", "MaxElementNameLen", "RequestedStatesSupported", "ElementNameMask"}; CapabilityID = "PCI_OpenDRIM_EnabledPCICapabilities"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_EnabledPCICapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_ConcretePCIIdentity-remove.sh0000755000175000017500000000631611400674237030140 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m PCI_OpenDRIM_ConcretePCIIdentityModule cimprovider -r -m PCI_OpenDRIM_ConcretePCIIdentityModule 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_ConcretePCIIdentity.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_RegisteredPCIProfile-remove.sh0000755000175000017500000000631411400674237030300 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m PCI_OpenDRIM_RegisteredPCIProfileModule cimprovider -r -m PCI_OpenDRIM_RegisteredPCIProfileModule 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_RegisteredPCIProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$3 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_ComputerSystemPCIDevice-remove.sh0000755000175000017500000000636611400674237031014 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m PCI_OpenDRIM_ComputerSystemPCIDeviceModule cimprovider -r -m PCI_OpenDRIM_ComputerSystemPCIDeviceModule 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_ComputerSystemPCIDevice.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_MemberOfPCICollection.sh0000755000175000017500000000643511400674237027103 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_MemberOfPCICollection.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_MemberOfPCICollection provider module"; Name = "PCI_OpenDRIM_MemberOfPCICollectionModule"; Location = "cmpiPCI_OpenDRIM_MemberOfPCICollectionProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_MemberOfPCICollection provider"; Name = "PCI_OpenDRIM_MemberOfPCICollectionProvider"; ProviderModuleName = "PCI_OpenDRIM_MemberOfPCICollectionModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_MemberOfPCICollection provider capabilities"; ProviderModuleName = "PCI_OpenDRIM_MemberOfPCICollectionModule"; ProviderName = "PCI_OpenDRIM_MemberOfPCICollectionProvider"; ClassName = "OpenDRIM_MemberOfPCICollection"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Collection", "Member"}; CapabilityID = "PCI_OpenDRIM_MemberOfPCICollection"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_MemberOfPCICollection.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_EnabledPCICapabilities-remove.sh0000755000175000017500000000634011400674237030525 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m PCI_OpenDRIM_EnabledPCICapabilitiesModule cimprovider -r -m PCI_OpenDRIM_EnabledPCICapabilitiesModule 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_EnabledPCICapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_PCIDeviceConnection.sh0000755000175000017500000000644411400674237026612 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_PCIDeviceConnection.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_PCIDeviceConnection provider module"; Name = "PCI_OpenDRIM_PCIDeviceConnectionModule"; Location = "cmpiPCI_OpenDRIM_PCIDeviceConnectionProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_PCIDeviceConnection provider"; Name = "PCI_OpenDRIM_PCIDeviceConnectionProvider"; ProviderModuleName = "PCI_OpenDRIM_PCIDeviceConnectionModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_PCIDeviceConnection provider capabilities"; ProviderModuleName = "PCI_OpenDRIM_PCIDeviceConnectionModule"; ProviderName = "PCI_OpenDRIM_PCIDeviceConnectionProvider"; ClassName = "OpenDRIM_PCIDeviceConnection"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent", "NegotiatedSpeed", "NegotiatedDataWidth"}; CapabilityID = "PCI_OpenDRIM_PCIDeviceConnection"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_PCIDeviceConnection.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_PCIDeviceControlledByPCIPort-remove.sh0000755000175000017500000000645011400674237031604 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m PCI_OpenDRIM_PCIDeviceControlledByPCIPortModule cimprovider -r -m PCI_OpenDRIM_PCIDeviceControlledByPCIPortModule 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_PCIDeviceControlledByPCIPort.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_PCIDeviceConnection-remove.sh0000755000175000017500000000631611400674237030103 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m PCI_OpenDRIM_PCIDeviceConnectionModule cimprovider -r -m PCI_OpenDRIM_PCIDeviceConnectionModule 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_PCIDeviceConnection.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_PCICapabilities-remove.sh0000755000175000017500000000624611400674237027257 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m PCI_OpenDRIM_PCICapabilitiesModule cimprovider -r -m PCI_OpenDRIM_PCICapabilitiesModule 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_PCICapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/PCI.sh0000755000175000017500000000552511400674237022014 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then 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_PCIeSwitch.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_PCIDeviceConnection.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_RegisteredPCIProfile.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_PCIPort.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_ComputerSystemPCIDevice.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_PCIBridge.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_PCIDeviceControlledByPCIPort.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_PCICapabilities.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_EnabledPCICapabilities.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_MemberOfPCICollection.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_PCIDevice.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_ConcretePCIIdentity.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_PCIPortGroup.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_PCIDeviceConformsToProfile.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_HostedPCICollection.sh $1 $2 $3 $4 $5 $6 if test "$3" = sfcb then /etc/init.d/sfcb start fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_ComputerSystemPCIDevice.sh0000755000175000017500000000651611400674237027516 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_ComputerSystemPCIDevice.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_ComputerSystemPCIDevice provider module"; Name = "PCI_OpenDRIM_ComputerSystemPCIDeviceModule"; Location = "cmpiPCI_OpenDRIM_ComputerSystemPCIDeviceProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_ComputerSystemPCIDevice provider"; Name = "PCI_OpenDRIM_ComputerSystemPCIDeviceProvider"; ProviderModuleName = "PCI_OpenDRIM_ComputerSystemPCIDeviceModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_ComputerSystemPCIDevice provider capabilities"; ProviderModuleName = "PCI_OpenDRIM_ComputerSystemPCIDeviceModule"; ProviderName = "PCI_OpenDRIM_ComputerSystemPCIDeviceProvider"; ClassName = "OpenDRIM_ComputerSystemPCIDevice"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"GroupComponent", "PartComponent"}; CapabilityID = "PCI_OpenDRIM_ComputerSystemPCIDevice"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_ComputerSystemPCIDevice.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/PCI-remove.sh0000755000175000017500000000554411400674237023310 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then 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_HostedPCICollection-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_PCIDeviceConformsToProfile-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_PCIPortGroup-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_ConcretePCIIdentity-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_PCIDevice-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_MemberOfPCICollection-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_EnabledPCICapabilities-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_PCICapabilities-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_PCIDeviceControlledByPCIPort-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_PCIBridge-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_ComputerSystemPCIDevice-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_PCIPort-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_RegisteredPCIProfile-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_PCIDeviceConnection-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_PCIeSwitch-remove.sh $1 $2 $3 $4 if test "$2" = sfcb then /etc/init.d/sfcb start fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_RegisteredPCIProfile.sh0000755000175000017500000000665111400674237027011 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $4 $6/mof/OpenDRIM_RegisteredPCIProfile.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_RegisteredPCIProfile provider module"; Name = "PCI_OpenDRIM_RegisteredPCIProfileModule"; Location = "cmpiPCI_OpenDRIM_RegisteredPCIProfileProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_RegisteredPCIProfile provider"; Name = "PCI_OpenDRIM_RegisteredPCIProfileProvider"; ProviderModuleName = "PCI_OpenDRIM_RegisteredPCIProfileModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_RegisteredPCIProfile provider capabilities"; ProviderModuleName = "PCI_OpenDRIM_RegisteredPCIProfileModule"; ProviderName = "PCI_OpenDRIM_RegisteredPCIProfileProvider"; ClassName = "OpenDRIM_RegisteredPCIProfile"; ProviderType = {2}; Namespaces = {"$4"}; SupportedProperties = {"Caption", "Description", "ElementName", "InstanceID", "RegisteredOrganization", "OtherRegisteredOrganization", "RegisteredName", "RegisteredVersion", "AdvertiseTypes", "AdvertiseTypeDescriptions"}; CapabilityID = "PCI_OpenDRIM_RegisteredPCIProfile"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_RegisteredPCIProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$4 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_ConcretePCIIdentity.sh0000755000175000017500000000637711400674237026654 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_ConcretePCIIdentity.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_ConcretePCIIdentity provider module"; Name = "PCI_OpenDRIM_ConcretePCIIdentityModule"; Location = "cmpiPCI_OpenDRIM_ConcretePCIIdentityProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_ConcretePCIIdentity provider"; Name = "PCI_OpenDRIM_ConcretePCIIdentityProvider"; ProviderModuleName = "PCI_OpenDRIM_ConcretePCIIdentityModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_ConcretePCIIdentity provider capabilities"; ProviderModuleName = "PCI_OpenDRIM_ConcretePCIIdentityModule"; ProviderName = "PCI_OpenDRIM_ConcretePCIIdentityProvider"; ClassName = "OpenDRIM_ConcretePCIIdentity"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"SystemElement", "SameElement"}; CapabilityID = "PCI_OpenDRIM_ConcretePCIIdentity"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_ConcretePCIIdentity.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_HostedPCICollection.sh0000755000175000017500000000637211400674237026635 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_HostedPCICollection.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_HostedPCICollection provider module"; Name = "PCI_OpenDRIM_HostedPCICollectionModule"; Location = "cmpiPCI_OpenDRIM_HostedPCICollectionProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_HostedPCICollection provider"; Name = "PCI_OpenDRIM_HostedPCICollectionProvider"; ProviderModuleName = "PCI_OpenDRIM_HostedPCICollectionModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_HostedPCICollection provider capabilities"; ProviderModuleName = "PCI_OpenDRIM_HostedPCICollectionModule"; ProviderName = "PCI_OpenDRIM_HostedPCICollectionProvider"; ClassName = "OpenDRIM_HostedPCICollection"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent"}; CapabilityID = "PCI_OpenDRIM_HostedPCICollection"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_HostedPCICollection.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_PCIDevice-remove.sh0000755000175000017500000000614511400674237026063 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m PCI_OpenDRIM_PCIDeviceModule cimprovider -r -m PCI_OpenDRIM_PCIDeviceModule 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_PCIDevice.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_PCIDevice.sh0000755000175000017500000001053111400674237024562 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_PCIDevice.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_PCIDevice provider module"; Name = "PCI_OpenDRIM_PCIDeviceModule"; Location = "cmpiPCI_OpenDRIM_PCIDeviceProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_PCIDevice provider"; Name = "PCI_OpenDRIM_PCIDeviceProvider"; ProviderModuleName = "PCI_OpenDRIM_PCIDeviceModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_PCIDevice provider capabilities"; ProviderModuleName = "PCI_OpenDRIM_PCIDeviceModule"; ProviderName = "PCI_OpenDRIM_PCIDeviceProvider"; ClassName = "OpenDRIM_PCIDevice"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"InstanceID", "Caption", "Description", "ElementName", "InstallDate", "Name", "OperationalStatus", "StatusDescriptions", "Status", "HealthState", "CommunicationStatus", "DetailedStatus", "OperatingStatus", "PrimaryStatus", "EnabledState", "OtherEnabledState", "RequestedState", "EnabledDefault", "TimeOfLastStateChange", "AvailableRequestedStates", "TransitioningToState", "SystemCreationClassName", "SystemName", "CreationClassName", "DeviceID", "PowerManagementSupported", "PowerManagementCapabilities", "Availability", "StatusInfo", "LastErrorCode", "ErrorDescription", "ErrorCleared", "OtherIdentifyingInfo", "PowerOnHours", "TotalPowerOnHours", "IdentifyingDescriptions", "AdditionalAvailability", "MaxQuiesceTime", "TimeOfLastReset", "ProtocolSupported", "MaxNumberControlled", "ProtocolDescription", "CommandRegister", "Capabilities", "CapabilityDescriptions", "DeviceSelectTiming", "ClassCode", "CacheLineSize", "LatencyTimer", "InterruptPin", "ExpansionROMBaseAddress", "SelfTestEnabled", "BaseAddress", "SubsystemID", "SubsystemVendorID", "MinGrantTime", "MaxLatency", "BusNumber", "DeviceNumber", "FunctionNumber", "PCIDeviceID", "VendorID", "RevisionID"}; SupportedMethods = {"RequestStateChange", "SetPowerState", "Reset", "EnableDevice", "OnlineDevice", "QuiesceDevice", "SaveProperties", "RestoreProperties", "BISTExecution"}; CapabilityID = "PCI_OpenDRIM_PCIDevice"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_PCIDevice.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_PCIPortGroup-remove.sh0000755000175000017500000000617411400674237026627 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m PCI_OpenDRIM_PCIPortGroupModule cimprovider -r -m PCI_OpenDRIM_PCIPortGroupModule 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_PCIPortGroup.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_HostedPCICollection-remove.sh0000755000175000017500000000631611400674237030126 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m PCI_OpenDRIM_HostedPCICollectionModule cimprovider -r -m PCI_OpenDRIM_HostedPCICollectionModule 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_HostedPCICollection.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_PCIeSwitch-remove.sh0000755000175000017500000000615711400674237026275 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m PCI_OpenDRIM_PCIeSwitchModule cimprovider -r -m PCI_OpenDRIM_PCIeSwitchModule 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_PCIeSwitch.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_PCIPort-remove.sh0000755000175000017500000000612111400674237025602 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m PCI_OpenDRIM_PCIPortModule cimprovider -r -m PCI_OpenDRIM_PCIPortModule 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_PCIPort.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_MemberOfPCICollection-remove.sh0000755000175000017500000000634211400674237030373 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m PCI_OpenDRIM_MemberOfPCICollectionModule cimprovider -r -m PCI_OpenDRIM_MemberOfPCICollectionModule 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_MemberOfPCICollection.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_PCIPort.sh0000755000175000017500000000767411400674237024325 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_PCIPort.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_PCIPort provider module"; Name = "PCI_OpenDRIM_PCIPortModule"; Location = "cmpiPCI_OpenDRIM_PCIPortProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_PCIPort provider"; Name = "PCI_OpenDRIM_PCIPortProvider"; ProviderModuleName = "PCI_OpenDRIM_PCIPortModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_PCIPort provider capabilities"; ProviderModuleName = "PCI_OpenDRIM_PCIPortModule"; ProviderName = "PCI_OpenDRIM_PCIPortProvider"; ClassName = "OpenDRIM_PCIPort"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"InstanceID", "Caption", "Description", "ElementName", "InstallDate", "Name", "OperationalStatus", "StatusDescriptions", "Status", "HealthState", "CommunicationStatus", "DetailedStatus", "OperatingStatus", "PrimaryStatus", "EnabledState", "OtherEnabledState", "RequestedState", "EnabledDefault", "TimeOfLastStateChange", "AvailableRequestedStates", "TransitioningToState", "SystemCreationClassName", "SystemName", "CreationClassName", "DeviceID", "PowerManagementSupported", "PowerManagementCapabilities", "Availability", "StatusInfo", "LastErrorCode", "ErrorDescription", "ErrorCleared", "OtherIdentifyingInfo", "PowerOnHours", "TotalPowerOnHours", "IdentifyingDescriptions", "AdditionalAvailability", "MaxQuiesceTime", "Speed", "MaxSpeed", "RequestedSpeed", "UsageRestriction", "OtherPortType", "PortType"}; SupportedMethods = {"RequestStateChange", "SetPowerState", "Reset", "EnableDevice", "OnlineDevice", "QuiesceDevice", "SaveProperties", "RestoreProperties"}; CapabilityID = "PCI_OpenDRIM_PCIPort"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_PCIPort.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/registration/OpenDRIM_PCIDeviceControlledByPCIPort.sh0000755000175000017500000000711711400674237030312 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_PCIDeviceControlledByPCIPort.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_PCIDeviceControlledByPCIPort provider module"; Name = "PCI_OpenDRIM_PCIDeviceControlledByPCIPortModule"; Location = "cmpiPCI_OpenDRIM_PCIDeviceControlledByPCIPortProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_PCIDeviceControlledByPCIPort provider"; Name = "PCI_OpenDRIM_PCIDeviceControlledByPCIPortProvider"; ProviderModuleName = "PCI_OpenDRIM_PCIDeviceControlledByPCIPortModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_PCIDeviceControlledByPCIPort provider capabilities"; ProviderModuleName = "PCI_OpenDRIM_PCIDeviceControlledByPCIPortModule"; ProviderName = "PCI_OpenDRIM_PCIDeviceControlledByPCIPortProvider"; ClassName = "OpenDRIM_PCIDeviceControlledByPCIPort"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent", "NegotiatedSpeed", "NegotiatedDataWidth", "AccessState", "TimeOfDeviceReset", "NumberOfHardResets", "NumberOfSoftResets", "DeviceNumber", "AccessMode", "AccessPriority"}; CapabilityID = "PCI_OpenDRIM_PCIDeviceControlledByPCIPort"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_PCIDeviceControlledByPCIPort.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_RegisteredPCIProfile/0000755000175000017500000000000011400674237023730 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_RegisteredPCIProfile/Makefile.am0000644000175000017500000000407211400674237025767 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPCI_OpenDRIM_RegisteredPCIProfileProvider.la libcmpiPCI_OpenDRIM_RegisteredPCIProfileProvider_la_SOURCES = OpenDRIM_RegisteredPCIProfileAccess.cpp OpenDRIM_RegisteredPCIProfileProvider.cpp cmpiOpenDRIM_RegisteredPCIProfile.cpp libcmpiPCI_OpenDRIM_RegisteredPCIProfileProvider_la_LIBADD = ../Common/libcmpiPCI_Common.la libcmpiPCI_OpenDRIM_RegisteredPCIProfileProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_RegisteredPCIProfile.h OpenDRIM_RegisteredPCIProfile.h OpenDRIM_RegisteredPCIProfileAccess.h opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_RegisteredPCIProfile/cmpiOpenDRIM_RegisteredPCIProfile.h0000644000175000017500000000433711400674237032370 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_REGISTEREDPCIPROFILE_H_ #define CMPIOPENDRIM_REGISTEREDPCIPROFILE_H_ #include "OpenDRIM_RegisteredPCIProfile.h" CMPIObjectPath* PCI_OpenDRIM_RegisteredPCIProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RegisteredPCIProfile& instance); CMPIInstance* PCI_OpenDRIM_RegisteredPCIProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RegisteredPCIProfile& instance); void PCI_OpenDRIM_RegisteredPCIProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RegisteredPCIProfile& instance); void PCI_OpenDRIM_RegisteredPCIProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RegisteredPCIProfile& instance); #endif /*CMPIOPENDRIM_REGISTEREDPCIPROFILE_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_RegisteredPCIProfile/OpenDRIM_RegisteredPCIProfile.h0000644000175000017500000001351111400674237031511 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_REGISTEREDPCIPROFILE_H_ #define OPENDRIM_REGISTEREDPCIPROFILE_H_ #include const static char* OpenDRIM_RegisteredPCIProfile_classnames[] = {"OpenDRIM_RegisteredPCIProfile"}; static string OpenDRIM_RegisteredPCIProfile_NAMESPACE = _INTEROP_NAMESPACE; class OpenDRIM_RegisteredPCIProfile { 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_RegisteredPCIProfile() { 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_RegisteredPCIProfile() {} 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_REGISTEREDPCIPROFILE_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_RegisteredPCIProfile/cmpiOpenDRIM_RegisteredPCIProfile.cpp0000644000175000017500000001145711400674237032724 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredPCIProfile.h" CMPIObjectPath* PCI_OpenDRIM_RegisteredPCIProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RegisteredPCIProfile& instance) { _E_; Objectpath op(broker, OpenDRIM_RegisteredPCIProfile_classnames[0], OpenDRIM_RegisteredPCIProfile_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* PCI_OpenDRIM_RegisteredPCIProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RegisteredPCIProfile& instance) { _E_; Objectpath op(broker, PCI_OpenDRIM_RegisteredPCIProfile_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 PCI_OpenDRIM_RegisteredPCIProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RegisteredPCIProfile& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void PCI_OpenDRIM_RegisteredPCIProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RegisteredPCIProfile& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("RegisteredOrganization", instance.RegisteredOrganization) == OK) instance.RegisteredOrganization_isNULL = false; if (inst.getProperty("OtherRegisteredOrganization", instance.OtherRegisteredOrganization) == OK) instance.OtherRegisteredOrganization_isNULL = false; if (inst.getProperty("RegisteredName", instance.RegisteredName) == OK) instance.RegisteredName_isNULL = false; if (inst.getProperty("RegisteredVersion", instance.RegisteredVersion) == OK) instance.RegisteredVersion_isNULL = false; if (inst.getProperty("AdvertiseTypes", instance.AdvertiseTypes) == OK) instance.AdvertiseTypes_isNULL = false; if (inst.getProperty("AdvertiseTypeDescriptions", instance.AdvertiseTypeDescriptions) == OK) instance.AdvertiseTypeDescriptions_isNULL = false; _L_; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_RegisteredPCIProfile/OpenDRIM_RegisteredPCIProfileAccess.cpp0000644000175000017500000000743111400674237033172 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_RegisteredPCIProfileAccess.h" const string instanceID="OpenDRIM:PCIDevice:1.0.0"; int PCI_OpenDRIM_RegisteredPCIProfile_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int PCI_OpenDRIM_RegisteredPCIProfile_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int PCI_OpenDRIM_RegisteredPCIProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; OpenDRIM_RegisteredPCIProfile instance; instance.setInstanceID(instanceID); if (discriminant == "ei") CF_assert(PCI_OpenDRIM_RegisteredPCIProfile_populate(instance, errorMessage)); result.push_back(instance); _L_; return OK; } int PCI_OpenDRIM_RegisteredPCIProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_RegisteredPCIProfile& instance, const char** properties, string& errorMessage) { _E_; if (instance.InstanceID!=instanceID) { errorMessage = "No instance"; return NOT_FOUND; } CF_assert(PCI_OpenDRIM_RegisteredPCIProfile_populate(instance, errorMessage)); _L_; return OK; } int PCI_OpenDRIM_RegisteredPCIProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredPCIProfile& newInstance, const OpenDRIM_RegisteredPCIProfile& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_RegisteredPCIProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredPCIProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_RegisteredPCIProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredPCIProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_RegisteredPCIProfile_populate(OpenDRIM_RegisteredPCIProfile& instance, string& errorMessage) { _E_; vector AdvertiseTypes; instance.setRegisteredName("PCI"); instance.setRegisteredVersion("1.0.0"); instance.setRegisteredOrganization(2); // DMTF AdvertiseTypes.push_back(2); // Not Advertised instance.setAdvertiseTypes(AdvertiseTypes); _L_; return OK; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_RegisteredPCIProfile/OpenDRIM_RegisteredPCIProfileProvider.cpp0000644000175000017500000002554011400674237033564 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredPCIProfile.h" #include "OpenDRIM_RegisteredPCIProfileAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PCI_OpenDRIM_RegisteredPCIProfileProviderSetInstance PCI_OpenDRIM_RegisteredPCIProfileProviderModifyInstance #endif int PCI_OpenDRIM_RegisteredPCIProfile_init(const CMPIBroker* broker); int PCI_OpenDRIM_RegisteredPCIProfile_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PCI_OpenDRIM_RegisteredPCIProfileProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_RegisteredPCIProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_RegisteredPCIProfileProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PCI_OpenDRIM_RegisteredPCIProfile_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredPCIProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_RegisteredPCIProfile_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_RegisteredPCIProfileProviderEnumInstances(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 = PCI_OpenDRIM_RegisteredPCIProfile_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredPCIProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PCI_OpenDRIM_RegisteredPCIProfile_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_RegisteredPCIProfileProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredPCIProfile instance; PCI_OpenDRIM_RegisteredPCIProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_RegisteredPCIProfile_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredPCIProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PCI_OpenDRIM_RegisteredPCIProfile_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_RegisteredPCIProfileProviderSetInstance(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_RegisteredPCIProfile newInstance, oldInstance; PCI_OpenDRIM_RegisteredPCIProfile_toCPP(_broker, ci, newInstance); PCI_OpenDRIM_RegisteredPCIProfile_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PCI_OpenDRIM_RegisteredPCIProfile_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredPCIProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_RegisteredPCIProfile_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredPCIProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_RegisteredPCIProfileProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredPCIProfile instance; PCI_OpenDRIM_RegisteredPCIProfile_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PCI_OpenDRIM_RegisteredPCIProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_RegisteredPCIProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_RegisteredPCIProfile_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredPCIProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_RegisteredPCIProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredPCIProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PCI_OpenDRIM_RegisteredPCIProfile_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_RegisteredPCIProfileProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredPCIProfile instance; PCI_OpenDRIM_RegisteredPCIProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_RegisteredPCIProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredPCIProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_RegisteredPCIProfile_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredPCIProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_RegisteredPCIProfileProviderExecQuery(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 PCI_OpenDRIM_RegisteredPCIProfile_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PCI_OpenDRIM_RegisteredPCIProfile_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_RegisteredPCIProfile_init FAILED: " + (string) OpenDRIM_RegisteredPCIProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PCI_OpenDRIM_RegisteredPCIProfile_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PCI_OpenDRIM_RegisteredPCIProfile_unload(errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_RegisteredPCIProfile_unload FAILED: " + (string) OpenDRIM_RegisteredPCIProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PCI_OpenDRIM_RegisteredPCIProfile_INIT if (PCI_OpenDRIM_RegisteredPCIProfile_init(_broker) < 0) return NULL CMInstanceMIStub(PCI_OpenDRIM_RegisteredPCIProfileProvider, PCI_OpenDRIM_RegisteredPCIProfileProvider, _broker, PCI_OpenDRIM_RegisteredPCIProfile_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_RegisteredPCIProfile/OpenDRIM_RegisteredPCIProfileAccess.h0000644000175000017500000000572311400674237032641 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_REGISTEREDPCIPROFILEACCESS_H_ #define OPENDRIM_REGISTEREDPCIPROFILEACCESS_H_ #include "PCI_Common.h" #include "OpenDRIM_RegisteredPCIProfile.h" int PCI_OpenDRIM_RegisteredPCIProfile_load(const CMPIBroker* broker, string& errorMessage); int PCI_OpenDRIM_RegisteredPCIProfile_unload(string& errorMessage); int PCI_OpenDRIM_RegisteredPCIProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_RegisteredPCIProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_RegisteredPCIProfile& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_RegisteredPCIProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredPCIProfile& newInstance, const OpenDRIM_RegisteredPCIProfile& oldInstance, const char** properties, string& errorMessage); int PCI_OpenDRIM_RegisteredPCIProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredPCIProfile& instance, string& errorMessage); int PCI_OpenDRIM_RegisteredPCIProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredPCIProfile& instance, string& errorMessage); int PCI_OpenDRIM_RegisteredPCIProfile_populate(OpenDRIM_RegisteredPCIProfile& instance, string& errorMessage); #endif /*OPENDRIM_REGISTEREDPCIPROFILEACCESS_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_HostedPCICollection/0000755000175000017500000000000011400674237023554 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_HostedPCICollection/Makefile.am0000644000175000017500000000467511400674237025624 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPCI_OpenDRIM_HostedPCICollectionProvider.la libcmpiPCI_OpenDRIM_HostedPCICollectionProvider_la_SOURCES = OpenDRIM_HostedPCICollectionAccess.cpp OpenDRIM_HostedPCICollectionProvider.cpp cmpiOpenDRIM_HostedPCICollection.cpp assocOpenDRIM_HostedPCICollection.cpp # May have to be adjusted for direct invocation libcmpiPCI_OpenDRIM_HostedPCICollectionProvider_la_CPPFLAGS = -I../CIM_System -I../CIM_SystemSpecificCollection # Uncomment the end for direct invocation, may have to be adjusted libcmpiPCI_OpenDRIM_HostedPCICollectionProvider_la_LIBADD = ../Common/libcmpiPCI_Common.la #../CIM_System/libcmpiPCI_CIM_SystemProvider.la ../CIM_SystemSpecificCollection/libcmpiPCI_CIM_SystemSpecificCollectionProvider.la libcmpiPCI_OpenDRIM_HostedPCICollectionProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_HostedPCICollection.h OpenDRIM_HostedPCICollection.h OpenDRIM_HostedPCICollectionAccess.h opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_HostedPCICollection/OpenDRIM_HostedPCICollectionAccess.cpp0000644000175000017500000002402211400674237032635 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_HostedPCICollectionAccess.h" int PCI_OpenDRIM_HostedPCICollection_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PCI_CIM_System_load(broker, errorMessage)); CF_assert(PCI_CIM_SystemSpecificCollection_load(broker, errorMessage)); */ // TODO _L_; return OK; } int PCI_OpenDRIM_HostedPCICollection_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PCI_CIM_System_unload(errorMessage)); CF_assert(PCI_CIM_SystemSpecificCollection_unload(errorMessage)); */ // TODO _L_; return OK; } int PCI_OpenDRIM_HostedPCICollection_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int PCI_OpenDRIM_HostedPCICollection_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(PCI_OpenDRIM_HostedPCICollection_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(PCI_OpenDRIM_HostedPCICollection_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; PCI_OpenDRIM_HostedPCICollection_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(PCI_OpenDRIM_HostedPCICollection_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int PCI_OpenDRIM_HostedPCICollection_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_HostedPCICollection& 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(PCI_OpenDRIM_HostedPCICollection_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(PCI_OpenDRIM_HostedPCICollection_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(PCI_OpenDRIM_HostedPCICollection_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int PCI_OpenDRIM_HostedPCICollection_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedPCICollection& newInstance, const OpenDRIM_HostedPCICollection& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_HostedPCICollection_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedPCICollection& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_HostedPCICollection_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedPCICollection& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_HostedPCICollection_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(PCI_OpenDRIM_HostedPCICollection_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PCI_OpenDRIM_HostedPCICollection_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(PCI_OpenDRIM_HostedPCICollection_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(PCI_OpenDRIM_HostedPCICollection_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PCI_OpenDRIM_HostedPCICollection_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(PCI_OpenDRIM_HostedPCICollection_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_HostedPCICollection_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_HostedPCICollection instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); OpenDRIM_HostedPCICollection_instances.push_back(instance); } _L_; return OK; } int PCI_OpenDRIM_HostedPCICollection_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_HostedPCICollection_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_HostedPCICollection instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); OpenDRIM_HostedPCICollection_instances.push_back(instance); } _L_; return OK; } int PCI_OpenDRIM_HostedPCICollection_populate(OpenDRIM_HostedPCICollection& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_HostedPCICollection/OpenDRIM_HostedPCICollection.h0000644000175000017500000000663311400674237031170 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_HOSTEDPCICOLLECTION_H_ #define OPENDRIM_HOSTEDPCICOLLECTION_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_System.h" #include "CIM_SystemAccess.h" #include "cmpiCIM_SystemSpecificCollection.h" #include "CIM_SystemSpecificCollectionAccess.h" */ const static char* OpenDRIM_HostedPCICollection_classnames[] = {"OpenDRIM_HostedPCICollection"}; static string OpenDRIM_HostedPCICollection_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_PCIPortGroup"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_HostedPCICollection { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; OpenDRIM_HostedPCICollection() { Antecedent_isNULL = true; Dependent_isNULL = true; } ~OpenDRIM_HostedPCICollection() {} 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_HOSTEDPCICOLLECTION_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_HostedPCICollection/assocOpenDRIM_HostedPCICollection.h0000644000175000017500000000615711400674237032222 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_HOSTEDPCICOLLECTION_H_ #define ASSOCOPENDRIM_HOSTEDPCICOLLECTION_H_ #include "OpenDRIM_HostedPCICollectionAccess.h" int PCI_OpenDRIM_HostedPCICollection_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 PCI_OpenDRIM_HostedPCICollection_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 PCI_OpenDRIM_HostedPCICollection_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PCI_OpenDRIM_HostedPCICollection_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_HostedPCICollection_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PCI_OpenDRIM_HostedPCICollection_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_HOSTEDPCICOLLECTION_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_HostedPCICollection/assocOpenDRIM_HostedPCICollection.cpp0000644000175000017500000002066311400674237032553 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_HostedPCICollection.h" int PCI_OpenDRIM_HostedPCICollection_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 = PCI_OpenDRIM_HostedPCICollection_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(PCI_OpenDRIM_HostedPCICollection_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(PCI_OpenDRIM_HostedPCICollection_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int PCI_OpenDRIM_HostedPCICollection_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(PCI_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PCI_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PCI_CIM_System_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PCI_OpenDRIM_HostedPCICollection_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; PCI_CIM_System_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PCI_CIM_System_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PCI_CIM_System_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int PCI_OpenDRIM_HostedPCICollection_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(PCI_CIM_SystemSpecificCollection_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PCI_CIM_SystemSpecificCollection_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PCI_CIM_SystemSpecificCollection_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PCI_OpenDRIM_HostedPCICollection_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_SystemSpecificCollection _instance; PCI_CIM_SystemSpecificCollection_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PCI_CIM_SystemSpecificCollection_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PCI_CIM_SystemSpecificCollection_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_HostedPCICollection/OpenDRIM_HostedPCICollectionProvider.cpp0000644000175000017500000004141411400674237033232 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_HostedPCICollection.h" #include "OpenDRIM_HostedPCICollectionAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PCI_OpenDRIM_HostedPCICollectionProviderSetInstance PCI_OpenDRIM_HostedPCICollectionProviderModifyInstance #endif int PCI_OpenDRIM_HostedPCICollection_init(const CMPIBroker* broker); int PCI_OpenDRIM_HostedPCICollection_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PCI_OpenDRIM_HostedPCICollectionProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_HostedPCICollection_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_HostedPCICollectionProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PCI_OpenDRIM_HostedPCICollection_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_HostedPCICollection_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_HostedPCICollectionProviderEnumInstances(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 = PCI_OpenDRIM_HostedPCICollection_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PCI_OpenDRIM_HostedPCICollection_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_HostedPCICollectionProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_HostedPCICollection instance; PCI_OpenDRIM_HostedPCICollection_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_HostedPCICollection_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PCI_OpenDRIM_HostedPCICollection_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_HostedPCICollectionProviderSetInstance(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_HostedPCICollection newInstance, oldInstance; PCI_OpenDRIM_HostedPCICollection_toCPP(_broker, ci, newInstance); PCI_OpenDRIM_HostedPCICollection_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PCI_OpenDRIM_HostedPCICollection_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_HostedPCICollection_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_HostedPCICollectionProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_HostedPCICollection instance; PCI_OpenDRIM_HostedPCICollection_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PCI_OpenDRIM_HostedPCICollection_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_HostedPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_HostedPCICollection_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_HostedPCICollection_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PCI_OpenDRIM_HostedPCICollection_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_HostedPCICollectionProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_HostedPCICollection instance; PCI_OpenDRIM_HostedPCICollection_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_HostedPCICollection_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_HostedPCICollection_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_HostedPCICollectionProviderExecQuery(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 PCI_OpenDRIM_HostedPCICollectionProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_HostedPCICollection_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_HostedPCICollectionProviderAssociatorNames(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 = PCI_OpenDRIM_HostedPCICollection_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPCICollection_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 PCI_OpenDRIM_HostedPCICollectionProviderAssociators(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 = PCI_OpenDRIM_HostedPCICollection_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPCICollection_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 PCI_OpenDRIM_HostedPCICollectionProviderReferenceNames(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 = PCI_OpenDRIM_HostedPCICollection_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PCI_OpenDRIM_HostedPCICollection_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = PCI_OpenDRIM_HostedPCICollection_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_HostedPCICollection_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus PCI_OpenDRIM_HostedPCICollectionProviderReferences(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 = PCI_OpenDRIM_HostedPCICollection_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PCI_OpenDRIM_HostedPCICollection_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = PCI_OpenDRIM_HostedPCICollection_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPCICollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = PCI_OpenDRIM_HostedPCICollection_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int PCI_OpenDRIM_HostedPCICollection_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PCI_OpenDRIM_HostedPCICollection_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_HostedPCICollection_init FAILED: " + (string) OpenDRIM_HostedPCICollection_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PCI_OpenDRIM_HostedPCICollection_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PCI_OpenDRIM_HostedPCICollection_unload(errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_HostedPCICollection_unload FAILED: " + (string) OpenDRIM_HostedPCICollection_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PCI_OpenDRIM_HostedPCICollection_INIT if (PCI_OpenDRIM_HostedPCICollection_init(_broker) < 0) return NULL CMInstanceMIStub(PCI_OpenDRIM_HostedPCICollectionProvider, PCI_OpenDRIM_HostedPCICollectionProvider, _broker, PCI_OpenDRIM_HostedPCICollection_INIT); CMAssociationMIStub(PCI_OpenDRIM_HostedPCICollectionProvider, PCI_OpenDRIM_HostedPCICollectionProvider, _broker, PCI_OpenDRIM_HostedPCICollection_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_HostedPCICollection/OpenDRIM_HostedPCICollectionAccess.h0000644000175000017500000001035111400674237032302 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_HOSTEDPCICOLLECTIONACCESS_H_ #define OPENDRIM_HOSTEDPCICOLLECTIONACCESS_H_ #include "PCI_Common.h" #include "OpenDRIM_HostedPCICollection.h" #include "assocOpenDRIM_HostedPCICollection.h" int PCI_OpenDRIM_HostedPCICollection_load(const CMPIBroker* broker, string& errorMessage); int PCI_OpenDRIM_HostedPCICollection_unload(string& errorMessage); int PCI_OpenDRIM_HostedPCICollection_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_HostedPCICollection_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_HostedPCICollection& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_HostedPCICollection_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedPCICollection& newInstance, const OpenDRIM_HostedPCICollection& oldInstance, const char** properties, string& errorMessage); int PCI_OpenDRIM_HostedPCICollection_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedPCICollection& instance, string& errorMessage); int PCI_OpenDRIM_HostedPCICollection_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedPCICollection& instance, string& errorMessage); int PCI_OpenDRIM_HostedPCICollection_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_HostedPCICollection_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_HostedPCICollection_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_HostedPCICollection_instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_HostedPCICollection_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_HostedPCICollection_instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_HostedPCICollection_populate(OpenDRIM_HostedPCICollection& instance, string& errorMessage); #endif /*OPENDRIM_HOSTEDPCICOLLECTIONACCESS_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_HostedPCICollection/cmpiOpenDRIM_HostedPCICollection.h0000644000175000017500000000432311400674237032033 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_HOSTEDPCICOLLECTION_H_ #define CMPIOPENDRIM_HOSTEDPCICOLLECTION_H_ #include "OpenDRIM_HostedPCICollection.h" CMPIObjectPath* PCI_OpenDRIM_HostedPCICollection_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_HostedPCICollection& instance); CMPIInstance* PCI_OpenDRIM_HostedPCICollection_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_HostedPCICollection& instance); void PCI_OpenDRIM_HostedPCICollection_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_HostedPCICollection& instance); void PCI_OpenDRIM_HostedPCICollection_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_HostedPCICollection& instance); #endif /*CMPIOPENDRIM_HOSTEDPCICOLLECTION_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_HostedPCICollection/cmpiOpenDRIM_HostedPCICollection.cpp0000644000175000017500000000604111400674237032365 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_HostedPCICollection.h" CMPIObjectPath* PCI_OpenDRIM_HostedPCICollection_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_HostedPCICollection& instance) { _E_; Objectpath op(broker, OpenDRIM_HostedPCICollection_classnames[0], OpenDRIM_HostedPCICollection_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* PCI_OpenDRIM_HostedPCICollection_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_HostedPCICollection& instance) { _E_; Objectpath op(broker, PCI_OpenDRIM_HostedPCICollection_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void PCI_OpenDRIM_HostedPCICollection_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_HostedPCICollection& 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 PCI_OpenDRIM_HostedPCICollection_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_HostedPCICollection& 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-pci-1.0.0~ppa/OpenDRIM_PCIDevice/0000755000175000017500000000000011400674237021511 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDevice/Makefile.am0000644000175000017500000000371411400674237023552 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPCI_OpenDRIM_PCIDeviceProvider.la libcmpiPCI_OpenDRIM_PCIDeviceProvider_la_SOURCES = OpenDRIM_PCIDeviceAccess.cpp OpenDRIM_PCIDeviceProvider.cpp cmpiOpenDRIM_PCIDevice.cpp libcmpiPCI_OpenDRIM_PCIDeviceProvider_la_LIBADD = ../Common/libcmpiPCI_Common.la libcmpiPCI_OpenDRIM_PCIDeviceProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_PCIDevice.h OpenDRIM_PCIDevice.h OpenDRIM_PCIDeviceAccess.h opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDevice/OpenDRIM_PCIDeviceProvider.cpp0000644000175000017500000004201611400674237027123 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIDevice.h" #include "OpenDRIM_PCIDeviceAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PCI_OpenDRIM_PCIDeviceProviderSetInstance PCI_OpenDRIM_PCIDeviceProviderModifyInstance #endif int PCI_OpenDRIM_PCIDevice_init(const CMPIBroker* broker); int PCI_OpenDRIM_PCIDevice_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PCI_OpenDRIM_PCIDeviceProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_PCIDevice_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PCI_OpenDRIM_PCIDevice_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_PCIDevice_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceProviderEnumInstances(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 = PCI_OpenDRIM_PCIDevice_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PCI_OpenDRIM_PCIDevice_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIDevice instance; PCI_OpenDRIM_PCIDevice_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIDevice_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PCI_OpenDRIM_PCIDevice_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceProviderSetInstance(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_PCIDevice newInstance, oldInstance; PCI_OpenDRIM_PCIDevice_toCPP(_broker, ci, newInstance); PCI_OpenDRIM_PCIDevice_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIDevice_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIDevice_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIDevice instance; PCI_OpenDRIM_PCIDevice_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIDevice_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIDevice_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIDevice_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PCI_OpenDRIM_PCIDevice_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIDevice instance; PCI_OpenDRIM_PCIDevice_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIDevice_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIDevice_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceProviderExecQuery(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 PCI_OpenDRIM_PCIDeviceProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_PCIDevice_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceProviderInvokeMethod(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_PCIDevice instance; PCI_OpenDRIM_PCIDevice_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"DeviceID", "SystemCreationClassName", "SystemName", "CreationClassName"}; int errorCode = PCI_OpenDRIM_PCIDevice_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_PCIDevice_RequestStateChange_In inArgs; PCI_OpenDRIM_PCIDevice_toCPP(_broker, in, inArgs); OpenDRIM_PCIDevice_RequestStateChange_Out outArgs; errorCode = PCI_OpenDRIM_PCIDevice_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } PCI_OpenDRIM_PCIDevice_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SetPowerState") { unsigned int returnValue; OpenDRIM_PCIDevice_SetPowerState_In inArgs; PCI_OpenDRIM_PCIDevice_toCPP(_broker, in, inArgs); errorCode = PCI_OpenDRIM_PCIDevice_SetPowerState(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="Reset") { unsigned int returnValue; errorCode = PCI_OpenDRIM_PCIDevice_Reset(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="EnableDevice") { unsigned int returnValue; OpenDRIM_PCIDevice_EnableDevice_In inArgs; PCI_OpenDRIM_PCIDevice_toCPP(_broker, in, inArgs); errorCode = PCI_OpenDRIM_PCIDevice_EnableDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="OnlineDevice") { unsigned int returnValue; OpenDRIM_PCIDevice_OnlineDevice_In inArgs; PCI_OpenDRIM_PCIDevice_toCPP(_broker, in, inArgs); errorCode = PCI_OpenDRIM_PCIDevice_OnlineDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="QuiesceDevice") { unsigned int returnValue; OpenDRIM_PCIDevice_QuiesceDevice_In inArgs; PCI_OpenDRIM_PCIDevice_toCPP(_broker, in, inArgs); errorCode = PCI_OpenDRIM_PCIDevice_QuiesceDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SaveProperties") { unsigned int returnValue; errorCode = PCI_OpenDRIM_PCIDevice_SaveProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="RestoreProperties") { unsigned int returnValue; errorCode = PCI_OpenDRIM_PCIDevice_RestoreProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="BISTExecution") { unsigned char returnValue; errorCode = PCI_OpenDRIM_PCIDevice_BISTExecution(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint8, CMPI_uint8); } else { errorMessage = (string) OpenDRIM_PCIDevice_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 PCI_OpenDRIM_PCIDevice_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PCI_OpenDRIM_PCIDevice_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_PCIDevice_init FAILED: " + (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PCI_OpenDRIM_PCIDevice_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PCI_OpenDRIM_PCIDevice_unload(errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_PCIDevice_unload FAILED: " + (string) OpenDRIM_PCIDevice_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PCI_OpenDRIM_PCIDevice_INIT if (PCI_OpenDRIM_PCIDevice_init(_broker) < 0) return NULL CMInstanceMIStub(PCI_OpenDRIM_PCIDeviceProvider, PCI_OpenDRIM_PCIDeviceProvider, _broker, PCI_OpenDRIM_PCIDevice_INIT); CMMethodMIStub(PCI_OpenDRIM_PCIDeviceProvider, PCI_OpenDRIM_PCIDeviceProvider, _broker, PCI_OpenDRIM_PCIDevice_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDevice/OpenDRIM_PCIDeviceAccess.h0000644000175000017500000001114311400674237026174 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PCIDEVICEACCESS_H_ #define OPENDRIM_PCIDEVICEACCESS_H_ #include "PCI_Common.h" #include "OpenDRIM_PCIDevice.h" int PCI_OpenDRIM_PCIDevice_load(const CMPIBroker* broker, string& errorMessage); int PCI_OpenDRIM_PCIDevice_unload(string& errorMessage); int PCI_OpenDRIM_PCIDevice_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCIDevice_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PCIDevice& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCIDevice_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDevice& newInstance, const OpenDRIM_PCIDevice& oldInstance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCIDevice_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDevice& instance, string& errorMessage); int PCI_OpenDRIM_PCIDevice_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDevice& instance, string& errorMessage); int PCI_OpenDRIM_PCIDevice_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDevice& instance, unsigned int& returnValue, const OpenDRIM_PCIDevice_RequestStateChange_In& in, OpenDRIM_PCIDevice_RequestStateChange_Out& out, string& errorMessage); int PCI_OpenDRIM_PCIDevice_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDevice& instance, unsigned int& returnValue, const OpenDRIM_PCIDevice_SetPowerState_In& in, string& errorMessage); int PCI_OpenDRIM_PCIDevice_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDevice& instance, unsigned int& returnValue, string& errorMessage); int PCI_OpenDRIM_PCIDevice_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDevice& instance, unsigned int& returnValue, const OpenDRIM_PCIDevice_EnableDevice_In& in, string& errorMessage); int PCI_OpenDRIM_PCIDevice_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDevice& instance, unsigned int& returnValue, const OpenDRIM_PCIDevice_OnlineDevice_In& in, string& errorMessage); int PCI_OpenDRIM_PCIDevice_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDevice& instance, unsigned int& returnValue, const OpenDRIM_PCIDevice_QuiesceDevice_In& in, string& errorMessage); int PCI_OpenDRIM_PCIDevice_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDevice& instance, unsigned int& returnValue, string& errorMessage); int PCI_OpenDRIM_PCIDevice_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDevice& instance, unsigned int& returnValue, string& errorMessage); int PCI_OpenDRIM_PCIDevice_BISTExecution(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDevice& instance, unsigned char& returnValue, string& errorMessage); int PCI_OpenDRIM_PCIDevice_populate(OpenDRIM_PCIDevice& instance, string& errorMessage); #endif /*OPENDRIM_PCIDEVICEACCESS_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDevice/cmpiOpenDRIM_PCIDevice.cpp0000644000175000017500000004517211400674237026267 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIDevice.h" CMPIObjectPath* PCI_OpenDRIM_PCIDevice_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PCIDevice& instance) { _E_; Objectpath op(broker, OpenDRIM_PCIDevice_classnames[0], OpenDRIM_PCIDevice_NAMESPACE); if (!instance.SystemCreationClassName_isNULL) op.addKey("SystemCreationClassName", instance.SystemCreationClassName); if (!instance.SystemName_isNULL) op.addKey("SystemName", instance.SystemName); if (!instance.CreationClassName_isNULL) op.addKey("CreationClassName", instance.CreationClassName); if (!instance.DeviceID_isNULL) op.addKey("DeviceID", instance.DeviceID); _L_; return op.getHdl(); } CMPIInstance* PCI_OpenDRIM_PCIDevice_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PCIDevice& instance) { _E_; Objectpath op(broker, PCI_OpenDRIM_PCIDevice_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.InstanceID_isNULL) ci.setProperty("InstanceID", instance.InstanceID); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.InstallDate_isNULL) ci.setPropertyDatetime("InstallDate", instance.InstallDate); if (!instance.Name_isNULL) ci.setProperty("Name", instance.Name); if (!instance.OperationalStatus_isNULL) ci.setProperty("OperationalStatus", instance.OperationalStatus); if (!instance.StatusDescriptions_isNULL) ci.setProperty("StatusDescriptions", instance.StatusDescriptions); if (!instance.Status_isNULL) ci.setProperty("Status", instance.Status); if (!instance.HealthState_isNULL) ci.setProperty("HealthState", instance.HealthState); if (!instance.CommunicationStatus_isNULL) ci.setProperty("CommunicationStatus", instance.CommunicationStatus); if (!instance.DetailedStatus_isNULL) ci.setProperty("DetailedStatus", instance.DetailedStatus); if (!instance.OperatingStatus_isNULL) ci.setProperty("OperatingStatus", instance.OperatingStatus); if (!instance.PrimaryStatus_isNULL) ci.setProperty("PrimaryStatus", instance.PrimaryStatus); if (!instance.EnabledState_isNULL) ci.setProperty("EnabledState", instance.EnabledState); if (!instance.OtherEnabledState_isNULL) ci.setProperty("OtherEnabledState", instance.OtherEnabledState); if (!instance.RequestedState_isNULL) ci.setProperty("RequestedState", instance.RequestedState); if (!instance.EnabledDefault_isNULL) ci.setProperty("EnabledDefault", instance.EnabledDefault); if (!instance.TimeOfLastStateChange_isNULL) ci.setPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange); if (!instance.AvailableRequestedStates_isNULL) ci.setProperty("AvailableRequestedStates", instance.AvailableRequestedStates); if (!instance.TransitioningToState_isNULL) ci.setProperty("TransitioningToState", instance.TransitioningToState); if (!instance.PowerManagementSupported_isNULL) ci.setProperty("PowerManagementSupported", instance.PowerManagementSupported); if (!instance.PowerManagementCapabilities_isNULL) ci.setProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities); if (!instance.Availability_isNULL) ci.setProperty("Availability", instance.Availability); if (!instance.StatusInfo_isNULL) ci.setProperty("StatusInfo", instance.StatusInfo); if (!instance.LastErrorCode_isNULL) ci.setProperty("LastErrorCode", instance.LastErrorCode); if (!instance.ErrorDescription_isNULL) ci.setProperty("ErrorDescription", instance.ErrorDescription); if (!instance.ErrorCleared_isNULL) ci.setProperty("ErrorCleared", instance.ErrorCleared); if (!instance.OtherIdentifyingInfo_isNULL) ci.setProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo); if (!instance.PowerOnHours_isNULL) ci.setProperty("PowerOnHours", instance.PowerOnHours); if (!instance.TotalPowerOnHours_isNULL) ci.setProperty("TotalPowerOnHours", instance.TotalPowerOnHours); if (!instance.IdentifyingDescriptions_isNULL) ci.setProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions); if (!instance.AdditionalAvailability_isNULL) ci.setProperty("AdditionalAvailability", instance.AdditionalAvailability); if (!instance.MaxQuiesceTime_isNULL) ci.setProperty("MaxQuiesceTime", instance.MaxQuiesceTime); if (!instance.TimeOfLastReset_isNULL) ci.setPropertyDatetime("TimeOfLastReset", instance.TimeOfLastReset); if (!instance.ProtocolSupported_isNULL) ci.setProperty("ProtocolSupported", instance.ProtocolSupported); if (!instance.MaxNumberControlled_isNULL) ci.setProperty("MaxNumberControlled", instance.MaxNumberControlled); if (!instance.ProtocolDescription_isNULL) ci.setProperty("ProtocolDescription", instance.ProtocolDescription); if (!instance.CommandRegister_isNULL) ci.setProperty("CommandRegister", instance.CommandRegister); if (!instance.Capabilities_isNULL) ci.setProperty("Capabilities", instance.Capabilities); if (!instance.CapabilityDescriptions_isNULL) ci.setProperty("CapabilityDescriptions", instance.CapabilityDescriptions); if (!instance.DeviceSelectTiming_isNULL) ci.setProperty("DeviceSelectTiming", instance.DeviceSelectTiming); if (!instance.ClassCode_isNULL) ci.setProperty("ClassCode", instance.ClassCode); if (!instance.CacheLineSize_isNULL) ci.setProperty("CacheLineSize", instance.CacheLineSize); if (!instance.LatencyTimer_isNULL) ci.setProperty("LatencyTimer", instance.LatencyTimer); if (!instance.InterruptPin_isNULL) ci.setProperty("InterruptPin", instance.InterruptPin); if (!instance.ExpansionROMBaseAddress_isNULL) ci.setProperty("ExpansionROMBaseAddress", instance.ExpansionROMBaseAddress); if (!instance.SelfTestEnabled_isNULL) ci.setProperty("SelfTestEnabled", instance.SelfTestEnabled); if (!instance.BaseAddress_isNULL) ci.setProperty("BaseAddress", instance.BaseAddress); if (!instance.SubsystemID_isNULL) ci.setProperty("SubsystemID", instance.SubsystemID); if (!instance.SubsystemVendorID_isNULL) ci.setProperty("SubsystemVendorID", instance.SubsystemVendorID); if (!instance.MinGrantTime_isNULL) ci.setProperty("MinGrantTime", instance.MinGrantTime); if (!instance.MaxLatency_isNULL) ci.setProperty("MaxLatency", instance.MaxLatency); if (!instance.BusNumber_isNULL) ci.setProperty("BusNumber", instance.BusNumber); if (!instance.DeviceNumber_isNULL) ci.setProperty("DeviceNumber", instance.DeviceNumber); if (!instance.FunctionNumber_isNULL) ci.setProperty("FunctionNumber", instance.FunctionNumber); if (!instance.PCIDeviceID_isNULL) ci.setProperty("PCIDeviceID", instance.PCIDeviceID); if (!instance.VendorID_isNULL) ci.setProperty("VendorID", instance.VendorID); if (!instance.RevisionID_isNULL) ci.setProperty("RevisionID", instance.RevisionID); _L_; return ci.getHdl(); } void PCI_OpenDRIM_PCIDevice_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PCIDevice& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (op.getKey("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (op.getKey("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (op.getKey("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; _L_; } void PCI_OpenDRIM_PCIDevice_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PCIDevice& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getPropertyDatetime("InstallDate", instance.InstallDate) == OK) instance.InstallDate_isNULL = false; if (inst.getProperty("Name", instance.Name) == OK) instance.Name_isNULL = false; if (inst.getProperty("OperationalStatus", instance.OperationalStatus) == OK) instance.OperationalStatus_isNULL = false; if (inst.getProperty("StatusDescriptions", instance.StatusDescriptions) == OK) instance.StatusDescriptions_isNULL = false; if (inst.getProperty("Status", instance.Status) == OK) instance.Status_isNULL = false; if (inst.getProperty("HealthState", instance.HealthState) == OK) instance.HealthState_isNULL = false; if (inst.getProperty("CommunicationStatus", instance.CommunicationStatus) == OK) instance.CommunicationStatus_isNULL = false; if (inst.getProperty("DetailedStatus", instance.DetailedStatus) == OK) instance.DetailedStatus_isNULL = false; if (inst.getProperty("OperatingStatus", instance.OperatingStatus) == OK) instance.OperatingStatus_isNULL = false; if (inst.getProperty("PrimaryStatus", instance.PrimaryStatus) == OK) instance.PrimaryStatus_isNULL = false; if (inst.getProperty("EnabledState", instance.EnabledState) == OK) instance.EnabledState_isNULL = false; if (inst.getProperty("OtherEnabledState", instance.OtherEnabledState) == OK) instance.OtherEnabledState_isNULL = false; if (inst.getProperty("RequestedState", instance.RequestedState) == OK) instance.RequestedState_isNULL = false; if (inst.getProperty("EnabledDefault", instance.EnabledDefault) == OK) instance.EnabledDefault_isNULL = false; if (inst.getPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange) == OK) instance.TimeOfLastStateChange_isNULL = false; if (inst.getProperty("AvailableRequestedStates", instance.AvailableRequestedStates) == OK) instance.AvailableRequestedStates_isNULL = false; if (inst.getProperty("TransitioningToState", instance.TransitioningToState) == OK) instance.TransitioningToState_isNULL = false; if (inst.getProperty("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (inst.getProperty("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (inst.getProperty("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; if (inst.getProperty("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (inst.getProperty("PowerManagementSupported", instance.PowerManagementSupported) == OK) instance.PowerManagementSupported_isNULL = false; if (inst.getProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities) == OK) instance.PowerManagementCapabilities_isNULL = false; if (inst.getProperty("Availability", instance.Availability) == OK) instance.Availability_isNULL = false; if (inst.getProperty("StatusInfo", instance.StatusInfo) == OK) instance.StatusInfo_isNULL = false; if (inst.getProperty("LastErrorCode", instance.LastErrorCode) == OK) instance.LastErrorCode_isNULL = false; if (inst.getProperty("ErrorDescription", instance.ErrorDescription) == OK) instance.ErrorDescription_isNULL = false; if (inst.getProperty("ErrorCleared", instance.ErrorCleared) == OK) instance.ErrorCleared_isNULL = false; if (inst.getProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo) == OK) instance.OtherIdentifyingInfo_isNULL = false; if (inst.getProperty("PowerOnHours", instance.PowerOnHours) == OK) instance.PowerOnHours_isNULL = false; if (inst.getProperty("TotalPowerOnHours", instance.TotalPowerOnHours) == OK) instance.TotalPowerOnHours_isNULL = false; if (inst.getProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions) == OK) instance.IdentifyingDescriptions_isNULL = false; if (inst.getProperty("AdditionalAvailability", instance.AdditionalAvailability) == OK) instance.AdditionalAvailability_isNULL = false; if (inst.getProperty("MaxQuiesceTime", instance.MaxQuiesceTime) == OK) instance.MaxQuiesceTime_isNULL = false; if (inst.getPropertyDatetime("TimeOfLastReset", instance.TimeOfLastReset) == OK) instance.TimeOfLastReset_isNULL = false; if (inst.getProperty("ProtocolSupported", instance.ProtocolSupported) == OK) instance.ProtocolSupported_isNULL = false; if (inst.getProperty("MaxNumberControlled", instance.MaxNumberControlled) == OK) instance.MaxNumberControlled_isNULL = false; if (inst.getProperty("ProtocolDescription", instance.ProtocolDescription) == OK) instance.ProtocolDescription_isNULL = false; if (inst.getProperty("CommandRegister", instance.CommandRegister) == OK) instance.CommandRegister_isNULL = false; if (inst.getProperty("Capabilities", instance.Capabilities) == OK) instance.Capabilities_isNULL = false; if (inst.getProperty("CapabilityDescriptions", instance.CapabilityDescriptions) == OK) instance.CapabilityDescriptions_isNULL = false; if (inst.getProperty("DeviceSelectTiming", instance.DeviceSelectTiming) == OK) instance.DeviceSelectTiming_isNULL = false; if (inst.getProperty("ClassCode", instance.ClassCode) == OK) instance.ClassCode_isNULL = false; if (inst.getProperty("CacheLineSize", instance.CacheLineSize) == OK) instance.CacheLineSize_isNULL = false; if (inst.getProperty("LatencyTimer", instance.LatencyTimer) == OK) instance.LatencyTimer_isNULL = false; if (inst.getProperty("InterruptPin", instance.InterruptPin) == OK) instance.InterruptPin_isNULL = false; if (inst.getProperty("ExpansionROMBaseAddress", instance.ExpansionROMBaseAddress) == OK) instance.ExpansionROMBaseAddress_isNULL = false; if (inst.getProperty("SelfTestEnabled", instance.SelfTestEnabled) == OK) instance.SelfTestEnabled_isNULL = false; if (inst.getProperty("BaseAddress", instance.BaseAddress) == OK) instance.BaseAddress_isNULL = false; if (inst.getProperty("SubsystemID", instance.SubsystemID) == OK) instance.SubsystemID_isNULL = false; if (inst.getProperty("SubsystemVendorID", instance.SubsystemVendorID) == OK) instance.SubsystemVendorID_isNULL = false; if (inst.getProperty("MinGrantTime", instance.MinGrantTime) == OK) instance.MinGrantTime_isNULL = false; if (inst.getProperty("MaxLatency", instance.MaxLatency) == OK) instance.MaxLatency_isNULL = false; if (inst.getProperty("BusNumber", instance.BusNumber) == OK) instance.BusNumber_isNULL = false; if (inst.getProperty("DeviceNumber", instance.DeviceNumber) == OK) instance.DeviceNumber_isNULL = false; if (inst.getProperty("FunctionNumber", instance.FunctionNumber) == OK) instance.FunctionNumber_isNULL = false; if (inst.getProperty("PCIDeviceID", instance.PCIDeviceID) == OK) instance.PCIDeviceID_isNULL = false; if (inst.getProperty("VendorID", instance.VendorID) == OK) instance.VendorID_isNULL = false; if (inst.getProperty("RevisionID", instance.RevisionID) == OK) instance.RevisionID_isNULL = false; _L_; } void PCI_OpenDRIM_PCIDevice_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIDevice_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 PCI_OpenDRIM_PCIDevice_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_PCIDevice_RequestStateChange_Out& args) { _E_; CMPIValue value; int errorMessage; Objectpath Job; errorMessage = args.getJob(Job); if (errorMessage == OK) { value = CT_toCMPI(Job); out->ft->addArg(out, "Job", &value, CMPI_ref); } _L_; } void PCI_OpenDRIM_PCIDevice_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIDevice_SetPowerState_In& args) { _E_; CMPIStatus rc; CMPIData data; unsigned short PowerState; data = in->ft->getArg(in, "PowerState", &rc); if (rc.rc == OK) { CT_ToC(data, PowerState); args.setPowerState(PowerState); } string Time; data = in->ft->getArg(in, "Time", &rc); if (rc.rc == OK) { CT_ToCDatetime(data, Time); args.setTime(Time); } _L_; } void PCI_OpenDRIM_PCIDevice_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIDevice_EnableDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Enabled; data = in->ft->getArg(in, "Enabled", &rc); if (rc.rc == OK) { CT_ToC(data, Enabled); args.setEnabled(Enabled); } _L_; } void PCI_OpenDRIM_PCIDevice_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIDevice_OnlineDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Online; data = in->ft->getArg(in, "Online", &rc); if (rc.rc == OK) { CT_ToC(data, Online); args.setOnline(Online); } _L_; } void PCI_OpenDRIM_PCIDevice_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIDevice_QuiesceDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Quiesce; data = in->ft->getArg(in, "Quiesce", &rc); if (rc.rc == OK) { CT_ToC(data, Quiesce); args.setQuiesce(Quiesce); } _L_; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDevice/OpenDRIM_PCIDeviceAccess.cpp0000644000175000017500000001624311400674237026535 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_PCIDeviceAccess.h" const string systemCreationClassName = "OpenDRIM_ComputerSystem"; const string creationClassName = "OpenDRIM_PCIDevice"; string systemName; string deviceID; int PCI_OpenDRIM_PCIDevice_load(const CMPIBroker* broker, string& errorMessage) { _E_; CF_assert(CF_getSystemName(systemName, errorMessage)); _L_; return OK; } int PCI_OpenDRIM_PCIDevice_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int PCI_OpenDRIM_PCIDevice_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; vector device_lines; CF_assert(CF_runCommandToLines("lspci -n", device_lines, 0, errorMessage)); vector deviceIDs; for(size_t i=0; i pcidevices_elements; string busNumber, deviceNumber, functionNumber; string command; string device; command = "lspci -d " + instance.DeviceID; CF_runCommandFL(command,device,errorMessage); instance.setElementName(device.substr(8)); CF_splitText(pcidevices_elements,device, ":."); busNumber = pcidevices_elements[0]; deviceNumber = pcidevices_elements[1]; functionNumber = pcidevices_elements[2]; //converting from string to char const char *bn, *dn, *fn; bn = busNumber.c_str(); dn = deviceNumber.c_str(); fn = functionNumber.c_str(); //converting from hex to dec instance.setBusNumber(HexToInteger(bn)); instance.setDeviceNumber(HexToInteger(dn)); instance.setFunctionNumber(HexToInteger(fn)); instance.setHealthState(0); instance.setPrimaryStatus(0); _L_; return OK; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDevice/OpenDRIM_PCIDevice.h0000644000175000017500000007256211400674237025066 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PCIDEVICE_H_ #define OPENDRIM_PCIDEVICE_H_ #include const static char* OpenDRIM_PCIDevice_classnames[] = {"OpenDRIM_PCIDevice"}; static string OpenDRIM_PCIDevice_NAMESPACE = _NAMESPACE; class OpenDRIM_PCIDevice { public: string InstanceID; bool InstanceID_isNULL; string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string InstallDate; bool InstallDate_isNULL; string Name; bool Name_isNULL; vector OperationalStatus; bool OperationalStatus_isNULL; vector StatusDescriptions; bool StatusDescriptions_isNULL; string Status; bool Status_isNULL; unsigned short HealthState; bool HealthState_isNULL; unsigned short CommunicationStatus; bool CommunicationStatus_isNULL; unsigned short DetailedStatus; bool DetailedStatus_isNULL; unsigned short OperatingStatus; bool OperatingStatus_isNULL; unsigned short PrimaryStatus; bool PrimaryStatus_isNULL; unsigned short EnabledState; bool EnabledState_isNULL; string OtherEnabledState; bool OtherEnabledState_isNULL; unsigned short RequestedState; bool RequestedState_isNULL; unsigned short EnabledDefault; bool EnabledDefault_isNULL; string TimeOfLastStateChange; bool TimeOfLastStateChange_isNULL; vector AvailableRequestedStates; bool AvailableRequestedStates_isNULL; unsigned short TransitioningToState; bool TransitioningToState_isNULL; string SystemCreationClassName; bool SystemCreationClassName_isNULL; string SystemName; bool SystemName_isNULL; string CreationClassName; bool CreationClassName_isNULL; string DeviceID; bool DeviceID_isNULL; bool PowerManagementSupported; bool PowerManagementSupported_isNULL; vector PowerManagementCapabilities; bool PowerManagementCapabilities_isNULL; unsigned short Availability; bool Availability_isNULL; unsigned short StatusInfo; bool StatusInfo_isNULL; unsigned int LastErrorCode; bool LastErrorCode_isNULL; string ErrorDescription; bool ErrorDescription_isNULL; bool ErrorCleared; bool ErrorCleared_isNULL; vector OtherIdentifyingInfo; bool OtherIdentifyingInfo_isNULL; unsigned long long PowerOnHours; bool PowerOnHours_isNULL; unsigned long long TotalPowerOnHours; bool TotalPowerOnHours_isNULL; vector IdentifyingDescriptions; bool IdentifyingDescriptions_isNULL; vector AdditionalAvailability; bool AdditionalAvailability_isNULL; unsigned long long MaxQuiesceTime; bool MaxQuiesceTime_isNULL; string TimeOfLastReset; bool TimeOfLastReset_isNULL; unsigned short ProtocolSupported; bool ProtocolSupported_isNULL; unsigned int MaxNumberControlled; bool MaxNumberControlled_isNULL; string ProtocolDescription; bool ProtocolDescription_isNULL; unsigned short CommandRegister; bool CommandRegister_isNULL; vector Capabilities; bool Capabilities_isNULL; vector CapabilityDescriptions; bool CapabilityDescriptions_isNULL; unsigned short DeviceSelectTiming; bool DeviceSelectTiming_isNULL; unsigned char ClassCode; bool ClassCode_isNULL; unsigned char CacheLineSize; bool CacheLineSize_isNULL; unsigned char LatencyTimer; bool LatencyTimer_isNULL; unsigned short InterruptPin; bool InterruptPin_isNULL; unsigned int ExpansionROMBaseAddress; bool ExpansionROMBaseAddress_isNULL; bool SelfTestEnabled; bool SelfTestEnabled_isNULL; vector BaseAddress; bool BaseAddress_isNULL; unsigned short SubsystemID; bool SubsystemID_isNULL; unsigned short SubsystemVendorID; bool SubsystemVendorID_isNULL; unsigned char MinGrantTime; bool MinGrantTime_isNULL; unsigned char MaxLatency; bool MaxLatency_isNULL; unsigned char BusNumber; bool BusNumber_isNULL; unsigned char DeviceNumber; bool DeviceNumber_isNULL; unsigned char FunctionNumber; bool FunctionNumber_isNULL; unsigned short PCIDeviceID; bool PCIDeviceID_isNULL; unsigned short VendorID; bool VendorID_isNULL; unsigned char RevisionID; bool RevisionID_isNULL; OpenDRIM_PCIDevice() { InstanceID_isNULL = true; Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstallDate_isNULL = true; Name_isNULL = true; OperationalStatus_isNULL = true; StatusDescriptions_isNULL = true; Status_isNULL = true; HealthState_isNULL = true; CommunicationStatus_isNULL = true; DetailedStatus_isNULL = true; OperatingStatus_isNULL = true; PrimaryStatus_isNULL = true; EnabledState_isNULL = true; OtherEnabledState_isNULL = true; RequestedState_isNULL = true; EnabledDefault_isNULL = true; TimeOfLastStateChange_isNULL = true; AvailableRequestedStates_isNULL = true; TransitioningToState_isNULL = true; SystemCreationClassName_isNULL = true; SystemName_isNULL = true; CreationClassName_isNULL = true; DeviceID_isNULL = true; PowerManagementSupported_isNULL = true; PowerManagementCapabilities_isNULL = true; Availability_isNULL = true; StatusInfo_isNULL = true; LastErrorCode_isNULL = true; ErrorDescription_isNULL = true; ErrorCleared_isNULL = true; OtherIdentifyingInfo_isNULL = true; PowerOnHours_isNULL = true; TotalPowerOnHours_isNULL = true; IdentifyingDescriptions_isNULL = true; AdditionalAvailability_isNULL = true; MaxQuiesceTime_isNULL = true; TimeOfLastReset_isNULL = true; ProtocolSupported_isNULL = true; MaxNumberControlled_isNULL = true; ProtocolDescription_isNULL = true; CommandRegister_isNULL = true; Capabilities_isNULL = true; CapabilityDescriptions_isNULL = true; DeviceSelectTiming_isNULL = true; ClassCode_isNULL = true; CacheLineSize_isNULL = true; LatencyTimer_isNULL = true; InterruptPin_isNULL = true; ExpansionROMBaseAddress_isNULL = true; SelfTestEnabled_isNULL = true; BaseAddress_isNULL = true; SubsystemID_isNULL = true; SubsystemVendorID_isNULL = true; MinGrantTime_isNULL = true; MaxLatency_isNULL = true; BusNumber_isNULL = true; DeviceNumber_isNULL = true; FunctionNumber_isNULL = true; PCIDeviceID_isNULL = true; VendorID_isNULL = true; RevisionID_isNULL = true; } ~OpenDRIM_PCIDevice() {} string getKeys() const { return CF_toLowCase(".SystemCreationClassName=\"" + CF_quoteString(SystemCreationClassName) + "\""".SystemName=\"" + CF_quoteString(SystemName) + "\""".CreationClassName=\"" + CF_quoteString(CreationClassName) + "\""".DeviceID=\"" + CF_quoteString(DeviceID) + "\""); } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getInstallDate(string& value) const { if (InstallDate_isNULL==true) return NOT_FOUND; value = InstallDate; return OK; } int setInstallDate(const string& newValue) { InstallDate = newValue; InstallDate_isNULL = false; return OK; } int getName(string& value) const { if (Name_isNULL==true) return NOT_FOUND; value = Name; return OK; } int setName(const string& newValue) { Name = newValue; Name_isNULL = false; return OK; } int getOperationalStatus(vector& value) const { if (OperationalStatus_isNULL==true) return NOT_FOUND; value = OperationalStatus; return OK; } int setOperationalStatus(const vector& newValue) { OperationalStatus = newValue; OperationalStatus_isNULL = false; return OK; } int getStatusDescriptions(vector& value) const { if (StatusDescriptions_isNULL==true) return NOT_FOUND; value = StatusDescriptions; return OK; } int setStatusDescriptions(const vector& newValue) { StatusDescriptions = newValue; StatusDescriptions_isNULL = false; return OK; } int getStatus(string& value) const { if (Status_isNULL==true) return NOT_FOUND; value = Status; return OK; } int setStatus(const string& newValue) { Status = newValue; Status_isNULL = false; return OK; } int getHealthState(unsigned short& value) const { if (HealthState_isNULL==true) return NOT_FOUND; value = HealthState; return OK; } int setHealthState(const unsigned short& newValue) { HealthState = newValue; HealthState_isNULL = false; return OK; } int getCommunicationStatus(unsigned short& value) const { if (CommunicationStatus_isNULL==true) return NOT_FOUND; value = CommunicationStatus; return OK; } int setCommunicationStatus(const unsigned short& newValue) { CommunicationStatus = newValue; CommunicationStatus_isNULL = false; return OK; } int getDetailedStatus(unsigned short& value) const { if (DetailedStatus_isNULL==true) return NOT_FOUND; value = DetailedStatus; return OK; } int setDetailedStatus(const unsigned short& newValue) { DetailedStatus = newValue; DetailedStatus_isNULL = false; return OK; } int getOperatingStatus(unsigned short& value) const { if (OperatingStatus_isNULL==true) return NOT_FOUND; value = OperatingStatus; return OK; } int setOperatingStatus(const unsigned short& newValue) { OperatingStatus = newValue; OperatingStatus_isNULL = false; return OK; } int getPrimaryStatus(unsigned short& value) const { if (PrimaryStatus_isNULL==true) return NOT_FOUND; value = PrimaryStatus; return OK; } int setPrimaryStatus(const unsigned short& newValue) { PrimaryStatus = newValue; PrimaryStatus_isNULL = false; return OK; } int getEnabledState(unsigned short& value) const { if (EnabledState_isNULL==true) return NOT_FOUND; value = EnabledState; return OK; } int setEnabledState(const unsigned short& newValue) { EnabledState = newValue; EnabledState_isNULL = false; return OK; } int getOtherEnabledState(string& value) const { if (OtherEnabledState_isNULL==true) return NOT_FOUND; value = OtherEnabledState; return OK; } int setOtherEnabledState(const string& newValue) { OtherEnabledState = newValue; OtherEnabledState_isNULL = false; return OK; } int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL==true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getEnabledDefault(unsigned short& value) const { if (EnabledDefault_isNULL==true) return NOT_FOUND; value = EnabledDefault; return OK; } int setEnabledDefault(const unsigned short& newValue) { EnabledDefault = newValue; EnabledDefault_isNULL = false; return OK; } int getTimeOfLastStateChange(string& value) const { if (TimeOfLastStateChange_isNULL==true) return NOT_FOUND; value = TimeOfLastStateChange; return OK; } int setTimeOfLastStateChange(const string& newValue) { TimeOfLastStateChange = newValue; TimeOfLastStateChange_isNULL = false; return OK; } int getAvailableRequestedStates(vector& value) const { if (AvailableRequestedStates_isNULL==true) return NOT_FOUND; value = AvailableRequestedStates; return OK; } int setAvailableRequestedStates(const vector& newValue) { AvailableRequestedStates = newValue; AvailableRequestedStates_isNULL = false; return OK; } int getTransitioningToState(unsigned short& value) const { if (TransitioningToState_isNULL==true) return NOT_FOUND; value = TransitioningToState; return OK; } int setTransitioningToState(const unsigned short& newValue) { TransitioningToState = newValue; TransitioningToState_isNULL = false; return OK; } int getSystemCreationClassName(string& value) const { if (SystemCreationClassName_isNULL==true) return NOT_FOUND; value = SystemCreationClassName; return OK; } int setSystemCreationClassName(const string& newValue) { SystemCreationClassName = newValue; SystemCreationClassName_isNULL = false; return OK; } int getSystemName(string& value) const { if (SystemName_isNULL==true) return NOT_FOUND; value = SystemName; return OK; } int setSystemName(const string& newValue) { SystemName = newValue; SystemName_isNULL = false; return OK; } int getCreationClassName(string& value) const { if (CreationClassName_isNULL==true) return NOT_FOUND; value = CreationClassName; return OK; } int setCreationClassName(const string& newValue) { CreationClassName = newValue; CreationClassName_isNULL = false; return OK; } int getDeviceID(string& value) const { if (DeviceID_isNULL==true) return NOT_FOUND; value = DeviceID; return OK; } int setDeviceID(const string& newValue) { DeviceID = newValue; DeviceID_isNULL = false; return OK; } int getPowerManagementSupported(bool& value) const { if (PowerManagementSupported_isNULL==true) return NOT_FOUND; value = PowerManagementSupported; return OK; } int setPowerManagementSupported(const bool& newValue) { PowerManagementSupported = newValue; PowerManagementSupported_isNULL = false; return OK; } int getPowerManagementCapabilities(vector& value) const { if (PowerManagementCapabilities_isNULL==true) return NOT_FOUND; value = PowerManagementCapabilities; return OK; } int setPowerManagementCapabilities(const vector& newValue) { PowerManagementCapabilities = newValue; PowerManagementCapabilities_isNULL = false; return OK; } int getAvailability(unsigned short& value) const { if (Availability_isNULL==true) return NOT_FOUND; value = Availability; return OK; } int setAvailability(const unsigned short& newValue) { Availability = newValue; Availability_isNULL = false; return OK; } int getStatusInfo(unsigned short& value) const { if (StatusInfo_isNULL==true) return NOT_FOUND; value = StatusInfo; return OK; } int setStatusInfo(const unsigned short& newValue) { StatusInfo = newValue; StatusInfo_isNULL = false; return OK; } int getLastErrorCode(unsigned int& value) const { if (LastErrorCode_isNULL==true) return NOT_FOUND; value = LastErrorCode; return OK; } int setLastErrorCode(const unsigned int& newValue) { LastErrorCode = newValue; LastErrorCode_isNULL = false; return OK; } int getErrorDescription(string& value) const { if (ErrorDescription_isNULL==true) return NOT_FOUND; value = ErrorDescription; return OK; } int setErrorDescription(const string& newValue) { ErrorDescription = newValue; ErrorDescription_isNULL = false; return OK; } int getErrorCleared(bool& value) const { if (ErrorCleared_isNULL==true) return NOT_FOUND; value = ErrorCleared; return OK; } int setErrorCleared(const bool& newValue) { ErrorCleared = newValue; ErrorCleared_isNULL = false; return OK; } int getOtherIdentifyingInfo(vector& value) const { if (OtherIdentifyingInfo_isNULL==true) return NOT_FOUND; value = OtherIdentifyingInfo; return OK; } int setOtherIdentifyingInfo(const vector& newValue) { OtherIdentifyingInfo = newValue; OtherIdentifyingInfo_isNULL = false; return OK; } int getPowerOnHours(unsigned long long& value) const { if (PowerOnHours_isNULL==true) return NOT_FOUND; value = PowerOnHours; return OK; } int setPowerOnHours(const unsigned long long& newValue) { PowerOnHours = newValue; PowerOnHours_isNULL = false; return OK; } int getTotalPowerOnHours(unsigned long long& value) const { if (TotalPowerOnHours_isNULL==true) return NOT_FOUND; value = TotalPowerOnHours; return OK; } int setTotalPowerOnHours(const unsigned long long& newValue) { TotalPowerOnHours = newValue; TotalPowerOnHours_isNULL = false; return OK; } int getIdentifyingDescriptions(vector& value) const { if (IdentifyingDescriptions_isNULL==true) return NOT_FOUND; value = IdentifyingDescriptions; return OK; } int setIdentifyingDescriptions(const vector& newValue) { IdentifyingDescriptions = newValue; IdentifyingDescriptions_isNULL = false; return OK; } int getAdditionalAvailability(vector& value) const { if (AdditionalAvailability_isNULL==true) return NOT_FOUND; value = AdditionalAvailability; return OK; } int setAdditionalAvailability(const vector& newValue) { AdditionalAvailability = newValue; AdditionalAvailability_isNULL = false; return OK; } int getMaxQuiesceTime(unsigned long long& value) const { if (MaxQuiesceTime_isNULL==true) return NOT_FOUND; value = MaxQuiesceTime; return OK; } int setMaxQuiesceTime(const unsigned long long& newValue) { MaxQuiesceTime = newValue; MaxQuiesceTime_isNULL = false; return OK; } int getTimeOfLastReset(string& value) const { if (TimeOfLastReset_isNULL==true) return NOT_FOUND; value = TimeOfLastReset; return OK; } int setTimeOfLastReset(const string& newValue) { TimeOfLastReset = newValue; TimeOfLastReset_isNULL = false; return OK; } int getProtocolSupported(unsigned short& value) const { if (ProtocolSupported_isNULL==true) return NOT_FOUND; value = ProtocolSupported; return OK; } int setProtocolSupported(const unsigned short& newValue) { ProtocolSupported = newValue; ProtocolSupported_isNULL = false; return OK; } int getMaxNumberControlled(unsigned int& value) const { if (MaxNumberControlled_isNULL==true) return NOT_FOUND; value = MaxNumberControlled; return OK; } int setMaxNumberControlled(const unsigned int& newValue) { MaxNumberControlled = newValue; MaxNumberControlled_isNULL = false; return OK; } int getProtocolDescription(string& value) const { if (ProtocolDescription_isNULL==true) return NOT_FOUND; value = ProtocolDescription; return OK; } int setProtocolDescription(const string& newValue) { ProtocolDescription = newValue; ProtocolDescription_isNULL = false; return OK; } int getCommandRegister(unsigned short& value) const { if (CommandRegister_isNULL==true) return NOT_FOUND; value = CommandRegister; return OK; } int setCommandRegister(const unsigned short& newValue) { CommandRegister = newValue; CommandRegister_isNULL = false; return OK; } int getCapabilities(vector& value) const { if (Capabilities_isNULL==true) return NOT_FOUND; value = Capabilities; return OK; } int setCapabilities(const vector& newValue) { Capabilities = newValue; Capabilities_isNULL = false; return OK; } int getCapabilityDescriptions(vector& value) const { if (CapabilityDescriptions_isNULL==true) return NOT_FOUND; value = CapabilityDescriptions; return OK; } int setCapabilityDescriptions(const vector& newValue) { CapabilityDescriptions = newValue; CapabilityDescriptions_isNULL = false; return OK; } int getDeviceSelectTiming(unsigned short& value) const { if (DeviceSelectTiming_isNULL==true) return NOT_FOUND; value = DeviceSelectTiming; return OK; } int setDeviceSelectTiming(const unsigned short& newValue) { DeviceSelectTiming = newValue; DeviceSelectTiming_isNULL = false; return OK; } int getClassCode(unsigned char& value) const { if (ClassCode_isNULL==true) return NOT_FOUND; value = ClassCode; return OK; } int setClassCode(const unsigned char& newValue) { ClassCode = newValue; ClassCode_isNULL = false; return OK; } int getCacheLineSize(unsigned char& value) const { if (CacheLineSize_isNULL==true) return NOT_FOUND; value = CacheLineSize; return OK; } int setCacheLineSize(const unsigned char& newValue) { CacheLineSize = newValue; CacheLineSize_isNULL = false; return OK; } int getLatencyTimer(unsigned char& value) const { if (LatencyTimer_isNULL==true) return NOT_FOUND; value = LatencyTimer; return OK; } int setLatencyTimer(const unsigned char& newValue) { LatencyTimer = newValue; LatencyTimer_isNULL = false; return OK; } int getInterruptPin(unsigned short& value) const { if (InterruptPin_isNULL==true) return NOT_FOUND; value = InterruptPin; return OK; } int setInterruptPin(const unsigned short& newValue) { InterruptPin = newValue; InterruptPin_isNULL = false; return OK; } int getExpansionROMBaseAddress(unsigned int& value) const { if (ExpansionROMBaseAddress_isNULL==true) return NOT_FOUND; value = ExpansionROMBaseAddress; return OK; } int setExpansionROMBaseAddress(const unsigned int& newValue) { ExpansionROMBaseAddress = newValue; ExpansionROMBaseAddress_isNULL = false; return OK; } int getSelfTestEnabled(bool& value) const { if (SelfTestEnabled_isNULL==true) return NOT_FOUND; value = SelfTestEnabled; return OK; } int setSelfTestEnabled(const bool& newValue) { SelfTestEnabled = newValue; SelfTestEnabled_isNULL = false; return OK; } int getBaseAddress(vector& value) const { if (BaseAddress_isNULL==true) return NOT_FOUND; value = BaseAddress; return OK; } int setBaseAddress(const vector& newValue) { BaseAddress = newValue; BaseAddress_isNULL = false; return OK; } int getSubsystemID(unsigned short& value) const { if (SubsystemID_isNULL==true) return NOT_FOUND; value = SubsystemID; return OK; } int setSubsystemID(const unsigned short& newValue) { SubsystemID = newValue; SubsystemID_isNULL = false; return OK; } int getSubsystemVendorID(unsigned short& value) const { if (SubsystemVendorID_isNULL==true) return NOT_FOUND; value = SubsystemVendorID; return OK; } int setSubsystemVendorID(const unsigned short& newValue) { SubsystemVendorID = newValue; SubsystemVendorID_isNULL = false; return OK; } int getMinGrantTime(unsigned char& value) const { if (MinGrantTime_isNULL==true) return NOT_FOUND; value = MinGrantTime; return OK; } int setMinGrantTime(const unsigned char& newValue) { MinGrantTime = newValue; MinGrantTime_isNULL = false; return OK; } int getMaxLatency(unsigned char& value) const { if (MaxLatency_isNULL==true) return NOT_FOUND; value = MaxLatency; return OK; } int setMaxLatency(const unsigned char& newValue) { MaxLatency = newValue; MaxLatency_isNULL = false; return OK; } int getBusNumber(unsigned char& value) const { if (BusNumber_isNULL==true) return NOT_FOUND; value = BusNumber; return OK; } int setBusNumber(const unsigned char& newValue) { BusNumber = newValue; BusNumber_isNULL = false; return OK; } int getDeviceNumber(unsigned char& value) const { if (DeviceNumber_isNULL==true) return NOT_FOUND; value = DeviceNumber; return OK; } int setDeviceNumber(const unsigned char& newValue) { DeviceNumber = newValue; DeviceNumber_isNULL = false; return OK; } int getFunctionNumber(unsigned char& value) const { if (FunctionNumber_isNULL==true) return NOT_FOUND; value = FunctionNumber; return OK; } int setFunctionNumber(const unsigned char& newValue) { FunctionNumber = newValue; FunctionNumber_isNULL = false; return OK; } int getPCIDeviceID(unsigned short& value) const { if (PCIDeviceID_isNULL==true) return NOT_FOUND; value = PCIDeviceID; return OK; } int setPCIDeviceID(const unsigned short& newValue) { PCIDeviceID = newValue; PCIDeviceID_isNULL = false; return OK; } int getVendorID(unsigned short& value) const { if (VendorID_isNULL==true) return NOT_FOUND; value = VendorID; return OK; } int setVendorID(const unsigned short& newValue) { VendorID = newValue; VendorID_isNULL = false; return OK; } int getRevisionID(unsigned char& value) const { if (RevisionID_isNULL==true) return NOT_FOUND; value = RevisionID; return OK; } int setRevisionID(const unsigned char& newValue) { RevisionID = newValue; RevisionID_isNULL = false; return OK; } }; class OpenDRIM_PCIDevice_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_PCIDevice_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_PCIDevice_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_PCIDevice_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_PCIDevice_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_PCIDevice_RequestStateChange_Out() {} int getJob(Objectpath& value) const { if (Job_isNULL == true) return NOT_FOUND; value = Job; return OK; } int setJob(const Objectpath& newValue) { Job = newValue; Job_isNULL = false; return OK; } }; class OpenDRIM_PCIDevice_SetPowerState_In { public: unsigned short PowerState; bool PowerState_isNULL; string Time; bool Time_isNULL; OpenDRIM_PCIDevice_SetPowerState_In() { PowerState_isNULL = true; Time_isNULL = true; } ~OpenDRIM_PCIDevice_SetPowerState_In() {} int getPowerState(unsigned short& value) const { if (PowerState_isNULL == true) return NOT_FOUND; value = PowerState; return OK; } int setPowerState(const unsigned short& newValue) { PowerState = newValue; PowerState_isNULL = false; return OK; } int getTime(string& value) const { if (Time_isNULL == true) return NOT_FOUND; value = Time; return OK; } int setTime(const string& newValue) { Time = newValue; Time_isNULL = false; return OK; } }; class OpenDRIM_PCIDevice_EnableDevice_In { public: bool Enabled; bool Enabled_isNULL; OpenDRIM_PCIDevice_EnableDevice_In() { Enabled_isNULL = true; } ~OpenDRIM_PCIDevice_EnableDevice_In() {} int getEnabled(bool& value) const { if (Enabled_isNULL == true) return NOT_FOUND; value = Enabled; return OK; } int setEnabled(const bool& newValue) { Enabled = newValue; Enabled_isNULL = false; return OK; } }; class OpenDRIM_PCIDevice_OnlineDevice_In { public: bool Online; bool Online_isNULL; OpenDRIM_PCIDevice_OnlineDevice_In() { Online_isNULL = true; } ~OpenDRIM_PCIDevice_OnlineDevice_In() {} int getOnline(bool& value) const { if (Online_isNULL == true) return NOT_FOUND; value = Online; return OK; } int setOnline(const bool& newValue) { Online = newValue; Online_isNULL = false; return OK; } }; class OpenDRIM_PCIDevice_QuiesceDevice_In { public: bool Quiesce; bool Quiesce_isNULL; OpenDRIM_PCIDevice_QuiesceDevice_In() { Quiesce_isNULL = true; } ~OpenDRIM_PCIDevice_QuiesceDevice_In() {} int getQuiesce(bool& value) const { if (Quiesce_isNULL == true) return NOT_FOUND; value = Quiesce; return OK; } int setQuiesce(const bool& newValue) { Quiesce = newValue; Quiesce_isNULL = false; return OK; } }; #endif /*OPENDRIM_PCIDEVICE_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDevice/cmpiOpenDRIM_PCIDevice.h0000644000175000017500000000552711400674237025734 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_PCIDEVICE_H_ #define CMPIOPENDRIM_PCIDEVICE_H_ #include "OpenDRIM_PCIDevice.h" CMPIObjectPath* PCI_OpenDRIM_PCIDevice_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PCIDevice& instance); CMPIInstance* PCI_OpenDRIM_PCIDevice_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PCIDevice& instance); void PCI_OpenDRIM_PCIDevice_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PCIDevice& instance); void PCI_OpenDRIM_PCIDevice_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PCIDevice& instance); void PCI_OpenDRIM_PCIDevice_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIDevice_RequestStateChange_In& args); void PCI_OpenDRIM_PCIDevice_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_PCIDevice_RequestStateChange_Out& args); void PCI_OpenDRIM_PCIDevice_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIDevice_SetPowerState_In& args); void PCI_OpenDRIM_PCIDevice_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIDevice_EnableDevice_In& args); void PCI_OpenDRIM_PCIDevice_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIDevice_OnlineDevice_In& args); void PCI_OpenDRIM_PCIDevice_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIDevice_QuiesceDevice_In& args); #endif /*CMPIOPENDRIM_PCIDEVICE_H_*/ opendrim-lmp-pci-1.0.0~ppa/VERSION0000644000175000017500000000000611400674237017365 0ustar guillaumeguillaume1.0.0 opendrim-lmp-pci-1.0.0~ppa/test/0000755000175000017500000000000011400674237017300 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/test/testOpenDRIM_PCIPort.cpp0000644000175000017500000001665211400674237023633 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIPort.h" #include "OpenDRIM_PCIPortAccess.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_PCIPort& instance) { os << " [OpenDRIM_PCIPort]" << endl; ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstallDate", InstallDate, InstallDate_isNULL); ToString("Name", Name, Name_isNULL); ToStringArrayInt("OperationalStatus", OperationalStatus, OperationalStatus_isNULL); ToStringArray("StatusDescriptions", StatusDescriptions, StatusDescriptions_isNULL); ToString("Status", Status, Status_isNULL); ToStringInt("HealthState", HealthState, HealthState_isNULL); ToStringInt("CommunicationStatus", CommunicationStatus, CommunicationStatus_isNULL); ToStringInt("DetailedStatus", DetailedStatus, DetailedStatus_isNULL); ToStringInt("OperatingStatus", OperatingStatus, OperatingStatus_isNULL); ToStringInt("PrimaryStatus", PrimaryStatus, PrimaryStatus_isNULL); ToStringInt("EnabledState", EnabledState, EnabledState_isNULL); ToString("OtherEnabledState", OtherEnabledState, OtherEnabledState_isNULL); ToStringInt("RequestedState", RequestedState, RequestedState_isNULL); ToStringInt("EnabledDefault", EnabledDefault, EnabledDefault_isNULL); ToString("TimeOfLastStateChange", TimeOfLastStateChange, TimeOfLastStateChange_isNULL); ToStringArrayInt("AvailableRequestedStates", AvailableRequestedStates, AvailableRequestedStates_isNULL); ToStringInt("TransitioningToState", TransitioningToState, TransitioningToState_isNULL); ToString("SystemCreationClassName", SystemCreationClassName, SystemCreationClassName_isNULL); ToString("SystemName", SystemName, SystemName_isNULL); ToString("CreationClassName", CreationClassName, CreationClassName_isNULL); ToString("DeviceID", DeviceID, DeviceID_isNULL); ToString("PowerManagementSupported", PowerManagementSupported, PowerManagementSupported_isNULL); ToStringArrayInt("PowerManagementCapabilities", PowerManagementCapabilities, PowerManagementCapabilities_isNULL); ToStringInt("Availability", Availability, Availability_isNULL); ToStringInt("StatusInfo", StatusInfo, StatusInfo_isNULL); ToString("LastErrorCode", LastErrorCode, LastErrorCode_isNULL); ToString("ErrorDescription", ErrorDescription, ErrorDescription_isNULL); ToString("ErrorCleared", ErrorCleared, ErrorCleared_isNULL); ToStringArray("OtherIdentifyingInfo", OtherIdentifyingInfo, OtherIdentifyingInfo_isNULL); ToString("PowerOnHours", PowerOnHours, PowerOnHours_isNULL); ToString("TotalPowerOnHours", TotalPowerOnHours, TotalPowerOnHours_isNULL); ToStringArray("IdentifyingDescriptions", IdentifyingDescriptions, IdentifyingDescriptions_isNULL); ToStringArrayInt("AdditionalAvailability", AdditionalAvailability, AdditionalAvailability_isNULL); ToString("MaxQuiesceTime", MaxQuiesceTime, MaxQuiesceTime_isNULL); ToString("Speed", Speed, Speed_isNULL); ToString("MaxSpeed", MaxSpeed, MaxSpeed_isNULL); ToString("RequestedSpeed", RequestedSpeed, RequestedSpeed_isNULL); ToStringInt("UsageRestriction", UsageRestriction, UsageRestriction_isNULL); ToString("OtherPortType", OtherPortType, OtherPortType_isNULL); ToStringInt("PortType", PortType, PortType_isNULL); os << " [\\OpenDRIM_PCIPort]" << endl; return os; } int main() { string errorMessage; int errorCode = PCI_OpenDRIM_PCIPort_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PCI_OpenDRIM_PCIPort_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 = PCI_OpenDRIM_PCIPort_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 = PCI_OpenDRIM_PCIPort_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 = PCI_OpenDRIM_PCIPort_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-pci-1.0.0~ppa/test/testOpenDRIM_PCIDeviceControlledByPCIPort.cpp0000644000175000017500000001254511400674237027625 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIDeviceControlledByPCIPort.h" #include "OpenDRIM_PCIDeviceControlledByPCIPortAccess.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_PCIDeviceControlledByPCIPort& instance) { os << " [OpenDRIM_PCIDeviceControlledByPCIPort]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); ToString("NegotiatedSpeed", NegotiatedSpeed, NegotiatedSpeed_isNULL); ToString("NegotiatedDataWidth", NegotiatedDataWidth, NegotiatedDataWidth_isNULL); ToStringInt("AccessState", AccessState, AccessState_isNULL); ToString("TimeOfDeviceReset", TimeOfDeviceReset, TimeOfDeviceReset_isNULL); ToString("NumberOfHardResets", NumberOfHardResets, NumberOfHardResets_isNULL); ToString("NumberOfSoftResets", NumberOfSoftResets, NumberOfSoftResets_isNULL); ToString("DeviceNumber", DeviceNumber, DeviceNumber_isNULL); ToStringInt("AccessMode", AccessMode, AccessMode_isNULL); ToStringInt("AccessPriority", AccessPriority, AccessPriority_isNULL); os << " [\\OpenDRIM_PCIDeviceControlledByPCIPort]" << endl; return os; } int main() { string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_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 = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_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 = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_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 = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-pci-1.0.0~ppa/test/Makefile.am0000644000175000017500000001754411400674237021347 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### noinst_PROGRAMS = testOpenDRIM_PCIeSwitch testOpenDRIM_PCIDeviceConnection testOpenDRIM_RegisteredPCIProfile testOpenDRIM_PCIPort testOpenDRIM_ComputerSystemPCIDevice testOpenDRIM_PCIBridge testOpenDRIM_PCIDeviceControlledByPCIPort testOpenDRIM_PCICapabilities testOpenDRIM_EnabledPCICapabilities testOpenDRIM_MemberOfPCICollection testOpenDRIM_PCIDevice testOpenDRIM_ConcretePCIIdentity testOpenDRIM_PCIPortGroup testOpenDRIM_PCIDeviceConformsToProfile testOpenDRIM_HostedPCICollection testOpenDRIM_PCIeSwitch_CPPFLAGS = -I../OpenDRIM_PCIeSwitch/ testOpenDRIM_PCIeSwitch_SOURCES = testOpenDRIM_PCIeSwitch.cpp testOpenDRIM_PCIeSwitch_LDADD = ../OpenDRIM_PCIeSwitch/libcmpiPCI_OpenDRIM_PCIeSwitchProvider.la test-OpenDRIM_PCIeSwitch: testOpenDRIM_PCIeSwitch ./testOpenDRIM_PCIeSwitch # May have to be adjusted for direct invocation testOpenDRIM_PCIDeviceConnection_CPPFLAGS = -I../OpenDRIM_PCIDeviceConnection/ -I../null/ -I../null/ testOpenDRIM_PCIDeviceConnection_SOURCES = testOpenDRIM_PCIDeviceConnection.cpp testOpenDRIM_PCIDeviceConnection_LDADD = ../OpenDRIM_PCIDeviceConnection/libcmpiPCI_OpenDRIM_PCIDeviceConnectionProvider.la test-OpenDRIM_PCIDeviceConnection: testOpenDRIM_PCIDeviceConnection ./testOpenDRIM_PCIDeviceConnection testOpenDRIM_RegisteredPCIProfile_CPPFLAGS = -I../OpenDRIM_RegisteredPCIProfile/ testOpenDRIM_RegisteredPCIProfile_SOURCES = testOpenDRIM_RegisteredPCIProfile.cpp testOpenDRIM_RegisteredPCIProfile_LDADD = ../OpenDRIM_RegisteredPCIProfile/libcmpiPCI_OpenDRIM_RegisteredPCIProfileProvider.la test-OpenDRIM_RegisteredPCIProfile: testOpenDRIM_RegisteredPCIProfile ./testOpenDRIM_RegisteredPCIProfile testOpenDRIM_PCIPort_CPPFLAGS = -I../OpenDRIM_PCIPort/ testOpenDRIM_PCIPort_SOURCES = testOpenDRIM_PCIPort.cpp testOpenDRIM_PCIPort_LDADD = ../OpenDRIM_PCIPort/libcmpiPCI_OpenDRIM_PCIPortProvider.la test-OpenDRIM_PCIPort: testOpenDRIM_PCIPort ./testOpenDRIM_PCIPort # May have to be adjusted for direct invocation testOpenDRIM_ComputerSystemPCIDevice_CPPFLAGS = -I../OpenDRIM_ComputerSystemPCIDevice/ -I../null/ -I../null/ testOpenDRIM_ComputerSystemPCIDevice_SOURCES = testOpenDRIM_ComputerSystemPCIDevice.cpp testOpenDRIM_ComputerSystemPCIDevice_LDADD = ../OpenDRIM_ComputerSystemPCIDevice/libcmpiPCI_OpenDRIM_ComputerSystemPCIDeviceProvider.la test-OpenDRIM_ComputerSystemPCIDevice: testOpenDRIM_ComputerSystemPCIDevice ./testOpenDRIM_ComputerSystemPCIDevice testOpenDRIM_PCIBridge_CPPFLAGS = -I../OpenDRIM_PCIBridge/ testOpenDRIM_PCIBridge_SOURCES = testOpenDRIM_PCIBridge.cpp testOpenDRIM_PCIBridge_LDADD = ../OpenDRIM_PCIBridge/libcmpiPCI_OpenDRIM_PCIBridgeProvider.la test-OpenDRIM_PCIBridge: testOpenDRIM_PCIBridge ./testOpenDRIM_PCIBridge # May have to be adjusted for direct invocation testOpenDRIM_PCIDeviceControlledByPCIPort_CPPFLAGS = -I../OpenDRIM_PCIDeviceControlledByPCIPort/ -I../null/ -I../null/ testOpenDRIM_PCIDeviceControlledByPCIPort_SOURCES = testOpenDRIM_PCIDeviceControlledByPCIPort.cpp testOpenDRIM_PCIDeviceControlledByPCIPort_LDADD = ../OpenDRIM_PCIDeviceControlledByPCIPort/libcmpiPCI_OpenDRIM_PCIDeviceControlledByPCIPortProvider.la test-OpenDRIM_PCIDeviceControlledByPCIPort: testOpenDRIM_PCIDeviceControlledByPCIPort ./testOpenDRIM_PCIDeviceControlledByPCIPort # May have to be adjusted for direct invocation testOpenDRIM_PCICapabilities_CPPFLAGS = -I../OpenDRIM_PCICapabilities/ -I../null/ -I../null/ testOpenDRIM_PCICapabilities_SOURCES = testOpenDRIM_PCICapabilities.cpp testOpenDRIM_PCICapabilities_LDADD = ../OpenDRIM_PCICapabilities/libcmpiPCI_OpenDRIM_PCICapabilitiesProvider.la test-OpenDRIM_PCICapabilities: testOpenDRIM_PCICapabilities ./testOpenDRIM_PCICapabilities testOpenDRIM_EnabledPCICapabilities_CPPFLAGS = -I../OpenDRIM_EnabledPCICapabilities/ testOpenDRIM_EnabledPCICapabilities_SOURCES = testOpenDRIM_EnabledPCICapabilities.cpp testOpenDRIM_EnabledPCICapabilities_LDADD = ../OpenDRIM_EnabledPCICapabilities/libcmpiPCI_OpenDRIM_EnabledPCICapabilitiesProvider.la test-OpenDRIM_EnabledPCICapabilities: testOpenDRIM_EnabledPCICapabilities ./testOpenDRIM_EnabledPCICapabilities # May have to be adjusted for direct invocation testOpenDRIM_MemberOfPCICollection_CPPFLAGS = -I../OpenDRIM_MemberOfPCICollection/ -I../null/ -I../null/ testOpenDRIM_MemberOfPCICollection_SOURCES = testOpenDRIM_MemberOfPCICollection.cpp testOpenDRIM_MemberOfPCICollection_LDADD = ../OpenDRIM_MemberOfPCICollection/libcmpiPCI_OpenDRIM_MemberOfPCICollectionProvider.la test-OpenDRIM_MemberOfPCICollection: testOpenDRIM_MemberOfPCICollection ./testOpenDRIM_MemberOfPCICollection testOpenDRIM_PCIDevice_CPPFLAGS = -I../OpenDRIM_PCIDevice/ testOpenDRIM_PCIDevice_SOURCES = testOpenDRIM_PCIDevice.cpp testOpenDRIM_PCIDevice_LDADD = ../OpenDRIM_PCIDevice/libcmpiPCI_OpenDRIM_PCIDeviceProvider.la test-OpenDRIM_PCIDevice: testOpenDRIM_PCIDevice ./testOpenDRIM_PCIDevice testOpenDRIM_ConcretePCIIdentity_CPPFLAGS = -I../OpenDRIM_ConcretePCIIdentity/ testOpenDRIM_ConcretePCIIdentity_SOURCES = testOpenDRIM_ConcretePCIIdentity.cpp testOpenDRIM_ConcretePCIIdentity_LDADD = ../OpenDRIM_ConcretePCIIdentity/libcmpiPCI_OpenDRIM_ConcretePCIIdentityProvider.la test-OpenDRIM_ConcretePCIIdentity: testOpenDRIM_ConcretePCIIdentity ./testOpenDRIM_ConcretePCIIdentity testOpenDRIM_PCIPortGroup_CPPFLAGS = -I../OpenDRIM_PCIPortGroup/ testOpenDRIM_PCIPortGroup_SOURCES = testOpenDRIM_PCIPortGroup.cpp testOpenDRIM_PCIPortGroup_LDADD = ../OpenDRIM_PCIPortGroup/libcmpiPCI_OpenDRIM_PCIPortGroupProvider.la test-OpenDRIM_PCIPortGroup: testOpenDRIM_PCIPortGroup ./testOpenDRIM_PCIPortGroup testOpenDRIM_PCIDeviceConformsToProfile_CPPFLAGS = -I../OpenDRIM_PCIDeviceConformsToProfile/ testOpenDRIM_PCIDeviceConformsToProfile_SOURCES = testOpenDRIM_PCIDeviceConformsToProfile.cpp testOpenDRIM_PCIDeviceConformsToProfile_LDADD = ../OpenDRIM_PCIDeviceConformsToProfile/libcmpiPCI_OpenDRIM_PCIDeviceConformsToProfileProvider.la test-OpenDRIM_PCIDeviceConformsToProfile: testOpenDRIM_PCIDeviceConformsToProfile ./testOpenDRIM_PCIDeviceConformsToProfile # May have to be adjusted for direct invocation testOpenDRIM_HostedPCICollection_CPPFLAGS = -I../OpenDRIM_HostedPCICollection/ -I../null/ -I../null/ testOpenDRIM_HostedPCICollection_SOURCES = testOpenDRIM_HostedPCICollection.cpp testOpenDRIM_HostedPCICollection_LDADD = ../OpenDRIM_HostedPCICollection/libcmpiPCI_OpenDRIM_HostedPCICollectionProvider.la test-OpenDRIM_HostedPCICollection: testOpenDRIM_HostedPCICollection ./testOpenDRIM_HostedPCICollection opendrim-lmp-pci-1.0.0~ppa/test/testOpenDRIM_ConcretePCIIdentity.cpp0000644000175000017500000001120311400674237026146 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ConcretePCIIdentity.h" #include "OpenDRIM_ConcretePCIIdentityAccess.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_ConcretePCIIdentity& instance) { os << " [OpenDRIM_ConcretePCIIdentity]" << endl; ToStringRef("SystemElement", SystemElement, SystemElement_isNULL); ToStringRef("SameElement", SameElement, SameElement_isNULL); os << " [\\OpenDRIM_ConcretePCIIdentity]" << endl; return os; } int main() { string errorMessage; int errorCode = PCI_OpenDRIM_ConcretePCIIdentity_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PCI_OpenDRIM_ConcretePCIIdentity_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 = PCI_OpenDRIM_ConcretePCIIdentity_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 = PCI_OpenDRIM_ConcretePCIIdentity_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 = PCI_OpenDRIM_ConcretePCIIdentity_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-pci-1.0.0~ppa/test/testOpenDRIM_PCIPortGroup.cpp0000644000175000017500000001154711400674237024646 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIPortGroup.h" #include "OpenDRIM_PCIPortGroupAccess.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_PCIPortGroup& instance) { os << " [OpenDRIM_PCIPortGroup]" << endl; ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("Name", Name, Name_isNULL); ToString("NameFormat", NameFormat, NameFormat_isNULL); ToString("OtherNameFormat", OtherNameFormat, OtherNameFormat_isNULL); ToStringInt("BusNumber", BusNumber, BusNumber_isNULL); os << " [\\OpenDRIM_PCIPortGroup]" << endl; return os; } int main() { string errorMessage; int errorCode = PCI_OpenDRIM_PCIPortGroup_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PCI_OpenDRIM_PCIPortGroup_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 = PCI_OpenDRIM_PCIPortGroup_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 = PCI_OpenDRIM_PCIPortGroup_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 = PCI_OpenDRIM_PCIPortGroup_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-pci-1.0.0~ppa/test/testOpenDRIM_RegisteredPCIProfile.cpp0000644000175000017500000001237311400674237026321 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredPCIProfile.h" #include "OpenDRIM_RegisteredPCIProfileAccess.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_RegisteredPCIProfile& instance) { os << " [OpenDRIM_RegisteredPCIProfile]" << 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_RegisteredPCIProfile]" << endl; return os; } int main() { string errorMessage; int errorCode = PCI_OpenDRIM_RegisteredPCIProfile_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PCI_OpenDRIM_RegisteredPCIProfile_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 = PCI_OpenDRIM_RegisteredPCIProfile_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 = PCI_OpenDRIM_RegisteredPCIProfile_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 = PCI_OpenDRIM_RegisteredPCIProfile_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-pci-1.0.0~ppa/test/testOpenDRIM_PCICapabilities.cpp0000644000175000017500000001125011400674237025265 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCICapabilities.h" #include "OpenDRIM_PCICapabilitiesAccess.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_PCICapabilities& instance) { os << " [OpenDRIM_PCICapabilities]" << endl; ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL); ToStringRef("Capabilities", Capabilities, Capabilities_isNULL); ToStringArrayInt("Characteristics", Characteristics, Characteristics_isNULL); os << " [\\OpenDRIM_PCICapabilities]" << endl; return os; } int main() { string errorMessage; int errorCode = PCI_OpenDRIM_PCICapabilities_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PCI_OpenDRIM_PCICapabilities_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 = PCI_OpenDRIM_PCICapabilities_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 = PCI_OpenDRIM_PCICapabilities_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 = PCI_OpenDRIM_PCICapabilities_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-pci-1.0.0~ppa/test/testOpenDRIM_PCIDeviceConformsToProfile.cpp0000644000175000017500000001135711400674237027436 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIDeviceConformsToProfile.h" #include "OpenDRIM_PCIDeviceConformsToProfileAccess.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_PCIDeviceConformsToProfile& instance) { os << " [OpenDRIM_PCIDeviceConformsToProfile]" << endl; ToStringRef("ConformantStandard", ConformantStandard, ConformantStandard_isNULL); ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL); os << " [\\OpenDRIM_PCIDeviceConformsToProfile]" << endl; return os; } int main() { string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceConformsToProfile_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PCI_OpenDRIM_PCIDeviceConformsToProfile_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 = PCI_OpenDRIM_PCIDeviceConformsToProfile_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 = PCI_OpenDRIM_PCIDeviceConformsToProfile_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 = PCI_OpenDRIM_PCIDeviceConformsToProfile_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-pci-1.0.0~ppa/test/testOpenDRIM_ComputerSystemPCIDevice.cpp0000644000175000017500000001127411400674237027025 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ComputerSystemPCIDevice.h" #include "OpenDRIM_ComputerSystemPCIDeviceAccess.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_ComputerSystemPCIDevice& instance) { os << " [OpenDRIM_ComputerSystemPCIDevice]" << endl; ToStringRef("GroupComponent", GroupComponent, GroupComponent_isNULL); ToStringRef("PartComponent", PartComponent, PartComponent_isNULL); os << " [\\OpenDRIM_ComputerSystemPCIDevice]" << endl; return os; } int main() { string errorMessage; int errorCode = PCI_OpenDRIM_ComputerSystemPCIDevice_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PCI_OpenDRIM_ComputerSystemPCIDevice_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 = PCI_OpenDRIM_ComputerSystemPCIDevice_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 = PCI_OpenDRIM_ComputerSystemPCIDevice_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 = PCI_OpenDRIM_ComputerSystemPCIDevice_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-pci-1.0.0~ppa/test/testOpenDRIM_PCIBridge.cpp0000644000175000017500000002413211400674237024073 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIBridge.h" #include "OpenDRIM_PCIBridgeAccess.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_PCIBridge& instance) { os << " [OpenDRIM_PCIBridge]" << endl; ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstallDate", InstallDate, InstallDate_isNULL); ToString("Name", Name, Name_isNULL); ToStringArrayInt("OperationalStatus", OperationalStatus, OperationalStatus_isNULL); ToStringArray("StatusDescriptions", StatusDescriptions, StatusDescriptions_isNULL); ToString("Status", Status, Status_isNULL); ToStringInt("HealthState", HealthState, HealthState_isNULL); ToStringInt("CommunicationStatus", CommunicationStatus, CommunicationStatus_isNULL); ToStringInt("DetailedStatus", DetailedStatus, DetailedStatus_isNULL); ToStringInt("OperatingStatus", OperatingStatus, OperatingStatus_isNULL); ToStringInt("PrimaryStatus", PrimaryStatus, PrimaryStatus_isNULL); ToStringInt("EnabledState", EnabledState, EnabledState_isNULL); ToString("OtherEnabledState", OtherEnabledState, OtherEnabledState_isNULL); ToStringInt("RequestedState", RequestedState, RequestedState_isNULL); ToStringInt("EnabledDefault", EnabledDefault, EnabledDefault_isNULL); ToString("TimeOfLastStateChange", TimeOfLastStateChange, TimeOfLastStateChange_isNULL); ToStringArrayInt("AvailableRequestedStates", AvailableRequestedStates, AvailableRequestedStates_isNULL); ToStringInt("TransitioningToState", TransitioningToState, TransitioningToState_isNULL); ToString("SystemCreationClassName", SystemCreationClassName, SystemCreationClassName_isNULL); ToString("SystemName", SystemName, SystemName_isNULL); ToString("CreationClassName", CreationClassName, CreationClassName_isNULL); ToString("DeviceID", DeviceID, DeviceID_isNULL); ToString("PowerManagementSupported", PowerManagementSupported, PowerManagementSupported_isNULL); ToStringArrayInt("PowerManagementCapabilities", PowerManagementCapabilities, PowerManagementCapabilities_isNULL); ToStringInt("Availability", Availability, Availability_isNULL); ToStringInt("StatusInfo", StatusInfo, StatusInfo_isNULL); ToString("LastErrorCode", LastErrorCode, LastErrorCode_isNULL); ToString("ErrorDescription", ErrorDescription, ErrorDescription_isNULL); ToString("ErrorCleared", ErrorCleared, ErrorCleared_isNULL); ToStringArray("OtherIdentifyingInfo", OtherIdentifyingInfo, OtherIdentifyingInfo_isNULL); ToString("PowerOnHours", PowerOnHours, PowerOnHours_isNULL); ToString("TotalPowerOnHours", TotalPowerOnHours, TotalPowerOnHours_isNULL); ToStringArray("IdentifyingDescriptions", IdentifyingDescriptions, IdentifyingDescriptions_isNULL); ToStringArrayInt("AdditionalAvailability", AdditionalAvailability, AdditionalAvailability_isNULL); ToString("MaxQuiesceTime", MaxQuiesceTime, MaxQuiesceTime_isNULL); ToString("TimeOfLastReset", TimeOfLastReset, TimeOfLastReset_isNULL); ToStringInt("ProtocolSupported", ProtocolSupported, ProtocolSupported_isNULL); ToString("MaxNumberControlled", MaxNumberControlled, MaxNumberControlled_isNULL); ToString("ProtocolDescription", ProtocolDescription, ProtocolDescription_isNULL); ToStringInt("CommandRegister", CommandRegister, CommandRegister_isNULL); ToStringArrayInt("Capabilities", Capabilities, Capabilities_isNULL); ToStringArray("CapabilityDescriptions", CapabilityDescriptions, CapabilityDescriptions_isNULL); ToStringInt("DeviceSelectTiming", DeviceSelectTiming, DeviceSelectTiming_isNULL); ToStringInt("ClassCode", ClassCode, ClassCode_isNULL); ToStringInt("CacheLineSize", CacheLineSize, CacheLineSize_isNULL); ToStringInt("LatencyTimer", LatencyTimer, LatencyTimer_isNULL); ToStringInt("InterruptPin", InterruptPin, InterruptPin_isNULL); ToString("ExpansionROMBaseAddress", ExpansionROMBaseAddress, ExpansionROMBaseAddress_isNULL); ToString("SelfTestEnabled", SelfTestEnabled, SelfTestEnabled_isNULL); ToStringArray("BaseAddress", BaseAddress, BaseAddress_isNULL); ToStringInt("SubsystemID", SubsystemID, SubsystemID_isNULL); ToStringInt("SubsystemVendorID", SubsystemVendorID, SubsystemVendorID_isNULL); ToStringInt("MinGrantTime", MinGrantTime, MinGrantTime_isNULL); ToStringInt("MaxLatency", MaxLatency, MaxLatency_isNULL); ToStringInt("BusNumber", BusNumber, BusNumber_isNULL); ToStringInt("DeviceNumber", DeviceNumber, DeviceNumber_isNULL); ToStringInt("FunctionNumber", FunctionNumber, FunctionNumber_isNULL); ToStringInt("PCIDeviceID", PCIDeviceID, PCIDeviceID_isNULL); ToStringInt("VendorID", VendorID, VendorID_isNULL); ToStringInt("RevisionID", RevisionID, RevisionID_isNULL); ToStringInt("BridgeType", BridgeType, BridgeType_isNULL); ToStringInt("SecondaryLatencyTimer", SecondaryLatencyTimer, SecondaryLatencyTimer_isNULL); ToStringInt("SubordinateBusNumber", SubordinateBusNumber, SubordinateBusNumber_isNULL); ToStringInt("SecondayBusNumber", SecondayBusNumber, SecondayBusNumber_isNULL); ToStringInt("PrimaryBusNumber", PrimaryBusNumber, PrimaryBusNumber_isNULL); ToStringInt("SecondaryStatusRegister", SecondaryStatusRegister, SecondaryStatusRegister_isNULL); ToStringInt("SecondaryBusDeviceSelectTiming", SecondaryBusDeviceSelectTiming, SecondaryBusDeviceSelectTiming_isNULL); ToStringInt("IOLimit", IOLimit, IOLimit_isNULL); ToStringInt("IOBase", IOBase, IOBase_isNULL); ToStringInt("MemoryLimit", MemoryLimit, MemoryLimit_isNULL); ToStringInt("MemoryBase", MemoryBase, MemoryBase_isNULL); ToStringInt("PrefetchMemoryLimit", PrefetchMemoryLimit, PrefetchMemoryLimit_isNULL); ToStringInt("PrefetchMemoryBase", PrefetchMemoryBase, PrefetchMemoryBase_isNULL); ToString("PrefetchLimitUpper32", PrefetchLimitUpper32, PrefetchLimitUpper32_isNULL); ToString("PrefetchBaseUpper32", PrefetchBaseUpper32, PrefetchBaseUpper32_isNULL); ToStringInt("IOLimitUpper16", IOLimitUpper16, IOLimitUpper16_isNULL); ToStringInt("IOBaseUpper16", IOBaseUpper16, IOBaseUpper16_isNULL); os << " [\\OpenDRIM_PCIBridge]" << endl; return os; } int main() { string errorMessage; int errorCode = PCI_OpenDRIM_PCIBridge_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PCI_OpenDRIM_PCIBridge_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 = PCI_OpenDRIM_PCIBridge_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 = PCI_OpenDRIM_PCIBridge_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 = PCI_OpenDRIM_PCIBridge_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-pci-1.0.0~ppa/test/testOpenDRIM_PCIDevice.cpp0000644000175000017500000002147511400674237024105 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIDevice.h" #include "OpenDRIM_PCIDeviceAccess.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_PCIDevice& instance) { os << " [OpenDRIM_PCIDevice]" << endl; ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstallDate", InstallDate, InstallDate_isNULL); ToString("Name", Name, Name_isNULL); ToStringArrayInt("OperationalStatus", OperationalStatus, OperationalStatus_isNULL); ToStringArray("StatusDescriptions", StatusDescriptions, StatusDescriptions_isNULL); ToString("Status", Status, Status_isNULL); ToStringInt("HealthState", HealthState, HealthState_isNULL); ToStringInt("CommunicationStatus", CommunicationStatus, CommunicationStatus_isNULL); ToStringInt("DetailedStatus", DetailedStatus, DetailedStatus_isNULL); ToStringInt("OperatingStatus", OperatingStatus, OperatingStatus_isNULL); ToStringInt("PrimaryStatus", PrimaryStatus, PrimaryStatus_isNULL); ToStringInt("EnabledState", EnabledState, EnabledState_isNULL); ToString("OtherEnabledState", OtherEnabledState, OtherEnabledState_isNULL); ToStringInt("RequestedState", RequestedState, RequestedState_isNULL); ToStringInt("EnabledDefault", EnabledDefault, EnabledDefault_isNULL); ToString("TimeOfLastStateChange", TimeOfLastStateChange, TimeOfLastStateChange_isNULL); ToStringArrayInt("AvailableRequestedStates", AvailableRequestedStates, AvailableRequestedStates_isNULL); ToStringInt("TransitioningToState", TransitioningToState, TransitioningToState_isNULL); ToString("SystemCreationClassName", SystemCreationClassName, SystemCreationClassName_isNULL); ToString("SystemName", SystemName, SystemName_isNULL); ToString("CreationClassName", CreationClassName, CreationClassName_isNULL); ToString("DeviceID", DeviceID, DeviceID_isNULL); ToString("PowerManagementSupported", PowerManagementSupported, PowerManagementSupported_isNULL); ToStringArrayInt("PowerManagementCapabilities", PowerManagementCapabilities, PowerManagementCapabilities_isNULL); ToStringInt("Availability", Availability, Availability_isNULL); ToStringInt("StatusInfo", StatusInfo, StatusInfo_isNULL); ToString("LastErrorCode", LastErrorCode, LastErrorCode_isNULL); ToString("ErrorDescription", ErrorDescription, ErrorDescription_isNULL); ToString("ErrorCleared", ErrorCleared, ErrorCleared_isNULL); ToStringArray("OtherIdentifyingInfo", OtherIdentifyingInfo, OtherIdentifyingInfo_isNULL); ToString("PowerOnHours", PowerOnHours, PowerOnHours_isNULL); ToString("TotalPowerOnHours", TotalPowerOnHours, TotalPowerOnHours_isNULL); ToStringArray("IdentifyingDescriptions", IdentifyingDescriptions, IdentifyingDescriptions_isNULL); ToStringArrayInt("AdditionalAvailability", AdditionalAvailability, AdditionalAvailability_isNULL); ToString("MaxQuiesceTime", MaxQuiesceTime, MaxQuiesceTime_isNULL); ToString("TimeOfLastReset", TimeOfLastReset, TimeOfLastReset_isNULL); ToStringInt("ProtocolSupported", ProtocolSupported, ProtocolSupported_isNULL); ToString("MaxNumberControlled", MaxNumberControlled, MaxNumberControlled_isNULL); ToString("ProtocolDescription", ProtocolDescription, ProtocolDescription_isNULL); ToStringInt("CommandRegister", CommandRegister, CommandRegister_isNULL); ToStringArrayInt("Capabilities", Capabilities, Capabilities_isNULL); ToStringArray("CapabilityDescriptions", CapabilityDescriptions, CapabilityDescriptions_isNULL); ToStringInt("DeviceSelectTiming", DeviceSelectTiming, DeviceSelectTiming_isNULL); ToStringInt("ClassCode", ClassCode, ClassCode_isNULL); ToStringInt("CacheLineSize", CacheLineSize, CacheLineSize_isNULL); ToStringInt("LatencyTimer", LatencyTimer, LatencyTimer_isNULL); ToStringInt("InterruptPin", InterruptPin, InterruptPin_isNULL); ToString("ExpansionROMBaseAddress", ExpansionROMBaseAddress, ExpansionROMBaseAddress_isNULL); ToString("SelfTestEnabled", SelfTestEnabled, SelfTestEnabled_isNULL); ToStringArray("BaseAddress", BaseAddress, BaseAddress_isNULL); ToStringInt("SubsystemID", SubsystemID, SubsystemID_isNULL); ToStringInt("SubsystemVendorID", SubsystemVendorID, SubsystemVendorID_isNULL); ToStringInt("MinGrantTime", MinGrantTime, MinGrantTime_isNULL); ToStringInt("MaxLatency", MaxLatency, MaxLatency_isNULL); ToStringInt("BusNumber", BusNumber, BusNumber_isNULL); ToStringInt("DeviceNumber", DeviceNumber, DeviceNumber_isNULL); ToStringInt("FunctionNumber", FunctionNumber, FunctionNumber_isNULL); ToStringInt("PCIDeviceID", PCIDeviceID, PCIDeviceID_isNULL); ToStringInt("VendorID", VendorID, VendorID_isNULL); ToStringInt("RevisionID", RevisionID, RevisionID_isNULL); os << " [\\OpenDRIM_PCIDevice]" << endl; return os; } int main() { string errorMessage; int errorCode = PCI_OpenDRIM_PCIDevice_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PCI_OpenDRIM_PCIDevice_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 = PCI_OpenDRIM_PCIDevice_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 = PCI_OpenDRIM_PCIDevice_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 = PCI_OpenDRIM_PCIDevice_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-pci-1.0.0~ppa/test/testOpenDRIM_HostedPCICollection.cpp0000644000175000017500000001116411400674237026142 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_HostedPCICollection.h" #include "OpenDRIM_HostedPCICollectionAccess.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_HostedPCICollection& instance) { os << " [OpenDRIM_HostedPCICollection]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); os << " [\\OpenDRIM_HostedPCICollection]" << endl; return os; } int main() { string errorMessage; int errorCode = PCI_OpenDRIM_HostedPCICollection_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PCI_OpenDRIM_HostedPCICollection_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 = PCI_OpenDRIM_HostedPCICollection_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 = PCI_OpenDRIM_HostedPCICollection_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 = PCI_OpenDRIM_HostedPCICollection_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-pci-1.0.0~ppa/test/testOpenDRIM_EnabledPCICapabilities.cpp0000644000175000017500000001226111400674237026543 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_EnabledPCICapabilities.h" #include "OpenDRIM_EnabledPCICapabilitiesAccess.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_EnabledPCICapabilities& instance) { os << " [OpenDRIM_EnabledPCICapabilities]" << endl; ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("ElementNameEditSupported", ElementNameEditSupported, ElementNameEditSupported_isNULL); ToStringInt("MaxElementNameLen", MaxElementNameLen, MaxElementNameLen_isNULL); ToStringArrayInt("RequestedStatesSupported", RequestedStatesSupported, RequestedStatesSupported_isNULL); ToString("ElementNameMask", ElementNameMask, ElementNameMask_isNULL); ToStringArrayInt("StateAwareness", StateAwareness, StateAwareness_isNULL); os << " [\\OpenDRIM_EnabledPCICapabilities]" << endl; return os; } int main() { string errorMessage; int errorCode = PCI_OpenDRIM_EnabledPCICapabilities_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PCI_OpenDRIM_EnabledPCICapabilities_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 = PCI_OpenDRIM_EnabledPCICapabilities_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 = PCI_OpenDRIM_EnabledPCICapabilities_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 = PCI_OpenDRIM_EnabledPCICapabilities_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-pci-1.0.0~ppa/test/testOpenDRIM_MemberOfPCICollection.cpp0000644000175000017500000001120311400674237026402 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_MemberOfPCICollection.h" #include "OpenDRIM_MemberOfPCICollectionAccess.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_MemberOfPCICollection& instance) { os << " [OpenDRIM_MemberOfPCICollection]" << endl; ToStringRef("Collection", Collection, Collection_isNULL); ToStringRef("Member", Member, Member_isNULL); os << " [\\OpenDRIM_MemberOfPCICollection]" << endl; return os; } int main() { string errorMessage; int errorCode = PCI_OpenDRIM_MemberOfPCICollection_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PCI_OpenDRIM_MemberOfPCICollection_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 = PCI_OpenDRIM_MemberOfPCICollection_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 = PCI_OpenDRIM_MemberOfPCICollection_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 = PCI_OpenDRIM_MemberOfPCICollection_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-pci-1.0.0~ppa/test/testOpenDRIM_PCIDeviceConnection.cpp0000644000175000017500000001141611400674237026117 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIDeviceConnection.h" #include "OpenDRIM_PCIDeviceConnectionAccess.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_PCIDeviceConnection& instance) { os << " [OpenDRIM_PCIDeviceConnection]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); ToString("NegotiatedSpeed", NegotiatedSpeed, NegotiatedSpeed_isNULL); ToString("NegotiatedDataWidth", NegotiatedDataWidth, NegotiatedDataWidth_isNULL); os << " [\\OpenDRIM_PCIDeviceConnection]" << endl; return os; } int main() { string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceConnection_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PCI_OpenDRIM_PCIDeviceConnection_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 = PCI_OpenDRIM_PCIDeviceConnection_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 = PCI_OpenDRIM_PCIDeviceConnection_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 = PCI_OpenDRIM_PCIDeviceConnection_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-pci-1.0.0~ppa/test/testOpenDRIM_PCIeSwitch.cpp0000644000175000017500000002175011400674237024310 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIeSwitch.h" #include "OpenDRIM_PCIeSwitchAccess.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_PCIeSwitch& instance) { os << " [OpenDRIM_PCIeSwitch]" << endl; ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstallDate", InstallDate, InstallDate_isNULL); ToString("Name", Name, Name_isNULL); ToStringArrayInt("OperationalStatus", OperationalStatus, OperationalStatus_isNULL); ToStringArray("StatusDescriptions", StatusDescriptions, StatusDescriptions_isNULL); ToString("Status", Status, Status_isNULL); ToStringInt("HealthState", HealthState, HealthState_isNULL); ToStringInt("CommunicationStatus", CommunicationStatus, CommunicationStatus_isNULL); ToStringInt("DetailedStatus", DetailedStatus, DetailedStatus_isNULL); ToStringInt("OperatingStatus", OperatingStatus, OperatingStatus_isNULL); ToStringInt("PrimaryStatus", PrimaryStatus, PrimaryStatus_isNULL); ToStringInt("EnabledState", EnabledState, EnabledState_isNULL); ToString("OtherEnabledState", OtherEnabledState, OtherEnabledState_isNULL); ToStringInt("RequestedState", RequestedState, RequestedState_isNULL); ToStringInt("EnabledDefault", EnabledDefault, EnabledDefault_isNULL); ToString("TimeOfLastStateChange", TimeOfLastStateChange, TimeOfLastStateChange_isNULL); ToStringArrayInt("AvailableRequestedStates", AvailableRequestedStates, AvailableRequestedStates_isNULL); ToStringInt("TransitioningToState", TransitioningToState, TransitioningToState_isNULL); ToString("SystemCreationClassName", SystemCreationClassName, SystemCreationClassName_isNULL); ToString("SystemName", SystemName, SystemName_isNULL); ToString("CreationClassName", CreationClassName, CreationClassName_isNULL); ToString("DeviceID", DeviceID, DeviceID_isNULL); ToString("PowerManagementSupported", PowerManagementSupported, PowerManagementSupported_isNULL); ToStringArrayInt("PowerManagementCapabilities", PowerManagementCapabilities, PowerManagementCapabilities_isNULL); ToStringInt("Availability", Availability, Availability_isNULL); ToStringInt("StatusInfo", StatusInfo, StatusInfo_isNULL); ToString("LastErrorCode", LastErrorCode, LastErrorCode_isNULL); ToString("ErrorDescription", ErrorDescription, ErrorDescription_isNULL); ToString("ErrorCleared", ErrorCleared, ErrorCleared_isNULL); ToStringArray("OtherIdentifyingInfo", OtherIdentifyingInfo, OtherIdentifyingInfo_isNULL); ToString("PowerOnHours", PowerOnHours, PowerOnHours_isNULL); ToString("TotalPowerOnHours", TotalPowerOnHours, TotalPowerOnHours_isNULL); ToStringArray("IdentifyingDescriptions", IdentifyingDescriptions, IdentifyingDescriptions_isNULL); ToStringArrayInt("AdditionalAvailability", AdditionalAvailability, AdditionalAvailability_isNULL); ToString("MaxQuiesceTime", MaxQuiesceTime, MaxQuiesceTime_isNULL); ToString("TimeOfLastReset", TimeOfLastReset, TimeOfLastReset_isNULL); ToStringInt("ProtocolSupported", ProtocolSupported, ProtocolSupported_isNULL); ToString("MaxNumberControlled", MaxNumberControlled, MaxNumberControlled_isNULL); ToString("ProtocolDescription", ProtocolDescription, ProtocolDescription_isNULL); ToStringInt("CommandRegister", CommandRegister, CommandRegister_isNULL); ToStringArrayInt("Capabilities", Capabilities, Capabilities_isNULL); ToStringArray("CapabilityDescriptions", CapabilityDescriptions, CapabilityDescriptions_isNULL); ToStringInt("DeviceSelectTiming", DeviceSelectTiming, DeviceSelectTiming_isNULL); ToStringInt("ClassCode", ClassCode, ClassCode_isNULL); ToStringInt("CacheLineSize", CacheLineSize, CacheLineSize_isNULL); ToStringInt("LatencyTimer", LatencyTimer, LatencyTimer_isNULL); ToStringInt("InterruptPin", InterruptPin, InterruptPin_isNULL); ToString("ExpansionROMBaseAddress", ExpansionROMBaseAddress, ExpansionROMBaseAddress_isNULL); ToString("SelfTestEnabled", SelfTestEnabled, SelfTestEnabled_isNULL); ToStringArray("BaseAddress", BaseAddress, BaseAddress_isNULL); ToStringInt("SubsystemID", SubsystemID, SubsystemID_isNULL); ToStringInt("SubsystemVendorID", SubsystemVendorID, SubsystemVendorID_isNULL); ToStringInt("MinGrantTime", MinGrantTime, MinGrantTime_isNULL); ToStringInt("MaxLatency", MaxLatency, MaxLatency_isNULL); ToStringInt("BusNumber", BusNumber, BusNumber_isNULL); ToStringInt("DeviceNumber", DeviceNumber, DeviceNumber_isNULL); ToStringInt("FunctionNumber", FunctionNumber, FunctionNumber_isNULL); ToStringInt("PCIDeviceID", PCIDeviceID, PCIDeviceID_isNULL); ToStringInt("VendorID", VendorID, VendorID_isNULL); ToStringInt("RevisionID", RevisionID, RevisionID_isNULL); ToStringInt("NumberOfPorts", NumberOfPorts, NumberOfPorts_isNULL); ToStringArrayInt("SecondaryBusNumbers", SecondaryBusNumbers, SecondaryBusNumbers_isNULL); os << " [\\OpenDRIM_PCIeSwitch]" << endl; return os; } int main() { string errorMessage; int errorCode = PCI_OpenDRIM_PCIeSwitch_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PCI_OpenDRIM_PCIeSwitch_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 = PCI_OpenDRIM_PCIeSwitch_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 = PCI_OpenDRIM_PCIeSwitch_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 = PCI_OpenDRIM_PCIeSwitch_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-pci-1.0.0~ppa/acinclude.m40000644000175000017500000002105611400674237020516 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### AC_DEFUN([SHOW_COPYRIGHT], [ echo "################################################################################# # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nodir Nazarov # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public 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-pci-1.0.0~ppa/OpenDRIM_PCIPort/0000755000175000017500000000000011400674237021236 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIPort/Makefile.am0000644000175000017500000000367011400674237023300 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPCI_OpenDRIM_PCIPortProvider.la libcmpiPCI_OpenDRIM_PCIPortProvider_la_SOURCES = OpenDRIM_PCIPortAccess.cpp OpenDRIM_PCIPortProvider.cpp cmpiOpenDRIM_PCIPort.cpp libcmpiPCI_OpenDRIM_PCIPortProvider_la_LIBADD = ../Common/libcmpiPCI_Common.la libcmpiPCI_OpenDRIM_PCIPortProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_PCIPort.h OpenDRIM_PCIPort.h OpenDRIM_PCIPortAccess.h opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIPort/OpenDRIM_PCIPort.h0000644000175000017500000005416011400674237024332 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PCIPORT_H_ #define OPENDRIM_PCIPORT_H_ #include const static char* OpenDRIM_PCIPort_classnames[] = {"OpenDRIM_PCIPort"}; static string OpenDRIM_PCIPort_NAMESPACE = _NAMESPACE; class OpenDRIM_PCIPort { public: string InstanceID; bool InstanceID_isNULL; string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string InstallDate; bool InstallDate_isNULL; string Name; bool Name_isNULL; vector OperationalStatus; bool OperationalStatus_isNULL; vector StatusDescriptions; bool StatusDescriptions_isNULL; string Status; bool Status_isNULL; unsigned short HealthState; bool HealthState_isNULL; unsigned short CommunicationStatus; bool CommunicationStatus_isNULL; unsigned short DetailedStatus; bool DetailedStatus_isNULL; unsigned short OperatingStatus; bool OperatingStatus_isNULL; unsigned short PrimaryStatus; bool PrimaryStatus_isNULL; unsigned short EnabledState; bool EnabledState_isNULL; string OtherEnabledState; bool OtherEnabledState_isNULL; unsigned short RequestedState; bool RequestedState_isNULL; unsigned short EnabledDefault; bool EnabledDefault_isNULL; string TimeOfLastStateChange; bool TimeOfLastStateChange_isNULL; vector AvailableRequestedStates; bool AvailableRequestedStates_isNULL; unsigned short TransitioningToState; bool TransitioningToState_isNULL; string SystemCreationClassName; bool SystemCreationClassName_isNULL; string SystemName; bool SystemName_isNULL; string CreationClassName; bool CreationClassName_isNULL; string DeviceID; bool DeviceID_isNULL; bool PowerManagementSupported; bool PowerManagementSupported_isNULL; vector PowerManagementCapabilities; bool PowerManagementCapabilities_isNULL; unsigned short Availability; bool Availability_isNULL; unsigned short StatusInfo; bool StatusInfo_isNULL; unsigned int LastErrorCode; bool LastErrorCode_isNULL; string ErrorDescription; bool ErrorDescription_isNULL; bool ErrorCleared; bool ErrorCleared_isNULL; vector OtherIdentifyingInfo; bool OtherIdentifyingInfo_isNULL; unsigned long long PowerOnHours; bool PowerOnHours_isNULL; unsigned long long TotalPowerOnHours; bool TotalPowerOnHours_isNULL; vector IdentifyingDescriptions; bool IdentifyingDescriptions_isNULL; vector AdditionalAvailability; bool AdditionalAvailability_isNULL; unsigned long long MaxQuiesceTime; bool MaxQuiesceTime_isNULL; unsigned long long Speed; bool Speed_isNULL; unsigned long long MaxSpeed; bool MaxSpeed_isNULL; unsigned long long RequestedSpeed; bool RequestedSpeed_isNULL; unsigned short UsageRestriction; bool UsageRestriction_isNULL; string OtherPortType; bool OtherPortType_isNULL; unsigned short PortType; bool PortType_isNULL; OpenDRIM_PCIPort() { InstanceID_isNULL = true; Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstallDate_isNULL = true; Name_isNULL = true; OperationalStatus_isNULL = true; StatusDescriptions_isNULL = true; Status_isNULL = true; HealthState_isNULL = true; CommunicationStatus_isNULL = true; DetailedStatus_isNULL = true; OperatingStatus_isNULL = true; PrimaryStatus_isNULL = true; EnabledState_isNULL = true; OtherEnabledState_isNULL = true; RequestedState_isNULL = true; EnabledDefault_isNULL = true; TimeOfLastStateChange_isNULL = true; AvailableRequestedStates_isNULL = true; TransitioningToState_isNULL = true; SystemCreationClassName_isNULL = true; SystemName_isNULL = true; CreationClassName_isNULL = true; DeviceID_isNULL = true; PowerManagementSupported_isNULL = true; PowerManagementCapabilities_isNULL = true; Availability_isNULL = true; StatusInfo_isNULL = true; LastErrorCode_isNULL = true; ErrorDescription_isNULL = true; ErrorCleared_isNULL = true; OtherIdentifyingInfo_isNULL = true; PowerOnHours_isNULL = true; TotalPowerOnHours_isNULL = true; IdentifyingDescriptions_isNULL = true; AdditionalAvailability_isNULL = true; MaxQuiesceTime_isNULL = true; Speed_isNULL = true; MaxSpeed_isNULL = true; RequestedSpeed_isNULL = true; UsageRestriction_isNULL = true; OtherPortType_isNULL = true; PortType_isNULL = true; } ~OpenDRIM_PCIPort() {} string getKeys() const { return CF_toLowCase(".SystemCreationClassName=\"" + CF_quoteString(SystemCreationClassName) + "\""".SystemName=\"" + CF_quoteString(SystemName) + "\""".CreationClassName=\"" + CF_quoteString(CreationClassName) + "\""".DeviceID=\"" + CF_quoteString(DeviceID) + "\""); } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getInstallDate(string& value) const { if (InstallDate_isNULL==true) return NOT_FOUND; value = InstallDate; return OK; } int setInstallDate(const string& newValue) { InstallDate = newValue; InstallDate_isNULL = false; return OK; } int getName(string& value) const { if (Name_isNULL==true) return NOT_FOUND; value = Name; return OK; } int setName(const string& newValue) { Name = newValue; Name_isNULL = false; return OK; } int getOperationalStatus(vector& value) const { if (OperationalStatus_isNULL==true) return NOT_FOUND; value = OperationalStatus; return OK; } int setOperationalStatus(const vector& newValue) { OperationalStatus = newValue; OperationalStatus_isNULL = false; return OK; } int getStatusDescriptions(vector& value) const { if (StatusDescriptions_isNULL==true) return NOT_FOUND; value = StatusDescriptions; return OK; } int setStatusDescriptions(const vector& newValue) { StatusDescriptions = newValue; StatusDescriptions_isNULL = false; return OK; } int getStatus(string& value) const { if (Status_isNULL==true) return NOT_FOUND; value = Status; return OK; } int setStatus(const string& newValue) { Status = newValue; Status_isNULL = false; return OK; } int getHealthState(unsigned short& value) const { if (HealthState_isNULL==true) return NOT_FOUND; value = HealthState; return OK; } int setHealthState(const unsigned short& newValue) { HealthState = newValue; HealthState_isNULL = false; return OK; } int getCommunicationStatus(unsigned short& value) const { if (CommunicationStatus_isNULL==true) return NOT_FOUND; value = CommunicationStatus; return OK; } int setCommunicationStatus(const unsigned short& newValue) { CommunicationStatus = newValue; CommunicationStatus_isNULL = false; return OK; } int getDetailedStatus(unsigned short& value) const { if (DetailedStatus_isNULL==true) return NOT_FOUND; value = DetailedStatus; return OK; } int setDetailedStatus(const unsigned short& newValue) { DetailedStatus = newValue; DetailedStatus_isNULL = false; return OK; } int getOperatingStatus(unsigned short& value) const { if (OperatingStatus_isNULL==true) return NOT_FOUND; value = OperatingStatus; return OK; } int setOperatingStatus(const unsigned short& newValue) { OperatingStatus = newValue; OperatingStatus_isNULL = false; return OK; } int getPrimaryStatus(unsigned short& value) const { if (PrimaryStatus_isNULL==true) return NOT_FOUND; value = PrimaryStatus; return OK; } int setPrimaryStatus(const unsigned short& newValue) { PrimaryStatus = newValue; PrimaryStatus_isNULL = false; return OK; } int getEnabledState(unsigned short& value) const { if (EnabledState_isNULL==true) return NOT_FOUND; value = EnabledState; return OK; } int setEnabledState(const unsigned short& newValue) { EnabledState = newValue; EnabledState_isNULL = false; return OK; } int getOtherEnabledState(string& value) const { if (OtherEnabledState_isNULL==true) return NOT_FOUND; value = OtherEnabledState; return OK; } int setOtherEnabledState(const string& newValue) { OtherEnabledState = newValue; OtherEnabledState_isNULL = false; return OK; } int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL==true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getEnabledDefault(unsigned short& value) const { if (EnabledDefault_isNULL==true) return NOT_FOUND; value = EnabledDefault; return OK; } int setEnabledDefault(const unsigned short& newValue) { EnabledDefault = newValue; EnabledDefault_isNULL = false; return OK; } int getTimeOfLastStateChange(string& value) const { if (TimeOfLastStateChange_isNULL==true) return NOT_FOUND; value = TimeOfLastStateChange; return OK; } int setTimeOfLastStateChange(const string& newValue) { TimeOfLastStateChange = newValue; TimeOfLastStateChange_isNULL = false; return OK; } int getAvailableRequestedStates(vector& value) const { if (AvailableRequestedStates_isNULL==true) return NOT_FOUND; value = AvailableRequestedStates; return OK; } int setAvailableRequestedStates(const vector& newValue) { AvailableRequestedStates = newValue; AvailableRequestedStates_isNULL = false; return OK; } int getTransitioningToState(unsigned short& value) const { if (TransitioningToState_isNULL==true) return NOT_FOUND; value = TransitioningToState; return OK; } int setTransitioningToState(const unsigned short& newValue) { TransitioningToState = newValue; TransitioningToState_isNULL = false; return OK; } int getSystemCreationClassName(string& value) const { if (SystemCreationClassName_isNULL==true) return NOT_FOUND; value = SystemCreationClassName; return OK; } int setSystemCreationClassName(const string& newValue) { SystemCreationClassName = newValue; SystemCreationClassName_isNULL = false; return OK; } int getSystemName(string& value) const { if (SystemName_isNULL==true) return NOT_FOUND; value = SystemName; return OK; } int setSystemName(const string& newValue) { SystemName = newValue; SystemName_isNULL = false; return OK; } int getCreationClassName(string& value) const { if (CreationClassName_isNULL==true) return NOT_FOUND; value = CreationClassName; return OK; } int setCreationClassName(const string& newValue) { CreationClassName = newValue; CreationClassName_isNULL = false; return OK; } int getDeviceID(string& value) const { if (DeviceID_isNULL==true) return NOT_FOUND; value = DeviceID; return OK; } int setDeviceID(const string& newValue) { DeviceID = newValue; DeviceID_isNULL = false; return OK; } int getPowerManagementSupported(bool& value) const { if (PowerManagementSupported_isNULL==true) return NOT_FOUND; value = PowerManagementSupported; return OK; } int setPowerManagementSupported(const bool& newValue) { PowerManagementSupported = newValue; PowerManagementSupported_isNULL = false; return OK; } int getPowerManagementCapabilities(vector& value) const { if (PowerManagementCapabilities_isNULL==true) return NOT_FOUND; value = PowerManagementCapabilities; return OK; } int setPowerManagementCapabilities(const vector& newValue) { PowerManagementCapabilities = newValue; PowerManagementCapabilities_isNULL = false; return OK; } int getAvailability(unsigned short& value) const { if (Availability_isNULL==true) return NOT_FOUND; value = Availability; return OK; } int setAvailability(const unsigned short& newValue) { Availability = newValue; Availability_isNULL = false; return OK; } int getStatusInfo(unsigned short& value) const { if (StatusInfo_isNULL==true) return NOT_FOUND; value = StatusInfo; return OK; } int setStatusInfo(const unsigned short& newValue) { StatusInfo = newValue; StatusInfo_isNULL = false; return OK; } int getLastErrorCode(unsigned int& value) const { if (LastErrorCode_isNULL==true) return NOT_FOUND; value = LastErrorCode; return OK; } int setLastErrorCode(const unsigned int& newValue) { LastErrorCode = newValue; LastErrorCode_isNULL = false; return OK; } int getErrorDescription(string& value) const { if (ErrorDescription_isNULL==true) return NOT_FOUND; value = ErrorDescription; return OK; } int setErrorDescription(const string& newValue) { ErrorDescription = newValue; ErrorDescription_isNULL = false; return OK; } int getErrorCleared(bool& value) const { if (ErrorCleared_isNULL==true) return NOT_FOUND; value = ErrorCleared; return OK; } int setErrorCleared(const bool& newValue) { ErrorCleared = newValue; ErrorCleared_isNULL = false; return OK; } int getOtherIdentifyingInfo(vector& value) const { if (OtherIdentifyingInfo_isNULL==true) return NOT_FOUND; value = OtherIdentifyingInfo; return OK; } int setOtherIdentifyingInfo(const vector& newValue) { OtherIdentifyingInfo = newValue; OtherIdentifyingInfo_isNULL = false; return OK; } int getPowerOnHours(unsigned long long& value) const { if (PowerOnHours_isNULL==true) return NOT_FOUND; value = PowerOnHours; return OK; } int setPowerOnHours(const unsigned long long& newValue) { PowerOnHours = newValue; PowerOnHours_isNULL = false; return OK; } int getTotalPowerOnHours(unsigned long long& value) const { if (TotalPowerOnHours_isNULL==true) return NOT_FOUND; value = TotalPowerOnHours; return OK; } int setTotalPowerOnHours(const unsigned long long& newValue) { TotalPowerOnHours = newValue; TotalPowerOnHours_isNULL = false; return OK; } int getIdentifyingDescriptions(vector& value) const { if (IdentifyingDescriptions_isNULL==true) return NOT_FOUND; value = IdentifyingDescriptions; return OK; } int setIdentifyingDescriptions(const vector& newValue) { IdentifyingDescriptions = newValue; IdentifyingDescriptions_isNULL = false; return OK; } int getAdditionalAvailability(vector& value) const { if (AdditionalAvailability_isNULL==true) return NOT_FOUND; value = AdditionalAvailability; return OK; } int setAdditionalAvailability(const vector& newValue) { AdditionalAvailability = newValue; AdditionalAvailability_isNULL = false; return OK; } int getMaxQuiesceTime(unsigned long long& value) const { if (MaxQuiesceTime_isNULL==true) return NOT_FOUND; value = MaxQuiesceTime; return OK; } int setMaxQuiesceTime(const unsigned long long& newValue) { MaxQuiesceTime = newValue; MaxQuiesceTime_isNULL = false; return OK; } int getSpeed(unsigned long long& value) const { if (Speed_isNULL==true) return NOT_FOUND; value = Speed; return OK; } int setSpeed(const unsigned long long& newValue) { Speed = newValue; Speed_isNULL = false; return OK; } int getMaxSpeed(unsigned long long& value) const { if (MaxSpeed_isNULL==true) return NOT_FOUND; value = MaxSpeed; return OK; } int setMaxSpeed(const unsigned long long& newValue) { MaxSpeed = newValue; MaxSpeed_isNULL = false; return OK; } int getRequestedSpeed(unsigned long long& value) const { if (RequestedSpeed_isNULL==true) return NOT_FOUND; value = RequestedSpeed; return OK; } int setRequestedSpeed(const unsigned long long& newValue) { RequestedSpeed = newValue; RequestedSpeed_isNULL = false; return OK; } int getUsageRestriction(unsigned short& value) const { if (UsageRestriction_isNULL==true) return NOT_FOUND; value = UsageRestriction; return OK; } int setUsageRestriction(const unsigned short& newValue) { UsageRestriction = newValue; UsageRestriction_isNULL = false; return OK; } int getOtherPortType(string& value) const { if (OtherPortType_isNULL==true) return NOT_FOUND; value = OtherPortType; return OK; } int setOtherPortType(const string& newValue) { OtherPortType = newValue; OtherPortType_isNULL = false; return OK; } int getPortType(unsigned short& value) const { if (PortType_isNULL==true) return NOT_FOUND; value = PortType; return OK; } int setPortType(const unsigned short& newValue) { PortType = newValue; PortType_isNULL = false; return OK; } }; class OpenDRIM_PCIPort_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_PCIPort_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_PCIPort_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_PCIPort_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_PCIPort_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_PCIPort_RequestStateChange_Out() {} int getJob(Objectpath& value) const { if (Job_isNULL == true) return NOT_FOUND; value = Job; return OK; } int setJob(const Objectpath& newValue) { Job = newValue; Job_isNULL = false; return OK; } }; class OpenDRIM_PCIPort_SetPowerState_In { public: unsigned short PowerState; bool PowerState_isNULL; string Time; bool Time_isNULL; OpenDRIM_PCIPort_SetPowerState_In() { PowerState_isNULL = true; Time_isNULL = true; } ~OpenDRIM_PCIPort_SetPowerState_In() {} int getPowerState(unsigned short& value) const { if (PowerState_isNULL == true) return NOT_FOUND; value = PowerState; return OK; } int setPowerState(const unsigned short& newValue) { PowerState = newValue; PowerState_isNULL = false; return OK; } int getTime(string& value) const { if (Time_isNULL == true) return NOT_FOUND; value = Time; return OK; } int setTime(const string& newValue) { Time = newValue; Time_isNULL = false; return OK; } }; class OpenDRIM_PCIPort_EnableDevice_In { public: bool Enabled; bool Enabled_isNULL; OpenDRIM_PCIPort_EnableDevice_In() { Enabled_isNULL = true; } ~OpenDRIM_PCIPort_EnableDevice_In() {} int getEnabled(bool& value) const { if (Enabled_isNULL == true) return NOT_FOUND; value = Enabled; return OK; } int setEnabled(const bool& newValue) { Enabled = newValue; Enabled_isNULL = false; return OK; } }; class OpenDRIM_PCIPort_OnlineDevice_In { public: bool Online; bool Online_isNULL; OpenDRIM_PCIPort_OnlineDevice_In() { Online_isNULL = true; } ~OpenDRIM_PCIPort_OnlineDevice_In() {} int getOnline(bool& value) const { if (Online_isNULL == true) return NOT_FOUND; value = Online; return OK; } int setOnline(const bool& newValue) { Online = newValue; Online_isNULL = false; return OK; } }; class OpenDRIM_PCIPort_QuiesceDevice_In { public: bool Quiesce; bool Quiesce_isNULL; OpenDRIM_PCIPort_QuiesceDevice_In() { Quiesce_isNULL = true; } ~OpenDRIM_PCIPort_QuiesceDevice_In() {} int getQuiesce(bool& value) const { if (Quiesce_isNULL == true) return NOT_FOUND; value = Quiesce; return OK; } int setQuiesce(const bool& newValue) { Quiesce = newValue; Quiesce_isNULL = false; return OK; } }; #endif /*OPENDRIM_PCIPORT_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIPort/cmpiOpenDRIM_PCIPort.h0000644000175000017500000000544711400674237025207 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_PCIPORT_H_ #define CMPIOPENDRIM_PCIPORT_H_ #include "OpenDRIM_PCIPort.h" CMPIObjectPath* PCI_OpenDRIM_PCIPort_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PCIPort& instance); CMPIInstance* PCI_OpenDRIM_PCIPort_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PCIPort& instance); void PCI_OpenDRIM_PCIPort_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PCIPort& instance); void PCI_OpenDRIM_PCIPort_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PCIPort& instance); void PCI_OpenDRIM_PCIPort_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIPort_RequestStateChange_In& args); void PCI_OpenDRIM_PCIPort_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_PCIPort_RequestStateChange_Out& args); void PCI_OpenDRIM_PCIPort_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIPort_SetPowerState_In& args); void PCI_OpenDRIM_PCIPort_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIPort_EnableDevice_In& args); void PCI_OpenDRIM_PCIPort_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIPort_OnlineDevice_In& args); void PCI_OpenDRIM_PCIPort_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIPort_QuiesceDevice_In& args); #endif /*CMPIOPENDRIM_PCIPORT_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIPort/OpenDRIM_PCIPortAccess.cpp0000644000175000017500000001163311400674237026005 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_PCIPortAccess.h" int PCI_OpenDRIM_PCIPort_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int PCI_OpenDRIM_PCIPort_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int PCI_OpenDRIM_PCIPort_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIPort_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PCIPort& instance, const char** properties, string& errorMessage) { _E_; _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIPort_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& newInstance, const OpenDRIM_PCIPort& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIPort_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIPort_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIPort_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& instance, unsigned int& returnValue, const OpenDRIM_PCIPort_RequestStateChange_In& in, OpenDRIM_PCIPort_RequestStateChange_Out& out, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIPort_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& instance, unsigned int& returnValue, const OpenDRIM_PCIPort_SetPowerState_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIPort_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIPort_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& instance, unsigned int& returnValue, const OpenDRIM_PCIPort_EnableDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIPort_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& instance, unsigned int& returnValue, const OpenDRIM_PCIPort_OnlineDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIPort_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& instance, unsigned int& returnValue, const OpenDRIM_PCIPort_QuiesceDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIPort_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIPort_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIPort_populate(OpenDRIM_PCIPort& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIPort/cmpiOpenDRIM_PCIPort.cpp0000644000175000017500000003474511400674237025545 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIPort.h" CMPIObjectPath* PCI_OpenDRIM_PCIPort_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PCIPort& instance) { _E_; Objectpath op(broker, OpenDRIM_PCIPort_classnames[0], OpenDRIM_PCIPort_NAMESPACE); if (!instance.SystemCreationClassName_isNULL) op.addKey("SystemCreationClassName", instance.SystemCreationClassName); if (!instance.SystemName_isNULL) op.addKey("SystemName", instance.SystemName); if (!instance.CreationClassName_isNULL) op.addKey("CreationClassName", instance.CreationClassName); if (!instance.DeviceID_isNULL) op.addKey("DeviceID", instance.DeviceID); _L_; return op.getHdl(); } CMPIInstance* PCI_OpenDRIM_PCIPort_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PCIPort& instance) { _E_; Objectpath op(broker, PCI_OpenDRIM_PCIPort_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.InstanceID_isNULL) ci.setProperty("InstanceID", instance.InstanceID); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.InstallDate_isNULL) ci.setPropertyDatetime("InstallDate", instance.InstallDate); if (!instance.Name_isNULL) ci.setProperty("Name", instance.Name); if (!instance.OperationalStatus_isNULL) ci.setProperty("OperationalStatus", instance.OperationalStatus); if (!instance.StatusDescriptions_isNULL) ci.setProperty("StatusDescriptions", instance.StatusDescriptions); if (!instance.Status_isNULL) ci.setProperty("Status", instance.Status); if (!instance.HealthState_isNULL) ci.setProperty("HealthState", instance.HealthState); if (!instance.CommunicationStatus_isNULL) ci.setProperty("CommunicationStatus", instance.CommunicationStatus); if (!instance.DetailedStatus_isNULL) ci.setProperty("DetailedStatus", instance.DetailedStatus); if (!instance.OperatingStatus_isNULL) ci.setProperty("OperatingStatus", instance.OperatingStatus); if (!instance.PrimaryStatus_isNULL) ci.setProperty("PrimaryStatus", instance.PrimaryStatus); if (!instance.EnabledState_isNULL) ci.setProperty("EnabledState", instance.EnabledState); if (!instance.OtherEnabledState_isNULL) ci.setProperty("OtherEnabledState", instance.OtherEnabledState); if (!instance.RequestedState_isNULL) ci.setProperty("RequestedState", instance.RequestedState); if (!instance.EnabledDefault_isNULL) ci.setProperty("EnabledDefault", instance.EnabledDefault); if (!instance.TimeOfLastStateChange_isNULL) ci.setPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange); if (!instance.AvailableRequestedStates_isNULL) ci.setProperty("AvailableRequestedStates", instance.AvailableRequestedStates); if (!instance.TransitioningToState_isNULL) ci.setProperty("TransitioningToState", instance.TransitioningToState); if (!instance.PowerManagementSupported_isNULL) ci.setProperty("PowerManagementSupported", instance.PowerManagementSupported); if (!instance.PowerManagementCapabilities_isNULL) ci.setProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities); if (!instance.Availability_isNULL) ci.setProperty("Availability", instance.Availability); if (!instance.StatusInfo_isNULL) ci.setProperty("StatusInfo", instance.StatusInfo); if (!instance.LastErrorCode_isNULL) ci.setProperty("LastErrorCode", instance.LastErrorCode); if (!instance.ErrorDescription_isNULL) ci.setProperty("ErrorDescription", instance.ErrorDescription); if (!instance.ErrorCleared_isNULL) ci.setProperty("ErrorCleared", instance.ErrorCleared); if (!instance.OtherIdentifyingInfo_isNULL) ci.setProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo); if (!instance.PowerOnHours_isNULL) ci.setProperty("PowerOnHours", instance.PowerOnHours); if (!instance.TotalPowerOnHours_isNULL) ci.setProperty("TotalPowerOnHours", instance.TotalPowerOnHours); if (!instance.IdentifyingDescriptions_isNULL) ci.setProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions); if (!instance.AdditionalAvailability_isNULL) ci.setProperty("AdditionalAvailability", instance.AdditionalAvailability); if (!instance.MaxQuiesceTime_isNULL) ci.setProperty("MaxQuiesceTime", instance.MaxQuiesceTime); if (!instance.Speed_isNULL) ci.setProperty("Speed", instance.Speed); if (!instance.MaxSpeed_isNULL) ci.setProperty("MaxSpeed", instance.MaxSpeed); if (!instance.RequestedSpeed_isNULL) ci.setProperty("RequestedSpeed", instance.RequestedSpeed); if (!instance.UsageRestriction_isNULL) ci.setProperty("UsageRestriction", instance.UsageRestriction); if (!instance.OtherPortType_isNULL) ci.setProperty("OtherPortType", instance.OtherPortType); if (!instance.PortType_isNULL) ci.setProperty("PortType", instance.PortType); _L_; return ci.getHdl(); } void PCI_OpenDRIM_PCIPort_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PCIPort& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (op.getKey("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (op.getKey("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (op.getKey("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; _L_; } void PCI_OpenDRIM_PCIPort_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PCIPort& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getPropertyDatetime("InstallDate", instance.InstallDate) == OK) instance.InstallDate_isNULL = false; if (inst.getProperty("Name", instance.Name) == OK) instance.Name_isNULL = false; if (inst.getProperty("OperationalStatus", instance.OperationalStatus) == OK) instance.OperationalStatus_isNULL = false; if (inst.getProperty("StatusDescriptions", instance.StatusDescriptions) == OK) instance.StatusDescriptions_isNULL = false; if (inst.getProperty("Status", instance.Status) == OK) instance.Status_isNULL = false; if (inst.getProperty("HealthState", instance.HealthState) == OK) instance.HealthState_isNULL = false; if (inst.getProperty("CommunicationStatus", instance.CommunicationStatus) == OK) instance.CommunicationStatus_isNULL = false; if (inst.getProperty("DetailedStatus", instance.DetailedStatus) == OK) instance.DetailedStatus_isNULL = false; if (inst.getProperty("OperatingStatus", instance.OperatingStatus) == OK) instance.OperatingStatus_isNULL = false; if (inst.getProperty("PrimaryStatus", instance.PrimaryStatus) == OK) instance.PrimaryStatus_isNULL = false; if (inst.getProperty("EnabledState", instance.EnabledState) == OK) instance.EnabledState_isNULL = false; if (inst.getProperty("OtherEnabledState", instance.OtherEnabledState) == OK) instance.OtherEnabledState_isNULL = false; if (inst.getProperty("RequestedState", instance.RequestedState) == OK) instance.RequestedState_isNULL = false; if (inst.getProperty("EnabledDefault", instance.EnabledDefault) == OK) instance.EnabledDefault_isNULL = false; if (inst.getPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange) == OK) instance.TimeOfLastStateChange_isNULL = false; if (inst.getProperty("AvailableRequestedStates", instance.AvailableRequestedStates) == OK) instance.AvailableRequestedStates_isNULL = false; if (inst.getProperty("TransitioningToState", instance.TransitioningToState) == OK) instance.TransitioningToState_isNULL = false; if (inst.getProperty("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (inst.getProperty("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (inst.getProperty("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; if (inst.getProperty("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (inst.getProperty("PowerManagementSupported", instance.PowerManagementSupported) == OK) instance.PowerManagementSupported_isNULL = false; if (inst.getProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities) == OK) instance.PowerManagementCapabilities_isNULL = false; if (inst.getProperty("Availability", instance.Availability) == OK) instance.Availability_isNULL = false; if (inst.getProperty("StatusInfo", instance.StatusInfo) == OK) instance.StatusInfo_isNULL = false; if (inst.getProperty("LastErrorCode", instance.LastErrorCode) == OK) instance.LastErrorCode_isNULL = false; if (inst.getProperty("ErrorDescription", instance.ErrorDescription) == OK) instance.ErrorDescription_isNULL = false; if (inst.getProperty("ErrorCleared", instance.ErrorCleared) == OK) instance.ErrorCleared_isNULL = false; if (inst.getProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo) == OK) instance.OtherIdentifyingInfo_isNULL = false; if (inst.getProperty("PowerOnHours", instance.PowerOnHours) == OK) instance.PowerOnHours_isNULL = false; if (inst.getProperty("TotalPowerOnHours", instance.TotalPowerOnHours) == OK) instance.TotalPowerOnHours_isNULL = false; if (inst.getProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions) == OK) instance.IdentifyingDescriptions_isNULL = false; if (inst.getProperty("AdditionalAvailability", instance.AdditionalAvailability) == OK) instance.AdditionalAvailability_isNULL = false; if (inst.getProperty("MaxQuiesceTime", instance.MaxQuiesceTime) == OK) instance.MaxQuiesceTime_isNULL = false; if (inst.getProperty("Speed", instance.Speed) == OK) instance.Speed_isNULL = false; if (inst.getProperty("MaxSpeed", instance.MaxSpeed) == OK) instance.MaxSpeed_isNULL = false; if (inst.getProperty("RequestedSpeed", instance.RequestedSpeed) == OK) instance.RequestedSpeed_isNULL = false; if (inst.getProperty("UsageRestriction", instance.UsageRestriction) == OK) instance.UsageRestriction_isNULL = false; if (inst.getProperty("OtherPortType", instance.OtherPortType) == OK) instance.OtherPortType_isNULL = false; if (inst.getProperty("PortType", instance.PortType) == OK) instance.PortType_isNULL = false; _L_; } void PCI_OpenDRIM_PCIPort_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIPort_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 PCI_OpenDRIM_PCIPort_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_PCIPort_RequestStateChange_Out& args) { _E_; CMPIValue value; int errorMessage; Objectpath Job; errorMessage = args.getJob(Job); if (errorMessage == OK) { value = CT_toCMPI(Job); out->ft->addArg(out, "Job", &value, CMPI_ref); } _L_; } void PCI_OpenDRIM_PCIPort_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIPort_SetPowerState_In& args) { _E_; CMPIStatus rc; CMPIData data; unsigned short PowerState; data = in->ft->getArg(in, "PowerState", &rc); if (rc.rc == OK) { CT_ToC(data, PowerState); args.setPowerState(PowerState); } string Time; data = in->ft->getArg(in, "Time", &rc); if (rc.rc == OK) { CT_ToCDatetime(data, Time); args.setTime(Time); } _L_; } void PCI_OpenDRIM_PCIPort_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIPort_EnableDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Enabled; data = in->ft->getArg(in, "Enabled", &rc); if (rc.rc == OK) { CT_ToC(data, Enabled); args.setEnabled(Enabled); } _L_; } void PCI_OpenDRIM_PCIPort_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIPort_OnlineDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Online; data = in->ft->getArg(in, "Online", &rc); if (rc.rc == OK) { CT_ToC(data, Online); args.setOnline(Online); } _L_; } void PCI_OpenDRIM_PCIPort_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIPort_QuiesceDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Quiesce; data = in->ft->getArg(in, "Quiesce", &rc); if (rc.rc == OK) { CT_ToC(data, Quiesce); args.setQuiesce(Quiesce); } _L_; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIPort/OpenDRIM_PCIPortProvider.cpp0000644000175000017500000004052711400674237026402 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIPort.h" #include "OpenDRIM_PCIPortAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PCI_OpenDRIM_PCIPortProviderSetInstance PCI_OpenDRIM_PCIPortProviderModifyInstance #endif int PCI_OpenDRIM_PCIPort_init(const CMPIBroker* broker); int PCI_OpenDRIM_PCIPort_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PCI_OpenDRIM_PCIPortProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_PCIPort_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIPortProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PCI_OpenDRIM_PCIPort_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_PCIPort_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIPortProviderEnumInstances(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 = PCI_OpenDRIM_PCIPort_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PCI_OpenDRIM_PCIPort_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIPortProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIPort instance; PCI_OpenDRIM_PCIPort_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIPort_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PCI_OpenDRIM_PCIPort_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIPortProviderSetInstance(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_PCIPort newInstance, oldInstance; PCI_OpenDRIM_PCIPort_toCPP(_broker, ci, newInstance); PCI_OpenDRIM_PCIPort_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIPort_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIPort_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIPortProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIPort instance; PCI_OpenDRIM_PCIPort_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIPort_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_PCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIPort_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIPort_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PCI_OpenDRIM_PCIPort_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIPortProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIPort instance; PCI_OpenDRIM_PCIPort_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIPort_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIPort_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIPortProviderExecQuery(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 PCI_OpenDRIM_PCIPortProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_PCIPort_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIPortProviderInvokeMethod(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_PCIPort instance; PCI_OpenDRIM_PCIPort_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"DeviceID", "SystemCreationClassName", "SystemName", "CreationClassName"}; int errorCode = PCI_OpenDRIM_PCIPort_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_PCIPort_RequestStateChange_In inArgs; PCI_OpenDRIM_PCIPort_toCPP(_broker, in, inArgs); OpenDRIM_PCIPort_RequestStateChange_Out outArgs; errorCode = PCI_OpenDRIM_PCIPort_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } PCI_OpenDRIM_PCIPort_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SetPowerState") { unsigned int returnValue; OpenDRIM_PCIPort_SetPowerState_In inArgs; PCI_OpenDRIM_PCIPort_toCPP(_broker, in, inArgs); errorCode = PCI_OpenDRIM_PCIPort_SetPowerState(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="Reset") { unsigned int returnValue; errorCode = PCI_OpenDRIM_PCIPort_Reset(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="EnableDevice") { unsigned int returnValue; OpenDRIM_PCIPort_EnableDevice_In inArgs; PCI_OpenDRIM_PCIPort_toCPP(_broker, in, inArgs); errorCode = PCI_OpenDRIM_PCIPort_EnableDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="OnlineDevice") { unsigned int returnValue; OpenDRIM_PCIPort_OnlineDevice_In inArgs; PCI_OpenDRIM_PCIPort_toCPP(_broker, in, inArgs); errorCode = PCI_OpenDRIM_PCIPort_OnlineDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="QuiesceDevice") { unsigned int returnValue; OpenDRIM_PCIPort_QuiesceDevice_In inArgs; PCI_OpenDRIM_PCIPort_toCPP(_broker, in, inArgs); errorCode = PCI_OpenDRIM_PCIPort_QuiesceDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SaveProperties") { unsigned int returnValue; errorCode = PCI_OpenDRIM_PCIPort_SaveProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="RestoreProperties") { unsigned int returnValue; errorCode = PCI_OpenDRIM_PCIPort_RestoreProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIPort_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_PCIPort_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 PCI_OpenDRIM_PCIPort_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PCI_OpenDRIM_PCIPort_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_PCIPort_init FAILED: " + (string) OpenDRIM_PCIPort_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PCI_OpenDRIM_PCIPort_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PCI_OpenDRIM_PCIPort_unload(errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_PCIPort_unload FAILED: " + (string) OpenDRIM_PCIPort_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PCI_OpenDRIM_PCIPort_INIT if (PCI_OpenDRIM_PCIPort_init(_broker) < 0) return NULL CMInstanceMIStub(PCI_OpenDRIM_PCIPortProvider, PCI_OpenDRIM_PCIPortProvider, _broker, PCI_OpenDRIM_PCIPort_INIT); CMMethodMIStub(PCI_OpenDRIM_PCIPortProvider, PCI_OpenDRIM_PCIPortProvider, _broker, PCI_OpenDRIM_PCIPort_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIPort/OpenDRIM_PCIPortAccess.h0000644000175000017500000001053611400674237025453 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PCIPORTACCESS_H_ #define OPENDRIM_PCIPORTACCESS_H_ #include "PCI_Common.h" #include "OpenDRIM_PCIPort.h" int PCI_OpenDRIM_PCIPort_load(const CMPIBroker* broker, string& errorMessage); int PCI_OpenDRIM_PCIPort_unload(string& errorMessage); int PCI_OpenDRIM_PCIPort_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCIPort_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PCIPort& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCIPort_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& newInstance, const OpenDRIM_PCIPort& oldInstance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCIPort_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& instance, string& errorMessage); int PCI_OpenDRIM_PCIPort_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& instance, string& errorMessage); int PCI_OpenDRIM_PCIPort_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& instance, unsigned int& returnValue, const OpenDRIM_PCIPort_RequestStateChange_In& in, OpenDRIM_PCIPort_RequestStateChange_Out& out, string& errorMessage); int PCI_OpenDRIM_PCIPort_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& instance, unsigned int& returnValue, const OpenDRIM_PCIPort_SetPowerState_In& in, string& errorMessage); int PCI_OpenDRIM_PCIPort_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& instance, unsigned int& returnValue, string& errorMessage); int PCI_OpenDRIM_PCIPort_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& instance, unsigned int& returnValue, const OpenDRIM_PCIPort_EnableDevice_In& in, string& errorMessage); int PCI_OpenDRIM_PCIPort_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& instance, unsigned int& returnValue, const OpenDRIM_PCIPort_OnlineDevice_In& in, string& errorMessage); int PCI_OpenDRIM_PCIPort_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& instance, unsigned int& returnValue, const OpenDRIM_PCIPort_QuiesceDevice_In& in, string& errorMessage); int PCI_OpenDRIM_PCIPort_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& instance, unsigned int& returnValue, string& errorMessage); int PCI_OpenDRIM_PCIPort_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIPort& instance, unsigned int& returnValue, string& errorMessage); int PCI_OpenDRIM_PCIPort_populate(OpenDRIM_PCIPort& instance, string& errorMessage); #endif /*OPENDRIM_PCIPORTACCESS_H_*/ opendrim-lmp-pci-1.0.0~ppa/Common/0000755000175000017500000000000011400674237017551 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/Common/Makefile.am0000644000175000017500000000334711400674237021614 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### commonlibdir = @COMMONLIBDIR@ commonlib_LTLIBRARIES = libcmpiPCI_Common.la libcmpiPCI_Common_la_SOURCES = PCI_Common.cpp libcmpiPCI_Common_la_LDFLAGS = -avoid-version libcmpiPCI_Common_la_LIBADD = -lopendrim noinst_HEADERS = PCI_Common.h opendrim-lmp-pci-1.0.0~ppa/Common/PCI_Common.h0000644000175000017500000000320411400674237021644 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef PCI_COMMON_H_ #define PCI_COMMON_H_ #include unsigned HexToInteger(const char *InputString); #endif /*PCI_COMMON_H_*/ opendrim-lmp-pci-1.0.0~ppa/Common/PCI_Common.cpp0000644000175000017500000000327411400674237022206 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "PCI_Common.h" unsigned HexToInteger(const char *InputString) { unsigned OutputInteger; if (sscanf(InputString,"%X",&OutputInteger)) return OutputInteger; else return 0; } opendrim-lmp-pci-1.0.0~ppa/configure.ac0000644000175000017500000001305511400674237020613 0ustar guillaumeguillaume# Process this file with autoconf to produce a configure script. ############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### 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), PCI provider package Copyright (C) 2009 Nodir Nazarov This program is being developed under the "OpenDRIM" project. The "OpenDRIM" project web page: http://opendrim.sourceforge.net The "OpenDRIM" project mailing list: opendrim@googlegroups.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public 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(PCI 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_PCIeSwitch/Makefile OpenDRIM_PCIDeviceConnection/Makefile OpenDRIM_RegisteredPCIProfile/Makefile OpenDRIM_PCIPort/Makefile OpenDRIM_ComputerSystemPCIDevice/Makefile OpenDRIM_PCIBridge/Makefile OpenDRIM_PCIDeviceControlledByPCIPort/Makefile OpenDRIM_PCICapabilities/Makefile OpenDRIM_EnabledPCICapabilities/Makefile OpenDRIM_MemberOfPCICollection/Makefile OpenDRIM_PCIDevice/Makefile OpenDRIM_ConcretePCIIdentity/Makefile OpenDRIM_PCIPortGroup/Makefile OpenDRIM_PCIDeviceConformsToProfile/Makefile OpenDRIM_HostedPCICollection/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-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConnection/0000755000175000017500000000000011400674237023531 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConnection/Makefile.am0000644000175000017500000000466111400674237025574 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPCI_OpenDRIM_PCIDeviceConnectionProvider.la libcmpiPCI_OpenDRIM_PCIDeviceConnectionProvider_la_SOURCES = OpenDRIM_PCIDeviceConnectionAccess.cpp OpenDRIM_PCIDeviceConnectionProvider.cpp cmpiOpenDRIM_PCIDeviceConnection.cpp assocOpenDRIM_PCIDeviceConnection.cpp # May have to be adjusted for direct invocation libcmpiPCI_OpenDRIM_PCIDeviceConnectionProvider_la_CPPFLAGS = -I../CIM_LogicalDevice -I../CIM_LogicalDevice # Uncomment the end for direct invocation, may have to be adjusted libcmpiPCI_OpenDRIM_PCIDeviceConnectionProvider_la_LIBADD = ../Common/libcmpiPCI_Common.la #../CIM_LogicalDevice/libcmpiPCI_CIM_LogicalDeviceProvider.la ../CIM_LogicalDevice/libcmpiPCI_CIM_LogicalDeviceProvider.la libcmpiPCI_OpenDRIM_PCIDeviceConnectionProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_PCIDeviceConnection.h OpenDRIM_PCIDeviceConnection.h OpenDRIM_PCIDeviceConnectionAccess.h opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConnection/cmpiOpenDRIM_PCIDeviceConnection.cpp0000644000175000017500000000676311400674237032332 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIDeviceConnection.h" CMPIObjectPath* PCI_OpenDRIM_PCIDeviceConnection_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PCIDeviceConnection& instance) { _E_; Objectpath op(broker, OpenDRIM_PCIDeviceConnection_classnames[0], OpenDRIM_PCIDeviceConnection_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* PCI_OpenDRIM_PCIDeviceConnection_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PCIDeviceConnection& instance) { _E_; Objectpath op(broker, PCI_OpenDRIM_PCIDeviceConnection_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.NegotiatedSpeed_isNULL) ci.setProperty("NegotiatedSpeed", instance.NegotiatedSpeed); if (!instance.NegotiatedDataWidth_isNULL) ci.setProperty("NegotiatedDataWidth", instance.NegotiatedDataWidth); _L_; return ci.getHdl(); } void PCI_OpenDRIM_PCIDeviceConnection_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PCIDeviceConnection& 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 PCI_OpenDRIM_PCIDeviceConnection_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PCIDeviceConnection& 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("NegotiatedSpeed", instance.NegotiatedSpeed) == OK) instance.NegotiatedSpeed_isNULL = false; if (inst.getProperty("NegotiatedDataWidth", instance.NegotiatedDataWidth) == OK) instance.NegotiatedDataWidth_isNULL = false; _L_; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConnection/OpenDRIM_PCIDeviceConnection.h0000644000175000017500000001030511400674237031111 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PCIDEVICECONNECTION_H_ #define OPENDRIM_PCIDEVICECONNECTION_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_LogicalDevice.h" #include "CIM_LogicalDeviceAccess.h" #include "cmpiCIM_LogicalDevice.h" #include "CIM_LogicalDeviceAccess.h" */ const static char* OpenDRIM_PCIDeviceConnection_classnames[] = {"OpenDRIM_PCIDeviceConnection"}; static string OpenDRIM_PCIDeviceConnection_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"OpenDRIM_PCIPort"}; const static string Antecedent_NAMESPACE = _NAMESPACE; const static string Dependent_role = "Dependent"; const static char* Dependent_classnames[] = {"OpenDRIM_PCIPort"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_PCIDeviceConnection { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; unsigned long long NegotiatedSpeed; bool NegotiatedSpeed_isNULL; unsigned int NegotiatedDataWidth; bool NegotiatedDataWidth_isNULL; OpenDRIM_PCIDeviceConnection() { Antecedent_isNULL = true; Dependent_isNULL = true; NegotiatedSpeed_isNULL = true; NegotiatedDataWidth_isNULL = true; } ~OpenDRIM_PCIDeviceConnection() {} 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 getNegotiatedSpeed(unsigned long long& value) const { if (NegotiatedSpeed_isNULL==true) return NOT_FOUND; value = NegotiatedSpeed; return OK; } int setNegotiatedSpeed(const unsigned long long& newValue) { NegotiatedSpeed = newValue; NegotiatedSpeed_isNULL = false; return OK; } int getNegotiatedDataWidth(unsigned int& value) const { if (NegotiatedDataWidth_isNULL==true) return NOT_FOUND; value = NegotiatedDataWidth; return OK; } int setNegotiatedDataWidth(const unsigned int& newValue) { NegotiatedDataWidth = newValue; NegotiatedDataWidth_isNULL = false; return OK; } }; #endif /*OPENDRIM_PCIDEVICECONNECTION_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConnection/assocOpenDRIM_PCIDeviceConnection.cpp0000644000175000017500000002062311400674237032501 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_PCIDeviceConnection.h" int PCI_OpenDRIM_PCIDeviceConnection_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 = PCI_OpenDRIM_PCIDeviceConnection_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(PCI_OpenDRIM_PCIDeviceConnection_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(PCI_OpenDRIM_PCIDeviceConnection_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConnection_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(PCI_CIM_LogicalDevice_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PCI_CIM_LogicalDevice_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PCI_CIM_LogicalDevice_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConnection_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_LogicalDevice _instance; PCI_CIM_LogicalDevice_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PCI_CIM_LogicalDevice_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PCI_CIM_LogicalDevice_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConnection_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(PCI_CIM_LogicalDevice_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PCI_CIM_LogicalDevice_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PCI_CIM_LogicalDevice_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConnection_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_LogicalDevice _instance; PCI_CIM_LogicalDevice_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PCI_CIM_LogicalDevice_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PCI_CIM_LogicalDevice_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConnection/OpenDRIM_PCIDeviceConnectionProvider.cpp0000644000175000017500000004141411400674237033164 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIDeviceConnection.h" #include "OpenDRIM_PCIDeviceConnectionAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PCI_OpenDRIM_PCIDeviceConnectionProviderSetInstance PCI_OpenDRIM_PCIDeviceConnectionProviderModifyInstance #endif int PCI_OpenDRIM_PCIDeviceConnection_init(const CMPIBroker* broker); int PCI_OpenDRIM_PCIDeviceConnection_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PCI_OpenDRIM_PCIDeviceConnectionProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_PCIDeviceConnection_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceConnectionProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceConnection_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConnection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_PCIDeviceConnection_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceConnectionProviderEnumInstances(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 = PCI_OpenDRIM_PCIDeviceConnection_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConnection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PCI_OpenDRIM_PCIDeviceConnection_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceConnectionProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIDeviceConnection instance; PCI_OpenDRIM_PCIDeviceConnection_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceConnection_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConnection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PCI_OpenDRIM_PCIDeviceConnection_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceConnectionProviderSetInstance(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_PCIDeviceConnection newInstance, oldInstance; PCI_OpenDRIM_PCIDeviceConnection_toCPP(_broker, ci, newInstance); PCI_OpenDRIM_PCIDeviceConnection_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceConnection_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConnection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIDeviceConnection_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConnection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceConnectionProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIDeviceConnection instance; PCI_OpenDRIM_PCIDeviceConnection_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceConnection_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_PCIDeviceConnection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIDeviceConnection_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConnection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIDeviceConnection_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConnection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PCI_OpenDRIM_PCIDeviceConnection_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceConnectionProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIDeviceConnection instance; PCI_OpenDRIM_PCIDeviceConnection_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceConnection_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConnection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIDeviceConnection_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConnection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceConnectionProviderExecQuery(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 PCI_OpenDRIM_PCIDeviceConnectionProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_PCIDeviceConnection_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceConnectionProviderAssociatorNames(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 = PCI_OpenDRIM_PCIDeviceConnection_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConnection_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 PCI_OpenDRIM_PCIDeviceConnectionProviderAssociators(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 = PCI_OpenDRIM_PCIDeviceConnection_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConnection_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 PCI_OpenDRIM_PCIDeviceConnectionProviderReferenceNames(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 = PCI_OpenDRIM_PCIDeviceConnection_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConnection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PCI_OpenDRIM_PCIDeviceConnection_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = PCI_OpenDRIM_PCIDeviceConnection_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConnection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_PCIDeviceConnection_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceConnectionProviderReferences(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 = PCI_OpenDRIM_PCIDeviceConnection_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConnection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PCI_OpenDRIM_PCIDeviceConnection_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = PCI_OpenDRIM_PCIDeviceConnection_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConnection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = PCI_OpenDRIM_PCIDeviceConnection_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int PCI_OpenDRIM_PCIDeviceConnection_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceConnection_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_PCIDeviceConnection_init FAILED: " + (string) OpenDRIM_PCIDeviceConnection_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConnection_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceConnection_unload(errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_PCIDeviceConnection_unload FAILED: " + (string) OpenDRIM_PCIDeviceConnection_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PCI_OpenDRIM_PCIDeviceConnection_INIT if (PCI_OpenDRIM_PCIDeviceConnection_init(_broker) < 0) return NULL CMInstanceMIStub(PCI_OpenDRIM_PCIDeviceConnectionProvider, PCI_OpenDRIM_PCIDeviceConnectionProvider, _broker, PCI_OpenDRIM_PCIDeviceConnection_INIT); CMAssociationMIStub(PCI_OpenDRIM_PCIDeviceConnectionProvider, PCI_OpenDRIM_PCIDeviceConnectionProvider, _broker, PCI_OpenDRIM_PCIDeviceConnection_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConnection/OpenDRIM_PCIDeviceConnectionAccess.cpp0000644000175000017500000002450511400674237032575 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_PCIDeviceConnectionAccess.h" int PCI_OpenDRIM_PCIDeviceConnection_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PCI_CIM_LogicalDevice_load(broker, errorMessage)); CF_assert(PCI_CIM_LogicalDevice_load(broker, errorMessage)); */ // TODO _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConnection_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PCI_CIM_LogicalDevice_unload(errorMessage)); CF_assert(PCI_CIM_LogicalDevice_unload(errorMessage)); */ // TODO _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConnection_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConnection_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(PCI_OpenDRIM_PCIDeviceConnection_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(PCI_OpenDRIM_PCIDeviceConnection_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; PCI_OpenDRIM_PCIDeviceConnection_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(PCI_OpenDRIM_PCIDeviceConnection_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConnection_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PCIDeviceConnection& 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(PCI_OpenDRIM_PCIDeviceConnection_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(PCI_OpenDRIM_PCIDeviceConnection_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(PCI_OpenDRIM_PCIDeviceConnection_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } CF_assert(PCI_OpenDRIM_PCIDeviceConnection_populate(instance, errorMessage)); _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConnection_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDeviceConnection& newInstance, const OpenDRIM_PCIDeviceConnection& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIDeviceConnection_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDeviceConnection& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIDeviceConnection_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDeviceConnection& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIDeviceConnection_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(PCI_OpenDRIM_PCIDeviceConnection_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PCI_OpenDRIM_PCIDeviceConnection_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(PCI_OpenDRIM_PCIDeviceConnection_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(PCI_OpenDRIM_PCIDeviceConnection_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PCI_OpenDRIM_PCIDeviceConnection_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(PCI_OpenDRIM_PCIDeviceConnection_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_PCIDeviceConnection_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_PCIDeviceConnection instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); if (discriminant == "r") { CF_assert(PCI_OpenDRIM_PCIDeviceConnection_populate(instance, errorMessage)); } OpenDRIM_PCIDeviceConnection_instances.push_back(instance); } _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConnection_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_PCIDeviceConnection_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_PCIDeviceConnection instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); if (discriminant == "r") { CF_assert(PCI_OpenDRIM_PCIDeviceConnection_populate(instance, errorMessage)); } OpenDRIM_PCIDeviceConnection_instances.push_back(instance); } _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConnection_populate(OpenDRIM_PCIDeviceConnection& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConnection/cmpiOpenDRIM_PCIDeviceConnection.h0000644000175000017500000000432311400674237031765 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_PCIDEVICECONNECTION_H_ #define CMPIOPENDRIM_PCIDEVICECONNECTION_H_ #include "OpenDRIM_PCIDeviceConnection.h" CMPIObjectPath* PCI_OpenDRIM_PCIDeviceConnection_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PCIDeviceConnection& instance); CMPIInstance* PCI_OpenDRIM_PCIDeviceConnection_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PCIDeviceConnection& instance); void PCI_OpenDRIM_PCIDeviceConnection_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PCIDeviceConnection& instance); void PCI_OpenDRIM_PCIDeviceConnection_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PCIDeviceConnection& instance); #endif /*CMPIOPENDRIM_PCIDEVICECONNECTION_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConnection/assocOpenDRIM_PCIDeviceConnection.h0000644000175000017500000000615711400674237032154 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_PCIDEVICECONNECTION_H_ #define ASSOCOPENDRIM_PCIDEVICECONNECTION_H_ #include "OpenDRIM_PCIDeviceConnectionAccess.h" int PCI_OpenDRIM_PCIDeviceConnection_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 PCI_OpenDRIM_PCIDeviceConnection_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 PCI_OpenDRIM_PCIDeviceConnection_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PCI_OpenDRIM_PCIDeviceConnection_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCIDeviceConnection_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PCI_OpenDRIM_PCIDeviceConnection_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_PCIDEVICECONNECTION_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConnection/OpenDRIM_PCIDeviceConnectionAccess.h0000644000175000017500000001035111400674237032234 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PCIDEVICECONNECTIONACCESS_H_ #define OPENDRIM_PCIDEVICECONNECTIONACCESS_H_ #include "PCI_Common.h" #include "OpenDRIM_PCIDeviceConnection.h" #include "assocOpenDRIM_PCIDeviceConnection.h" int PCI_OpenDRIM_PCIDeviceConnection_load(const CMPIBroker* broker, string& errorMessage); int PCI_OpenDRIM_PCIDeviceConnection_unload(string& errorMessage); int PCI_OpenDRIM_PCIDeviceConnection_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCIDeviceConnection_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PCIDeviceConnection& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCIDeviceConnection_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDeviceConnection& newInstance, const OpenDRIM_PCIDeviceConnection& oldInstance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCIDeviceConnection_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDeviceConnection& instance, string& errorMessage); int PCI_OpenDRIM_PCIDeviceConnection_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDeviceConnection& instance, string& errorMessage); int PCI_OpenDRIM_PCIDeviceConnection_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCIDeviceConnection_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCIDeviceConnection_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_PCIDeviceConnection_instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCIDeviceConnection_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_PCIDeviceConnection_instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCIDeviceConnection_populate(OpenDRIM_PCIDeviceConnection& instance, string& errorMessage); #endif /*OPENDRIM_PCIDEVICECONNECTIONACCESS_H_*/ opendrim-lmp-pci-1.0.0~ppa/TODO0000644000175000017500000000010111400674237017001 0ustar guillaumeguillaumeTODO for Major.Minor.Revision ========================= // TODO opendrim-lmp-pci-1.0.0~ppa/INSTALL0000644000175000017500000000667411400674237017367 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ --------------------------------------------------------- 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-pci-1.0.0~ppa/AUTHORS0000644000175000017500000000012611400674237017370 0ustar guillaumeguillaumeNodir Nazarov Guillaume BOTTEX opendrim-lmp-pci-1.0.0~ppa/packaging/0000755000175000017500000000000011400674237020245 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/packaging/debian/0000755000175000017500000000000011404350216021457 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/packaging/debian/postrm0000644000175000017500000000364711404350216022740 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_PCIeSwitch rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_PCIDeviceConnection rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_RegisteredPCIProfile rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_PCIPort rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_ComputerSystemPCIDevice rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_PCIBridge rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_PCIDeviceControlledByPCIPort rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_PCICapabilities rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_EnabledPCICapabilities rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_MemberOfPCICollection rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_PCIDevice rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_ConcretePCIIdentity rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_PCIPortGroup rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_PCIDeviceConformsToProfile rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_HostedPCICollection ;; 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-pci-1.0.0~ppa/packaging/debian/source/0000755000175000017500000000000011400674237022767 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/packaging/debian/source/format0000644000175000017500000000001411400674237024175 0ustar guillaumeguillaume3.0 (quilt) opendrim-lmp-pci-1.0.0~ppa/packaging/debian/copyright0000644000175000017500000000275111400674237023427 0ustar guillaumeguillaumeThis package was debianized by Guillaume BOTTEX on Tue, 16 Mar 2010 11:18:00 +0900. It was downloaded from http://opendrim.sourceforge.net/ Upstream Authors: Nodir Nazarov Guillaume BOTTEX Copyright: Copyright (C) 2009 ETRI Nodir Nazarov Copyright (C) 2009 ETRI Guillaume BOTTEX License: Linux Management Providers (LMP), PCI 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 2010, Guillaume BOTTEX and is licensed under the GPL, see `/usr/share/common-licenses/GPL-2'. opendrim-lmp-pci-1.0.0~ppa/packaging/debian/control0000644000175000017500000000124311404350210023054 0ustar guillaumeguillaumeSource: opendrim-lmp-pci 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-pci Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, sfcb, libopendrim0 (>= 1.1.3), pciutils Description: OpenDRIM PCI provider Provides information about the computer system PCI devices capabilities. . Compliant with the DMTF PCI Profile v1.0.0 (DSP1075). opendrim-lmp-pci-1.0.0~ppa/packaging/debian/prerm0000644000175000017500000000240511400674237022540 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-pci VERSION=`cat /usr/share/doc/opendrim-lmp-pci/VERSION` OPENDRIM_REG_DIR=/usr/share/OpenDRIM PROVIDER_SCRIPT_POST=PCI $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-pci-1.0.0~ppa/packaging/debian/changelog0000644000175000017500000000024111404350167023333 0ustar guillaumeguillaumeopendrim-lmp-pci (1.0.0-0ubuntu1) lucid; urgency=low * Initial release -- Guillaume BOTTEX Fri, 11 Jun 2010 14:58:00 +0900 opendrim-lmp-pci-1.0.0~ppa/packaging/debian/postinst0000644000175000017500000000256211400674237023302 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-pci VERSION=`cat /usr/share/doc/opendrim-lmp-pci/VERSION` OPENDRIM_REG_DIR=/usr/share/OpenDRIM PROVIDER_SCRIPT_POST=PCI $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-pci-1.0.0~ppa/packaging/debian/install0000644000175000017500000000004711400674237023061 0ustar guillaumeguillaumeusr/lib/cmpi/*.so usr/share/OpenDRIM/* opendrim-lmp-pci-1.0.0~ppa/packaging/debian/rules0000755000175000017500000000353311400674237022553 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-pci 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-pci.sgml > opendrim-lmp-pci.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-pci-1.0.0~ppa/packaging/debian/docs0000644000175000017500000000003111400674237022334 0ustar guillaumeguillaumeNEWS README TODO VERSION opendrim-lmp-pci-1.0.0~ppa/packaging/debian/compat0000644000175000017500000000000211400674237022665 0ustar guillaumeguillaume5 opendrim-lmp-pci-1.0.0~ppa/packaging/opendrim-lmp-pci.spec0000644000175000017500000000765511400674237024312 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ %define packageVersion 1 Version: %{version} Release: %{packageVersion}%{?dist} Vendor: OpenDRIM Summary: OpenDRIM PCI Provider Name: opendrim-lmp-pci Group: Systems Management/Base License: GPL BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root URL: http://opendrim.sourceforge.net Source: %{name}-%{version}.tar.gz BuildRequires: autoconf, tog-pegasus-devel, libopendrim >= 1.1.1 Requires: tog-pegasus, libopendrim >= 1.1.1 %description %global PEGASUS_ARCH_LIB %{_lib} %global COMMONLIBDIR /usr/%PEGASUS_ARCH_LIB %global PROVIDERDIR %COMMONLIBDIR/Pegasus/providers %global OPENDRIM_REG_DIR /usr/share/OpenDRIM %global OPENDRIM_MOF_DIR /usr/share/OpenDRIM/%{name}/mof %global PROVIDER_SCRIPT_POST PCI %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-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConformsToProfile/0000755000175000017500000000000011400674237025044 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConformsToProfile/Makefile.am0000644000175000017500000000502411400674237027101 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPCI_OpenDRIM_PCIDeviceConformsToProfileProvider.la libcmpiPCI_OpenDRIM_PCIDeviceConformsToProfileProvider_la_SOURCES = OpenDRIM_PCIDeviceConformsToProfileAccess.cpp OpenDRIM_PCIDeviceConformsToProfileProvider.cpp cmpiOpenDRIM_PCIDeviceConformsToProfile.cpp assocOpenDRIM_PCIDeviceConformsToProfile.cpp # May have to be adjusted for direct invocation libcmpiPCI_OpenDRIM_PCIDeviceConformsToProfileProvider_la_CPPFLAGS = -I../CIM_RegisteredProfile -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiPCI_OpenDRIM_PCIDeviceConformsToProfileProvider_la_LIBADD = ../Common/libcmpiPCI_Common.la #../CIM_RegisteredProfile/libcmpiPCI_CIM_RegisteredProfileProvider.la ../CIM_ManagedElement/libcmpiPCI_CIM_ManagedElementProvider.la libcmpiPCI_OpenDRIM_PCIDeviceConformsToProfileProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_PCIDeviceConformsToProfile.h OpenDRIM_PCIDeviceConformsToProfile.h OpenDRIM_PCIDeviceConformsToProfileAccess.h ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConformsToProfile/cmpiOpenDRIM_PCIDeviceConformsToProfile.hopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConformsToProfile/cmpiOpenDRIM_PCIDeviceConformsToProfi0000644000175000017500000000444711400674237034053 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_PCIDEVICECONFORMSTOPROFILE_H_ #define CMPIOPENDRIM_PCIDEVICECONFORMSTOPROFILE_H_ #include "OpenDRIM_PCIDeviceConformsToProfile.h" CMPIObjectPath* PCI_OpenDRIM_PCIDeviceConformsToProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PCIDeviceConformsToProfile& instance); CMPIInstance* PCI_OpenDRIM_PCIDeviceConformsToProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PCIDeviceConformsToProfile& instance); void PCI_OpenDRIM_PCIDeviceConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PCIDeviceConformsToProfile& instance); void PCI_OpenDRIM_PCIDeviceConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PCIDeviceConformsToProfile& instance); #endif /*CMPIOPENDRIM_PCIDEVICECONFORMSTOPROFILE_H_*/ ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConformsToProfile/OpenDRIM_PCIDeviceConformsToProfileAccess.cppopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConformsToProfile/OpenDRIM_PCIDeviceConformsToProfileAc0000644000175000017500000002547111400674237033767 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_PCIDeviceConformsToProfileAccess.h" int PCI_OpenDRIM_PCIDeviceConformsToProfile_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PCI_CIM_RegisteredProfile_load(broker, errorMessage)); CF_assert(PCI_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConformsToProfile_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PCI_CIM_RegisteredProfile_unload(errorMessage)); CF_assert(PCI_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConformsToProfile_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 PCI_OpenDRIM_PCIDeviceConformsToProfile_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(PCI_OpenDRIM_PCIDeviceConformsToProfile_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(PCI_OpenDRIM_PCIDeviceConformsToProfile_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; PCI_OpenDRIM_PCIDeviceConformsToProfile_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(PCI_OpenDRIM_PCIDeviceConformsToProfile_referenceConformantStandardToManagedElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConformsToProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PCIDeviceConformsToProfile& 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(PCI_OpenDRIM_PCIDeviceConformsToProfile_getConformantStandard(broker, ctx, ConformantStandard_objectpath, ConformantStandard_instance, NULL, errorMessage)); Objectpath ManagedElement_objectpath; instance.getManagedElement(ManagedElement_objectpath); Instance ManagedElement_instance; CF_assert(PCI_OpenDRIM_PCIDeviceConformsToProfile_getManagedElement(broker, ctx, ManagedElement_objectpath, ManagedElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(PCI_OpenDRIM_PCIDeviceConformsToProfile_isAssociated(ConformantStandard_instance, ManagedElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConformsToProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDeviceConformsToProfile& newInstance, const OpenDRIM_PCIDeviceConformsToProfile& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIDeviceConformsToProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDeviceConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIDeviceConformsToProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDeviceConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIDeviceConformsToProfile_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(PCI_OpenDRIM_PCIDeviceConformsToProfile_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PCI_OpenDRIM_PCIDeviceConformsToProfile_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(PCI_OpenDRIM_PCIDeviceConformsToProfile_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(PCI_OpenDRIM_PCIDeviceConformsToProfile_enumerateConformantStandards(broker, ctx, ConformantStandard_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PCI_OpenDRIM_PCIDeviceConformsToProfile_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(PCI_OpenDRIM_PCIDeviceConformsToProfile_enumerateConformantStandards(broker, ctx, ConformantStandard_instances, properties, false, errorMessage)); } for (size_t i=0; i& ManagedElement_instances, vector& OpenDRIM_PCIDeviceConformsToProfile_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_PCIDeviceConformsToProfile instance; instance.setConformantStandard(((Instance) ConformantStandard_instance).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instances[i]).getObjectpath()); OpenDRIM_PCIDeviceConformsToProfile_instances.push_back(instance); } _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConformsToProfile_referenceManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& ConformantStandard_instances, vector& OpenDRIM_PCIDeviceConformsToProfile_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_PCIDeviceConformsToProfile instance; instance.setConformantStandard(((Instance) ConformantStandard_instances[i]).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instance).getObjectpath()); OpenDRIM_PCIDeviceConformsToProfile_instances.push_back(instance); } _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConformsToProfile_populate(OpenDRIM_PCIDeviceConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConformsToProfile/assocOpenDRIM_PCIDeviceConformsToProfile.hopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConformsToProfile/assocOpenDRIM_PCIDeviceConformsToProf0000644000175000017500000000631711400674237034060 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_PCIDEVICECONFORMSTOPROFILE_H_ #define ASSOCOPENDRIM_PCIDEVICECONFORMSTOPROFILE_H_ #include "OpenDRIM_PCIDeviceConformsToProfileAccess.h" int PCI_OpenDRIM_PCIDeviceConformsToProfile_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 PCI_OpenDRIM_PCIDeviceConformsToProfile_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 PCI_OpenDRIM_PCIDeviceConformsToProfile_enumerateConformantStandards(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PCI_OpenDRIM_PCIDeviceConformsToProfile_getConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCIDeviceConformsToProfile_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PCI_OpenDRIM_PCIDeviceConformsToProfile_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_PCIDEVICECONFORMSTOPROFILE_H_*/ ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConformsToProfile/cmpiOpenDRIM_PCIDeviceConformsToProfile.cppopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConformsToProfile/cmpiOpenDRIM_PCIDeviceConformsToProfi0000644000175000017500000000635211400674237034050 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIDeviceConformsToProfile.h" CMPIObjectPath* PCI_OpenDRIM_PCIDeviceConformsToProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PCIDeviceConformsToProfile& instance) { _E_; Objectpath op(broker, OpenDRIM_PCIDeviceConformsToProfile_classnames[0], OpenDRIM_PCIDeviceConformsToProfile_NAMESPACE); if (!instance.ConformantStandard_isNULL) op.addKey("ConformantStandard", instance.ConformantStandard); if (!instance.ManagedElement_isNULL) op.addKey("ManagedElement", instance.ManagedElement); _L_; return op.getHdl(); } CMPIInstance* PCI_OpenDRIM_PCIDeviceConformsToProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PCIDeviceConformsToProfile& instance) { _E_; Objectpath op(broker, PCI_OpenDRIM_PCIDeviceConformsToProfile_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void PCI_OpenDRIM_PCIDeviceConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PCIDeviceConformsToProfile& 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 PCI_OpenDRIM_PCIDeviceConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PCIDeviceConformsToProfile& 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_; } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConformsToProfile/OpenDRIM_PCIDeviceConformsToProfileProvider.cppopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConformsToProfile/OpenDRIM_PCIDeviceConformsToProfilePr0000644000175000017500000004266611400674237034032 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIDeviceConformsToProfile.h" #include "OpenDRIM_PCIDeviceConformsToProfileAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PCI_OpenDRIM_PCIDeviceConformsToProfileProviderSetInstance PCI_OpenDRIM_PCIDeviceConformsToProfileProviderModifyInstance #endif int PCI_OpenDRIM_PCIDeviceConformsToProfile_init(const CMPIBroker* broker); int PCI_OpenDRIM_PCIDeviceConformsToProfile_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PCI_OpenDRIM_PCIDeviceConformsToProfileProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_PCIDeviceConformsToProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceConformsToProfileProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceConformsToProfile_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_PCIDeviceConformsToProfile_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceConformsToProfileProviderEnumInstances(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 = PCI_OpenDRIM_PCIDeviceConformsToProfile_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PCI_OpenDRIM_PCIDeviceConformsToProfile_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceConformsToProfileProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIDeviceConformsToProfile instance; PCI_OpenDRIM_PCIDeviceConformsToProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceConformsToProfile_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PCI_OpenDRIM_PCIDeviceConformsToProfile_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceConformsToProfileProviderSetInstance(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_PCIDeviceConformsToProfile newInstance, oldInstance; PCI_OpenDRIM_PCIDeviceConformsToProfile_toCPP(_broker, ci, newInstance); PCI_OpenDRIM_PCIDeviceConformsToProfile_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceConformsToProfile_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIDeviceConformsToProfile_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceConformsToProfileProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIDeviceConformsToProfile instance; PCI_OpenDRIM_PCIDeviceConformsToProfile_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_PCIDeviceConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIDeviceConformsToProfile_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIDeviceConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PCI_OpenDRIM_PCIDeviceConformsToProfile_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceConformsToProfileProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIDeviceConformsToProfile instance; PCI_OpenDRIM_PCIDeviceConformsToProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIDeviceConformsToProfile_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceConformsToProfileProviderExecQuery(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 PCI_OpenDRIM_PCIDeviceConformsToProfileProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_PCIDeviceConformsToProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceConformsToProfileProviderAssociatorNames(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 = PCI_OpenDRIM_PCIDeviceConformsToProfile_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConformsToProfile_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 PCI_OpenDRIM_PCIDeviceConformsToProfileProviderAssociators(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 = PCI_OpenDRIM_PCIDeviceConformsToProfile_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConformsToProfile_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 PCI_OpenDRIM_PCIDeviceConformsToProfileProviderReferenceNames(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 = PCI_OpenDRIM_PCIDeviceConformsToProfile_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PCI_OpenDRIM_PCIDeviceConformsToProfile_referenceConformantStandardToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = PCI_OpenDRIM_PCIDeviceConformsToProfile_referenceManagedElementToConformantStandard(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_PCIDeviceConformsToProfile_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceConformsToProfileProviderReferences(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 = PCI_OpenDRIM_PCIDeviceConformsToProfile_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PCI_OpenDRIM_PCIDeviceConformsToProfile_referenceConformantStandardToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = PCI_OpenDRIM_PCIDeviceConformsToProfile_referenceManagedElementToConformantStandard(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = PCI_OpenDRIM_PCIDeviceConformsToProfile_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int PCI_OpenDRIM_PCIDeviceConformsToProfile_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceConformsToProfile_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_PCIDeviceConformsToProfile_init FAILED: " + (string) OpenDRIM_PCIDeviceConformsToProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConformsToProfile_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceConformsToProfile_unload(errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_PCIDeviceConformsToProfile_unload FAILED: " + (string) OpenDRIM_PCIDeviceConformsToProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PCI_OpenDRIM_PCIDeviceConformsToProfile_INIT if (PCI_OpenDRIM_PCIDeviceConformsToProfile_init(_broker) < 0) return NULL CMInstanceMIStub(PCI_OpenDRIM_PCIDeviceConformsToProfileProvider, PCI_OpenDRIM_PCIDeviceConformsToProfileProvider, _broker, PCI_OpenDRIM_PCIDeviceConformsToProfile_INIT); CMAssociationMIStub(PCI_OpenDRIM_PCIDeviceConformsToProfileProvider, PCI_OpenDRIM_PCIDeviceConformsToProfileProvider, _broker, PCI_OpenDRIM_PCIDeviceConformsToProfile_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConformsToProfile/assocOpenDRIM_PCIDeviceConformsToProfile.cppopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConformsToProfile/assocOpenDRIM_PCIDeviceConformsToProf0000644000175000017500000002137311400674237034057 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_PCIDeviceConformsToProfile.h" int PCI_OpenDRIM_PCIDeviceConformsToProfile_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 = PCI_OpenDRIM_PCIDeviceConformsToProfile_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(PCI_OpenDRIM_PCIDeviceConformsToProfile_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(PCI_OpenDRIM_PCIDeviceConformsToProfile_associatorManagedElementToConformantStandard(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConformsToProfile_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(PCI_CIM_RegisteredProfile_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PCI_CIM_RegisteredProfile_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PCI_CIM_RegisteredProfile_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConformsToProfile_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; PCI_CIM_RegisteredProfile_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PCI_CIM_RegisteredProfile_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PCI_CIM_RegisteredProfile_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConformsToProfile_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(PCI_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PCI_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PCI_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PCI_OpenDRIM_PCIDeviceConformsToProfile_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; PCI_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PCI_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PCI_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConformsToProfile/OpenDRIM_PCIDeviceConformsToProfile.hopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConformsToProfile/OpenDRIM_PCIDeviceConformsToProfile.h0000644000175000017500000000731411400674237033745 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PCIDEVICECONFORMSTOPROFILE_H_ #define OPENDRIM_PCIDEVICECONFORMSTOPROFILE_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_PCIDeviceConformsToProfile_classnames[] = {"OpenDRIM_PCIDeviceConformsToProfile"}; static string OpenDRIM_PCIDeviceConformsToProfile_NAMESPACE = _INTEROP_NAMESPACE; const static string ConformantStandard_role = "ConformantStandard"; const static char* ConformantStandard_classnames[] = {"OpenDRIM_RegisteredPCIProfile"}; const static string ConformantStandard_NAMESPACE = _INTEROP_NAMESPACE; const static string ManagedElement_role = "ManagedElement"; const static char* ManagedElement_classnames[] = {"OpenDRIM_PCIDevice"}; const static string ManagedElement_NAMESPACE = _NAMESPACE; class OpenDRIM_PCIDeviceConformsToProfile { public: Objectpath ConformantStandard; bool ConformantStandard_isNULL; Objectpath ManagedElement; bool ManagedElement_isNULL; OpenDRIM_PCIDeviceConformsToProfile() { ConformantStandard_isNULL = true; ManagedElement_isNULL = true; } ~OpenDRIM_PCIDeviceConformsToProfile() {} 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_PCIDEVICECONFORMSTOPROFILE_H_*/ ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConformsToProfile/OpenDRIM_PCIDeviceConformsToProfileAccess.hopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceConformsToProfile/OpenDRIM_PCIDeviceConformsToProfileAc0000644000175000017500000001102511400674237033755 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PCIDEVICECONFORMSTOPROFILEACCESS_H_ #define OPENDRIM_PCIDEVICECONFORMSTOPROFILEACCESS_H_ #include "PCI_Common.h" #include "OpenDRIM_PCIDeviceConformsToProfile.h" #include "assocOpenDRIM_PCIDeviceConformsToProfile.h" int PCI_OpenDRIM_PCIDeviceConformsToProfile_load(const CMPIBroker* broker, string& errorMessage); int PCI_OpenDRIM_PCIDeviceConformsToProfile_unload(string& errorMessage); int PCI_OpenDRIM_PCIDeviceConformsToProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCIDeviceConformsToProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PCIDeviceConformsToProfile& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCIDeviceConformsToProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDeviceConformsToProfile& newInstance, const OpenDRIM_PCIDeviceConformsToProfile& oldInstance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCIDeviceConformsToProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDeviceConformsToProfile& instance, string& errorMessage); int PCI_OpenDRIM_PCIDeviceConformsToProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDeviceConformsToProfile& instance, string& errorMessage); int PCI_OpenDRIM_PCIDeviceConformsToProfile_associatorConformantStandardToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ConformantStandard_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCIDeviceConformsToProfile_associatorManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const char** properties, vector& ConformantStandard_associatedInstances, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCIDeviceConformsToProfile_referenceConformantStandardToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ConformantStandard_instance, const vector& ManagedElement_instances, vector& OpenDRIM_PCIDeviceConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCIDeviceConformsToProfile_referenceManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& ConformantStandard_instances, vector& OpenDRIM_PCIDeviceConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCIDeviceConformsToProfile_populate(OpenDRIM_PCIDeviceConformsToProfile& instance, string& errorMessage); #endif /*OPENDRIM_PCIDEVICECONFORMSTOPROFILEACCESS_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCICapabilities/0000755000175000017500000000000011400674237022703 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCICapabilities/Makefile.am0000644000175000017500000000460111400674237024740 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPCI_OpenDRIM_PCICapabilitiesProvider.la libcmpiPCI_OpenDRIM_PCICapabilitiesProvider_la_SOURCES = OpenDRIM_PCICapabilitiesAccess.cpp OpenDRIM_PCICapabilitiesProvider.cpp cmpiOpenDRIM_PCICapabilities.cpp assocOpenDRIM_PCICapabilities.cpp # May have to be adjusted for direct invocation libcmpiPCI_OpenDRIM_PCICapabilitiesProvider_la_CPPFLAGS = -I../CIM_Capabilities -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiPCI_OpenDRIM_PCICapabilitiesProvider_la_LIBADD = ../Common/libcmpiPCI_Common.la #../CIM_Capabilities/libcmpiPCI_CIM_CapabilitiesProvider.la ../CIM_ManagedElement/libcmpiPCI_CIM_ManagedElementProvider.la libcmpiPCI_OpenDRIM_PCICapabilitiesProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_PCICapabilities.h OpenDRIM_PCICapabilities.h OpenDRIM_PCICapabilitiesAccess.h opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCICapabilities/OpenDRIM_PCICapabilitiesAccess.h0000644000175000017500000001026111400674237030560 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PCICAPABILITIESACCESS_H_ #define OPENDRIM_PCICAPABILITIESACCESS_H_ #include "PCI_Common.h" #include "OpenDRIM_PCICapabilities.h" #include "assocOpenDRIM_PCICapabilities.h" int PCI_OpenDRIM_PCICapabilities_load(const CMPIBroker* broker, string& errorMessage); int PCI_OpenDRIM_PCICapabilities_unload(string& errorMessage); int PCI_OpenDRIM_PCICapabilities_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCICapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PCICapabilities& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCICapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCICapabilities& newInstance, const OpenDRIM_PCICapabilities& oldInstance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCICapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCICapabilities& instance, string& errorMessage); int PCI_OpenDRIM_PCICapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCICapabilities& instance, string& errorMessage); int PCI_OpenDRIM_PCICapabilities_associatorCapabilitiesToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Capabilities_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCICapabilities_associatorManagedElementToCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const char** properties, vector& Capabilities_associatedInstances, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCICapabilities_referenceCapabilitiesToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Capabilities_instance, const vector& ManagedElement_instances, vector& OpenDRIM_PCICapabilities_instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCICapabilities_referenceManagedElementToCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& Capabilities_instances, vector& OpenDRIM_PCICapabilities_instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCICapabilities_populate(OpenDRIM_PCICapabilities& instance, string& errorMessage); #endif /*OPENDRIM_PCICAPABILITIESACCESS_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCICapabilities/assocOpenDRIM_PCICapabilities.h0000644000175000017500000000612511400674237030473 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_PCICAPABILITIES_H_ #define ASSOCOPENDRIM_PCICAPABILITIES_H_ #include "OpenDRIM_PCICapabilitiesAccess.h" int PCI_OpenDRIM_PCICapabilities_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 PCI_OpenDRIM_PCICapabilities_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 PCI_OpenDRIM_PCICapabilities_enumerateCapabilitiess(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PCI_OpenDRIM_PCICapabilities_getCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCICapabilities_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PCI_OpenDRIM_PCICapabilities_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_PCICAPABILITIES_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCICapabilities/assocOpenDRIM_PCICapabilities.cpp0000644000175000017500000002070311400674237031024 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_PCICapabilities.h" int PCI_OpenDRIM_PCICapabilities_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 = PCI_OpenDRIM_PCICapabilities_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, "Capabilities") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "ManagedElement") != 0) return OK; CF_assert(PCI_OpenDRIM_PCICapabilities_associatorCapabilitiesToManagedElement(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "ManagedElement") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "Capabilities") != 0) return OK; CF_assert(PCI_OpenDRIM_PCICapabilities_associatorManagedElementToCapabilities(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int PCI_OpenDRIM_PCICapabilities_enumerateCapabilitiess(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, Capabilities_NAMESPACE, Capabilities_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PCI_CIM_Capabilities_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PCI_CIM_Capabilities_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PCI_CIM_Capabilities_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PCI_OpenDRIM_PCICapabilities_getCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Capabilities_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Capabilities_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_Capabilities _instance; PCI_CIM_Capabilities_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PCI_CIM_Capabilities_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PCI_CIM_Capabilities_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int PCI_OpenDRIM_PCICapabilities_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(PCI_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PCI_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PCI_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PCI_OpenDRIM_PCICapabilities_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; PCI_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PCI_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PCI_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCICapabilities/cmpiOpenDRIM_PCICapabilities.cpp0000644000175000017500000000641511400674237030650 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCICapabilities.h" CMPIObjectPath* PCI_OpenDRIM_PCICapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PCICapabilities& instance) { _E_; Objectpath op(broker, OpenDRIM_PCICapabilities_classnames[0], OpenDRIM_PCICapabilities_NAMESPACE); if (!instance.ManagedElement_isNULL) op.addKey("ManagedElement", instance.ManagedElement); if (!instance.Capabilities_isNULL) op.addKey("Capabilities", instance.Capabilities); _L_; return op.getHdl(); } CMPIInstance* PCI_OpenDRIM_PCICapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PCICapabilities& instance) { _E_; Objectpath op(broker, PCI_OpenDRIM_PCICapabilities_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.Characteristics_isNULL) ci.setProperty("Characteristics", instance.Characteristics); _L_; return ci.getHdl(); } void PCI_OpenDRIM_PCICapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PCICapabilities& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("Capabilities", instance.Capabilities) == OK) instance.Capabilities_isNULL = false; if (op.getKey("ManagedElement", instance.ManagedElement) == OK) instance.ManagedElement_isNULL = false; _L_; } void PCI_OpenDRIM_PCICapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PCICapabilities& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("ManagedElement", instance.ManagedElement) == OK) instance.ManagedElement_isNULL = false; if (inst.getProperty("Capabilities", instance.Capabilities) == OK) instance.Capabilities_isNULL = false; if (inst.getProperty("Characteristics", instance.Characteristics) == OK) instance.Characteristics_isNULL = false; _L_; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCICapabilities/cmpiOpenDRIM_PCICapabilities.h0000644000175000017500000000424311400674237030312 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_PCICAPABILITIES_H_ #define CMPIOPENDRIM_PCICAPABILITIES_H_ #include "OpenDRIM_PCICapabilities.h" CMPIObjectPath* PCI_OpenDRIM_PCICapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PCICapabilities& instance); CMPIInstance* PCI_OpenDRIM_PCICapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PCICapabilities& instance); void PCI_OpenDRIM_PCICapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PCICapabilities& instance); void PCI_OpenDRIM_PCICapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PCICapabilities& instance); #endif /*CMPIOPENDRIM_PCICAPABILITIES_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCICapabilities/OpenDRIM_PCICapabilities.h0000644000175000017500000000761511400674237027447 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PCICAPABILITIES_H_ #define OPENDRIM_PCICAPABILITIES_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_Capabilities.h" #include "CIM_CapabilitiesAccess.h" #include "cmpiCIM_ManagedElement.h" #include "CIM_ManagedElementAccess.h" */ const static char* OpenDRIM_PCICapabilities_classnames[] = {"OpenDRIM_PCICapabilities"}; static string OpenDRIM_PCICapabilities_NAMESPACE = _NAMESPACE; const static string Capabilities_role = "Capabilities"; const static char* Capabilities_classnames[] = {"OpenDRIM_EnabledPCICapabilities"}; const static string Capabilities_NAMESPACE = _NAMESPACE; const static string ManagedElement_role = "ManagedElement"; const static char* ManagedElement_classnames[] = {"OpenDRIM_PCIDevice"}; const static string ManagedElement_NAMESPACE = _NAMESPACE; class OpenDRIM_PCICapabilities { public: Objectpath ManagedElement; bool ManagedElement_isNULL; Objectpath Capabilities; bool Capabilities_isNULL; vector Characteristics; bool Characteristics_isNULL; OpenDRIM_PCICapabilities() { ManagedElement_isNULL = true; Capabilities_isNULL = true; Characteristics_isNULL = true; } ~OpenDRIM_PCICapabilities() {} string getKeys() const { return CF_toLowCase(".ManagedElement=\"" + CF_quoteString(ManagedElement.toString()) + "\""".Capabilities=\"" + CF_quoteString(Capabilities.toString()) + "\""); } int getManagedElement(Objectpath& value) const { if (ManagedElement_isNULL==true) return NOT_FOUND; value = ManagedElement; return OK; } int setManagedElement(const Objectpath& newValue) { ManagedElement = newValue; ManagedElement.setNamespace(ManagedElement_NAMESPACE); ManagedElement_isNULL = false; return OK; } int getCapabilities(Objectpath& value) const { if (Capabilities_isNULL==true) return NOT_FOUND; value = Capabilities; return OK; } int setCapabilities(const Objectpath& newValue) { Capabilities = newValue; Capabilities.setNamespace(Capabilities_NAMESPACE); Capabilities_isNULL = false; return OK; } int getCharacteristics(vector& value) const { if (Characteristics_isNULL==true) return NOT_FOUND; value = Characteristics; return OK; } int setCharacteristics(const vector& newValue) { Characteristics = newValue; Characteristics_isNULL = false; return OK; } }; #endif /*OPENDRIM_PCICAPABILITIES_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCICapabilities/OpenDRIM_PCICapabilitiesProvider.cpp0000644000175000017500000004070011400674237031505 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCICapabilities.h" #include "OpenDRIM_PCICapabilitiesAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PCI_OpenDRIM_PCICapabilitiesProviderSetInstance PCI_OpenDRIM_PCICapabilitiesProviderModifyInstance #endif int PCI_OpenDRIM_PCICapabilities_init(const CMPIBroker* broker); int PCI_OpenDRIM_PCICapabilities_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PCI_OpenDRIM_PCICapabilitiesProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_PCICapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCICapabilitiesProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PCI_OpenDRIM_PCICapabilities_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_PCICapabilities_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCICapabilitiesProviderEnumInstances(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 = PCI_OpenDRIM_PCICapabilities_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PCI_OpenDRIM_PCICapabilities_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCICapabilitiesProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCICapabilities instance; PCI_OpenDRIM_PCICapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCICapabilities_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PCI_OpenDRIM_PCICapabilities_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCICapabilitiesProviderSetInstance(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_PCICapabilities newInstance, oldInstance; PCI_OpenDRIM_PCICapabilities_toCPP(_broker, ci, newInstance); PCI_OpenDRIM_PCICapabilities_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PCI_OpenDRIM_PCICapabilities_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCICapabilities_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCICapabilitiesProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCICapabilities instance; PCI_OpenDRIM_PCICapabilities_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCICapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_PCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCICapabilities_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCICapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PCI_OpenDRIM_PCICapabilities_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCICapabilitiesProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCICapabilities instance; PCI_OpenDRIM_PCICapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCICapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCICapabilities_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCICapabilitiesProviderExecQuery(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 PCI_OpenDRIM_PCICapabilitiesProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_PCICapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCICapabilitiesProviderAssociatorNames(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 = PCI_OpenDRIM_PCICapabilities_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCICapabilities_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 PCI_OpenDRIM_PCICapabilitiesProviderAssociators(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 = PCI_OpenDRIM_PCICapabilities_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCICapabilities_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 PCI_OpenDRIM_PCICapabilitiesProviderReferenceNames(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 = PCI_OpenDRIM_PCICapabilities_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PCI_OpenDRIM_PCICapabilities_referenceCapabilitiesToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = PCI_OpenDRIM_PCICapabilities_referenceManagedElementToCapabilities(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_PCICapabilities_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCICapabilitiesProviderReferences(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 = PCI_OpenDRIM_PCICapabilities_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PCI_OpenDRIM_PCICapabilities_referenceCapabilitiesToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = PCI_OpenDRIM_PCICapabilities_referenceManagedElementToCapabilities(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = PCI_OpenDRIM_PCICapabilities_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int PCI_OpenDRIM_PCICapabilities_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PCI_OpenDRIM_PCICapabilities_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_PCICapabilities_init FAILED: " + (string) OpenDRIM_PCICapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PCI_OpenDRIM_PCICapabilities_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PCI_OpenDRIM_PCICapabilities_unload(errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_PCICapabilities_unload FAILED: " + (string) OpenDRIM_PCICapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PCI_OpenDRIM_PCICapabilities_INIT if (PCI_OpenDRIM_PCICapabilities_init(_broker) < 0) return NULL CMInstanceMIStub(PCI_OpenDRIM_PCICapabilitiesProvider, PCI_OpenDRIM_PCICapabilitiesProvider, _broker, PCI_OpenDRIM_PCICapabilities_INIT); CMAssociationMIStub(PCI_OpenDRIM_PCICapabilitiesProvider, PCI_OpenDRIM_PCICapabilitiesProvider, _broker, PCI_OpenDRIM_PCICapabilities_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCICapabilities/OpenDRIM_PCICapabilitiesAccess.cpp0000644000175000017500000002462011400674237031117 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_PCICapabilitiesAccess.h" int PCI_OpenDRIM_PCICapabilities_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PCI_CIM_Capabilities_load(broker, errorMessage)); CF_assert(PCI_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int PCI_OpenDRIM_PCICapabilities_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PCI_CIM_Capabilities_unload(errorMessage)); CF_assert(PCI_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int PCI_OpenDRIM_PCICapabilities_isAssociated(const Instance& Capabilities, const Instance& ManagedElement, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int PCI_OpenDRIM_PCICapabilities_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(PCI_OpenDRIM_PCICapabilities_enumerateCapabilitiess(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(PCI_OpenDRIM_PCICapabilities_enumerateCapabilitiess(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; PCI_OpenDRIM_PCICapabilities_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), Capabilities_classnames[0], ManagedElement_classnames[0], Capabilities_role.c_str(), ManagedElement_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(PCI_OpenDRIM_PCICapabilities_referenceCapabilitiesToManagedElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int PCI_OpenDRIM_PCICapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PCICapabilities& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath Capabilities_objectpath; instance.getCapabilities(Capabilities_objectpath); Instance Capabilities_instance; CF_assert(PCI_OpenDRIM_PCICapabilities_getCapabilities(broker, ctx, Capabilities_objectpath, Capabilities_instance, NULL, errorMessage)); Objectpath ManagedElement_objectpath; instance.getManagedElement(ManagedElement_objectpath); Instance ManagedElement_instance; CF_assert(PCI_OpenDRIM_PCICapabilities_getManagedElement(broker, ctx, ManagedElement_objectpath, ManagedElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(PCI_OpenDRIM_PCICapabilities_isAssociated(Capabilities_instance, ManagedElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } CF_assert(PCI_OpenDRIM_PCICapabilities_populate(instance, errorMessage)); _L_; return OK; } int PCI_OpenDRIM_PCICapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCICapabilities& newInstance, const OpenDRIM_PCICapabilities& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCICapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCICapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCICapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCICapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCICapabilities_associatorCapabilitiesToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Capabilities_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(PCI_OpenDRIM_PCICapabilities_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PCI_OpenDRIM_PCICapabilities_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(PCI_OpenDRIM_PCICapabilities_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); } for (size_t i=0; i& Capabilities_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector Capabilities_instances; if (discriminant=="a") CF_assert(PCI_OpenDRIM_PCICapabilities_enumerateCapabilitiess(broker, ctx, Capabilities_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PCI_OpenDRIM_PCICapabilities_enumerateCapabilitiess(broker, ctx, Capabilities_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(PCI_OpenDRIM_PCICapabilities_enumerateCapabilitiess(broker, ctx, Capabilities_instances, properties, false, errorMessage)); } for (size_t i=0; i& ManagedElement_instances, vector& OpenDRIM_PCICapabilities_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_PCICapabilities instance; instance.setCapabilities(((Instance) Capabilities_instance).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instances[i]).getObjectpath()); if (discriminant == "r") { CF_assert(PCI_OpenDRIM_PCICapabilities_populate(instance, errorMessage)); } OpenDRIM_PCICapabilities_instances.push_back(instance); } _L_; return OK; } int PCI_OpenDRIM_PCICapabilities_referenceManagedElementToCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& Capabilities_instances, vector& OpenDRIM_PCICapabilities_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 < Capabilities_instances.size(); i++) { OpenDRIM_PCICapabilities instance; instance.setCapabilities(((Instance) Capabilities_instances[i]).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instance).getObjectpath()); if (discriminant == "r") { CF_assert(PCI_OpenDRIM_PCICapabilities_populate(instance, errorMessage)); } OpenDRIM_PCICapabilities_instances.push_back(instance); } _L_; return OK; } int PCI_OpenDRIM_PCICapabilities_populate(OpenDRIM_PCICapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ComputerSystemPCIDevice/0000755000175000017500000000000011400674237024435 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ComputerSystemPCIDevice/Makefile.am0000644000175000017500000000471411400674237026477 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPCI_OpenDRIM_ComputerSystemPCIDeviceProvider.la libcmpiPCI_OpenDRIM_ComputerSystemPCIDeviceProvider_la_SOURCES = OpenDRIM_ComputerSystemPCIDeviceAccess.cpp OpenDRIM_ComputerSystemPCIDeviceProvider.cpp cmpiOpenDRIM_ComputerSystemPCIDevice.cpp assocOpenDRIM_ComputerSystemPCIDevice.cpp # May have to be adjusted for direct invocation libcmpiPCI_OpenDRIM_ComputerSystemPCIDeviceProvider_la_CPPFLAGS = -I../CIM_LogicalDevice -I../CIM_System # Uncomment the end for direct invocation, may have to be adjusted libcmpiPCI_OpenDRIM_ComputerSystemPCIDeviceProvider_la_LIBADD = ../Common/libcmpiPCI_Common.la #../CIM_LogicalDevice/libcmpiPCI_CIM_LogicalDeviceProvider.la ../CIM_System/libcmpiPCI_CIM_SystemProvider.la libcmpiPCI_OpenDRIM_ComputerSystemPCIDeviceProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_ComputerSystemPCIDevice.h OpenDRIM_ComputerSystemPCIDevice.h OpenDRIM_ComputerSystemPCIDeviceAccess.h ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ComputerSystemPCIDevice/OpenDRIM_ComputerSystemPCIDeviceAccess.hopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ComputerSystemPCIDevice/OpenDRIM_ComputerSystemPCIDeviceAccess.h0000644000175000017500000001063111400674237034045 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_COMPUTERSYSTEMPCIDEVICEACCESS_H_ #define OPENDRIM_COMPUTERSYSTEMPCIDEVICEACCESS_H_ #include "PCI_Common.h" #include "OpenDRIM_ComputerSystemPCIDevice.h" #include "assocOpenDRIM_ComputerSystemPCIDevice.h" int PCI_OpenDRIM_ComputerSystemPCIDevice_load(const CMPIBroker* broker, string& errorMessage); int PCI_OpenDRIM_ComputerSystemPCIDevice_unload(string& errorMessage); int PCI_OpenDRIM_ComputerSystemPCIDevice_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_ComputerSystemPCIDevice_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ComputerSystemPCIDevice& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_ComputerSystemPCIDevice_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemPCIDevice& newInstance, const OpenDRIM_ComputerSystemPCIDevice& oldInstance, const char** properties, string& errorMessage); int PCI_OpenDRIM_ComputerSystemPCIDevice_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemPCIDevice& instance, string& errorMessage); int PCI_OpenDRIM_ComputerSystemPCIDevice_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemPCIDevice& instance, string& errorMessage); int PCI_OpenDRIM_ComputerSystemPCIDevice_associatorPartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const char** properties, vector& GroupComponent_associatedInstances, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_ComputerSystemPCIDevice_associatorGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const char** properties, vector& PartComponent_associatedInstances, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_ComputerSystemPCIDevice_referencePartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const vector& GroupComponent_instances, vector& OpenDRIM_ComputerSystemPCIDevice_instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_ComputerSystemPCIDevice_referenceGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const vector& PartComponent_instances, vector& OpenDRIM_ComputerSystemPCIDevice_instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_ComputerSystemPCIDevice_populate(OpenDRIM_ComputerSystemPCIDevice& instance, string& errorMessage); #endif /*OPENDRIM_COMPUTERSYSTEMPCIDEVICEACCESS_H_*/ ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ComputerSystemPCIDevice/OpenDRIM_ComputerSystemPCIDeviceAccess.cppopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ComputerSystemPCIDevice/OpenDRIM_ComputerSystemPCIDeviceAccess.c0000644000175000017500000002521611400674237034045 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_ComputerSystemPCIDeviceAccess.h" int PCI_OpenDRIM_ComputerSystemPCIDevice_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PCI_CIM_LogicalDevice_load(broker, errorMessage)); CF_assert(PCI_CIM_System_load(broker, errorMessage)); */ // TODO _L_; return OK; } int PCI_OpenDRIM_ComputerSystemPCIDevice_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PCI_CIM_LogicalDevice_unload(errorMessage)); CF_assert(PCI_CIM_System_unload(errorMessage)); */ // TODO _L_; return OK; } int PCI_OpenDRIM_ComputerSystemPCIDevice_isAssociated(const Instance& PartComponent, const Instance& GroupComponent, bool& isAssociated, string& errorMessage) { _E_; // Determine if the association can be established or not string logicalDevice_classname; logicalDevice_classname = PartComponent.getClassname(); isAssociated=(logicalDevice_classname=="OpenDRIM_PCIDevice" || logicalDevice_classname=="OpenDRIM_PCIeSwitch"); _L_; return OK; } int PCI_OpenDRIM_ComputerSystemPCIDevice_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(PCI_OpenDRIM_ComputerSystemPCIDevice_enumeratePartComponents(broker, ctx, subjects, NULL, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PCI_OpenDRIM_ComputerSystemPCIDevice_enumeratePartComponents(broker, ctx, subjects, NULL, false, errorMessage)); vector::iterator c = subjects.begin(); vector::iterator end = subjects.end(); for (; c != end; ++c) { bool leftToRight = true; vector associatedInstances; PCI_OpenDRIM_ComputerSystemPCIDevice_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), PartComponent_classnames[0], GroupComponent_classnames[0], PartComponent_role.c_str(), GroupComponent_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(PCI_OpenDRIM_ComputerSystemPCIDevice_referencePartComponentToGroupComponent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int PCI_OpenDRIM_ComputerSystemPCIDevice_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ComputerSystemPCIDevice& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath PartComponent_objectpath; instance.getPartComponent(PartComponent_objectpath); Instance PartComponent_instance; CF_assert(PCI_OpenDRIM_ComputerSystemPCIDevice_getPartComponent(broker, ctx, PartComponent_objectpath, PartComponent_instance, NULL, errorMessage)); Objectpath GroupComponent_objectpath; instance.getGroupComponent(GroupComponent_objectpath); Instance GroupComponent_instance; CF_assert(PCI_OpenDRIM_ComputerSystemPCIDevice_getGroupComponent(broker, ctx, GroupComponent_objectpath, GroupComponent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(PCI_OpenDRIM_ComputerSystemPCIDevice_isAssociated(PartComponent_instance, GroupComponent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int PCI_OpenDRIM_ComputerSystemPCIDevice_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemPCIDevice& newInstance, const OpenDRIM_ComputerSystemPCIDevice& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_ComputerSystemPCIDevice_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemPCIDevice& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_ComputerSystemPCIDevice_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemPCIDevice& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_ComputerSystemPCIDevice_associatorPartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const char** properties, vector& GroupComponent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector GroupComponent_instances; if (discriminant=="a") CF_assert(PCI_OpenDRIM_ComputerSystemPCIDevice_enumerateGroupComponents(broker, ctx, GroupComponent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PCI_OpenDRIM_ComputerSystemPCIDevice_enumerateGroupComponents(broker, ctx, GroupComponent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PCI_OpenDRIM_ComputerSystemPCIDevice_enumerateGroupComponents(broker, ctx, GroupComponent_instances, properties, false, errorMessage)); } for (size_t i=0; i& PartComponent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector PartComponent_instances; if (discriminant=="a") CF_assert(PCI_OpenDRIM_ComputerSystemPCIDevice_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PCI_OpenDRIM_ComputerSystemPCIDevice_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PCI_OpenDRIM_ComputerSystemPCIDevice_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, false, errorMessage)); } for (size_t i=0; i& GroupComponent_instances, vector& OpenDRIM_ComputerSystemPCIDevice_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < GroupComponent_instances.size(); i++) { OpenDRIM_ComputerSystemPCIDevice instance; instance.setPartComponent(((Instance) PartComponent_instance).getObjectpath()); instance.setGroupComponent(((Instance) GroupComponent_instances[i]).getObjectpath()); OpenDRIM_ComputerSystemPCIDevice_instances.push_back(instance); } _L_; return OK; } int PCI_OpenDRIM_ComputerSystemPCIDevice_referenceGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const vector& PartComponent_instances, vector& OpenDRIM_ComputerSystemPCIDevice_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < PartComponent_instances.size(); i++) { OpenDRIM_ComputerSystemPCIDevice instance; instance.setPartComponent(((Instance) PartComponent_instances[i]).getObjectpath()); instance.setGroupComponent(((Instance) GroupComponent_instance).getObjectpath()); OpenDRIM_ComputerSystemPCIDevice_instances.push_back(instance); } _L_; return OK; } int PCI_OpenDRIM_ComputerSystemPCIDevice_populate(OpenDRIM_ComputerSystemPCIDevice& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ComputerSystemPCIDevice/cmpiOpenDRIM_ComputerSystemPCIDevice.h0000644000175000017500000000440311400674237033574 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_COMPUTERSYSTEMPCIDEVICE_H_ #define CMPIOPENDRIM_COMPUTERSYSTEMPCIDEVICE_H_ #include "OpenDRIM_ComputerSystemPCIDevice.h" CMPIObjectPath* PCI_OpenDRIM_ComputerSystemPCIDevice_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ComputerSystemPCIDevice& instance); CMPIInstance* PCI_OpenDRIM_ComputerSystemPCIDevice_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ComputerSystemPCIDevice& instance); void PCI_OpenDRIM_ComputerSystemPCIDevice_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ComputerSystemPCIDevice& instance); void PCI_OpenDRIM_ComputerSystemPCIDevice_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ComputerSystemPCIDevice& instance); #endif /*CMPIOPENDRIM_COMPUTERSYSTEMPCIDEVICE_H_*/ ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ComputerSystemPCIDevice/assocOpenDRIM_ComputerSystemPCIDevice.cppopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ComputerSystemPCIDevice/assocOpenDRIM_ComputerSystemPCIDevice.cp0000644000175000017500000002103311400674237034125 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_ComputerSystemPCIDevice.h" int PCI_OpenDRIM_ComputerSystemPCIDevice_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 = PCI_OpenDRIM_ComputerSystemPCIDevice_associatorFilter(broker, ctx, cop, knownInstance, assocClass, resultClass, role, resultRole, leftToRight, errorMessage); if (errorCode == -1) return OK; if (errorCode != OK) return errorCode; if (leftToRight) { if (role != NULL && strcasecmp(role, "PartComponent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "GroupComponent") != 0) return OK; CF_assert(PCI_OpenDRIM_ComputerSystemPCIDevice_associatorPartComponentToGroupComponent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "GroupComponent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "PartComponent") != 0) return OK; CF_assert(PCI_OpenDRIM_ComputerSystemPCIDevice_associatorGroupComponentToPartComponent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int PCI_OpenDRIM_ComputerSystemPCIDevice_enumeratePartComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, PartComponent_NAMESPACE, PartComponent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PCI_CIM_LogicalDevice_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PCI_CIM_LogicalDevice_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PCI_CIM_LogicalDevice_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PCI_OpenDRIM_ComputerSystemPCIDevice_getPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), PartComponent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), PartComponent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_LogicalDevice _instance; PCI_CIM_LogicalDevice_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PCI_CIM_LogicalDevice_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PCI_CIM_LogicalDevice_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int PCI_OpenDRIM_ComputerSystemPCIDevice_enumerateGroupComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, GroupComponent_NAMESPACE, GroupComponent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PCI_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PCI_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PCI_CIM_System_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PCI_OpenDRIM_ComputerSystemPCIDevice_getGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), GroupComponent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), GroupComponent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_System _instance; PCI_CIM_System_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PCI_CIM_System_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PCI_CIM_System_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ComputerSystemPCIDevice/assocOpenDRIM_ComputerSystemPCIDevice.h0000644000175000017500000000624711400674237033764 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_COMPUTERSYSTEMPCIDEVICE_H_ #define ASSOCOPENDRIM_COMPUTERSYSTEMPCIDEVICE_H_ #include "OpenDRIM_ComputerSystemPCIDeviceAccess.h" int PCI_OpenDRIM_ComputerSystemPCIDevice_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 PCI_OpenDRIM_ComputerSystemPCIDevice_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 PCI_OpenDRIM_ComputerSystemPCIDevice_enumeratePartComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PCI_OpenDRIM_ComputerSystemPCIDevice_getPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_ComputerSystemPCIDevice_enumerateGroupComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PCI_OpenDRIM_ComputerSystemPCIDevice_getGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_COMPUTERSYSTEMPCIDEVICE_H_*/ ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ComputerSystemPCIDevice/cmpiOpenDRIM_ComputerSystemPCIDevice.cppopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ComputerSystemPCIDevice/cmpiOpenDRIM_ComputerSystemPCIDevice.cpp0000644000175000017500000000623111400674237034130 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ComputerSystemPCIDevice.h" CMPIObjectPath* PCI_OpenDRIM_ComputerSystemPCIDevice_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ComputerSystemPCIDevice& instance) { _E_; Objectpath op(broker, OpenDRIM_ComputerSystemPCIDevice_classnames[0], OpenDRIM_ComputerSystemPCIDevice_NAMESPACE); if (!instance.GroupComponent_isNULL) op.addKey("GroupComponent", instance.GroupComponent); if (!instance.PartComponent_isNULL) op.addKey("PartComponent", instance.PartComponent); _L_; return op.getHdl(); } CMPIInstance* PCI_OpenDRIM_ComputerSystemPCIDevice_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ComputerSystemPCIDevice& instance) { _E_; Objectpath op(broker, PCI_OpenDRIM_ComputerSystemPCIDevice_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void PCI_OpenDRIM_ComputerSystemPCIDevice_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ComputerSystemPCIDevice& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("PartComponent", instance.PartComponent) == OK) instance.PartComponent_isNULL = false; if (op.getKey("GroupComponent", instance.GroupComponent) == OK) instance.GroupComponent_isNULL = false; _L_; } void PCI_OpenDRIM_ComputerSystemPCIDevice_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ComputerSystemPCIDevice& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("GroupComponent", instance.GroupComponent) == OK) instance.GroupComponent_isNULL = false; if (inst.getProperty("PartComponent", instance.PartComponent) == OK) instance.PartComponent_isNULL = false; _L_; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ComputerSystemPCIDevice/OpenDRIM_ComputerSystemPCIDevice.h0000644000175000017500000000713411400674237032727 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_COMPUTERSYSTEMPCIDEVICE_H_ #define OPENDRIM_COMPUTERSYSTEMPCIDEVICE_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_LogicalDevice.h" #include "CIM_LogicalDeviceAccess.h" #include "cmpiCIM_System.h" #include "CIM_SystemAccess.h" */ const static char* OpenDRIM_ComputerSystemPCIDevice_classnames[] = {"OpenDRIM_ComputerSystemPCIDevice"}; static string OpenDRIM_ComputerSystemPCIDevice_NAMESPACE = _NAMESPACE; const static string PartComponent_role = "PartComponent"; const static char* PartComponent_classnames[] = {"CIM_LogicalDevice"}; // "OpenDRIM_PCIDevice", "OpenDRIM_PCIeSwitch" const static string PartComponent_NAMESPACE = _NAMESPACE; const static string GroupComponent_role = "GroupComponent"; const static char* GroupComponent_classnames[] = {"OpenDRIM_ComputerSystem"}; const static string GroupComponent_NAMESPACE = _NAMESPACE; class OpenDRIM_ComputerSystemPCIDevice { public: Objectpath GroupComponent; bool GroupComponent_isNULL; Objectpath PartComponent; bool PartComponent_isNULL; OpenDRIM_ComputerSystemPCIDevice() { GroupComponent_isNULL = true; PartComponent_isNULL = true; } ~OpenDRIM_ComputerSystemPCIDevice() {} string getKeys() const { return CF_toLowCase(".GroupComponent=\"" + CF_quoteString(GroupComponent.toString()) + "\""".PartComponent=\"" + CF_quoteString(PartComponent.toString()) + "\""); } int getGroupComponent(Objectpath& value) const { if (GroupComponent_isNULL==true) return NOT_FOUND; value = GroupComponent; return OK; } int setGroupComponent(const Objectpath& newValue) { GroupComponent = newValue; GroupComponent.setNamespace(GroupComponent_NAMESPACE); GroupComponent_isNULL = false; return OK; } int getPartComponent(Objectpath& value) const { if (PartComponent_isNULL==true) return NOT_FOUND; value = PartComponent; return OK; } int setPartComponent(const Objectpath& newValue) { PartComponent = newValue; PartComponent.setNamespace(PartComponent_NAMESPACE); PartComponent_isNULL = false; return OK; } }; #endif /*OPENDRIM_COMPUTERSYSTEMPCIDEVICE_H_*/ ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ComputerSystemPCIDevice/OpenDRIM_ComputerSystemPCIDeviceProvider.cppopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ComputerSystemPCIDevice/OpenDRIM_ComputerSystemPCIDeviceProvider0000644000175000017500000004222411400674237034213 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ComputerSystemPCIDevice.h" #include "OpenDRIM_ComputerSystemPCIDeviceAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PCI_OpenDRIM_ComputerSystemPCIDeviceProviderSetInstance PCI_OpenDRIM_ComputerSystemPCIDeviceProviderModifyInstance #endif int PCI_OpenDRIM_ComputerSystemPCIDevice_init(const CMPIBroker* broker); int PCI_OpenDRIM_ComputerSystemPCIDevice_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PCI_OpenDRIM_ComputerSystemPCIDeviceProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_ComputerSystemPCIDevice_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_ComputerSystemPCIDeviceProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PCI_OpenDRIM_ComputerSystemPCIDevice_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_ComputerSystemPCIDevice_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_ComputerSystemPCIDeviceProviderEnumInstances(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 = PCI_OpenDRIM_ComputerSystemPCIDevice_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PCI_OpenDRIM_ComputerSystemPCIDevice_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_ComputerSystemPCIDeviceProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ComputerSystemPCIDevice instance; PCI_OpenDRIM_ComputerSystemPCIDevice_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_ComputerSystemPCIDevice_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PCI_OpenDRIM_ComputerSystemPCIDevice_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_ComputerSystemPCIDeviceProviderSetInstance(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_ComputerSystemPCIDevice newInstance, oldInstance; PCI_OpenDRIM_ComputerSystemPCIDevice_toCPP(_broker, ci, newInstance); PCI_OpenDRIM_ComputerSystemPCIDevice_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PCI_OpenDRIM_ComputerSystemPCIDevice_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_ComputerSystemPCIDevice_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_ComputerSystemPCIDeviceProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ComputerSystemPCIDevice instance; PCI_OpenDRIM_ComputerSystemPCIDevice_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PCI_OpenDRIM_ComputerSystemPCIDevice_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_ComputerSystemPCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_ComputerSystemPCIDevice_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_ComputerSystemPCIDevice_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PCI_OpenDRIM_ComputerSystemPCIDevice_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_ComputerSystemPCIDeviceProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ComputerSystemPCIDevice instance; PCI_OpenDRIM_ComputerSystemPCIDevice_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_ComputerSystemPCIDevice_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_ComputerSystemPCIDevice_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_ComputerSystemPCIDeviceProviderExecQuery(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 PCI_OpenDRIM_ComputerSystemPCIDeviceProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_ComputerSystemPCIDevice_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_ComputerSystemPCIDeviceProviderAssociatorNames(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 = PCI_OpenDRIM_ComputerSystemPCIDevice_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPCIDevice_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 PCI_OpenDRIM_ComputerSystemPCIDeviceProviderAssociators(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 = PCI_OpenDRIM_ComputerSystemPCIDevice_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPCIDevice_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 PCI_OpenDRIM_ComputerSystemPCIDeviceProviderReferenceNames(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 = PCI_OpenDRIM_ComputerSystemPCIDevice_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PCI_OpenDRIM_ComputerSystemPCIDevice_referencePartComponentToGroupComponent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = PCI_OpenDRIM_ComputerSystemPCIDevice_referenceGroupComponentToPartComponent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_ComputerSystemPCIDevice_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus PCI_OpenDRIM_ComputerSystemPCIDeviceProviderReferences(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 = PCI_OpenDRIM_ComputerSystemPCIDevice_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PCI_OpenDRIM_ComputerSystemPCIDevice_referencePartComponentToGroupComponent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = PCI_OpenDRIM_ComputerSystemPCIDevice_referenceGroupComponentToPartComponent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPCIDevice_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = PCI_OpenDRIM_ComputerSystemPCIDevice_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int PCI_OpenDRIM_ComputerSystemPCIDevice_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PCI_OpenDRIM_ComputerSystemPCIDevice_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_ComputerSystemPCIDevice_init FAILED: " + (string) OpenDRIM_ComputerSystemPCIDevice_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PCI_OpenDRIM_ComputerSystemPCIDevice_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PCI_OpenDRIM_ComputerSystemPCIDevice_unload(errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_ComputerSystemPCIDevice_unload FAILED: " + (string) OpenDRIM_ComputerSystemPCIDevice_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PCI_OpenDRIM_ComputerSystemPCIDevice_INIT if (PCI_OpenDRIM_ComputerSystemPCIDevice_init(_broker) < 0) return NULL CMInstanceMIStub(PCI_OpenDRIM_ComputerSystemPCIDeviceProvider, PCI_OpenDRIM_ComputerSystemPCIDeviceProvider, _broker, PCI_OpenDRIM_ComputerSystemPCIDevice_INIT); CMAssociationMIStub(PCI_OpenDRIM_ComputerSystemPCIDeviceProvider, PCI_OpenDRIM_ComputerSystemPCIDeviceProvider, _broker, PCI_OpenDRIM_ComputerSystemPCIDevice_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIeSwitch/0000755000175000017500000000000011400674237021720 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIeSwitch/OpenDRIM_PCIeSwitchProvider.cpp0000644000175000017500000004216611400674237027547 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIeSwitch.h" #include "OpenDRIM_PCIeSwitchAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PCI_OpenDRIM_PCIeSwitchProviderSetInstance PCI_OpenDRIM_PCIeSwitchProviderModifyInstance #endif int PCI_OpenDRIM_PCIeSwitch_init(const CMPIBroker* broker); int PCI_OpenDRIM_PCIeSwitch_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PCI_OpenDRIM_PCIeSwitchProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_PCIeSwitch_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIeSwitchProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PCI_OpenDRIM_PCIeSwitch_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_PCIeSwitch_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIeSwitchProviderEnumInstances(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 = PCI_OpenDRIM_PCIeSwitch_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PCI_OpenDRIM_PCIeSwitch_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIeSwitchProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIeSwitch instance; PCI_OpenDRIM_PCIeSwitch_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIeSwitch_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PCI_OpenDRIM_PCIeSwitch_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIeSwitchProviderSetInstance(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_PCIeSwitch newInstance, oldInstance; PCI_OpenDRIM_PCIeSwitch_toCPP(_broker, ci, newInstance); PCI_OpenDRIM_PCIeSwitch_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIeSwitch_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIeSwitch_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIeSwitchProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIeSwitch instance; PCI_OpenDRIM_PCIeSwitch_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIeSwitch_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIeSwitch_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIeSwitch_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PCI_OpenDRIM_PCIeSwitch_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIeSwitchProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIeSwitch instance; PCI_OpenDRIM_PCIeSwitch_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIeSwitch_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIeSwitch_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIeSwitchProviderExecQuery(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 PCI_OpenDRIM_PCIeSwitchProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_PCIeSwitch_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIeSwitchProviderInvokeMethod(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_PCIeSwitch instance; PCI_OpenDRIM_PCIeSwitch_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"DeviceID", "SystemCreationClassName", "SystemName", "CreationClassName"}; int errorCode = PCI_OpenDRIM_PCIeSwitch_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_PCIeSwitch_RequestStateChange_In inArgs; PCI_OpenDRIM_PCIeSwitch_toCPP(_broker, in, inArgs); OpenDRIM_PCIeSwitch_RequestStateChange_Out outArgs; errorCode = PCI_OpenDRIM_PCIeSwitch_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } PCI_OpenDRIM_PCIeSwitch_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SetPowerState") { unsigned int returnValue; OpenDRIM_PCIeSwitch_SetPowerState_In inArgs; PCI_OpenDRIM_PCIeSwitch_toCPP(_broker, in, inArgs); errorCode = PCI_OpenDRIM_PCIeSwitch_SetPowerState(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="Reset") { unsigned int returnValue; errorCode = PCI_OpenDRIM_PCIeSwitch_Reset(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="EnableDevice") { unsigned int returnValue; OpenDRIM_PCIeSwitch_EnableDevice_In inArgs; PCI_OpenDRIM_PCIeSwitch_toCPP(_broker, in, inArgs); errorCode = PCI_OpenDRIM_PCIeSwitch_EnableDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="OnlineDevice") { unsigned int returnValue; OpenDRIM_PCIeSwitch_OnlineDevice_In inArgs; PCI_OpenDRIM_PCIeSwitch_toCPP(_broker, in, inArgs); errorCode = PCI_OpenDRIM_PCIeSwitch_OnlineDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="QuiesceDevice") { unsigned int returnValue; OpenDRIM_PCIeSwitch_QuiesceDevice_In inArgs; PCI_OpenDRIM_PCIeSwitch_toCPP(_broker, in, inArgs); errorCode = PCI_OpenDRIM_PCIeSwitch_QuiesceDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SaveProperties") { unsigned int returnValue; errorCode = PCI_OpenDRIM_PCIeSwitch_SaveProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="RestoreProperties") { unsigned int returnValue; errorCode = PCI_OpenDRIM_PCIeSwitch_RestoreProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="BISTExecution") { unsigned char returnValue; errorCode = PCI_OpenDRIM_PCIeSwitch_BISTExecution(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint8, CMPI_uint8); } else { errorMessage = (string) OpenDRIM_PCIeSwitch_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 PCI_OpenDRIM_PCIeSwitch_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PCI_OpenDRIM_PCIeSwitch_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_PCIeSwitch_init FAILED: " + (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PCI_OpenDRIM_PCIeSwitch_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PCI_OpenDRIM_PCIeSwitch_unload(errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_PCIeSwitch_unload FAILED: " + (string) OpenDRIM_PCIeSwitch_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PCI_OpenDRIM_PCIeSwitch_INIT if (PCI_OpenDRIM_PCIeSwitch_init(_broker) < 0) return NULL CMInstanceMIStub(PCI_OpenDRIM_PCIeSwitchProvider, PCI_OpenDRIM_PCIeSwitchProvider, _broker, PCI_OpenDRIM_PCIeSwitch_INIT); CMMethodMIStub(PCI_OpenDRIM_PCIeSwitchProvider, PCI_OpenDRIM_PCIeSwitchProvider, _broker, PCI_OpenDRIM_PCIeSwitch_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIeSwitch/Makefile.am0000644000175000017500000000372611400674237023764 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPCI_OpenDRIM_PCIeSwitchProvider.la libcmpiPCI_OpenDRIM_PCIeSwitchProvider_la_SOURCES = OpenDRIM_PCIeSwitchAccess.cpp OpenDRIM_PCIeSwitchProvider.cpp cmpiOpenDRIM_PCIeSwitch.cpp libcmpiPCI_OpenDRIM_PCIeSwitchProvider_la_LIBADD = ../Common/libcmpiPCI_Common.la libcmpiPCI_OpenDRIM_PCIeSwitchProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_PCIeSwitch.h OpenDRIM_PCIeSwitch.h OpenDRIM_PCIeSwitchAccess.h opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIeSwitch/OpenDRIM_PCIeSwitchAccess.h0000644000175000017500000001121611400674237026613 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PCIESWITCHACCESS_H_ #define OPENDRIM_PCIESWITCHACCESS_H_ #include "PCI_Common.h" #include "OpenDRIM_PCIeSwitch.h" int PCI_OpenDRIM_PCIeSwitch_load(const CMPIBroker* broker, string& errorMessage); int PCI_OpenDRIM_PCIeSwitch_unload(string& errorMessage); int PCI_OpenDRIM_PCIeSwitch_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCIeSwitch_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PCIeSwitch& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCIeSwitch_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIeSwitch& newInstance, const OpenDRIM_PCIeSwitch& oldInstance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCIeSwitch_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIeSwitch& instance, string& errorMessage); int PCI_OpenDRIM_PCIeSwitch_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIeSwitch& instance, string& errorMessage); int PCI_OpenDRIM_PCIeSwitch_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIeSwitch& instance, unsigned int& returnValue, const OpenDRIM_PCIeSwitch_RequestStateChange_In& in, OpenDRIM_PCIeSwitch_RequestStateChange_Out& out, string& errorMessage); int PCI_OpenDRIM_PCIeSwitch_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIeSwitch& instance, unsigned int& returnValue, const OpenDRIM_PCIeSwitch_SetPowerState_In& in, string& errorMessage); int PCI_OpenDRIM_PCIeSwitch_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIeSwitch& instance, unsigned int& returnValue, string& errorMessage); int PCI_OpenDRIM_PCIeSwitch_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIeSwitch& instance, unsigned int& returnValue, const OpenDRIM_PCIeSwitch_EnableDevice_In& in, string& errorMessage); int PCI_OpenDRIM_PCIeSwitch_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIeSwitch& instance, unsigned int& returnValue, const OpenDRIM_PCIeSwitch_OnlineDevice_In& in, string& errorMessage); int PCI_OpenDRIM_PCIeSwitch_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIeSwitch& instance, unsigned int& returnValue, const OpenDRIM_PCIeSwitch_QuiesceDevice_In& in, string& errorMessage); int PCI_OpenDRIM_PCIeSwitch_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIeSwitch& instance, unsigned int& returnValue, string& errorMessage); int PCI_OpenDRIM_PCIeSwitch_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIeSwitch& instance, unsigned int& returnValue, string& errorMessage); int PCI_OpenDRIM_PCIeSwitch_BISTExecution(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIeSwitch& instance, unsigned char& returnValue, string& errorMessage); int PCI_OpenDRIM_PCIeSwitch_populate(OpenDRIM_PCIeSwitch& instance, string& errorMessage); #endif /*OPENDRIM_PCIESWITCHACCESS_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIeSwitch/OpenDRIM_PCIeSwitchAccess.cpp0000644000175000017500000001631511400674237027153 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_PCIeSwitchAccess.h" const string systemCreationClassName = "OpenDRIM_ComputerSystem"; const string creationClassName = "OpenDRIM_PCIeSwitch"; string systemName; string deviceID; int PCI_OpenDRIM_PCIeSwitch_load(const CMPIBroker* broker, string& errorMessage) { _E_; CF_assert(CF_getSystemName(systemName, errorMessage)); _L_; return OK; } int PCI_OpenDRIM_PCIeSwitch_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int PCI_OpenDRIM_PCIeSwitch_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; vector device_lines; CF_assert(CF_runCommandToLines("lspci -n", device_lines, 0, errorMessage)); vector deviceIDs; for(size_t i=0; i pcidevices_elements; string busNumber, deviceNumber, functionNumber; string command; string device; command = "lspci -d " + instance.DeviceID; CF_runCommandFL(command,device,errorMessage); instance.setElementName(device.substr(8)); CF_splitText(pcidevices_elements,device, ":."); busNumber = pcidevices_elements[0]; deviceNumber = pcidevices_elements[1]; functionNumber = pcidevices_elements[2]; //converting from string to char const char *bn, *dn, *fn; bn = busNumber.c_str(); dn = deviceNumber.c_str(); fn = functionNumber.c_str(); //converting from hex to dec instance.setBusNumber(HexToInteger(bn)); instance.setDeviceNumber(HexToInteger(dn)); instance.setFunctionNumber(HexToInteger(fn)); instance.setHealthState(0); instance.setPrimaryStatus(0); _L_; return OK; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIeSwitch/OpenDRIM_PCIeSwitch.h0000644000175000017500000007431011400674237025475 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PCIESWITCH_H_ #define OPENDRIM_PCIESWITCH_H_ #include const static char* OpenDRIM_PCIeSwitch_classnames[] = {"OpenDRIM_PCIeSwitch"}; static string OpenDRIM_PCIeSwitch_NAMESPACE = _NAMESPACE; class OpenDRIM_PCIeSwitch { public: string InstanceID; bool InstanceID_isNULL; string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string InstallDate; bool InstallDate_isNULL; string Name; bool Name_isNULL; vector OperationalStatus; bool OperationalStatus_isNULL; vector StatusDescriptions; bool StatusDescriptions_isNULL; string Status; bool Status_isNULL; unsigned short HealthState; bool HealthState_isNULL; unsigned short CommunicationStatus; bool CommunicationStatus_isNULL; unsigned short DetailedStatus; bool DetailedStatus_isNULL; unsigned short OperatingStatus; bool OperatingStatus_isNULL; unsigned short PrimaryStatus; bool PrimaryStatus_isNULL; unsigned short EnabledState; bool EnabledState_isNULL; string OtherEnabledState; bool OtherEnabledState_isNULL; unsigned short RequestedState; bool RequestedState_isNULL; unsigned short EnabledDefault; bool EnabledDefault_isNULL; string TimeOfLastStateChange; bool TimeOfLastStateChange_isNULL; vector AvailableRequestedStates; bool AvailableRequestedStates_isNULL; unsigned short TransitioningToState; bool TransitioningToState_isNULL; string SystemCreationClassName; bool SystemCreationClassName_isNULL; string SystemName; bool SystemName_isNULL; string CreationClassName; bool CreationClassName_isNULL; string DeviceID; bool DeviceID_isNULL; bool PowerManagementSupported; bool PowerManagementSupported_isNULL; vector PowerManagementCapabilities; bool PowerManagementCapabilities_isNULL; unsigned short Availability; bool Availability_isNULL; unsigned short StatusInfo; bool StatusInfo_isNULL; unsigned int LastErrorCode; bool LastErrorCode_isNULL; string ErrorDescription; bool ErrorDescription_isNULL; bool ErrorCleared; bool ErrorCleared_isNULL; vector OtherIdentifyingInfo; bool OtherIdentifyingInfo_isNULL; unsigned long long PowerOnHours; bool PowerOnHours_isNULL; unsigned long long TotalPowerOnHours; bool TotalPowerOnHours_isNULL; vector IdentifyingDescriptions; bool IdentifyingDescriptions_isNULL; vector AdditionalAvailability; bool AdditionalAvailability_isNULL; unsigned long long MaxQuiesceTime; bool MaxQuiesceTime_isNULL; string TimeOfLastReset; bool TimeOfLastReset_isNULL; unsigned short ProtocolSupported; bool ProtocolSupported_isNULL; unsigned int MaxNumberControlled; bool MaxNumberControlled_isNULL; string ProtocolDescription; bool ProtocolDescription_isNULL; unsigned short CommandRegister; bool CommandRegister_isNULL; vector Capabilities; bool Capabilities_isNULL; vector CapabilityDescriptions; bool CapabilityDescriptions_isNULL; unsigned short DeviceSelectTiming; bool DeviceSelectTiming_isNULL; unsigned char ClassCode; bool ClassCode_isNULL; unsigned char CacheLineSize; bool CacheLineSize_isNULL; unsigned char LatencyTimer; bool LatencyTimer_isNULL; unsigned short InterruptPin; bool InterruptPin_isNULL; unsigned int ExpansionROMBaseAddress; bool ExpansionROMBaseAddress_isNULL; bool SelfTestEnabled; bool SelfTestEnabled_isNULL; vector BaseAddress; bool BaseAddress_isNULL; unsigned short SubsystemID; bool SubsystemID_isNULL; unsigned short SubsystemVendorID; bool SubsystemVendorID_isNULL; unsigned char MinGrantTime; bool MinGrantTime_isNULL; unsigned char MaxLatency; bool MaxLatency_isNULL; unsigned char BusNumber; bool BusNumber_isNULL; unsigned char DeviceNumber; bool DeviceNumber_isNULL; unsigned char FunctionNumber; bool FunctionNumber_isNULL; unsigned short PCIDeviceID; bool PCIDeviceID_isNULL; unsigned short VendorID; bool VendorID_isNULL; unsigned char RevisionID; bool RevisionID_isNULL; unsigned short NumberOfPorts; bool NumberOfPorts_isNULL; vector SecondaryBusNumbers; bool SecondaryBusNumbers_isNULL; OpenDRIM_PCIeSwitch() { InstanceID_isNULL = true; Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstallDate_isNULL = true; Name_isNULL = true; OperationalStatus_isNULL = true; StatusDescriptions_isNULL = true; Status_isNULL = true; HealthState_isNULL = true; CommunicationStatus_isNULL = true; DetailedStatus_isNULL = true; OperatingStatus_isNULL = true; PrimaryStatus_isNULL = true; EnabledState_isNULL = true; OtherEnabledState_isNULL = true; RequestedState_isNULL = true; EnabledDefault_isNULL = true; TimeOfLastStateChange_isNULL = true; AvailableRequestedStates_isNULL = true; TransitioningToState_isNULL = true; SystemCreationClassName_isNULL = true; SystemName_isNULL = true; CreationClassName_isNULL = true; DeviceID_isNULL = true; PowerManagementSupported_isNULL = true; PowerManagementCapabilities_isNULL = true; Availability_isNULL = true; StatusInfo_isNULL = true; LastErrorCode_isNULL = true; ErrorDescription_isNULL = true; ErrorCleared_isNULL = true; OtherIdentifyingInfo_isNULL = true; PowerOnHours_isNULL = true; TotalPowerOnHours_isNULL = true; IdentifyingDescriptions_isNULL = true; AdditionalAvailability_isNULL = true; MaxQuiesceTime_isNULL = true; TimeOfLastReset_isNULL = true; ProtocolSupported_isNULL = true; MaxNumberControlled_isNULL = true; ProtocolDescription_isNULL = true; CommandRegister_isNULL = true; Capabilities_isNULL = true; CapabilityDescriptions_isNULL = true; DeviceSelectTiming_isNULL = true; ClassCode_isNULL = true; CacheLineSize_isNULL = true; LatencyTimer_isNULL = true; InterruptPin_isNULL = true; ExpansionROMBaseAddress_isNULL = true; SelfTestEnabled_isNULL = true; BaseAddress_isNULL = true; SubsystemID_isNULL = true; SubsystemVendorID_isNULL = true; MinGrantTime_isNULL = true; MaxLatency_isNULL = true; BusNumber_isNULL = true; DeviceNumber_isNULL = true; FunctionNumber_isNULL = true; PCIDeviceID_isNULL = true; VendorID_isNULL = true; RevisionID_isNULL = true; NumberOfPorts_isNULL = true; SecondaryBusNumbers_isNULL = true; } ~OpenDRIM_PCIeSwitch() {} string getKeys() const { return CF_toLowCase(".SystemCreationClassName=\"" + CF_quoteString(SystemCreationClassName) + "\""".SystemName=\"" + CF_quoteString(SystemName) + "\""".CreationClassName=\"" + CF_quoteString(CreationClassName) + "\""".DeviceID=\"" + CF_quoteString(DeviceID) + "\""); } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getInstallDate(string& value) const { if (InstallDate_isNULL==true) return NOT_FOUND; value = InstallDate; return OK; } int setInstallDate(const string& newValue) { InstallDate = newValue; InstallDate_isNULL = false; return OK; } int getName(string& value) const { if (Name_isNULL==true) return NOT_FOUND; value = Name; return OK; } int setName(const string& newValue) { Name = newValue; Name_isNULL = false; return OK; } int getOperationalStatus(vector& value) const { if (OperationalStatus_isNULL==true) return NOT_FOUND; value = OperationalStatus; return OK; } int setOperationalStatus(const vector& newValue) { OperationalStatus = newValue; OperationalStatus_isNULL = false; return OK; } int getStatusDescriptions(vector& value) const { if (StatusDescriptions_isNULL==true) return NOT_FOUND; value = StatusDescriptions; return OK; } int setStatusDescriptions(const vector& newValue) { StatusDescriptions = newValue; StatusDescriptions_isNULL = false; return OK; } int getStatus(string& value) const { if (Status_isNULL==true) return NOT_FOUND; value = Status; return OK; } int setStatus(const string& newValue) { Status = newValue; Status_isNULL = false; return OK; } int getHealthState(unsigned short& value) const { if (HealthState_isNULL==true) return NOT_FOUND; value = HealthState; return OK; } int setHealthState(const unsigned short& newValue) { HealthState = newValue; HealthState_isNULL = false; return OK; } int getCommunicationStatus(unsigned short& value) const { if (CommunicationStatus_isNULL==true) return NOT_FOUND; value = CommunicationStatus; return OK; } int setCommunicationStatus(const unsigned short& newValue) { CommunicationStatus = newValue; CommunicationStatus_isNULL = false; return OK; } int getDetailedStatus(unsigned short& value) const { if (DetailedStatus_isNULL==true) return NOT_FOUND; value = DetailedStatus; return OK; } int setDetailedStatus(const unsigned short& newValue) { DetailedStatus = newValue; DetailedStatus_isNULL = false; return OK; } int getOperatingStatus(unsigned short& value) const { if (OperatingStatus_isNULL==true) return NOT_FOUND; value = OperatingStatus; return OK; } int setOperatingStatus(const unsigned short& newValue) { OperatingStatus = newValue; OperatingStatus_isNULL = false; return OK; } int getPrimaryStatus(unsigned short& value) const { if (PrimaryStatus_isNULL==true) return NOT_FOUND; value = PrimaryStatus; return OK; } int setPrimaryStatus(const unsigned short& newValue) { PrimaryStatus = newValue; PrimaryStatus_isNULL = false; return OK; } int getEnabledState(unsigned short& value) const { if (EnabledState_isNULL==true) return NOT_FOUND; value = EnabledState; return OK; } int setEnabledState(const unsigned short& newValue) { EnabledState = newValue; EnabledState_isNULL = false; return OK; } int getOtherEnabledState(string& value) const { if (OtherEnabledState_isNULL==true) return NOT_FOUND; value = OtherEnabledState; return OK; } int setOtherEnabledState(const string& newValue) { OtherEnabledState = newValue; OtherEnabledState_isNULL = false; return OK; } int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL==true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getEnabledDefault(unsigned short& value) const { if (EnabledDefault_isNULL==true) return NOT_FOUND; value = EnabledDefault; return OK; } int setEnabledDefault(const unsigned short& newValue) { EnabledDefault = newValue; EnabledDefault_isNULL = false; return OK; } int getTimeOfLastStateChange(string& value) const { if (TimeOfLastStateChange_isNULL==true) return NOT_FOUND; value = TimeOfLastStateChange; return OK; } int setTimeOfLastStateChange(const string& newValue) { TimeOfLastStateChange = newValue; TimeOfLastStateChange_isNULL = false; return OK; } int getAvailableRequestedStates(vector& value) const { if (AvailableRequestedStates_isNULL==true) return NOT_FOUND; value = AvailableRequestedStates; return OK; } int setAvailableRequestedStates(const vector& newValue) { AvailableRequestedStates = newValue; AvailableRequestedStates_isNULL = false; return OK; } int getTransitioningToState(unsigned short& value) const { if (TransitioningToState_isNULL==true) return NOT_FOUND; value = TransitioningToState; return OK; } int setTransitioningToState(const unsigned short& newValue) { TransitioningToState = newValue; TransitioningToState_isNULL = false; return OK; } int getSystemCreationClassName(string& value) const { if (SystemCreationClassName_isNULL==true) return NOT_FOUND; value = SystemCreationClassName; return OK; } int setSystemCreationClassName(const string& newValue) { SystemCreationClassName = newValue; SystemCreationClassName_isNULL = false; return OK; } int getSystemName(string& value) const { if (SystemName_isNULL==true) return NOT_FOUND; value = SystemName; return OK; } int setSystemName(const string& newValue) { SystemName = newValue; SystemName_isNULL = false; return OK; } int getCreationClassName(string& value) const { if (CreationClassName_isNULL==true) return NOT_FOUND; value = CreationClassName; return OK; } int setCreationClassName(const string& newValue) { CreationClassName = newValue; CreationClassName_isNULL = false; return OK; } int getDeviceID(string& value) const { if (DeviceID_isNULL==true) return NOT_FOUND; value = DeviceID; return OK; } int setDeviceID(const string& newValue) { DeviceID = newValue; DeviceID_isNULL = false; return OK; } int getPowerManagementSupported(bool& value) const { if (PowerManagementSupported_isNULL==true) return NOT_FOUND; value = PowerManagementSupported; return OK; } int setPowerManagementSupported(const bool& newValue) { PowerManagementSupported = newValue; PowerManagementSupported_isNULL = false; return OK; } int getPowerManagementCapabilities(vector& value) const { if (PowerManagementCapabilities_isNULL==true) return NOT_FOUND; value = PowerManagementCapabilities; return OK; } int setPowerManagementCapabilities(const vector& newValue) { PowerManagementCapabilities = newValue; PowerManagementCapabilities_isNULL = false; return OK; } int getAvailability(unsigned short& value) const { if (Availability_isNULL==true) return NOT_FOUND; value = Availability; return OK; } int setAvailability(const unsigned short& newValue) { Availability = newValue; Availability_isNULL = false; return OK; } int getStatusInfo(unsigned short& value) const { if (StatusInfo_isNULL==true) return NOT_FOUND; value = StatusInfo; return OK; } int setStatusInfo(const unsigned short& newValue) { StatusInfo = newValue; StatusInfo_isNULL = false; return OK; } int getLastErrorCode(unsigned int& value) const { if (LastErrorCode_isNULL==true) return NOT_FOUND; value = LastErrorCode; return OK; } int setLastErrorCode(const unsigned int& newValue) { LastErrorCode = newValue; LastErrorCode_isNULL = false; return OK; } int getErrorDescription(string& value) const { if (ErrorDescription_isNULL==true) return NOT_FOUND; value = ErrorDescription; return OK; } int setErrorDescription(const string& newValue) { ErrorDescription = newValue; ErrorDescription_isNULL = false; return OK; } int getErrorCleared(bool& value) const { if (ErrorCleared_isNULL==true) return NOT_FOUND; value = ErrorCleared; return OK; } int setErrorCleared(const bool& newValue) { ErrorCleared = newValue; ErrorCleared_isNULL = false; return OK; } int getOtherIdentifyingInfo(vector& value) const { if (OtherIdentifyingInfo_isNULL==true) return NOT_FOUND; value = OtherIdentifyingInfo; return OK; } int setOtherIdentifyingInfo(const vector& newValue) { OtherIdentifyingInfo = newValue; OtherIdentifyingInfo_isNULL = false; return OK; } int getPowerOnHours(unsigned long long& value) const { if (PowerOnHours_isNULL==true) return NOT_FOUND; value = PowerOnHours; return OK; } int setPowerOnHours(const unsigned long long& newValue) { PowerOnHours = newValue; PowerOnHours_isNULL = false; return OK; } int getTotalPowerOnHours(unsigned long long& value) const { if (TotalPowerOnHours_isNULL==true) return NOT_FOUND; value = TotalPowerOnHours; return OK; } int setTotalPowerOnHours(const unsigned long long& newValue) { TotalPowerOnHours = newValue; TotalPowerOnHours_isNULL = false; return OK; } int getIdentifyingDescriptions(vector& value) const { if (IdentifyingDescriptions_isNULL==true) return NOT_FOUND; value = IdentifyingDescriptions; return OK; } int setIdentifyingDescriptions(const vector& newValue) { IdentifyingDescriptions = newValue; IdentifyingDescriptions_isNULL = false; return OK; } int getAdditionalAvailability(vector& value) const { if (AdditionalAvailability_isNULL==true) return NOT_FOUND; value = AdditionalAvailability; return OK; } int setAdditionalAvailability(const vector& newValue) { AdditionalAvailability = newValue; AdditionalAvailability_isNULL = false; return OK; } int getMaxQuiesceTime(unsigned long long& value) const { if (MaxQuiesceTime_isNULL==true) return NOT_FOUND; value = MaxQuiesceTime; return OK; } int setMaxQuiesceTime(const unsigned long long& newValue) { MaxQuiesceTime = newValue; MaxQuiesceTime_isNULL = false; return OK; } int getTimeOfLastReset(string& value) const { if (TimeOfLastReset_isNULL==true) return NOT_FOUND; value = TimeOfLastReset; return OK; } int setTimeOfLastReset(const string& newValue) { TimeOfLastReset = newValue; TimeOfLastReset_isNULL = false; return OK; } int getProtocolSupported(unsigned short& value) const { if (ProtocolSupported_isNULL==true) return NOT_FOUND; value = ProtocolSupported; return OK; } int setProtocolSupported(const unsigned short& newValue) { ProtocolSupported = newValue; ProtocolSupported_isNULL = false; return OK; } int getMaxNumberControlled(unsigned int& value) const { if (MaxNumberControlled_isNULL==true) return NOT_FOUND; value = MaxNumberControlled; return OK; } int setMaxNumberControlled(const unsigned int& newValue) { MaxNumberControlled = newValue; MaxNumberControlled_isNULL = false; return OK; } int getProtocolDescription(string& value) const { if (ProtocolDescription_isNULL==true) return NOT_FOUND; value = ProtocolDescription; return OK; } int setProtocolDescription(const string& newValue) { ProtocolDescription = newValue; ProtocolDescription_isNULL = false; return OK; } int getCommandRegister(unsigned short& value) const { if (CommandRegister_isNULL==true) return NOT_FOUND; value = CommandRegister; return OK; } int setCommandRegister(const unsigned short& newValue) { CommandRegister = newValue; CommandRegister_isNULL = false; return OK; } int getCapabilities(vector& value) const { if (Capabilities_isNULL==true) return NOT_FOUND; value = Capabilities; return OK; } int setCapabilities(const vector& newValue) { Capabilities = newValue; Capabilities_isNULL = false; return OK; } int getCapabilityDescriptions(vector& value) const { if (CapabilityDescriptions_isNULL==true) return NOT_FOUND; value = CapabilityDescriptions; return OK; } int setCapabilityDescriptions(const vector& newValue) { CapabilityDescriptions = newValue; CapabilityDescriptions_isNULL = false; return OK; } int getDeviceSelectTiming(unsigned short& value) const { if (DeviceSelectTiming_isNULL==true) return NOT_FOUND; value = DeviceSelectTiming; return OK; } int setDeviceSelectTiming(const unsigned short& newValue) { DeviceSelectTiming = newValue; DeviceSelectTiming_isNULL = false; return OK; } int getClassCode(unsigned char& value) const { if (ClassCode_isNULL==true) return NOT_FOUND; value = ClassCode; return OK; } int setClassCode(const unsigned char& newValue) { ClassCode = newValue; ClassCode_isNULL = false; return OK; } int getCacheLineSize(unsigned char& value) const { if (CacheLineSize_isNULL==true) return NOT_FOUND; value = CacheLineSize; return OK; } int setCacheLineSize(const unsigned char& newValue) { CacheLineSize = newValue; CacheLineSize_isNULL = false; return OK; } int getLatencyTimer(unsigned char& value) const { if (LatencyTimer_isNULL==true) return NOT_FOUND; value = LatencyTimer; return OK; } int setLatencyTimer(const unsigned char& newValue) { LatencyTimer = newValue; LatencyTimer_isNULL = false; return OK; } int getInterruptPin(unsigned short& value) const { if (InterruptPin_isNULL==true) return NOT_FOUND; value = InterruptPin; return OK; } int setInterruptPin(const unsigned short& newValue) { InterruptPin = newValue; InterruptPin_isNULL = false; return OK; } int getExpansionROMBaseAddress(unsigned int& value) const { if (ExpansionROMBaseAddress_isNULL==true) return NOT_FOUND; value = ExpansionROMBaseAddress; return OK; } int setExpansionROMBaseAddress(const unsigned int& newValue) { ExpansionROMBaseAddress = newValue; ExpansionROMBaseAddress_isNULL = false; return OK; } int getSelfTestEnabled(bool& value) const { if (SelfTestEnabled_isNULL==true) return NOT_FOUND; value = SelfTestEnabled; return OK; } int setSelfTestEnabled(const bool& newValue) { SelfTestEnabled = newValue; SelfTestEnabled_isNULL = false; return OK; } int getBaseAddress(vector& value) const { if (BaseAddress_isNULL==true) return NOT_FOUND; value = BaseAddress; return OK; } int setBaseAddress(const vector& newValue) { BaseAddress = newValue; BaseAddress_isNULL = false; return OK; } int getSubsystemID(unsigned short& value) const { if (SubsystemID_isNULL==true) return NOT_FOUND; value = SubsystemID; return OK; } int setSubsystemID(const unsigned short& newValue) { SubsystemID = newValue; SubsystemID_isNULL = false; return OK; } int getSubsystemVendorID(unsigned short& value) const { if (SubsystemVendorID_isNULL==true) return NOT_FOUND; value = SubsystemVendorID; return OK; } int setSubsystemVendorID(const unsigned short& newValue) { SubsystemVendorID = newValue; SubsystemVendorID_isNULL = false; return OK; } int getMinGrantTime(unsigned char& value) const { if (MinGrantTime_isNULL==true) return NOT_FOUND; value = MinGrantTime; return OK; } int setMinGrantTime(const unsigned char& newValue) { MinGrantTime = newValue; MinGrantTime_isNULL = false; return OK; } int getMaxLatency(unsigned char& value) const { if (MaxLatency_isNULL==true) return NOT_FOUND; value = MaxLatency; return OK; } int setMaxLatency(const unsigned char& newValue) { MaxLatency = newValue; MaxLatency_isNULL = false; return OK; } int getBusNumber(unsigned char& value) const { if (BusNumber_isNULL==true) return NOT_FOUND; value = BusNumber; return OK; } int setBusNumber(const unsigned char& newValue) { BusNumber = newValue; BusNumber_isNULL = false; return OK; } int getDeviceNumber(unsigned char& value) const { if (DeviceNumber_isNULL==true) return NOT_FOUND; value = DeviceNumber; return OK; } int setDeviceNumber(const unsigned char& newValue) { DeviceNumber = newValue; DeviceNumber_isNULL = false; return OK; } int getFunctionNumber(unsigned char& value) const { if (FunctionNumber_isNULL==true) return NOT_FOUND; value = FunctionNumber; return OK; } int setFunctionNumber(const unsigned char& newValue) { FunctionNumber = newValue; FunctionNumber_isNULL = false; return OK; } int getPCIDeviceID(unsigned short& value) const { if (PCIDeviceID_isNULL==true) return NOT_FOUND; value = PCIDeviceID; return OK; } int setPCIDeviceID(const unsigned short& newValue) { PCIDeviceID = newValue; PCIDeviceID_isNULL = false; return OK; } int getVendorID(unsigned short& value) const { if (VendorID_isNULL==true) return NOT_FOUND; value = VendorID; return OK; } int setVendorID(const unsigned short& newValue) { VendorID = newValue; VendorID_isNULL = false; return OK; } int getRevisionID(unsigned char& value) const { if (RevisionID_isNULL==true) return NOT_FOUND; value = RevisionID; return OK; } int setRevisionID(const unsigned char& newValue) { RevisionID = newValue; RevisionID_isNULL = false; return OK; } int getNumberOfPorts(unsigned short& value) const { if (NumberOfPorts_isNULL==true) return NOT_FOUND; value = NumberOfPorts; return OK; } int setNumberOfPorts(const unsigned short& newValue) { NumberOfPorts = newValue; NumberOfPorts_isNULL = false; return OK; } int getSecondaryBusNumbers(vector& value) const { if (SecondaryBusNumbers_isNULL==true) return NOT_FOUND; value = SecondaryBusNumbers; return OK; } int setSecondaryBusNumbers(const vector& newValue) { SecondaryBusNumbers = newValue; SecondaryBusNumbers_isNULL = false; return OK; } }; class OpenDRIM_PCIeSwitch_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_PCIeSwitch_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_PCIeSwitch_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_PCIeSwitch_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_PCIeSwitch_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_PCIeSwitch_RequestStateChange_Out() {} int getJob(Objectpath& value) const { if (Job_isNULL == true) return NOT_FOUND; value = Job; return OK; } int setJob(const Objectpath& newValue) { Job = newValue; Job_isNULL = false; return OK; } }; class OpenDRIM_PCIeSwitch_SetPowerState_In { public: unsigned short PowerState; bool PowerState_isNULL; string Time; bool Time_isNULL; OpenDRIM_PCIeSwitch_SetPowerState_In() { PowerState_isNULL = true; Time_isNULL = true; } ~OpenDRIM_PCIeSwitch_SetPowerState_In() {} int getPowerState(unsigned short& value) const { if (PowerState_isNULL == true) return NOT_FOUND; value = PowerState; return OK; } int setPowerState(const unsigned short& newValue) { PowerState = newValue; PowerState_isNULL = false; return OK; } int getTime(string& value) const { if (Time_isNULL == true) return NOT_FOUND; value = Time; return OK; } int setTime(const string& newValue) { Time = newValue; Time_isNULL = false; return OK; } }; class OpenDRIM_PCIeSwitch_EnableDevice_In { public: bool Enabled; bool Enabled_isNULL; OpenDRIM_PCIeSwitch_EnableDevice_In() { Enabled_isNULL = true; } ~OpenDRIM_PCIeSwitch_EnableDevice_In() {} int getEnabled(bool& value) const { if (Enabled_isNULL == true) return NOT_FOUND; value = Enabled; return OK; } int setEnabled(const bool& newValue) { Enabled = newValue; Enabled_isNULL = false; return OK; } }; class OpenDRIM_PCIeSwitch_OnlineDevice_In { public: bool Online; bool Online_isNULL; OpenDRIM_PCIeSwitch_OnlineDevice_In() { Online_isNULL = true; } ~OpenDRIM_PCIeSwitch_OnlineDevice_In() {} int getOnline(bool& value) const { if (Online_isNULL == true) return NOT_FOUND; value = Online; return OK; } int setOnline(const bool& newValue) { Online = newValue; Online_isNULL = false; return OK; } }; class OpenDRIM_PCIeSwitch_QuiesceDevice_In { public: bool Quiesce; bool Quiesce_isNULL; OpenDRIM_PCIeSwitch_QuiesceDevice_In() { Quiesce_isNULL = true; } ~OpenDRIM_PCIeSwitch_QuiesceDevice_In() {} int getQuiesce(bool& value) const { if (Quiesce_isNULL == true) return NOT_FOUND; value = Quiesce; return OK; } int setQuiesce(const bool& newValue) { Quiesce = newValue; Quiesce_isNULL = false; return OK; } }; #endif /*OPENDRIM_PCIESWITCH_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIeSwitch/cmpiOpenDRIM_PCIeSwitch.h0000644000175000017500000000555711400674237026355 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_PCIESWITCH_H_ #define CMPIOPENDRIM_PCIESWITCH_H_ #include "OpenDRIM_PCIeSwitch.h" CMPIObjectPath* PCI_OpenDRIM_PCIeSwitch_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PCIeSwitch& instance); CMPIInstance* PCI_OpenDRIM_PCIeSwitch_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PCIeSwitch& instance); void PCI_OpenDRIM_PCIeSwitch_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PCIeSwitch& instance); void PCI_OpenDRIM_PCIeSwitch_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PCIeSwitch& instance); void PCI_OpenDRIM_PCIeSwitch_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIeSwitch_RequestStateChange_In& args); void PCI_OpenDRIM_PCIeSwitch_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_PCIeSwitch_RequestStateChange_Out& args); void PCI_OpenDRIM_PCIeSwitch_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIeSwitch_SetPowerState_In& args); void PCI_OpenDRIM_PCIeSwitch_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIeSwitch_EnableDevice_In& args); void PCI_OpenDRIM_PCIeSwitch_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIeSwitch_OnlineDevice_In& args); void PCI_OpenDRIM_PCIeSwitch_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIeSwitch_QuiesceDevice_In& args); #endif /*CMPIOPENDRIM_PCIESWITCH_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIeSwitch/cmpiOpenDRIM_PCIeSwitch.cpp0000644000175000017500000004613011400674237026700 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIeSwitch.h" CMPIObjectPath* PCI_OpenDRIM_PCIeSwitch_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PCIeSwitch& instance) { _E_; Objectpath op(broker, OpenDRIM_PCIeSwitch_classnames[0], OpenDRIM_PCIeSwitch_NAMESPACE); if (!instance.SystemCreationClassName_isNULL) op.addKey("SystemCreationClassName", instance.SystemCreationClassName); if (!instance.SystemName_isNULL) op.addKey("SystemName", instance.SystemName); if (!instance.CreationClassName_isNULL) op.addKey("CreationClassName", instance.CreationClassName); if (!instance.DeviceID_isNULL) op.addKey("DeviceID", instance.DeviceID); _L_; return op.getHdl(); } CMPIInstance* PCI_OpenDRIM_PCIeSwitch_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PCIeSwitch& instance) { _E_; Objectpath op(broker, PCI_OpenDRIM_PCIeSwitch_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.InstanceID_isNULL) ci.setProperty("InstanceID", instance.InstanceID); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.InstallDate_isNULL) ci.setPropertyDatetime("InstallDate", instance.InstallDate); if (!instance.Name_isNULL) ci.setProperty("Name", instance.Name); if (!instance.OperationalStatus_isNULL) ci.setProperty("OperationalStatus", instance.OperationalStatus); if (!instance.StatusDescriptions_isNULL) ci.setProperty("StatusDescriptions", instance.StatusDescriptions); if (!instance.Status_isNULL) ci.setProperty("Status", instance.Status); if (!instance.HealthState_isNULL) ci.setProperty("HealthState", instance.HealthState); if (!instance.CommunicationStatus_isNULL) ci.setProperty("CommunicationStatus", instance.CommunicationStatus); if (!instance.DetailedStatus_isNULL) ci.setProperty("DetailedStatus", instance.DetailedStatus); if (!instance.OperatingStatus_isNULL) ci.setProperty("OperatingStatus", instance.OperatingStatus); if (!instance.PrimaryStatus_isNULL) ci.setProperty("PrimaryStatus", instance.PrimaryStatus); if (!instance.EnabledState_isNULL) ci.setProperty("EnabledState", instance.EnabledState); if (!instance.OtherEnabledState_isNULL) ci.setProperty("OtherEnabledState", instance.OtherEnabledState); if (!instance.RequestedState_isNULL) ci.setProperty("RequestedState", instance.RequestedState); if (!instance.EnabledDefault_isNULL) ci.setProperty("EnabledDefault", instance.EnabledDefault); if (!instance.TimeOfLastStateChange_isNULL) ci.setPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange); if (!instance.AvailableRequestedStates_isNULL) ci.setProperty("AvailableRequestedStates", instance.AvailableRequestedStates); if (!instance.TransitioningToState_isNULL) ci.setProperty("TransitioningToState", instance.TransitioningToState); if (!instance.PowerManagementSupported_isNULL) ci.setProperty("PowerManagementSupported", instance.PowerManagementSupported); if (!instance.PowerManagementCapabilities_isNULL) ci.setProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities); if (!instance.Availability_isNULL) ci.setProperty("Availability", instance.Availability); if (!instance.StatusInfo_isNULL) ci.setProperty("StatusInfo", instance.StatusInfo); if (!instance.LastErrorCode_isNULL) ci.setProperty("LastErrorCode", instance.LastErrorCode); if (!instance.ErrorDescription_isNULL) ci.setProperty("ErrorDescription", instance.ErrorDescription); if (!instance.ErrorCleared_isNULL) ci.setProperty("ErrorCleared", instance.ErrorCleared); if (!instance.OtherIdentifyingInfo_isNULL) ci.setProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo); if (!instance.PowerOnHours_isNULL) ci.setProperty("PowerOnHours", instance.PowerOnHours); if (!instance.TotalPowerOnHours_isNULL) ci.setProperty("TotalPowerOnHours", instance.TotalPowerOnHours); if (!instance.IdentifyingDescriptions_isNULL) ci.setProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions); if (!instance.AdditionalAvailability_isNULL) ci.setProperty("AdditionalAvailability", instance.AdditionalAvailability); if (!instance.MaxQuiesceTime_isNULL) ci.setProperty("MaxQuiesceTime", instance.MaxQuiesceTime); if (!instance.TimeOfLastReset_isNULL) ci.setPropertyDatetime("TimeOfLastReset", instance.TimeOfLastReset); if (!instance.ProtocolSupported_isNULL) ci.setProperty("ProtocolSupported", instance.ProtocolSupported); if (!instance.MaxNumberControlled_isNULL) ci.setProperty("MaxNumberControlled", instance.MaxNumberControlled); if (!instance.ProtocolDescription_isNULL) ci.setProperty("ProtocolDescription", instance.ProtocolDescription); if (!instance.CommandRegister_isNULL) ci.setProperty("CommandRegister", instance.CommandRegister); if (!instance.Capabilities_isNULL) ci.setProperty("Capabilities", instance.Capabilities); if (!instance.CapabilityDescriptions_isNULL) ci.setProperty("CapabilityDescriptions", instance.CapabilityDescriptions); if (!instance.DeviceSelectTiming_isNULL) ci.setProperty("DeviceSelectTiming", instance.DeviceSelectTiming); if (!instance.ClassCode_isNULL) ci.setProperty("ClassCode", instance.ClassCode); if (!instance.CacheLineSize_isNULL) ci.setProperty("CacheLineSize", instance.CacheLineSize); if (!instance.LatencyTimer_isNULL) ci.setProperty("LatencyTimer", instance.LatencyTimer); if (!instance.InterruptPin_isNULL) ci.setProperty("InterruptPin", instance.InterruptPin); if (!instance.ExpansionROMBaseAddress_isNULL) ci.setProperty("ExpansionROMBaseAddress", instance.ExpansionROMBaseAddress); if (!instance.SelfTestEnabled_isNULL) ci.setProperty("SelfTestEnabled", instance.SelfTestEnabled); if (!instance.BaseAddress_isNULL) ci.setProperty("BaseAddress", instance.BaseAddress); if (!instance.SubsystemID_isNULL) ci.setProperty("SubsystemID", instance.SubsystemID); if (!instance.SubsystemVendorID_isNULL) ci.setProperty("SubsystemVendorID", instance.SubsystemVendorID); if (!instance.MinGrantTime_isNULL) ci.setProperty("MinGrantTime", instance.MinGrantTime); if (!instance.MaxLatency_isNULL) ci.setProperty("MaxLatency", instance.MaxLatency); if (!instance.BusNumber_isNULL) ci.setProperty("BusNumber", instance.BusNumber); if (!instance.DeviceNumber_isNULL) ci.setProperty("DeviceNumber", instance.DeviceNumber); if (!instance.FunctionNumber_isNULL) ci.setProperty("FunctionNumber", instance.FunctionNumber); if (!instance.PCIDeviceID_isNULL) ci.setProperty("PCIDeviceID", instance.PCIDeviceID); if (!instance.VendorID_isNULL) ci.setProperty("VendorID", instance.VendorID); if (!instance.RevisionID_isNULL) ci.setProperty("RevisionID", instance.RevisionID); if (!instance.NumberOfPorts_isNULL) ci.setProperty("NumberOfPorts", instance.NumberOfPorts); if (!instance.SecondaryBusNumbers_isNULL) ci.setProperty("SecondaryBusNumbers", instance.SecondaryBusNumbers); _L_; return ci.getHdl(); } void PCI_OpenDRIM_PCIeSwitch_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PCIeSwitch& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (op.getKey("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (op.getKey("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (op.getKey("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; _L_; } void PCI_OpenDRIM_PCIeSwitch_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PCIeSwitch& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getPropertyDatetime("InstallDate", instance.InstallDate) == OK) instance.InstallDate_isNULL = false; if (inst.getProperty("Name", instance.Name) == OK) instance.Name_isNULL = false; if (inst.getProperty("OperationalStatus", instance.OperationalStatus) == OK) instance.OperationalStatus_isNULL = false; if (inst.getProperty("StatusDescriptions", instance.StatusDescriptions) == OK) instance.StatusDescriptions_isNULL = false; if (inst.getProperty("Status", instance.Status) == OK) instance.Status_isNULL = false; if (inst.getProperty("HealthState", instance.HealthState) == OK) instance.HealthState_isNULL = false; if (inst.getProperty("CommunicationStatus", instance.CommunicationStatus) == OK) instance.CommunicationStatus_isNULL = false; if (inst.getProperty("DetailedStatus", instance.DetailedStatus) == OK) instance.DetailedStatus_isNULL = false; if (inst.getProperty("OperatingStatus", instance.OperatingStatus) == OK) instance.OperatingStatus_isNULL = false; if (inst.getProperty("PrimaryStatus", instance.PrimaryStatus) == OK) instance.PrimaryStatus_isNULL = false; if (inst.getProperty("EnabledState", instance.EnabledState) == OK) instance.EnabledState_isNULL = false; if (inst.getProperty("OtherEnabledState", instance.OtherEnabledState) == OK) instance.OtherEnabledState_isNULL = false; if (inst.getProperty("RequestedState", instance.RequestedState) == OK) instance.RequestedState_isNULL = false; if (inst.getProperty("EnabledDefault", instance.EnabledDefault) == OK) instance.EnabledDefault_isNULL = false; if (inst.getPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange) == OK) instance.TimeOfLastStateChange_isNULL = false; if (inst.getProperty("AvailableRequestedStates", instance.AvailableRequestedStates) == OK) instance.AvailableRequestedStates_isNULL = false; if (inst.getProperty("TransitioningToState", instance.TransitioningToState) == OK) instance.TransitioningToState_isNULL = false; if (inst.getProperty("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (inst.getProperty("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (inst.getProperty("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; if (inst.getProperty("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (inst.getProperty("PowerManagementSupported", instance.PowerManagementSupported) == OK) instance.PowerManagementSupported_isNULL = false; if (inst.getProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities) == OK) instance.PowerManagementCapabilities_isNULL = false; if (inst.getProperty("Availability", instance.Availability) == OK) instance.Availability_isNULL = false; if (inst.getProperty("StatusInfo", instance.StatusInfo) == OK) instance.StatusInfo_isNULL = false; if (inst.getProperty("LastErrorCode", instance.LastErrorCode) == OK) instance.LastErrorCode_isNULL = false; if (inst.getProperty("ErrorDescription", instance.ErrorDescription) == OK) instance.ErrorDescription_isNULL = false; if (inst.getProperty("ErrorCleared", instance.ErrorCleared) == OK) instance.ErrorCleared_isNULL = false; if (inst.getProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo) == OK) instance.OtherIdentifyingInfo_isNULL = false; if (inst.getProperty("PowerOnHours", instance.PowerOnHours) == OK) instance.PowerOnHours_isNULL = false; if (inst.getProperty("TotalPowerOnHours", instance.TotalPowerOnHours) == OK) instance.TotalPowerOnHours_isNULL = false; if (inst.getProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions) == OK) instance.IdentifyingDescriptions_isNULL = false; if (inst.getProperty("AdditionalAvailability", instance.AdditionalAvailability) == OK) instance.AdditionalAvailability_isNULL = false; if (inst.getProperty("MaxQuiesceTime", instance.MaxQuiesceTime) == OK) instance.MaxQuiesceTime_isNULL = false; if (inst.getPropertyDatetime("TimeOfLastReset", instance.TimeOfLastReset) == OK) instance.TimeOfLastReset_isNULL = false; if (inst.getProperty("ProtocolSupported", instance.ProtocolSupported) == OK) instance.ProtocolSupported_isNULL = false; if (inst.getProperty("MaxNumberControlled", instance.MaxNumberControlled) == OK) instance.MaxNumberControlled_isNULL = false; if (inst.getProperty("ProtocolDescription", instance.ProtocolDescription) == OK) instance.ProtocolDescription_isNULL = false; if (inst.getProperty("CommandRegister", instance.CommandRegister) == OK) instance.CommandRegister_isNULL = false; if (inst.getProperty("Capabilities", instance.Capabilities) == OK) instance.Capabilities_isNULL = false; if (inst.getProperty("CapabilityDescriptions", instance.CapabilityDescriptions) == OK) instance.CapabilityDescriptions_isNULL = false; if (inst.getProperty("DeviceSelectTiming", instance.DeviceSelectTiming) == OK) instance.DeviceSelectTiming_isNULL = false; if (inst.getProperty("ClassCode", instance.ClassCode) == OK) instance.ClassCode_isNULL = false; if (inst.getProperty("CacheLineSize", instance.CacheLineSize) == OK) instance.CacheLineSize_isNULL = false; if (inst.getProperty("LatencyTimer", instance.LatencyTimer) == OK) instance.LatencyTimer_isNULL = false; if (inst.getProperty("InterruptPin", instance.InterruptPin) == OK) instance.InterruptPin_isNULL = false; if (inst.getProperty("ExpansionROMBaseAddress", instance.ExpansionROMBaseAddress) == OK) instance.ExpansionROMBaseAddress_isNULL = false; if (inst.getProperty("SelfTestEnabled", instance.SelfTestEnabled) == OK) instance.SelfTestEnabled_isNULL = false; if (inst.getProperty("BaseAddress", instance.BaseAddress) == OK) instance.BaseAddress_isNULL = false; if (inst.getProperty("SubsystemID", instance.SubsystemID) == OK) instance.SubsystemID_isNULL = false; if (inst.getProperty("SubsystemVendorID", instance.SubsystemVendorID) == OK) instance.SubsystemVendorID_isNULL = false; if (inst.getProperty("MinGrantTime", instance.MinGrantTime) == OK) instance.MinGrantTime_isNULL = false; if (inst.getProperty("MaxLatency", instance.MaxLatency) == OK) instance.MaxLatency_isNULL = false; if (inst.getProperty("BusNumber", instance.BusNumber) == OK) instance.BusNumber_isNULL = false; if (inst.getProperty("DeviceNumber", instance.DeviceNumber) == OK) instance.DeviceNumber_isNULL = false; if (inst.getProperty("FunctionNumber", instance.FunctionNumber) == OK) instance.FunctionNumber_isNULL = false; if (inst.getProperty("PCIDeviceID", instance.PCIDeviceID) == OK) instance.PCIDeviceID_isNULL = false; if (inst.getProperty("VendorID", instance.VendorID) == OK) instance.VendorID_isNULL = false; if (inst.getProperty("RevisionID", instance.RevisionID) == OK) instance.RevisionID_isNULL = false; if (inst.getProperty("NumberOfPorts", instance.NumberOfPorts) == OK) instance.NumberOfPorts_isNULL = false; if (inst.getProperty("SecondaryBusNumbers", instance.SecondaryBusNumbers) == OK) instance.SecondaryBusNumbers_isNULL = false; _L_; } void PCI_OpenDRIM_PCIeSwitch_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIeSwitch_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 PCI_OpenDRIM_PCIeSwitch_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_PCIeSwitch_RequestStateChange_Out& args) { _E_; CMPIValue value; int errorMessage; Objectpath Job; errorMessage = args.getJob(Job); if (errorMessage == OK) { value = CT_toCMPI(Job); out->ft->addArg(out, "Job", &value, CMPI_ref); } _L_; } void PCI_OpenDRIM_PCIeSwitch_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIeSwitch_SetPowerState_In& args) { _E_; CMPIStatus rc; CMPIData data; unsigned short PowerState; data = in->ft->getArg(in, "PowerState", &rc); if (rc.rc == OK) { CT_ToC(data, PowerState); args.setPowerState(PowerState); } string Time; data = in->ft->getArg(in, "Time", &rc); if (rc.rc == OK) { CT_ToCDatetime(data, Time); args.setTime(Time); } _L_; } void PCI_OpenDRIM_PCIeSwitch_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIeSwitch_EnableDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Enabled; data = in->ft->getArg(in, "Enabled", &rc); if (rc.rc == OK) { CT_ToC(data, Enabled); args.setEnabled(Enabled); } _L_; } void PCI_OpenDRIM_PCIeSwitch_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIeSwitch_OnlineDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Online; data = in->ft->getArg(in, "Online", &rc); if (rc.rc == OK) { CT_ToC(data, Online); args.setOnline(Online); } _L_; } void PCI_OpenDRIM_PCIeSwitch_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIeSwitch_QuiesceDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Quiesce; data = in->ft->getArg(in, "Quiesce", &rc); if (rc.rc == OK) { CT_ToC(data, Quiesce); args.setQuiesce(Quiesce); } _L_; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceControlledByPCIPort/0000755000175000017500000000000011400674237025233 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceControlledByPCIPort/Makefile.am0000644000175000017500000000502411400674237027270 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPCI_OpenDRIM_PCIDeviceControlledByPCIPortProvider.la libcmpiPCI_OpenDRIM_PCIDeviceControlledByPCIPortProvider_la_SOURCES = OpenDRIM_PCIDeviceControlledByPCIPortAccess.cpp OpenDRIM_PCIDeviceControlledByPCIPortProvider.cpp cmpiOpenDRIM_PCIDeviceControlledByPCIPort.cpp assocOpenDRIM_PCIDeviceControlledByPCIPort.cpp # May have to be adjusted for direct invocation libcmpiPCI_OpenDRIM_PCIDeviceControlledByPCIPortProvider_la_CPPFLAGS = -I../CIM_Controller -I../CIM_LogicalDevice # Uncomment the end for direct invocation, may have to be adjusted libcmpiPCI_OpenDRIM_PCIDeviceControlledByPCIPortProvider_la_LIBADD = ../Common/libcmpiPCI_Common.la #../CIM_Controller/libcmpiPCI_CIM_ControllerProvider.la ../CIM_LogicalDevice/libcmpiPCI_CIM_LogicalDeviceProvider.la libcmpiPCI_OpenDRIM_PCIDeviceControlledByPCIPortProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_PCIDeviceControlledByPCIPort.h OpenDRIM_PCIDeviceControlledByPCIPort.h OpenDRIM_PCIDeviceControlledByPCIPortAccess.h ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceControlledByPCIPort/cmpiOpenDRIM_PCIDeviceControlledByPCIPort.cppopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceControlledByPCIPort/cmpiOpenDRIM_PCIDeviceControlledByP0000644000175000017500000001213411400674237033661 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIDeviceControlledByPCIPort.h" CMPIObjectPath* PCI_OpenDRIM_PCIDeviceControlledByPCIPort_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PCIDeviceControlledByPCIPort& instance) { _E_; Objectpath op(broker, OpenDRIM_PCIDeviceControlledByPCIPort_classnames[0], OpenDRIM_PCIDeviceControlledByPCIPort_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* PCI_OpenDRIM_PCIDeviceControlledByPCIPort_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PCIDeviceControlledByPCIPort& instance) { _E_; Objectpath op(broker, PCI_OpenDRIM_PCIDeviceControlledByPCIPort_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.NegotiatedSpeed_isNULL) ci.setProperty("NegotiatedSpeed", instance.NegotiatedSpeed); if (!instance.NegotiatedDataWidth_isNULL) ci.setProperty("NegotiatedDataWidth", instance.NegotiatedDataWidth); if (!instance.AccessState_isNULL) ci.setProperty("AccessState", instance.AccessState); if (!instance.TimeOfDeviceReset_isNULL) ci.setPropertyDatetime("TimeOfDeviceReset", instance.TimeOfDeviceReset); if (!instance.NumberOfHardResets_isNULL) ci.setProperty("NumberOfHardResets", instance.NumberOfHardResets); if (!instance.NumberOfSoftResets_isNULL) ci.setProperty("NumberOfSoftResets", instance.NumberOfSoftResets); if (!instance.DeviceNumber_isNULL) ci.setProperty("DeviceNumber", instance.DeviceNumber); if (!instance.AccessMode_isNULL) ci.setProperty("AccessMode", instance.AccessMode); if (!instance.AccessPriority_isNULL) ci.setProperty("AccessPriority", instance.AccessPriority); _L_; return ci.getHdl(); } void PCI_OpenDRIM_PCIDeviceControlledByPCIPort_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PCIDeviceControlledByPCIPort& 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 PCI_OpenDRIM_PCIDeviceControlledByPCIPort_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PCIDeviceControlledByPCIPort& 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("NegotiatedSpeed", instance.NegotiatedSpeed) == OK) instance.NegotiatedSpeed_isNULL = false; if (inst.getProperty("NegotiatedDataWidth", instance.NegotiatedDataWidth) == OK) instance.NegotiatedDataWidth_isNULL = false; if (inst.getProperty("AccessState", instance.AccessState) == OK) instance.AccessState_isNULL = false; if (inst.getPropertyDatetime("TimeOfDeviceReset", instance.TimeOfDeviceReset) == OK) instance.TimeOfDeviceReset_isNULL = false; if (inst.getProperty("NumberOfHardResets", instance.NumberOfHardResets) == OK) instance.NumberOfHardResets_isNULL = false; if (inst.getProperty("NumberOfSoftResets", instance.NumberOfSoftResets) == OK) instance.NumberOfSoftResets_isNULL = false; if (inst.getProperty("DeviceNumber", instance.DeviceNumber) == OK) instance.DeviceNumber_isNULL = false; if (inst.getProperty("AccessMode", instance.AccessMode) == OK) instance.AccessMode_isNULL = false; if (inst.getProperty("AccessPriority", instance.AccessPriority) == OK) instance.AccessPriority_isNULL = false; _L_; } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceControlledByPCIPort/OpenDRIM_PCIDeviceControlledByPCIPort.hopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceControlledByPCIPort/OpenDRIM_PCIDeviceControlledByPCIPo0000644000175000017500000001555711400674237033537 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PCIDEVICECONTROLLEDBYPCIPORT_H_ #define OPENDRIM_PCIDEVICECONTROLLEDBYPCIPORT_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_Controller.h" #include "CIM_ControllerAccess.h" #include "cmpiCIM_LogicalDevice.h" #include "CIM_LogicalDeviceAccess.h" */ const static char* OpenDRIM_PCIDeviceControlledByPCIPort_classnames[] = {"OpenDRIM_PCIDeviceControlledByPCIPort"}; static string OpenDRIM_PCIDeviceControlledByPCIPort_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"OpenDRIM_PCIDevice"}; const static string Antecedent_NAMESPACE = _NAMESPACE; const static string Dependent_role = "Dependent"; const static char* Dependent_classnames[] = {"OpenDRIM_PCIPort"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_PCIDeviceControlledByPCIPort { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; unsigned long long NegotiatedSpeed; bool NegotiatedSpeed_isNULL; unsigned int NegotiatedDataWidth; bool NegotiatedDataWidth_isNULL; unsigned short AccessState; bool AccessState_isNULL; string TimeOfDeviceReset; bool TimeOfDeviceReset_isNULL; unsigned int NumberOfHardResets; bool NumberOfHardResets_isNULL; unsigned int NumberOfSoftResets; bool NumberOfSoftResets_isNULL; string DeviceNumber; bool DeviceNumber_isNULL; unsigned short AccessMode; bool AccessMode_isNULL; unsigned short AccessPriority; bool AccessPriority_isNULL; OpenDRIM_PCIDeviceControlledByPCIPort() { Antecedent_isNULL = true; Dependent_isNULL = true; NegotiatedSpeed_isNULL = true; NegotiatedDataWidth_isNULL = true; AccessState_isNULL = true; TimeOfDeviceReset_isNULL = true; NumberOfHardResets_isNULL = true; NumberOfSoftResets_isNULL = true; DeviceNumber_isNULL = true; AccessMode_isNULL = true; AccessPriority_isNULL = true; } ~OpenDRIM_PCIDeviceControlledByPCIPort() {} 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 getNegotiatedSpeed(unsigned long long& value) const { if (NegotiatedSpeed_isNULL==true) return NOT_FOUND; value = NegotiatedSpeed; return OK; } int setNegotiatedSpeed(const unsigned long long& newValue) { NegotiatedSpeed = newValue; NegotiatedSpeed_isNULL = false; return OK; } int getNegotiatedDataWidth(unsigned int& value) const { if (NegotiatedDataWidth_isNULL==true) return NOT_FOUND; value = NegotiatedDataWidth; return OK; } int setNegotiatedDataWidth(const unsigned int& newValue) { NegotiatedDataWidth = newValue; NegotiatedDataWidth_isNULL = false; return OK; } int getAccessState(unsigned short& value) const { if (AccessState_isNULL==true) return NOT_FOUND; value = AccessState; return OK; } int setAccessState(const unsigned short& newValue) { AccessState = newValue; AccessState_isNULL = false; return OK; } int getTimeOfDeviceReset(string& value) const { if (TimeOfDeviceReset_isNULL==true) return NOT_FOUND; value = TimeOfDeviceReset; return OK; } int setTimeOfDeviceReset(const string& newValue) { TimeOfDeviceReset = newValue; TimeOfDeviceReset_isNULL = false; return OK; } int getNumberOfHardResets(unsigned int& value) const { if (NumberOfHardResets_isNULL==true) return NOT_FOUND; value = NumberOfHardResets; return OK; } int setNumberOfHardResets(const unsigned int& newValue) { NumberOfHardResets = newValue; NumberOfHardResets_isNULL = false; return OK; } int getNumberOfSoftResets(unsigned int& value) const { if (NumberOfSoftResets_isNULL==true) return NOT_FOUND; value = NumberOfSoftResets; return OK; } int setNumberOfSoftResets(const unsigned int& newValue) { NumberOfSoftResets = newValue; NumberOfSoftResets_isNULL = false; return OK; } int getDeviceNumber(string& value) const { if (DeviceNumber_isNULL==true) return NOT_FOUND; value = DeviceNumber; return OK; } int setDeviceNumber(const string& newValue) { DeviceNumber = newValue; DeviceNumber_isNULL = false; return OK; } int getAccessMode(unsigned short& value) const { if (AccessMode_isNULL==true) return NOT_FOUND; value = AccessMode; return OK; } int setAccessMode(const unsigned short& newValue) { AccessMode = newValue; AccessMode_isNULL = false; return OK; } int getAccessPriority(unsigned short& value) const { if (AccessPriority_isNULL==true) return NOT_FOUND; value = AccessPriority; return OK; } int setAccessPriority(const unsigned short& newValue) { AccessPriority = newValue; AccessPriority_isNULL = false; return OK; } }; #endif /*OPENDRIM_PCIDEVICECONTROLLEDBYPCIPORT_H_*/ ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceControlledByPCIPort/assocOpenDRIM_PCIDeviceControlledByPCIPort.cppopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceControlledByPCIPort/assocOpenDRIM_PCIDeviceControlledBy0000644000175000017500000002101311400674237033715 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_PCIDeviceControlledByPCIPort.h" int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_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 = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_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(PCI_OpenDRIM_PCIDeviceControlledByPCIPort_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(PCI_OpenDRIM_PCIDeviceControlledByPCIPort_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_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(PCI_CIM_Controller_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PCI_CIM_Controller_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PCI_CIM_Controller_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_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_Controller _instance; PCI_CIM_Controller_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PCI_CIM_Controller_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PCI_CIM_Controller_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_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(PCI_CIM_LogicalDevice_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PCI_CIM_LogicalDevice_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PCI_CIM_LogicalDevice_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_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_LogicalDevice _instance; PCI_CIM_LogicalDevice_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PCI_CIM_LogicalDevice_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PCI_CIM_LogicalDevice_toCMPIInstance(broker, _instance)); */ _L_; return OK; } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceControlledByPCIPort/assocOpenDRIM_PCIDeviceControlledByPCIPort.hopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceControlledByPCIPort/assocOpenDRIM_PCIDeviceControlledBy0000644000175000017500000000631111400674237033721 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_PCIDEVICECONTROLLEDBYPCIPORT_H_ #define ASSOCOPENDRIM_PCIDEVICECONTROLLEDBYPCIPORT_H_ #include "OpenDRIM_PCIDeviceControlledByPCIPortAccess.h" int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_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 PCI_OpenDRIM_PCIDeviceControlledByPCIPort_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 PCI_OpenDRIM_PCIDeviceControlledByPCIPort_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_PCIDEVICECONTROLLEDBYPCIPORT_H_*/ ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceControlledByPCIPort/OpenDRIM_PCIDeviceControlledByPCIPortProvider.cppopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceControlledByPCIPort/OpenDRIM_PCIDeviceControlledByPCIPo0000644000175000017500000004306611400674237033533 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIDeviceControlledByPCIPort.h" #include "OpenDRIM_PCIDeviceControlledByPCIPortAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PCI_OpenDRIM_PCIDeviceControlledByPCIPortProviderSetInstance PCI_OpenDRIM_PCIDeviceControlledByPCIPortProviderModifyInstance #endif int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_init(const CMPIBroker* broker); int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PCI_OpenDRIM_PCIDeviceControlledByPCIPortProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceControlledByPCIPortProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceControlledByPCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceControlledByPCIPortProviderEnumInstances(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 = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceControlledByPCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceControlledByPCIPortProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIDeviceControlledByPCIPort instance; PCI_OpenDRIM_PCIDeviceControlledByPCIPort_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceControlledByPCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceControlledByPCIPortProviderSetInstance(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_PCIDeviceControlledByPCIPort newInstance, oldInstance; PCI_OpenDRIM_PCIDeviceControlledByPCIPort_toCPP(_broker, ci, newInstance); PCI_OpenDRIM_PCIDeviceControlledByPCIPort_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceControlledByPCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceControlledByPCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceControlledByPCIPortProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIDeviceControlledByPCIPort instance; PCI_OpenDRIM_PCIDeviceControlledByPCIPort_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_PCIDeviceControlledByPCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceControlledByPCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceControlledByPCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceControlledByPCIPortProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIDeviceControlledByPCIPort instance; PCI_OpenDRIM_PCIDeviceControlledByPCIPort_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceControlledByPCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceControlledByPCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceControlledByPCIPortProviderExecQuery(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 PCI_OpenDRIM_PCIDeviceControlledByPCIPortProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceControlledByPCIPortProviderAssociatorNames(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 = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceControlledByPCIPort_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 PCI_OpenDRIM_PCIDeviceControlledByPCIPortProviderAssociators(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 = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceControlledByPCIPort_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 PCI_OpenDRIM_PCIDeviceControlledByPCIPortProviderReferenceNames(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 = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceControlledByPCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceControlledByPCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIDeviceControlledByPCIPortProviderReferences(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 = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceControlledByPCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIDeviceControlledByPCIPort_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_PCIDeviceControlledByPCIPort_init FAILED: " + (string) OpenDRIM_PCIDeviceControlledByPCIPort_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PCI_OpenDRIM_PCIDeviceControlledByPCIPort_unload(errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_PCIDeviceControlledByPCIPort_unload FAILED: " + (string) OpenDRIM_PCIDeviceControlledByPCIPort_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PCI_OpenDRIM_PCIDeviceControlledByPCIPort_INIT if (PCI_OpenDRIM_PCIDeviceControlledByPCIPort_init(_broker) < 0) return NULL CMInstanceMIStub(PCI_OpenDRIM_PCIDeviceControlledByPCIPortProvider, PCI_OpenDRIM_PCIDeviceControlledByPCIPortProvider, _broker, PCI_OpenDRIM_PCIDeviceControlledByPCIPort_INIT); CMAssociationMIStub(PCI_OpenDRIM_PCIDeviceControlledByPCIPortProvider, PCI_OpenDRIM_PCIDeviceControlledByPCIPortProvider, _broker, PCI_OpenDRIM_PCIDeviceControlledByPCIPort_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceControlledByPCIPort/cmpiOpenDRIM_PCIDeviceControlledByPCIPort.hopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceControlledByPCIPort/cmpiOpenDRIM_PCIDeviceControlledByP0000644000175000017500000000447711400674237033674 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_PCIDEVICECONTROLLEDBYPCIPORT_H_ #define CMPIOPENDRIM_PCIDEVICECONTROLLEDBYPCIPORT_H_ #include "OpenDRIM_PCIDeviceControlledByPCIPort.h" CMPIObjectPath* PCI_OpenDRIM_PCIDeviceControlledByPCIPort_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PCIDeviceControlledByPCIPort& instance); CMPIInstance* PCI_OpenDRIM_PCIDeviceControlledByPCIPort_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PCIDeviceControlledByPCIPort& instance); void PCI_OpenDRIM_PCIDeviceControlledByPCIPort_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PCIDeviceControlledByPCIPort& instance); void PCI_OpenDRIM_PCIDeviceControlledByPCIPort_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PCIDeviceControlledByPCIPort& instance); #endif /*CMPIOPENDRIM_PCIDEVICECONTROLLEDBYPCIPORT_H_*/ ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceControlledByPCIPort/OpenDRIM_PCIDeviceControlledByPCIPortAccess.hopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceControlledByPCIPort/OpenDRIM_PCIDeviceControlledByPCIPo0000644000175000017500000001074511400674237033531 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PCIDEVICECONTROLLEDBYPCIPORTACCESS_H_ #define OPENDRIM_PCIDEVICECONTROLLEDBYPCIPORTACCESS_H_ #include "PCI_Common.h" #include "OpenDRIM_PCIDeviceControlledByPCIPort.h" #include "assocOpenDRIM_PCIDeviceControlledByPCIPort.h" int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_load(const CMPIBroker* broker, string& errorMessage); int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_unload(string& errorMessage); int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PCIDeviceControlledByPCIPort& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDeviceControlledByPCIPort& newInstance, const OpenDRIM_PCIDeviceControlledByPCIPort& oldInstance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDeviceControlledByPCIPort& instance, string& errorMessage); int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDeviceControlledByPCIPort& instance, string& errorMessage); int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_PCIDeviceControlledByPCIPort_instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_PCIDeviceControlledByPCIPort_instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_populate(OpenDRIM_PCIDeviceControlledByPCIPort& instance, string& errorMessage); #endif /*OPENDRIM_PCIDEVICECONTROLLEDBYPCIPORTACCESS_H_*/ ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceControlledByPCIPort/OpenDRIM_PCIDeviceControlledByPCIPortAccess.cppopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIDeviceControlledByPCIPort/OpenDRIM_PCIDeviceControlledByPCIPo0000644000175000017500000002534611400674237033534 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_PCIDeviceControlledByPCIPortAccess.h" int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PCI_CIM_Controller_load(broker, errorMessage)); CF_assert(PCI_CIM_LogicalDevice_load(broker, errorMessage)); */ // TODO _L_; return OK; } int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PCI_CIM_Controller_unload(errorMessage)); CF_assert(PCI_CIM_LogicalDevice_unload(errorMessage)); */ // TODO _L_; return OK; } int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_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(PCI_OpenDRIM_PCIDeviceControlledByPCIPort_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(PCI_OpenDRIM_PCIDeviceControlledByPCIPort_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; PCI_OpenDRIM_PCIDeviceControlledByPCIPort_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(PCI_OpenDRIM_PCIDeviceControlledByPCIPort_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PCIDeviceControlledByPCIPort& 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(PCI_OpenDRIM_PCIDeviceControlledByPCIPort_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(PCI_OpenDRIM_PCIDeviceControlledByPCIPort_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(PCI_OpenDRIM_PCIDeviceControlledByPCIPort_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } CF_assert(PCI_OpenDRIM_PCIDeviceControlledByPCIPort_populate(instance, errorMessage)); _L_; return OK; } int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDeviceControlledByPCIPort& newInstance, const OpenDRIM_PCIDeviceControlledByPCIPort& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDeviceControlledByPCIPort& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIDeviceControlledByPCIPort& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_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(PCI_OpenDRIM_PCIDeviceControlledByPCIPort_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PCI_OpenDRIM_PCIDeviceControlledByPCIPort_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(PCI_OpenDRIM_PCIDeviceControlledByPCIPort_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(PCI_OpenDRIM_PCIDeviceControlledByPCIPort_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PCI_OpenDRIM_PCIDeviceControlledByPCIPort_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(PCI_OpenDRIM_PCIDeviceControlledByPCIPort_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_PCIDeviceControlledByPCIPort_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_PCIDeviceControlledByPCIPort instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); if (discriminant == "r") { CF_assert(PCI_OpenDRIM_PCIDeviceControlledByPCIPort_populate(instance, errorMessage)); } OpenDRIM_PCIDeviceControlledByPCIPort_instances.push_back(instance); } _L_; return OK; } int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_PCIDeviceControlledByPCIPort_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_PCIDeviceControlledByPCIPort instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); if (discriminant == "r") { CF_assert(PCI_OpenDRIM_PCIDeviceControlledByPCIPort_populate(instance, errorMessage)); } OpenDRIM_PCIDeviceControlledByPCIPort_instances.push_back(instance); } _L_; return OK; } int PCI_OpenDRIM_PCIDeviceControlledByPCIPort_populate(OpenDRIM_PCIDeviceControlledByPCIPort& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-pci-1.0.0~ppa/mof/0000755000175000017500000000000011400674237017102 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/mof/OpenDRIM_PCIPort.mof0000644000175000017500000000312411400674237022522 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ [Provider("cmpi:cmpiPCI_OpenDRIM_PCIPortProvider")] class OpenDRIM_PCIPort:CIM_PCIPort { }; opendrim-lmp-pci-1.0.0~ppa/mof/OpenDRIM_PCIDeviceConnection.mof0000644000175000017500000000320311400674237025013 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ [Association, Provider("cmpi:cmpiPCI_OpenDRIM_PCIDeviceConnectionProvider")] class OpenDRIM_PCIDeviceConnection:CIM_DeviceConnection { }; opendrim-lmp-pci-1.0.0~ppa/mof/OpenDRIM_MemberOfPCICollection.mof0000644000175000017500000000321111400674237025303 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ [Association, Provider("cmpi:cmpiPCI_OpenDRIM_MemberOfPCICollectionProvider")] class OpenDRIM_MemberOfPCICollection:CIM_MemberOfCollection { }; opendrim-lmp-pci-1.0.0~ppa/mof/OpenDRIM_RegisteredPCIProfile.mof0000644000175000017500000000317011400674237025215 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ [Provider("cmpi:cmpiPCI_OpenDRIM_RegisteredPCIProfileProvider")] class OpenDRIM_RegisteredPCIProfile:CIM_RegisteredProfile { }; opendrim-lmp-pci-1.0.0~ppa/mof/OpenDRIM_PCIPortGroup.mof0000644000175000017500000000314311400674237023540 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ [Provider("cmpi:cmpiPCI_OpenDRIM_PCIPortGroupProvider")] class OpenDRIM_PCIPortGroup:CIM_PCIPortGroup { }; opendrim-lmp-pci-1.0.0~ppa/mof/OpenDRIM_PCIDeviceConformsToProfile.mof0000644000175000017500000000321311400674237026327 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ [Provider("cmpi:cmpiPCI_OpenDRIM_PCIDeviceConformsToProfileProvider")] class OpenDRIM_PCIDeviceConformsToProfile:CIM_ElementConformsToProfile { }; opendrim-lmp-pci-1.0.0~ppa/mof/OpenDRIM_EnabledPCICapabilities.mof0000644000175000017500000000321411400674237025442 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ [Provider("cmpi:cmpiPCI_OpenDRIM_EnabledPCICapabilitiesProvider")] class OpenDRIM_EnabledPCICapabilities:CIM_EnabledLogicalElementCapabilities { }; opendrim-lmp-pci-1.0.0~ppa/mof/OpenDRIM_ConcretePCIIdentity.mof0000644000175000017500000000316511400674237025057 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ [Provider("cmpi:cmpiPCI_OpenDRIM_ConcretePCIIdentityProvider")] class OpenDRIM_ConcretePCIIdentity:CIM_ConcreteIdentity { }; opendrim-lmp-pci-1.0.0~ppa/mof/OpenDRIM_PCIDevice.mof0000644000175000017500000000313211400674237022774 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ [Provider("cmpi:cmpiPCI_OpenDRIM_PCIDeviceProvider")] class OpenDRIM_PCIDevice:CIM_PCIDevice { }; opendrim-lmp-pci-1.0.0~ppa/mof/OpenDRIM_PCIDeviceControlledByPCIPort.mof0000644000175000017500000000322111400674237026515 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ [Association, Provider("cmpi:cmpiPCI_OpenDRIM_PCIDeviceControlledByPCIPortProvider")] class OpenDRIM_PCIDeviceControlledByPCIPort:CIM_ControlledBy { }; opendrim-lmp-pci-1.0.0~ppa/mof/OpenDRIM_HostedPCICollection.mof0000644000175000017500000000320311400674237025036 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ [Association, Provider("cmpi:cmpiPCI_OpenDRIM_HostedPCICollectionProvider")] class OpenDRIM_HostedPCICollection:CIM_HostedCollection { }; opendrim-lmp-pci-1.0.0~ppa/mof/OpenDRIM_PCIBridge.mof0000644000175000017500000000313211400674237022771 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ [Provider("cmpi:cmpiPCI_OpenDRIM_PCIBridgeProvider")] class OpenDRIM_PCIBridge:CIM_PCIBridge { }; opendrim-lmp-pci-1.0.0~ppa/mof/OpenDRIM_PCIeSwitch.mof0000644000175000017500000000313511400674237023206 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ [Provider("cmpi:cmpiPCI_OpenDRIM_PCIeSwitchProvider")] class OpenDRIM_PCIeSwitch:CIM_PCIeSwitch { }; opendrim-lmp-pci-1.0.0~ppa/mof/OpenDRIM_ComputerSystemPCIDevice.mof0000644000175000017500000000320711400674237025723 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ [Association, Provider("cmpi:cmpiPCI_OpenDRIM_ComputerSystemPCIDeviceProvider")] class OpenDRIM_ComputerSystemPCIDevice:CIM_SystemDevice { }; opendrim-lmp-pci-1.0.0~ppa/mof/OpenDRIM_PCICapabilities.mof0000644000175000017500000000317611400674237024176 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ [Association, Provider("cmpi:cmpiPCI_OpenDRIM_PCICapabilitiesProvider")] class OpenDRIM_PCICapabilities:CIM_ElementCapabilities { }; opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ConcretePCIIdentity/0000755000175000017500000000000011400674237023566 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ConcretePCIIdentity/cmpiOpenDRIM_ConcretePCIIdentity.cpp0000644000175000017500000000611611400674237032414 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ConcretePCIIdentity.h" CMPIObjectPath* PCI_OpenDRIM_ConcretePCIIdentity_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ConcretePCIIdentity& instance) { _E_; Objectpath op(broker, OpenDRIM_ConcretePCIIdentity_classnames[0], OpenDRIM_ConcretePCIIdentity_NAMESPACE); if (!instance.SystemElement_isNULL) op.addKey("SystemElement", instance.SystemElement); if (!instance.SameElement_isNULL) op.addKey("SameElement", instance.SameElement); _L_; return op.getHdl(); } CMPIInstance* PCI_OpenDRIM_ConcretePCIIdentity_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ConcretePCIIdentity& instance) { _E_; Objectpath op(broker, PCI_OpenDRIM_ConcretePCIIdentity_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void PCI_OpenDRIM_ConcretePCIIdentity_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ConcretePCIIdentity& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("SystemElement", instance.SystemElement) == OK) instance.SystemElement_isNULL = false; if (op.getKey("SameElement", instance.SameElement) == OK) instance.SameElement_isNULL = false; _L_; } void PCI_OpenDRIM_ConcretePCIIdentity_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ConcretePCIIdentity& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("SystemElement", instance.SystemElement) == OK) instance.SystemElement_isNULL = false; if (inst.getProperty("SameElement", instance.SameElement) == OK) instance.SameElement_isNULL = false; _L_; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ConcretePCIIdentity/Makefile.am0000644000175000017500000000466711400674237025637 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPCI_OpenDRIM_ConcretePCIIdentityProvider.la libcmpiPCI_OpenDRIM_ConcretePCIIdentityProvider_la_SOURCES = OpenDRIM_ConcretePCIIdentityAccess.cpp OpenDRIM_ConcretePCIIdentityProvider.cpp cmpiOpenDRIM_ConcretePCIIdentity.cpp assocOpenDRIM_ConcretePCIIdentity.cpp # May have to be adjusted for direct invocation libcmpiPCI_OpenDRIM_ConcretePCIIdentityProvider_la_CPPFLAGS = -I../CIM_ManagedElement -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiPCI_OpenDRIM_ConcretePCIIdentityProvider_la_LIBADD = ../Common/libcmpiPCI_Common.la #../CIM_ManagedElement/libcmpiPCI_CIM_ManagedElementProvider.la ../CIM_ManagedElement/libcmpiPCI_CIM_ManagedElementProvider.la libcmpiPCI_OpenDRIM_ConcretePCIIdentityProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_ConcretePCIIdentity.h OpenDRIM_ConcretePCIIdentity.h OpenDRIM_ConcretePCIIdentityAccess.h opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ConcretePCIIdentity/OpenDRIM_ConcretePCIIdentityAccess.cpp0000644000175000017500000002431511400674237032666 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_ConcretePCIIdentityAccess.h" int PCI_OpenDRIM_ConcretePCIIdentity_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PCI_CIM_ManagedElement_load(broker, errorMessage)); CF_assert(PCI_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int PCI_OpenDRIM_ConcretePCIIdentity_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PCI_CIM_ManagedElement_unload(errorMessage)); CF_assert(PCI_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int PCI_OpenDRIM_ConcretePCIIdentity_isAssociated(const Instance& SystemElement, const Instance& SameElement, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int PCI_OpenDRIM_ConcretePCIIdentity_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(PCI_OpenDRIM_ConcretePCIIdentity_enumerateSystemElements(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(PCI_OpenDRIM_ConcretePCIIdentity_enumerateSystemElements(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; PCI_OpenDRIM_ConcretePCIIdentity_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), SystemElement_classnames[0], SameElement_classnames[0], SystemElement_role.c_str(), SameElement_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(PCI_OpenDRIM_ConcretePCIIdentity_referenceSystemElementToSameElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int PCI_OpenDRIM_ConcretePCIIdentity_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ConcretePCIIdentity& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath SystemElement_objectpath; instance.getSystemElement(SystemElement_objectpath); Instance SystemElement_instance; CF_assert(PCI_OpenDRIM_ConcretePCIIdentity_getSystemElement(broker, ctx, SystemElement_objectpath, SystemElement_instance, NULL, errorMessage)); Objectpath SameElement_objectpath; instance.getSameElement(SameElement_objectpath); Instance SameElement_instance; CF_assert(PCI_OpenDRIM_ConcretePCIIdentity_getSameElement(broker, ctx, SameElement_objectpath, SameElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(PCI_OpenDRIM_ConcretePCIIdentity_isAssociated(SystemElement_instance, SameElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int PCI_OpenDRIM_ConcretePCIIdentity_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ConcretePCIIdentity& newInstance, const OpenDRIM_ConcretePCIIdentity& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_ConcretePCIIdentity_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ConcretePCIIdentity& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_ConcretePCIIdentity_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ConcretePCIIdentity& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_ConcretePCIIdentity_associatorSystemElementToSameElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& SystemElement_instance, const char** properties, vector& SameElement_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector SameElement_instances; if (discriminant=="a") CF_assert(PCI_OpenDRIM_ConcretePCIIdentity_enumerateSameElements(broker, ctx, SameElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PCI_OpenDRIM_ConcretePCIIdentity_enumerateSameElements(broker, ctx, SameElement_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(PCI_OpenDRIM_ConcretePCIIdentity_enumerateSameElements(broker, ctx, SameElement_instances, properties, false, errorMessage)); } for (size_t i=0; i& SystemElement_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector SystemElement_instances; if (discriminant=="a") CF_assert(PCI_OpenDRIM_ConcretePCIIdentity_enumerateSystemElements(broker, ctx, SystemElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PCI_OpenDRIM_ConcretePCIIdentity_enumerateSystemElements(broker, ctx, SystemElement_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(PCI_OpenDRIM_ConcretePCIIdentity_enumerateSystemElements(broker, ctx, SystemElement_instances, properties, false, errorMessage)); } for (size_t i=0; i& SameElement_instances, vector& OpenDRIM_ConcretePCIIdentity_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 < SameElement_instances.size(); i++) { OpenDRIM_ConcretePCIIdentity instance; instance.setSystemElement(((Instance) SystemElement_instance).getObjectpath()); instance.setSameElement(((Instance) SameElement_instances[i]).getObjectpath()); OpenDRIM_ConcretePCIIdentity_instances.push_back(instance); } _L_; return OK; } int PCI_OpenDRIM_ConcretePCIIdentity_referenceSameElementToSystemElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& SameElement_instance, const vector& SystemElement_instances, vector& OpenDRIM_ConcretePCIIdentity_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 < SystemElement_instances.size(); i++) { OpenDRIM_ConcretePCIIdentity instance; instance.setSystemElement(((Instance) SystemElement_instances[i]).getObjectpath()); instance.setSameElement(((Instance) SameElement_instance).getObjectpath()); OpenDRIM_ConcretePCIIdentity_instances.push_back(instance); } _L_; return OK; } int PCI_OpenDRIM_ConcretePCIIdentity_populate(OpenDRIM_ConcretePCIIdentity& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ConcretePCIIdentity/OpenDRIM_ConcretePCIIdentity.h0000644000175000017500000000674311400674237031216 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_CONCRETEPCIIDENTITY_H_ #define OPENDRIM_CONCRETEPCIIDENTITY_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_ManagedElement.h" #include "CIM_ManagedElementAccess.h" #include "cmpiCIM_ManagedElement.h" #include "CIM_ManagedElementAccess.h" */ const static char* OpenDRIM_ConcretePCIIdentity_classnames[] = {"OpenDRIM_ConcretePCIIdentity"}; static string OpenDRIM_ConcretePCIIdentity_NAMESPACE = _NAMESPACE; const static string SystemElement_role = "SystemElement"; const static char* SystemElement_classnames[] = {"OpenDRIM_PCIDevice"}; const static string SystemElement_NAMESPACE = _NAMESPACE; const static string SameElement_role = "SameElement"; const static char* SameElement_classnames[] = {"CIM_LogicalDevice"}; const static string SameElement_NAMESPACE = _NAMESPACE; class OpenDRIM_ConcretePCIIdentity { public: Objectpath SystemElement; bool SystemElement_isNULL; Objectpath SameElement; bool SameElement_isNULL; OpenDRIM_ConcretePCIIdentity() { SystemElement_isNULL = true; SameElement_isNULL = true; } ~OpenDRIM_ConcretePCIIdentity() {} string getKeys() const { return CF_toLowCase(".SystemElement=\"" + CF_quoteString(SystemElement.toString()) + "\""".SameElement=\"" + CF_quoteString(SameElement.toString()) + "\""); } int getSystemElement(Objectpath& value) const { if (SystemElement_isNULL==true) return NOT_FOUND; value = SystemElement; return OK; } int setSystemElement(const Objectpath& newValue) { SystemElement = newValue; SystemElement.setNamespace(SystemElement_NAMESPACE); SystemElement_isNULL = false; return OK; } int getSameElement(Objectpath& value) const { if (SameElement_isNULL==true) return NOT_FOUND; value = SameElement; return OK; } int setSameElement(const Objectpath& newValue) { SameElement = newValue; SameElement.setNamespace(SameElement_NAMESPACE); SameElement_isNULL = false; return OK; } }; #endif /*OPENDRIM_CONCRETEPCIIDENTITY_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ConcretePCIIdentity/assocOpenDRIM_ConcretePCIIdentity.h0000644000175000017500000000617111400674237032242 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_CONCRETEPCIIDENTITY_H_ #define ASSOCOPENDRIM_CONCRETEPCIIDENTITY_H_ #include "OpenDRIM_ConcretePCIIdentityAccess.h" int PCI_OpenDRIM_ConcretePCIIdentity_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 PCI_OpenDRIM_ConcretePCIIdentity_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 PCI_OpenDRIM_ConcretePCIIdentity_enumerateSystemElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PCI_OpenDRIM_ConcretePCIIdentity_getSystemElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_ConcretePCIIdentity_enumerateSameElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PCI_OpenDRIM_ConcretePCIIdentity_getSameElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_CONCRETEPCIIDENTITY_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ConcretePCIIdentity/cmpiOpenDRIM_ConcretePCIIdentity.h0000644000175000017500000000432311400674237032057 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_CONCRETEPCIIDENTITY_H_ #define CMPIOPENDRIM_CONCRETEPCIIDENTITY_H_ #include "OpenDRIM_ConcretePCIIdentity.h" CMPIObjectPath* PCI_OpenDRIM_ConcretePCIIdentity_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ConcretePCIIdentity& instance); CMPIInstance* PCI_OpenDRIM_ConcretePCIIdentity_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ConcretePCIIdentity& instance); void PCI_OpenDRIM_ConcretePCIIdentity_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ConcretePCIIdentity& instance); void PCI_OpenDRIM_ConcretePCIIdentity_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ConcretePCIIdentity& instance); #endif /*CMPIOPENDRIM_CONCRETEPCIIDENTITY_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ConcretePCIIdentity/assocOpenDRIM_ConcretePCIIdentity.cpp0000644000175000017500000002076311400674237032600 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_ConcretePCIIdentity.h" int PCI_OpenDRIM_ConcretePCIIdentity_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 = PCI_OpenDRIM_ConcretePCIIdentity_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, "SystemElement") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "SameElement") != 0) return OK; CF_assert(PCI_OpenDRIM_ConcretePCIIdentity_associatorSystemElementToSameElement(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "SameElement") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "SystemElement") != 0) return OK; CF_assert(PCI_OpenDRIM_ConcretePCIIdentity_associatorSameElementToSystemElement(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int PCI_OpenDRIM_ConcretePCIIdentity_enumerateSystemElements(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, SystemElement_NAMESPACE, SystemElement_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PCI_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PCI_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PCI_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PCI_OpenDRIM_ConcretePCIIdentity_getSystemElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), SystemElement_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), SystemElement_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_ManagedElement _instance; PCI_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PCI_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PCI_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int PCI_OpenDRIM_ConcretePCIIdentity_enumerateSameElements(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, SameElement_NAMESPACE, SameElement_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PCI_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PCI_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PCI_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PCI_OpenDRIM_ConcretePCIIdentity_getSameElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), SameElement_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), SameElement_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_ManagedElement _instance; PCI_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PCI_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PCI_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ConcretePCIIdentity/OpenDRIM_ConcretePCIIdentityAccess.h0000644000175000017500000001042111400674237032324 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_CONCRETEPCIIDENTITYACCESS_H_ #define OPENDRIM_CONCRETEPCIIDENTITYACCESS_H_ #include "PCI_Common.h" #include "OpenDRIM_ConcretePCIIdentity.h" #include "assocOpenDRIM_ConcretePCIIdentity.h" int PCI_OpenDRIM_ConcretePCIIdentity_load(const CMPIBroker* broker, string& errorMessage); int PCI_OpenDRIM_ConcretePCIIdentity_unload(string& errorMessage); int PCI_OpenDRIM_ConcretePCIIdentity_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_ConcretePCIIdentity_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ConcretePCIIdentity& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_ConcretePCIIdentity_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ConcretePCIIdentity& newInstance, const OpenDRIM_ConcretePCIIdentity& oldInstance, const char** properties, string& errorMessage); int PCI_OpenDRIM_ConcretePCIIdentity_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ConcretePCIIdentity& instance, string& errorMessage); int PCI_OpenDRIM_ConcretePCIIdentity_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ConcretePCIIdentity& instance, string& errorMessage); int PCI_OpenDRIM_ConcretePCIIdentity_associatorSystemElementToSameElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& SystemElement_instance, const char** properties, vector& SameElement_associatedInstances, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_ConcretePCIIdentity_associatorSameElementToSystemElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& SameElement_instance, const char** properties, vector& SystemElement_associatedInstances, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_ConcretePCIIdentity_referenceSystemElementToSameElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& SystemElement_instance, const vector& SameElement_instances, vector& OpenDRIM_ConcretePCIIdentity_instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_ConcretePCIIdentity_referenceSameElementToSystemElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& SameElement_instance, const vector& SystemElement_instances, vector& OpenDRIM_ConcretePCIIdentity_instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_ConcretePCIIdentity_populate(OpenDRIM_ConcretePCIIdentity& instance, string& errorMessage); #endif /*OPENDRIM_CONCRETEPCIIDENTITYACCESS_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_ConcretePCIIdentity/OpenDRIM_ConcretePCIIdentityProvider.cpp0000644000175000017500000004144011400674237033255 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ConcretePCIIdentity.h" #include "OpenDRIM_ConcretePCIIdentityAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PCI_OpenDRIM_ConcretePCIIdentityProviderSetInstance PCI_OpenDRIM_ConcretePCIIdentityProviderModifyInstance #endif int PCI_OpenDRIM_ConcretePCIIdentity_init(const CMPIBroker* broker); int PCI_OpenDRIM_ConcretePCIIdentity_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PCI_OpenDRIM_ConcretePCIIdentityProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_ConcretePCIIdentity_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_ConcretePCIIdentityProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PCI_OpenDRIM_ConcretePCIIdentity_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ConcretePCIIdentity_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_ConcretePCIIdentity_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_ConcretePCIIdentityProviderEnumInstances(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 = PCI_OpenDRIM_ConcretePCIIdentity_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ConcretePCIIdentity_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PCI_OpenDRIM_ConcretePCIIdentity_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_ConcretePCIIdentityProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ConcretePCIIdentity instance; PCI_OpenDRIM_ConcretePCIIdentity_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_ConcretePCIIdentity_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ConcretePCIIdentity_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PCI_OpenDRIM_ConcretePCIIdentity_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_ConcretePCIIdentityProviderSetInstance(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_ConcretePCIIdentity newInstance, oldInstance; PCI_OpenDRIM_ConcretePCIIdentity_toCPP(_broker, ci, newInstance); PCI_OpenDRIM_ConcretePCIIdentity_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PCI_OpenDRIM_ConcretePCIIdentity_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ConcretePCIIdentity_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_ConcretePCIIdentity_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ConcretePCIIdentity_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_ConcretePCIIdentityProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ConcretePCIIdentity instance; PCI_OpenDRIM_ConcretePCIIdentity_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PCI_OpenDRIM_ConcretePCIIdentity_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_ConcretePCIIdentity_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_ConcretePCIIdentity_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ConcretePCIIdentity_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_ConcretePCIIdentity_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ConcretePCIIdentity_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PCI_OpenDRIM_ConcretePCIIdentity_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_ConcretePCIIdentityProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ConcretePCIIdentity instance; PCI_OpenDRIM_ConcretePCIIdentity_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_ConcretePCIIdentity_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ConcretePCIIdentity_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_ConcretePCIIdentity_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ConcretePCIIdentity_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_ConcretePCIIdentityProviderExecQuery(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 PCI_OpenDRIM_ConcretePCIIdentityProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_ConcretePCIIdentity_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_ConcretePCIIdentityProviderAssociatorNames(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 = PCI_OpenDRIM_ConcretePCIIdentity_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ConcretePCIIdentity_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 PCI_OpenDRIM_ConcretePCIIdentityProviderAssociators(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 = PCI_OpenDRIM_ConcretePCIIdentity_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ConcretePCIIdentity_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 PCI_OpenDRIM_ConcretePCIIdentityProviderReferenceNames(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 = PCI_OpenDRIM_ConcretePCIIdentity_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ConcretePCIIdentity_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PCI_OpenDRIM_ConcretePCIIdentity_referenceSystemElementToSameElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = PCI_OpenDRIM_ConcretePCIIdentity_referenceSameElementToSystemElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ConcretePCIIdentity_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_ConcretePCIIdentity_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus PCI_OpenDRIM_ConcretePCIIdentityProviderReferences(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 = PCI_OpenDRIM_ConcretePCIIdentity_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ConcretePCIIdentity_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PCI_OpenDRIM_ConcretePCIIdentity_referenceSystemElementToSameElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = PCI_OpenDRIM_ConcretePCIIdentity_referenceSameElementToSystemElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ConcretePCIIdentity_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = PCI_OpenDRIM_ConcretePCIIdentity_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int PCI_OpenDRIM_ConcretePCIIdentity_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PCI_OpenDRIM_ConcretePCIIdentity_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_ConcretePCIIdentity_init FAILED: " + (string) OpenDRIM_ConcretePCIIdentity_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PCI_OpenDRIM_ConcretePCIIdentity_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PCI_OpenDRIM_ConcretePCIIdentity_unload(errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_ConcretePCIIdentity_unload FAILED: " + (string) OpenDRIM_ConcretePCIIdentity_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PCI_OpenDRIM_ConcretePCIIdentity_INIT if (PCI_OpenDRIM_ConcretePCIIdentity_init(_broker) < 0) return NULL CMInstanceMIStub(PCI_OpenDRIM_ConcretePCIIdentityProvider, PCI_OpenDRIM_ConcretePCIIdentityProvider, _broker, PCI_OpenDRIM_ConcretePCIIdentity_INIT); CMAssociationMIStub(PCI_OpenDRIM_ConcretePCIIdentityProvider, PCI_OpenDRIM_ConcretePCIIdentityProvider, _broker, PCI_OpenDRIM_ConcretePCIIdentity_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-pci-1.0.0~ppa/COPYING0000644000175000017500000004310311400674237017355 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-pci-1.0.0~ppa/OpenDRIM_PCIBridge/0000755000175000017500000000000011400674237021506 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIBridge/OpenDRIM_PCIBridgeAccess.h0000644000175000017500000001114311400674237026166 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PCIBRIDGEACCESS_H_ #define OPENDRIM_PCIBRIDGEACCESS_H_ #include "PCI_Common.h" #include "OpenDRIM_PCIBridge.h" int PCI_OpenDRIM_PCIBridge_load(const CMPIBroker* broker, string& errorMessage); int PCI_OpenDRIM_PCIBridge_unload(string& errorMessage); int PCI_OpenDRIM_PCIBridge_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_PCIBridge_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PCIBridge& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCIBridge_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& newInstance, const OpenDRIM_PCIBridge& oldInstance, const char** properties, string& errorMessage); int PCI_OpenDRIM_PCIBridge_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, string& errorMessage); int PCI_OpenDRIM_PCIBridge_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, string& errorMessage); int PCI_OpenDRIM_PCIBridge_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, unsigned int& returnValue, const OpenDRIM_PCIBridge_RequestStateChange_In& in, OpenDRIM_PCIBridge_RequestStateChange_Out& out, string& errorMessage); int PCI_OpenDRIM_PCIBridge_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, unsigned int& returnValue, const OpenDRIM_PCIBridge_SetPowerState_In& in, string& errorMessage); int PCI_OpenDRIM_PCIBridge_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, unsigned int& returnValue, string& errorMessage); int PCI_OpenDRIM_PCIBridge_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, unsigned int& returnValue, const OpenDRIM_PCIBridge_EnableDevice_In& in, string& errorMessage); int PCI_OpenDRIM_PCIBridge_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, unsigned int& returnValue, const OpenDRIM_PCIBridge_OnlineDevice_In& in, string& errorMessage); int PCI_OpenDRIM_PCIBridge_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, unsigned int& returnValue, const OpenDRIM_PCIBridge_QuiesceDevice_In& in, string& errorMessage); int PCI_OpenDRIM_PCIBridge_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, unsigned int& returnValue, string& errorMessage); int PCI_OpenDRIM_PCIBridge_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, unsigned int& returnValue, string& errorMessage); int PCI_OpenDRIM_PCIBridge_BISTExecution(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, unsigned char& returnValue, string& errorMessage); int PCI_OpenDRIM_PCIBridge_populate(OpenDRIM_PCIBridge& instance, string& errorMessage); #endif /*OPENDRIM_PCIBRIDGEACCESS_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIBridge/Makefile.am0000644000175000017500000000371411400674237023547 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPCI_OpenDRIM_PCIBridgeProvider.la libcmpiPCI_OpenDRIM_PCIBridgeProvider_la_SOURCES = OpenDRIM_PCIBridgeAccess.cpp OpenDRIM_PCIBridgeProvider.cpp cmpiOpenDRIM_PCIBridge.cpp libcmpiPCI_OpenDRIM_PCIBridgeProvider_la_LIBADD = ../Common/libcmpiPCI_Common.la libcmpiPCI_OpenDRIM_PCIBridgeProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_PCIBridge.h OpenDRIM_PCIBridge.h OpenDRIM_PCIBridgeAccess.h opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIBridge/OpenDRIM_PCIBridgeProvider.cpp0000644000175000017500000004201611400674237027115 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIBridge.h" #include "OpenDRIM_PCIBridgeAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PCI_OpenDRIM_PCIBridgeProviderSetInstance PCI_OpenDRIM_PCIBridgeProviderModifyInstance #endif int PCI_OpenDRIM_PCIBridge_init(const CMPIBroker* broker); int PCI_OpenDRIM_PCIBridge_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PCI_OpenDRIM_PCIBridgeProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_PCIBridge_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIBridgeProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PCI_OpenDRIM_PCIBridge_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_PCIBridge_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIBridgeProviderEnumInstances(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 = PCI_OpenDRIM_PCIBridge_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PCI_OpenDRIM_PCIBridge_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIBridgeProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIBridge instance; PCI_OpenDRIM_PCIBridge_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIBridge_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PCI_OpenDRIM_PCIBridge_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIBridgeProviderSetInstance(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_PCIBridge newInstance, oldInstance; PCI_OpenDRIM_PCIBridge_toCPP(_broker, ci, newInstance); PCI_OpenDRIM_PCIBridge_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIBridge_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIBridge_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIBridgeProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIBridge instance; PCI_OpenDRIM_PCIBridge_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIBridge_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIBridge_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIBridge_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PCI_OpenDRIM_PCIBridge_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIBridgeProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PCIBridge instance; PCI_OpenDRIM_PCIBridge_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_PCIBridge_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_PCIBridge_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIBridgeProviderExecQuery(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 PCI_OpenDRIM_PCIBridgeProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_PCIBridge_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_PCIBridgeProviderInvokeMethod(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_PCIBridge instance; PCI_OpenDRIM_PCIBridge_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"DeviceID", "SystemCreationClassName", "SystemName", "CreationClassName"}; int errorCode = PCI_OpenDRIM_PCIBridge_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_PCIBridge_RequestStateChange_In inArgs; PCI_OpenDRIM_PCIBridge_toCPP(_broker, in, inArgs); OpenDRIM_PCIBridge_RequestStateChange_Out outArgs; errorCode = PCI_OpenDRIM_PCIBridge_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } PCI_OpenDRIM_PCIBridge_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SetPowerState") { unsigned int returnValue; OpenDRIM_PCIBridge_SetPowerState_In inArgs; PCI_OpenDRIM_PCIBridge_toCPP(_broker, in, inArgs); errorCode = PCI_OpenDRIM_PCIBridge_SetPowerState(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="Reset") { unsigned int returnValue; errorCode = PCI_OpenDRIM_PCIBridge_Reset(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="EnableDevice") { unsigned int returnValue; OpenDRIM_PCIBridge_EnableDevice_In inArgs; PCI_OpenDRIM_PCIBridge_toCPP(_broker, in, inArgs); errorCode = PCI_OpenDRIM_PCIBridge_EnableDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="OnlineDevice") { unsigned int returnValue; OpenDRIM_PCIBridge_OnlineDevice_In inArgs; PCI_OpenDRIM_PCIBridge_toCPP(_broker, in, inArgs); errorCode = PCI_OpenDRIM_PCIBridge_OnlineDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="QuiesceDevice") { unsigned int returnValue; OpenDRIM_PCIBridge_QuiesceDevice_In inArgs; PCI_OpenDRIM_PCIBridge_toCPP(_broker, in, inArgs); errorCode = PCI_OpenDRIM_PCIBridge_QuiesceDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SaveProperties") { unsigned int returnValue; errorCode = PCI_OpenDRIM_PCIBridge_SaveProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="RestoreProperties") { unsigned int returnValue; errorCode = PCI_OpenDRIM_PCIBridge_RestoreProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="BISTExecution") { unsigned char returnValue; errorCode = PCI_OpenDRIM_PCIBridge_BISTExecution(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint8, CMPI_uint8); } else { errorMessage = (string) OpenDRIM_PCIBridge_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 PCI_OpenDRIM_PCIBridge_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PCI_OpenDRIM_PCIBridge_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_PCIBridge_init FAILED: " + (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PCI_OpenDRIM_PCIBridge_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PCI_OpenDRIM_PCIBridge_unload(errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_PCIBridge_unload FAILED: " + (string) OpenDRIM_PCIBridge_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PCI_OpenDRIM_PCIBridge_INIT if (PCI_OpenDRIM_PCIBridge_init(_broker) < 0) return NULL CMInstanceMIStub(PCI_OpenDRIM_PCIBridgeProvider, PCI_OpenDRIM_PCIBridgeProvider, _broker, PCI_OpenDRIM_PCIBridge_INIT); CMMethodMIStub(PCI_OpenDRIM_PCIBridgeProvider, PCI_OpenDRIM_PCIBridgeProvider, _broker, PCI_OpenDRIM_PCIBridge_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIBridge/cmpiOpenDRIM_PCIBridge.cpp0000644000175000017500000005463111400674237026261 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_PCIBridge.h" CMPIObjectPath* PCI_OpenDRIM_PCIBridge_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PCIBridge& instance) { _E_; Objectpath op(broker, OpenDRIM_PCIBridge_classnames[0], OpenDRIM_PCIBridge_NAMESPACE); if (!instance.SystemCreationClassName_isNULL) op.addKey("SystemCreationClassName", instance.SystemCreationClassName); if (!instance.SystemName_isNULL) op.addKey("SystemName", instance.SystemName); if (!instance.CreationClassName_isNULL) op.addKey("CreationClassName", instance.CreationClassName); if (!instance.DeviceID_isNULL) op.addKey("DeviceID", instance.DeviceID); _L_; return op.getHdl(); } CMPIInstance* PCI_OpenDRIM_PCIBridge_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PCIBridge& instance) { _E_; Objectpath op(broker, PCI_OpenDRIM_PCIBridge_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.InstanceID_isNULL) ci.setProperty("InstanceID", instance.InstanceID); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.InstallDate_isNULL) ci.setPropertyDatetime("InstallDate", instance.InstallDate); if (!instance.Name_isNULL) ci.setProperty("Name", instance.Name); if (!instance.OperationalStatus_isNULL) ci.setProperty("OperationalStatus", instance.OperationalStatus); if (!instance.StatusDescriptions_isNULL) ci.setProperty("StatusDescriptions", instance.StatusDescriptions); if (!instance.Status_isNULL) ci.setProperty("Status", instance.Status); if (!instance.HealthState_isNULL) ci.setProperty("HealthState", instance.HealthState); if (!instance.CommunicationStatus_isNULL) ci.setProperty("CommunicationStatus", instance.CommunicationStatus); if (!instance.DetailedStatus_isNULL) ci.setProperty("DetailedStatus", instance.DetailedStatus); if (!instance.OperatingStatus_isNULL) ci.setProperty("OperatingStatus", instance.OperatingStatus); if (!instance.PrimaryStatus_isNULL) ci.setProperty("PrimaryStatus", instance.PrimaryStatus); if (!instance.EnabledState_isNULL) ci.setProperty("EnabledState", instance.EnabledState); if (!instance.OtherEnabledState_isNULL) ci.setProperty("OtherEnabledState", instance.OtherEnabledState); if (!instance.RequestedState_isNULL) ci.setProperty("RequestedState", instance.RequestedState); if (!instance.EnabledDefault_isNULL) ci.setProperty("EnabledDefault", instance.EnabledDefault); if (!instance.TimeOfLastStateChange_isNULL) ci.setPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange); if (!instance.AvailableRequestedStates_isNULL) ci.setProperty("AvailableRequestedStates", instance.AvailableRequestedStates); if (!instance.TransitioningToState_isNULL) ci.setProperty("TransitioningToState", instance.TransitioningToState); if (!instance.PowerManagementSupported_isNULL) ci.setProperty("PowerManagementSupported", instance.PowerManagementSupported); if (!instance.PowerManagementCapabilities_isNULL) ci.setProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities); if (!instance.Availability_isNULL) ci.setProperty("Availability", instance.Availability); if (!instance.StatusInfo_isNULL) ci.setProperty("StatusInfo", instance.StatusInfo); if (!instance.LastErrorCode_isNULL) ci.setProperty("LastErrorCode", instance.LastErrorCode); if (!instance.ErrorDescription_isNULL) ci.setProperty("ErrorDescription", instance.ErrorDescription); if (!instance.ErrorCleared_isNULL) ci.setProperty("ErrorCleared", instance.ErrorCleared); if (!instance.OtherIdentifyingInfo_isNULL) ci.setProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo); if (!instance.PowerOnHours_isNULL) ci.setProperty("PowerOnHours", instance.PowerOnHours); if (!instance.TotalPowerOnHours_isNULL) ci.setProperty("TotalPowerOnHours", instance.TotalPowerOnHours); if (!instance.IdentifyingDescriptions_isNULL) ci.setProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions); if (!instance.AdditionalAvailability_isNULL) ci.setProperty("AdditionalAvailability", instance.AdditionalAvailability); if (!instance.MaxQuiesceTime_isNULL) ci.setProperty("MaxQuiesceTime", instance.MaxQuiesceTime); if (!instance.TimeOfLastReset_isNULL) ci.setPropertyDatetime("TimeOfLastReset", instance.TimeOfLastReset); if (!instance.ProtocolSupported_isNULL) ci.setProperty("ProtocolSupported", instance.ProtocolSupported); if (!instance.MaxNumberControlled_isNULL) ci.setProperty("MaxNumberControlled", instance.MaxNumberControlled); if (!instance.ProtocolDescription_isNULL) ci.setProperty("ProtocolDescription", instance.ProtocolDescription); if (!instance.CommandRegister_isNULL) ci.setProperty("CommandRegister", instance.CommandRegister); if (!instance.Capabilities_isNULL) ci.setProperty("Capabilities", instance.Capabilities); if (!instance.CapabilityDescriptions_isNULL) ci.setProperty("CapabilityDescriptions", instance.CapabilityDescriptions); if (!instance.DeviceSelectTiming_isNULL) ci.setProperty("DeviceSelectTiming", instance.DeviceSelectTiming); if (!instance.ClassCode_isNULL) ci.setProperty("ClassCode", instance.ClassCode); if (!instance.CacheLineSize_isNULL) ci.setProperty("CacheLineSize", instance.CacheLineSize); if (!instance.LatencyTimer_isNULL) ci.setProperty("LatencyTimer", instance.LatencyTimer); if (!instance.InterruptPin_isNULL) ci.setProperty("InterruptPin", instance.InterruptPin); if (!instance.ExpansionROMBaseAddress_isNULL) ci.setProperty("ExpansionROMBaseAddress", instance.ExpansionROMBaseAddress); if (!instance.SelfTestEnabled_isNULL) ci.setProperty("SelfTestEnabled", instance.SelfTestEnabled); if (!instance.BaseAddress_isNULL) ci.setProperty("BaseAddress", instance.BaseAddress); if (!instance.SubsystemID_isNULL) ci.setProperty("SubsystemID", instance.SubsystemID); if (!instance.SubsystemVendorID_isNULL) ci.setProperty("SubsystemVendorID", instance.SubsystemVendorID); if (!instance.MinGrantTime_isNULL) ci.setProperty("MinGrantTime", instance.MinGrantTime); if (!instance.MaxLatency_isNULL) ci.setProperty("MaxLatency", instance.MaxLatency); if (!instance.BusNumber_isNULL) ci.setProperty("BusNumber", instance.BusNumber); if (!instance.DeviceNumber_isNULL) ci.setProperty("DeviceNumber", instance.DeviceNumber); if (!instance.FunctionNumber_isNULL) ci.setProperty("FunctionNumber", instance.FunctionNumber); if (!instance.PCIDeviceID_isNULL) ci.setProperty("PCIDeviceID", instance.PCIDeviceID); if (!instance.VendorID_isNULL) ci.setProperty("VendorID", instance.VendorID); if (!instance.RevisionID_isNULL) ci.setProperty("RevisionID", instance.RevisionID); if (!instance.BridgeType_isNULL) ci.setProperty("BridgeType", instance.BridgeType); if (!instance.SecondaryLatencyTimer_isNULL) ci.setProperty("SecondaryLatencyTimer", instance.SecondaryLatencyTimer); if (!instance.SubordinateBusNumber_isNULL) ci.setProperty("SubordinateBusNumber", instance.SubordinateBusNumber); if (!instance.SecondayBusNumber_isNULL) ci.setProperty("SecondayBusNumber", instance.SecondayBusNumber); if (!instance.PrimaryBusNumber_isNULL) ci.setProperty("PrimaryBusNumber", instance.PrimaryBusNumber); if (!instance.SecondaryStatusRegister_isNULL) ci.setProperty("SecondaryStatusRegister", instance.SecondaryStatusRegister); if (!instance.SecondaryBusDeviceSelectTiming_isNULL) ci.setProperty("SecondaryBusDeviceSelectTiming", instance.SecondaryBusDeviceSelectTiming); if (!instance.IOLimit_isNULL) ci.setProperty("IOLimit", instance.IOLimit); if (!instance.IOBase_isNULL) ci.setProperty("IOBase", instance.IOBase); if (!instance.MemoryLimit_isNULL) ci.setProperty("MemoryLimit", instance.MemoryLimit); if (!instance.MemoryBase_isNULL) ci.setProperty("MemoryBase", instance.MemoryBase); if (!instance.PrefetchMemoryLimit_isNULL) ci.setProperty("PrefetchMemoryLimit", instance.PrefetchMemoryLimit); if (!instance.PrefetchMemoryBase_isNULL) ci.setProperty("PrefetchMemoryBase", instance.PrefetchMemoryBase); if (!instance.PrefetchLimitUpper32_isNULL) ci.setProperty("PrefetchLimitUpper32", instance.PrefetchLimitUpper32); if (!instance.PrefetchBaseUpper32_isNULL) ci.setProperty("PrefetchBaseUpper32", instance.PrefetchBaseUpper32); if (!instance.IOLimitUpper16_isNULL) ci.setProperty("IOLimitUpper16", instance.IOLimitUpper16); if (!instance.IOBaseUpper16_isNULL) ci.setProperty("IOBaseUpper16", instance.IOBaseUpper16); _L_; return ci.getHdl(); } void PCI_OpenDRIM_PCIBridge_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PCIBridge& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (op.getKey("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (op.getKey("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (op.getKey("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; _L_; } void PCI_OpenDRIM_PCIBridge_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PCIBridge& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getPropertyDatetime("InstallDate", instance.InstallDate) == OK) instance.InstallDate_isNULL = false; if (inst.getProperty("Name", instance.Name) == OK) instance.Name_isNULL = false; if (inst.getProperty("OperationalStatus", instance.OperationalStatus) == OK) instance.OperationalStatus_isNULL = false; if (inst.getProperty("StatusDescriptions", instance.StatusDescriptions) == OK) instance.StatusDescriptions_isNULL = false; if (inst.getProperty("Status", instance.Status) == OK) instance.Status_isNULL = false; if (inst.getProperty("HealthState", instance.HealthState) == OK) instance.HealthState_isNULL = false; if (inst.getProperty("CommunicationStatus", instance.CommunicationStatus) == OK) instance.CommunicationStatus_isNULL = false; if (inst.getProperty("DetailedStatus", instance.DetailedStatus) == OK) instance.DetailedStatus_isNULL = false; if (inst.getProperty("OperatingStatus", instance.OperatingStatus) == OK) instance.OperatingStatus_isNULL = false; if (inst.getProperty("PrimaryStatus", instance.PrimaryStatus) == OK) instance.PrimaryStatus_isNULL = false; if (inst.getProperty("EnabledState", instance.EnabledState) == OK) instance.EnabledState_isNULL = false; if (inst.getProperty("OtherEnabledState", instance.OtherEnabledState) == OK) instance.OtherEnabledState_isNULL = false; if (inst.getProperty("RequestedState", instance.RequestedState) == OK) instance.RequestedState_isNULL = false; if (inst.getProperty("EnabledDefault", instance.EnabledDefault) == OK) instance.EnabledDefault_isNULL = false; if (inst.getPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange) == OK) instance.TimeOfLastStateChange_isNULL = false; if (inst.getProperty("AvailableRequestedStates", instance.AvailableRequestedStates) == OK) instance.AvailableRequestedStates_isNULL = false; if (inst.getProperty("TransitioningToState", instance.TransitioningToState) == OK) instance.TransitioningToState_isNULL = false; if (inst.getProperty("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (inst.getProperty("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (inst.getProperty("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; if (inst.getProperty("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (inst.getProperty("PowerManagementSupported", instance.PowerManagementSupported) == OK) instance.PowerManagementSupported_isNULL = false; if (inst.getProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities) == OK) instance.PowerManagementCapabilities_isNULL = false; if (inst.getProperty("Availability", instance.Availability) == OK) instance.Availability_isNULL = false; if (inst.getProperty("StatusInfo", instance.StatusInfo) == OK) instance.StatusInfo_isNULL = false; if (inst.getProperty("LastErrorCode", instance.LastErrorCode) == OK) instance.LastErrorCode_isNULL = false; if (inst.getProperty("ErrorDescription", instance.ErrorDescription) == OK) instance.ErrorDescription_isNULL = false; if (inst.getProperty("ErrorCleared", instance.ErrorCleared) == OK) instance.ErrorCleared_isNULL = false; if (inst.getProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo) == OK) instance.OtherIdentifyingInfo_isNULL = false; if (inst.getProperty("PowerOnHours", instance.PowerOnHours) == OK) instance.PowerOnHours_isNULL = false; if (inst.getProperty("TotalPowerOnHours", instance.TotalPowerOnHours) == OK) instance.TotalPowerOnHours_isNULL = false; if (inst.getProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions) == OK) instance.IdentifyingDescriptions_isNULL = false; if (inst.getProperty("AdditionalAvailability", instance.AdditionalAvailability) == OK) instance.AdditionalAvailability_isNULL = false; if (inst.getProperty("MaxQuiesceTime", instance.MaxQuiesceTime) == OK) instance.MaxQuiesceTime_isNULL = false; if (inst.getPropertyDatetime("TimeOfLastReset", instance.TimeOfLastReset) == OK) instance.TimeOfLastReset_isNULL = false; if (inst.getProperty("ProtocolSupported", instance.ProtocolSupported) == OK) instance.ProtocolSupported_isNULL = false; if (inst.getProperty("MaxNumberControlled", instance.MaxNumberControlled) == OK) instance.MaxNumberControlled_isNULL = false; if (inst.getProperty("ProtocolDescription", instance.ProtocolDescription) == OK) instance.ProtocolDescription_isNULL = false; if (inst.getProperty("CommandRegister", instance.CommandRegister) == OK) instance.CommandRegister_isNULL = false; if (inst.getProperty("Capabilities", instance.Capabilities) == OK) instance.Capabilities_isNULL = false; if (inst.getProperty("CapabilityDescriptions", instance.CapabilityDescriptions) == OK) instance.CapabilityDescriptions_isNULL = false; if (inst.getProperty("DeviceSelectTiming", instance.DeviceSelectTiming) == OK) instance.DeviceSelectTiming_isNULL = false; if (inst.getProperty("ClassCode", instance.ClassCode) == OK) instance.ClassCode_isNULL = false; if (inst.getProperty("CacheLineSize", instance.CacheLineSize) == OK) instance.CacheLineSize_isNULL = false; if (inst.getProperty("LatencyTimer", instance.LatencyTimer) == OK) instance.LatencyTimer_isNULL = false; if (inst.getProperty("InterruptPin", instance.InterruptPin) == OK) instance.InterruptPin_isNULL = false; if (inst.getProperty("ExpansionROMBaseAddress", instance.ExpansionROMBaseAddress) == OK) instance.ExpansionROMBaseAddress_isNULL = false; if (inst.getProperty("SelfTestEnabled", instance.SelfTestEnabled) == OK) instance.SelfTestEnabled_isNULL = false; if (inst.getProperty("BaseAddress", instance.BaseAddress) == OK) instance.BaseAddress_isNULL = false; if (inst.getProperty("SubsystemID", instance.SubsystemID) == OK) instance.SubsystemID_isNULL = false; if (inst.getProperty("SubsystemVendorID", instance.SubsystemVendorID) == OK) instance.SubsystemVendorID_isNULL = false; if (inst.getProperty("MinGrantTime", instance.MinGrantTime) == OK) instance.MinGrantTime_isNULL = false; if (inst.getProperty("MaxLatency", instance.MaxLatency) == OK) instance.MaxLatency_isNULL = false; if (inst.getProperty("BusNumber", instance.BusNumber) == OK) instance.BusNumber_isNULL = false; if (inst.getProperty("DeviceNumber", instance.DeviceNumber) == OK) instance.DeviceNumber_isNULL = false; if (inst.getProperty("FunctionNumber", instance.FunctionNumber) == OK) instance.FunctionNumber_isNULL = false; if (inst.getProperty("PCIDeviceID", instance.PCIDeviceID) == OK) instance.PCIDeviceID_isNULL = false; if (inst.getProperty("VendorID", instance.VendorID) == OK) instance.VendorID_isNULL = false; if (inst.getProperty("RevisionID", instance.RevisionID) == OK) instance.RevisionID_isNULL = false; if (inst.getProperty("BridgeType", instance.BridgeType) == OK) instance.BridgeType_isNULL = false; if (inst.getProperty("SecondaryLatencyTimer", instance.SecondaryLatencyTimer) == OK) instance.SecondaryLatencyTimer_isNULL = false; if (inst.getProperty("SubordinateBusNumber", instance.SubordinateBusNumber) == OK) instance.SubordinateBusNumber_isNULL = false; if (inst.getProperty("SecondayBusNumber", instance.SecondayBusNumber) == OK) instance.SecondayBusNumber_isNULL = false; if (inst.getProperty("PrimaryBusNumber", instance.PrimaryBusNumber) == OK) instance.PrimaryBusNumber_isNULL = false; if (inst.getProperty("SecondaryStatusRegister", instance.SecondaryStatusRegister) == OK) instance.SecondaryStatusRegister_isNULL = false; if (inst.getProperty("SecondaryBusDeviceSelectTiming", instance.SecondaryBusDeviceSelectTiming) == OK) instance.SecondaryBusDeviceSelectTiming_isNULL = false; if (inst.getProperty("IOLimit", instance.IOLimit) == OK) instance.IOLimit_isNULL = false; if (inst.getProperty("IOBase", instance.IOBase) == OK) instance.IOBase_isNULL = false; if (inst.getProperty("MemoryLimit", instance.MemoryLimit) == OK) instance.MemoryLimit_isNULL = false; if (inst.getProperty("MemoryBase", instance.MemoryBase) == OK) instance.MemoryBase_isNULL = false; if (inst.getProperty("PrefetchMemoryLimit", instance.PrefetchMemoryLimit) == OK) instance.PrefetchMemoryLimit_isNULL = false; if (inst.getProperty("PrefetchMemoryBase", instance.PrefetchMemoryBase) == OK) instance.PrefetchMemoryBase_isNULL = false; if (inst.getProperty("PrefetchLimitUpper32", instance.PrefetchLimitUpper32) == OK) instance.PrefetchLimitUpper32_isNULL = false; if (inst.getProperty("PrefetchBaseUpper32", instance.PrefetchBaseUpper32) == OK) instance.PrefetchBaseUpper32_isNULL = false; if (inst.getProperty("IOLimitUpper16", instance.IOLimitUpper16) == OK) instance.IOLimitUpper16_isNULL = false; if (inst.getProperty("IOBaseUpper16", instance.IOBaseUpper16) == OK) instance.IOBaseUpper16_isNULL = false; _L_; } void PCI_OpenDRIM_PCIBridge_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIBridge_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 PCI_OpenDRIM_PCIBridge_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_PCIBridge_RequestStateChange_Out& args) { _E_; CMPIValue value; int errorMessage; Objectpath Job; errorMessage = args.getJob(Job); if (errorMessage == OK) { value = CT_toCMPI(Job); out->ft->addArg(out, "Job", &value, CMPI_ref); } _L_; } void PCI_OpenDRIM_PCIBridge_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIBridge_SetPowerState_In& args) { _E_; CMPIStatus rc; CMPIData data; unsigned short PowerState; data = in->ft->getArg(in, "PowerState", &rc); if (rc.rc == OK) { CT_ToC(data, PowerState); args.setPowerState(PowerState); } string Time; data = in->ft->getArg(in, "Time", &rc); if (rc.rc == OK) { CT_ToCDatetime(data, Time); args.setTime(Time); } _L_; } void PCI_OpenDRIM_PCIBridge_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIBridge_EnableDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Enabled; data = in->ft->getArg(in, "Enabled", &rc); if (rc.rc == OK) { CT_ToC(data, Enabled); args.setEnabled(Enabled); } _L_; } void PCI_OpenDRIM_PCIBridge_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIBridge_OnlineDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Online; data = in->ft->getArg(in, "Online", &rc); if (rc.rc == OK) { CT_ToC(data, Online); args.setOnline(Online); } _L_; } void PCI_OpenDRIM_PCIBridge_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIBridge_QuiesceDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Quiesce; data = in->ft->getArg(in, "Quiesce", &rc); if (rc.rc == OK) { CT_ToC(data, Quiesce); args.setQuiesce(Quiesce); } _L_; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIBridge/OpenDRIM_PCIBridgeAccess.cpp0000644000175000017500000001231111400674237026517 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_PCIBridgeAccess.h" int PCI_OpenDRIM_PCIBridge_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int PCI_OpenDRIM_PCIBridge_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int PCI_OpenDRIM_PCIBridge_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIBridge_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PCIBridge& instance, const char** properties, string& errorMessage) { _E_; _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIBridge_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& newInstance, const OpenDRIM_PCIBridge& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIBridge_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIBridge_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIBridge_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, unsigned int& returnValue, const OpenDRIM_PCIBridge_RequestStateChange_In& in, OpenDRIM_PCIBridge_RequestStateChange_Out& out, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIBridge_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, unsigned int& returnValue, const OpenDRIM_PCIBridge_SetPowerState_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIBridge_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIBridge_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, unsigned int& returnValue, const OpenDRIM_PCIBridge_EnableDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIBridge_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, unsigned int& returnValue, const OpenDRIM_PCIBridge_OnlineDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIBridge_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, unsigned int& returnValue, const OpenDRIM_PCIBridge_QuiesceDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIBridge_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIBridge_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIBridge_BISTExecution(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PCIBridge& instance, unsigned char& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_PCIBridge_populate(OpenDRIM_PCIBridge& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIBridge/cmpiOpenDRIM_PCIBridge.h0000644000175000017500000000552711400674237025726 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_PCIBRIDGE_H_ #define CMPIOPENDRIM_PCIBRIDGE_H_ #include "OpenDRIM_PCIBridge.h" CMPIObjectPath* PCI_OpenDRIM_PCIBridge_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PCIBridge& instance); CMPIInstance* PCI_OpenDRIM_PCIBridge_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PCIBridge& instance); void PCI_OpenDRIM_PCIBridge_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PCIBridge& instance); void PCI_OpenDRIM_PCIBridge_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PCIBridge& instance); void PCI_OpenDRIM_PCIBridge_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIBridge_RequestStateChange_In& args); void PCI_OpenDRIM_PCIBridge_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_PCIBridge_RequestStateChange_Out& args); void PCI_OpenDRIM_PCIBridge_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIBridge_SetPowerState_In& args); void PCI_OpenDRIM_PCIBridge_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIBridge_EnableDevice_In& args); void PCI_OpenDRIM_PCIBridge_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIBridge_OnlineDevice_In& args); void PCI_OpenDRIM_PCIBridge_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PCIBridge_QuiesceDevice_In& args); #endif /*CMPIOPENDRIM_PCIBRIDGE_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_PCIBridge/OpenDRIM_PCIBridge.h0000644000175000017500000011005111400674237025042 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PCIBRIDGE_H_ #define OPENDRIM_PCIBRIDGE_H_ #include const static char* OpenDRIM_PCIBridge_classnames[] = {"OpenDRIM_PCIBridge"}; static string OpenDRIM_PCIBridge_NAMESPACE = _NAMESPACE; class OpenDRIM_PCIBridge { public: string InstanceID; bool InstanceID_isNULL; string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string InstallDate; bool InstallDate_isNULL; string Name; bool Name_isNULL; vector OperationalStatus; bool OperationalStatus_isNULL; vector StatusDescriptions; bool StatusDescriptions_isNULL; string Status; bool Status_isNULL; unsigned short HealthState; bool HealthState_isNULL; unsigned short CommunicationStatus; bool CommunicationStatus_isNULL; unsigned short DetailedStatus; bool DetailedStatus_isNULL; unsigned short OperatingStatus; bool OperatingStatus_isNULL; unsigned short PrimaryStatus; bool PrimaryStatus_isNULL; unsigned short EnabledState; bool EnabledState_isNULL; string OtherEnabledState; bool OtherEnabledState_isNULL; unsigned short RequestedState; bool RequestedState_isNULL; unsigned short EnabledDefault; bool EnabledDefault_isNULL; string TimeOfLastStateChange; bool TimeOfLastStateChange_isNULL; vector AvailableRequestedStates; bool AvailableRequestedStates_isNULL; unsigned short TransitioningToState; bool TransitioningToState_isNULL; string SystemCreationClassName; bool SystemCreationClassName_isNULL; string SystemName; bool SystemName_isNULL; string CreationClassName; bool CreationClassName_isNULL; string DeviceID; bool DeviceID_isNULL; bool PowerManagementSupported; bool PowerManagementSupported_isNULL; vector PowerManagementCapabilities; bool PowerManagementCapabilities_isNULL; unsigned short Availability; bool Availability_isNULL; unsigned short StatusInfo; bool StatusInfo_isNULL; unsigned int LastErrorCode; bool LastErrorCode_isNULL; string ErrorDescription; bool ErrorDescription_isNULL; bool ErrorCleared; bool ErrorCleared_isNULL; vector OtherIdentifyingInfo; bool OtherIdentifyingInfo_isNULL; unsigned long long PowerOnHours; bool PowerOnHours_isNULL; unsigned long long TotalPowerOnHours; bool TotalPowerOnHours_isNULL; vector IdentifyingDescriptions; bool IdentifyingDescriptions_isNULL; vector AdditionalAvailability; bool AdditionalAvailability_isNULL; unsigned long long MaxQuiesceTime; bool MaxQuiesceTime_isNULL; string TimeOfLastReset; bool TimeOfLastReset_isNULL; unsigned short ProtocolSupported; bool ProtocolSupported_isNULL; unsigned int MaxNumberControlled; bool MaxNumberControlled_isNULL; string ProtocolDescription; bool ProtocolDescription_isNULL; unsigned short CommandRegister; bool CommandRegister_isNULL; vector Capabilities; bool Capabilities_isNULL; vector CapabilityDescriptions; bool CapabilityDescriptions_isNULL; unsigned short DeviceSelectTiming; bool DeviceSelectTiming_isNULL; unsigned char ClassCode; bool ClassCode_isNULL; unsigned char CacheLineSize; bool CacheLineSize_isNULL; unsigned char LatencyTimer; bool LatencyTimer_isNULL; unsigned short InterruptPin; bool InterruptPin_isNULL; unsigned int ExpansionROMBaseAddress; bool ExpansionROMBaseAddress_isNULL; bool SelfTestEnabled; bool SelfTestEnabled_isNULL; vector BaseAddress; bool BaseAddress_isNULL; unsigned short SubsystemID; bool SubsystemID_isNULL; unsigned short SubsystemVendorID; bool SubsystemVendorID_isNULL; unsigned char MinGrantTime; bool MinGrantTime_isNULL; unsigned char MaxLatency; bool MaxLatency_isNULL; unsigned char BusNumber; bool BusNumber_isNULL; unsigned char DeviceNumber; bool DeviceNumber_isNULL; unsigned char FunctionNumber; bool FunctionNumber_isNULL; unsigned short PCIDeviceID; bool PCIDeviceID_isNULL; unsigned short VendorID; bool VendorID_isNULL; unsigned char RevisionID; bool RevisionID_isNULL; unsigned short BridgeType; bool BridgeType_isNULL; unsigned char SecondaryLatencyTimer; bool SecondaryLatencyTimer_isNULL; unsigned char SubordinateBusNumber; bool SubordinateBusNumber_isNULL; unsigned char SecondayBusNumber; bool SecondayBusNumber_isNULL; unsigned char PrimaryBusNumber; bool PrimaryBusNumber_isNULL; unsigned short SecondaryStatusRegister; bool SecondaryStatusRegister_isNULL; unsigned short SecondaryBusDeviceSelectTiming; bool SecondaryBusDeviceSelectTiming_isNULL; unsigned char IOLimit; bool IOLimit_isNULL; unsigned char IOBase; bool IOBase_isNULL; unsigned short MemoryLimit; bool MemoryLimit_isNULL; unsigned short MemoryBase; bool MemoryBase_isNULL; unsigned short PrefetchMemoryLimit; bool PrefetchMemoryLimit_isNULL; unsigned short PrefetchMemoryBase; bool PrefetchMemoryBase_isNULL; unsigned int PrefetchLimitUpper32; bool PrefetchLimitUpper32_isNULL; unsigned int PrefetchBaseUpper32; bool PrefetchBaseUpper32_isNULL; unsigned short IOLimitUpper16; bool IOLimitUpper16_isNULL; unsigned short IOBaseUpper16; bool IOBaseUpper16_isNULL; OpenDRIM_PCIBridge() { InstanceID_isNULL = true; Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstallDate_isNULL = true; Name_isNULL = true; OperationalStatus_isNULL = true; StatusDescriptions_isNULL = true; Status_isNULL = true; HealthState_isNULL = true; CommunicationStatus_isNULL = true; DetailedStatus_isNULL = true; OperatingStatus_isNULL = true; PrimaryStatus_isNULL = true; EnabledState_isNULL = true; OtherEnabledState_isNULL = true; RequestedState_isNULL = true; EnabledDefault_isNULL = true; TimeOfLastStateChange_isNULL = true; AvailableRequestedStates_isNULL = true; TransitioningToState_isNULL = true; SystemCreationClassName_isNULL = true; SystemName_isNULL = true; CreationClassName_isNULL = true; DeviceID_isNULL = true; PowerManagementSupported_isNULL = true; PowerManagementCapabilities_isNULL = true; Availability_isNULL = true; StatusInfo_isNULL = true; LastErrorCode_isNULL = true; ErrorDescription_isNULL = true; ErrorCleared_isNULL = true; OtherIdentifyingInfo_isNULL = true; PowerOnHours_isNULL = true; TotalPowerOnHours_isNULL = true; IdentifyingDescriptions_isNULL = true; AdditionalAvailability_isNULL = true; MaxQuiesceTime_isNULL = true; TimeOfLastReset_isNULL = true; ProtocolSupported_isNULL = true; MaxNumberControlled_isNULL = true; ProtocolDescription_isNULL = true; CommandRegister_isNULL = true; Capabilities_isNULL = true; CapabilityDescriptions_isNULL = true; DeviceSelectTiming_isNULL = true; ClassCode_isNULL = true; CacheLineSize_isNULL = true; LatencyTimer_isNULL = true; InterruptPin_isNULL = true; ExpansionROMBaseAddress_isNULL = true; SelfTestEnabled_isNULL = true; BaseAddress_isNULL = true; SubsystemID_isNULL = true; SubsystemVendorID_isNULL = true; MinGrantTime_isNULL = true; MaxLatency_isNULL = true; BusNumber_isNULL = true; DeviceNumber_isNULL = true; FunctionNumber_isNULL = true; PCIDeviceID_isNULL = true; VendorID_isNULL = true; RevisionID_isNULL = true; BridgeType_isNULL = true; SecondaryLatencyTimer_isNULL = true; SubordinateBusNumber_isNULL = true; SecondayBusNumber_isNULL = true; PrimaryBusNumber_isNULL = true; SecondaryStatusRegister_isNULL = true; SecondaryBusDeviceSelectTiming_isNULL = true; IOLimit_isNULL = true; IOBase_isNULL = true; MemoryLimit_isNULL = true; MemoryBase_isNULL = true; PrefetchMemoryLimit_isNULL = true; PrefetchMemoryBase_isNULL = true; PrefetchLimitUpper32_isNULL = true; PrefetchBaseUpper32_isNULL = true; IOLimitUpper16_isNULL = true; IOBaseUpper16_isNULL = true; } ~OpenDRIM_PCIBridge() {} string getKeys() const { return CF_toLowCase(".SystemCreationClassName=\"" + CF_quoteString(SystemCreationClassName) + "\""".SystemName=\"" + CF_quoteString(SystemName) + "\""".CreationClassName=\"" + CF_quoteString(CreationClassName) + "\""".DeviceID=\"" + CF_quoteString(DeviceID) + "\""); } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getInstallDate(string& value) const { if (InstallDate_isNULL==true) return NOT_FOUND; value = InstallDate; return OK; } int setInstallDate(const string& newValue) { InstallDate = newValue; InstallDate_isNULL = false; return OK; } int getName(string& value) const { if (Name_isNULL==true) return NOT_FOUND; value = Name; return OK; } int setName(const string& newValue) { Name = newValue; Name_isNULL = false; return OK; } int getOperationalStatus(vector& value) const { if (OperationalStatus_isNULL==true) return NOT_FOUND; value = OperationalStatus; return OK; } int setOperationalStatus(const vector& newValue) { OperationalStatus = newValue; OperationalStatus_isNULL = false; return OK; } int getStatusDescriptions(vector& value) const { if (StatusDescriptions_isNULL==true) return NOT_FOUND; value = StatusDescriptions; return OK; } int setStatusDescriptions(const vector& newValue) { StatusDescriptions = newValue; StatusDescriptions_isNULL = false; return OK; } int getStatus(string& value) const { if (Status_isNULL==true) return NOT_FOUND; value = Status; return OK; } int setStatus(const string& newValue) { Status = newValue; Status_isNULL = false; return OK; } int getHealthState(unsigned short& value) const { if (HealthState_isNULL==true) return NOT_FOUND; value = HealthState; return OK; } int setHealthState(const unsigned short& newValue) { HealthState = newValue; HealthState_isNULL = false; return OK; } int getCommunicationStatus(unsigned short& value) const { if (CommunicationStatus_isNULL==true) return NOT_FOUND; value = CommunicationStatus; return OK; } int setCommunicationStatus(const unsigned short& newValue) { CommunicationStatus = newValue; CommunicationStatus_isNULL = false; return OK; } int getDetailedStatus(unsigned short& value) const { if (DetailedStatus_isNULL==true) return NOT_FOUND; value = DetailedStatus; return OK; } int setDetailedStatus(const unsigned short& newValue) { DetailedStatus = newValue; DetailedStatus_isNULL = false; return OK; } int getOperatingStatus(unsigned short& value) const { if (OperatingStatus_isNULL==true) return NOT_FOUND; value = OperatingStatus; return OK; } int setOperatingStatus(const unsigned short& newValue) { OperatingStatus = newValue; OperatingStatus_isNULL = false; return OK; } int getPrimaryStatus(unsigned short& value) const { if (PrimaryStatus_isNULL==true) return NOT_FOUND; value = PrimaryStatus; return OK; } int setPrimaryStatus(const unsigned short& newValue) { PrimaryStatus = newValue; PrimaryStatus_isNULL = false; return OK; } int getEnabledState(unsigned short& value) const { if (EnabledState_isNULL==true) return NOT_FOUND; value = EnabledState; return OK; } int setEnabledState(const unsigned short& newValue) { EnabledState = newValue; EnabledState_isNULL = false; return OK; } int getOtherEnabledState(string& value) const { if (OtherEnabledState_isNULL==true) return NOT_FOUND; value = OtherEnabledState; return OK; } int setOtherEnabledState(const string& newValue) { OtherEnabledState = newValue; OtherEnabledState_isNULL = false; return OK; } int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL==true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getEnabledDefault(unsigned short& value) const { if (EnabledDefault_isNULL==true) return NOT_FOUND; value = EnabledDefault; return OK; } int setEnabledDefault(const unsigned short& newValue) { EnabledDefault = newValue; EnabledDefault_isNULL = false; return OK; } int getTimeOfLastStateChange(string& value) const { if (TimeOfLastStateChange_isNULL==true) return NOT_FOUND; value = TimeOfLastStateChange; return OK; } int setTimeOfLastStateChange(const string& newValue) { TimeOfLastStateChange = newValue; TimeOfLastStateChange_isNULL = false; return OK; } int getAvailableRequestedStates(vector& value) const { if (AvailableRequestedStates_isNULL==true) return NOT_FOUND; value = AvailableRequestedStates; return OK; } int setAvailableRequestedStates(const vector& newValue) { AvailableRequestedStates = newValue; AvailableRequestedStates_isNULL = false; return OK; } int getTransitioningToState(unsigned short& value) const { if (TransitioningToState_isNULL==true) return NOT_FOUND; value = TransitioningToState; return OK; } int setTransitioningToState(const unsigned short& newValue) { TransitioningToState = newValue; TransitioningToState_isNULL = false; return OK; } int getSystemCreationClassName(string& value) const { if (SystemCreationClassName_isNULL==true) return NOT_FOUND; value = SystemCreationClassName; return OK; } int setSystemCreationClassName(const string& newValue) { SystemCreationClassName = newValue; SystemCreationClassName_isNULL = false; return OK; } int getSystemName(string& value) const { if (SystemName_isNULL==true) return NOT_FOUND; value = SystemName; return OK; } int setSystemName(const string& newValue) { SystemName = newValue; SystemName_isNULL = false; return OK; } int getCreationClassName(string& value) const { if (CreationClassName_isNULL==true) return NOT_FOUND; value = CreationClassName; return OK; } int setCreationClassName(const string& newValue) { CreationClassName = newValue; CreationClassName_isNULL = false; return OK; } int getDeviceID(string& value) const { if (DeviceID_isNULL==true) return NOT_FOUND; value = DeviceID; return OK; } int setDeviceID(const string& newValue) { DeviceID = newValue; DeviceID_isNULL = false; return OK; } int getPowerManagementSupported(bool& value) const { if (PowerManagementSupported_isNULL==true) return NOT_FOUND; value = PowerManagementSupported; return OK; } int setPowerManagementSupported(const bool& newValue) { PowerManagementSupported = newValue; PowerManagementSupported_isNULL = false; return OK; } int getPowerManagementCapabilities(vector& value) const { if (PowerManagementCapabilities_isNULL==true) return NOT_FOUND; value = PowerManagementCapabilities; return OK; } int setPowerManagementCapabilities(const vector& newValue) { PowerManagementCapabilities = newValue; PowerManagementCapabilities_isNULL = false; return OK; } int getAvailability(unsigned short& value) const { if (Availability_isNULL==true) return NOT_FOUND; value = Availability; return OK; } int setAvailability(const unsigned short& newValue) { Availability = newValue; Availability_isNULL = false; return OK; } int getStatusInfo(unsigned short& value) const { if (StatusInfo_isNULL==true) return NOT_FOUND; value = StatusInfo; return OK; } int setStatusInfo(const unsigned short& newValue) { StatusInfo = newValue; StatusInfo_isNULL = false; return OK; } int getLastErrorCode(unsigned int& value) const { if (LastErrorCode_isNULL==true) return NOT_FOUND; value = LastErrorCode; return OK; } int setLastErrorCode(const unsigned int& newValue) { LastErrorCode = newValue; LastErrorCode_isNULL = false; return OK; } int getErrorDescription(string& value) const { if (ErrorDescription_isNULL==true) return NOT_FOUND; value = ErrorDescription; return OK; } int setErrorDescription(const string& newValue) { ErrorDescription = newValue; ErrorDescription_isNULL = false; return OK; } int getErrorCleared(bool& value) const { if (ErrorCleared_isNULL==true) return NOT_FOUND; value = ErrorCleared; return OK; } int setErrorCleared(const bool& newValue) { ErrorCleared = newValue; ErrorCleared_isNULL = false; return OK; } int getOtherIdentifyingInfo(vector& value) const { if (OtherIdentifyingInfo_isNULL==true) return NOT_FOUND; value = OtherIdentifyingInfo; return OK; } int setOtherIdentifyingInfo(const vector& newValue) { OtherIdentifyingInfo = newValue; OtherIdentifyingInfo_isNULL = false; return OK; } int getPowerOnHours(unsigned long long& value) const { if (PowerOnHours_isNULL==true) return NOT_FOUND; value = PowerOnHours; return OK; } int setPowerOnHours(const unsigned long long& newValue) { PowerOnHours = newValue; PowerOnHours_isNULL = false; return OK; } int getTotalPowerOnHours(unsigned long long& value) const { if (TotalPowerOnHours_isNULL==true) return NOT_FOUND; value = TotalPowerOnHours; return OK; } int setTotalPowerOnHours(const unsigned long long& newValue) { TotalPowerOnHours = newValue; TotalPowerOnHours_isNULL = false; return OK; } int getIdentifyingDescriptions(vector& value) const { if (IdentifyingDescriptions_isNULL==true) return NOT_FOUND; value = IdentifyingDescriptions; return OK; } int setIdentifyingDescriptions(const vector& newValue) { IdentifyingDescriptions = newValue; IdentifyingDescriptions_isNULL = false; return OK; } int getAdditionalAvailability(vector& value) const { if (AdditionalAvailability_isNULL==true) return NOT_FOUND; value = AdditionalAvailability; return OK; } int setAdditionalAvailability(const vector& newValue) { AdditionalAvailability = newValue; AdditionalAvailability_isNULL = false; return OK; } int getMaxQuiesceTime(unsigned long long& value) const { if (MaxQuiesceTime_isNULL==true) return NOT_FOUND; value = MaxQuiesceTime; return OK; } int setMaxQuiesceTime(const unsigned long long& newValue) { MaxQuiesceTime = newValue; MaxQuiesceTime_isNULL = false; return OK; } int getTimeOfLastReset(string& value) const { if (TimeOfLastReset_isNULL==true) return NOT_FOUND; value = TimeOfLastReset; return OK; } int setTimeOfLastReset(const string& newValue) { TimeOfLastReset = newValue; TimeOfLastReset_isNULL = false; return OK; } int getProtocolSupported(unsigned short& value) const { if (ProtocolSupported_isNULL==true) return NOT_FOUND; value = ProtocolSupported; return OK; } int setProtocolSupported(const unsigned short& newValue) { ProtocolSupported = newValue; ProtocolSupported_isNULL = false; return OK; } int getMaxNumberControlled(unsigned int& value) const { if (MaxNumberControlled_isNULL==true) return NOT_FOUND; value = MaxNumberControlled; return OK; } int setMaxNumberControlled(const unsigned int& newValue) { MaxNumberControlled = newValue; MaxNumberControlled_isNULL = false; return OK; } int getProtocolDescription(string& value) const { if (ProtocolDescription_isNULL==true) return NOT_FOUND; value = ProtocolDescription; return OK; } int setProtocolDescription(const string& newValue) { ProtocolDescription = newValue; ProtocolDescription_isNULL = false; return OK; } int getCommandRegister(unsigned short& value) const { if (CommandRegister_isNULL==true) return NOT_FOUND; value = CommandRegister; return OK; } int setCommandRegister(const unsigned short& newValue) { CommandRegister = newValue; CommandRegister_isNULL = false; return OK; } int getCapabilities(vector& value) const { if (Capabilities_isNULL==true) return NOT_FOUND; value = Capabilities; return OK; } int setCapabilities(const vector& newValue) { Capabilities = newValue; Capabilities_isNULL = false; return OK; } int getCapabilityDescriptions(vector& value) const { if (CapabilityDescriptions_isNULL==true) return NOT_FOUND; value = CapabilityDescriptions; return OK; } int setCapabilityDescriptions(const vector& newValue) { CapabilityDescriptions = newValue; CapabilityDescriptions_isNULL = false; return OK; } int getDeviceSelectTiming(unsigned short& value) const { if (DeviceSelectTiming_isNULL==true) return NOT_FOUND; value = DeviceSelectTiming; return OK; } int setDeviceSelectTiming(const unsigned short& newValue) { DeviceSelectTiming = newValue; DeviceSelectTiming_isNULL = false; return OK; } int getClassCode(unsigned char& value) const { if (ClassCode_isNULL==true) return NOT_FOUND; value = ClassCode; return OK; } int setClassCode(const unsigned char& newValue) { ClassCode = newValue; ClassCode_isNULL = false; return OK; } int getCacheLineSize(unsigned char& value) const { if (CacheLineSize_isNULL==true) return NOT_FOUND; value = CacheLineSize; return OK; } int setCacheLineSize(const unsigned char& newValue) { CacheLineSize = newValue; CacheLineSize_isNULL = false; return OK; } int getLatencyTimer(unsigned char& value) const { if (LatencyTimer_isNULL==true) return NOT_FOUND; value = LatencyTimer; return OK; } int setLatencyTimer(const unsigned char& newValue) { LatencyTimer = newValue; LatencyTimer_isNULL = false; return OK; } int getInterruptPin(unsigned short& value) const { if (InterruptPin_isNULL==true) return NOT_FOUND; value = InterruptPin; return OK; } int setInterruptPin(const unsigned short& newValue) { InterruptPin = newValue; InterruptPin_isNULL = false; return OK; } int getExpansionROMBaseAddress(unsigned int& value) const { if (ExpansionROMBaseAddress_isNULL==true) return NOT_FOUND; value = ExpansionROMBaseAddress; return OK; } int setExpansionROMBaseAddress(const unsigned int& newValue) { ExpansionROMBaseAddress = newValue; ExpansionROMBaseAddress_isNULL = false; return OK; } int getSelfTestEnabled(bool& value) const { if (SelfTestEnabled_isNULL==true) return NOT_FOUND; value = SelfTestEnabled; return OK; } int setSelfTestEnabled(const bool& newValue) { SelfTestEnabled = newValue; SelfTestEnabled_isNULL = false; return OK; } int getBaseAddress(vector& value) const { if (BaseAddress_isNULL==true) return NOT_FOUND; value = BaseAddress; return OK; } int setBaseAddress(const vector& newValue) { BaseAddress = newValue; BaseAddress_isNULL = false; return OK; } int getSubsystemID(unsigned short& value) const { if (SubsystemID_isNULL==true) return NOT_FOUND; value = SubsystemID; return OK; } int setSubsystemID(const unsigned short& newValue) { SubsystemID = newValue; SubsystemID_isNULL = false; return OK; } int getSubsystemVendorID(unsigned short& value) const { if (SubsystemVendorID_isNULL==true) return NOT_FOUND; value = SubsystemVendorID; return OK; } int setSubsystemVendorID(const unsigned short& newValue) { SubsystemVendorID = newValue; SubsystemVendorID_isNULL = false; return OK; } int getMinGrantTime(unsigned char& value) const { if (MinGrantTime_isNULL==true) return NOT_FOUND; value = MinGrantTime; return OK; } int setMinGrantTime(const unsigned char& newValue) { MinGrantTime = newValue; MinGrantTime_isNULL = false; return OK; } int getMaxLatency(unsigned char& value) const { if (MaxLatency_isNULL==true) return NOT_FOUND; value = MaxLatency; return OK; } int setMaxLatency(const unsigned char& newValue) { MaxLatency = newValue; MaxLatency_isNULL = false; return OK; } int getBusNumber(unsigned char& value) const { if (BusNumber_isNULL==true) return NOT_FOUND; value = BusNumber; return OK; } int setBusNumber(const unsigned char& newValue) { BusNumber = newValue; BusNumber_isNULL = false; return OK; } int getDeviceNumber(unsigned char& value) const { if (DeviceNumber_isNULL==true) return NOT_FOUND; value = DeviceNumber; return OK; } int setDeviceNumber(const unsigned char& newValue) { DeviceNumber = newValue; DeviceNumber_isNULL = false; return OK; } int getFunctionNumber(unsigned char& value) const { if (FunctionNumber_isNULL==true) return NOT_FOUND; value = FunctionNumber; return OK; } int setFunctionNumber(const unsigned char& newValue) { FunctionNumber = newValue; FunctionNumber_isNULL = false; return OK; } int getPCIDeviceID(unsigned short& value) const { if (PCIDeviceID_isNULL==true) return NOT_FOUND; value = PCIDeviceID; return OK; } int setPCIDeviceID(const unsigned short& newValue) { PCIDeviceID = newValue; PCIDeviceID_isNULL = false; return OK; } int getVendorID(unsigned short& value) const { if (VendorID_isNULL==true) return NOT_FOUND; value = VendorID; return OK; } int setVendorID(const unsigned short& newValue) { VendorID = newValue; VendorID_isNULL = false; return OK; } int getRevisionID(unsigned char& value) const { if (RevisionID_isNULL==true) return NOT_FOUND; value = RevisionID; return OK; } int setRevisionID(const unsigned char& newValue) { RevisionID = newValue; RevisionID_isNULL = false; return OK; } int getBridgeType(unsigned short& value) const { if (BridgeType_isNULL==true) return NOT_FOUND; value = BridgeType; return OK; } int setBridgeType(const unsigned short& newValue) { BridgeType = newValue; BridgeType_isNULL = false; return OK; } int getSecondaryLatencyTimer(unsigned char& value) const { if (SecondaryLatencyTimer_isNULL==true) return NOT_FOUND; value = SecondaryLatencyTimer; return OK; } int setSecondaryLatencyTimer(const unsigned char& newValue) { SecondaryLatencyTimer = newValue; SecondaryLatencyTimer_isNULL = false; return OK; } int getSubordinateBusNumber(unsigned char& value) const { if (SubordinateBusNumber_isNULL==true) return NOT_FOUND; value = SubordinateBusNumber; return OK; } int setSubordinateBusNumber(const unsigned char& newValue) { SubordinateBusNumber = newValue; SubordinateBusNumber_isNULL = false; return OK; } int getSecondayBusNumber(unsigned char& value) const { if (SecondayBusNumber_isNULL==true) return NOT_FOUND; value = SecondayBusNumber; return OK; } int setSecondayBusNumber(const unsigned char& newValue) { SecondayBusNumber = newValue; SecondayBusNumber_isNULL = false; return OK; } int getPrimaryBusNumber(unsigned char& value) const { if (PrimaryBusNumber_isNULL==true) return NOT_FOUND; value = PrimaryBusNumber; return OK; } int setPrimaryBusNumber(const unsigned char& newValue) { PrimaryBusNumber = newValue; PrimaryBusNumber_isNULL = false; return OK; } int getSecondaryStatusRegister(unsigned short& value) const { if (SecondaryStatusRegister_isNULL==true) return NOT_FOUND; value = SecondaryStatusRegister; return OK; } int setSecondaryStatusRegister(const unsigned short& newValue) { SecondaryStatusRegister = newValue; SecondaryStatusRegister_isNULL = false; return OK; } int getSecondaryBusDeviceSelectTiming(unsigned short& value) const { if (SecondaryBusDeviceSelectTiming_isNULL==true) return NOT_FOUND; value = SecondaryBusDeviceSelectTiming; return OK; } int setSecondaryBusDeviceSelectTiming(const unsigned short& newValue) { SecondaryBusDeviceSelectTiming = newValue; SecondaryBusDeviceSelectTiming_isNULL = false; return OK; } int getIOLimit(unsigned char& value) const { if (IOLimit_isNULL==true) return NOT_FOUND; value = IOLimit; return OK; } int setIOLimit(const unsigned char& newValue) { IOLimit = newValue; IOLimit_isNULL = false; return OK; } int getIOBase(unsigned char& value) const { if (IOBase_isNULL==true) return NOT_FOUND; value = IOBase; return OK; } int setIOBase(const unsigned char& newValue) { IOBase = newValue; IOBase_isNULL = false; return OK; } int getMemoryLimit(unsigned short& value) const { if (MemoryLimit_isNULL==true) return NOT_FOUND; value = MemoryLimit; return OK; } int setMemoryLimit(const unsigned short& newValue) { MemoryLimit = newValue; MemoryLimit_isNULL = false; return OK; } int getMemoryBase(unsigned short& value) const { if (MemoryBase_isNULL==true) return NOT_FOUND; value = MemoryBase; return OK; } int setMemoryBase(const unsigned short& newValue) { MemoryBase = newValue; MemoryBase_isNULL = false; return OK; } int getPrefetchMemoryLimit(unsigned short& value) const { if (PrefetchMemoryLimit_isNULL==true) return NOT_FOUND; value = PrefetchMemoryLimit; return OK; } int setPrefetchMemoryLimit(const unsigned short& newValue) { PrefetchMemoryLimit = newValue; PrefetchMemoryLimit_isNULL = false; return OK; } int getPrefetchMemoryBase(unsigned short& value) const { if (PrefetchMemoryBase_isNULL==true) return NOT_FOUND; value = PrefetchMemoryBase; return OK; } int setPrefetchMemoryBase(const unsigned short& newValue) { PrefetchMemoryBase = newValue; PrefetchMemoryBase_isNULL = false; return OK; } int getPrefetchLimitUpper32(unsigned int& value) const { if (PrefetchLimitUpper32_isNULL==true) return NOT_FOUND; value = PrefetchLimitUpper32; return OK; } int setPrefetchLimitUpper32(const unsigned int& newValue) { PrefetchLimitUpper32 = newValue; PrefetchLimitUpper32_isNULL = false; return OK; } int getPrefetchBaseUpper32(unsigned int& value) const { if (PrefetchBaseUpper32_isNULL==true) return NOT_FOUND; value = PrefetchBaseUpper32; return OK; } int setPrefetchBaseUpper32(const unsigned int& newValue) { PrefetchBaseUpper32 = newValue; PrefetchBaseUpper32_isNULL = false; return OK; } int getIOLimitUpper16(unsigned short& value) const { if (IOLimitUpper16_isNULL==true) return NOT_FOUND; value = IOLimitUpper16; return OK; } int setIOLimitUpper16(const unsigned short& newValue) { IOLimitUpper16 = newValue; IOLimitUpper16_isNULL = false; return OK; } int getIOBaseUpper16(unsigned short& value) const { if (IOBaseUpper16_isNULL==true) return NOT_FOUND; value = IOBaseUpper16; return OK; } int setIOBaseUpper16(const unsigned short& newValue) { IOBaseUpper16 = newValue; IOBaseUpper16_isNULL = false; return OK; } }; class OpenDRIM_PCIBridge_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_PCIBridge_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_PCIBridge_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_PCIBridge_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_PCIBridge_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_PCIBridge_RequestStateChange_Out() {} int getJob(Objectpath& value) const { if (Job_isNULL == true) return NOT_FOUND; value = Job; return OK; } int setJob(const Objectpath& newValue) { Job = newValue; Job_isNULL = false; return OK; } }; class OpenDRIM_PCIBridge_SetPowerState_In { public: unsigned short PowerState; bool PowerState_isNULL; string Time; bool Time_isNULL; OpenDRIM_PCIBridge_SetPowerState_In() { PowerState_isNULL = true; Time_isNULL = true; } ~OpenDRIM_PCIBridge_SetPowerState_In() {} int getPowerState(unsigned short& value) const { if (PowerState_isNULL == true) return NOT_FOUND; value = PowerState; return OK; } int setPowerState(const unsigned short& newValue) { PowerState = newValue; PowerState_isNULL = false; return OK; } int getTime(string& value) const { if (Time_isNULL == true) return NOT_FOUND; value = Time; return OK; } int setTime(const string& newValue) { Time = newValue; Time_isNULL = false; return OK; } }; class OpenDRIM_PCIBridge_EnableDevice_In { public: bool Enabled; bool Enabled_isNULL; OpenDRIM_PCIBridge_EnableDevice_In() { Enabled_isNULL = true; } ~OpenDRIM_PCIBridge_EnableDevice_In() {} int getEnabled(bool& value) const { if (Enabled_isNULL == true) return NOT_FOUND; value = Enabled; return OK; } int setEnabled(const bool& newValue) { Enabled = newValue; Enabled_isNULL = false; return OK; } }; class OpenDRIM_PCIBridge_OnlineDevice_In { public: bool Online; bool Online_isNULL; OpenDRIM_PCIBridge_OnlineDevice_In() { Online_isNULL = true; } ~OpenDRIM_PCIBridge_OnlineDevice_In() {} int getOnline(bool& value) const { if (Online_isNULL == true) return NOT_FOUND; value = Online; return OK; } int setOnline(const bool& newValue) { Online = newValue; Online_isNULL = false; return OK; } }; class OpenDRIM_PCIBridge_QuiesceDevice_In { public: bool Quiesce; bool Quiesce_isNULL; OpenDRIM_PCIBridge_QuiesceDevice_In() { Quiesce_isNULL = true; } ~OpenDRIM_PCIBridge_QuiesceDevice_In() {} int getQuiesce(bool& value) const { if (Quiesce_isNULL == true) return NOT_FOUND; value = Quiesce; return OK; } int setQuiesce(const bool& newValue) { Quiesce = newValue; Quiesce_isNULL = false; return OK; } }; #endif /*OPENDRIM_PCIBRIDGE_H_*/ opendrim-lmp-pci-1.0.0~ppa/NEWS0000644000175000017500000000017511400674237017023 0ustar guillaumeguillaumeInitial Release 1.0.0 ========================= // TODO Changes in Major.Minor.Revision ========================= // TODO opendrim-lmp-pci-1.0.0~ppa/LICENSE0000644000175000017500000000276311400674237017336 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_EnabledPCICapabilities/0000755000175000017500000000000011400674237024156 5ustar guillaumeguillaumeopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_EnabledPCICapabilities/Makefile.am0000644000175000017500000000411611400674237026214 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPCI_OpenDRIM_EnabledPCICapabilitiesProvider.la libcmpiPCI_OpenDRIM_EnabledPCICapabilitiesProvider_la_SOURCES = OpenDRIM_EnabledPCICapabilitiesAccess.cpp OpenDRIM_EnabledPCICapabilitiesProvider.cpp cmpiOpenDRIM_EnabledPCICapabilities.cpp libcmpiPCI_OpenDRIM_EnabledPCICapabilitiesProvider_la_LIBADD = ../Common/libcmpiPCI_Common.la libcmpiPCI_OpenDRIM_EnabledPCICapabilitiesProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_EnabledPCICapabilities.h OpenDRIM_EnabledPCICapabilities.h OpenDRIM_EnabledPCICapabilitiesAccess.h opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_EnabledPCICapabilities/cmpiOpenDRIM_EnabledPCICapabilities.h0000644000175000017500000000506511400674237033043 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_ENABLEDPCICAPABILITIES_H_ #define CMPIOPENDRIM_ENABLEDPCICAPABILITIES_H_ #include "OpenDRIM_EnabledPCICapabilities.h" CMPIObjectPath* PCI_OpenDRIM_EnabledPCICapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_EnabledPCICapabilities& instance); CMPIInstance* PCI_OpenDRIM_EnabledPCICapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_EnabledPCICapabilities& instance); void PCI_OpenDRIM_EnabledPCICapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_EnabledPCICapabilities& instance); void PCI_OpenDRIM_EnabledPCICapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_EnabledPCICapabilities& instance); void PCI_OpenDRIM_EnabledPCICapabilities_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_EnabledPCICapabilities_CreateGoalSettings_In& args); void PCI_OpenDRIM_EnabledPCICapabilities_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_EnabledPCICapabilities_CreateGoalSettings_Out& args); #endif /*CMPIOPENDRIM_ENABLEDPCICAPABILITIES_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_EnabledPCICapabilities/OpenDRIM_EnabledPCICapabilities.h0000644000175000017500000001614511400674237032173 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_ENABLEDPCICAPABILITIES_H_ #define OPENDRIM_ENABLEDPCICAPABILITIES_H_ #include const static char* OpenDRIM_EnabledPCICapabilities_classnames[] = {"OpenDRIM_EnabledPCICapabilities"}; static string OpenDRIM_EnabledPCICapabilities_NAMESPACE = _NAMESPACE; class OpenDRIM_EnabledPCICapabilities { public: string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string InstanceID; bool InstanceID_isNULL; string ElementName; bool ElementName_isNULL; bool ElementNameEditSupported; bool ElementNameEditSupported_isNULL; unsigned short MaxElementNameLen; bool MaxElementNameLen_isNULL; vector RequestedStatesSupported; bool RequestedStatesSupported_isNULL; string ElementNameMask; bool ElementNameMask_isNULL; vector StateAwareness; bool StateAwareness_isNULL; OpenDRIM_EnabledPCICapabilities() { Caption_isNULL = true; Description_isNULL = true; InstanceID_isNULL = true; ElementName_isNULL = true; ElementNameEditSupported_isNULL = true; MaxElementNameLen_isNULL = true; RequestedStatesSupported_isNULL = true; ElementNameMask_isNULL = true; StateAwareness_isNULL = true; } ~OpenDRIM_EnabledPCICapabilities() {} string getKeys() const { return CF_toLowCase(".InstanceID=\"" + CF_quoteString(InstanceID) + "\""); } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getElementNameEditSupported(bool& value) const { if (ElementNameEditSupported_isNULL==true) return NOT_FOUND; value = ElementNameEditSupported; return OK; } int setElementNameEditSupported(const bool& newValue) { ElementNameEditSupported = newValue; ElementNameEditSupported_isNULL = false; return OK; } int getMaxElementNameLen(unsigned short& value) const { if (MaxElementNameLen_isNULL==true) return NOT_FOUND; value = MaxElementNameLen; return OK; } int setMaxElementNameLen(const unsigned short& newValue) { MaxElementNameLen = newValue; MaxElementNameLen_isNULL = false; return OK; } int getRequestedStatesSupported(vector& value) const { if (RequestedStatesSupported_isNULL==true) return NOT_FOUND; value = RequestedStatesSupported; return OK; } int setRequestedStatesSupported(const vector& newValue) { RequestedStatesSupported = newValue; RequestedStatesSupported_isNULL = false; return OK; } int getElementNameMask(string& value) const { if (ElementNameMask_isNULL==true) return NOT_FOUND; value = ElementNameMask; return OK; } int setElementNameMask(const string& newValue) { ElementNameMask = newValue; ElementNameMask_isNULL = false; return OK; } int getStateAwareness(vector& value) const { if (StateAwareness_isNULL==true) return NOT_FOUND; value = StateAwareness; return OK; } int setStateAwareness(const vector& newValue) { StateAwareness = newValue; StateAwareness_isNULL = false; return OK; } }; class OpenDRIM_EnabledPCICapabilities_CreateGoalSettings_In { public: vector TemplateGoalSettings; bool TemplateGoalSettings_isNULL; vector SupportedGoalSettings; bool SupportedGoalSettings_isNULL; OpenDRIM_EnabledPCICapabilities_CreateGoalSettings_In() { TemplateGoalSettings_isNULL = true; SupportedGoalSettings_isNULL = true; } ~OpenDRIM_EnabledPCICapabilities_CreateGoalSettings_In() {} int getTemplateGoalSettings(vector& value) const { if (TemplateGoalSettings_isNULL == true) return NOT_FOUND; value = TemplateGoalSettings; return OK; } int setTemplateGoalSettings(const vector& newValue) { TemplateGoalSettings = newValue; TemplateGoalSettings_isNULL = false; return OK; } int getSupportedGoalSettings(vector& value) const { if (SupportedGoalSettings_isNULL == true) return NOT_FOUND; value = SupportedGoalSettings; return OK; } int setSupportedGoalSettings(const vector& newValue) { SupportedGoalSettings = newValue; SupportedGoalSettings_isNULL = false; return OK; } }; class OpenDRIM_EnabledPCICapabilities_CreateGoalSettings_Out { public: vector SupportedGoalSettings; bool SupportedGoalSettings_isNULL; OpenDRIM_EnabledPCICapabilities_CreateGoalSettings_Out() { SupportedGoalSettings_isNULL = true; } ~OpenDRIM_EnabledPCICapabilities_CreateGoalSettings_Out() {} int getSupportedGoalSettings(vector& value) const { if (SupportedGoalSettings_isNULL == true) return NOT_FOUND; value = SupportedGoalSettings; return OK; } int setSupportedGoalSettings(const vector& newValue) { SupportedGoalSettings = newValue; SupportedGoalSettings_isNULL = false; return OK; } }; #endif /*OPENDRIM_ENABLEDPCICAPABILITIES_H_*/ opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_EnabledPCICapabilities/OpenDRIM_EnabledPCICapabilitiesAccess.h0000644000175000017500000000651211400674237033312 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_ENABLEDPCICAPABILITIESACCESS_H_ #define OPENDRIM_ENABLEDPCICAPABILITIESACCESS_H_ #include "PCI_Common.h" #include "OpenDRIM_EnabledPCICapabilities.h" int PCI_OpenDRIM_EnabledPCICapabilities_load(const CMPIBroker* broker, string& errorMessage); int PCI_OpenDRIM_EnabledPCICapabilities_unload(string& errorMessage); int PCI_OpenDRIM_EnabledPCICapabilities_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PCI_OpenDRIM_EnabledPCICapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_EnabledPCICapabilities& instance, const char** properties, string& errorMessage); int PCI_OpenDRIM_EnabledPCICapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledPCICapabilities& newInstance, const OpenDRIM_EnabledPCICapabilities& oldInstance, const char** properties, string& errorMessage); int PCI_OpenDRIM_EnabledPCICapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledPCICapabilities& instance, string& errorMessage); int PCI_OpenDRIM_EnabledPCICapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledPCICapabilities& instance, string& errorMessage); int PCI_OpenDRIM_EnabledPCICapabilities_CreateGoalSettings(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledPCICapabilities& instance, unsigned short& returnValue, const OpenDRIM_EnabledPCICapabilities_CreateGoalSettings_In& in, OpenDRIM_EnabledPCICapabilities_CreateGoalSettings_Out& out, string& errorMessage); int PCI_OpenDRIM_EnabledPCICapabilities_populate(OpenDRIM_EnabledPCICapabilities& instance, string& errorMessage); #endif /*OPENDRIM_ENABLEDPCICAPABILITIESACCESS_H_*/ ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_EnabledPCICapabilities/OpenDRIM_EnabledPCICapabilitiesAccess.cppopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_EnabledPCICapabilities/OpenDRIM_EnabledPCICapabilitiesAccess.cpp0000644000175000017500000000676011400674237033652 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_EnabledPCICapabilitiesAccess.h" int PCI_OpenDRIM_EnabledPCICapabilities_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int PCI_OpenDRIM_EnabledPCICapabilities_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int PCI_OpenDRIM_EnabledPCICapabilities_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; _L_; return OK; } int PCI_OpenDRIM_EnabledPCICapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_EnabledPCICapabilities& instance, const char** properties, string& errorMessage) { _E_; _L_; return OK; } int PCI_OpenDRIM_EnabledPCICapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledPCICapabilities& newInstance, const OpenDRIM_EnabledPCICapabilities& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_EnabledPCICapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledPCICapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_EnabledPCICapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledPCICapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PCI_OpenDRIM_EnabledPCICapabilities_CreateGoalSettings(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledPCICapabilities& instance, unsigned short& returnValue, const OpenDRIM_EnabledPCICapabilities_CreateGoalSettings_In& in, OpenDRIM_EnabledPCICapabilities_CreateGoalSettings_Out& out, string& errorMessage) { _E_; // TODO _L_; return OK; } int PCI_OpenDRIM_EnabledPCICapabilities_populate(OpenDRIM_EnabledPCICapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-pci-1.0.0~ppa/OpenDRIM_EnabledPCICapabilities/cmpiOpenDRIM_EnabledPCICapabilities.cpp0000644000175000017500000001321211400674237033367 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_EnabledPCICapabilities.h" CMPIObjectPath* PCI_OpenDRIM_EnabledPCICapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_EnabledPCICapabilities& instance) { _E_; Objectpath op(broker, OpenDRIM_EnabledPCICapabilities_classnames[0], OpenDRIM_EnabledPCICapabilities_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* PCI_OpenDRIM_EnabledPCICapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_EnabledPCICapabilities& instance) { _E_; Objectpath op(broker, PCI_OpenDRIM_EnabledPCICapabilities_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.ElementNameEditSupported_isNULL) ci.setProperty("ElementNameEditSupported", instance.ElementNameEditSupported); if (!instance.MaxElementNameLen_isNULL) ci.setProperty("MaxElementNameLen", instance.MaxElementNameLen); if (!instance.RequestedStatesSupported_isNULL) ci.setProperty("RequestedStatesSupported", instance.RequestedStatesSupported); if (!instance.ElementNameMask_isNULL) ci.setProperty("ElementNameMask", instance.ElementNameMask); if (!instance.StateAwareness_isNULL) ci.setProperty("StateAwareness", instance.StateAwareness); _L_; return ci.getHdl(); } void PCI_OpenDRIM_EnabledPCICapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_EnabledPCICapabilities& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void PCI_OpenDRIM_EnabledPCICapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_EnabledPCICapabilities& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getProperty("ElementNameEditSupported", instance.ElementNameEditSupported) == OK) instance.ElementNameEditSupported_isNULL = false; if (inst.getProperty("MaxElementNameLen", instance.MaxElementNameLen) == OK) instance.MaxElementNameLen_isNULL = false; if (inst.getProperty("RequestedStatesSupported", instance.RequestedStatesSupported) == OK) instance.RequestedStatesSupported_isNULL = false; if (inst.getProperty("ElementNameMask", instance.ElementNameMask) == OK) instance.ElementNameMask_isNULL = false; if (inst.getProperty("StateAwareness", instance.StateAwareness) == OK) instance.StateAwareness_isNULL = false; _L_; } void PCI_OpenDRIM_EnabledPCICapabilities_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_EnabledPCICapabilities_CreateGoalSettings_In& args) { _E_; CMPIStatus rc; CMPIData data; vector TemplateGoalSettings; data = in->ft->getArg(in, "TemplateGoalSettings", &rc); if (rc.rc == OK) { CT_ToC(data, TemplateGoalSettings); args.setTemplateGoalSettings(TemplateGoalSettings); } vector SupportedGoalSettings; data = in->ft->getArg(in, "SupportedGoalSettings", &rc); if (rc.rc == OK) { CT_ToC(data, SupportedGoalSettings); args.setSupportedGoalSettings(SupportedGoalSettings); } _L_; } void PCI_OpenDRIM_EnabledPCICapabilities_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_EnabledPCICapabilities_CreateGoalSettings_Out& args) { _E_; CMPIValue value; int errorMessage; vector SupportedGoalSettings; errorMessage = args.getSupportedGoalSettings(SupportedGoalSettings); if (errorMessage == OK) { value = CT_toCMPI(broker, SupportedGoalSettings); out->ft->addArg(out, "SupportedGoalSettings", &value, CMPI_stringA); } _L_; } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_EnabledPCICapabilities/OpenDRIM_EnabledPCICapabilitiesProvider.cppopendrim-lmp-pci-1.0.0~ppa/OpenDRIM_EnabledPCICapabilities/OpenDRIM_EnabledPCICapabilitiesProvider.c0000644000175000017500000003334511400674237033702 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), PCI provider package # Copyright (C) 2009 Nazarov Nodir, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_EnabledPCICapabilities.h" #include "OpenDRIM_EnabledPCICapabilitiesAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PCI_OpenDRIM_EnabledPCICapabilitiesProviderSetInstance PCI_OpenDRIM_EnabledPCICapabilitiesProviderModifyInstance #endif int PCI_OpenDRIM_EnabledPCICapabilities_init(const CMPIBroker* broker); int PCI_OpenDRIM_EnabledPCICapabilities_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PCI_OpenDRIM_EnabledPCICapabilitiesProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_EnabledPCICapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_EnabledPCICapabilitiesProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PCI_OpenDRIM_EnabledPCICapabilities_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledPCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PCI_OpenDRIM_EnabledPCICapabilities_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_EnabledPCICapabilitiesProviderEnumInstances(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 = PCI_OpenDRIM_EnabledPCICapabilities_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledPCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PCI_OpenDRIM_EnabledPCICapabilities_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_EnabledPCICapabilitiesProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_EnabledPCICapabilities instance; PCI_OpenDRIM_EnabledPCICapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_EnabledPCICapabilities_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledPCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PCI_OpenDRIM_EnabledPCICapabilities_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_EnabledPCICapabilitiesProviderSetInstance(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_EnabledPCICapabilities newInstance, oldInstance; PCI_OpenDRIM_EnabledPCICapabilities_toCPP(_broker, ci, newInstance); PCI_OpenDRIM_EnabledPCICapabilities_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PCI_OpenDRIM_EnabledPCICapabilities_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledPCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_EnabledPCICapabilities_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledPCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_EnabledPCICapabilitiesProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_EnabledPCICapabilities instance; PCI_OpenDRIM_EnabledPCICapabilities_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PCI_OpenDRIM_EnabledPCICapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_EnabledPCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_EnabledPCICapabilities_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledPCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_EnabledPCICapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledPCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PCI_OpenDRIM_EnabledPCICapabilities_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_EnabledPCICapabilitiesProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_EnabledPCICapabilities instance; PCI_OpenDRIM_EnabledPCICapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PCI_OpenDRIM_EnabledPCICapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledPCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PCI_OpenDRIM_EnabledPCICapabilities_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledPCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PCI_OpenDRIM_EnabledPCICapabilitiesProviderExecQuery(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 PCI_OpenDRIM_EnabledPCICapabilitiesProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = PCI_OpenDRIM_EnabledPCICapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PCI_OpenDRIM_EnabledPCICapabilitiesProviderInvokeMethod(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_EnabledPCICapabilities instance; PCI_OpenDRIM_EnabledPCICapabilities_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"InstanceID"}; int errorCode = PCI_OpenDRIM_EnabledPCICapabilities_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledPCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="CreateGoalSettings") { unsigned short returnValue; OpenDRIM_EnabledPCICapabilities_CreateGoalSettings_In inArgs; PCI_OpenDRIM_EnabledPCICapabilities_toCPP(_broker, in, inArgs); OpenDRIM_EnabledPCICapabilities_CreateGoalSettings_Out outArgs; errorCode = PCI_OpenDRIM_EnabledPCICapabilities_CreateGoalSettings(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledPCICapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } PCI_OpenDRIM_EnabledPCICapabilities_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint16, CMPI_uint16); } else { errorMessage = (string) OpenDRIM_EnabledPCICapabilities_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 PCI_OpenDRIM_EnabledPCICapabilities_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PCI_OpenDRIM_EnabledPCICapabilities_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_EnabledPCICapabilities_init FAILED: " + (string) OpenDRIM_EnabledPCICapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PCI_OpenDRIM_EnabledPCICapabilities_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PCI_OpenDRIM_EnabledPCICapabilities_unload(errorMessage); if (errorCode != OK) { errorMessage += "PCI_OpenDRIM_EnabledPCICapabilities_unload FAILED: " + (string) OpenDRIM_EnabledPCICapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PCI_OpenDRIM_EnabledPCICapabilities_INIT if (PCI_OpenDRIM_EnabledPCICapabilities_init(_broker) < 0) return NULL CMInstanceMIStub(PCI_OpenDRIM_EnabledPCICapabilitiesProvider, PCI_OpenDRIM_EnabledPCICapabilitiesProvider, _broker, PCI_OpenDRIM_EnabledPCICapabilities_INIT); CMMethodMIStub(PCI_OpenDRIM_EnabledPCICapabilitiesProvider, PCI_OpenDRIM_EnabledPCICapabilitiesProvider, _broker, PCI_OpenDRIM_EnabledPCICapabilities_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-pci-1.0.0~ppa/README0000644000175000017500000000103311400674237017176 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!