opendrim-lmp-dhcp-1.0.0~ppa/0000755000175000017500000000000011400673053016457 5ustar guillaumeguillaumeopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementCapabilities/0000755000175000017500000000000011400673053024456 5ustar guillaumeguillaumeopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementCapabilities/Makefile.am0000644000175000017500000000477311400673053026525 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 = libcmpiDHCP_OpenDRIM_DHCPElementCapabilitiesProvider.la libcmpiDHCP_OpenDRIM_DHCPElementCapabilitiesProvider_la_SOURCES = OpenDRIM_DHCPElementCapabilitiesAccess.cpp OpenDRIM_DHCPElementCapabilitiesProvider.cpp cmpiOpenDRIM_DHCPElementCapabilities.cpp assocOpenDRIM_DHCPElementCapabilities.cpp # May have to be adjusted for direct invocation libcmpiDHCP_OpenDRIM_DHCPElementCapabilitiesProvider_la_CPPFLAGS = -I../CIM_Capabilities -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiDHCP_OpenDRIM_DHCPElementCapabilitiesProvider_la_LIBADD = ../Common/libcmpiDHCP_Common.la #../CIM_Capabilities/libcmpiDHCP_CIM_CapabilitiesProvider.la ../CIM_ManagedElement/libcmpiDHCP_CIM_ManagedElementProvider.la libcmpiDHCP_OpenDRIM_DHCPElementCapabilitiesProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_DHCPElementCapabilities.h OpenDRIM_DHCPElementCapabilities.h OpenDRIM_DHCPElementCapabilitiesAccess.h ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementCapabilities/OpenDRIM_DHCPElementCapabilitiesAccess.cppopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementCapabilities/OpenDRIM_DHCPElementCapabilitiesAccess.0000644000175000017500000002547511400673053033615 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPElementCapabilitiesAccess.h" int DHCP_OpenDRIM_DHCPElementCapabilities_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(DHCP_CIM_Capabilities_load(broker, errorMessage)); CF_assert(DHCP_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int DHCP_OpenDRIM_DHCPElementCapabilities_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(DHCP_CIM_Capabilities_unload(errorMessage)); CF_assert(DHCP_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int DHCP_OpenDRIM_DHCPElementCapabilities_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 DHCP_OpenDRIM_DHCPElementCapabilities_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(DHCP_OpenDRIM_DHCPElementCapabilities_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(DHCP_OpenDRIM_DHCPElementCapabilities_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; DHCP_OpenDRIM_DHCPElementCapabilities_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(DHCP_OpenDRIM_DHCPElementCapabilities_referenceCapabilitiesToManagedElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int DHCP_OpenDRIM_DHCPElementCapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_DHCPElementCapabilities& 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(DHCP_OpenDRIM_DHCPElementCapabilities_getCapabilities(broker, ctx, Capabilities_objectpath, Capabilities_instance, NULL, errorMessage)); Objectpath ManagedElement_objectpath; instance.getManagedElement(ManagedElement_objectpath); Instance ManagedElement_instance; CF_assert(DHCP_OpenDRIM_DHCPElementCapabilities_getManagedElement(broker, ctx, ManagedElement_objectpath, ManagedElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(DHCP_OpenDRIM_DHCPElementCapabilities_isAssociated(Capabilities_instance, ManagedElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } CF_assert(DHCP_OpenDRIM_DHCPElementCapabilities_populate(instance, errorMessage)); _L_; return OK; } int DHCP_OpenDRIM_DHCPElementCapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPElementCapabilities& newInstance, const OpenDRIM_DHCPElementCapabilities& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPElementCapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPElementCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPElementCapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPElementCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPElementCapabilities_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(DHCP_OpenDRIM_DHCPElementCapabilities_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(DHCP_OpenDRIM_DHCPElementCapabilities_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(DHCP_OpenDRIM_DHCPElementCapabilities_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(DHCP_OpenDRIM_DHCPElementCapabilities_enumerateCapabilitiess(broker, ctx, Capabilities_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(DHCP_OpenDRIM_DHCPElementCapabilities_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(DHCP_OpenDRIM_DHCPElementCapabilities_enumerateCapabilitiess(broker, ctx, Capabilities_instances, properties, false, errorMessage)); } for (size_t i=0; i& ManagedElement_instances, vector& OpenDRIM_DHCPElementCapabilities_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_DHCPElementCapabilities instance; instance.setCapabilities(((Instance) Capabilities_instance).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instances[i]).getObjectpath()); if (discriminant == "r") { CF_assert(DHCP_OpenDRIM_DHCPElementCapabilities_populate(instance, errorMessage)); } OpenDRIM_DHCPElementCapabilities_instances.push_back(instance); } _L_; return OK; } int DHCP_OpenDRIM_DHCPElementCapabilities_referenceManagedElementToCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& Capabilities_instances, vector& OpenDRIM_DHCPElementCapabilities_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_DHCPElementCapabilities instance; instance.setCapabilities(((Instance) Capabilities_instances[i]).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instance).getObjectpath()); if (discriminant == "r") { CF_assert(DHCP_OpenDRIM_DHCPElementCapabilities_populate(instance, errorMessage)); } OpenDRIM_DHCPElementCapabilities_instances.push_back(instance); } _L_; return OK; } int DHCP_OpenDRIM_DHCPElementCapabilities_populate(OpenDRIM_DHCPElementCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementCapabilities/cmpiOpenDRIM_DHCPElementCapabilities.h0000644000175000017500000000443111400673053033501 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPELEMENTCAPABILITIES_H_ #define CMPIOPENDRIM_DHCPELEMENTCAPABILITIES_H_ #include "OpenDRIM_DHCPElementCapabilities.h" CMPIObjectPath* DHCP_OpenDRIM_DHCPElementCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_DHCPElementCapabilities& instance); CMPIInstance* DHCP_OpenDRIM_DHCPElementCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_DHCPElementCapabilities& instance); void DHCP_OpenDRIM_DHCPElementCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_DHCPElementCapabilities& instance); void DHCP_OpenDRIM_DHCPElementCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_DHCPElementCapabilities& instance); #endif /*CMPIOPENDRIM_DHCPELEMENTCAPABILITIES_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementCapabilities/OpenDRIM_DHCPElementCapabilities.h0000644000175000017500000000775411400673053032643 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPELEMENTCAPABILITIES_H_ #define OPENDRIM_DHCPELEMENTCAPABILITIES_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_DHCPElementCapabilities_classnames[] = {"OpenDRIM_DHCPElementCapabilities"}; static string OpenDRIM_DHCPElementCapabilities_NAMESPACE = _NAMESPACE; const static string Capabilities_role = "Capabilities"; const static char* Capabilities_classnames[] = {"OpenDRIM_DHCPCapabilities"}; const static string Capabilities_NAMESPACE = _NAMESPACE; const static string ManagedElement_role = "ManagedElement"; const static char* ManagedElement_classnames[] = {"OpenDRIM_DHCPProtocolEndpoint"}; const static string ManagedElement_NAMESPACE = _NAMESPACE; class OpenDRIM_DHCPElementCapabilities { public: Objectpath ManagedElement; bool ManagedElement_isNULL; Objectpath Capabilities; bool Capabilities_isNULL; vector Characteristics; bool Characteristics_isNULL; OpenDRIM_DHCPElementCapabilities() { ManagedElement_isNULL = true; Capabilities_isNULL = true; Characteristics_isNULL = true; } ~OpenDRIM_DHCPElementCapabilities() {} 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_DHCPELEMENTCAPABILITIES_H_*/ ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementCapabilities/OpenDRIM_DHCPElementCapabilitiesProvider.cppopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementCapabilities/OpenDRIM_DHCPElementCapabilitiesProvide0000644000175000017500000004234011400673053033734 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPElementCapabilities.h" #include "OpenDRIM_DHCPElementCapabilitiesAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define DHCP_OpenDRIM_DHCPElementCapabilitiesProviderSetInstance DHCP_OpenDRIM_DHCPElementCapabilitiesProviderModifyInstance #endif int DHCP_OpenDRIM_DHCPElementCapabilities_init(const CMPIBroker* broker); int DHCP_OpenDRIM_DHCPElementCapabilities_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus DHCP_OpenDRIM_DHCPElementCapabilitiesProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = DHCP_OpenDRIM_DHCPElementCapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPElementCapabilitiesProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPElementCapabilities_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = DHCP_OpenDRIM_DHCPElementCapabilities_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPElementCapabilitiesProviderEnumInstances(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 = DHCP_OpenDRIM_DHCPElementCapabilities_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = DHCP_OpenDRIM_DHCPElementCapabilities_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPElementCapabilitiesProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPElementCapabilities instance; DHCP_OpenDRIM_DHCPElementCapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPElementCapabilities_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = DHCP_OpenDRIM_DHCPElementCapabilities_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPElementCapabilitiesProviderSetInstance(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_DHCPElementCapabilities newInstance, oldInstance; DHCP_OpenDRIM_DHCPElementCapabilities_toCPP(_broker, ci, newInstance); DHCP_OpenDRIM_DHCPElementCapabilities_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPElementCapabilities_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPElementCapabilities_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPElementCapabilitiesProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPElementCapabilities instance; DHCP_OpenDRIM_DHCPElementCapabilities_toCPP(_broker, ci, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPElementCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_DHCPElementCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPElementCapabilities_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPElementCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = DHCP_OpenDRIM_DHCPElementCapabilities_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPElementCapabilitiesProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPElementCapabilities instance; DHCP_OpenDRIM_DHCPElementCapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPElementCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPElementCapabilities_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPElementCapabilitiesProviderExecQuery(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 DHCP_OpenDRIM_DHCPElementCapabilitiesProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = DHCP_OpenDRIM_DHCPElementCapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPElementCapabilitiesProviderAssociatorNames(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 = DHCP_OpenDRIM_DHCPElementCapabilities_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementCapabilities_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 DHCP_OpenDRIM_DHCPElementCapabilitiesProviderAssociators(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 = DHCP_OpenDRIM_DHCPElementCapabilities_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementCapabilities_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 DHCP_OpenDRIM_DHCPElementCapabilitiesProviderReferenceNames(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 = DHCP_OpenDRIM_DHCPElementCapabilities_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = DHCP_OpenDRIM_DHCPElementCapabilities_referenceCapabilitiesToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = DHCP_OpenDRIM_DHCPElementCapabilities_referenceManagedElementToCapabilities(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = DHCP_OpenDRIM_DHCPElementCapabilities_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPElementCapabilitiesProviderReferences(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 = DHCP_OpenDRIM_DHCPElementCapabilities_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = DHCP_OpenDRIM_DHCPElementCapabilities_referenceCapabilitiesToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = DHCP_OpenDRIM_DHCPElementCapabilities_referenceManagedElementToCapabilities(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = DHCP_OpenDRIM_DHCPElementCapabilities_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int DHCP_OpenDRIM_DHCPElementCapabilities_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPElementCapabilities_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_DHCPElementCapabilities_init FAILED: " + (string) OpenDRIM_DHCPElementCapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int DHCP_OpenDRIM_DHCPElementCapabilities_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPElementCapabilities_unload(errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_DHCPElementCapabilities_unload FAILED: " + (string) OpenDRIM_DHCPElementCapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define DHCP_OpenDRIM_DHCPElementCapabilities_INIT if (DHCP_OpenDRIM_DHCPElementCapabilities_init(_broker) < 0) return NULL CMInstanceMIStub(DHCP_OpenDRIM_DHCPElementCapabilitiesProvider, DHCP_OpenDRIM_DHCPElementCapabilitiesProvider, _broker, DHCP_OpenDRIM_DHCPElementCapabilities_INIT); CMAssociationMIStub(DHCP_OpenDRIM_DHCPElementCapabilitiesProvider, DHCP_OpenDRIM_DHCPElementCapabilitiesProvider, _broker, DHCP_OpenDRIM_DHCPElementCapabilities_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementCapabilities/assocOpenDRIM_DHCPElementCapabilities.hopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementCapabilities/assocOpenDRIM_DHCPElementCapabilities.h0000644000175000017500000000627511400673053033671 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPELEMENTCAPABILITIES_H_ #define ASSOCOPENDRIM_DHCPELEMENTCAPABILITIES_H_ #include "OpenDRIM_DHCPElementCapabilitiesAccess.h" int DHCP_OpenDRIM_DHCPElementCapabilities_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 DHCP_OpenDRIM_DHCPElementCapabilities_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 DHCP_OpenDRIM_DHCPElementCapabilities_enumerateCapabilitiess(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int DHCP_OpenDRIM_DHCPElementCapabilities_getCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCPElementCapabilities_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int DHCP_OpenDRIM_DHCPElementCapabilities_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_DHCPELEMENTCAPABILITIES_H_*/ ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementCapabilities/cmpiOpenDRIM_DHCPElementCapabilities.cppopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementCapabilities/cmpiOpenDRIM_DHCPElementCapabilities.cp0000644000175000017500000000660411400673053033660 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPElementCapabilities.h" CMPIObjectPath* DHCP_OpenDRIM_DHCPElementCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_DHCPElementCapabilities& instance) { _E_; Objectpath op(broker, OpenDRIM_DHCPElementCapabilities_classnames[0], OpenDRIM_DHCPElementCapabilities_NAMESPACE); if (!instance.ManagedElement_isNULL) op.addKey("ManagedElement", instance.ManagedElement); if (!instance.Capabilities_isNULL) op.addKey("Capabilities", instance.Capabilities); _L_; return op.getHdl(); } CMPIInstance* DHCP_OpenDRIM_DHCPElementCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_DHCPElementCapabilities& instance) { _E_; Objectpath op(broker, DHCP_OpenDRIM_DHCPElementCapabilities_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.Characteristics_isNULL) ci.setProperty("Characteristics", instance.Characteristics); _L_; return ci.getHdl(); } void DHCP_OpenDRIM_DHCPElementCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_DHCPElementCapabilities& 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 DHCP_OpenDRIM_DHCPElementCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_DHCPElementCapabilities& 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_; } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementCapabilities/assocOpenDRIM_DHCPElementCapabilities.cppopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementCapabilities/assocOpenDRIM_DHCPElementCapabilities.c0000644000175000017500000002115411400673053033655 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPElementCapabilities.h" int DHCP_OpenDRIM_DHCPElementCapabilities_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 = DHCP_OpenDRIM_DHCPElementCapabilities_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(DHCP_OpenDRIM_DHCPElementCapabilities_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(DHCP_OpenDRIM_DHCPElementCapabilities_associatorManagedElementToCapabilities(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int DHCP_OpenDRIM_DHCPElementCapabilities_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(DHCP_CIM_Capabilities_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(DHCP_CIM_Capabilities_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, DHCP_CIM_Capabilities_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int DHCP_OpenDRIM_DHCPElementCapabilities_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; DHCP_CIM_Capabilities_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(DHCP_CIM_Capabilities_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, DHCP_CIM_Capabilities_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int DHCP_OpenDRIM_DHCPElementCapabilities_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(DHCP_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(DHCP_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, DHCP_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int DHCP_OpenDRIM_DHCPElementCapabilities_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; DHCP_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(DHCP_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, DHCP_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementCapabilities/OpenDRIM_DHCPElementCapabilitiesAccess.hopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementCapabilities/OpenDRIM_DHCPElementCapabilitiesAccess.0000644000175000017500000001066011400673053033603 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPELEMENTCAPABILITIESACCESS_H_ #define OPENDRIM_DHCPELEMENTCAPABILITIESACCESS_H_ #include "DHCP_Common.h" #include "OpenDRIM_DHCPElementCapabilities.h" #include "assocOpenDRIM_DHCPElementCapabilities.h" int DHCP_OpenDRIM_DHCPElementCapabilities_load(const CMPIBroker* broker, string& errorMessage); int DHCP_OpenDRIM_DHCPElementCapabilities_unload(string& errorMessage); int DHCP_OpenDRIM_DHCPElementCapabilities_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCPElementCapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_DHCPElementCapabilities& instance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCPElementCapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPElementCapabilities& newInstance, const OpenDRIM_DHCPElementCapabilities& oldInstance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCPElementCapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPElementCapabilities& instance, string& errorMessage); int DHCP_OpenDRIM_DHCPElementCapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPElementCapabilities& instance, string& errorMessage); int DHCP_OpenDRIM_DHCPElementCapabilities_associatorCapabilitiesToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Capabilities_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCPElementCapabilities_associatorManagedElementToCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const char** properties, vector& Capabilities_associatedInstances, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCPElementCapabilities_referenceCapabilitiesToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Capabilities_instance, const vector& ManagedElement_instances, vector& OpenDRIM_DHCPElementCapabilities_instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCPElementCapabilities_referenceManagedElementToCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& Capabilities_instances, vector& OpenDRIM_DHCPElementCapabilities_instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCPElementCapabilities_populate(OpenDRIM_DHCPElementCapabilities& instance, string& errorMessage); #endif /*OPENDRIM_DHCPELEMENTCAPABILITIESACCESS_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/Makefile.am0000644000175000017500000001054711400673053020522 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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-dhcp RPM_PACKAGE_DIR = packaging PLATFORM = $(shell rpm --eval %_target_cpu) WORKING_DIR = $(shell pwd) SUBDIRS = Common OpenDRIM_DHCPServer OpenDRIM_DHCPProtocolEndpoint OpenDRIM_DHCPConformsToProfile OpenDRIM_RegisteredDHCPProfile OpenDRIM_DHCPSettingData OpenDRIM_DHCPCapabilities OpenDRIM_DHCPElementSettingData OpenDRIM_DHCP2RSA OpenDRIM_DHCPElementCapabilities OpenDRIM_DHCP2IP OpenDRIM_DHCP2ComputerSystem test postinstall: registration/DHCP.sh @CIMNAMESPACE@ $(VENDOR) @CIMSERVER@ @INTEROPNAMESPACE@ $(VERSION) . preuninstall: registration/DHCP-remove.sh @CIMNAMESPACE@ @CIMSERVER@ @INTEROPNAMESPACE@ . test-OpenDRIM_DHCPServer: all make -C test test-OpenDRIM_DHCPServer test-OpenDRIM_DHCPElementSettingData: all make -C test test-OpenDRIM_DHCPElementSettingData test-OpenDRIM_DHCPProtocolEndpoint: all make -C test test-OpenDRIM_DHCPProtocolEndpoint test-OpenDRIM_DHCPConformsToProfile: all make -C test test-OpenDRIM_DHCPConformsToProfile test-OpenDRIM_RegisteredDHCPProfile: all make -C test test-OpenDRIM_RegisteredDHCPProfile test-OpenDRIM_DHCPSettingData: all make -C test test-OpenDRIM_DHCPSettingData test-OpenDRIM_DHCPCapabilities: all make -C test test-OpenDRIM_DHCPCapabilities test-OpenDRIM_DHCP2RSA: all make -C test test-OpenDRIM_DHCP2RSA test-OpenDRIM_DHCPElementCapabilities: all make -C test test-OpenDRIM_DHCPElementCapabilities test-OpenDRIM_DHCP2IP: all make -C test test-OpenDRIM_DHCP2IP test-OpenDRIM_DHCP2ComputerSystem: all make -C test test-OpenDRIM_DHCP2ComputerSystem 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-dhcp-1.0.0~ppa/registration/0000755000175000017500000000000011400673053021171 5ustar guillaumeguillaumeopendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_DHCP2ComputerSystem-remove.sh0000755000175000017500000000633511400673053030213 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 DHCP_OpenDRIM_DHCP2ComputerSystemModule cimprovider -r -m DHCP_OpenDRIM_DHCP2ComputerSystemModule 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_DHCP2ComputerSystem.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_DHCP2IP-remove.sh0000755000175000017500000000614511400673053025517 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 DHCP_OpenDRIM_DHCP2IPModule cimprovider -r -m DHCP_OpenDRIM_DHCP2IPModule 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_DHCP2IP.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_DHCPConformsToProfile-remove.sh0000755000175000017500000001027111400673053030532 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 DHCP_OpenDRIM_DHCPConformsToProfileModule cimprovider -r -m DHCP_OpenDRIM_DHCPConformsToProfileModule 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_DHCPConformsToProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE owmofc -u http://localhost/$3 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_DHCP2ComputerSystem.sh0000755000175000017500000000641611400673053026720 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2ComputerSystem.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_DHCP2ComputerSystem provider module"; Name = "DHCP_OpenDRIM_DHCP2ComputerSystemModule"; Location = "cmpiDHCP_OpenDRIM_DHCP2ComputerSystemProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_DHCP2ComputerSystem provider"; Name = "DHCP_OpenDRIM_DHCP2ComputerSystemProvider"; ProviderModuleName = "DHCP_OpenDRIM_DHCP2ComputerSystemModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_DHCP2ComputerSystem provider capabilities"; ProviderModuleName = "DHCP_OpenDRIM_DHCP2ComputerSystemModule"; ProviderName = "DHCP_OpenDRIM_DHCP2ComputerSystemProvider"; ClassName = "OpenDRIM_DHCP2ComputerSystem"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent"}; CapabilityID = "DHCP_OpenDRIM_DHCP2ComputerSystem"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_DHCP2ComputerSystem.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_DHCPCapabilities.sh0000755000175000017500000000652611400673053026226 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPCapabilities.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_DHCPCapabilities provider module"; Name = "DHCP_OpenDRIM_DHCPCapabilitiesModule"; Location = "cmpiDHCP_OpenDRIM_DHCPCapabilitiesProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_DHCPCapabilities provider"; Name = "DHCP_OpenDRIM_DHCPCapabilitiesProvider"; ProviderModuleName = "DHCP_OpenDRIM_DHCPCapabilitiesModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_DHCPCapabilities provider capabilities"; ProviderModuleName = "DHCP_OpenDRIM_DHCPCapabilitiesModule"; ProviderName = "DHCP_OpenDRIM_DHCPCapabilitiesProvider"; ClassName = "OpenDRIM_DHCPCapabilities"; ProviderType = {2}; Namespaces = {"$1"}; SupportedProperties = {"Caption", "Description", "InstanceID", "ElementName", "ElementNameEditSupported", "MaxElementNameLen", "RequestedStatesSupported", "ElementNameMask", "OptionsSupported"}; CapabilityID = "DHCP_OpenDRIM_DHCPCapabilities"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_DHCPCapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_DHCPSettingData.sh0000755000175000017500000000654211400673053026042 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPSettingData.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_DHCPSettingData provider module"; Name = "DHCP_OpenDRIM_DHCPSettingDataModule"; Location = "cmpiDHCP_OpenDRIM_DHCPSettingDataProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_DHCPSettingData provider"; Name = "DHCP_OpenDRIM_DHCPSettingDataProvider"; ProviderModuleName = "DHCP_OpenDRIM_DHCPSettingDataModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_DHCPSettingData provider capabilities"; ProviderModuleName = "DHCP_OpenDRIM_DHCPSettingDataModule"; ProviderName = "DHCP_OpenDRIM_DHCPSettingDataProvider"; ClassName = "OpenDRIM_DHCPSettingData"; ProviderType = {2}; Namespaces = {"$1"}; SupportedProperties = {"Caption", "Description", "InstanceID", "ElementName", "AddressOrigin", "RequestedIPv4Address", "RequestedLeaseTime", "ClientIdentifier", "VendorClassIdentifier", "RequestedOptions", "RequiredOptions"}; CapabilityID = "DHCP_OpenDRIM_DHCPSettingData"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_DHCPSettingData.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_RegisteredDHCPProfile-remove.sh0000755000175000017500000000634511400673053030545 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 DHCP_OpenDRIM_RegisteredDHCPProfileModule cimprovider -r -m DHCP_OpenDRIM_RegisteredDHCPProfileModule 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_RegisteredDHCPProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$3 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_DHCP2RSA-remove.sh0000755000175000017500000000615711400673053025637 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 DHCP_OpenDRIM_DHCP2RSAModule cimprovider -r -m DHCP_OpenDRIM_DHCP2RSAModule 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_DHCP2RSA.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_DHCPCapabilities-remove.sh0000755000175000017500000000626311400673053027517 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 DHCP_OpenDRIM_DHCPCapabilitiesModule cimprovider -r -m DHCP_OpenDRIM_DHCPCapabilitiesModule 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_DHCPCapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_DHCP2IP.sh0000755000175000017500000000605211400673053024221 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2IP.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_DHCP2IP provider module"; Name = "DHCP_OpenDRIM_DHCP2IPModule"; Location = "cmpiDHCP_OpenDRIM_DHCP2IPProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_DHCP2IP provider"; Name = "DHCP_OpenDRIM_DHCP2IPProvider"; ProviderModuleName = "DHCP_OpenDRIM_DHCP2IPModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_DHCP2IP provider capabilities"; ProviderModuleName = "DHCP_OpenDRIM_DHCP2IPModule"; ProviderName = "DHCP_OpenDRIM_DHCP2IPProvider"; ClassName = "OpenDRIM_DHCP2IP"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent"}; CapabilityID = "DHCP_OpenDRIM_DHCP2IP"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_DHCP2IP.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_DHCPElementSettingData-remove.sh0000755000175000017500000000637311400673053030651 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 DHCP_OpenDRIM_DHCPElementSettingDataModule cimprovider -r -m DHCP_OpenDRIM_DHCPElementSettingDataModule 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_DHCPElementSettingData.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/DHCP.sh0000755000175000017500000000512711400673053022253 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPServer.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_DHCPElementSettingData.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_DHCPProtocolEndpoint.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_DHCPConformsToProfile.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_RegisteredDHCPProfile.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_DHCPSettingData.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_DHCPCapabilities.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_DHCP2RSA.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_DHCPElementCapabilities.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_DHCP2IP.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_DHCP2ComputerSystem.sh $1 $2 $3 $4 $5 $6 if test "$3" = sfcb then /etc/init.d/sfcb start fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_RegisteredDHCPProfile.sh0000755000175000017500000000672011400673053027247 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_RegisteredDHCPProfile.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_RegisteredDHCPProfile provider module"; Name = "DHCP_OpenDRIM_RegisteredDHCPProfileModule"; Location = "cmpiDHCP_OpenDRIM_RegisteredDHCPProfileProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_RegisteredDHCPProfile provider"; Name = "DHCP_OpenDRIM_RegisteredDHCPProfileProvider"; ProviderModuleName = "DHCP_OpenDRIM_RegisteredDHCPProfileModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_RegisteredDHCPProfile provider capabilities"; ProviderModuleName = "DHCP_OpenDRIM_RegisteredDHCPProfileModule"; ProviderName = "DHCP_OpenDRIM_RegisteredDHCPProfileProvider"; ClassName = "OpenDRIM_RegisteredDHCPProfile"; ProviderType = {2}; Namespaces = {"$4"}; SupportedProperties = {"Caption", "Description", "ElementName", "InstanceID", "RegisteredOrganization", "OtherRegisteredOrganization", "RegisteredName", "RegisteredVersion", "AdvertiseTypes", "AdvertiseTypeDescriptions"}; CapabilityID = "DHCP_OpenDRIM_RegisteredDHCPProfile"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_RegisteredDHCPProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$4 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_DHCPSettingData-remove.sh0000755000175000017500000000625111400673053027332 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 DHCP_OpenDRIM_DHCPSettingDataModule cimprovider -r -m DHCP_OpenDRIM_DHCPSettingDataModule 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_DHCPSettingData.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_DHCPElementCapabilities.sh0000755000175000017500000000656411400673053027542 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPElementCapabilities.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_DHCPElementCapabilities provider module"; Name = "DHCP_OpenDRIM_DHCPElementCapabilitiesModule"; Location = "cmpiDHCP_OpenDRIM_DHCPElementCapabilitiesProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_DHCPElementCapabilities provider"; Name = "DHCP_OpenDRIM_DHCPElementCapabilitiesProvider"; ProviderModuleName = "DHCP_OpenDRIM_DHCPElementCapabilitiesModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_DHCPElementCapabilities provider capabilities"; ProviderModuleName = "DHCP_OpenDRIM_DHCPElementCapabilitiesModule"; ProviderName = "DHCP_OpenDRIM_DHCPElementCapabilitiesProvider"; ClassName = "OpenDRIM_DHCPElementCapabilities"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"ManagedElement", "Capabilities", "Characteristics"}; CapabilityID = "DHCP_OpenDRIM_DHCPElementCapabilities"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_DHCPElementCapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_DHCPElementSettingData.sh0000755000175000017500000000656111400673053027355 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPElementSettingData.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_DHCPElementSettingData provider module"; Name = "DHCP_OpenDRIM_DHCPElementSettingDataModule"; Location = "cmpiDHCP_OpenDRIM_DHCPElementSettingDataProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_DHCPElementSettingData provider"; Name = "DHCP_OpenDRIM_DHCPElementSettingDataProvider"; ProviderModuleName = "DHCP_OpenDRIM_DHCPElementSettingDataModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_DHCPElementSettingData provider capabilities"; ProviderModuleName = "DHCP_OpenDRIM_DHCPElementSettingDataModule"; ProviderName = "DHCP_OpenDRIM_DHCPElementSettingDataProvider"; ClassName = "OpenDRIM_DHCPElementSettingData"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"ManagedElement", "SettingData", "IsDefault", "IsCurrent", "IsNext"}; CapabilityID = "DHCP_OpenDRIM_DHCPElementSettingData"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_DHCPElementSettingData.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/DHCP-remove.sh0000755000175000017500000000514211400673053023543 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2ComputerSystem-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_DHCP2IP-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_DHCPElementCapabilities-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_DHCP2RSA-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_DHCPCapabilities-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_DHCPSettingData-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_RegisteredDHCPProfile-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_DHCPConformsToProfile-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_DHCPProtocolEndpoint-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_DHCPElementSettingData-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_DHCPServer-remove.sh $1 $2 $3 $4 if test "$2" = sfcb then /etc/init.d/sfcb start fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_DHCPElementCapabilities-remove.sh0000755000175000017500000000640511400673053031027 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 DHCP_OpenDRIM_DHCPElementCapabilitiesModule cimprovider -r -m DHCP_OpenDRIM_DHCPElementCapabilitiesModule 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_DHCPElementCapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_DHCPServer-remove.sh0000755000175000017500000000617611400673053026377 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 DHCP_OpenDRIM_DHCPServerModule cimprovider -r -m DHCP_OpenDRIM_DHCPServerModule 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_DHCPServer.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_DHCPProtocolEndpoint-remove.sh0000755000175000017500000000634211400673053030426 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 DHCP_OpenDRIM_DHCPProtocolEndpointModule cimprovider -r -m DHCP_OpenDRIM_DHCPProtocolEndpointModule 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_DHCPProtocolEndpoint.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_DHCP2RSA.sh0000755000175000017500000000613311400673053024336 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2RSA.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_DHCP2RSA provider module"; Name = "DHCP_OpenDRIM_DHCP2RSAModule"; Location = "cmpiDHCP_OpenDRIM_DHCP2RSAProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_DHCP2RSA provider"; Name = "DHCP_OpenDRIM_DHCP2RSAProvider"; ProviderModuleName = "DHCP_OpenDRIM_DHCP2RSAModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_DHCP2RSA provider capabilities"; ProviderModuleName = "DHCP_OpenDRIM_DHCP2RSAModule"; ProviderName = "DHCP_OpenDRIM_DHCP2RSAProvider"; ClassName = "OpenDRIM_DHCP2RSA"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent", "IsDefault", "OrderOfAccess"}; CapabilityID = "DHCP_OpenDRIM_DHCP2RSA"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_DHCP2RSA.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_DHCPConformsToProfile.sh0000755000175000017500000000676511400673053027254 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPConformsToProfile.mof cimmof -aE -n $4 $6/mof/OpenDRIM_DHCPConformsToProfile.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_DHCPConformsToProfile provider module"; Name = "DHCP_OpenDRIM_DHCPConformsToProfileModule"; Location = "cmpiDHCP_OpenDRIM_DHCPConformsToProfileProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_DHCPConformsToProfile provider"; Name = "DHCP_OpenDRIM_DHCPConformsToProfileProvider"; ProviderModuleName = "DHCP_OpenDRIM_DHCPConformsToProfileModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_DHCPConformsToProfile provider capabilities"; ProviderModuleName = "DHCP_OpenDRIM_DHCPConformsToProfileModule"; ProviderName = "DHCP_OpenDRIM_DHCPConformsToProfileProvider"; ClassName = "OpenDRIM_DHCPConformsToProfile"; ProviderType = {2, 3}; Namespaces = {"$1", "$4"}; SupportedProperties = {"ConformantStandard", "ManagedElement"}; CapabilityID = "DHCP_OpenDRIM_DHCPConformsToProfile"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_DHCPConformsToProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE owmofc -u http://localhost/$4 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_DHCPServer.sh0000755000175000017500000000720211400673053025073 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPServer.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_DHCPServer provider module"; Name = "DHCP_OpenDRIM_DHCPServerModule"; Location = "cmpiDHCP_OpenDRIM_DHCPServerProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_DHCPServer provider"; Name = "DHCP_OpenDRIM_DHCPServerProvider"; ProviderModuleName = "DHCP_OpenDRIM_DHCPServerModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_DHCPServer provider capabilities"; ProviderModuleName = "DHCP_OpenDRIM_DHCPServerModule"; ProviderName = "DHCP_OpenDRIM_DHCPServerProvider"; ClassName = "OpenDRIM_DHCPServer"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"InstanceID", "Caption", "Description", "ElementName", "InstallDate", "OperationalStatus", "StatusDescriptions", "Status", "HealthState", "CommunicationStatus", "DetailedStatus", "OperatingStatus", "PrimaryStatus", "EnabledState", "OtherEnabledState", "RequestedState", "EnabledDefault", "TimeOfLastStateChange", "AvailableRequestedStates", "TransitioningToState", "SystemCreationClassName", "SystemName", "CreationClassName", "Name", "AccessInfo", "InfoFormat", "OtherInfoFormatDescription", "AccessContext", "OtherAccessContext"}; SupportedMethods = {"RequestStateChange"}; CapabilityID = "DHCP_OpenDRIM_DHCPServer"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_DHCPServer.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/registration/OpenDRIM_DHCPProtocolEndpoint.sh0000755000175000017500000000762711400673053027142 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPProtocolEndpoint.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_DHCPProtocolEndpoint provider module"; Name = "DHCP_OpenDRIM_DHCPProtocolEndpointModule"; Location = "cmpiDHCP_OpenDRIM_DHCPProtocolEndpointProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_DHCPProtocolEndpoint provider"; Name = "DHCP_OpenDRIM_DHCPProtocolEndpointProvider"; ProviderModuleName = "DHCP_OpenDRIM_DHCPProtocolEndpointModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_DHCPProtocolEndpoint provider capabilities"; ProviderModuleName = "DHCP_OpenDRIM_DHCPProtocolEndpointModule"; ProviderName = "DHCP_OpenDRIM_DHCPProtocolEndpointProvider"; ClassName = "OpenDRIM_DHCPProtocolEndpoint"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"InstanceID", "Caption", "ElementName", "InstallDate", "StatusDescriptions", "Status", "HealthState", "CommunicationStatus", "DetailedStatus", "OperatingStatus", "PrimaryStatus", "OtherEnabledState", "RequestedState", "EnabledDefault", "AvailableRequestedStates", "TransitioningToState", "SystemCreationClassName", "SystemName", "CreationClassName", "Name", "Description", "OperationalStatus", "EnabledState", "TimeOfLastStateChange", "NameFormat", "ProtocolType", "ProtocolIFType", "OtherTypeDescription", "ClientState", "RenewalTime", "RebindingTime", "LeaseTime", "LeaseObtained", "LeaseExpires", "OptionsReceived"}; SupportedMethods = {"RequestStateChange"}; CapabilityID = "DHCP_OpenDRIM_DHCPProtocolEndpoint"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_DHCPProtocolEndpoint.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2RSA/0000755000175000017500000000000011400673053021262 5ustar guillaumeguillaumeopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2RSA/cmpiOpenDRIM_DHCP2RSA.cpp0000644000175000017500000000647611400673053025457 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2RSA.h" CMPIObjectPath* DHCP_OpenDRIM_DHCP2RSA_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_DHCP2RSA& instance) { _E_; Objectpath op(broker, OpenDRIM_DHCP2RSA_classnames[0], OpenDRIM_DHCP2RSA_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* DHCP_OpenDRIM_DHCP2RSA_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_DHCP2RSA& instance) { _E_; Objectpath op(broker, DHCP_OpenDRIM_DHCP2RSA_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.IsDefault_isNULL) ci.setProperty("IsDefault", instance.IsDefault); if (!instance.OrderOfAccess_isNULL) ci.setProperty("OrderOfAccess", instance.OrderOfAccess); _L_; return ci.getHdl(); } void DHCP_OpenDRIM_DHCP2RSA_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_DHCP2RSA& 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 DHCP_OpenDRIM_DHCP2RSA_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_DHCP2RSA& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Antecedent", instance.Antecedent) == OK) instance.Antecedent_isNULL = false; if (inst.getProperty("Dependent", instance.Dependent) == OK) instance.Dependent_isNULL = false; if (inst.getProperty("IsDefault", instance.IsDefault) == OK) instance.IsDefault_isNULL = false; if (inst.getProperty("OrderOfAccess", instance.OrderOfAccess) == OK) instance.OrderOfAccess_isNULL = false; _L_; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2RSA/cmpiOpenDRIM_DHCP2RSA.h0000644000175000017500000000414511400673053025113 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2RSA_H_ #define CMPIOPENDRIM_DHCP2RSA_H_ #include "OpenDRIM_DHCP2RSA.h" CMPIObjectPath* DHCP_OpenDRIM_DHCP2RSA_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_DHCP2RSA& instance); CMPIInstance* DHCP_OpenDRIM_DHCP2RSA_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_DHCP2RSA& instance); void DHCP_OpenDRIM_DHCP2RSA_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_DHCP2RSA& instance); void DHCP_OpenDRIM_DHCP2RSA_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_DHCP2RSA& instance); #endif /*CMPIOPENDRIM_DHCP2RSA_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2RSA/OpenDRIM_DHCP2RSAAccess.h0000644000175000017500000000772411400673053025372 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2RSAACCESS_H_ #define OPENDRIM_DHCP2RSAACCESS_H_ #include "DHCP_Common.h" #include "OpenDRIM_DHCP2RSA.h" #include "assocOpenDRIM_DHCP2RSA.h" int DHCP_OpenDRIM_DHCP2RSA_load(const CMPIBroker* broker, string& errorMessage); int DHCP_OpenDRIM_DHCP2RSA_unload(string& errorMessage); int DHCP_OpenDRIM_DHCP2RSA_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCP2RSA_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_DHCP2RSA& instance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCP2RSA_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCP2RSA& newInstance, const OpenDRIM_DHCP2RSA& oldInstance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCP2RSA_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCP2RSA& instance, string& errorMessage); int DHCP_OpenDRIM_DHCP2RSA_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCP2RSA& instance, string& errorMessage); int DHCP_OpenDRIM_DHCP2RSA_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCP2RSA_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCP2RSA_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_DHCP2RSA_instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCP2RSA_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_DHCP2RSA_instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCP2RSA_populate(OpenDRIM_DHCP2RSA& instance, string& errorMessage); #endif /*OPENDRIM_DHCP2RSAACCESS_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2RSA/Makefile.am0000644000175000017500000000460011400673053023316 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 = libcmpiDHCP_OpenDRIM_DHCP2RSAProvider.la libcmpiDHCP_OpenDRIM_DHCP2RSAProvider_la_SOURCES = OpenDRIM_DHCP2RSAAccess.cpp OpenDRIM_DHCP2RSAProvider.cpp cmpiOpenDRIM_DHCP2RSA.cpp assocOpenDRIM_DHCP2RSA.cpp # May have to be adjusted for direct invocation libcmpiDHCP_OpenDRIM_DHCP2RSAProvider_la_CPPFLAGS = -I../CIM_RemoteServiceAccessPoint -I../CIM_EnabledLogicalElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiDHCP_OpenDRIM_DHCP2RSAProvider_la_LIBADD = ../Common/libcmpiDHCP_Common.la #../CIM_RemoteServiceAccessPoint/libcmpiDHCP_CIM_RemoteServiceAccessPointProvider.la ../CIM_EnabledLogicalElement/libcmpiDHCP_CIM_EnabledLogicalElementProvider.la libcmpiDHCP_OpenDRIM_DHCP2RSAProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_DHCP2RSA.h OpenDRIM_DHCP2RSA.h OpenDRIM_DHCP2RSAAccess.h opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2RSA/OpenDRIM_DHCP2RSAAccess.cpp0000644000175000017500000002363311400673053025722 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2RSAAccess.h" int DHCP_OpenDRIM_DHCP2RSA_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(DHCP_CIM_RemoteServiceAccessPoint_load(broker, errorMessage)); CF_assert(DHCP_CIM_EnabledLogicalElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int DHCP_OpenDRIM_DHCP2RSA_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(DHCP_CIM_RemoteServiceAccessPoint_unload(errorMessage)); CF_assert(DHCP_CIM_EnabledLogicalElement_unload(errorMessage)); */ // TODO _L_; return OK; } int DHCP_OpenDRIM_DHCP2RSA_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 DHCP_OpenDRIM_DHCP2RSA_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(DHCP_OpenDRIM_DHCP2RSA_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(DHCP_OpenDRIM_DHCP2RSA_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; DHCP_OpenDRIM_DHCP2RSA_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(DHCP_OpenDRIM_DHCP2RSA_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int DHCP_OpenDRIM_DHCP2RSA_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_DHCP2RSA& 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(DHCP_OpenDRIM_DHCP2RSA_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(DHCP_OpenDRIM_DHCP2RSA_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(DHCP_OpenDRIM_DHCP2RSA_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } CF_assert(DHCP_OpenDRIM_DHCP2RSA_populate(instance, errorMessage)); _L_; return OK; } int DHCP_OpenDRIM_DHCP2RSA_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCP2RSA& newInstance, const OpenDRIM_DHCP2RSA& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCP2RSA_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCP2RSA& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCP2RSA_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCP2RSA& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCP2RSA_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(DHCP_OpenDRIM_DHCP2RSA_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(DHCP_OpenDRIM_DHCP2RSA_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(DHCP_OpenDRIM_DHCP2RSA_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(DHCP_OpenDRIM_DHCP2RSA_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(DHCP_OpenDRIM_DHCP2RSA_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(DHCP_OpenDRIM_DHCP2RSA_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_DHCP2RSA_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_DHCP2RSA instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); if (discriminant == "r") { CF_assert(DHCP_OpenDRIM_DHCP2RSA_populate(instance, errorMessage)); } OpenDRIM_DHCP2RSA_instances.push_back(instance); } _L_; return OK; } int DHCP_OpenDRIM_DHCP2RSA_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_DHCP2RSA_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_DHCP2RSA instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); if (discriminant == "r") { CF_assert(DHCP_OpenDRIM_DHCP2RSA_populate(instance, errorMessage)); } OpenDRIM_DHCP2RSA_instances.push_back(instance); } _L_; return OK; } int DHCP_OpenDRIM_DHCP2RSA_populate(OpenDRIM_DHCP2RSA& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2RSA/assocOpenDRIM_DHCP2RSA.h0000644000175000017500000000603111400673053025267 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2RSA_H_ #define ASSOCOPENDRIM_DHCP2RSA_H_ #include "OpenDRIM_DHCP2RSAAccess.h" int DHCP_OpenDRIM_DHCP2RSA_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 DHCP_OpenDRIM_DHCP2RSA_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 DHCP_OpenDRIM_DHCP2RSA_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int DHCP_OpenDRIM_DHCP2RSA_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCP2RSA_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int DHCP_OpenDRIM_DHCP2RSA_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_DHCP2RSA_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2RSA/assocOpenDRIM_DHCP2RSA.cpp0000644000175000017500000002064411400673053025630 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2RSA.h" int DHCP_OpenDRIM_DHCP2RSA_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 = DHCP_OpenDRIM_DHCP2RSA_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(DHCP_OpenDRIM_DHCP2RSA_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(DHCP_OpenDRIM_DHCP2RSA_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int DHCP_OpenDRIM_DHCP2RSA_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(DHCP_CIM_RemoteServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(DHCP_CIM_RemoteServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, DHCP_CIM_RemoteServiceAccessPoint_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int DHCP_OpenDRIM_DHCP2RSA_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Antecedent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Antecedent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_RemoteServiceAccessPoint _instance; DHCP_CIM_RemoteServiceAccessPoint_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(DHCP_CIM_RemoteServiceAccessPoint_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, DHCP_CIM_RemoteServiceAccessPoint_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int DHCP_OpenDRIM_DHCP2RSA_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(DHCP_CIM_EnabledLogicalElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(DHCP_CIM_EnabledLogicalElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, DHCP_CIM_EnabledLogicalElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int DHCP_OpenDRIM_DHCP2RSA_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Dependent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Dependent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_EnabledLogicalElement _instance; DHCP_CIM_EnabledLogicalElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(DHCP_CIM_EnabledLogicalElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, DHCP_CIM_EnabledLogicalElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2RSA/OpenDRIM_DHCP2RSA.h0000644000175000017500000001003211400673053024232 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2RSA_H_ #define OPENDRIM_DHCP2RSA_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_RemoteServiceAccessPoint.h" #include "CIM_RemoteServiceAccessPointAccess.h" #include "cmpiCIM_EnabledLogicalElement.h" #include "CIM_EnabledLogicalElementAccess.h" */ const static char* OpenDRIM_DHCP2RSA_classnames[] = {"OpenDRIM_DHCP2RSA"}; static string OpenDRIM_DHCP2RSA_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"OpenDRIM_DHCPServer"}; const static string Antecedent_NAMESPACE = _NAMESPACE; const static string Dependent_role = "Dependent"; const static char* Dependent_classnames[] = {"OpenDRIM_DHCPProtocolEndpoint"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_DHCP2RSA { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; bool IsDefault; bool IsDefault_isNULL; unsigned short OrderOfAccess; bool OrderOfAccess_isNULL; OpenDRIM_DHCP2RSA() { Antecedent_isNULL = true; Dependent_isNULL = true; IsDefault_isNULL = true; OrderOfAccess_isNULL = true; } ~OpenDRIM_DHCP2RSA() {} string getKeys() const { return CF_toLowCase(".Antecedent=\"" + CF_quoteString(Antecedent.toString()) + "\""".Dependent=\"" + CF_quoteString(Dependent.toString()) + "\""); } int getAntecedent(Objectpath& value) const { if (Antecedent_isNULL==true) return NOT_FOUND; value = Antecedent; return OK; } int setAntecedent(const Objectpath& newValue) { Antecedent = newValue; Antecedent.setNamespace(Antecedent_NAMESPACE); Antecedent_isNULL = false; return OK; } int getDependent(Objectpath& value) const { if (Dependent_isNULL==true) return NOT_FOUND; value = Dependent; return OK; } int setDependent(const Objectpath& newValue) { Dependent = newValue; Dependent.setNamespace(Dependent_NAMESPACE); Dependent_isNULL = false; return OK; } int getIsDefault(bool& value) const { if (IsDefault_isNULL==true) return NOT_FOUND; value = IsDefault; return OK; } int setIsDefault(const bool& newValue) { IsDefault = newValue; IsDefault_isNULL = false; return OK; } int getOrderOfAccess(unsigned short& value) const { if (OrderOfAccess_isNULL==true) return NOT_FOUND; value = OrderOfAccess; return OK; } int setOrderOfAccess(const unsigned short& newValue) { OrderOfAccess = newValue; OrderOfAccess_isNULL = false; return OK; } }; #endif /*OPENDRIM_DHCP2RSA_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2RSA/OpenDRIM_DHCP2RSAProvider.cpp0000644000175000017500000003757611400673053026326 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2RSA.h" #include "OpenDRIM_DHCP2RSAAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define DHCP_OpenDRIM_DHCP2RSAProviderSetInstance DHCP_OpenDRIM_DHCP2RSAProviderModifyInstance #endif int DHCP_OpenDRIM_DHCP2RSA_init(const CMPIBroker* broker); int DHCP_OpenDRIM_DHCP2RSA_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus DHCP_OpenDRIM_DHCP2RSAProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = DHCP_OpenDRIM_DHCP2RSA_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2RSAProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2RSA_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2RSA_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = DHCP_OpenDRIM_DHCP2RSA_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2RSAProviderEnumInstances(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 = DHCP_OpenDRIM_DHCP2RSA_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2RSA_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = DHCP_OpenDRIM_DHCP2RSA_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2RSAProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCP2RSA instance; DHCP_OpenDRIM_DHCP2RSA_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2RSA_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2RSA_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = DHCP_OpenDRIM_DHCP2RSA_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2RSAProviderSetInstance(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_DHCP2RSA newInstance, oldInstance; DHCP_OpenDRIM_DHCP2RSA_toCPP(_broker, ci, newInstance); DHCP_OpenDRIM_DHCP2RSA_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2RSA_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2RSA_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCP2RSA_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2RSA_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2RSAProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCP2RSA instance; DHCP_OpenDRIM_DHCP2RSA_toCPP(_broker, ci, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2RSA_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_DHCP2RSA_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCP2RSA_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2RSA_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCP2RSA_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2RSA_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = DHCP_OpenDRIM_DHCP2RSA_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2RSAProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCP2RSA instance; DHCP_OpenDRIM_DHCP2RSA_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2RSA_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2RSA_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCP2RSA_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2RSA_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2RSAProviderExecQuery(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 DHCP_OpenDRIM_DHCP2RSAProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = DHCP_OpenDRIM_DHCP2RSA_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2RSAProviderAssociatorNames(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 = DHCP_OpenDRIM_DHCP2RSA_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2RSA_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 DHCP_OpenDRIM_DHCP2RSAProviderAssociators(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 = DHCP_OpenDRIM_DHCP2RSA_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2RSA_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 DHCP_OpenDRIM_DHCP2RSAProviderReferenceNames(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 = DHCP_OpenDRIM_DHCP2RSA_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2RSA_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = DHCP_OpenDRIM_DHCP2RSA_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = DHCP_OpenDRIM_DHCP2RSA_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2RSA_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = DHCP_OpenDRIM_DHCP2RSA_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2RSAProviderReferences(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 = DHCP_OpenDRIM_DHCP2RSA_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2RSA_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = DHCP_OpenDRIM_DHCP2RSA_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = DHCP_OpenDRIM_DHCP2RSA_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2RSA_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = DHCP_OpenDRIM_DHCP2RSA_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int DHCP_OpenDRIM_DHCP2RSA_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2RSA_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_DHCP2RSA_init FAILED: " + (string) OpenDRIM_DHCP2RSA_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int DHCP_OpenDRIM_DHCP2RSA_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2RSA_unload(errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_DHCP2RSA_unload FAILED: " + (string) OpenDRIM_DHCP2RSA_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define DHCP_OpenDRIM_DHCP2RSA_INIT if (DHCP_OpenDRIM_DHCP2RSA_init(_broker) < 0) return NULL CMInstanceMIStub(DHCP_OpenDRIM_DHCP2RSAProvider, DHCP_OpenDRIM_DHCP2RSAProvider, _broker, DHCP_OpenDRIM_DHCP2RSA_INIT); CMAssociationMIStub(DHCP_OpenDRIM_DHCP2RSAProvider, DHCP_OpenDRIM_DHCP2RSAProvider, _broker, DHCP_OpenDRIM_DHCP2RSA_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementSettingData/0000755000175000017500000000000011400673053024274 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementSettingData/assocOpenDRIM_DHCPElementSettingData.cppopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementSettingData/assocOpenDRIM_DHCPElementSettingData.cpp0000644000175000017500000002110411400673053033644 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPElementSettingData.h" int DHCP_OpenDRIM_DHCPElementSettingData_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 = DHCP_OpenDRIM_DHCPElementSettingData_associatorFilter(broker, ctx, cop, knownInstance, assocClass, resultClass, role, resultRole, leftToRight, errorMessage); if (errorCode == -1) return OK; if (errorCode != OK) return errorCode; if (leftToRight) { if (role != NULL && strcasecmp(role, "SettingData") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "ManagedElement") != 0) return OK; CF_assert(DHCP_OpenDRIM_DHCPElementSettingData_associatorSettingDataToManagedElement(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "ManagedElement") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "SettingData") != 0) return OK; CF_assert(DHCP_OpenDRIM_DHCPElementSettingData_associatorManagedElementToSettingData(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int DHCP_OpenDRIM_DHCPElementSettingData_enumerateSettingDatas(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, SettingData_NAMESPACE, SettingData_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(DHCP_CIM_SettingData_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(DHCP_CIM_SettingData_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, DHCP_CIM_SettingData_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int DHCP_OpenDRIM_DHCPElementSettingData_getSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), SettingData_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), SettingData_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_SettingData _instance; DHCP_CIM_SettingData_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(DHCP_CIM_SettingData_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, DHCP_CIM_SettingData_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int DHCP_OpenDRIM_DHCPElementSettingData_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(DHCP_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(DHCP_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, DHCP_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int DHCP_OpenDRIM_DHCPElementSettingData_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; DHCP_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(DHCP_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, DHCP_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementSettingData/Makefile.am0000644000175000017500000000475411400673053026342 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 = libcmpiDHCP_OpenDRIM_DHCPElementSettingDataProvider.la libcmpiDHCP_OpenDRIM_DHCPElementSettingDataProvider_la_SOURCES = OpenDRIM_DHCPElementSettingDataAccess.cpp OpenDRIM_DHCPElementSettingDataProvider.cpp cmpiOpenDRIM_DHCPElementSettingData.cpp assocOpenDRIM_DHCPElementSettingData.cpp # May have to be adjusted for direct invocation libcmpiDHCP_OpenDRIM_DHCPElementSettingDataProvider_la_CPPFLAGS = -I../CIM_SettingData -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiDHCP_OpenDRIM_DHCPElementSettingDataProvider_la_LIBADD = ../Common/libcmpiDHCP_Common.la #../CIM_SettingData/libcmpiDHCP_CIM_SettingDataProvider.la ../CIM_ManagedElement/libcmpiDHCP_CIM_ManagedElementProvider.la libcmpiDHCP_OpenDRIM_DHCPElementSettingDataProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_DHCPElementSettingData.h OpenDRIM_DHCPElementSettingData.h OpenDRIM_DHCPElementSettingDataAccess.h opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementSettingData/cmpiOpenDRIM_DHCPElementSettingData.cpp0000644000175000017500000000725311400673053033475 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPElementSettingData.h" CMPIObjectPath* DHCP_OpenDRIM_DHCPElementSettingData_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_DHCPElementSettingData& instance) { _E_; Objectpath op(broker, OpenDRIM_DHCPElementSettingData_classnames[0], OpenDRIM_DHCPElementSettingData_NAMESPACE); if (!instance.ManagedElement_isNULL) op.addKey("ManagedElement", instance.ManagedElement); if (!instance.SettingData_isNULL) op.addKey("SettingData", instance.SettingData); _L_; return op.getHdl(); } CMPIInstance* DHCP_OpenDRIM_DHCPElementSettingData_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_DHCPElementSettingData& instance) { _E_; Objectpath op(broker, DHCP_OpenDRIM_DHCPElementSettingData_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.IsDefault_isNULL) ci.setProperty("IsDefault", instance.IsDefault); if (!instance.IsCurrent_isNULL) ci.setProperty("IsCurrent", instance.IsCurrent); if (!instance.IsNext_isNULL) ci.setProperty("IsNext", instance.IsNext); _L_; return ci.getHdl(); } void DHCP_OpenDRIM_DHCPElementSettingData_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_DHCPElementSettingData& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("SettingData", instance.SettingData) == OK) instance.SettingData_isNULL = false; if (op.getKey("ManagedElement", instance.ManagedElement) == OK) instance.ManagedElement_isNULL = false; _L_; } void DHCP_OpenDRIM_DHCPElementSettingData_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_DHCPElementSettingData& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("ManagedElement", instance.ManagedElement) == OK) instance.ManagedElement_isNULL = false; if (inst.getProperty("SettingData", instance.SettingData) == OK) instance.SettingData_isNULL = false; if (inst.getProperty("IsDefault", instance.IsDefault) == OK) instance.IsDefault_isNULL = false; if (inst.getProperty("IsCurrent", instance.IsCurrent) == OK) instance.IsCurrent_isNULL = false; if (inst.getProperty("IsNext", instance.IsNext) == OK) instance.IsNext_isNULL = false; _L_; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementSettingData/assocOpenDRIM_DHCPElementSettingData.h0000644000175000017500000000626111400673053033320 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPELEMENTSETTINGDATA_H_ #define ASSOCOPENDRIM_DHCPELEMENTSETTINGDATA_H_ #include "OpenDRIM_DHCPElementSettingDataAccess.h" int DHCP_OpenDRIM_DHCPElementSettingData_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 DHCP_OpenDRIM_DHCPElementSettingData_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 DHCP_OpenDRIM_DHCPElementSettingData_enumerateSettingDatas(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int DHCP_OpenDRIM_DHCPElementSettingData_getSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCPElementSettingData_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int DHCP_OpenDRIM_DHCPElementSettingData_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_DHCPELEMENTSETTINGDATA_H_*/ ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementSettingData/OpenDRIM_DHCPElementSettingDataProvider.cppopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementSettingData/OpenDRIM_DHCPElementSettingDataProvider.0000644000175000017500000004220211400673053033625 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPElementSettingData.h" #include "OpenDRIM_DHCPElementSettingDataAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define DHCP_OpenDRIM_DHCPElementSettingDataProviderSetInstance DHCP_OpenDRIM_DHCPElementSettingDataProviderModifyInstance #endif int DHCP_OpenDRIM_DHCPElementSettingData_init(const CMPIBroker* broker); int DHCP_OpenDRIM_DHCPElementSettingData_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus DHCP_OpenDRIM_DHCPElementSettingDataProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = DHCP_OpenDRIM_DHCPElementSettingData_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPElementSettingDataProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPElementSettingData_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = DHCP_OpenDRIM_DHCPElementSettingData_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPElementSettingDataProviderEnumInstances(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 = DHCP_OpenDRIM_DHCPElementSettingData_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = DHCP_OpenDRIM_DHCPElementSettingData_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPElementSettingDataProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPElementSettingData instance; DHCP_OpenDRIM_DHCPElementSettingData_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPElementSettingData_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = DHCP_OpenDRIM_DHCPElementSettingData_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPElementSettingDataProviderSetInstance(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_DHCPElementSettingData newInstance, oldInstance; DHCP_OpenDRIM_DHCPElementSettingData_toCPP(_broker, ci, newInstance); DHCP_OpenDRIM_DHCPElementSettingData_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPElementSettingData_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPElementSettingData_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPElementSettingDataProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPElementSettingData instance; DHCP_OpenDRIM_DHCPElementSettingData_toCPP(_broker, ci, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPElementSettingData_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_DHCPElementSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPElementSettingData_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPElementSettingData_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = DHCP_OpenDRIM_DHCPElementSettingData_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPElementSettingDataProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPElementSettingData instance; DHCP_OpenDRIM_DHCPElementSettingData_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPElementSettingData_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPElementSettingData_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPElementSettingDataProviderExecQuery(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 DHCP_OpenDRIM_DHCPElementSettingDataProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = DHCP_OpenDRIM_DHCPElementSettingData_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPElementSettingDataProviderAssociatorNames(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 = DHCP_OpenDRIM_DHCPElementSettingData_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementSettingData_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 DHCP_OpenDRIM_DHCPElementSettingDataProviderAssociators(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 = DHCP_OpenDRIM_DHCPElementSettingData_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementSettingData_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 DHCP_OpenDRIM_DHCPElementSettingDataProviderReferenceNames(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 = DHCP_OpenDRIM_DHCPElementSettingData_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = DHCP_OpenDRIM_DHCPElementSettingData_referenceSettingDataToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = DHCP_OpenDRIM_DHCPElementSettingData_referenceManagedElementToSettingData(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = DHCP_OpenDRIM_DHCPElementSettingData_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPElementSettingDataProviderReferences(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 = DHCP_OpenDRIM_DHCPElementSettingData_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = DHCP_OpenDRIM_DHCPElementSettingData_referenceSettingDataToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = DHCP_OpenDRIM_DHCPElementSettingData_referenceManagedElementToSettingData(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPElementSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = DHCP_OpenDRIM_DHCPElementSettingData_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int DHCP_OpenDRIM_DHCPElementSettingData_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPElementSettingData_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_DHCPElementSettingData_init FAILED: " + (string) OpenDRIM_DHCPElementSettingData_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int DHCP_OpenDRIM_DHCPElementSettingData_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPElementSettingData_unload(errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_DHCPElementSettingData_unload FAILED: " + (string) OpenDRIM_DHCPElementSettingData_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define DHCP_OpenDRIM_DHCPElementSettingData_INIT if (DHCP_OpenDRIM_DHCPElementSettingData_init(_broker) < 0) return NULL CMInstanceMIStub(DHCP_OpenDRIM_DHCPElementSettingDataProvider, DHCP_OpenDRIM_DHCPElementSettingDataProvider, _broker, DHCP_OpenDRIM_DHCPElementSettingData_INIT); CMAssociationMIStub(DHCP_OpenDRIM_DHCPElementSettingDataProvider, DHCP_OpenDRIM_DHCPElementSettingDataProvider, _broker, DHCP_OpenDRIM_DHCPElementSettingData_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementSettingData/cmpiOpenDRIM_DHCPElementSettingData.h0000644000175000017500000000441511400673053033137 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPELEMENTSETTINGDATA_H_ #define CMPIOPENDRIM_DHCPELEMENTSETTINGDATA_H_ #include "OpenDRIM_DHCPElementSettingData.h" CMPIObjectPath* DHCP_OpenDRIM_DHCPElementSettingData_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_DHCPElementSettingData& instance); CMPIInstance* DHCP_OpenDRIM_DHCPElementSettingData_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_DHCPElementSettingData& instance); void DHCP_OpenDRIM_DHCPElementSettingData_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_DHCPElementSettingData& instance); void DHCP_OpenDRIM_DHCPElementSettingData_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_DHCPElementSettingData& instance); #endif /*CMPIOPENDRIM_DHCPELEMENTSETTINGDATA_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementSettingData/OpenDRIM_DHCPElementSettingData.h0000644000175000017500000001101611400673053032261 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPELEMENTSETTINGDATA_H_ #define OPENDRIM_DHCPELEMENTSETTINGDATA_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_SettingData.h" #include "CIM_SettingDataAccess.h" #include "cmpiCIM_ManagedElement.h" #include "CIM_ManagedElementAccess.h" */ const static char* OpenDRIM_DHCPElementSettingData_classnames[] = {"OpenDRIM_DHCPElementSettingData"}; static string OpenDRIM_DHCPElementSettingData_NAMESPACE = _NAMESPACE; const static string SettingData_role = "SettingData"; const static char* SettingData_classnames[] = {"OpenDRIM_DHCPSettingData"}; const static string SettingData_NAMESPACE = _NAMESPACE; const static string ManagedElement_role = "ManagedElement"; const static char* ManagedElement_classnames[] = {"OpenDRIM_DHCPProtocolEndpoint"}; const static string ManagedElement_NAMESPACE = _NAMESPACE; class OpenDRIM_DHCPElementSettingData { public: Objectpath ManagedElement; bool ManagedElement_isNULL; Objectpath SettingData; bool SettingData_isNULL; unsigned short IsDefault; bool IsDefault_isNULL; unsigned short IsCurrent; bool IsCurrent_isNULL; unsigned short IsNext; bool IsNext_isNULL; OpenDRIM_DHCPElementSettingData() { ManagedElement_isNULL = true; SettingData_isNULL = true; IsDefault_isNULL = true; IsCurrent_isNULL = true; IsNext_isNULL = true; } ~OpenDRIM_DHCPElementSettingData() {} string getKeys() const { return CF_toLowCase(".ManagedElement=\"" + CF_quoteString(ManagedElement.toString()) + "\""".SettingData=\"" + CF_quoteString(SettingData.toString()) + "\""); } int getManagedElement(Objectpath& value) const { if (ManagedElement_isNULL==true) return NOT_FOUND; value = ManagedElement; return OK; } int setManagedElement(const Objectpath& newValue) { ManagedElement = newValue; ManagedElement.setNamespace(ManagedElement_NAMESPACE); ManagedElement_isNULL = false; return OK; } int getSettingData(Objectpath& value) const { if (SettingData_isNULL==true) return NOT_FOUND; value = SettingData; return OK; } int setSettingData(const Objectpath& newValue) { SettingData = newValue; SettingData.setNamespace(SettingData_NAMESPACE); SettingData_isNULL = false; return OK; } int getIsDefault(unsigned short& value) const { if (IsDefault_isNULL==true) return NOT_FOUND; value = IsDefault; return OK; } int setIsDefault(const unsigned short& newValue) { IsDefault = newValue; IsDefault_isNULL = false; return OK; } int getIsCurrent(unsigned short& value) const { if (IsCurrent_isNULL==true) return NOT_FOUND; value = IsCurrent; return OK; } int setIsCurrent(const unsigned short& newValue) { IsCurrent = newValue; IsCurrent_isNULL = false; return OK; } int getIsNext(unsigned short& value) const { if (IsNext_isNULL==true) return NOT_FOUND; value = IsNext; return OK; } int setIsNext(const unsigned short& newValue) { IsNext = newValue; IsNext_isNULL = false; return OK; } }; #endif /*OPENDRIM_DHCPELEMENTSETTINGDATA_H_*/ ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementSettingData/OpenDRIM_DHCPElementSettingDataAccess.cppopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementSettingData/OpenDRIM_DHCPElementSettingDataAccess.cp0000644000175000017500000002536711400673053033574 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPElementSettingDataAccess.h" int DHCP_OpenDRIM_DHCPElementSettingData_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(DHCP_CIM_SettingData_load(broker, errorMessage)); CF_assert(DHCP_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int DHCP_OpenDRIM_DHCPElementSettingData_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(DHCP_CIM_SettingData_unload(errorMessage)); CF_assert(DHCP_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int DHCP_OpenDRIM_DHCPElementSettingData_isAssociated(const Instance& SettingData, const Instance& ManagedElement, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int DHCP_OpenDRIM_DHCPElementSettingData_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(DHCP_OpenDRIM_DHCPElementSettingData_enumerateSettingDatas(broker, ctx, subjects, NULL, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(DHCP_OpenDRIM_DHCPElementSettingData_enumerateSettingDatas(broker, ctx, subjects, NULL, false, errorMessage)); vector::iterator c = subjects.begin(); vector::iterator end = subjects.end(); for (; c != end; ++c) { bool leftToRight = true; vector associatedInstances; DHCP_OpenDRIM_DHCPElementSettingData_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), SettingData_classnames[0], ManagedElement_classnames[0], SettingData_role.c_str(), ManagedElement_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(DHCP_OpenDRIM_DHCPElementSettingData_referenceSettingDataToManagedElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int DHCP_OpenDRIM_DHCPElementSettingData_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_DHCPElementSettingData& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath SettingData_objectpath; instance.getSettingData(SettingData_objectpath); Instance SettingData_instance; CF_assert(DHCP_OpenDRIM_DHCPElementSettingData_getSettingData(broker, ctx, SettingData_objectpath, SettingData_instance, NULL, errorMessage)); Objectpath ManagedElement_objectpath; instance.getManagedElement(ManagedElement_objectpath); Instance ManagedElement_instance; CF_assert(DHCP_OpenDRIM_DHCPElementSettingData_getManagedElement(broker, ctx, ManagedElement_objectpath, ManagedElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(DHCP_OpenDRIM_DHCPElementSettingData_isAssociated(SettingData_instance, ManagedElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } CF_assert(DHCP_OpenDRIM_DHCPElementSettingData_populate(instance, errorMessage)); _L_; return OK; } int DHCP_OpenDRIM_DHCPElementSettingData_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPElementSettingData& newInstance, const OpenDRIM_DHCPElementSettingData& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPElementSettingData_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPElementSettingData& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPElementSettingData_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPElementSettingData& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPElementSettingData_associatorSettingDataToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& SettingData_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector ManagedElement_instances; if (discriminant=="a") CF_assert(DHCP_OpenDRIM_DHCPElementSettingData_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(DHCP_OpenDRIM_DHCPElementSettingData_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(DHCP_OpenDRIM_DHCPElementSettingData_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); } for (size_t i=0; i& SettingData_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector SettingData_instances; if (discriminant=="a") CF_assert(DHCP_OpenDRIM_DHCPElementSettingData_enumerateSettingDatas(broker, ctx, SettingData_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(DHCP_OpenDRIM_DHCPElementSettingData_enumerateSettingDatas(broker, ctx, SettingData_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(DHCP_OpenDRIM_DHCPElementSettingData_enumerateSettingDatas(broker, ctx, SettingData_instances, properties, false, errorMessage)); } for (size_t i=0; i& ManagedElement_instances, vector& OpenDRIM_DHCPElementSettingData_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_DHCPElementSettingData instance; instance.setSettingData(((Instance) SettingData_instance).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instances[i]).getObjectpath()); if (discriminant == "r") { CF_assert(DHCP_OpenDRIM_DHCPElementSettingData_populate(instance, errorMessage)); } OpenDRIM_DHCPElementSettingData_instances.push_back(instance); } _L_; return OK; } int DHCP_OpenDRIM_DHCPElementSettingData_referenceManagedElementToSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& SettingData_instances, vector& OpenDRIM_DHCPElementSettingData_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < SettingData_instances.size(); i++) { OpenDRIM_DHCPElementSettingData instance; instance.setSettingData(((Instance) SettingData_instances[i]).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instance).getObjectpath()); if (discriminant == "r") { CF_assert(DHCP_OpenDRIM_DHCPElementSettingData_populate(instance, errorMessage)); } OpenDRIM_DHCPElementSettingData_instances.push_back(instance); } _L_; return OK; } int DHCP_OpenDRIM_DHCPElementSettingData_populate(OpenDRIM_DHCPElementSettingData& instance, string& errorMessage) { _E_; instance.setIsCurrent(1); _L_; return OK; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPElementSettingData/OpenDRIM_DHCPElementSettingDataAccess.h0000644000175000017500000001061411400673053033406 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPELEMENTSETTINGDATAACCESS_H_ #define OPENDRIM_DHCPELEMENTSETTINGDATAACCESS_H_ #include "DHCP_Common.h" #include "OpenDRIM_DHCPElementSettingData.h" #include "assocOpenDRIM_DHCPElementSettingData.h" int DHCP_OpenDRIM_DHCPElementSettingData_load(const CMPIBroker* broker, string& errorMessage); int DHCP_OpenDRIM_DHCPElementSettingData_unload(string& errorMessage); int DHCP_OpenDRIM_DHCPElementSettingData_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCPElementSettingData_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_DHCPElementSettingData& instance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCPElementSettingData_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPElementSettingData& newInstance, const OpenDRIM_DHCPElementSettingData& oldInstance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCPElementSettingData_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPElementSettingData& instance, string& errorMessage); int DHCP_OpenDRIM_DHCPElementSettingData_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPElementSettingData& instance, string& errorMessage); int DHCP_OpenDRIM_DHCPElementSettingData_associatorSettingDataToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& SettingData_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCPElementSettingData_associatorManagedElementToSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const char** properties, vector& SettingData_associatedInstances, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCPElementSettingData_referenceSettingDataToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& SettingData_instance, const vector& ManagedElement_instances, vector& OpenDRIM_DHCPElementSettingData_instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCPElementSettingData_referenceManagedElementToSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& SettingData_instances, vector& OpenDRIM_DHCPElementSettingData_instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCPElementSettingData_populate(OpenDRIM_DHCPElementSettingData& instance, string& errorMessage); #endif /*OPENDRIM_DHCPELEMENTSETTINGDATAACCESS_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/VERSION0000644000175000017500000000000611400673053017523 0ustar guillaumeguillaume1.0.0 opendrim-lmp-dhcp-1.0.0~ppa/test/0000755000175000017500000000000011400673053017436 5ustar guillaumeguillaumeopendrim-lmp-dhcp-1.0.0~ppa/test/testOpenDRIM_DHCPSettingData.cpp0000644000175000017500000001236311400673053025352 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPSettingData.h" #include "OpenDRIM_DHCPSettingDataAccess.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_DHCPSettingData& instance) { os << " [OpenDRIM_DHCPSettingData]" << endl; ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToStringInt("AddressOrigin", AddressOrigin, AddressOrigin_isNULL); ToString("RequestedIPv4Address", RequestedIPv4Address, RequestedIPv4Address_isNULL); ToString("RequestedLeaseTime", RequestedLeaseTime, RequestedLeaseTime_isNULL); ToString("ClientIdentifier", ClientIdentifier, ClientIdentifier_isNULL); ToString("VendorClassIdentifier", VendorClassIdentifier, VendorClassIdentifier_isNULL); ToStringArrayInt("RequestedOptions", RequestedOptions, RequestedOptions_isNULL); ToStringArrayInt("RequiredOptions", RequiredOptions, RequiredOptions_isNULL); os << " [\\OpenDRIM_DHCPSettingData]" << endl; return os; } int main() { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPSettingData_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = DHCP_OpenDRIM_DHCPSettingData_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 = DHCP_OpenDRIM_DHCPSettingData_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 = DHCP_OpenDRIM_DHCPSettingData_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 = DHCP_OpenDRIM_DHCPSettingData_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-dhcp-1.0.0~ppa/test/testOpenDRIM_DHCP2IP.cpp0000644000175000017500000001077311400673053023540 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2IP.h" #include "OpenDRIM_DHCP2IPAccess.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_DHCP2IP& instance) { os << " [OpenDRIM_DHCP2IP]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); os << " [\\OpenDRIM_DHCP2IP]" << endl; return os; } int main() { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2IP_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = DHCP_OpenDRIM_DHCP2IP_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 = DHCP_OpenDRIM_DHCP2IP_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 = DHCP_OpenDRIM_DHCP2IP_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 = DHCP_OpenDRIM_DHCP2IP_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-dhcp-1.0.0~ppa/test/Makefile.am0000644000175000017500000001422011400673053021471 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPServer testOpenDRIM_DHCPElementSettingData testOpenDRIM_DHCPProtocolEndpoint testOpenDRIM_DHCPConformsToProfile testOpenDRIM_RegisteredDHCPProfile testOpenDRIM_DHCPSettingData testOpenDRIM_DHCPCapabilities testOpenDRIM_DHCP2RSA testOpenDRIM_DHCPElementCapabilities testOpenDRIM_DHCP2IP testOpenDRIM_DHCP2ComputerSystem testOpenDRIM_DHCPServer_CPPFLAGS = -I../OpenDRIM_DHCPServer/ testOpenDRIM_DHCPServer_SOURCES = testOpenDRIM_DHCPServer.cpp testOpenDRIM_DHCPServer_LDADD = ../OpenDRIM_DHCPServer/libcmpiDHCP_OpenDRIM_DHCPServerProvider.la test-OpenDRIM_DHCPServer: testOpenDRIM_DHCPServer ./testOpenDRIM_DHCPServer # May have to be adjusted for direct invocation testOpenDRIM_DHCPElementSettingData_CPPFLAGS = -I../OpenDRIM_DHCPElementSettingData/ -I../null/ -I../null/ testOpenDRIM_DHCPElementSettingData_SOURCES = testOpenDRIM_DHCPElementSettingData.cpp testOpenDRIM_DHCPElementSettingData_LDADD = ../OpenDRIM_DHCPElementSettingData/libcmpiDHCP_OpenDRIM_DHCPElementSettingDataProvider.la test-OpenDRIM_DHCPElementSettingData: testOpenDRIM_DHCPElementSettingData ./testOpenDRIM_DHCPElementSettingData testOpenDRIM_DHCPProtocolEndpoint_CPPFLAGS = -I../OpenDRIM_DHCPProtocolEndpoint/ testOpenDRIM_DHCPProtocolEndpoint_SOURCES = testOpenDRIM_DHCPProtocolEndpoint.cpp testOpenDRIM_DHCPProtocolEndpoint_LDADD = ../OpenDRIM_DHCPProtocolEndpoint/libcmpiDHCP_OpenDRIM_DHCPProtocolEndpointProvider.la test-OpenDRIM_DHCPProtocolEndpoint: testOpenDRIM_DHCPProtocolEndpoint ./testOpenDRIM_DHCPProtocolEndpoint testOpenDRIM_DHCPConformsToProfile_CPPFLAGS = -I../OpenDRIM_DHCPConformsToProfile/ testOpenDRIM_DHCPConformsToProfile_SOURCES = testOpenDRIM_DHCPConformsToProfile.cpp testOpenDRIM_DHCPConformsToProfile_LDADD = ../OpenDRIM_DHCPConformsToProfile/libcmpiDHCP_OpenDRIM_DHCPConformsToProfileProvider.la test-OpenDRIM_DHCPConformsToProfile: testOpenDRIM_DHCPConformsToProfile ./testOpenDRIM_DHCPConformsToProfile testOpenDRIM_RegisteredDHCPProfile_CPPFLAGS = -I../OpenDRIM_RegisteredDHCPProfile/ testOpenDRIM_RegisteredDHCPProfile_SOURCES = testOpenDRIM_RegisteredDHCPProfile.cpp testOpenDRIM_RegisteredDHCPProfile_LDADD = ../OpenDRIM_RegisteredDHCPProfile/libcmpiDHCP_OpenDRIM_RegisteredDHCPProfileProvider.la test-OpenDRIM_RegisteredDHCPProfile: testOpenDRIM_RegisteredDHCPProfile ./testOpenDRIM_RegisteredDHCPProfile testOpenDRIM_DHCPSettingData_CPPFLAGS = -I../OpenDRIM_DHCPSettingData/ testOpenDRIM_DHCPSettingData_SOURCES = testOpenDRIM_DHCPSettingData.cpp testOpenDRIM_DHCPSettingData_LDADD = ../OpenDRIM_DHCPSettingData/libcmpiDHCP_OpenDRIM_DHCPSettingDataProvider.la test-OpenDRIM_DHCPSettingData: testOpenDRIM_DHCPSettingData ./testOpenDRIM_DHCPSettingData testOpenDRIM_DHCPCapabilities_CPPFLAGS = -I../OpenDRIM_DHCPCapabilities/ testOpenDRIM_DHCPCapabilities_SOURCES = testOpenDRIM_DHCPCapabilities.cpp testOpenDRIM_DHCPCapabilities_LDADD = ../OpenDRIM_DHCPCapabilities/libcmpiDHCP_OpenDRIM_DHCPCapabilitiesProvider.la test-OpenDRIM_DHCPCapabilities: testOpenDRIM_DHCPCapabilities ./testOpenDRIM_DHCPCapabilities # May have to be adjusted for direct invocation testOpenDRIM_DHCP2RSA_CPPFLAGS = -I../OpenDRIM_DHCP2RSA/ -I../null/ -I../null/ testOpenDRIM_DHCP2RSA_SOURCES = testOpenDRIM_DHCP2RSA.cpp testOpenDRIM_DHCP2RSA_LDADD = ../OpenDRIM_DHCP2RSA/libcmpiDHCP_OpenDRIM_DHCP2RSAProvider.la test-OpenDRIM_DHCP2RSA: testOpenDRIM_DHCP2RSA ./testOpenDRIM_DHCP2RSA # May have to be adjusted for direct invocation testOpenDRIM_DHCPElementCapabilities_CPPFLAGS = -I../OpenDRIM_DHCPElementCapabilities/ -I../null/ -I../null/ testOpenDRIM_DHCPElementCapabilities_SOURCES = testOpenDRIM_DHCPElementCapabilities.cpp testOpenDRIM_DHCPElementCapabilities_LDADD = ../OpenDRIM_DHCPElementCapabilities/libcmpiDHCP_OpenDRIM_DHCPElementCapabilitiesProvider.la test-OpenDRIM_DHCPElementCapabilities: testOpenDRIM_DHCPElementCapabilities ./testOpenDRIM_DHCPElementCapabilities # May have to be adjusted for direct invocation testOpenDRIM_DHCP2IP_CPPFLAGS = -I../OpenDRIM_DHCP2IP/ -I../null/ -I../null/ testOpenDRIM_DHCP2IP_SOURCES = testOpenDRIM_DHCP2IP.cpp testOpenDRIM_DHCP2IP_LDADD = ../OpenDRIM_DHCP2IP/libcmpiDHCP_OpenDRIM_DHCP2IPProvider.la test-OpenDRIM_DHCP2IP: testOpenDRIM_DHCP2IP ./testOpenDRIM_DHCP2IP # May have to be adjusted for direct invocation testOpenDRIM_DHCP2ComputerSystem_CPPFLAGS = -I../OpenDRIM_DHCP2ComputerSystem/ -I../null/ -I../null/ testOpenDRIM_DHCP2ComputerSystem_SOURCES = testOpenDRIM_DHCP2ComputerSystem.cpp testOpenDRIM_DHCP2ComputerSystem_LDADD = ../OpenDRIM_DHCP2ComputerSystem/libcmpiDHCP_OpenDRIM_DHCP2ComputerSystemProvider.la test-OpenDRIM_DHCP2ComputerSystem: testOpenDRIM_DHCP2ComputerSystem ./testOpenDRIM_DHCP2ComputerSystem opendrim-lmp-dhcp-1.0.0~ppa/test/testOpenDRIM_DHCPElementSettingData.cpp0000644000175000017500000001154011400673053026660 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPElementSettingData.h" #include "OpenDRIM_DHCPElementSettingDataAccess.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_DHCPElementSettingData& instance) { os << " [OpenDRIM_DHCPElementSettingData]" << endl; ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL); ToStringRef("SettingData", SettingData, SettingData_isNULL); ToStringInt("IsDefault", IsDefault, IsDefault_isNULL); ToStringInt("IsCurrent", IsCurrent, IsCurrent_isNULL); ToStringInt("IsNext", IsNext, IsNext_isNULL); os << " [\\OpenDRIM_DHCPElementSettingData]" << endl; return os; } int main() { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPElementSettingData_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = DHCP_OpenDRIM_DHCPElementSettingData_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 = DHCP_OpenDRIM_DHCPElementSettingData_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 = DHCP_OpenDRIM_DHCPElementSettingData_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 = DHCP_OpenDRIM_DHCPElementSettingData_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-dhcp-1.0.0~ppa/test/testOpenDRIM_RegisteredDHCPProfile.cpp0000644000175000017500000001243611400673053026562 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_RegisteredDHCPProfile.h" #include "OpenDRIM_RegisteredDHCPProfileAccess.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_RegisteredDHCPProfile& instance) { os << " [OpenDRIM_RegisteredDHCPProfile]" << 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_RegisteredDHCPProfile]" << endl; return os; } int main() { string errorMessage; int errorCode = DHCP_OpenDRIM_RegisteredDHCPProfile_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = DHCP_OpenDRIM_RegisteredDHCPProfile_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 = DHCP_OpenDRIM_RegisteredDHCPProfile_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 = DHCP_OpenDRIM_RegisteredDHCPProfile_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 = DHCP_OpenDRIM_RegisteredDHCPProfile_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-dhcp-1.0.0~ppa/test/testOpenDRIM_DHCPConformsToProfile.cpp0000644000175000017500000001131211400673053026546 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPConformsToProfile.h" #include "OpenDRIM_DHCPConformsToProfileAccess.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_DHCPConformsToProfile& instance) { os << " [OpenDRIM_DHCPConformsToProfile]" << endl; ToStringRef("ConformantStandard", ConformantStandard, ConformantStandard_isNULL); ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL); os << " [\\OpenDRIM_DHCPConformsToProfile]" << endl; return os; } int main() { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPConformsToProfile_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = DHCP_OpenDRIM_DHCPConformsToProfile_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 = DHCP_OpenDRIM_DHCPConformsToProfile_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 = DHCP_OpenDRIM_DHCPConformsToProfile_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 = DHCP_OpenDRIM_DHCPConformsToProfile_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-dhcp-1.0.0~ppa/test/testOpenDRIM_DHCP2RSA.cpp0000644000175000017500000001120011400673053023637 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2RSA.h" #include "OpenDRIM_DHCP2RSAAccess.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_DHCP2RSA& instance) { os << " [OpenDRIM_DHCP2RSA]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); ToString("IsDefault", IsDefault, IsDefault_isNULL); ToStringInt("OrderOfAccess", OrderOfAccess, OrderOfAccess_isNULL); os << " [\\OpenDRIM_DHCP2RSA]" << endl; return os; } int main() { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2RSA_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = DHCP_OpenDRIM_DHCP2RSA_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 = DHCP_OpenDRIM_DHCP2RSA_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 = DHCP_OpenDRIM_DHCP2RSA_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 = DHCP_OpenDRIM_DHCP2RSA_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-dhcp-1.0.0~ppa/test/testOpenDRIM_DHCPCapabilities.cpp0000644000175000017500000001220611400673053025530 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPCapabilities.h" #include "OpenDRIM_DHCPCapabilitiesAccess.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_DHCPCapabilities& instance) { os << " [OpenDRIM_DHCPCapabilities]" << 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("OptionsSupported", OptionsSupported, OptionsSupported_isNULL); os << " [\\OpenDRIM_DHCPCapabilities]" << endl; return os; } int main() { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPCapabilities_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = DHCP_OpenDRIM_DHCPCapabilities_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 = DHCP_OpenDRIM_DHCPCapabilities_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 = DHCP_OpenDRIM_DHCPCapabilities_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 = DHCP_OpenDRIM_DHCPCapabilities_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-dhcp-1.0.0~ppa/test/testOpenDRIM_DHCPServer.cpp0000644000175000017500000001466411400673053024417 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPServer.h" #include "OpenDRIM_DHCPServerAccess.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_DHCPServer& instance) { os << " [OpenDRIM_DHCPServer]" << endl; ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstallDate", InstallDate, InstallDate_isNULL); ToStringArrayInt("OperationalStatus", OperationalStatus, OperationalStatus_isNULL); ToStringArray("StatusDescriptions", StatusDescriptions, StatusDescriptions_isNULL); ToString("Status", Status, Status_isNULL); ToStringInt("HealthState", HealthState, HealthState_isNULL); ToStringInt("CommunicationStatus", CommunicationStatus, CommunicationStatus_isNULL); ToStringInt("DetailedStatus", DetailedStatus, DetailedStatus_isNULL); ToStringInt("OperatingStatus", OperatingStatus, OperatingStatus_isNULL); ToStringInt("PrimaryStatus", PrimaryStatus, PrimaryStatus_isNULL); ToStringInt("EnabledState", EnabledState, EnabledState_isNULL); ToString("OtherEnabledState", OtherEnabledState, OtherEnabledState_isNULL); ToStringInt("RequestedState", RequestedState, RequestedState_isNULL); ToStringInt("EnabledDefault", EnabledDefault, EnabledDefault_isNULL); ToString("TimeOfLastStateChange", TimeOfLastStateChange, TimeOfLastStateChange_isNULL); ToStringArrayInt("AvailableRequestedStates", AvailableRequestedStates, AvailableRequestedStates_isNULL); ToStringInt("TransitioningToState", TransitioningToState, TransitioningToState_isNULL); ToString("SystemCreationClassName", SystemCreationClassName, SystemCreationClassName_isNULL); ToString("SystemName", SystemName, SystemName_isNULL); ToString("CreationClassName", CreationClassName, CreationClassName_isNULL); ToString("Name", Name, Name_isNULL); ToString("AccessInfo", AccessInfo, AccessInfo_isNULL); ToStringInt("InfoFormat", InfoFormat, InfoFormat_isNULL); ToString("OtherInfoFormatDescription", OtherInfoFormatDescription, OtherInfoFormatDescription_isNULL); ToStringInt("AccessContext", AccessContext, AccessContext_isNULL); ToString("OtherAccessContext", OtherAccessContext, OtherAccessContext_isNULL); os << " [\\OpenDRIM_DHCPServer]" << endl; return os; } int main() { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPServer_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = DHCP_OpenDRIM_DHCPServer_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 = DHCP_OpenDRIM_DHCPServer_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 = DHCP_OpenDRIM_DHCPServer_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 = DHCP_OpenDRIM_DHCPServer_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-dhcp-1.0.0~ppa/test/testOpenDRIM_DHCP2ComputerSystem.cpp0000644000175000017500000001121311400673053026221 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2ComputerSystem.h" #include "OpenDRIM_DHCP2ComputerSystemAccess.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_DHCP2ComputerSystem& instance) { os << " [OpenDRIM_DHCP2ComputerSystem]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); os << " [\\OpenDRIM_DHCP2ComputerSystem]" << endl; return os; } int main() { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2ComputerSystem_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = DHCP_OpenDRIM_DHCP2ComputerSystem_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 = DHCP_OpenDRIM_DHCP2ComputerSystem_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 = DHCP_OpenDRIM_DHCP2ComputerSystem_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 = DHCP_OpenDRIM_DHCP2ComputerSystem_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-dhcp-1.0.0~ppa/test/testOpenDRIM_DHCPElementCapabilities.cpp0000644000175000017500000001143711400673053027047 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPElementCapabilities.h" #include "OpenDRIM_DHCPElementCapabilitiesAccess.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_DHCPElementCapabilities& instance) { os << " [OpenDRIM_DHCPElementCapabilities]" << endl; ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL); ToStringRef("Capabilities", Capabilities, Capabilities_isNULL); ToStringArrayInt("Characteristics", Characteristics, Characteristics_isNULL); os << " [\\OpenDRIM_DHCPElementCapabilities]" << endl; return os; } int main() { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPElementCapabilities_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = DHCP_OpenDRIM_DHCPElementCapabilities_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 = DHCP_OpenDRIM_DHCPElementCapabilities_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 = DHCP_OpenDRIM_DHCPElementCapabilities_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 = DHCP_OpenDRIM_DHCPElementCapabilities_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-dhcp-1.0.0~ppa/test/testOpenDRIM_DHCPProtocolEndpoint.cpp0000644000175000017500000001562011400673053026444 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPProtocolEndpoint.h" #include "OpenDRIM_DHCPProtocolEndpointAccess.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_DHCPProtocolEndpoint& instance) { os << " [OpenDRIM_DHCPProtocolEndpoint]" << endl; ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("Caption", Caption, Caption_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstallDate", InstallDate, InstallDate_isNULL); ToStringArray("StatusDescriptions", StatusDescriptions, StatusDescriptions_isNULL); ToString("Status", Status, Status_isNULL); ToStringInt("HealthState", HealthState, HealthState_isNULL); ToStringInt("CommunicationStatus", CommunicationStatus, CommunicationStatus_isNULL); ToStringInt("DetailedStatus", DetailedStatus, DetailedStatus_isNULL); ToStringInt("OperatingStatus", OperatingStatus, OperatingStatus_isNULL); ToStringInt("PrimaryStatus", PrimaryStatus, PrimaryStatus_isNULL); ToString("OtherEnabledState", OtherEnabledState, OtherEnabledState_isNULL); ToStringInt("RequestedState", RequestedState, RequestedState_isNULL); ToStringInt("EnabledDefault", EnabledDefault, EnabledDefault_isNULL); ToStringArrayInt("AvailableRequestedStates", AvailableRequestedStates, AvailableRequestedStates_isNULL); ToStringInt("TransitioningToState", TransitioningToState, TransitioningToState_isNULL); ToString("SystemCreationClassName", SystemCreationClassName, SystemCreationClassName_isNULL); ToString("SystemName", SystemName, SystemName_isNULL); ToString("CreationClassName", CreationClassName, CreationClassName_isNULL); ToString("Name", Name, Name_isNULL); ToString("Description", Description, Description_isNULL); ToStringArrayInt("OperationalStatus", OperationalStatus, OperationalStatus_isNULL); ToStringInt("EnabledState", EnabledState, EnabledState_isNULL); ToString("TimeOfLastStateChange", TimeOfLastStateChange, TimeOfLastStateChange_isNULL); ToString("NameFormat", NameFormat, NameFormat_isNULL); ToStringInt("ProtocolType", ProtocolType, ProtocolType_isNULL); ToStringInt("ProtocolIFType", ProtocolIFType, ProtocolIFType_isNULL); ToString("OtherTypeDescription", OtherTypeDescription, OtherTypeDescription_isNULL); ToStringInt("ClientState", ClientState, ClientState_isNULL); ToString("RenewalTime", RenewalTime, RenewalTime_isNULL); ToString("RebindingTime", RebindingTime, RebindingTime_isNULL); ToString("LeaseTime", LeaseTime, LeaseTime_isNULL); ToString("LeaseObtained", LeaseObtained, LeaseObtained_isNULL); ToString("LeaseExpires", LeaseExpires, LeaseExpires_isNULL); ToStringArrayInt("OptionsReceived", OptionsReceived, OptionsReceived_isNULL); os << " [\\OpenDRIM_DHCPProtocolEndpoint]" << endl; return os; } int main() { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPProtocolEndpoint_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = DHCP_OpenDRIM_DHCPProtocolEndpoint_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 = DHCP_OpenDRIM_DHCPProtocolEndpoint_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 = DHCP_OpenDRIM_DHCPProtocolEndpoint_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 = DHCP_OpenDRIM_DHCPProtocolEndpoint_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPSettingData/0000755000175000017500000000000011400673053022762 5ustar guillaumeguillaumeopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPSettingData/Makefile.am0000644000175000017500000000403711400673053025022 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 = libcmpiDHCP_OpenDRIM_DHCPSettingDataProvider.la libcmpiDHCP_OpenDRIM_DHCPSettingDataProvider_la_SOURCES = OpenDRIM_DHCPSettingDataAccess.cpp OpenDRIM_DHCPSettingDataProvider.cpp cmpiOpenDRIM_DHCPSettingData.cpp libcmpiDHCP_OpenDRIM_DHCPSettingDataProvider_la_LIBADD = ../Common/libcmpiDHCP_Common.la libcmpiDHCP_OpenDRIM_DHCPSettingDataProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_DHCPSettingData.h OpenDRIM_DHCPSettingData.h OpenDRIM_DHCPSettingDataAccess.h opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPSettingData/cmpiOpenDRIM_DHCPSettingData.h0000644000175000017500000000427111400673053030313 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPSETTINGDATA_H_ #define CMPIOPENDRIM_DHCPSETTINGDATA_H_ #include "OpenDRIM_DHCPSettingData.h" CMPIObjectPath* DHCP_OpenDRIM_DHCPSettingData_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_DHCPSettingData& instance); CMPIInstance* DHCP_OpenDRIM_DHCPSettingData_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_DHCPSettingData& instance); void DHCP_OpenDRIM_DHCPSettingData_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_DHCPSettingData& instance); void DHCP_OpenDRIM_DHCPSettingData_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_DHCPSettingData& instance); #endif /*CMPIOPENDRIM_DHCPSETTINGDATA_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPSettingData/OpenDRIM_DHCPSettingDataProvider.cpp0000644000175000017500000002514211400673053031510 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPSettingData.h" #include "OpenDRIM_DHCPSettingDataAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define DHCP_OpenDRIM_DHCPSettingDataProviderSetInstance DHCP_OpenDRIM_DHCPSettingDataProviderModifyInstance #endif int DHCP_OpenDRIM_DHCPSettingData_init(const CMPIBroker* broker); int DHCP_OpenDRIM_DHCPSettingData_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus DHCP_OpenDRIM_DHCPSettingDataProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = DHCP_OpenDRIM_DHCPSettingData_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPSettingDataProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPSettingData_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = DHCP_OpenDRIM_DHCPSettingData_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPSettingDataProviderEnumInstances(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 = DHCP_OpenDRIM_DHCPSettingData_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = DHCP_OpenDRIM_DHCPSettingData_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPSettingDataProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPSettingData instance; DHCP_OpenDRIM_DHCPSettingData_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPSettingData_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = DHCP_OpenDRIM_DHCPSettingData_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPSettingDataProviderSetInstance(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_DHCPSettingData newInstance, oldInstance; DHCP_OpenDRIM_DHCPSettingData_toCPP(_broker, ci, newInstance); DHCP_OpenDRIM_DHCPSettingData_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPSettingData_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPSettingData_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPSettingDataProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPSettingData instance; DHCP_OpenDRIM_DHCPSettingData_toCPP(_broker, ci, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPSettingData_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_DHCPSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPSettingData_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPSettingData_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = DHCP_OpenDRIM_DHCPSettingData_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPSettingDataProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPSettingData instance; DHCP_OpenDRIM_DHCPSettingData_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPSettingData_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPSettingData_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPSettingDataProviderExecQuery(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 DHCP_OpenDRIM_DHCPSettingData_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPSettingData_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_DHCPSettingData_init FAILED: " + (string) OpenDRIM_DHCPSettingData_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int DHCP_OpenDRIM_DHCPSettingData_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPSettingData_unload(errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_DHCPSettingData_unload FAILED: " + (string) OpenDRIM_DHCPSettingData_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define DHCP_OpenDRIM_DHCPSettingData_INIT if (DHCP_OpenDRIM_DHCPSettingData_init(_broker) < 0) return NULL CMInstanceMIStub(DHCP_OpenDRIM_DHCPSettingDataProvider, DHCP_OpenDRIM_DHCPSettingDataProvider, _broker, DHCP_OpenDRIM_DHCPSettingData_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPSettingData/OpenDRIM_DHCPSettingDataAccess.h0000644000175000017500000000561711400673053030571 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPSETTINGDATAACCESS_H_ #define OPENDRIM_DHCPSETTINGDATAACCESS_H_ #include "DHCP_Common.h" #include "OpenDRIM_DHCPSettingData.h" int DHCP_OpenDRIM_DHCPSettingData_load(const CMPIBroker* broker, string& errorMessage); int DHCP_OpenDRIM_DHCPSettingData_unload(string& errorMessage); int DHCP_OpenDRIM_DHCPSettingData_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCPSettingData_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_DHCPSettingData& instance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCPSettingData_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPSettingData& newInstance, const OpenDRIM_DHCPSettingData& oldInstance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCPSettingData_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPSettingData& instance, string& errorMessage); int DHCP_OpenDRIM_DHCPSettingData_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPSettingData& instance, string& errorMessage); int DHCP_OpenDRIM_DHCPSettingData_populate(OpenDRIM_DHCPSettingData& instance, string& errorMessage); #endif /*OPENDRIM_DHCPSETTINGDATAACCESS_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPSettingData/OpenDRIM_DHCPSettingDataAccess.cpp0000644000175000017500000000775611400673053031132 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPSettingDataAccess.h" int DHCP_OpenDRIM_DHCPSettingData_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int DHCP_OpenDRIM_DHCPSettingData_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int DHCP_OpenDRIM_DHCPSettingData_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; vector ethernet_names; int errorCode; errorCode=dhcp_ethernet_names(ethernet_names,errorMessage); if(errorCode!=OK) return errorCode; for(int i=0;i ethernet_names; vector::size_type index; CF_assert(dhcp_ethernet_names(ethernet_names,errorMessage)); if(!CF_foundInList(instance.InstanceID,ethernet_names,index)) { errorMessage = "Invalid path"; return NOT_FOUND; } CF_assert(DHCP_OpenDRIM_DHCPSettingData_populate(instance,errorMessage)); _L_; return OK; } int DHCP_OpenDRIM_DHCPSettingData_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPSettingData& newInstance, const OpenDRIM_DHCPSettingData& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPSettingData_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPSettingData& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPSettingData_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPSettingData& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPSettingData_populate(OpenDRIM_DHCPSettingData& instance, string& errorMessage) { _E_; /* * Properties to fill from profile * + Mandatory: * [X] InstanceID [KEY] * [X] AddressOrigin * [X] ElementName */ instance.setAddressOrigin(4); instance.setElementName(instance.InstanceID+" DHCP Setting"); _L_; return OK; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPSettingData/cmpiOpenDRIM_DHCPSettingData.cpp0000644000175000017500000001161511400673053030646 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPSettingData.h" CMPIObjectPath* DHCP_OpenDRIM_DHCPSettingData_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_DHCPSettingData& instance) { _E_; Objectpath op(broker, OpenDRIM_DHCPSettingData_classnames[0], OpenDRIM_DHCPSettingData_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* DHCP_OpenDRIM_DHCPSettingData_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_DHCPSettingData& instance) { _E_; Objectpath op(broker, DHCP_OpenDRIM_DHCPSettingData_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.AddressOrigin_isNULL) ci.setProperty("AddressOrigin", instance.AddressOrigin); if (!instance.RequestedIPv4Address_isNULL) ci.setProperty("RequestedIPv4Address", instance.RequestedIPv4Address); if (!instance.RequestedLeaseTime_isNULL) ci.setProperty("RequestedLeaseTime", instance.RequestedLeaseTime); if (!instance.ClientIdentifier_isNULL) ci.setProperty("ClientIdentifier", instance.ClientIdentifier); if (!instance.VendorClassIdentifier_isNULL) ci.setProperty("VendorClassIdentifier", instance.VendorClassIdentifier); if (!instance.RequestedOptions_isNULL) ci.setProperty("RequestedOptions", instance.RequestedOptions); if (!instance.RequiredOptions_isNULL) ci.setProperty("RequiredOptions", instance.RequiredOptions); _L_; return ci.getHdl(); } void DHCP_OpenDRIM_DHCPSettingData_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_DHCPSettingData& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void DHCP_OpenDRIM_DHCPSettingData_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_DHCPSettingData& 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("AddressOrigin", instance.AddressOrigin) == OK) instance.AddressOrigin_isNULL = false; if (inst.getProperty("RequestedIPv4Address", instance.RequestedIPv4Address) == OK) instance.RequestedIPv4Address_isNULL = false; if (inst.getProperty("RequestedLeaseTime", instance.RequestedLeaseTime) == OK) instance.RequestedLeaseTime_isNULL = false; if (inst.getProperty("ClientIdentifier", instance.ClientIdentifier) == OK) instance.ClientIdentifier_isNULL = false; if (inst.getProperty("VendorClassIdentifier", instance.VendorClassIdentifier) == OK) instance.VendorClassIdentifier_isNULL = false; if (inst.getProperty("RequestedOptions", instance.RequestedOptions) == OK) instance.RequestedOptions_isNULL = false; if (inst.getProperty("RequiredOptions", instance.RequiredOptions) == OK) instance.RequiredOptions_isNULL = false; _L_; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPSettingData/OpenDRIM_DHCPSettingData.h0000644000175000017500000001407311400673053027443 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPSETTINGDATA_H_ #define OPENDRIM_DHCPSETTINGDATA_H_ #include const static char* OpenDRIM_DHCPSettingData_classnames[] = {"OpenDRIM_DHCPSettingData"}; static string OpenDRIM_DHCPSettingData_NAMESPACE = _NAMESPACE; class OpenDRIM_DHCPSettingData { public: string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string InstanceID; bool InstanceID_isNULL; string ElementName; bool ElementName_isNULL; unsigned short AddressOrigin; bool AddressOrigin_isNULL; string RequestedIPv4Address; bool RequestedIPv4Address_isNULL; unsigned int RequestedLeaseTime; bool RequestedLeaseTime_isNULL; string ClientIdentifier; bool ClientIdentifier_isNULL; string VendorClassIdentifier; bool VendorClassIdentifier_isNULL; vector RequestedOptions; bool RequestedOptions_isNULL; vector RequiredOptions; bool RequiredOptions_isNULL; OpenDRIM_DHCPSettingData() { Caption_isNULL = true; Description_isNULL = true; InstanceID_isNULL = true; ElementName_isNULL = true; AddressOrigin_isNULL = true; RequestedIPv4Address_isNULL = true; RequestedLeaseTime_isNULL = true; ClientIdentifier_isNULL = true; VendorClassIdentifier_isNULL = true; RequestedOptions_isNULL = true; RequiredOptions_isNULL = true; } ~OpenDRIM_DHCPSettingData() {} 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 getAddressOrigin(unsigned short& value) const { if (AddressOrigin_isNULL==true) return NOT_FOUND; value = AddressOrigin; return OK; } int setAddressOrigin(const unsigned short& newValue) { AddressOrigin = newValue; AddressOrigin_isNULL = false; return OK; } int getRequestedIPv4Address(string& value) const { if (RequestedIPv4Address_isNULL==true) return NOT_FOUND; value = RequestedIPv4Address; return OK; } int setRequestedIPv4Address(const string& newValue) { RequestedIPv4Address = newValue; RequestedIPv4Address_isNULL = false; return OK; } int getRequestedLeaseTime(unsigned int& value) const { if (RequestedLeaseTime_isNULL==true) return NOT_FOUND; value = RequestedLeaseTime; return OK; } int setRequestedLeaseTime(const unsigned int& newValue) { RequestedLeaseTime = newValue; RequestedLeaseTime_isNULL = false; return OK; } int getClientIdentifier(string& value) const { if (ClientIdentifier_isNULL==true) return NOT_FOUND; value = ClientIdentifier; return OK; } int setClientIdentifier(const string& newValue) { ClientIdentifier = newValue; ClientIdentifier_isNULL = false; return OK; } int getVendorClassIdentifier(string& value) const { if (VendorClassIdentifier_isNULL==true) return NOT_FOUND; value = VendorClassIdentifier; return OK; } int setVendorClassIdentifier(const string& newValue) { VendorClassIdentifier = newValue; VendorClassIdentifier_isNULL = false; return OK; } int getRequestedOptions(vector& value) const { if (RequestedOptions_isNULL==true) return NOT_FOUND; value = RequestedOptions; return OK; } int setRequestedOptions(const vector& newValue) { RequestedOptions = newValue; RequestedOptions_isNULL = false; return OK; } int getRequiredOptions(vector& value) const { if (RequiredOptions_isNULL==true) return NOT_FOUND; value = RequiredOptions; return OK; } int setRequiredOptions(const vector& newValue) { RequiredOptions = newValue; RequiredOptions_isNULL = false; return OK; } }; #endif /*OPENDRIM_DHCPSETTINGDATA_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2IP/0000755000175000017500000000000011400673053021145 5ustar guillaumeguillaumeopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2IP/assocOpenDRIM_DHCP2IP.h0000644000175000017500000000601711400673053025041 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2IP_H_ #define ASSOCOPENDRIM_DHCP2IP_H_ #include "OpenDRIM_DHCP2IPAccess.h" int DHCP_OpenDRIM_DHCP2IP_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 DHCP_OpenDRIM_DHCP2IP_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 DHCP_OpenDRIM_DHCP2IP_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int DHCP_OpenDRIM_DHCP2IP_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCP2IP_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int DHCP_OpenDRIM_DHCP2IP_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_DHCP2IP_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2IP/Makefile.am0000644000175000017500000000453111400673053023204 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 = libcmpiDHCP_OpenDRIM_DHCP2IPProvider.la libcmpiDHCP_OpenDRIM_DHCP2IPProvider_la_SOURCES = OpenDRIM_DHCP2IPAccess.cpp OpenDRIM_DHCP2IPProvider.cpp cmpiOpenDRIM_DHCP2IP.cpp assocOpenDRIM_DHCP2IP.cpp # May have to be adjusted for direct invocation libcmpiDHCP_OpenDRIM_DHCP2IPProvider_la_CPPFLAGS = -I../CIM_ServiceAccessPoint -I../CIM_ServiceAccessPoint # Uncomment the end for direct invocation, may have to be adjusted libcmpiDHCP_OpenDRIM_DHCP2IPProvider_la_LIBADD = ../Common/libcmpiDHCP_Common.la #../CIM_ServiceAccessPoint/libcmpiDHCP_CIM_ServiceAccessPointProvider.la ../CIM_ServiceAccessPoint/libcmpiDHCP_CIM_ServiceAccessPointProvider.la libcmpiDHCP_OpenDRIM_DHCP2IPProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_DHCP2IP.h OpenDRIM_DHCP2IP.h OpenDRIM_DHCP2IPAccess.h opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2IP/OpenDRIM_DHCP2IPProvider.cpp0000644000175000017500000003744411400673053026066 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2IP.h" #include "OpenDRIM_DHCP2IPAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define DHCP_OpenDRIM_DHCP2IPProviderSetInstance DHCP_OpenDRIM_DHCP2IPProviderModifyInstance #endif int DHCP_OpenDRIM_DHCP2IP_init(const CMPIBroker* broker); int DHCP_OpenDRIM_DHCP2IP_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus DHCP_OpenDRIM_DHCP2IPProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = DHCP_OpenDRIM_DHCP2IP_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2IPProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2IP_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2IP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = DHCP_OpenDRIM_DHCP2IP_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2IPProviderEnumInstances(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 = DHCP_OpenDRIM_DHCP2IP_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2IP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = DHCP_OpenDRIM_DHCP2IP_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2IPProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCP2IP instance; DHCP_OpenDRIM_DHCP2IP_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2IP_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2IP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = DHCP_OpenDRIM_DHCP2IP_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2IPProviderSetInstance(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_DHCP2IP newInstance, oldInstance; DHCP_OpenDRIM_DHCP2IP_toCPP(_broker, ci, newInstance); DHCP_OpenDRIM_DHCP2IP_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2IP_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2IP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCP2IP_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2IP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2IPProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCP2IP instance; DHCP_OpenDRIM_DHCP2IP_toCPP(_broker, ci, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2IP_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_DHCP2IP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCP2IP_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2IP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCP2IP_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2IP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = DHCP_OpenDRIM_DHCP2IP_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2IPProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCP2IP instance; DHCP_OpenDRIM_DHCP2IP_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2IP_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2IP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCP2IP_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2IP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2IPProviderExecQuery(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 DHCP_OpenDRIM_DHCP2IPProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = DHCP_OpenDRIM_DHCP2IP_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2IPProviderAssociatorNames(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 = DHCP_OpenDRIM_DHCP2IP_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2IP_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 DHCP_OpenDRIM_DHCP2IPProviderAssociators(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 = DHCP_OpenDRIM_DHCP2IP_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2IP_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 DHCP_OpenDRIM_DHCP2IPProviderReferenceNames(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 = DHCP_OpenDRIM_DHCP2IP_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2IP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = DHCP_OpenDRIM_DHCP2IP_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = DHCP_OpenDRIM_DHCP2IP_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2IP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = DHCP_OpenDRIM_DHCP2IP_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2IPProviderReferences(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 = DHCP_OpenDRIM_DHCP2IP_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2IP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = DHCP_OpenDRIM_DHCP2IP_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = DHCP_OpenDRIM_DHCP2IP_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2IP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = DHCP_OpenDRIM_DHCP2IP_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int DHCP_OpenDRIM_DHCP2IP_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2IP_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_DHCP2IP_init FAILED: " + (string) OpenDRIM_DHCP2IP_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int DHCP_OpenDRIM_DHCP2IP_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2IP_unload(errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_DHCP2IP_unload FAILED: " + (string) OpenDRIM_DHCP2IP_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define DHCP_OpenDRIM_DHCP2IP_INIT if (DHCP_OpenDRIM_DHCP2IP_init(_broker) < 0) return NULL CMInstanceMIStub(DHCP_OpenDRIM_DHCP2IPProvider, DHCP_OpenDRIM_DHCP2IPProvider, _broker, DHCP_OpenDRIM_DHCP2IP_INIT); CMAssociationMIStub(DHCP_OpenDRIM_DHCP2IPProvider, DHCP_OpenDRIM_DHCP2IPProvider, _broker, DHCP_OpenDRIM_DHCP2IP_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2IP/OpenDRIM_DHCP2IPAccess.h0000644000175000017500000000767011400673053025140 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2IPACCESS_H_ #define OPENDRIM_DHCP2IPACCESS_H_ #include "DHCP_Common.h" #include "OpenDRIM_DHCP2IP.h" #include "assocOpenDRIM_DHCP2IP.h" int DHCP_OpenDRIM_DHCP2IP_load(const CMPIBroker* broker, string& errorMessage); int DHCP_OpenDRIM_DHCP2IP_unload(string& errorMessage); int DHCP_OpenDRIM_DHCP2IP_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCP2IP_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_DHCP2IP& instance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCP2IP_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCP2IP& newInstance, const OpenDRIM_DHCP2IP& oldInstance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCP2IP_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCP2IP& instance, string& errorMessage); int DHCP_OpenDRIM_DHCP2IP_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCP2IP& instance, string& errorMessage); int DHCP_OpenDRIM_DHCP2IP_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCP2IP_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCP2IP_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_DHCP2IP_instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCP2IP_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_DHCP2IP_instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCP2IP_populate(OpenDRIM_DHCP2IP& instance, string& errorMessage); #endif /*OPENDRIM_DHCP2IPACCESS_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2IP/cmpiOpenDRIM_DHCP2IP.h0000644000175000017500000000413111400673053024654 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2IP_H_ #define CMPIOPENDRIM_DHCP2IP_H_ #include "OpenDRIM_DHCP2IP.h" CMPIObjectPath* DHCP_OpenDRIM_DHCP2IP_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_DHCP2IP& instance); CMPIInstance* DHCP_OpenDRIM_DHCP2IP_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_DHCP2IP& instance); void DHCP_OpenDRIM_DHCP2IP_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_DHCP2IP& instance); void DHCP_OpenDRIM_DHCP2IP_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_DHCP2IP& instance); #endif /*CMPIOPENDRIM_DHCP2IP_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2IP/assocOpenDRIM_DHCP2IP.cpp0000644000175000017500000002051411400673053025372 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2IP.h" int DHCP_OpenDRIM_DHCP2IP_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 = DHCP_OpenDRIM_DHCP2IP_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(DHCP_OpenDRIM_DHCP2IP_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(DHCP_OpenDRIM_DHCP2IP_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int DHCP_OpenDRIM_DHCP2IP_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(DHCP_CIM_ServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(DHCP_CIM_ServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, DHCP_CIM_ServiceAccessPoint_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int DHCP_OpenDRIM_DHCP2IP_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_ServiceAccessPoint _instance; DHCP_CIM_ServiceAccessPoint_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(DHCP_CIM_ServiceAccessPoint_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, DHCP_CIM_ServiceAccessPoint_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int DHCP_OpenDRIM_DHCP2IP_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(DHCP_CIM_ServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(DHCP_CIM_ServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, DHCP_CIM_ServiceAccessPoint_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int DHCP_OpenDRIM_DHCP2IP_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Dependent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Dependent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_ServiceAccessPoint _instance; DHCP_CIM_ServiceAccessPoint_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(DHCP_CIM_ServiceAccessPoint_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, DHCP_CIM_ServiceAccessPoint_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2IP/cmpiOpenDRIM_DHCP2IP.cpp0000644000175000017500000000565011400673053025216 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2IP.h" CMPIObjectPath* DHCP_OpenDRIM_DHCP2IP_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_DHCP2IP& instance) { _E_; Objectpath op(broker, OpenDRIM_DHCP2IP_classnames[0], OpenDRIM_DHCP2IP_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* DHCP_OpenDRIM_DHCP2IP_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_DHCP2IP& instance) { _E_; Objectpath op(broker, DHCP_OpenDRIM_DHCP2IP_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void DHCP_OpenDRIM_DHCP2IP_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_DHCP2IP& 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 DHCP_OpenDRIM_DHCP2IP_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_DHCP2IP& 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-dhcp-1.0.0~ppa/OpenDRIM_DHCP2IP/OpenDRIM_DHCP2IPAccess.cpp0000644000175000017500000002310011400673053025455 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2IPAccess.h" int DHCP_OpenDRIM_DHCP2IP_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(DHCP_CIM_ServiceAccessPoint_load(broker, errorMessage)); CF_assert(DHCP_CIM_ServiceAccessPoint_load(broker, errorMessage)); */ // TODO _L_; return OK; } int DHCP_OpenDRIM_DHCP2IP_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(DHCP_CIM_ServiceAccessPoint_unload(errorMessage)); CF_assert(DHCP_CIM_ServiceAccessPoint_unload(errorMessage)); */ // TODO _L_; return OK; } int DHCP_OpenDRIM_DHCP2IP_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 DHCP_OpenDRIM_DHCP2IP_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(DHCP_OpenDRIM_DHCP2IP_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(DHCP_OpenDRIM_DHCP2IP_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; DHCP_OpenDRIM_DHCP2IP_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(DHCP_OpenDRIM_DHCP2IP_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int DHCP_OpenDRIM_DHCP2IP_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_DHCP2IP& 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(DHCP_OpenDRIM_DHCP2IP_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(DHCP_OpenDRIM_DHCP2IP_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(DHCP_OpenDRIM_DHCP2IP_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int DHCP_OpenDRIM_DHCP2IP_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCP2IP& newInstance, const OpenDRIM_DHCP2IP& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCP2IP_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCP2IP& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCP2IP_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCP2IP& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCP2IP_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(DHCP_OpenDRIM_DHCP2IP_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(DHCP_OpenDRIM_DHCP2IP_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(DHCP_OpenDRIM_DHCP2IP_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(DHCP_OpenDRIM_DHCP2IP_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(DHCP_OpenDRIM_DHCP2IP_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(DHCP_OpenDRIM_DHCP2IP_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_DHCP2IP_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_DHCP2IP instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); OpenDRIM_DHCP2IP_instances.push_back(instance); } _L_; return OK; } int DHCP_OpenDRIM_DHCP2IP_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_DHCP2IP_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_DHCP2IP instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); OpenDRIM_DHCP2IP_instances.push_back(instance); } _L_; return OK; } int DHCP_OpenDRIM_DHCP2IP_populate(OpenDRIM_DHCP2IP& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2IP/OpenDRIM_DHCP2IP.h0000644000175000017500000000653111400673053024011 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2IP_H_ #define OPENDRIM_DHCP2IP_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_ServiceAccessPoint.h" #include "CIM_ServiceAccessPointAccess.h" #include "cmpiCIM_ServiceAccessPoint.h" #include "CIM_ServiceAccessPointAccess.h" */ const static char* OpenDRIM_DHCP2IP_classnames[] = {"OpenDRIM_DHCP2IP"}; static string OpenDRIM_DHCP2IP_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"OpenDRIM_IPProtocolEndpoint"}; const static string Antecedent_NAMESPACE = _NAMESPACE; const static string Dependent_role = "Dependent"; const static char* Dependent_classnames[] = {"OpenDRIM_DHCPProtocolEndpoint"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_DHCP2IP { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; OpenDRIM_DHCP2IP() { Antecedent_isNULL = true; Dependent_isNULL = true; } ~OpenDRIM_DHCP2IP() {} 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_DHCP2IP_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/acinclude.m40000644000175000017500000002111011400673053020643 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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), DHCP provider package # Copyright (C) 2007 Khahramon NURIDDINOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public 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-dhcp-1.0.0~ppa/Common/0000755000175000017500000000000011400673053017707 5ustar guillaumeguillaumeopendrim-lmp-dhcp-1.0.0~ppa/Common/Makefile.am0000644000175000017500000000337711400673053021755 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 = libcmpiDHCP_Common.la libcmpiDHCP_Common_la_SOURCES = DHCP_Common.cpp libcmpiDHCP_Common_la_LDFLAGS = -avoid-version libcmpiDHCP_Common_la_LIBADD = -lopendrim noinst_HEADERS = DHCP_Common.h opendrim-lmp-dhcp-1.0.0~ppa/Common/DHCP_Common.cpp0000644000175000017500000001554011400673053022446 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 "DHCP_Common.h" int get_dhcp_leases(dhcp_lease &lease,string key,string &option,string &errorMessage) { // dhcp_client lease path string filepath; CF_assert(get_dhcp_lease_path(filepath,errorMessage)); // all the leases from the dhclient.leases file list leases; // try to open the dhclient.leases file ifstream leasesFile; leasesFile.open(filepath.c_str()); if (!leasesFile) { errorMessage= "Cannot open dhcp leases file.\n"; return NOT_FOUND; } string line = ""; char c; bool inLease = false; int leaseCount = 0; dhcp_lease currentLease; while (leasesFile) { leasesFile.get(c); switch (c) { case '{': inLease = true; break; case '}': inLease = false; leases.push_front(currentLease); currentLease = dhcp_lease(); break; case '\n': if (inLease) { if (line.length() > 0) { int startOfs = line.find_first_not_of(" \t"); int endOfs = line.find_last_of(";"); // trim extra stuff off from line line = line.substr(startOfs, endOfs-startOfs); if (line.find("option") != string::npos ) { // drop the option keyword line = line.substr(7); size_t ofs = line.find_first_of(" "); // extract the option name string key = line.substr(0, ofs); // extract the comma delimited values list values; line = line.substr(ofs+1); while (line.length()) { ofs = line.find_first_of(','); string valStr; if (ofs == string::npos) { //ofs = line.length(); ofs = 0; valStr = line; line = ""; } else { valStr = line.substr(0, ofs); line = line.substr(ofs+1); } values.push_back(valStr); } // while pair > p(key,values); currentLease.options.insert(p); } else if (line.find("renew") != string::npos) { // drop the expire and expire number keyword line = line.substr(8); size_t endofs = line.find_last_of("\""); // extract the interface name currentLease.renew=line.substr(0,endofs); } else if (line.find("rebind") != string::npos) { // drop the expire and expire number keyword line = line.substr(9); size_t endofs = line.find_last_of("\""); // extract the interface name currentLease.rebind=line.substr(0,endofs); } else if (line.find("expire") != string::npos) { // drop the expire and expire number keyword line = line.substr(9); size_t endofs = line.find_last_of("\""); // extract the interface name currentLease.expire=line.substr(0,endofs); } else if (line.find("interface") != string::npos) { size_t ofs = line.find_first_of("\""); size_t endofs = line.find_last_of("\""); // extract the interface name currentLease.interface=line.substr(ofs,endofs); } else if (line.find("fixed-address") != string::npos) { size_t ofs = line.find_first_of(" ")+1; size_t endofs = line.find_last_of(";"); // extract the adress name currentLease.address=line.substr(ofs,endofs); } // reset the line string line = ""; } } break; default: if (inLease) { line += c; } } } // while lease file has values // retreive the last lease in the file (tokenize entire contents by { and } delimiters if (leases.size() > 0) { list::iterator itr = leases.begin(); lease = *itr; // get the requested option map >::iterator valItr = lease.options.find(key); if (valItr != lease.options.end()) { pair > p = *valItr; list valList = p.second; list::iterator itmItr = valList.begin(); option=*itmItr; } else { // this option could not be found in the lease errorMessage=key+" option could not be found in the lease"; return NOT_FOUND; } } return OK; } int get_dhcp_lease_path(string &path, string &errorMessage) { string stdOut, stdErr,start; int errorCode; start="/var/lib"; CF_assertWithString(CF_runCommand("ls "+start+" |grep dhcp", stdOut, stdErr, errorMessage),"Cannot find dhcp folder from "+start); start+="/"; start+=stdOut.substr(0,stdOut.find_last_of("\n\r")); stdOut=""; CF_assertWithString(CF_runCommand("ls "+start+" |grep eth0.leases", stdOut, stdErr, errorMessage),"Cannot find dhcp client configuration from "+start); start+="/"; start+=stdOut.substr(0,stdOut.find_last_of("\n\r")); path=start; return OK; } int dhcp_ethernet_names(vector &names,string &errorMessage) { string filepath1("/etc/network/interfaces"); ifstream ifs1(filepath1.c_str(), ifstream::in); if(!ifs1.is_open()) { errorMessage = "Failed to open /etc/network/interfaces"; return FAILED; } string line; while(getline(ifs1, line)) { if(CF_startsWith(line,"iface")) { string ethname; bool is_dhcp; ethname=line.substr(line.find_first_of(" ")+1); ethname=ethname.substr(0,ethname.find_first_of(" ")); is_dhcp=CF_endsWith(line,"dhcp"); if(ethname!="lo" && is_dhcp ) names.push_back(ethname); } } if (names.size()==0) return NOT_FOUND; else return OK; } opendrim-lmp-dhcp-1.0.0~ppa/Common/DHCP_Common.h0000644000175000017500000000407011400673053022107 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 DHCP_COMMON_H_ #define DHCP_COMMON_H_ #include #include #include struct dhcp_lease { // the name / value pairs for options for this lease string interface; string address; map > options; string renew; string rebind; string expire; dhcp_lease() {} }; int get_dhcp_lease_path(string &path, string &errorMessage); int get_dhcp_leases(dhcp_lease &lease,string key,string &option,string &errorMessage); int dhcp_ethernet_names(vector &names,string &errorMessage); #endif /*DHCP_COMMON_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/configure.ac0000644000175000017500000001265611400673053020757 0ustar guillaumeguillaume# Process this file with autoconf to produce a configure script. ################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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), DHCP provider package Copyright (C) 2007 Khahramon NURIDDINOV This program is being developed under the "OpenDRIM" project. The "OpenDRIM" project web page: http://opendrim.sourceforge.net The "OpenDRIM" project mailing list: opendrim@googlegroups.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public 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(DHCP 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_DHCPServer/Makefile OpenDRIM_DHCPElementSettingData/Makefile OpenDRIM_DHCPProtocolEndpoint/Makefile OpenDRIM_DHCPConformsToProfile/Makefile OpenDRIM_RegisteredDHCPProfile/Makefile OpenDRIM_DHCPSettingData/Makefile OpenDRIM_DHCPCapabilities/Makefile OpenDRIM_DHCP2RSA/Makefile OpenDRIM_DHCPElementCapabilities/Makefile OpenDRIM_DHCP2IP/Makefile OpenDRIM_DHCP2ComputerSystem/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-dhcp-1.0.0~ppa/OpenDRIM_RegisteredDHCPProfile/0000755000175000017500000000000011400673053024171 5ustar guillaumeguillaumeopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_RegisteredDHCPProfile/OpenDRIM_RegisteredDHCPProfileAccess.cpp0000644000175000017500000000773111400673053033541 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_RegisteredDHCPProfileAccess.h" string InstanceID="OpenDRIM:DHCP:1.0.1"; int DHCP_OpenDRIM_RegisteredDHCPProfile_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int DHCP_OpenDRIM_RegisteredDHCPProfile_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int DHCP_OpenDRIM_RegisteredDHCPProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; OpenDRIM_RegisteredDHCPProfile instance; instance.setInstanceID(InstanceID); if(discriminant=="ei") CF_assert(DHCP_OpenDRIM_RegisteredDHCPProfile_populate(instance, errorMessage)); result.push_back(instance); _L_; return OK; } int DHCP_OpenDRIM_RegisteredDHCPProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_RegisteredDHCPProfile& instance, const char** properties, string& errorMessage) { _E_; if(instance.InstanceID!=InstanceID) { errorMessage = "No instance"; return NOT_FOUND; } CF_assert(DHCP_OpenDRIM_RegisteredDHCPProfile_populate(instance, errorMessage)); _L_; return OK; } int DHCP_OpenDRIM_RegisteredDHCPProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredDHCPProfile& newInstance, const OpenDRIM_RegisteredDHCPProfile& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_RegisteredDHCPProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredDHCPProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_RegisteredDHCPProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredDHCPProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_RegisteredDHCPProfile_populate(OpenDRIM_RegisteredDHCPProfile& instance, string& errorMessage) { _E_; vector AdvertiseTypes; //Registred name of profile which is listed in Standard instance.setRegisteredName("DHCP Client"); //Registred version of Profile instance.setRegisteredVersion("1.0.1"); // Profile Registred organization - 2 (DMTF) instance.setRegisteredOrganization(2); // Advertise Types - 2 (Not Advertised) AdvertiseTypes.push_back(2); instance.setAdvertiseTypes(AdvertiseTypes); _L_; return OK; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_RegisteredDHCPProfile/Makefile.am0000644000175000017500000000413511400673053026230 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 = libcmpiDHCP_OpenDRIM_RegisteredDHCPProfileProvider.la libcmpiDHCP_OpenDRIM_RegisteredDHCPProfileProvider_la_SOURCES = OpenDRIM_RegisteredDHCPProfileAccess.cpp OpenDRIM_RegisteredDHCPProfileProvider.cpp cmpiOpenDRIM_RegisteredDHCPProfile.cpp libcmpiDHCP_OpenDRIM_RegisteredDHCPProfileProvider_la_LIBADD = ../Common/libcmpiDHCP_Common.la libcmpiDHCP_OpenDRIM_RegisteredDHCPProfileProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_RegisteredDHCPProfile.h OpenDRIM_RegisteredDHCPProfile.h OpenDRIM_RegisteredDHCPProfileAccess.h opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_RegisteredDHCPProfile/cmpiOpenDRIM_RegisteredDHCPProfile.cpp0000644000175000017500000001152211400673053033261 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_RegisteredDHCPProfile.h" CMPIObjectPath* DHCP_OpenDRIM_RegisteredDHCPProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RegisteredDHCPProfile& instance) { _E_; Objectpath op(broker, OpenDRIM_RegisteredDHCPProfile_classnames[0], OpenDRIM_RegisteredDHCPProfile_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* DHCP_OpenDRIM_RegisteredDHCPProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RegisteredDHCPProfile& instance) { _E_; Objectpath op(broker, DHCP_OpenDRIM_RegisteredDHCPProfile_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 DHCP_OpenDRIM_RegisteredDHCPProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RegisteredDHCPProfile& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void DHCP_OpenDRIM_RegisteredDHCPProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RegisteredDHCPProfile& 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_; } ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_RegisteredDHCPProfile/OpenDRIM_RegisteredDHCPProfileProvider.cppopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_RegisteredDHCPProfile/OpenDRIM_RegisteredDHCPProfileProvider.cp0000644000175000017500000002573411400673053033755 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_RegisteredDHCPProfile.h" #include "OpenDRIM_RegisteredDHCPProfileAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define DHCP_OpenDRIM_RegisteredDHCPProfileProviderSetInstance DHCP_OpenDRIM_RegisteredDHCPProfileProviderModifyInstance #endif int DHCP_OpenDRIM_RegisteredDHCPProfile_init(const CMPIBroker* broker); int DHCP_OpenDRIM_RegisteredDHCPProfile_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus DHCP_OpenDRIM_RegisteredDHCPProfileProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = DHCP_OpenDRIM_RegisteredDHCPProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_RegisteredDHCPProfileProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = DHCP_OpenDRIM_RegisteredDHCPProfile_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredDHCPProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = DHCP_OpenDRIM_RegisteredDHCPProfile_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_RegisteredDHCPProfileProviderEnumInstances(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 = DHCP_OpenDRIM_RegisteredDHCPProfile_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredDHCPProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = DHCP_OpenDRIM_RegisteredDHCPProfile_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_RegisteredDHCPProfileProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredDHCPProfile instance; DHCP_OpenDRIM_RegisteredDHCPProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_RegisteredDHCPProfile_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredDHCPProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = DHCP_OpenDRIM_RegisteredDHCPProfile_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_RegisteredDHCPProfileProviderSetInstance(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_RegisteredDHCPProfile newInstance, oldInstance; DHCP_OpenDRIM_RegisteredDHCPProfile_toCPP(_broker, ci, newInstance); DHCP_OpenDRIM_RegisteredDHCPProfile_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = DHCP_OpenDRIM_RegisteredDHCPProfile_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredDHCPProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_RegisteredDHCPProfile_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredDHCPProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_RegisteredDHCPProfileProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredDHCPProfile instance; DHCP_OpenDRIM_RegisteredDHCPProfile_toCPP(_broker, ci, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_RegisteredDHCPProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_RegisteredDHCPProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_RegisteredDHCPProfile_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredDHCPProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_RegisteredDHCPProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredDHCPProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = DHCP_OpenDRIM_RegisteredDHCPProfile_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_RegisteredDHCPProfileProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredDHCPProfile instance; DHCP_OpenDRIM_RegisteredDHCPProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_RegisteredDHCPProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredDHCPProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_RegisteredDHCPProfile_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredDHCPProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_RegisteredDHCPProfileProviderExecQuery(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 DHCP_OpenDRIM_RegisteredDHCPProfile_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = DHCP_OpenDRIM_RegisteredDHCPProfile_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_RegisteredDHCPProfile_init FAILED: " + (string) OpenDRIM_RegisteredDHCPProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int DHCP_OpenDRIM_RegisteredDHCPProfile_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = DHCP_OpenDRIM_RegisteredDHCPProfile_unload(errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_RegisteredDHCPProfile_unload FAILED: " + (string) OpenDRIM_RegisteredDHCPProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define DHCP_OpenDRIM_RegisteredDHCPProfile_INIT if (DHCP_OpenDRIM_RegisteredDHCPProfile_init(_broker) < 0) return NULL CMInstanceMIStub(DHCP_OpenDRIM_RegisteredDHCPProfileProvider, DHCP_OpenDRIM_RegisteredDHCPProfileProvider, _broker, DHCP_OpenDRIM_RegisteredDHCPProfile_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_RegisteredDHCPProfile/OpenDRIM_RegisteredDHCPProfileAccess.h0000644000175000017500000000600111400673053033173 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_REGISTEREDDHCPPROFILEACCESS_H_ #define OPENDRIM_REGISTEREDDHCPPROFILEACCESS_H_ #include "DHCP_Common.h" #include "OpenDRIM_RegisteredDHCPProfile.h" int DHCP_OpenDRIM_RegisteredDHCPProfile_load(const CMPIBroker* broker, string& errorMessage); int DHCP_OpenDRIM_RegisteredDHCPProfile_unload(string& errorMessage); int DHCP_OpenDRIM_RegisteredDHCPProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_RegisteredDHCPProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_RegisteredDHCPProfile& instance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_RegisteredDHCPProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredDHCPProfile& newInstance, const OpenDRIM_RegisteredDHCPProfile& oldInstance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_RegisteredDHCPProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredDHCPProfile& instance, string& errorMessage); int DHCP_OpenDRIM_RegisteredDHCPProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredDHCPProfile& instance, string& errorMessage); int DHCP_OpenDRIM_RegisteredDHCPProfile_populate(OpenDRIM_RegisteredDHCPProfile& instance, string& errorMessage); #endif /*OPENDRIM_REGISTEREDDHCPPROFILEACCESS_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_RegisteredDHCPProfile/OpenDRIM_RegisteredDHCPProfile.h0000644000175000017500000001354411400673053032063 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_REGISTEREDDHCPPROFILE_H_ #define OPENDRIM_REGISTEREDDHCPPROFILE_H_ #include const static char* OpenDRIM_RegisteredDHCPProfile_classnames[] = {"OpenDRIM_RegisteredDHCPProfile"}; static string OpenDRIM_RegisteredDHCPProfile_NAMESPACE = _INTEROP_NAMESPACE; class OpenDRIM_RegisteredDHCPProfile { 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_RegisteredDHCPProfile() { 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_RegisteredDHCPProfile() {} 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_REGISTEREDDHCPPROFILE_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_RegisteredDHCPProfile/cmpiOpenDRIM_RegisteredDHCPProfile.h0000644000175000017500000000440111400673053032724 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_REGISTEREDDHCPPROFILE_H_ #define CMPIOPENDRIM_REGISTEREDDHCPPROFILE_H_ #include "OpenDRIM_RegisteredDHCPProfile.h" CMPIObjectPath* DHCP_OpenDRIM_RegisteredDHCPProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RegisteredDHCPProfile& instance); CMPIInstance* DHCP_OpenDRIM_RegisteredDHCPProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RegisteredDHCPProfile& instance); void DHCP_OpenDRIM_RegisteredDHCPProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RegisteredDHCPProfile& instance); void DHCP_OpenDRIM_RegisteredDHCPProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RegisteredDHCPProfile& instance); #endif /*CMPIOPENDRIM_REGISTEREDDHCPPROFILE_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/TODO0000644000175000017500000000010111400673053017137 0ustar guillaumeguillaumeTODO for Major.Minor.Revision ========================= // TODO opendrim-lmp-dhcp-1.0.0~ppa/INSTALL0000644000175000017500000000671311400673053017517 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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-dhcp-1.0.0~ppa/AUTHORS0000644000175000017500000000014111400673053017523 0ustar guillaumeguillaumeKhahramon NURIDDINOV ,TUIT Guillaume BOTTEX opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPCapabilities/0000755000175000017500000000000011400673053023144 5ustar guillaumeguillaumeopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPCapabilities/OpenDRIM_DHCPCapabilitiesProvider.cpp0000644000175000017500000002524111400673053032054 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPCapabilities.h" #include "OpenDRIM_DHCPCapabilitiesAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define DHCP_OpenDRIM_DHCPCapabilitiesProviderSetInstance DHCP_OpenDRIM_DHCPCapabilitiesProviderModifyInstance #endif int DHCP_OpenDRIM_DHCPCapabilities_init(const CMPIBroker* broker); int DHCP_OpenDRIM_DHCPCapabilities_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus DHCP_OpenDRIM_DHCPCapabilitiesProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = DHCP_OpenDRIM_DHCPCapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPCapabilitiesProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPCapabilities_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = DHCP_OpenDRIM_DHCPCapabilities_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPCapabilitiesProviderEnumInstances(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 = DHCP_OpenDRIM_DHCPCapabilities_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = DHCP_OpenDRIM_DHCPCapabilities_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPCapabilitiesProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPCapabilities instance; DHCP_OpenDRIM_DHCPCapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPCapabilities_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = DHCP_OpenDRIM_DHCPCapabilities_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPCapabilitiesProviderSetInstance(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_DHCPCapabilities newInstance, oldInstance; DHCP_OpenDRIM_DHCPCapabilities_toCPP(_broker, ci, newInstance); DHCP_OpenDRIM_DHCPCapabilities_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPCapabilities_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPCapabilities_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPCapabilitiesProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPCapabilities instance; DHCP_OpenDRIM_DHCPCapabilities_toCPP(_broker, ci, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_DHCPCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPCapabilities_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = DHCP_OpenDRIM_DHCPCapabilities_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPCapabilitiesProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPCapabilities instance; DHCP_OpenDRIM_DHCPCapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPCapabilities_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPCapabilitiesProviderExecQuery(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 DHCP_OpenDRIM_DHCPCapabilities_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPCapabilities_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_DHCPCapabilities_init FAILED: " + (string) OpenDRIM_DHCPCapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int DHCP_OpenDRIM_DHCPCapabilities_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPCapabilities_unload(errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_DHCPCapabilities_unload FAILED: " + (string) OpenDRIM_DHCPCapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define DHCP_OpenDRIM_DHCPCapabilities_INIT if (DHCP_OpenDRIM_DHCPCapabilities_init(_broker) < 0) return NULL CMInstanceMIStub(DHCP_OpenDRIM_DHCPCapabilitiesProvider, DHCP_OpenDRIM_DHCPCapabilitiesProvider, _broker, DHCP_OpenDRIM_DHCPCapabilities_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPCapabilities/Makefile.am0000644000175000017500000000405111400673053025200 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 = libcmpiDHCP_OpenDRIM_DHCPCapabilitiesProvider.la libcmpiDHCP_OpenDRIM_DHCPCapabilitiesProvider_la_SOURCES = OpenDRIM_DHCPCapabilitiesAccess.cpp OpenDRIM_DHCPCapabilitiesProvider.cpp cmpiOpenDRIM_DHCPCapabilities.cpp libcmpiDHCP_OpenDRIM_DHCPCapabilitiesProvider_la_LIBADD = ../Common/libcmpiDHCP_Common.la libcmpiDHCP_OpenDRIM_DHCPCapabilitiesProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_DHCPCapabilities.h OpenDRIM_DHCPCapabilities.h OpenDRIM_DHCPCapabilitiesAccess.h opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPCapabilities/OpenDRIM_DHCPCapabilitiesAccess.cpp0000644000175000017500000001047111400673053031462 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPCapabilitiesAccess.h" string InstanceID; int DHCP_OpenDRIM_DHCPCapabilities_load(const CMPIBroker* broker, string& errorMessage) { _E_; CF_assert(CF_getSystemName(InstanceID, errorMessage)); _L_; return OK; } int DHCP_OpenDRIM_DHCPCapabilities_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int DHCP_OpenDRIM_DHCPCapabilities_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; OpenDRIM_DHCPCapabilities instance; instance.setInstanceID(InstanceID); if (discriminant == "ei") { CF_assert(DHCP_OpenDRIM_DHCPCapabilities_populate(instance, errorMessage)); } result.push_back(instance); _L_; return OK; } int DHCP_OpenDRIM_DHCPCapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_DHCPCapabilities& instance, const char** properties, string& errorMessage) { _E_; if(instance.InstanceID!=InstanceID) { errorMessage="No instance"; return NOT_FOUND; } CF_assert(DHCP_OpenDRIM_DHCPCapabilities_populate(instance, errorMessage)); _L_; return OK; } int DHCP_OpenDRIM_DHCPCapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPCapabilities& newInstance, const OpenDRIM_DHCPCapabilities& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPCapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPCapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPCapabilities_populate(OpenDRIM_DHCPCapabilities& instance, string& errorMessage) { _E_; /* * Properties to fill from profile * + Mandatory: * [X] InstanceID [KEY] * [X] ElementName * [X] ElementNameEditSupported * [X] OptionsSupported * + Conditional: * [X] MaxElementNameLen */ vector optionsSupported; string cmd; string output; instance.setElementName("DHCP Capabilities"); instance.setMaxElementNameLen(256); instance.setElementNameEditSupported(false); cmd="dhclient --version 2>&1"; CF_assert(CF_runCommandFL(cmd,output,errorMessage)); // Options Supported by dhclient v3.1.* if(output.find("isc-dhclient-V3.1")!=string::npos) { for(unsigned int i=3;i<=84;i++) { if((i>=3 && i<=63) || (i>=66 && i<=81) || i==84) optionsSupported.push_back(i); } optionsSupported.push_back(120); } instance.setOptionsSupported(optionsSupported); _L_; return OK; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPCapabilities/OpenDRIM_DHCPCapabilitiesAccess.h0000644000175000017500000000564211400673053031133 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPCAPABILITIESACCESS_H_ #define OPENDRIM_DHCPCAPABILITIESACCESS_H_ #include "DHCP_Common.h" #include "OpenDRIM_DHCPCapabilities.h" int DHCP_OpenDRIM_DHCPCapabilities_load(const CMPIBroker* broker, string& errorMessage); int DHCP_OpenDRIM_DHCPCapabilities_unload(string& errorMessage); int DHCP_OpenDRIM_DHCPCapabilities_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCPCapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_DHCPCapabilities& instance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCPCapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPCapabilities& newInstance, const OpenDRIM_DHCPCapabilities& oldInstance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCPCapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPCapabilities& instance, string& errorMessage); int DHCP_OpenDRIM_DHCPCapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPCapabilities& instance, string& errorMessage); int DHCP_OpenDRIM_DHCPCapabilities_populate(OpenDRIM_DHCPCapabilities& instance, string& errorMessage); #endif /*OPENDRIM_DHCPCAPABILITIESACCESS_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPCapabilities/cmpiOpenDRIM_DHCPCapabilities.h0000644000175000017500000000430511400673053030655 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPCAPABILITIES_H_ #define CMPIOPENDRIM_DHCPCAPABILITIES_H_ #include "OpenDRIM_DHCPCapabilities.h" CMPIObjectPath* DHCP_OpenDRIM_DHCPCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_DHCPCapabilities& instance); CMPIInstance* DHCP_OpenDRIM_DHCPCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_DHCPCapabilities& instance); void DHCP_OpenDRIM_DHCPCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_DHCPCapabilities& instance); void DHCP_OpenDRIM_DHCPCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_DHCPCapabilities& instance); #endif /*CMPIOPENDRIM_DHCPCAPABILITIES_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPCapabilities/cmpiOpenDRIM_DHCPCapabilities.cpp0000644000175000017500000001101111400673053031200 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPCapabilities.h" CMPIObjectPath* DHCP_OpenDRIM_DHCPCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_DHCPCapabilities& instance) { _E_; Objectpath op(broker, OpenDRIM_DHCPCapabilities_classnames[0], OpenDRIM_DHCPCapabilities_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* DHCP_OpenDRIM_DHCPCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_DHCPCapabilities& instance) { _E_; Objectpath op(broker, DHCP_OpenDRIM_DHCPCapabilities_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.OptionsSupported_isNULL) ci.setProperty("OptionsSupported", instance.OptionsSupported); _L_; return ci.getHdl(); } void DHCP_OpenDRIM_DHCPCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_DHCPCapabilities& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void DHCP_OpenDRIM_DHCPCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_DHCPCapabilities& 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("OptionsSupported", instance.OptionsSupported) == OK) instance.OptionsSupported_isNULL = false; _L_; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPCapabilities/OpenDRIM_DHCPCapabilities.h0000644000175000017500000001260711400673053030010 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPCAPABILITIES_H_ #define OPENDRIM_DHCPCAPABILITIES_H_ #include const static char* OpenDRIM_DHCPCapabilities_classnames[] = {"OpenDRIM_DHCPCapabilities"}; static string OpenDRIM_DHCPCapabilities_NAMESPACE = _NAMESPACE; class OpenDRIM_DHCPCapabilities { 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 OptionsSupported; bool OptionsSupported_isNULL; OpenDRIM_DHCPCapabilities() { Caption_isNULL = true; Description_isNULL = true; InstanceID_isNULL = true; ElementName_isNULL = true; ElementNameEditSupported_isNULL = true; MaxElementNameLen_isNULL = true; RequestedStatesSupported_isNULL = true; ElementNameMask_isNULL = true; OptionsSupported_isNULL = true; } ~OpenDRIM_DHCPCapabilities() {} 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 getOptionsSupported(vector& value) const { if (OptionsSupported_isNULL==true) return NOT_FOUND; value = OptionsSupported; return OK; } int setOptionsSupported(const vector& newValue) { OptionsSupported = newValue; OptionsSupported_isNULL = false; return OK; } }; #endif /*OPENDRIM_DHCPCAPABILITIES_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/packaging/0000755000175000017500000000000011400673053020403 5ustar guillaumeguillaumeopendrim-lmp-dhcp-1.0.0~ppa/packaging/opendrim-lmp-dhcp.spec0000644000175000017500000000764711400673053024614 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Guillaume BOTTEX, ETRI # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ################################################################################ %define packageVersion 1 Version: %{version} Release: %{packageVersion}%{?dist} Vendor: OpenDRIM Summary: OpenDRIM DHCP Provider Name: opendrim-lmp-dhcp Group: Systems Management/Base License: GPL BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root URL: http://opendrim.sourceforge.net Source: %{name}-%{version}.tar.gz BuildRequires: autoconf, tog-pegasus-devel, libopendrim >= 1.1.2 Requires: tog-pegasus, libopendrim >= 1.1.2 %description %global PEGASUS_ARCH_LIB %{_lib} %global COMMONLIBDIR /usr/%PEGASUS_ARCH_LIB %global PROVIDERDIR %COMMONLIBDIR/Pegasus/providers %global OPENDRIM_REG_DIR /usr/share/OpenDRIM %global OPENDRIM_MOF_DIR /usr/share/OpenDRIM/%{name}/mof %global PROVIDER_SCRIPT_POST DHCP %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-dhcp-1.0.0~ppa/packaging/debian/0000755000175000017500000000000011404347506021632 5ustar guillaumeguillaumeopendrim-lmp-dhcp-1.0.0~ppa/packaging/debian/postrm0000644000175000017500000000320211404347506023076 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_DHCPServer rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_DHCPElementSettingData rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_DHCPProtocolEndpoint rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_DHCPConformsToProfile rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_RegisteredDHCPProfile rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_DHCPSettingData rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_DHCPCapabilities rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_DHCP2RSA rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_DHCPElementCapabilities rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_DHCP2IP rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_DHCP2ComputerSystem ;; 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-dhcp-1.0.0~ppa/packaging/debian/source/0000755000175000017500000000000011400673053023125 5ustar guillaumeguillaumeopendrim-lmp-dhcp-1.0.0~ppa/packaging/debian/source/format0000644000175000017500000000001411400673053024333 0ustar guillaumeguillaume3.0 (quilt) opendrim-lmp-dhcp-1.0.0~ppa/packaging/debian/copyright0000644000175000017500000000276611400673053023573 0ustar guillaumeguillaumeThis package was debianized by Guillaume BOTTEX on Mon, 1 Feb 2010 12:50:17 +0900. It was downloaded from http://opendrim.sourceforge.net/ Upstream Authors: Khahramon NURIDDINOV Guillaume BOTTEX Copyright: Copyright (C) 2009 ETRI Khahramon NURIDDINOV Copyright (C) 2009 ETRI Guillaume BOTTEX License: Linux Management Providers (LMP), DHCP 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-dhcp-1.0.0~ppa/packaging/debian/control0000644000175000017500000000125611404347477023250 0ustar guillaumeguillaumeSource: opendrim-lmp-dhcp 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-dhcp Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, sfcb, libopendrim0 (>= 1.1.3) Description: OpenDRIM DHCP provider Provides information about the system DHCP client configuration and capabilities. . Compliant with the DMTF DHCP Client Profile v1.0.1 (DSP1037). opendrim-lmp-dhcp-1.0.0~ppa/packaging/debian/prerm0000644000175000017500000000241011400673053022672 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-dhcp VERSION=`cat /usr/share/doc/opendrim-lmp-dhcp/VERSION` OPENDRIM_REG_DIR=/usr/share/OpenDRIM PROVIDER_SCRIPT_POST=DHCP $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-dhcp-1.0.0~ppa/packaging/debian/changelog0000644000175000017500000000024211404347464023505 0ustar guillaumeguillaumeopendrim-lmp-dhcp (1.0.0-0ubuntu1) lucid; urgency=low * Initial release -- Guillaume BOTTEX Fri, 11 Jun 2010 14:52:00 +0900 opendrim-lmp-dhcp-1.0.0~ppa/packaging/debian/postinst0000644000175000017500000000256511400673053023443 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-dhcp VERSION=`cat /usr/share/doc/opendrim-lmp-dhcp/VERSION` OPENDRIM_REG_DIR=/usr/share/OpenDRIM PROVIDER_SCRIPT_POST=DHCP $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-dhcp-1.0.0~ppa/packaging/debian/install0000644000175000017500000000004711400673053023217 0ustar guillaumeguillaumeusr/lib/cmpi/*.so usr/share/OpenDRIM/* opendrim-lmp-dhcp-1.0.0~ppa/packaging/debian/rules0000755000175000017500000000353611400673053022714 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-dhcp 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-dhcp.sgml > opendrim-lmp-dhcp.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-dhcp-1.0.0~ppa/packaging/debian/docs0000644000175000017500000000003111400673053022472 0ustar guillaumeguillaumeNEWS README TODO VERSION opendrim-lmp-dhcp-1.0.0~ppa/packaging/debian/compat0000644000175000017500000000000211400673053023023 0ustar guillaumeguillaume5 opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPConformsToProfile/0000755000175000017500000000000011400673053024165 5ustar guillaumeguillaumeopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPConformsToProfile/Makefile.am0000644000175000017500000000476211400673053026232 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 = libcmpiDHCP_OpenDRIM_DHCPConformsToProfileProvider.la libcmpiDHCP_OpenDRIM_DHCPConformsToProfileProvider_la_SOURCES = OpenDRIM_DHCPConformsToProfileAccess.cpp OpenDRIM_DHCPConformsToProfileProvider.cpp cmpiOpenDRIM_DHCPConformsToProfile.cpp assocOpenDRIM_DHCPConformsToProfile.cpp # May have to be adjusted for direct invocation libcmpiDHCP_OpenDRIM_DHCPConformsToProfileProvider_la_CPPFLAGS = -I../CIM_RegisteredProfile -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiDHCP_OpenDRIM_DHCPConformsToProfileProvider_la_LIBADD = ../Common/libcmpiDHCP_Common.la #../CIM_RegisteredProfile/libcmpiDHCP_CIM_RegisteredProfileProvider.la ../CIM_ManagedElement/libcmpiDHCP_CIM_ManagedElementProvider.la libcmpiDHCP_OpenDRIM_DHCPConformsToProfileProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_DHCPConformsToProfile.h OpenDRIM_DHCPConformsToProfile.h OpenDRIM_DHCPConformsToProfileAccess.h opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPConformsToProfile/OpenDRIM_DHCPConformsToProfileAccess.h0000644000175000017500000001065011400673053033170 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPCONFORMSTOPROFILEACCESS_H_ #define OPENDRIM_DHCPCONFORMSTOPROFILEACCESS_H_ #include "DHCP_Common.h" #include "OpenDRIM_DHCPConformsToProfile.h" #include "assocOpenDRIM_DHCPConformsToProfile.h" int DHCP_OpenDRIM_DHCPConformsToProfile_load(const CMPIBroker* broker, string& errorMessage); int DHCP_OpenDRIM_DHCPConformsToProfile_unload(string& errorMessage); int DHCP_OpenDRIM_DHCPConformsToProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCPConformsToProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_DHCPConformsToProfile& instance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCPConformsToProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPConformsToProfile& newInstance, const OpenDRIM_DHCPConformsToProfile& oldInstance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCPConformsToProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPConformsToProfile& instance, string& errorMessage); int DHCP_OpenDRIM_DHCPConformsToProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPConformsToProfile& instance, string& errorMessage); int DHCP_OpenDRIM_DHCPConformsToProfile_associatorConformantStandardToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ConformantStandard_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCPConformsToProfile_associatorManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const char** properties, vector& ConformantStandard_associatedInstances, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCPConformsToProfile_referenceConformantStandardToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ConformantStandard_instance, const vector& ManagedElement_instances, vector& OpenDRIM_DHCPConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCPConformsToProfile_referenceManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& ConformantStandard_instances, vector& OpenDRIM_DHCPConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCPConformsToProfile_populate(OpenDRIM_DHCPConformsToProfile& instance, string& errorMessage); #endif /*OPENDRIM_DHCPCONFORMSTOPROFILEACCESS_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPConformsToProfile/cmpiOpenDRIM_DHCPConformsToProfile.cpp0000644000175000017500000000630511400673053033254 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPConformsToProfile.h" CMPIObjectPath* DHCP_OpenDRIM_DHCPConformsToProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_DHCPConformsToProfile& instance) { _E_; Objectpath op(broker, OpenDRIM_DHCPConformsToProfile_classnames[0], OpenDRIM_DHCPConformsToProfile_NAMESPACE); if (!instance.ConformantStandard_isNULL) op.addKey("ConformantStandard", instance.ConformantStandard); if (!instance.ManagedElement_isNULL) op.addKey("ManagedElement", instance.ManagedElement); _L_; return op.getHdl(); } CMPIInstance* DHCP_OpenDRIM_DHCPConformsToProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_DHCPConformsToProfile& instance) { _E_; Objectpath op(broker, DHCP_OpenDRIM_DHCPConformsToProfile_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void DHCP_OpenDRIM_DHCPConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_DHCPConformsToProfile& 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 DHCP_OpenDRIM_DHCPConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_DHCPConformsToProfile& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("ConformantStandard", instance.ConformantStandard) == OK) instance.ConformantStandard_isNULL = false; if (inst.getProperty("ManagedElement", instance.ManagedElement) == OK) instance.ManagedElement_isNULL = false; _L_; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPConformsToProfile/assocOpenDRIM_DHCPConformsToProfile.cpp0000644000175000017500000002132411400673053033432 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPConformsToProfile.h" int DHCP_OpenDRIM_DHCPConformsToProfile_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 = DHCP_OpenDRIM_DHCPConformsToProfile_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(DHCP_OpenDRIM_DHCPConformsToProfile_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(DHCP_OpenDRIM_DHCPConformsToProfile_associatorManagedElementToConformantStandard(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int DHCP_OpenDRIM_DHCPConformsToProfile_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(DHCP_CIM_RegisteredProfile_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(DHCP_CIM_RegisteredProfile_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, DHCP_CIM_RegisteredProfile_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int DHCP_OpenDRIM_DHCPConformsToProfile_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; DHCP_CIM_RegisteredProfile_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(DHCP_CIM_RegisteredProfile_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, DHCP_CIM_RegisteredProfile_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int DHCP_OpenDRIM_DHCPConformsToProfile_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(DHCP_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(DHCP_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, DHCP_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int DHCP_OpenDRIM_DHCPConformsToProfile_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; DHCP_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(DHCP_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, DHCP_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPConformsToProfile/OpenDRIM_DHCPConformsToProfileAccess.cpp0000644000175000017500000002521711400673053033530 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPConformsToProfileAccess.h" int DHCP_OpenDRIM_DHCPConformsToProfile_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(DHCP_CIM_RegisteredProfile_load(broker, errorMessage)); CF_assert(DHCP_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int DHCP_OpenDRIM_DHCPConformsToProfile_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(DHCP_CIM_RegisteredProfile_unload(errorMessage)); CF_assert(DHCP_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int DHCP_OpenDRIM_DHCPConformsToProfile_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 DHCP_OpenDRIM_DHCPConformsToProfile_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(DHCP_OpenDRIM_DHCPConformsToProfile_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(DHCP_OpenDRIM_DHCPConformsToProfile_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; DHCP_OpenDRIM_DHCPConformsToProfile_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(DHCP_OpenDRIM_DHCPConformsToProfile_referenceConformantStandardToManagedElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int DHCP_OpenDRIM_DHCPConformsToProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_DHCPConformsToProfile& 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(DHCP_OpenDRIM_DHCPConformsToProfile_getConformantStandard(broker, ctx, ConformantStandard_objectpath, ConformantStandard_instance, NULL, errorMessage)); Objectpath ManagedElement_objectpath; instance.getManagedElement(ManagedElement_objectpath); Instance ManagedElement_instance; CF_assert(DHCP_OpenDRIM_DHCPConformsToProfile_getManagedElement(broker, ctx, ManagedElement_objectpath, ManagedElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(DHCP_OpenDRIM_DHCPConformsToProfile_isAssociated(ConformantStandard_instance, ManagedElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int DHCP_OpenDRIM_DHCPConformsToProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPConformsToProfile& newInstance, const OpenDRIM_DHCPConformsToProfile& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPConformsToProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPConformsToProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPConformsToProfile_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(DHCP_OpenDRIM_DHCPConformsToProfile_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(DHCP_OpenDRIM_DHCPConformsToProfile_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(DHCP_OpenDRIM_DHCPConformsToProfile_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(DHCP_OpenDRIM_DHCPConformsToProfile_enumerateConformantStandards(broker, ctx, ConformantStandard_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(DHCP_OpenDRIM_DHCPConformsToProfile_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(DHCP_OpenDRIM_DHCPConformsToProfile_enumerateConformantStandards(broker, ctx, ConformantStandard_instances, properties, false, errorMessage)); } for (size_t i=0; i& ManagedElement_instances, vector& OpenDRIM_DHCPConformsToProfile_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_DHCPConformsToProfile instance; instance.setConformantStandard(((Instance) ConformantStandard_instance).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instances[i]).getObjectpath()); OpenDRIM_DHCPConformsToProfile_instances.push_back(instance); } _L_; return OK; } int DHCP_OpenDRIM_DHCPConformsToProfile_referenceManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& ConformantStandard_instances, vector& OpenDRIM_DHCPConformsToProfile_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_DHCPConformsToProfile instance; instance.setConformantStandard(((Instance) ConformantStandard_instances[i]).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instance).getObjectpath()); OpenDRIM_DHCPConformsToProfile_instances.push_back(instance); } _L_; return OK; } int DHCP_OpenDRIM_DHCPConformsToProfile_populate(OpenDRIM_DHCPConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPConformsToProfile/assocOpenDRIM_DHCPConformsToProfile.h0000644000175000017500000000626511400673053033106 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPCONFORMSTOPROFILE_H_ #define ASSOCOPENDRIM_DHCPCONFORMSTOPROFILE_H_ #include "OpenDRIM_DHCPConformsToProfileAccess.h" int DHCP_OpenDRIM_DHCPConformsToProfile_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 DHCP_OpenDRIM_DHCPConformsToProfile_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 DHCP_OpenDRIM_DHCPConformsToProfile_enumerateConformantStandards(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int DHCP_OpenDRIM_DHCPConformsToProfile_getConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCPConformsToProfile_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int DHCP_OpenDRIM_DHCPConformsToProfile_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_DHCPCONFORMSTOPROFILE_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPConformsToProfile/cmpiOpenDRIM_DHCPConformsToProfile.h0000644000175000017500000000440111400673053032714 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPCONFORMSTOPROFILE_H_ #define CMPIOPENDRIM_DHCPCONFORMSTOPROFILE_H_ #include "OpenDRIM_DHCPConformsToProfile.h" CMPIObjectPath* DHCP_OpenDRIM_DHCPConformsToProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_DHCPConformsToProfile& instance); CMPIInstance* DHCP_OpenDRIM_DHCPConformsToProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_DHCPConformsToProfile& instance); void DHCP_OpenDRIM_DHCPConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_DHCPConformsToProfile& instance); void DHCP_OpenDRIM_DHCPConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_DHCPConformsToProfile& instance); #endif /*CMPIOPENDRIM_DHCPCONFORMSTOPROFILE_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPConformsToProfile/OpenDRIM_DHCPConformsToProfile.h0000644000175000017500000000727511400673053032057 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPCONFORMSTOPROFILE_H_ #define OPENDRIM_DHCPCONFORMSTOPROFILE_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_DHCPConformsToProfile_classnames[] = {"OpenDRIM_DHCPConformsToProfile"}; static string OpenDRIM_DHCPConformsToProfile_NAMESPACE = _INTEROP_NAMESPACE; const static string ConformantStandard_role = "ConformantStandard"; const static char* ConformantStandard_classnames[] = {"OpenDRIM_RegisteredDHCPProfile"}; const static string ConformantStandard_NAMESPACE = _INTEROP_NAMESPACE; const static string ManagedElement_role = "ManagedElement"; const static char* ManagedElement_classnames[] = {"OpenDRIM_DHCPProtocolEndpoint"}; const static string ManagedElement_NAMESPACE = _NAMESPACE; class OpenDRIM_DHCPConformsToProfile { public: Objectpath ConformantStandard; bool ConformantStandard_isNULL; Objectpath ManagedElement; bool ManagedElement_isNULL; OpenDRIM_DHCPConformsToProfile() { ConformantStandard_isNULL = true; ManagedElement_isNULL = true; } ~OpenDRIM_DHCPConformsToProfile() {} 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_DHCPCONFORMSTOPROFILE_H_*/ ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPConformsToProfile/OpenDRIM_DHCPConformsToProfileProvider.cppopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPConformsToProfile/OpenDRIM_DHCPConformsToProfileProvider.cp0000644000175000017500000004210411400673053033733 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPConformsToProfile.h" #include "OpenDRIM_DHCPConformsToProfileAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define DHCP_OpenDRIM_DHCPConformsToProfileProviderSetInstance DHCP_OpenDRIM_DHCPConformsToProfileProviderModifyInstance #endif int DHCP_OpenDRIM_DHCPConformsToProfile_init(const CMPIBroker* broker); int DHCP_OpenDRIM_DHCPConformsToProfile_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus DHCP_OpenDRIM_DHCPConformsToProfileProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = DHCP_OpenDRIM_DHCPConformsToProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPConformsToProfileProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPConformsToProfile_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = DHCP_OpenDRIM_DHCPConformsToProfile_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPConformsToProfileProviderEnumInstances(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 = DHCP_OpenDRIM_DHCPConformsToProfile_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = DHCP_OpenDRIM_DHCPConformsToProfile_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPConformsToProfileProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPConformsToProfile instance; DHCP_OpenDRIM_DHCPConformsToProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPConformsToProfile_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = DHCP_OpenDRIM_DHCPConformsToProfile_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPConformsToProfileProviderSetInstance(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_DHCPConformsToProfile newInstance, oldInstance; DHCP_OpenDRIM_DHCPConformsToProfile_toCPP(_broker, ci, newInstance); DHCP_OpenDRIM_DHCPConformsToProfile_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPConformsToProfile_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPConformsToProfile_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPConformsToProfileProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPConformsToProfile instance; DHCP_OpenDRIM_DHCPConformsToProfile_toCPP(_broker, ci, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_DHCPConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPConformsToProfile_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = DHCP_OpenDRIM_DHCPConformsToProfile_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPConformsToProfileProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPConformsToProfile instance; DHCP_OpenDRIM_DHCPConformsToProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPConformsToProfile_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPConformsToProfileProviderExecQuery(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 DHCP_OpenDRIM_DHCPConformsToProfileProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = DHCP_OpenDRIM_DHCPConformsToProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPConformsToProfileProviderAssociatorNames(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 = DHCP_OpenDRIM_DHCPConformsToProfile_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPConformsToProfile_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 DHCP_OpenDRIM_DHCPConformsToProfileProviderAssociators(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 = DHCP_OpenDRIM_DHCPConformsToProfile_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPConformsToProfile_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 DHCP_OpenDRIM_DHCPConformsToProfileProviderReferenceNames(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 = DHCP_OpenDRIM_DHCPConformsToProfile_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = DHCP_OpenDRIM_DHCPConformsToProfile_referenceConformantStandardToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = DHCP_OpenDRIM_DHCPConformsToProfile_referenceManagedElementToConformantStandard(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = DHCP_OpenDRIM_DHCPConformsToProfile_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPConformsToProfileProviderReferences(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 = DHCP_OpenDRIM_DHCPConformsToProfile_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = DHCP_OpenDRIM_DHCPConformsToProfile_referenceConformantStandardToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = DHCP_OpenDRIM_DHCPConformsToProfile_referenceManagedElementToConformantStandard(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = DHCP_OpenDRIM_DHCPConformsToProfile_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int DHCP_OpenDRIM_DHCPConformsToProfile_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPConformsToProfile_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_DHCPConformsToProfile_init FAILED: " + (string) OpenDRIM_DHCPConformsToProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int DHCP_OpenDRIM_DHCPConformsToProfile_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPConformsToProfile_unload(errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_DHCPConformsToProfile_unload FAILED: " + (string) OpenDRIM_DHCPConformsToProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define DHCP_OpenDRIM_DHCPConformsToProfile_INIT if (DHCP_OpenDRIM_DHCPConformsToProfile_init(_broker) < 0) return NULL CMInstanceMIStub(DHCP_OpenDRIM_DHCPConformsToProfileProvider, DHCP_OpenDRIM_DHCPConformsToProfileProvider, _broker, DHCP_OpenDRIM_DHCPConformsToProfile_INIT); CMAssociationMIStub(DHCP_OpenDRIM_DHCPConformsToProfileProvider, DHCP_OpenDRIM_DHCPConformsToProfileProvider, _broker, DHCP_OpenDRIM_DHCPConformsToProfile_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-dhcp-1.0.0~ppa/mof/0000755000175000017500000000000011400673053017240 5ustar guillaumeguillaumeopendrim-lmp-dhcp-1.0.0~ppa/mof/OpenDRIM_RegisteredDHCPProfile.mof0000644000175000017500000000324111400673053025455 0ustar guillaumeguillaume//############################################################################## // Linux Management Providers (LMP), DHCP provider package // Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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:cmpiDHCP_OpenDRIM_RegisteredDHCPProfileProvider")] class OpenDRIM_RegisteredDHCPProfile:CIM_RegisteredProfile { }; opendrim-lmp-dhcp-1.0.0~ppa/mof/OpenDRIM_DHCPElementCapabilities.mof0000644000175000017500000000326511400673053025750 0ustar guillaumeguillaume//############################################################################## // Linux Management Providers (LMP), DHCP provider package // Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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:cmpiDHCP_OpenDRIM_DHCPElementCapabilitiesProvider")] class OpenDRIM_DHCPElementCapabilities:CIM_ElementCapabilities { }; opendrim-lmp-dhcp-1.0.0~ppa/mof/OpenDRIM_DHCP2RSA.mof0000644000175000017500000000324211400673053022547 0ustar guillaumeguillaume//############################################################################## // Linux Management Providers (LMP), DHCP provider package // Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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:cmpiDHCP_OpenDRIM_DHCP2RSAProvider")] class OpenDRIM_DHCP2RSA:CIM_RemoteAccessAvailableToElement { }; opendrim-lmp-dhcp-1.0.0~ppa/mof/OpenDRIM_DHCPServer.mof0000644000175000017500000000322211400673053023304 0ustar guillaumeguillaume//############################################################################## // Linux Management Providers (LMP), DHCP provider package // Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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:cmpiDHCP_OpenDRIM_DHCPServerProvider")] class OpenDRIM_DHCPServer:CIM_RemoteServiceAccessPoint { }; opendrim-lmp-dhcp-1.0.0~ppa/mof/OpenDRIM_DHCPSettingData.mof0000644000175000017500000000322311400673053024246 0ustar guillaumeguillaume//############################################################################## // Linux Management Providers (LMP), DHCP provider package // Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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:cmpiDHCP_OpenDRIM_DHCPSettingDataProvider")] class OpenDRIM_DHCPSettingData:CIM_DHCPSettingData { }; opendrim-lmp-dhcp-1.0.0~ppa/mof/OpenDRIM_DHCPProtocolEndpoint.mof0000644000175000017500000000324211400673053025342 0ustar guillaumeguillaume//############################################################################## // Linux Management Providers (LMP), DHCP provider package // Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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:cmpiDHCP_OpenDRIM_DHCPProtocolEndpointProvider")] class OpenDRIM_DHCPProtocolEndpoint:CIM_DHCPProtocolEndpoint { }; opendrim-lmp-dhcp-1.0.0~ppa/mof/OpenDRIM_DHCP2ComputerSystem.mof0000644000175000017500000000325311400673053025127 0ustar guillaumeguillaume//############################################################################## // Linux Management Providers (LMP), DHCP provider package // Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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:cmpiDHCP_OpenDRIM_DHCP2ComputerSystemProvider")] class OpenDRIM_DHCP2ComputerSystem:CIM_HostedAccessPoint { }; opendrim-lmp-dhcp-1.0.0~ppa/mof/OpenDRIM_DHCPCapabilities.mof0000644000175000017500000000322611400673053024433 0ustar guillaumeguillaume//############################################################################## // Linux Management Providers (LMP), DHCP provider package // Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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:cmpiDHCP_OpenDRIM_DHCPCapabilitiesProvider")] class OpenDRIM_DHCPCapabilities:CIM_DHCPCapabilities { }; opendrim-lmp-dhcp-1.0.0~ppa/mof/OpenDRIM_DHCP2IP.mof0000644000175000017500000000322211400673053022430 0ustar guillaumeguillaume//############################################################################## // Linux Management Providers (LMP), DHCP provider package // Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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:cmpiDHCP_OpenDRIM_DHCP2IPProvider")] class OpenDRIM_DHCP2IP:CIM_SAPSAPDependency { }; opendrim-lmp-dhcp-1.0.0~ppa/mof/OpenDRIM_DHCPElementSettingData.mof0000644000175000017500000000326211400673053025563 0ustar guillaumeguillaume//############################################################################## // Linux Management Providers (LMP), DHCP provider package // Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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:cmpiDHCP_OpenDRIM_DHCPElementSettingDataProvider")] class OpenDRIM_DHCPElementSettingData:CIM_ElementSettingData { }; opendrim-lmp-dhcp-1.0.0~ppa/mof/OpenDRIM_DHCPConformsToProfile.mof0000644000175000017500000000325011400673053025451 0ustar guillaumeguillaume//############################################################################## // Linux Management Providers (LMP), DHCP provider package // Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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:cmpiDHCP_OpenDRIM_DHCPConformsToProfileProvider")] class OpenDRIM_DHCPConformsToProfile:CIM_ElementConformsToProfile { }; opendrim-lmp-dhcp-1.0.0~ppa/COPYING0000644000175000017500000004310311400673053017513 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-dhcp-1.0.0~ppa/OpenDRIM_DHCPServer/0000755000175000017500000000000011400673053022021 5ustar guillaumeguillaumeopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPServer/Makefile.am0000644000175000017500000000375511400673053024067 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 = libcmpiDHCP_OpenDRIM_DHCPServerProvider.la libcmpiDHCP_OpenDRIM_DHCPServerProvider_la_SOURCES = OpenDRIM_DHCPServerAccess.cpp OpenDRIM_DHCPServerProvider.cpp cmpiOpenDRIM_DHCPServer.cpp libcmpiDHCP_OpenDRIM_DHCPServerProvider_la_LIBADD = ../Common/libcmpiDHCP_Common.la libcmpiDHCP_OpenDRIM_DHCPServerProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_DHCPServer.h OpenDRIM_DHCPServer.h OpenDRIM_DHCPServerAccess.h opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPServer/OpenDRIM_DHCPServerAccess.cpp0000644000175000017500000001221011400673053027205 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPServerAccess.h" string systemName; const string systemCreationClassName = "OpenDRIM_ComputerSystem"; const string creationClassName = "OpenDRIM_DNSServer"; int DHCP_OpenDRIM_DHCPServer_load(const CMPIBroker* broker, string& errorMessage) { _E_; CF_assert(CF_getSystemName(systemName, errorMessage)); _L_; return OK; } int DHCP_OpenDRIM_DHCPServer_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int DHCP_OpenDRIM_DHCPServer_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; OpenDRIM_DHCPServer instance; vector ethernet_names; int errorCode; dhcp_lease lease; string option; errorCode=dhcp_ethernet_names(ethernet_names,errorMessage); if(errorCode!=OK) return OK; instance.setSystemCreationClassName(systemCreationClassName); instance.setSystemName(systemName); instance.setCreationClassName(creationClassName); errorCode=get_dhcp_leases(lease,"dhcp-server-identifier",option,errorMessage); if(errorCode!=OK) return errorCode; instance.setName(option); if(discriminant == "ei") CF_assert(DHCP_OpenDRIM_DHCPServer_populate(instance, errorMessage)); result.push_back(instance); _L_; return OK; } int DHCP_OpenDRIM_DHCPServer_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_DHCPServer& instance, const char** properties, string& errorMessage) { _E_; if(instance.SystemCreationClassName == systemCreationClassName && instance.SystemName == systemName && instance.CreationClassName == creationClassName) { dhcp_lease lease; string option; int errorCode; errorCode=get_dhcp_leases(lease,"dhcp-server-identifier",option,errorMessage); if(errorCode!=OK) return ERROR; if (CF_strCmpNoCase(option,instance.Name)) { CF_assert(DHCP_OpenDRIM_DHCPServer_populate(instance, errorMessage)); return OK; } errorMessage = "Invalid path"; return NOT_FOUND; } else { errorMessage = "Invalid path"; return NOT_FOUND; } _L_; return OK; } int DHCP_OpenDRIM_DHCPServer_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPServer& newInstance, const OpenDRIM_DHCPServer& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPServer_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPServer& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPServer_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPServer& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPServer_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPServer& instance, unsigned int& returnValue, const OpenDRIM_DHCPServer_RequestStateChange_In& in, OpenDRIM_DHCPServer_RequestStateChange_Out& out, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPServer_populate(OpenDRIM_DHCPServer& instance, string& errorMessage) { _E_; /* * Properties to fill from profile * + Mandatory: * [X] SystemCreationClassName [KEY] * [X] CreationClassName [KEY] * [X] SystemName [KEY] * [X] Name [KEY] * [X] InfoFormat * [X] AccessContext * [X] AccessInfo * [X] ElementName */ instance.setAccessInfo(instance.Name); instance.setInfoFormat(3); instance.setElementName("DHCP server "+instance.Name); instance.setAccessContext(7); _L_; return OK; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPServer/cmpiOpenDRIM_DHCPServer.h0000644000175000017500000000461511400673053026413 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPSERVER_H_ #define CMPIOPENDRIM_DHCPSERVER_H_ #include "OpenDRIM_DHCPServer.h" CMPIObjectPath* DHCP_OpenDRIM_DHCPServer_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_DHCPServer& instance); CMPIInstance* DHCP_OpenDRIM_DHCPServer_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_DHCPServer& instance); void DHCP_OpenDRIM_DHCPServer_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_DHCPServer& instance); void DHCP_OpenDRIM_DHCPServer_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_DHCPServer& instance); void DHCP_OpenDRIM_DHCPServer_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_DHCPServer_RequestStateChange_In& args); void DHCP_OpenDRIM_DHCPServer_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_DHCPServer_RequestStateChange_Out& args); #endif /*CMPIOPENDRIM_DHCPSERVER_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPServer/cmpiOpenDRIM_DHCPServer.cpp0000644000175000017500000002376211400673053026752 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPServer.h" CMPIObjectPath* DHCP_OpenDRIM_DHCPServer_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_DHCPServer& instance) { _E_; Objectpath op(broker, OpenDRIM_DHCPServer_classnames[0], OpenDRIM_DHCPServer_NAMESPACE); if (!instance.SystemCreationClassName_isNULL) op.addKey("SystemCreationClassName", instance.SystemCreationClassName); if (!instance.SystemName_isNULL) op.addKey("SystemName", instance.SystemName); if (!instance.CreationClassName_isNULL) op.addKey("CreationClassName", instance.CreationClassName); if (!instance.Name_isNULL) op.addKey("Name", instance.Name); _L_; return op.getHdl(); } CMPIInstance* DHCP_OpenDRIM_DHCPServer_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_DHCPServer& instance) { _E_; Objectpath op(broker, DHCP_OpenDRIM_DHCPServer_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.InstanceID_isNULL) ci.setProperty("InstanceID", instance.InstanceID); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.InstallDate_isNULL) ci.setPropertyDatetime("InstallDate", instance.InstallDate); if (!instance.OperationalStatus_isNULL) ci.setProperty("OperationalStatus", instance.OperationalStatus); if (!instance.StatusDescriptions_isNULL) ci.setProperty("StatusDescriptions", instance.StatusDescriptions); if (!instance.Status_isNULL) ci.setProperty("Status", instance.Status); if (!instance.HealthState_isNULL) ci.setProperty("HealthState", instance.HealthState); if (!instance.CommunicationStatus_isNULL) ci.setProperty("CommunicationStatus", instance.CommunicationStatus); if (!instance.DetailedStatus_isNULL) ci.setProperty("DetailedStatus", instance.DetailedStatus); if (!instance.OperatingStatus_isNULL) ci.setProperty("OperatingStatus", instance.OperatingStatus); if (!instance.PrimaryStatus_isNULL) ci.setProperty("PrimaryStatus", instance.PrimaryStatus); if (!instance.EnabledState_isNULL) ci.setProperty("EnabledState", instance.EnabledState); if (!instance.OtherEnabledState_isNULL) ci.setProperty("OtherEnabledState", instance.OtherEnabledState); if (!instance.RequestedState_isNULL) ci.setProperty("RequestedState", instance.RequestedState); if (!instance.EnabledDefault_isNULL) ci.setProperty("EnabledDefault", instance.EnabledDefault); if (!instance.TimeOfLastStateChange_isNULL) ci.setPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange); if (!instance.AvailableRequestedStates_isNULL) ci.setProperty("AvailableRequestedStates", instance.AvailableRequestedStates); if (!instance.TransitioningToState_isNULL) ci.setProperty("TransitioningToState", instance.TransitioningToState); if (!instance.AccessInfo_isNULL) ci.setProperty("AccessInfo", instance.AccessInfo); if (!instance.InfoFormat_isNULL) ci.setProperty("InfoFormat", instance.InfoFormat); if (!instance.OtherInfoFormatDescription_isNULL) ci.setProperty("OtherInfoFormatDescription", instance.OtherInfoFormatDescription); if (!instance.AccessContext_isNULL) ci.setProperty("AccessContext", instance.AccessContext); if (!instance.OtherAccessContext_isNULL) ci.setProperty("OtherAccessContext", instance.OtherAccessContext); _L_; return ci.getHdl(); } void DHCP_OpenDRIM_DHCPServer_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_DHCPServer& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (op.getKey("Name", instance.Name) == OK) instance.Name_isNULL = false; if (op.getKey("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (op.getKey("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; _L_; } void DHCP_OpenDRIM_DHCPServer_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_DHCPServer& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getPropertyDatetime("InstallDate", instance.InstallDate) == OK) instance.InstallDate_isNULL = false; if (inst.getProperty("OperationalStatus", instance.OperationalStatus) == OK) instance.OperationalStatus_isNULL = false; if (inst.getProperty("StatusDescriptions", instance.StatusDescriptions) == OK) instance.StatusDescriptions_isNULL = false; if (inst.getProperty("Status", instance.Status) == OK) instance.Status_isNULL = false; if (inst.getProperty("HealthState", instance.HealthState) == OK) instance.HealthState_isNULL = false; if (inst.getProperty("CommunicationStatus", instance.CommunicationStatus) == OK) instance.CommunicationStatus_isNULL = false; if (inst.getProperty("DetailedStatus", instance.DetailedStatus) == OK) instance.DetailedStatus_isNULL = false; if (inst.getProperty("OperatingStatus", instance.OperatingStatus) == OK) instance.OperatingStatus_isNULL = false; if (inst.getProperty("PrimaryStatus", instance.PrimaryStatus) == OK) instance.PrimaryStatus_isNULL = false; if (inst.getProperty("EnabledState", instance.EnabledState) == OK) instance.EnabledState_isNULL = false; if (inst.getProperty("OtherEnabledState", instance.OtherEnabledState) == OK) instance.OtherEnabledState_isNULL = false; if (inst.getProperty("RequestedState", instance.RequestedState) == OK) instance.RequestedState_isNULL = false; if (inst.getProperty("EnabledDefault", instance.EnabledDefault) == OK) instance.EnabledDefault_isNULL = false; if (inst.getPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange) == OK) instance.TimeOfLastStateChange_isNULL = false; if (inst.getProperty("AvailableRequestedStates", instance.AvailableRequestedStates) == OK) instance.AvailableRequestedStates_isNULL = false; if (inst.getProperty("TransitioningToState", instance.TransitioningToState) == OK) instance.TransitioningToState_isNULL = false; if (inst.getProperty("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (inst.getProperty("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (inst.getProperty("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; if (inst.getProperty("Name", instance.Name) == OK) instance.Name_isNULL = false; if (inst.getProperty("AccessInfo", instance.AccessInfo) == OK) instance.AccessInfo_isNULL = false; if (inst.getProperty("InfoFormat", instance.InfoFormat) == OK) instance.InfoFormat_isNULL = false; if (inst.getProperty("OtherInfoFormatDescription", instance.OtherInfoFormatDescription) == OK) instance.OtherInfoFormatDescription_isNULL = false; if (inst.getProperty("AccessContext", instance.AccessContext) == OK) instance.AccessContext_isNULL = false; if (inst.getProperty("OtherAccessContext", instance.OtherAccessContext) == OK) instance.OtherAccessContext_isNULL = false; _L_; } void DHCP_OpenDRIM_DHCPServer_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_DHCPServer_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 DHCP_OpenDRIM_DHCPServer_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_DHCPServer_RequestStateChange_Out& args) { _E_; CMPIValue value; int errorMessage; Objectpath Job; errorMessage = args.getJob(Job); if (errorMessage == OK) { value = CT_toCMPI(Job); out->ft->addArg(out, "Job", &value, CMPI_ref); } _L_; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPServer/OpenDRIM_DHCPServer.h0000644000175000017500000003464611400673053025551 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPSERVER_H_ #define OPENDRIM_DHCPSERVER_H_ #include const static char* OpenDRIM_DHCPServer_classnames[] = {"OpenDRIM_DHCPServer"}; static string OpenDRIM_DHCPServer_NAMESPACE = _NAMESPACE; class OpenDRIM_DHCPServer { public: string InstanceID; bool InstanceID_isNULL; string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string InstallDate; bool InstallDate_isNULL; vector OperationalStatus; bool OperationalStatus_isNULL; vector StatusDescriptions; bool StatusDescriptions_isNULL; string Status; bool Status_isNULL; unsigned short HealthState; bool HealthState_isNULL; unsigned short CommunicationStatus; bool CommunicationStatus_isNULL; unsigned short DetailedStatus; bool DetailedStatus_isNULL; unsigned short OperatingStatus; bool OperatingStatus_isNULL; unsigned short PrimaryStatus; bool PrimaryStatus_isNULL; unsigned short EnabledState; bool EnabledState_isNULL; string OtherEnabledState; bool OtherEnabledState_isNULL; unsigned short RequestedState; bool RequestedState_isNULL; unsigned short EnabledDefault; bool EnabledDefault_isNULL; string TimeOfLastStateChange; bool TimeOfLastStateChange_isNULL; vector AvailableRequestedStates; bool AvailableRequestedStates_isNULL; unsigned short TransitioningToState; bool TransitioningToState_isNULL; string SystemCreationClassName; bool SystemCreationClassName_isNULL; string SystemName; bool SystemName_isNULL; string CreationClassName; bool CreationClassName_isNULL; string Name; bool Name_isNULL; string AccessInfo; bool AccessInfo_isNULL; unsigned short InfoFormat; bool InfoFormat_isNULL; string OtherInfoFormatDescription; bool OtherInfoFormatDescription_isNULL; unsigned short AccessContext; bool AccessContext_isNULL; string OtherAccessContext; bool OtherAccessContext_isNULL; OpenDRIM_DHCPServer() { InstanceID_isNULL = true; Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstallDate_isNULL = true; OperationalStatus_isNULL = true; StatusDescriptions_isNULL = true; Status_isNULL = true; HealthState_isNULL = true; CommunicationStatus_isNULL = true; DetailedStatus_isNULL = true; OperatingStatus_isNULL = true; PrimaryStatus_isNULL = true; EnabledState_isNULL = true; OtherEnabledState_isNULL = true; RequestedState_isNULL = true; EnabledDefault_isNULL = true; TimeOfLastStateChange_isNULL = true; AvailableRequestedStates_isNULL = true; TransitioningToState_isNULL = true; SystemCreationClassName_isNULL = true; SystemName_isNULL = true; CreationClassName_isNULL = true; Name_isNULL = true; AccessInfo_isNULL = true; InfoFormat_isNULL = true; OtherInfoFormatDescription_isNULL = true; AccessContext_isNULL = true; OtherAccessContext_isNULL = true; } ~OpenDRIM_DHCPServer() {} string getKeys() const { return CF_toLowCase(".SystemCreationClassName=\"" + CF_quoteString(SystemCreationClassName) + "\""".SystemName=\"" + CF_quoteString(SystemName) + "\""".CreationClassName=\"" + CF_quoteString(CreationClassName) + "\""".Name=\"" + CF_quoteString(Name) + "\""); } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getInstallDate(string& value) const { if (InstallDate_isNULL==true) return NOT_FOUND; value = InstallDate; return OK; } int setInstallDate(const string& newValue) { InstallDate = newValue; InstallDate_isNULL = false; return OK; } int getOperationalStatus(vector& value) const { if (OperationalStatus_isNULL==true) return NOT_FOUND; value = OperationalStatus; return OK; } int setOperationalStatus(const vector& newValue) { OperationalStatus = newValue; OperationalStatus_isNULL = false; return OK; } int getStatusDescriptions(vector& value) const { if (StatusDescriptions_isNULL==true) return NOT_FOUND; value = StatusDescriptions; return OK; } int setStatusDescriptions(const vector& newValue) { StatusDescriptions = newValue; StatusDescriptions_isNULL = false; return OK; } int getStatus(string& value) const { if (Status_isNULL==true) return NOT_FOUND; value = Status; return OK; } int setStatus(const string& newValue) { Status = newValue; Status_isNULL = false; return OK; } int getHealthState(unsigned short& value) const { if (HealthState_isNULL==true) return NOT_FOUND; value = HealthState; return OK; } int setHealthState(const unsigned short& newValue) { HealthState = newValue; HealthState_isNULL = false; return OK; } int getCommunicationStatus(unsigned short& value) const { if (CommunicationStatus_isNULL==true) return NOT_FOUND; value = CommunicationStatus; return OK; } int setCommunicationStatus(const unsigned short& newValue) { CommunicationStatus = newValue; CommunicationStatus_isNULL = false; return OK; } int getDetailedStatus(unsigned short& value) const { if (DetailedStatus_isNULL==true) return NOT_FOUND; value = DetailedStatus; return OK; } int setDetailedStatus(const unsigned short& newValue) { DetailedStatus = newValue; DetailedStatus_isNULL = false; return OK; } int getOperatingStatus(unsigned short& value) const { if (OperatingStatus_isNULL==true) return NOT_FOUND; value = OperatingStatus; return OK; } int setOperatingStatus(const unsigned short& newValue) { OperatingStatus = newValue; OperatingStatus_isNULL = false; return OK; } int getPrimaryStatus(unsigned short& value) const { if (PrimaryStatus_isNULL==true) return NOT_FOUND; value = PrimaryStatus; return OK; } int setPrimaryStatus(const unsigned short& newValue) { PrimaryStatus = newValue; PrimaryStatus_isNULL = false; return OK; } int getEnabledState(unsigned short& value) const { if (EnabledState_isNULL==true) return NOT_FOUND; value = EnabledState; return OK; } int setEnabledState(const unsigned short& newValue) { EnabledState = newValue; EnabledState_isNULL = false; return OK; } int getOtherEnabledState(string& value) const { if (OtherEnabledState_isNULL==true) return NOT_FOUND; value = OtherEnabledState; return OK; } int setOtherEnabledState(const string& newValue) { OtherEnabledState = newValue; OtherEnabledState_isNULL = false; return OK; } int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL==true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getEnabledDefault(unsigned short& value) const { if (EnabledDefault_isNULL==true) return NOT_FOUND; value = EnabledDefault; return OK; } int setEnabledDefault(const unsigned short& newValue) { EnabledDefault = newValue; EnabledDefault_isNULL = false; return OK; } int getTimeOfLastStateChange(string& value) const { if (TimeOfLastStateChange_isNULL==true) return NOT_FOUND; value = TimeOfLastStateChange; return OK; } int setTimeOfLastStateChange(const string& newValue) { TimeOfLastStateChange = newValue; TimeOfLastStateChange_isNULL = false; return OK; } int getAvailableRequestedStates(vector& value) const { if (AvailableRequestedStates_isNULL==true) return NOT_FOUND; value = AvailableRequestedStates; return OK; } int setAvailableRequestedStates(const vector& newValue) { AvailableRequestedStates = newValue; AvailableRequestedStates_isNULL = false; return OK; } int getTransitioningToState(unsigned short& value) const { if (TransitioningToState_isNULL==true) return NOT_FOUND; value = TransitioningToState; return OK; } int setTransitioningToState(const unsigned short& newValue) { TransitioningToState = newValue; TransitioningToState_isNULL = false; return OK; } int getSystemCreationClassName(string& value) const { if (SystemCreationClassName_isNULL==true) return NOT_FOUND; value = SystemCreationClassName; return OK; } int setSystemCreationClassName(const string& newValue) { SystemCreationClassName = newValue; SystemCreationClassName_isNULL = false; return OK; } int getSystemName(string& value) const { if (SystemName_isNULL==true) return NOT_FOUND; value = SystemName; return OK; } int setSystemName(const string& newValue) { SystemName = newValue; SystemName_isNULL = false; return OK; } int getCreationClassName(string& value) const { if (CreationClassName_isNULL==true) return NOT_FOUND; value = CreationClassName; return OK; } int setCreationClassName(const string& newValue) { CreationClassName = newValue; CreationClassName_isNULL = false; return OK; } int getName(string& value) const { if (Name_isNULL==true) return NOT_FOUND; value = Name; return OK; } int setName(const string& newValue) { Name = newValue; Name_isNULL = false; return OK; } int getAccessInfo(string& value) const { if (AccessInfo_isNULL==true) return NOT_FOUND; value = AccessInfo; return OK; } int setAccessInfo(const string& newValue) { AccessInfo = newValue; AccessInfo_isNULL = false; return OK; } int getInfoFormat(unsigned short& value) const { if (InfoFormat_isNULL==true) return NOT_FOUND; value = InfoFormat; return OK; } int setInfoFormat(const unsigned short& newValue) { InfoFormat = newValue; InfoFormat_isNULL = false; return OK; } int getOtherInfoFormatDescription(string& value) const { if (OtherInfoFormatDescription_isNULL==true) return NOT_FOUND; value = OtherInfoFormatDescription; return OK; } int setOtherInfoFormatDescription(const string& newValue) { OtherInfoFormatDescription = newValue; OtherInfoFormatDescription_isNULL = false; return OK; } int getAccessContext(unsigned short& value) const { if (AccessContext_isNULL==true) return NOT_FOUND; value = AccessContext; return OK; } int setAccessContext(const unsigned short& newValue) { AccessContext = newValue; AccessContext_isNULL = false; return OK; } int getOtherAccessContext(string& value) const { if (OtherAccessContext_isNULL==true) return NOT_FOUND; value = OtherAccessContext; return OK; } int setOtherAccessContext(const string& newValue) { OtherAccessContext = newValue; OtherAccessContext_isNULL = false; return OK; } }; class OpenDRIM_DHCPServer_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_DHCPServer_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_DHCPServer_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_DHCPServer_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_DHCPServer_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_DHCPServer_RequestStateChange_Out() {} int getJob(Objectpath& value) const { if (Job_isNULL == true) return NOT_FOUND; value = Job; return OK; } int setJob(const Objectpath& newValue) { Job = newValue; Job_isNULL = false; return OK; } }; #endif /*OPENDRIM_DHCPSERVER_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPServer/OpenDRIM_DHCPServerProvider.cpp0000644000175000017500000003164311400673053027611 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPServer.h" #include "OpenDRIM_DHCPServerAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define DHCP_OpenDRIM_DHCPServerProviderSetInstance DHCP_OpenDRIM_DHCPServerProviderModifyInstance #endif int DHCP_OpenDRIM_DHCPServer_init(const CMPIBroker* broker); int DHCP_OpenDRIM_DHCPServer_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus DHCP_OpenDRIM_DHCPServerProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = DHCP_OpenDRIM_DHCPServer_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPServerProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPServer_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPServer_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = DHCP_OpenDRIM_DHCPServer_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPServerProviderEnumInstances(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 = DHCP_OpenDRIM_DHCPServer_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPServer_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = DHCP_OpenDRIM_DHCPServer_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPServerProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPServer instance; DHCP_OpenDRIM_DHCPServer_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPServer_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPServer_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = DHCP_OpenDRIM_DHCPServer_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPServerProviderSetInstance(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_DHCPServer newInstance, oldInstance; DHCP_OpenDRIM_DHCPServer_toCPP(_broker, ci, newInstance); DHCP_OpenDRIM_DHCPServer_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPServer_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPServer_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPServer_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPServer_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPServerProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPServer instance; DHCP_OpenDRIM_DHCPServer_toCPP(_broker, ci, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPServer_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_DHCPServer_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPServer_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPServer_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPServer_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPServer_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = DHCP_OpenDRIM_DHCPServer_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPServerProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPServer instance; DHCP_OpenDRIM_DHCPServer_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPServer_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPServer_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPServer_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPServer_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPServerProviderExecQuery(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 DHCP_OpenDRIM_DHCPServerProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = DHCP_OpenDRIM_DHCPServer_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPServerProviderInvokeMethod(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_DHCPServer instance; DHCP_OpenDRIM_DHCPServer_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"SystemCreationClassName", "Name", "SystemName", "CreationClassName"}; int errorCode = DHCP_OpenDRIM_DHCPServer_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPServer_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_DHCPServer_RequestStateChange_In inArgs; DHCP_OpenDRIM_DHCPServer_toCPP(_broker, in, inArgs); OpenDRIM_DHCPServer_RequestStateChange_Out outArgs; errorCode = DHCP_OpenDRIM_DHCPServer_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPServer_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } DHCP_OpenDRIM_DHCPServer_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else { errorMessage = (string) OpenDRIM_DHCPServer_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 DHCP_OpenDRIM_DHCPServer_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPServer_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_DHCPServer_init FAILED: " + (string) OpenDRIM_DHCPServer_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int DHCP_OpenDRIM_DHCPServer_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPServer_unload(errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_DHCPServer_unload FAILED: " + (string) OpenDRIM_DHCPServer_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define DHCP_OpenDRIM_DHCPServer_INIT if (DHCP_OpenDRIM_DHCPServer_init(_broker) < 0) return NULL CMInstanceMIStub(DHCP_OpenDRIM_DHCPServerProvider, DHCP_OpenDRIM_DHCPServerProvider, _broker, DHCP_OpenDRIM_DHCPServer_INIT); CMMethodMIStub(DHCP_OpenDRIM_DHCPServerProvider, DHCP_OpenDRIM_DHCPServerProvider, _broker, DHCP_OpenDRIM_DHCPServer_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPServer/OpenDRIM_DHCPServerAccess.h0000644000175000017500000000612011400673053026655 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPSERVERACCESS_H_ #define OPENDRIM_DHCPSERVERACCESS_H_ #include "DHCP_Common.h" #include "OpenDRIM_DHCPServer.h" int DHCP_OpenDRIM_DHCPServer_load(const CMPIBroker* broker, string& errorMessage); int DHCP_OpenDRIM_DHCPServer_unload(string& errorMessage); int DHCP_OpenDRIM_DHCPServer_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCPServer_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_DHCPServer& instance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCPServer_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPServer& newInstance, const OpenDRIM_DHCPServer& oldInstance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCPServer_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPServer& instance, string& errorMessage); int DHCP_OpenDRIM_DHCPServer_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPServer& instance, string& errorMessage); int DHCP_OpenDRIM_DHCPServer_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPServer& instance, unsigned int& returnValue, const OpenDRIM_DHCPServer_RequestStateChange_In& in, OpenDRIM_DHCPServer_RequestStateChange_Out& out, string& errorMessage); int DHCP_OpenDRIM_DHCPServer_populate(OpenDRIM_DHCPServer& instance, string& errorMessage); #endif /*OPENDRIM_DHCPSERVERACCESS_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/NEWS0000644000175000017500000000017511400673053017161 0ustar guillaumeguillaumeInitial Release 1.0.0 ========================= // TODO Changes in Major.Minor.Revision ========================= // TODO opendrim-lmp-dhcp-1.0.0~ppa/LICENSE0000644000175000017500000000300511400673053017462 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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-dhcp-1.0.0~ppa/README0000644000175000017500000000103311400673053017334 0ustar guillaumeguillaume--------------------------------------------------------- REQUIREMENTS --------------------------------------------------------- For compliling: * gcc >= 3.2.0 * cmpi header files >= ver 86 * autoconf >= 2.57 * automake >= 1.5 * libtool (preferably >= 1.8.5) * OpenDRIM Common Library >= 1.1.2 For running: * OpenPegasus >= 2.5.2 OR SBLIM sfcb >= 1.2.0 OR OpenWBEM >= 3.2.2 * Interop package (for sfcb and OpenPegasus only) * In the case of pegasus installed from sources, the PEGASUS_HOME and PEGASUS_ROOT variable MUST be defined! opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPProtocolEndpoint/0000755000175000017500000000000011400673053024055 5ustar guillaumeguillaumeopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPProtocolEndpoint/Makefile.am0000644000175000017500000000412111400673053026107 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 = libcmpiDHCP_OpenDRIM_DHCPProtocolEndpointProvider.la libcmpiDHCP_OpenDRIM_DHCPProtocolEndpointProvider_la_SOURCES = OpenDRIM_DHCPProtocolEndpointAccess.cpp OpenDRIM_DHCPProtocolEndpointProvider.cpp cmpiOpenDRIM_DHCPProtocolEndpoint.cpp libcmpiDHCP_OpenDRIM_DHCPProtocolEndpointProvider_la_LIBADD = ../Common/libcmpiDHCP_Common.la libcmpiDHCP_OpenDRIM_DHCPProtocolEndpointProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_DHCPProtocolEndpoint.h OpenDRIM_DHCPProtocolEndpoint.h OpenDRIM_DHCPProtocolEndpointAccess.h opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPProtocolEndpoint/OpenDRIM_DHCPProtocolEndpointAccess.h0000644000175000017500000000646611400673053032762 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPPROTOCOLENDPOINTACCESS_H_ #define OPENDRIM_DHCPPROTOCOLENDPOINTACCESS_H_ #include "DHCP_Common.h" #include "OpenDRIM_DHCPProtocolEndpoint.h" int DHCP_OpenDRIM_DHCPProtocolEndpoint_load(const CMPIBroker* broker, string& errorMessage); int DHCP_OpenDRIM_DHCPProtocolEndpoint_unload(string& errorMessage); int DHCP_OpenDRIM_DHCPProtocolEndpoint_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCPProtocolEndpoint_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_DHCPProtocolEndpoint& instance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCPProtocolEndpoint_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPProtocolEndpoint& newInstance, const OpenDRIM_DHCPProtocolEndpoint& oldInstance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCPProtocolEndpoint_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPProtocolEndpoint& instance, string& errorMessage); int DHCP_OpenDRIM_DHCPProtocolEndpoint_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPProtocolEndpoint& instance, string& errorMessage); int DHCP_OpenDRIM_DHCPProtocolEndpoint_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPProtocolEndpoint& instance, unsigned int& returnValue, const OpenDRIM_DHCPProtocolEndpoint_RequestStateChange_In& in, OpenDRIM_DHCPProtocolEndpoint_RequestStateChange_Out& out, string& errorMessage); int DHCP_OpenDRIM_DHCPProtocolEndpoint_populate(OpenDRIM_DHCPProtocolEndpoint& instance, string& errorMessage); #endif /*OPENDRIM_DHCPPROTOCOLENDPOINTACCESS_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPProtocolEndpoint/OpenDRIM_DHCPProtocolEndpointAccess.cpp0000644000175000017500000001322111400673053033300 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPProtocolEndpointAccess.h" string systemName; string Name; const string systemCreationClassName = "OpenDRIM_ComputerSystem"; const string creationClassName = "OpenDRIM_DHCPProtocolEndpoint"; int DHCP_OpenDRIM_DHCPProtocolEndpoint_load(const CMPIBroker* broker, string& errorMessage) { _E_; CF_assert(CF_getSystemName(systemName, errorMessage)); Name="dhclient"; _L_; return OK; } int DHCP_OpenDRIM_DHCPProtocolEndpoint_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int DHCP_OpenDRIM_DHCPProtocolEndpoint_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; OpenDRIM_DHCPProtocolEndpoint instance; if(!CF_isExist("/sbin/dhclient")) return OK; instance.setName(Name); instance.setSystemCreationClassName(systemCreationClassName); instance.setSystemName(systemName); instance.setCreationClassName(creationClassName); if (discriminant == "ei") CF_assert(DHCP_OpenDRIM_DHCPProtocolEndpoint_populate(instance, errorMessage)); result.push_back(instance); _L_; return OK; } int DHCP_OpenDRIM_DHCPProtocolEndpoint_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_DHCPProtocolEndpoint& instance, const char** properties, string& errorMessage) { _E_; if (instance.SystemCreationClassName != systemCreationClassName || instance.SystemName != systemName || instance.CreationClassName != creationClassName || instance.Name != Name) { errorMessage = "Invalid path"; return NOT_FOUND; } CF_assert(DHCP_OpenDRIM_DHCPProtocolEndpoint_populate(instance, errorMessage)); _L_; return OK; } int DHCP_OpenDRIM_DHCPProtocolEndpoint_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPProtocolEndpoint& newInstance, const OpenDRIM_DHCPProtocolEndpoint& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPProtocolEndpoint_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPProtocolEndpoint& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPProtocolEndpoint_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPProtocolEndpoint& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPProtocolEndpoint_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCPProtocolEndpoint& instance, unsigned int& returnValue, const OpenDRIM_DHCPProtocolEndpoint_RequestStateChange_In& in, OpenDRIM_DHCPProtocolEndpoint_RequestStateChange_Out& out, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCPProtocolEndpoint_populate(OpenDRIM_DHCPProtocolEndpoint& instance, string& errorMessage) { _E_; /* Properties to fill from profile * Mandatory: * [X] SystemCreationClassName [KEY] * [X] CreationClassName [KEY] * [X] SystemName [KEY] * [X] Name [KEY] * [X] NameFormat * [X] ProtocolIFType * [X] OtherTypeDescription * [X] RequestedState => left to default value * [X] EnabledState => left to default value * [X] ClientState * [X] ElementName */ string elementName; string dhcpVersion; instance.setNameFormat("DHCP-client-name"); instance.setProtocolIFType(1); // Other (required by the profile) instance.setOtherTypeDescription("DHCP"); instance.setRequestedState(12); instance.setEnabledState(5); instance.setClientState(0); CF_getWhatisFL("dhclient",elementName,errorMessage); CF_runCommandFL("dhclient --version 2>&1",dhcpVersion,errorMessage); if(elementName.empty()) elementName="DHCP client"; if(!dhcpVersion.empty()) elementName+=" ("+dhcpVersion+")"; instance.setElementName(elementName); string filepath; string modifiedTime; int errorCode=get_dhcp_lease_path(filepath,errorMessage); if(errorCode!=OK) return ERROR; CF_assert(CF_lastModified(filepath, modifiedTime, errorMessage)); instance.setTimeOfLastStateChange(modifiedTime); _L_; return OK; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPProtocolEndpoint/cmpiOpenDRIM_DHCPProtocolEndpoint.h0000644000175000017500000000505511400673053032502 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPPROTOCOLENDPOINT_H_ #define CMPIOPENDRIM_DHCPPROTOCOLENDPOINT_H_ #include "OpenDRIM_DHCPProtocolEndpoint.h" CMPIObjectPath* DHCP_OpenDRIM_DHCPProtocolEndpoint_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_DHCPProtocolEndpoint& instance); CMPIInstance* DHCP_OpenDRIM_DHCPProtocolEndpoint_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_DHCPProtocolEndpoint& instance); void DHCP_OpenDRIM_DHCPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_DHCPProtocolEndpoint& instance); void DHCP_OpenDRIM_DHCPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_DHCPProtocolEndpoint& instance); void DHCP_OpenDRIM_DHCPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_DHCPProtocolEndpoint_RequestStateChange_In& args); void DHCP_OpenDRIM_DHCPProtocolEndpoint_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_DHCPProtocolEndpoint_RequestStateChange_Out& args); #endif /*CMPIOPENDRIM_DHCPPROTOCOLENDPOINT_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPProtocolEndpoint/OpenDRIM_DHCPProtocolEndpointProvider.cpp0000644000175000017500000003330311400673053033674 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPProtocolEndpoint.h" #include "OpenDRIM_DHCPProtocolEndpointAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define DHCP_OpenDRIM_DHCPProtocolEndpointProviderSetInstance DHCP_OpenDRIM_DHCPProtocolEndpointProviderModifyInstance #endif int DHCP_OpenDRIM_DHCPProtocolEndpoint_init(const CMPIBroker* broker); int DHCP_OpenDRIM_DHCPProtocolEndpoint_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus DHCP_OpenDRIM_DHCPProtocolEndpointProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = DHCP_OpenDRIM_DHCPProtocolEndpoint_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPProtocolEndpointProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPProtocolEndpoint_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = DHCP_OpenDRIM_DHCPProtocolEndpoint_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPProtocolEndpointProviderEnumInstances(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 = DHCP_OpenDRIM_DHCPProtocolEndpoint_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = DHCP_OpenDRIM_DHCPProtocolEndpoint_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPProtocolEndpointProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPProtocolEndpoint instance; DHCP_OpenDRIM_DHCPProtocolEndpoint_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPProtocolEndpoint_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = DHCP_OpenDRIM_DHCPProtocolEndpoint_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPProtocolEndpointProviderSetInstance(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_DHCPProtocolEndpoint newInstance, oldInstance; DHCP_OpenDRIM_DHCPProtocolEndpoint_toCPP(_broker, ci, newInstance); DHCP_OpenDRIM_DHCPProtocolEndpoint_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPProtocolEndpoint_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPProtocolEndpoint_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPProtocolEndpointProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPProtocolEndpoint instance; DHCP_OpenDRIM_DHCPProtocolEndpoint_toCPP(_broker, ci, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPProtocolEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_DHCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPProtocolEndpoint_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPProtocolEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = DHCP_OpenDRIM_DHCPProtocolEndpoint_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPProtocolEndpointProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCPProtocolEndpoint instance; DHCP_OpenDRIM_DHCPProtocolEndpoint_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPProtocolEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCPProtocolEndpoint_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPProtocolEndpointProviderExecQuery(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 DHCP_OpenDRIM_DHCPProtocolEndpointProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = DHCP_OpenDRIM_DHCPProtocolEndpoint_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCPProtocolEndpointProviderInvokeMethod(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_DHCPProtocolEndpoint instance; DHCP_OpenDRIM_DHCPProtocolEndpoint_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"SystemCreationClassName", "Name", "SystemName", "CreationClassName"}; int errorCode = DHCP_OpenDRIM_DHCPProtocolEndpoint_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_DHCPProtocolEndpoint_RequestStateChange_In inArgs; DHCP_OpenDRIM_DHCPProtocolEndpoint_toCPP(_broker, in, inArgs); OpenDRIM_DHCPProtocolEndpoint_RequestStateChange_Out outArgs; errorCode = DHCP_OpenDRIM_DHCPProtocolEndpoint_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } DHCP_OpenDRIM_DHCPProtocolEndpoint_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else { errorMessage = (string) OpenDRIM_DHCPProtocolEndpoint_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 DHCP_OpenDRIM_DHCPProtocolEndpoint_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPProtocolEndpoint_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_DHCPProtocolEndpoint_init FAILED: " + (string) OpenDRIM_DHCPProtocolEndpoint_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int DHCP_OpenDRIM_DHCPProtocolEndpoint_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCPProtocolEndpoint_unload(errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_DHCPProtocolEndpoint_unload FAILED: " + (string) OpenDRIM_DHCPProtocolEndpoint_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define DHCP_OpenDRIM_DHCPProtocolEndpoint_INIT if (DHCP_OpenDRIM_DHCPProtocolEndpoint_init(_broker) < 0) return NULL CMInstanceMIStub(DHCP_OpenDRIM_DHCPProtocolEndpointProvider, DHCP_OpenDRIM_DHCPProtocolEndpointProvider, _broker, DHCP_OpenDRIM_DHCPProtocolEndpoint_INIT); CMMethodMIStub(DHCP_OpenDRIM_DHCPProtocolEndpointProvider, DHCP_OpenDRIM_DHCPProtocolEndpointProvider, _broker, DHCP_OpenDRIM_DHCPProtocolEndpoint_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPProtocolEndpoint/cmpiOpenDRIM_DHCPProtocolEndpoint.cpp0000644000175000017500000002647611400673053033047 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPProtocolEndpoint.h" CMPIObjectPath* DHCP_OpenDRIM_DHCPProtocolEndpoint_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_DHCPProtocolEndpoint& instance) { _E_; Objectpath op(broker, OpenDRIM_DHCPProtocolEndpoint_classnames[0], OpenDRIM_DHCPProtocolEndpoint_NAMESPACE); if (!instance.SystemCreationClassName_isNULL) op.addKey("SystemCreationClassName", instance.SystemCreationClassName); if (!instance.SystemName_isNULL) op.addKey("SystemName", instance.SystemName); if (!instance.CreationClassName_isNULL) op.addKey("CreationClassName", instance.CreationClassName); if (!instance.Name_isNULL) op.addKey("Name", instance.Name); _L_; return op.getHdl(); } CMPIInstance* DHCP_OpenDRIM_DHCPProtocolEndpoint_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_DHCPProtocolEndpoint& instance) { _E_; Objectpath op(broker, DHCP_OpenDRIM_DHCPProtocolEndpoint_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.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.InstallDate_isNULL) ci.setPropertyDatetime("InstallDate", instance.InstallDate); if (!instance.StatusDescriptions_isNULL) ci.setProperty("StatusDescriptions", instance.StatusDescriptions); if (!instance.Status_isNULL) ci.setProperty("Status", instance.Status); if (!instance.HealthState_isNULL) ci.setProperty("HealthState", instance.HealthState); if (!instance.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.OtherEnabledState_isNULL) ci.setProperty("OtherEnabledState", instance.OtherEnabledState); if (!instance.RequestedState_isNULL) ci.setProperty("RequestedState", instance.RequestedState); if (!instance.EnabledDefault_isNULL) ci.setProperty("EnabledDefault", instance.EnabledDefault); if (!instance.AvailableRequestedStates_isNULL) ci.setProperty("AvailableRequestedStates", instance.AvailableRequestedStates); if (!instance.TransitioningToState_isNULL) ci.setProperty("TransitioningToState", instance.TransitioningToState); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.OperationalStatus_isNULL) ci.setProperty("OperationalStatus", instance.OperationalStatus); if (!instance.EnabledState_isNULL) ci.setProperty("EnabledState", instance.EnabledState); if (!instance.TimeOfLastStateChange_isNULL) ci.setPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange); if (!instance.NameFormat_isNULL) ci.setProperty("NameFormat", instance.NameFormat); if (!instance.ProtocolType_isNULL) ci.setProperty("ProtocolType", instance.ProtocolType); if (!instance.ProtocolIFType_isNULL) ci.setProperty("ProtocolIFType", instance.ProtocolIFType); if (!instance.OtherTypeDescription_isNULL) ci.setProperty("OtherTypeDescription", instance.OtherTypeDescription); if (!instance.ClientState_isNULL) ci.setProperty("ClientState", instance.ClientState); if (!instance.RenewalTime_isNULL) ci.setProperty("RenewalTime", instance.RenewalTime); if (!instance.RebindingTime_isNULL) ci.setProperty("RebindingTime", instance.RebindingTime); if (!instance.LeaseTime_isNULL) ci.setProperty("LeaseTime", instance.LeaseTime); if (!instance.LeaseObtained_isNULL) ci.setPropertyDatetime("LeaseObtained", instance.LeaseObtained); if (!instance.LeaseExpires_isNULL) ci.setPropertyDatetime("LeaseExpires", instance.LeaseExpires); if (!instance.OptionsReceived_isNULL) ci.setProperty("OptionsReceived", instance.OptionsReceived); _L_; return ci.getHdl(); } void DHCP_OpenDRIM_DHCPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_DHCPProtocolEndpoint& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (op.getKey("Name", instance.Name) == OK) instance.Name_isNULL = false; if (op.getKey("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (op.getKey("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; _L_; } void DHCP_OpenDRIM_DHCPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_DHCPProtocolEndpoint& 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("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getPropertyDatetime("InstallDate", instance.InstallDate) == OK) instance.InstallDate_isNULL = false; if (inst.getProperty("StatusDescriptions", instance.StatusDescriptions) == OK) instance.StatusDescriptions_isNULL = false; if (inst.getProperty("Status", instance.Status) == OK) instance.Status_isNULL = false; if (inst.getProperty("HealthState", instance.HealthState) == OK) instance.HealthState_isNULL = false; if (inst.getProperty("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("OtherEnabledState", instance.OtherEnabledState) == OK) instance.OtherEnabledState_isNULL = false; if (inst.getProperty("RequestedState", instance.RequestedState) == OK) instance.RequestedState_isNULL = false; if (inst.getProperty("EnabledDefault", instance.EnabledDefault) == OK) instance.EnabledDefault_isNULL = false; if (inst.getProperty("AvailableRequestedStates", instance.AvailableRequestedStates) == OK) instance.AvailableRequestedStates_isNULL = false; if (inst.getProperty("TransitioningToState", instance.TransitioningToState) == OK) instance.TransitioningToState_isNULL = false; if (inst.getProperty("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (inst.getProperty("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (inst.getProperty("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; if (inst.getProperty("Name", instance.Name) == OK) instance.Name_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("OperationalStatus", instance.OperationalStatus) == OK) instance.OperationalStatus_isNULL = false; if (inst.getProperty("EnabledState", instance.EnabledState) == OK) instance.EnabledState_isNULL = false; if (inst.getPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange) == OK) instance.TimeOfLastStateChange_isNULL = false; if (inst.getProperty("NameFormat", instance.NameFormat) == OK) instance.NameFormat_isNULL = false; if (inst.getProperty("ProtocolType", instance.ProtocolType) == OK) instance.ProtocolType_isNULL = false; if (inst.getProperty("ProtocolIFType", instance.ProtocolIFType) == OK) instance.ProtocolIFType_isNULL = false; if (inst.getProperty("OtherTypeDescription", instance.OtherTypeDescription) == OK) instance.OtherTypeDescription_isNULL = false; if (inst.getProperty("ClientState", instance.ClientState) == OK) instance.ClientState_isNULL = false; if (inst.getProperty("RenewalTime", instance.RenewalTime) == OK) instance.RenewalTime_isNULL = false; if (inst.getProperty("RebindingTime", instance.RebindingTime) == OK) instance.RebindingTime_isNULL = false; if (inst.getProperty("LeaseTime", instance.LeaseTime) == OK) instance.LeaseTime_isNULL = false; if (inst.getPropertyDatetime("LeaseObtained", instance.LeaseObtained) == OK) instance.LeaseObtained_isNULL = false; if (inst.getPropertyDatetime("LeaseExpires", instance.LeaseExpires) == OK) instance.LeaseExpires_isNULL = false; if (inst.getProperty("OptionsReceived", instance.OptionsReceived) == OK) instance.OptionsReceived_isNULL = false; _L_; } void DHCP_OpenDRIM_DHCPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_DHCPProtocolEndpoint_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 DHCP_OpenDRIM_DHCPProtocolEndpoint_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_DHCPProtocolEndpoint_RequestStateChange_Out& args) { _E_; CMPIValue value; int errorMessage; Objectpath Job; errorMessage = args.getJob(Job); if (errorMessage == OK) { value = CT_toCMPI(Job); out->ft->addArg(out, "Job", &value, CMPI_ref); } _L_; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCPProtocolEndpoint/OpenDRIM_DHCPProtocolEndpoint.h0000644000175000017500000004116311400673053031631 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCPPROTOCOLENDPOINT_H_ #define OPENDRIM_DHCPPROTOCOLENDPOINT_H_ #include const static char* OpenDRIM_DHCPProtocolEndpoint_classnames[] = {"OpenDRIM_DHCPProtocolEndpoint"}; static string OpenDRIM_DHCPProtocolEndpoint_NAMESPACE = _NAMESPACE; class OpenDRIM_DHCPProtocolEndpoint { public: string InstanceID; bool InstanceID_isNULL; string Caption; bool Caption_isNULL; string ElementName; bool ElementName_isNULL; string InstallDate; bool InstallDate_isNULL; vector StatusDescriptions; bool StatusDescriptions_isNULL; string Status; bool Status_isNULL; unsigned short HealthState; bool HealthState_isNULL; unsigned short CommunicationStatus; bool CommunicationStatus_isNULL; unsigned short DetailedStatus; bool DetailedStatus_isNULL; unsigned short OperatingStatus; bool OperatingStatus_isNULL; unsigned short PrimaryStatus; bool PrimaryStatus_isNULL; string OtherEnabledState; bool OtherEnabledState_isNULL; unsigned short RequestedState; bool RequestedState_isNULL; unsigned short EnabledDefault; bool EnabledDefault_isNULL; vector AvailableRequestedStates; bool AvailableRequestedStates_isNULL; unsigned short TransitioningToState; bool TransitioningToState_isNULL; string SystemCreationClassName; bool SystemCreationClassName_isNULL; string SystemName; bool SystemName_isNULL; string CreationClassName; bool CreationClassName_isNULL; string Name; bool Name_isNULL; string Description; bool Description_isNULL; vector OperationalStatus; bool OperationalStatus_isNULL; unsigned short EnabledState; bool EnabledState_isNULL; string TimeOfLastStateChange; bool TimeOfLastStateChange_isNULL; string NameFormat; bool NameFormat_isNULL; unsigned short ProtocolType; bool ProtocolType_isNULL; unsigned short ProtocolIFType; bool ProtocolIFType_isNULL; string OtherTypeDescription; bool OtherTypeDescription_isNULL; unsigned short ClientState; bool ClientState_isNULL; unsigned int RenewalTime; bool RenewalTime_isNULL; unsigned int RebindingTime; bool RebindingTime_isNULL; unsigned int LeaseTime; bool LeaseTime_isNULL; string LeaseObtained; bool LeaseObtained_isNULL; string LeaseExpires; bool LeaseExpires_isNULL; vector OptionsReceived; bool OptionsReceived_isNULL; OpenDRIM_DHCPProtocolEndpoint() { InstanceID_isNULL = true; Caption_isNULL = true; ElementName_isNULL = true; InstallDate_isNULL = true; StatusDescriptions_isNULL = true; Status_isNULL = true; HealthState_isNULL = true; CommunicationStatus_isNULL = true; DetailedStatus_isNULL = true; OperatingStatus_isNULL = true; PrimaryStatus_isNULL = true; OtherEnabledState_isNULL = true; RequestedState_isNULL = true; EnabledDefault_isNULL = true; AvailableRequestedStates_isNULL = true; TransitioningToState_isNULL = true; SystemCreationClassName_isNULL = true; SystemName_isNULL = true; CreationClassName_isNULL = true; Name_isNULL = true; Description_isNULL = true; OperationalStatus_isNULL = true; EnabledState_isNULL = true; TimeOfLastStateChange_isNULL = true; NameFormat_isNULL = true; ProtocolType_isNULL = true; ProtocolIFType_isNULL = true; OtherTypeDescription_isNULL = true; ClientState_isNULL = true; RenewalTime_isNULL = true; RebindingTime_isNULL = true; LeaseTime_isNULL = true; LeaseObtained_isNULL = true; LeaseExpires_isNULL = true; OptionsReceived_isNULL = true; } ~OpenDRIM_DHCPProtocolEndpoint() {} string getKeys() const { return CF_toLowCase(".SystemCreationClassName=\"" + CF_quoteString(SystemCreationClassName) + "\""".SystemName=\"" + CF_quoteString(SystemName) + "\""".CreationClassName=\"" + CF_quoteString(CreationClassName) + "\""".Name=\"" + CF_quoteString(Name) + "\""); } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getInstallDate(string& value) const { if (InstallDate_isNULL==true) return NOT_FOUND; value = InstallDate; return OK; } int setInstallDate(const string& newValue) { InstallDate = newValue; InstallDate_isNULL = false; return OK; } int getStatusDescriptions(vector& value) const { if (StatusDescriptions_isNULL==true) return NOT_FOUND; value = StatusDescriptions; return OK; } int setStatusDescriptions(const vector& newValue) { StatusDescriptions = newValue; StatusDescriptions_isNULL = false; return OK; } int getStatus(string& value) const { if (Status_isNULL==true) return NOT_FOUND; value = Status; return OK; } int setStatus(const string& newValue) { Status = newValue; Status_isNULL = false; return OK; } int getHealthState(unsigned short& value) const { if (HealthState_isNULL==true) return NOT_FOUND; value = HealthState; return OK; } int setHealthState(const unsigned short& newValue) { HealthState = newValue; HealthState_isNULL = false; return OK; } int 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 getOtherEnabledState(string& value) const { if (OtherEnabledState_isNULL==true) return NOT_FOUND; value = OtherEnabledState; return OK; } int setOtherEnabledState(const string& newValue) { OtherEnabledState = newValue; OtherEnabledState_isNULL = false; return OK; } int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL==true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getEnabledDefault(unsigned short& value) const { if (EnabledDefault_isNULL==true) return NOT_FOUND; value = EnabledDefault; return OK; } int setEnabledDefault(const unsigned short& newValue) { EnabledDefault = newValue; EnabledDefault_isNULL = false; return OK; } int getAvailableRequestedStates(vector& value) const { if (AvailableRequestedStates_isNULL==true) return NOT_FOUND; value = AvailableRequestedStates; return OK; } int setAvailableRequestedStates(const vector& newValue) { AvailableRequestedStates = newValue; AvailableRequestedStates_isNULL = false; return OK; } int getTransitioningToState(unsigned short& value) const { if (TransitioningToState_isNULL==true) return NOT_FOUND; value = TransitioningToState; return OK; } int setTransitioningToState(const unsigned short& newValue) { TransitioningToState = newValue; TransitioningToState_isNULL = false; return OK; } int getSystemCreationClassName(string& value) const { if (SystemCreationClassName_isNULL==true) return NOT_FOUND; value = SystemCreationClassName; return OK; } int setSystemCreationClassName(const string& newValue) { SystemCreationClassName = newValue; SystemCreationClassName_isNULL = false; return OK; } int getSystemName(string& value) const { if (SystemName_isNULL==true) return NOT_FOUND; value = SystemName; return OK; } int setSystemName(const string& newValue) { SystemName = newValue; SystemName_isNULL = false; return OK; } int getCreationClassName(string& value) const { if (CreationClassName_isNULL==true) return NOT_FOUND; value = CreationClassName; return OK; } int setCreationClassName(const string& newValue) { CreationClassName = newValue; CreationClassName_isNULL = false; return OK; } int getName(string& value) const { if (Name_isNULL==true) return NOT_FOUND; value = Name; return OK; } int setName(const string& newValue) { Name = newValue; Name_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getOperationalStatus(vector& value) const { if (OperationalStatus_isNULL==true) return NOT_FOUND; value = OperationalStatus; return OK; } int setOperationalStatus(const vector& newValue) { OperationalStatus = newValue; OperationalStatus_isNULL = false; return OK; } int getEnabledState(unsigned short& value) const { if (EnabledState_isNULL==true) return NOT_FOUND; value = EnabledState; return OK; } int setEnabledState(const unsigned short& newValue) { EnabledState = newValue; EnabledState_isNULL = false; return OK; } int getTimeOfLastStateChange(string& value) const { if (TimeOfLastStateChange_isNULL==true) return NOT_FOUND; value = TimeOfLastStateChange; return OK; } int setTimeOfLastStateChange(const string& newValue) { TimeOfLastStateChange = newValue; TimeOfLastStateChange_isNULL = false; return OK; } int getNameFormat(string& value) const { if (NameFormat_isNULL==true) return NOT_FOUND; value = NameFormat; return OK; } int setNameFormat(const string& newValue) { NameFormat = newValue; NameFormat_isNULL = false; return OK; } int getProtocolType(unsigned short& value) const { if (ProtocolType_isNULL==true) return NOT_FOUND; value = ProtocolType; return OK; } int setProtocolType(const unsigned short& newValue) { ProtocolType = newValue; ProtocolType_isNULL = false; return OK; } int getProtocolIFType(unsigned short& value) const { if (ProtocolIFType_isNULL==true) return NOT_FOUND; value = ProtocolIFType; return OK; } int setProtocolIFType(const unsigned short& newValue) { ProtocolIFType = newValue; ProtocolIFType_isNULL = false; return OK; } int getOtherTypeDescription(string& value) const { if (OtherTypeDescription_isNULL==true) return NOT_FOUND; value = OtherTypeDescription; return OK; } int setOtherTypeDescription(const string& newValue) { OtherTypeDescription = newValue; OtherTypeDescription_isNULL = false; return OK; } int getClientState(unsigned short& value) const { if (ClientState_isNULL==true) return NOT_FOUND; value = ClientState; return OK; } int setClientState(const unsigned short& newValue) { ClientState = newValue; ClientState_isNULL = false; return OK; } int getRenewalTime(unsigned int& value) const { if (RenewalTime_isNULL==true) return NOT_FOUND; value = RenewalTime; return OK; } int setRenewalTime(const unsigned int& newValue) { RenewalTime = newValue; RenewalTime_isNULL = false; return OK; } int getRebindingTime(unsigned int& value) const { if (RebindingTime_isNULL==true) return NOT_FOUND; value = RebindingTime; return OK; } int setRebindingTime(const unsigned int& newValue) { RebindingTime = newValue; RebindingTime_isNULL = false; return OK; } int getLeaseTime(unsigned int& value) const { if (LeaseTime_isNULL==true) return NOT_FOUND; value = LeaseTime; return OK; } int setLeaseTime(const unsigned int& newValue) { LeaseTime = newValue; LeaseTime_isNULL = false; return OK; } int getLeaseObtained(string& value) const { if (LeaseObtained_isNULL==true) return NOT_FOUND; value = LeaseObtained; return OK; } int setLeaseObtained(const string& newValue) { LeaseObtained = newValue; LeaseObtained_isNULL = false; return OK; } int getLeaseExpires(string& value) const { if (LeaseExpires_isNULL==true) return NOT_FOUND; value = LeaseExpires; return OK; } int setLeaseExpires(const string& newValue) { LeaseExpires = newValue; LeaseExpires_isNULL = false; return OK; } int getOptionsReceived(vector& value) const { if (OptionsReceived_isNULL==true) return NOT_FOUND; value = OptionsReceived; return OK; } int setOptionsReceived(const vector& newValue) { OptionsReceived = newValue; OptionsReceived_isNULL = false; return OK; } }; class OpenDRIM_DHCPProtocolEndpoint_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_DHCPProtocolEndpoint_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_DHCPProtocolEndpoint_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_DHCPProtocolEndpoint_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_DHCPProtocolEndpoint_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_DHCPProtocolEndpoint_RequestStateChange_Out() {} int getJob(Objectpath& value) const { if (Job_isNULL == true) return NOT_FOUND; value = Job; return OK; } int setJob(const Objectpath& newValue) { Job = newValue; Job_isNULL = false; return OK; } }; #endif /*OPENDRIM_DHCPPROTOCOLENDPOINT_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2ComputerSystem/0000755000175000017500000000000011400673053023640 5ustar guillaumeguillaumeopendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2ComputerSystem/OpenDRIM_DHCP2ComputerSystemAccess.h0000644000175000017500000001041011400673053032310 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2COMPUTERSYSTEMACCESS_H_ #define OPENDRIM_DHCP2COMPUTERSYSTEMACCESS_H_ #include "DHCP_Common.h" #include "OpenDRIM_DHCP2ComputerSystem.h" #include "assocOpenDRIM_DHCP2ComputerSystem.h" int DHCP_OpenDRIM_DHCP2ComputerSystem_load(const CMPIBroker* broker, string& errorMessage); int DHCP_OpenDRIM_DHCP2ComputerSystem_unload(string& errorMessage); int DHCP_OpenDRIM_DHCP2ComputerSystem_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCP2ComputerSystem_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_DHCP2ComputerSystem& instance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCP2ComputerSystem_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCP2ComputerSystem& newInstance, const OpenDRIM_DHCP2ComputerSystem& oldInstance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCP2ComputerSystem_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCP2ComputerSystem& instance, string& errorMessage); int DHCP_OpenDRIM_DHCP2ComputerSystem_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCP2ComputerSystem& instance, string& errorMessage); int DHCP_OpenDRIM_DHCP2ComputerSystem_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCP2ComputerSystem_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCP2ComputerSystem_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_DHCP2ComputerSystem_instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCP2ComputerSystem_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_DHCP2ComputerSystem_instances, const char** properties, string& errorMessage, const string& discriminant); int DHCP_OpenDRIM_DHCP2ComputerSystem_populate(OpenDRIM_DHCP2ComputerSystem& instance, string& errorMessage); #endif /*OPENDRIM_DHCP2COMPUTERSYSTEMACCESS_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2ComputerSystem/Makefile.am0000644000175000017500000000470511400673053025702 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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 = libcmpiDHCP_OpenDRIM_DHCP2ComputerSystemProvider.la libcmpiDHCP_OpenDRIM_DHCP2ComputerSystemProvider_la_SOURCES = OpenDRIM_DHCP2ComputerSystemAccess.cpp OpenDRIM_DHCP2ComputerSystemProvider.cpp cmpiOpenDRIM_DHCP2ComputerSystem.cpp assocOpenDRIM_DHCP2ComputerSystem.cpp # May have to be adjusted for direct invocation libcmpiDHCP_OpenDRIM_DHCP2ComputerSystemProvider_la_CPPFLAGS = -I../CIM_System -I../CIM_ServiceAccessPoint # Uncomment the end for direct invocation, may have to be adjusted libcmpiDHCP_OpenDRIM_DHCP2ComputerSystemProvider_la_LIBADD = ../Common/libcmpiDHCP_Common.la #../CIM_System/libcmpiDHCP_CIM_SystemProvider.la ../CIM_ServiceAccessPoint/libcmpiDHCP_CIM_ServiceAccessPointProvider.la libcmpiDHCP_OpenDRIM_DHCP2ComputerSystemProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_DHCP2ComputerSystem.h OpenDRIM_DHCP2ComputerSystem.h OpenDRIM_DHCP2ComputerSystemAccess.h opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2ComputerSystem/assocOpenDRIM_DHCP2ComputerSystem.h0000644000175000017500000000620711400673053032230 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2COMPUTERSYSTEM_H_ #define ASSOCOPENDRIM_DHCP2COMPUTERSYSTEM_H_ #include "OpenDRIM_DHCP2ComputerSystemAccess.h" int DHCP_OpenDRIM_DHCP2ComputerSystem_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 DHCP_OpenDRIM_DHCP2ComputerSystem_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 DHCP_OpenDRIM_DHCP2ComputerSystem_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int DHCP_OpenDRIM_DHCP2ComputerSystem_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int DHCP_OpenDRIM_DHCP2ComputerSystem_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int DHCP_OpenDRIM_DHCP2ComputerSystem_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_DHCP2COMPUTERSYSTEM_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2ComputerSystem/assocOpenDRIM_DHCP2ComputerSystem.cpp0000644000175000017500000002065411400673053032565 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2ComputerSystem.h" int DHCP_OpenDRIM_DHCP2ComputerSystem_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 = DHCP_OpenDRIM_DHCP2ComputerSystem_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(DHCP_OpenDRIM_DHCP2ComputerSystem_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(DHCP_OpenDRIM_DHCP2ComputerSystem_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int DHCP_OpenDRIM_DHCP2ComputerSystem_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(DHCP_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(DHCP_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, DHCP_CIM_System_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int DHCP_OpenDRIM_DHCP2ComputerSystem_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; DHCP_CIM_System_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(DHCP_CIM_System_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, DHCP_CIM_System_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int DHCP_OpenDRIM_DHCP2ComputerSystem_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(DHCP_CIM_ServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(DHCP_CIM_ServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, DHCP_CIM_ServiceAccessPoint_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int DHCP_OpenDRIM_DHCP2ComputerSystem_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Dependent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Dependent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_ServiceAccessPoint _instance; DHCP_CIM_ServiceAccessPoint_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(DHCP_CIM_ServiceAccessPoint_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, DHCP_CIM_ServiceAccessPoint_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2ComputerSystem/OpenDRIM_DHCP2ComputerSystemAccess.cpp0000644000175000017500000002407011400673053032652 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2ComputerSystemAccess.h" int DHCP_OpenDRIM_DHCP2ComputerSystem_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(DHCP_CIM_System_load(broker, errorMessage)); CF_assert(DHCP_CIM_ServiceAccessPoint_load(broker, errorMessage)); */ // TODO _L_; return OK; } int DHCP_OpenDRIM_DHCP2ComputerSystem_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(DHCP_CIM_System_unload(errorMessage)); CF_assert(DHCP_CIM_ServiceAccessPoint_unload(errorMessage)); */ // TODO _L_; return OK; } int DHCP_OpenDRIM_DHCP2ComputerSystem_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 DHCP_OpenDRIM_DHCP2ComputerSystem_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(DHCP_OpenDRIM_DHCP2ComputerSystem_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(DHCP_OpenDRIM_DHCP2ComputerSystem_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; DHCP_OpenDRIM_DHCP2ComputerSystem_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(DHCP_OpenDRIM_DHCP2ComputerSystem_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int DHCP_OpenDRIM_DHCP2ComputerSystem_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_DHCP2ComputerSystem& 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(DHCP_OpenDRIM_DHCP2ComputerSystem_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(DHCP_OpenDRIM_DHCP2ComputerSystem_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(DHCP_OpenDRIM_DHCP2ComputerSystem_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int DHCP_OpenDRIM_DHCP2ComputerSystem_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCP2ComputerSystem& newInstance, const OpenDRIM_DHCP2ComputerSystem& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCP2ComputerSystem_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCP2ComputerSystem& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCP2ComputerSystem_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_DHCP2ComputerSystem& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int DHCP_OpenDRIM_DHCP2ComputerSystem_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(DHCP_OpenDRIM_DHCP2ComputerSystem_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(DHCP_OpenDRIM_DHCP2ComputerSystem_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(DHCP_OpenDRIM_DHCP2ComputerSystem_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(DHCP_OpenDRIM_DHCP2ComputerSystem_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(DHCP_OpenDRIM_DHCP2ComputerSystem_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(DHCP_OpenDRIM_DHCP2ComputerSystem_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_DHCP2ComputerSystem_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_DHCP2ComputerSystem instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); OpenDRIM_DHCP2ComputerSystem_instances.push_back(instance); } _L_; return OK; } int DHCP_OpenDRIM_DHCP2ComputerSystem_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_DHCP2ComputerSystem_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_DHCP2ComputerSystem instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); OpenDRIM_DHCP2ComputerSystem_instances.push_back(instance); } _L_; return OK; } int DHCP_OpenDRIM_DHCP2ComputerSystem_populate(OpenDRIM_DHCP2ComputerSystem& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2ComputerSystem/cmpiOpenDRIM_DHCP2ComputerSystem.cpp0000644000175000017500000000607011400673053032401 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2ComputerSystem.h" CMPIObjectPath* DHCP_OpenDRIM_DHCP2ComputerSystem_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_DHCP2ComputerSystem& instance) { _E_; Objectpath op(broker, OpenDRIM_DHCP2ComputerSystem_classnames[0], OpenDRIM_DHCP2ComputerSystem_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* DHCP_OpenDRIM_DHCP2ComputerSystem_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_DHCP2ComputerSystem& instance) { _E_; Objectpath op(broker, DHCP_OpenDRIM_DHCP2ComputerSystem_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void DHCP_OpenDRIM_DHCP2ComputerSystem_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_DHCP2ComputerSystem& 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 DHCP_OpenDRIM_DHCP2ComputerSystem_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_DHCP2ComputerSystem& 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-dhcp-1.0.0~ppa/OpenDRIM_DHCP2ComputerSystem/cmpiOpenDRIM_DHCP2ComputerSystem.h0000644000175000017500000000435111400673053032046 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2COMPUTERSYSTEM_H_ #define CMPIOPENDRIM_DHCP2COMPUTERSYSTEM_H_ #include "OpenDRIM_DHCP2ComputerSystem.h" CMPIObjectPath* DHCP_OpenDRIM_DHCP2ComputerSystem_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_DHCP2ComputerSystem& instance); CMPIInstance* DHCP_OpenDRIM_DHCP2ComputerSystem_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_DHCP2ComputerSystem& instance); void DHCP_OpenDRIM_DHCP2ComputerSystem_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_DHCP2ComputerSystem& instance); void DHCP_OpenDRIM_DHCP2ComputerSystem_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_DHCP2ComputerSystem& instance); #endif /*CMPIOPENDRIM_DHCP2COMPUTERSYSTEM_H_*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2ComputerSystem/OpenDRIM_DHCP2ComputerSystemProvider.cpp0000644000175000017500000004153411400673053033247 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2ComputerSystem.h" #include "OpenDRIM_DHCP2ComputerSystemAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define DHCP_OpenDRIM_DHCP2ComputerSystemProviderSetInstance DHCP_OpenDRIM_DHCP2ComputerSystemProviderModifyInstance #endif int DHCP_OpenDRIM_DHCP2ComputerSystem_init(const CMPIBroker* broker); int DHCP_OpenDRIM_DHCP2ComputerSystem_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus DHCP_OpenDRIM_DHCP2ComputerSystemProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = DHCP_OpenDRIM_DHCP2ComputerSystem_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2ComputerSystemProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2ComputerSystem_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = DHCP_OpenDRIM_DHCP2ComputerSystem_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2ComputerSystemProviderEnumInstances(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 = DHCP_OpenDRIM_DHCP2ComputerSystem_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = DHCP_OpenDRIM_DHCP2ComputerSystem_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2ComputerSystemProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCP2ComputerSystem instance; DHCP_OpenDRIM_DHCP2ComputerSystem_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2ComputerSystem_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = DHCP_OpenDRIM_DHCP2ComputerSystem_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2ComputerSystemProviderSetInstance(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_DHCP2ComputerSystem newInstance, oldInstance; DHCP_OpenDRIM_DHCP2ComputerSystem_toCPP(_broker, ci, newInstance); DHCP_OpenDRIM_DHCP2ComputerSystem_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2ComputerSystem_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCP2ComputerSystem_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2ComputerSystemProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCP2ComputerSystem instance; DHCP_OpenDRIM_DHCP2ComputerSystem_toCPP(_broker, ci, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2ComputerSystem_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_DHCP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCP2ComputerSystem_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCP2ComputerSystem_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = DHCP_OpenDRIM_DHCP2ComputerSystem_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2ComputerSystemProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_DHCP2ComputerSystem instance; DHCP_OpenDRIM_DHCP2ComputerSystem_toCPP(_broker, cop, instance); string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2ComputerSystem_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = DHCP_OpenDRIM_DHCP2ComputerSystem_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2ComputerSystemProviderExecQuery(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 DHCP_OpenDRIM_DHCP2ComputerSystemProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = DHCP_OpenDRIM_DHCP2ComputerSystem_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2ComputerSystemProviderAssociatorNames(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 = DHCP_OpenDRIM_DHCP2ComputerSystem_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2ComputerSystem_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 DHCP_OpenDRIM_DHCP2ComputerSystemProviderAssociators(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 = DHCP_OpenDRIM_DHCP2ComputerSystem_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2ComputerSystem_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 DHCP_OpenDRIM_DHCP2ComputerSystemProviderReferenceNames(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 = DHCP_OpenDRIM_DHCP2ComputerSystem_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = DHCP_OpenDRIM_DHCP2ComputerSystem_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = DHCP_OpenDRIM_DHCP2ComputerSystem_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = DHCP_OpenDRIM_DHCP2ComputerSystem_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus DHCP_OpenDRIM_DHCP2ComputerSystemProviderReferences(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 = DHCP_OpenDRIM_DHCP2ComputerSystem_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = DHCP_OpenDRIM_DHCP2ComputerSystem_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = DHCP_OpenDRIM_DHCP2ComputerSystem_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_DHCP2ComputerSystem_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = DHCP_OpenDRIM_DHCP2ComputerSystem_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int DHCP_OpenDRIM_DHCP2ComputerSystem_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2ComputerSystem_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_DHCP2ComputerSystem_init FAILED: " + (string) OpenDRIM_DHCP2ComputerSystem_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int DHCP_OpenDRIM_DHCP2ComputerSystem_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = DHCP_OpenDRIM_DHCP2ComputerSystem_unload(errorMessage); if (errorCode != OK) { errorMessage += "DHCP_OpenDRIM_DHCP2ComputerSystem_unload FAILED: " + (string) OpenDRIM_DHCP2ComputerSystem_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define DHCP_OpenDRIM_DHCP2ComputerSystem_INIT if (DHCP_OpenDRIM_DHCP2ComputerSystem_init(_broker) < 0) return NULL CMInstanceMIStub(DHCP_OpenDRIM_DHCP2ComputerSystemProvider, DHCP_OpenDRIM_DHCP2ComputerSystemProvider, _broker, DHCP_OpenDRIM_DHCP2ComputerSystem_INIT); CMAssociationMIStub(DHCP_OpenDRIM_DHCP2ComputerSystemProvider, DHCP_OpenDRIM_DHCP2ComputerSystemProvider, _broker, DHCP_OpenDRIM_DHCP2ComputerSystem_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-dhcp-1.0.0~ppa/OpenDRIM_DHCP2ComputerSystem/OpenDRIM_DHCP2ComputerSystem.h0000644000175000017500000000665111400673053031202 0ustar guillaumeguillaume/*################################################################################ # Linux Management Providers (LMP), DHCP provider package # Copyright (C) 2009 Khahramon NURIDDINOV, qahramon0786@gmail.com,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_DHCP2COMPUTERSYSTEM_H_ #define OPENDRIM_DHCP2COMPUTERSYSTEM_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_System.h" #include "CIM_SystemAccess.h" #include "cmpiCIM_ServiceAccessPoint.h" #include "CIM_ServiceAccessPointAccess.h" */ const static char* OpenDRIM_DHCP2ComputerSystem_classnames[] = {"OpenDRIM_DHCP2ComputerSystem"}; static string OpenDRIM_DHCP2ComputerSystem_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_DHCPProtocolEndpoint"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_DHCP2ComputerSystem { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; OpenDRIM_DHCP2ComputerSystem() { Antecedent_isNULL = true; Dependent_isNULL = true; } ~OpenDRIM_DHCP2ComputerSystem() {} 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_DHCP2COMPUTERSYSTEM_H_*/