opendrim-lmp-ssh-1.0.0/0000755000175000017500000000000011415301347015437 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHSessionSettingData/0000755000175000017500000000000011415301347023225 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHSessionSettingData/Makefile.am0000644000175000017500000000471111415301347025264 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSSH_OpenDRIM_SSHSessionSettingDataProvider.la libcmpiSSH_OpenDRIM_SSHSessionSettingDataProvider_la_SOURCES = OpenDRIM_SSHSessionSettingDataAccess.cpp OpenDRIM_SSHSessionSettingDataProvider.cpp cmpiOpenDRIM_SSHSessionSettingData.cpp assocOpenDRIM_SSHSessionSettingData.cpp # May have to be adjusted for direct invocation libcmpiSSH_OpenDRIM_SSHSessionSettingDataProvider_la_CPPFLAGS = -I../CIM_SettingData -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiSSH_OpenDRIM_SSHSessionSettingDataProvider_la_LIBADD = ../Common/libcmpiSSH_Common.la #../CIM_SettingData/libcmpiSSH_CIM_SettingDataProvider.la ../CIM_ManagedElement/libcmpiSSH_CIM_ManagedElementProvider.la libcmpiSSH_OpenDRIM_SSHSessionSettingDataProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_SSHSessionSettingData.h OpenDRIM_SSHSessionSettingData.h OpenDRIM_SSHSessionSettingDataAccess.h opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHSessionSettingData/assocOpenDRIM_SSHSessionSettingData.cpp0000644000175000017500000002101211415301347032544 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "assocOpenDRIM_SSHSessionSettingData.h" int SSH_OpenDRIM_SSHSessionSettingData_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 = SSH_OpenDRIM_SSHSessionSettingData_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(SSH_OpenDRIM_SSHSessionSettingData_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(SSH_OpenDRIM_SSHSessionSettingData_associatorManagedElementToSettingData(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int SSH_OpenDRIM_SSHSessionSettingData_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(SSH_CIM_SettingData_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(SSH_CIM_SettingData_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, SSH_CIM_SettingData_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int SSH_OpenDRIM_SSHSessionSettingData_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; SSH_CIM_SettingData_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(SSH_CIM_SettingData_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, SSH_CIM_SettingData_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int SSH_OpenDRIM_SSHSessionSettingData_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(SSH_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(SSH_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, SSH_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int SSH_OpenDRIM_SSHSessionSettingData_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; SSH_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(SSH_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, SSH_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHSessionSettingData/assocOpenDRIM_SSHSessionSettingData.h0000644000175000017500000000621611415301347032222 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef ASSOCOPENDRIM_SSHSESSIONSETTINGDATA_H_ #define ASSOCOPENDRIM_SSHSESSIONSETTINGDATA_H_ #include "OpenDRIM_SSHSessionSettingDataAccess.h" int SSH_OpenDRIM_SSHSessionSettingData_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 SSH_OpenDRIM_SSHSessionSettingData_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 SSH_OpenDRIM_SSHSessionSettingData_enumerateSettingDatas(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int SSH_OpenDRIM_SSHSessionSettingData_getSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHSessionSettingData_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int SSH_OpenDRIM_SSHSessionSettingData_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_SSHSESSIONSETTINGDATA_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHSessionSettingData/OpenDRIM_SSHSessionSettingDataProvider.cpp0000644000175000017500000004172711415301347033245 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHSessionSettingData.h" #include "OpenDRIM_SSHSessionSettingDataAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define SSH_OpenDRIM_SSHSessionSettingDataProviderSetInstance SSH_OpenDRIM_SSHSessionSettingDataProviderModifyInstance #endif int SSH_OpenDRIM_SSHSessionSettingData_init(const CMPIBroker* broker); int SSH_OpenDRIM_SSHSessionSettingData_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus SSH_OpenDRIM_SSHSessionSettingDataProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHSessionSettingData_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHSessionSettingDataProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = SSH_OpenDRIM_SSHSessionSettingData_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSessionSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_SSHSessionSettingData_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHSessionSettingDataProviderEnumInstances(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 = SSH_OpenDRIM_SSHSessionSettingData_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSessionSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = SSH_OpenDRIM_SSHSessionSettingData_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHSessionSettingDataProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHSessionSettingData instance; SSH_OpenDRIM_SSHSessionSettingData_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHSessionSettingData_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSessionSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = SSH_OpenDRIM_SSHSessionSettingData_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHSessionSettingDataProviderSetInstance(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_SSHSessionSettingData newInstance, oldInstance; SSH_OpenDRIM_SSHSessionSettingData_toCPP(_broker, ci, newInstance); SSH_OpenDRIM_SSHSessionSettingData_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHSessionSettingData_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSessionSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHSessionSettingData_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSessionSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHSessionSettingDataProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHSessionSettingData instance; SSH_OpenDRIM_SSHSessionSettingData_toCPP(_broker, ci, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHSessionSettingData_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_SSHSessionSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHSessionSettingData_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSessionSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHSessionSettingData_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSessionSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = SSH_OpenDRIM_SSHSessionSettingData_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHSessionSettingDataProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHSessionSettingData instance; SSH_OpenDRIM_SSHSessionSettingData_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHSessionSettingData_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSessionSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHSessionSettingData_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSessionSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHSessionSettingDataProviderExecQuery(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 SSH_OpenDRIM_SSHSessionSettingDataProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHSessionSettingData_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHSessionSettingDataProviderAssociatorNames(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 = SSH_OpenDRIM_SSHSessionSettingData_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSessionSettingData_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 SSH_OpenDRIM_SSHSessionSettingDataProviderAssociators(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 = SSH_OpenDRIM_SSHSessionSettingData_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSessionSettingData_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 SSH_OpenDRIM_SSHSessionSettingDataProviderReferenceNames(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 = SSH_OpenDRIM_SSHSessionSettingData_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSessionSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = SSH_OpenDRIM_SSHSessionSettingData_referenceSettingDataToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = SSH_OpenDRIM_SSHSessionSettingData_referenceManagedElementToSettingData(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSessionSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_SSHSessionSettingData_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHSessionSettingDataProviderReferences(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 = SSH_OpenDRIM_SSHSessionSettingData_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSessionSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = SSH_OpenDRIM_SSHSessionSettingData_referenceSettingDataToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = SSH_OpenDRIM_SSHSessionSettingData_referenceManagedElementToSettingData(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSessionSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = SSH_OpenDRIM_SSHSessionSettingData_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int SSH_OpenDRIM_SSHSessionSettingData_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHSessionSettingData_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHSessionSettingData_init FAILED: " + (string) OpenDRIM_SSHSessionSettingData_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int SSH_OpenDRIM_SSHSessionSettingData_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHSessionSettingData_unload(errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHSessionSettingData_unload FAILED: " + (string) OpenDRIM_SSHSessionSettingData_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define SSH_OpenDRIM_SSHSessionSettingData_INIT if (SSH_OpenDRIM_SSHSessionSettingData_init(_broker) < 0) return NULL CMInstanceMIStub(SSH_OpenDRIM_SSHSessionSettingDataProvider, SSH_OpenDRIM_SSHSessionSettingDataProvider, _broker, SSH_OpenDRIM_SSHSessionSettingData_INIT); CMAssociationMIStub(SSH_OpenDRIM_SSHSessionSettingDataProvider, SSH_OpenDRIM_SSHSessionSettingDataProvider, _broker, SSH_OpenDRIM_SSHSessionSettingData_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHSessionSettingData/cmpiOpenDRIM_SSHSessionSettingData.h0000644000175000017500000000435211415301347032041 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef CMPIOPENDRIM_SSHSESSIONSETTINGDATA_H_ #define CMPIOPENDRIM_SSHSESSIONSETTINGDATA_H_ #include "OpenDRIM_SSHSessionSettingData.h" CMPIObjectPath* SSH_OpenDRIM_SSHSessionSettingData_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHSessionSettingData& instance); CMPIInstance* SSH_OpenDRIM_SSHSessionSettingData_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHSessionSettingData& instance); void SSH_OpenDRIM_SSHSessionSettingData_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHSessionSettingData& instance); void SSH_OpenDRIM_SSHSessionSettingData_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHSessionSettingData& instance); #endif /*CMPIOPENDRIM_SSHSESSIONSETTINGDATA_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHSessionSettingData/OpenDRIM_SSHSessionSettingDataAccess.cpp0000644000175000017500000002525311415301347032650 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "OpenDRIM_SSHSessionSettingDataAccess.h" int SSH_OpenDRIM_SSHSessionSettingData_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(SSH_CIM_SettingData_load(broker, errorMessage)); CF_assert(SSH_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int SSH_OpenDRIM_SSHSessionSettingData_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(SSH_CIM_SettingData_unload(errorMessage)); CF_assert(SSH_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int SSH_OpenDRIM_SSHSessionSettingData_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 SSH_OpenDRIM_SSHSessionSettingData_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(SSH_OpenDRIM_SSHSessionSettingData_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(SSH_OpenDRIM_SSHSessionSettingData_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; CF_assert(SSH_OpenDRIM_SSHSessionSettingData_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(SSH_OpenDRIM_SSHSessionSettingData_referenceSettingDataToManagedElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int SSH_OpenDRIM_SSHSessionSettingData_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHSessionSettingData& 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(SSH_OpenDRIM_SSHSessionSettingData_getSettingData(broker, ctx, SettingData_objectpath, SettingData_instance, NULL, errorMessage)); Objectpath ManagedElement_objectpath; instance.getManagedElement(ManagedElement_objectpath); Instance ManagedElement_instance; CF_assert(SSH_OpenDRIM_SSHSessionSettingData_getManagedElement(broker, ctx, ManagedElement_objectpath, ManagedElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(SSH_OpenDRIM_SSHSessionSettingData_isAssociated(SettingData_instance, ManagedElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } CF_assert(SSH_OpenDRIM_SSHSessionSettingData_populate(instance, errorMessage)); _L_; return OK; } int SSH_OpenDRIM_SSHSessionSettingData_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHSessionSettingData& newInstance, const OpenDRIM_SSHSessionSettingData& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHSessionSettingData_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHSessionSettingData& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHSessionSettingData_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHSessionSettingData& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHSessionSettingData_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(SSH_OpenDRIM_SSHSessionSettingData_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(SSH_OpenDRIM_SSHSessionSettingData_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(SSH_OpenDRIM_SSHSessionSettingData_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(SSH_OpenDRIM_SSHSessionSettingData_enumerateSettingDatas(broker, ctx, SettingData_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(SSH_OpenDRIM_SSHSessionSettingData_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(SSH_OpenDRIM_SSHSessionSettingData_enumerateSettingDatas(broker, ctx, SettingData_instances, properties, false, errorMessage)); } for (size_t i=0; i& ManagedElement_instances, vector& OpenDRIM_SSHSessionSettingData_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_SSHSessionSettingData instance; instance.setSettingData(((Instance) SettingData_instance).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instances[i]).getObjectpath()); if (discriminant == "r") { CF_assert(SSH_OpenDRIM_SSHSessionSettingData_populate(instance, errorMessage)); } OpenDRIM_SSHSessionSettingData_instances.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_SSHSessionSettingData_referenceManagedElementToSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& SettingData_instances, vector& OpenDRIM_SSHSessionSettingData_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_SSHSessionSettingData instance; instance.setSettingData(((Instance) SettingData_instances[i]).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instance).getObjectpath()); if (discriminant == "r") { CF_assert(SSH_OpenDRIM_SSHSessionSettingData_populate(instance, errorMessage)); } OpenDRIM_SSHSessionSettingData_instances.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_SSHSessionSettingData_populate(OpenDRIM_SSHSessionSettingData& instance, string& errorMessage) { _E_; instance.setIsCurrent(1); // Is Current _L_; return OK; } opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHSessionSettingData/OpenDRIM_SSHSessionSettingDataAccess.h0000644000175000017500000001052011415301347032304 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHSESSIONSETTINGDATAACCESS_H_ #define OPENDRIM_SSHSESSIONSETTINGDATAACCESS_H_ #include "SSH_Common.h" #include "OpenDRIM_SSHSessionSettingData.h" #include "assocOpenDRIM_SSHSessionSettingData.h" int SSH_OpenDRIM_SSHSessionSettingData_load(const CMPIBroker* broker, string& errorMessage); int SSH_OpenDRIM_SSHSessionSettingData_unload(string& errorMessage); int SSH_OpenDRIM_SSHSessionSettingData_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHSessionSettingData_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHSessionSettingData& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHSessionSettingData_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHSessionSettingData& newInstance, const OpenDRIM_SSHSessionSettingData& oldInstance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHSessionSettingData_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHSessionSettingData& instance, string& errorMessage); int SSH_OpenDRIM_SSHSessionSettingData_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHSessionSettingData& instance, string& errorMessage); int SSH_OpenDRIM_SSHSessionSettingData_associatorSettingDataToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& SettingData_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHSessionSettingData_associatorManagedElementToSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const char** properties, vector& SettingData_associatedInstances, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHSessionSettingData_referenceSettingDataToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& SettingData_instance, const vector& ManagedElement_instances, vector& OpenDRIM_SSHSessionSettingData_instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHSessionSettingData_referenceManagedElementToSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& SettingData_instances, vector& OpenDRIM_SSHSessionSettingData_instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHSessionSettingData_populate(OpenDRIM_SSHSessionSettingData& instance, string& errorMessage); #endif /*OPENDRIM_SSHSESSIONSETTINGDATAACCESS_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHSessionSettingData/OpenDRIM_SSHSessionSettingData.h0000644000175000017500000001275411415301347031175 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHSESSIONSETTINGDATA_H_ #define OPENDRIM_SSHSESSIONSETTINGDATA_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_SSHSessionSettingData_classnames[] = {"OpenDRIM_SSHSessionSettingData"}; static string OpenDRIM_SSHSessionSettingData_NAMESPACE = _NAMESPACE; const static string SettingData_role = "SettingData"; const static char* SettingData_classnames[] = {"OpenDRIM_SSHSettingData"}; const static string SettingData_NAMESPACE = _NAMESPACE; const static string ManagedElement_role = "ManagedElement"; const static char* ManagedElement_classnames[] = {"OpenDRIM_SSHProtocolEndpoint"}; const static string ManagedElement_NAMESPACE = _NAMESPACE; class OpenDRIM_SSHSessionSettingData { public: Objectpath ManagedElement; bool ManagedElement_isNULL; Objectpath SettingData; bool SettingData_isNULL; unsigned short IsDefault; bool IsDefault_isNULL; unsigned short IsCurrent; bool IsCurrent_isNULL; unsigned short IsNext; bool IsNext_isNULL; unsigned short IsMinimum; bool IsMinimum_isNULL; unsigned short IsMaximum; bool IsMaximum_isNULL; unsigned short IsPending; bool IsPending_isNULL; OpenDRIM_SSHSessionSettingData() { ManagedElement_isNULL = true; SettingData_isNULL = true; IsDefault_isNULL = true; IsCurrent_isNULL = true; IsNext_isNULL = true; IsMinimum_isNULL = true; IsMaximum_isNULL = true; IsPending_isNULL = true; } ~OpenDRIM_SSHSessionSettingData() {} string getKeys() const { return CF_toLowCase(".ManagedElement=\"" + CF_quoteString(ManagedElement.toString()) + "\""".SettingData=\"" + CF_quoteString(SettingData.toString()) + "\""); } int getManagedElement(Objectpath& value) const { if (ManagedElement_isNULL==true) return NOT_FOUND; value = ManagedElement; return OK; } int setManagedElement(const Objectpath& newValue) { ManagedElement = newValue; ManagedElement.setNamespace(ManagedElement_NAMESPACE); ManagedElement_isNULL = false; return OK; } int getSettingData(Objectpath& value) const { if (SettingData_isNULL==true) return NOT_FOUND; value = SettingData; return OK; } int setSettingData(const Objectpath& newValue) { SettingData = newValue; SettingData.setNamespace(SettingData_NAMESPACE); SettingData_isNULL = false; return OK; } int getIsDefault(unsigned short& value) const { if (IsDefault_isNULL==true) return NOT_FOUND; value = IsDefault; return OK; } int setIsDefault(const unsigned short& newValue) { IsDefault = newValue; IsDefault_isNULL = false; return OK; } int getIsCurrent(unsigned short& value) const { if (IsCurrent_isNULL==true) return NOT_FOUND; value = IsCurrent; return OK; } int setIsCurrent(const unsigned short& newValue) { IsCurrent = newValue; IsCurrent_isNULL = false; return OK; } int getIsNext(unsigned short& value) const { if (IsNext_isNULL==true) return NOT_FOUND; value = IsNext; return OK; } int setIsNext(const unsigned short& newValue) { IsNext = newValue; IsNext_isNULL = false; return OK; } int getIsMinimum(unsigned short& value) const { if (IsMinimum_isNULL==true) return NOT_FOUND; value = IsMinimum; return OK; } int setIsMinimum(const unsigned short& newValue) { IsMinimum = newValue; IsMinimum_isNULL = false; return OK; } int getIsMaximum(unsigned short& value) const { if (IsMaximum_isNULL==true) return NOT_FOUND; value = IsMaximum; return OK; } int setIsMaximum(const unsigned short& newValue) { IsMaximum = newValue; IsMaximum_isNULL = false; return OK; } int getIsPending(unsigned short& value) const { if (IsPending_isNULL==true) return NOT_FOUND; value = IsPending; return OK; } int setIsPending(const unsigned short& newValue) { IsPending = newValue; IsPending_isNULL = false; return OK; } }; #endif /*OPENDRIM_SSHSESSIONSETTINGDATA_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHSessionSettingData/cmpiOpenDRIM_SSHSessionSettingData.cpp0000644000175000017500000001026211415301347032371 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHSessionSettingData.h" CMPIObjectPath* SSH_OpenDRIM_SSHSessionSettingData_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHSessionSettingData& instance) { _E_; Objectpath op(broker, OpenDRIM_SSHSessionSettingData_classnames[0], OpenDRIM_SSHSessionSettingData_NAMESPACE); if (!instance.ManagedElement_isNULL) op.addKey("ManagedElement", instance.ManagedElement); if (!instance.SettingData_isNULL) op.addKey("SettingData", instance.SettingData); _L_; return op.getHdl(); } CMPIInstance* SSH_OpenDRIM_SSHSessionSettingData_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHSessionSettingData& instance) { _E_; Objectpath op(broker, SSH_OpenDRIM_SSHSessionSettingData_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.IsDefault_isNULL) ci.setProperty("IsDefault", instance.IsDefault); if (!instance.IsCurrent_isNULL) ci.setProperty("IsCurrent", instance.IsCurrent); if (!instance.IsNext_isNULL) ci.setProperty("IsNext", instance.IsNext); if (!instance.IsMinimum_isNULL) ci.setProperty("IsMinimum", instance.IsMinimum); if (!instance.IsMaximum_isNULL) ci.setProperty("IsMaximum", instance.IsMaximum); if (!instance.IsPending_isNULL) ci.setProperty("IsPending", instance.IsPending); _L_; return ci.getHdl(); } void SSH_OpenDRIM_SSHSessionSettingData_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHSessionSettingData& 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 SSH_OpenDRIM_SSHSessionSettingData_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHSessionSettingData& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("ManagedElement", instance.ManagedElement) == OK) instance.ManagedElement_isNULL = false; if (inst.getProperty("SettingData", instance.SettingData) == OK) instance.SettingData_isNULL = false; if (inst.getProperty("IsDefault", instance.IsDefault) == OK) instance.IsDefault_isNULL = false; if (inst.getProperty("IsCurrent", instance.IsCurrent) == OK) instance.IsCurrent_isNULL = false; if (inst.getProperty("IsNext", instance.IsNext) == OK) instance.IsNext_isNULL = false; if (inst.getProperty("IsMinimum", instance.IsMinimum) == OK) instance.IsMinimum_isNULL = false; if (inst.getProperty("IsMaximum", instance.IsMaximum) == OK) instance.IsMaximum_isNULL = false; if (inst.getProperty("IsPending", instance.IsPending) == OK) instance.IsPending_isNULL = false; _L_; } opendrim-lmp-ssh-1.0.0/Makefile.am0000644000175000017500000001224511415301347017477 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# VENDOR = OpenDRIM VERSION = $(shell cat ./VERSION) APP_NAME = opendrim-lmp-ssh RPM_PACKAGE_DIR = packaging PLATFORM = $(shell rpm --eval %_target_cpu) WORKING_DIR = $(shell pwd) SUBDIRS = Common OpenDRIM_SSHProtocolEndpoint OpenDRIM_TCPProtocolEndpoint OpenDRIM_SSHCapabilities OpenDRIM_HostedSSHAccessPoint OpenDRIM_RegisteredSSHProfile OpenDRIM_SSHProtocolService OpenDRIM_SSHSettingData OpenDRIM_SSHProtocolCapabilities OpenDRIM_SSHSessionSettingData OpenDRIM_SSHProtocolProvidesEndpoint OpenDRIM_SSHConformsToProfile OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint OpenDRIM_SSHServiceAccessBySAP OpenDRIM_SSHServiceSettingData OpenDRIM_HostedSSHService OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint test postinstall: registration/SSH.sh @CIMNAMESPACE@ $(VENDOR) @CIMSERVER@ @INTEROPNAMESPACE@ $(VERSION) . preuninstall: registration/SSH-remove.sh @CIMNAMESPACE@ @CIMSERVER@ @INTEROPNAMESPACE@ . test-OpenDRIM_SSHProtocolEndpoint: all make -C test test-OpenDRIM_SSHProtocolEndpoint test-OpenDRIM_SSHProtocolCapabilities: all make -C test test-OpenDRIM_SSHProtocolCapabilities test-OpenDRIM_TCPProtocolEndpoint: all make -C test test-OpenDRIM_TCPProtocolEndpoint test-OpenDRIM_SSHSessionSettingData: all make -C test test-OpenDRIM_SSHSessionSettingData test-OpenDRIM_SSHProtocolProvidesEndpoint: all make -C test test-OpenDRIM_SSHProtocolProvidesEndpoint test-OpenDRIM_SSHCapabilities: all make -C test test-OpenDRIM_SSHCapabilities test-OpenDRIM_HostedSSHAccessPoint: all make -C test test-OpenDRIM_HostedSSHAccessPoint test-OpenDRIM_RegisteredSSHProfile: all make -C test test-OpenDRIM_RegisteredSSHProfile test-OpenDRIM_SSHConformsToProfile: all make -C test test-OpenDRIM_SSHConformsToProfile test-OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint: all make -C test test-OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint test-OpenDRIM_SSHProtocolService: all make -C test test-OpenDRIM_SSHProtocolService test-OpenDRIM_SSHServiceAccessBySAP: all make -C test test-OpenDRIM_SSHServiceAccessBySAP test-OpenDRIM_SSHServiceSettingData: all make -C test test-OpenDRIM_SSHServiceSettingData test-OpenDRIM_SSHSettingData: all make -C test test-OpenDRIM_SSHSettingData test-OpenDRIM_HostedSSHService: all make -C test test-OpenDRIM_HostedSSHService test-OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint: all make -C test test-OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint 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-ssh-1.0.0/registration/0000755000175000017500000000000011415301347020151 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHProtocolEndpoint.sh0000755000175000017500000001006611415301347026030 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_SSHProtocolEndpoint.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_SSHProtocolEndpoint provider module"; Name = "SSH_OpenDRIM_SSHProtocolEndpointModule"; Location = "cmpiSSH_OpenDRIM_SSHProtocolEndpointProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_SSHProtocolEndpoint provider"; Name = "SSH_OpenDRIM_SSHProtocolEndpointProvider"; ProviderModuleName = "SSH_OpenDRIM_SSHProtocolEndpointModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_SSHProtocolEndpoint provider capabilities"; ProviderModuleName = "SSH_OpenDRIM_SSHProtocolEndpointModule"; ProviderName = "SSH_OpenDRIM_SSHProtocolEndpointProvider"; ClassName = "OpenDRIM_SSHProtocolEndpoint"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"InstanceID", "Caption", "ElementName", "Generation", "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", "BroadcastResetSupported", "EnabledSSHVersions", "OtherEnabledSSHVersion", "SSHVersion", "OtherSSHVersion", "EnabledEncryptionAlgorithms", "OtherEnabledEncryptionAlgorithm", "EncryptionAlgorithm", "OtherEncryptionAlgorithm", "IdleTimeout", "KeepAlive", "ForwardX11", "Compression"}; SupportedMethods = {"RequestStateChange", "BroadcastReset"}; CapabilityID = "SSH_OpenDRIM_SSHProtocolEndpoint"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_SSHProtocolEndpoint.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHProtocolCapabilities.sh0000755000175000017500000000653411415301347026646 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_SSHProtocolCapabilities.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_SSHProtocolCapabilities provider module"; Name = "SSH_OpenDRIM_SSHProtocolCapabilitiesModule"; Location = "cmpiSSH_OpenDRIM_SSHProtocolCapabilitiesProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_SSHProtocolCapabilities provider"; Name = "SSH_OpenDRIM_SSHProtocolCapabilitiesProvider"; ProviderModuleName = "SSH_OpenDRIM_SSHProtocolCapabilitiesModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_SSHProtocolCapabilities provider capabilities"; ProviderModuleName = "SSH_OpenDRIM_SSHProtocolCapabilitiesModule"; ProviderName = "SSH_OpenDRIM_SSHProtocolCapabilitiesProvider"; ClassName = "OpenDRIM_SSHProtocolCapabilities"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"ManagedElement", "Capabilities", "Characteristics"}; CapabilityID = "SSH_OpenDRIM_SSHProtocolCapabilities"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_SSHProtocolCapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHProtocolService-remove.sh0000755000175000017500000000627311415301347027150 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$2" = pegasus then cimprovider -d -m SSH_OpenDRIM_SSHProtocolServiceModule cimprovider -r -m SSH_OpenDRIM_SSHProtocolServiceModule 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_SSHProtocolService.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.sh0000755000175000017500000000734411415301347033112 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint provider module"; Name = "SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointModule"; Location = "cmpiSSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint provider"; Name = "SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProvider"; ProviderModuleName = "SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint provider capabilities"; ProviderModuleName = "SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointModule"; ProviderName = "SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProvider"; ClassName = "OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent"}; CapabilityID = "SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_RegisteredSSHProfile.sh0000755000175000017500000000715211415301347026146 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$3" = pegasus then cimmof -aE -n $4 $6/mof/OpenDRIM_RegisteredSSHProfile.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_RegisteredSSHProfile provider module"; Name = "SSH_OpenDRIM_RegisteredSSHProfileModule"; Location = "cmpiSSH_OpenDRIM_RegisteredSSHProfileProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_RegisteredSSHProfile provider"; Name = "SSH_OpenDRIM_RegisteredSSHProfileProvider"; ProviderModuleName = "SSH_OpenDRIM_RegisteredSSHProfileModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_RegisteredSSHProfile provider capabilities"; ProviderModuleName = "SSH_OpenDRIM_RegisteredSSHProfileModule"; ProviderName = "SSH_OpenDRIM_RegisteredSSHProfileProvider"; ClassName = "OpenDRIM_RegisteredSSHProfile"; ProviderType = {2, 5}; Namespaces = {"$4"}; SupportedProperties = {"Caption", "Description", "ElementName", "Generation", "InstanceID", "OtherSpecificationType", "RegisteredOrganization", "OtherRegisteredOrganization", "RegisteredName", "RegisteredVersion", "AdvertiseTypes", "AdvertiseTypeDescriptions", "SpecificationType", "ImplementedFeatures"}; SupportedMethods = {"CloseConformantInstances", "OpenConformantInstances", "PullConformantInstances"}; CapabilityID = "SSH_OpenDRIM_RegisteredSSHProfile"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_RegisteredSSHProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$4 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHConformsToProfile-remove.sh0000755000175000017500000001023211415301347027426 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$2" = pegasus then cimprovider -d -m SSH_OpenDRIM_SSHConformsToProfileModule cimprovider -r -m SSH_OpenDRIM_SSHConformsToProfileModule 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_SSHConformsToProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE owmofc -u http://localhost/$3 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHProtocolCapabilities-remove.sh0000755000175000017500000000636211415301347030140 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$2" = pegasus then cimprovider -d -m SSH_OpenDRIM_SSHProtocolCapabilitiesModule cimprovider -r -m SSH_OpenDRIM_SSHProtocolCapabilitiesModule 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_SSHProtocolCapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHServiceSettingData-remove.sh0000755000175000017500000000633611415301347027556 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$2" = pegasus then cimprovider -d -m SSH_OpenDRIM_SSHServiceSettingDataModule cimprovider -r -m SSH_OpenDRIM_SSHServiceSettingDataModule 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_SSHServiceSettingData.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_HostedSSHService.sh0000755000175000017500000000627511415301347025304 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_HostedSSHService.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_HostedSSHService provider module"; Name = "SSH_OpenDRIM_HostedSSHServiceModule"; Location = "cmpiSSH_OpenDRIM_HostedSSHServiceProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_HostedSSHService provider"; Name = "SSH_OpenDRIM_HostedSSHServiceProvider"; ProviderModuleName = "SSH_OpenDRIM_HostedSSHServiceModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_HostedSSHService provider capabilities"; ProviderModuleName = "SSH_OpenDRIM_HostedSSHServiceModule"; ProviderName = "SSH_OpenDRIM_HostedSSHServiceProvider"; ClassName = "OpenDRIM_HostedSSHService"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent"}; CapabilityID = "SSH_OpenDRIM_HostedSSHService"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_HostedSSHService.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.sh0000755000175000017500000000732111415301347032760 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint provider module"; Name = "SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointModule"; Location = "cmpiSSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint provider"; Name = "SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProvider"; ProviderModuleName = "SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint provider capabilities"; ProviderModuleName = "SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointModule"; ProviderName = "SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProvider"; ClassName = "OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent"}; CapabilityID = "SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHSettingData-remove.sh0000755000175000017500000000621411415301347026230 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$2" = pegasus then cimprovider -d -m SSH_OpenDRIM_SSHSettingDataModule cimprovider -r -m SSH_OpenDRIM_SSHSettingDataModule 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_SSHSettingData.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHServiceAccessBySAP.sh0000755000175000017500000000643411415301347026113 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_SSHServiceAccessBySAP.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_SSHServiceAccessBySAP provider module"; Name = "SSH_OpenDRIM_SSHServiceAccessBySAPModule"; Location = "cmpiSSH_OpenDRIM_SSHServiceAccessBySAPProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_SSHServiceAccessBySAP provider"; Name = "SSH_OpenDRIM_SSHServiceAccessBySAPProvider"; ProviderModuleName = "SSH_OpenDRIM_SSHServiceAccessBySAPModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_SSHServiceAccessBySAP provider capabilities"; ProviderModuleName = "SSH_OpenDRIM_SSHServiceAccessBySAPModule"; ProviderName = "SSH_OpenDRIM_SSHServiceAccessBySAPProvider"; ClassName = "OpenDRIM_SSHServiceAccessBySAP"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent"}; CapabilityID = "SSH_OpenDRIM_SSHServiceAccessBySAP"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_SSHServiceAccessBySAP.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHProtocolService.sh0000755000175000017500000000762611415301347025660 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_SSHProtocolService.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_SSHProtocolService provider module"; Name = "SSH_OpenDRIM_SSHProtocolServiceModule"; Location = "cmpiSSH_OpenDRIM_SSHProtocolServiceProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_SSHProtocolService provider"; Name = "SSH_OpenDRIM_SSHProtocolServiceProvider"; ProviderModuleName = "SSH_OpenDRIM_SSHProtocolServiceModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_SSHProtocolService provider capabilities"; ProviderModuleName = "SSH_OpenDRIM_SSHProtocolServiceModule"; ProviderName = "SSH_OpenDRIM_SSHProtocolServiceProvider"; ClassName = "OpenDRIM_SSHProtocolService"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"InstanceID", "Caption", "Description", "ElementName", "Generation", "InstallDate", "OperationalStatus", "StatusDescriptions", "Status", "HealthState", "CommunicationStatus", "DetailedStatus", "OperatingStatus", "PrimaryStatus", "EnabledState", "OtherEnabledState", "RequestedState", "EnabledDefault", "TimeOfLastStateChange", "AvailableRequestedStates", "TransitioningToState", "SystemCreationClassName", "SystemName", "CreationClassName", "Name", "PrimaryOwnerName", "PrimaryOwnerContact", "StartMode", "Started", "Protocol", "OtherProtocol", "MaxConnections", "CurrentActiveConnections"}; SupportedMethods = {"RequestStateChange", "StartService", "StopService", "ChangeAffectedElementsAssignedSequence", "ListenOnPort"}; CapabilityID = "SSH_OpenDRIM_SSHProtocolService"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_SSHProtocolService.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_TCPProtocolEndpoint-remove.sh0000755000175000017500000000630511415301347027315 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$2" = pegasus then cimprovider -d -m SSH_OpenDRIM_TCPProtocolEndpointModule cimprovider -r -m SSH_OpenDRIM_TCPProtocolEndpointModule 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_TCPProtocolEndpoint.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_HostedSSHService-remove.sh0000755000175000017500000000625411415301347026574 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$2" = pegasus then cimprovider -d -m SSH_OpenDRIM_HostedSSHServiceModule cimprovider -r -m SSH_OpenDRIM_HostedSSHServiceModule 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_HostedSSHService.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHSessionSettingData-remove.sh0000755000175000017500000000633611415301347027601 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$2" = pegasus then cimprovider -d -m SSH_OpenDRIM_SSHSessionSettingDataModule cimprovider -r -m SSH_OpenDRIM_SSHSessionSettingDataModule 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_SSHSessionSettingData.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHServiceSettingData.sh0000755000175000017500000000655511415301347026266 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_SSHServiceSettingData.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_SSHServiceSettingData provider module"; Name = "SSH_OpenDRIM_SSHServiceSettingDataModule"; Location = "cmpiSSH_OpenDRIM_SSHServiceSettingDataProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_SSHServiceSettingData provider"; Name = "SSH_OpenDRIM_SSHServiceSettingDataProvider"; ProviderModuleName = "SSH_OpenDRIM_SSHServiceSettingDataModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_SSHServiceSettingData provider capabilities"; ProviderModuleName = "SSH_OpenDRIM_SSHServiceSettingDataModule"; ProviderName = "SSH_OpenDRIM_SSHServiceSettingDataProvider"; ClassName = "OpenDRIM_SSHServiceSettingData"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"ManagedElement", "SettingData", "IsDefault", "IsCurrent", "IsNext", "IsMinimum", "IsMaximum", "IsPending"}; CapabilityID = "SSH_OpenDRIM_SSHServiceSettingData"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_SSHServiceSettingData.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint-remove.shopendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint-remove.sh0000755000175000017500000000671611415301347034407 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$2" = pegasus then cimprovider -d -m SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointModule cimprovider -r -m SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointModule 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_SSHProtocolEndpointBindsToTCPProtocolEndpoint.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_TCPProtocolEndpoint.sh0000755000175000017500000000750511415301347026025 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_TCPProtocolEndpoint.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_TCPProtocolEndpoint provider module"; Name = "SSH_OpenDRIM_TCPProtocolEndpointModule"; Location = "cmpiSSH_OpenDRIM_TCPProtocolEndpointProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_TCPProtocolEndpoint provider"; Name = "SSH_OpenDRIM_TCPProtocolEndpointProvider"; ProviderModuleName = "SSH_OpenDRIM_TCPProtocolEndpointModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_TCPProtocolEndpoint provider capabilities"; ProviderModuleName = "SSH_OpenDRIM_TCPProtocolEndpointModule"; ProviderName = "SSH_OpenDRIM_TCPProtocolEndpointProvider"; ClassName = "OpenDRIM_TCPProtocolEndpoint"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"InstanceID", "Caption", "ElementName", "Generation", "InstallDate", "StatusDescriptions", "Status", "HealthState", "CommunicationStatus", "DetailedStatus", "OperatingStatus", "PrimaryStatus", "OtherEnabledState", "RequestedState", "EnabledDefault", "AvailableRequestedStates", "TransitioningToState", "SystemCreationClassName", "SystemName", "CreationClassName", "Name", "Description", "OperationalStatus", "EnabledState", "TimeOfLastStateChange", "NameFormat", "ProtocolType", "OtherTypeDescription", "BroadcastResetSupported", "PortNumber", "ProtocolIFType"}; SupportedMethods = {"RequestStateChange", "BroadcastReset"}; CapabilityID = "SSH_OpenDRIM_TCPProtocolEndpoint"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_TCPProtocolEndpoint.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/SSH-remove.sh0000755000175000017500000000577011415301347022451 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# 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_TCPProtocolEndpointBindsToIPProtocolEndpoint-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_HostedSSHService-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_SSHSettingData-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_SSHServiceSettingData-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_SSHServiceAccessBySAP-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_SSHProtocolService-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_SSHConformsToProfile-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_RegisteredSSHProfile-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_HostedSSHAccessPoint-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_SSHCapabilities-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_SSHProtocolProvidesEndpoint-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_SSHSessionSettingData-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_TCPProtocolEndpoint-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_SSHProtocolCapabilities-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_SSHProtocolEndpoint-remove.sh $1 $2 $3 $4 if test "$2" = sfcb then /etc/init.d/sfcb start fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHSessionSettingData.sh0000755000175000017500000000655511415301347026311 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_SSHSessionSettingData.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_SSHSessionSettingData provider module"; Name = "SSH_OpenDRIM_SSHSessionSettingDataModule"; Location = "cmpiSSH_OpenDRIM_SSHSessionSettingDataProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_SSHSessionSettingData provider"; Name = "SSH_OpenDRIM_SSHSessionSettingDataProvider"; ProviderModuleName = "SSH_OpenDRIM_SSHSessionSettingDataModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_SSHSessionSettingData provider capabilities"; ProviderModuleName = "SSH_OpenDRIM_SSHSessionSettingDataModule"; ProviderName = "SSH_OpenDRIM_SSHSessionSettingDataProvider"; ClassName = "OpenDRIM_SSHSessionSettingData"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"ManagedElement", "SettingData", "IsDefault", "IsCurrent", "IsNext", "IsMinimum", "IsMaximum", "IsPending"}; CapabilityID = "SSH_OpenDRIM_SSHSessionSettingData"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_SSHSessionSettingData.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHCapabilities.sh0000755000175000017500000000706111415301347025120 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_SSHCapabilities.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_SSHCapabilities provider module"; Name = "SSH_OpenDRIM_SSHCapabilitiesModule"; Location = "cmpiSSH_OpenDRIM_SSHCapabilitiesProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_SSHCapabilities provider"; Name = "SSH_OpenDRIM_SSHCapabilitiesProvider"; ProviderModuleName = "SSH_OpenDRIM_SSHCapabilitiesModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_SSHCapabilities provider capabilities"; ProviderModuleName = "SSH_OpenDRIM_SSHCapabilitiesModule"; ProviderName = "SSH_OpenDRIM_SSHCapabilitiesProvider"; ClassName = "OpenDRIM_SSHCapabilities"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"Caption", "Description", "Generation", "InstanceID", "ElementName", "ElementNameEditSupported", "MaxElementNameLen", "RequestedStatesSupported", "ElementNameMask", "StateAwareness", "MaxConnections", "MaxListeningPorts", "ListeningPortManagementSupported", "SupportedSSHVersions", "OtherSupportedSSHVersion", "SupportedEncryptionAlgorithms", "OtherSupportedEncryptionAlgorithm"}; SupportedMethods = {"CreateGoalSettings"}; CapabilityID = "SSH_OpenDRIM_SSHCapabilities"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_SSHCapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_HostedSSHAccessPoint.sh0000755000175000017500000000641111415301347026107 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_HostedSSHAccessPoint.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_HostedSSHAccessPoint provider module"; Name = "SSH_OpenDRIM_HostedSSHAccessPointModule"; Location = "cmpiSSH_OpenDRIM_HostedSSHAccessPointProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_HostedSSHAccessPoint provider"; Name = "SSH_OpenDRIM_HostedSSHAccessPointProvider"; ProviderModuleName = "SSH_OpenDRIM_HostedSSHAccessPointModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_HostedSSHAccessPoint provider capabilities"; ProviderModuleName = "SSH_OpenDRIM_HostedSSHAccessPointModule"; ProviderName = "SSH_OpenDRIM_HostedSSHAccessPointProvider"; ClassName = "OpenDRIM_HostedSSHAccessPoint"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent"}; CapabilityID = "SSH_OpenDRIM_HostedSSHAccessPoint"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_HostedSSHAccessPoint.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHCapabilities-remove.sh0000755000175000017500000000623511415301347026415 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$2" = pegasus then cimprovider -d -m SSH_OpenDRIM_SSHCapabilitiesModule cimprovider -r -m SSH_OpenDRIM_SSHCapabilitiesModule 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_SSHCapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHSettingData.sh0000755000175000017500000000673011415301347024740 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_SSHSettingData.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_SSHSettingData provider module"; Name = "SSH_OpenDRIM_SSHSettingDataModule"; Location = "cmpiSSH_OpenDRIM_SSHSettingDataProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_SSHSettingData provider"; Name = "SSH_OpenDRIM_SSHSettingDataProvider"; ProviderModuleName = "SSH_OpenDRIM_SSHSettingDataModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_SSHSettingData provider capabilities"; ProviderModuleName = "SSH_OpenDRIM_SSHSettingDataModule"; ProviderName = "SSH_OpenDRIM_SSHSettingDataProvider"; ClassName = "OpenDRIM_SSHSettingData"; ProviderType = {2}; Namespaces = {"$1"}; SupportedProperties = {"Caption", "Description", "Generation", "InstanceID", "ElementName", "ConfigurationName", "ChangeableType", "EnabledSSHVersions", "OtherEnabledSSHVersion", "SSHVersion", "OtherSSHVersion", "EnabledEncryptionAlgorithms", "OtherEnabledEncryptionAlgorithm", "EncryptionAlgorithm", "OtherEncryptionAlgorithm", "IdleTimeout", "KeepAlive", "ForwardX11", "Compression"}; CapabilityID = "SSH_OpenDRIM_SSHSettingData"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_SSHSettingData.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHConformsToProfile.sh0000755000175000017500000000671011415301347026141 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_SSHConformsToProfile.mof cimmof -aE -n $4 $6/mof/OpenDRIM_SSHConformsToProfile.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_SSHConformsToProfile provider module"; Name = "SSH_OpenDRIM_SSHConformsToProfileModule"; Location = "cmpiSSH_OpenDRIM_SSHConformsToProfileProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_SSHConformsToProfile provider"; Name = "SSH_OpenDRIM_SSHConformsToProfileProvider"; ProviderModuleName = "SSH_OpenDRIM_SSHConformsToProfileModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_SSHConformsToProfile provider capabilities"; ProviderModuleName = "SSH_OpenDRIM_SSHConformsToProfileModule"; ProviderName = "SSH_OpenDRIM_SSHConformsToProfileProvider"; ClassName = "OpenDRIM_SSHConformsToProfile"; ProviderType = {2, 3}; Namespaces = {"$1", "$4"}; SupportedProperties = {"ConformantStandard", "ManagedElement"}; CapabilityID = "SSH_OpenDRIM_SSHConformsToProfile"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_SSHConformsToProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE owmofc -u http://localhost/$4 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHProtocolEndpoint-remove.sh0000755000175000017500000000630511415301347027324 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$2" = pegasus then cimprovider -d -m SSH_OpenDRIM_SSHProtocolEndpointModule cimprovider -r -m SSH_OpenDRIM_SSHProtocolEndpointModule 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_SSHProtocolEndpoint.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHServiceAccessBySAP-remove.sh0000755000175000017500000000633611415301347027407 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$2" = pegasus then cimprovider -d -m SSH_OpenDRIM_SSHServiceAccessBySAPModule cimprovider -r -m SSH_OpenDRIM_SSHServiceAccessBySAPModule 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_SSHServiceAccessBySAP.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_RegisteredSSHProfile-remove.sh0000755000175000017500000000631711415301347027443 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$2" = pegasus then cimprovider -d -m SSH_OpenDRIM_RegisteredSSHProfileModule cimprovider -r -m SSH_OpenDRIM_RegisteredSSHProfileModule 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_RegisteredSSHProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$3 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_HostedSSHAccessPoint-remove.sh0000755000175000017500000000632411415301347027405 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$2" = pegasus then cimprovider -d -m SSH_OpenDRIM_HostedSSHAccessPointModule cimprovider -r -m SSH_OpenDRIM_HostedSSHAccessPointModule 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_HostedSSHAccessPoint.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint-remove.sh0000755000175000017500000000670411415301347034257 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$2" = pegasus then cimprovider -d -m SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointModule cimprovider -r -m SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointModule 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_TCPProtocolEndpointBindsToIPProtocolEndpoint.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHProtocolProvidesEndpoint.sh0000755000175000017500000000661611415301347027552 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_SSHProtocolProvidesEndpoint.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_SSHProtocolProvidesEndpoint provider module"; Name = "SSH_OpenDRIM_SSHProtocolProvidesEndpointModule"; Location = "cmpiSSH_OpenDRIM_SSHProtocolProvidesEndpointProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_SSHProtocolProvidesEndpoint provider"; Name = "SSH_OpenDRIM_SSHProtocolProvidesEndpointProvider"; ProviderModuleName = "SSH_OpenDRIM_SSHProtocolProvidesEndpointModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_SSHProtocolProvidesEndpoint provider capabilities"; ProviderModuleName = "SSH_OpenDRIM_SSHProtocolProvidesEndpointModule"; ProviderName = "SSH_OpenDRIM_SSHProtocolProvidesEndpointProvider"; ClassName = "OpenDRIM_SSHProtocolProvidesEndpoint"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent"}; CapabilityID = "SSH_OpenDRIM_SSHProtocolProvidesEndpoint"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_SSHProtocolProvidesEndpoint.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/OpenDRIM_SSHProtocolProvidesEndpoint-remove.sh0000755000175000017500000000643211415301347031041 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# if test "$2" = pegasus then cimprovider -d -m SSH_OpenDRIM_SSHProtocolProvidesEndpointModule cimprovider -r -m SSH_OpenDRIM_SSHProtocolProvidesEndpointModule 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_SSHProtocolProvidesEndpoint.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-ssh-1.0.0/registration/SSH.sh0000755000175000017500000000575011415301347021154 0ustar guillaumeguillaume#!/bin/bash ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# 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_SSHProtocolEndpoint.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_SSHProtocolCapabilities.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_TCPProtocolEndpoint.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_SSHSessionSettingData.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_SSHProtocolProvidesEndpoint.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_SSHCapabilities.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_HostedSSHAccessPoint.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_RegisteredSSHProfile.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_SSHConformsToProfile.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_SSHProtocolService.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_SSHServiceAccessBySAP.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_SSHServiceSettingData.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_SSHSettingData.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_HostedSSHService.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.sh $1 $2 $3 $4 $5 $6 if test "$3" = sfcb then /etc/init.d/sfcb start fi opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolProvidesEndpoint/0000755000175000017500000000000011415301347024470 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolProvidesEndpoint/OpenDRIM_SSHProtocolProvidesEndpoint.h0000644000175000017500000000673711415301347033707 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHPROTOCOLPROVIDESENDPOINT_H_ #define OPENDRIM_SSHPROTOCOLPROVIDESENDPOINT_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_Service.h" #include "CIM_ServiceAccess.h" #include "cmpiCIM_ProtocolEndpoint.h" #include "CIM_ProtocolEndpointAccess.h" */ const static char* OpenDRIM_SSHProtocolProvidesEndpoint_classnames[] = {"OpenDRIM_SSHProtocolProvidesEndpoint"}; static string OpenDRIM_SSHProtocolProvidesEndpoint_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"OpenDRIM_SSHProtocolService"}; const static string Antecedent_NAMESPACE = _NAMESPACE; const static string Dependent_role = "Dependent"; const static char* Dependent_classnames[] = {"OpenDRIM_SSHProtocolEndpoint"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_SSHProtocolProvidesEndpoint { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; OpenDRIM_SSHProtocolProvidesEndpoint() { Antecedent_isNULL = true; Dependent_isNULL = true; } ~OpenDRIM_SSHProtocolProvidesEndpoint() {} 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_SSHPROTOCOLPROVIDESENDPOINT_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolProvidesEndpoint/Makefile.am0000644000175000017500000000501311415301347026523 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSSH_OpenDRIM_SSHProtocolProvidesEndpointProvider.la libcmpiSSH_OpenDRIM_SSHProtocolProvidesEndpointProvider_la_SOURCES = OpenDRIM_SSHProtocolProvidesEndpointAccess.cpp OpenDRIM_SSHProtocolProvidesEndpointProvider.cpp cmpiOpenDRIM_SSHProtocolProvidesEndpoint.cpp assocOpenDRIM_SSHProtocolProvidesEndpoint.cpp # May have to be adjusted for direct invocation libcmpiSSH_OpenDRIM_SSHProtocolProvidesEndpointProvider_la_CPPFLAGS = -I../CIM_Service -I../CIM_ProtocolEndpoint # Uncomment the end for direct invocation, may have to be adjusted libcmpiSSH_OpenDRIM_SSHProtocolProvidesEndpointProvider_la_LIBADD = ../Common/libcmpiSSH_Common.la #../CIM_Service/libcmpiSSH_CIM_ServiceProvider.la ../CIM_ProtocolEndpoint/libcmpiSSH_CIM_ProtocolEndpointProvider.la libcmpiSSH_OpenDRIM_SSHProtocolProvidesEndpointProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_SSHProtocolProvidesEndpoint.h OpenDRIM_SSHProtocolProvidesEndpoint.h OpenDRIM_SSHProtocolProvidesEndpointAccess.h ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolProvidesEndpoint/OpenDRIM_SSHProtocolProvidesEndpointAccess.hopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolProvidesEndpoint/OpenDRIM_SSHProtocolProvidesEndpointAcce0000644000175000017500000001071011415301347034217 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHPROTOCOLPROVIDESENDPOINTACCESS_H_ #define OPENDRIM_SSHPROTOCOLPROVIDESENDPOINTACCESS_H_ #include "SSH_Common.h" #include "OpenDRIM_SSHProtocolProvidesEndpoint.h" #include "assocOpenDRIM_SSHProtocolProvidesEndpoint.h" int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_load(const CMPIBroker* broker, string& errorMessage); int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_unload(string& errorMessage); int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHProtocolProvidesEndpoint& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolProvidesEndpoint& newInstance, const OpenDRIM_SSHProtocolProvidesEndpoint& oldInstance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolProvidesEndpoint& instance, string& errorMessage); int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolProvidesEndpoint& instance, string& errorMessage); int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_SSHProtocolProvidesEndpoint_instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_SSHProtocolProvidesEndpoint_instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_populate(OpenDRIM_SSHProtocolProvidesEndpoint& instance, string& errorMessage); #endif /*OPENDRIM_SSHPROTOCOLPROVIDESENDPOINTACCESS_H_*/ ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolProvidesEndpoint/OpenDRIM_SSHProtocolProvidesEndpointAccess.cppopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolProvidesEndpoint/OpenDRIM_SSHProtocolProvidesEndpointAcce0000644000175000017500000002526211415301347034227 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "OpenDRIM_SSHProtocolProvidesEndpointAccess.h" int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(SSH_CIM_Service_load(broker, errorMessage)); CF_assert(SSH_CIM_ProtocolEndpoint_load(broker, errorMessage)); */ // TODO _L_; return OK; } int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(SSH_CIM_Service_unload(errorMessage)); CF_assert(SSH_CIM_ProtocolEndpoint_unload(errorMessage)); */ // TODO _L_; return OK; } int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // Determine if the association can be established or not string protocolService_systemName; CF_assert(Antecedent.getProperty("SystemName", protocolService_systemName)); string protocolEndpoint_systemName; CF_assert(Dependent.getProperty("SystemName", protocolEndpoint_systemName)); if (protocolService_systemName == protocolEndpoint_systemName) isAssociated = true; else isAssociated = false; _L_; return OK; } int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_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(SSH_OpenDRIM_SSHProtocolProvidesEndpoint_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(SSH_OpenDRIM_SSHProtocolProvidesEndpoint_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; CF_assert(SSH_OpenDRIM_SSHProtocolProvidesEndpoint_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(SSH_OpenDRIM_SSHProtocolProvidesEndpoint_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHProtocolProvidesEndpoint& 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(SSH_OpenDRIM_SSHProtocolProvidesEndpoint_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(SSH_OpenDRIM_SSHProtocolProvidesEndpoint_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(SSH_OpenDRIM_SSHProtocolProvidesEndpoint_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolProvidesEndpoint& newInstance, const OpenDRIM_SSHProtocolProvidesEndpoint& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolProvidesEndpoint& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolProvidesEndpoint& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_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(SSH_OpenDRIM_SSHProtocolProvidesEndpoint_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(SSH_OpenDRIM_SSHProtocolProvidesEndpoint_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(SSH_OpenDRIM_SSHProtocolProvidesEndpoint_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(SSH_OpenDRIM_SSHProtocolProvidesEndpoint_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(SSH_OpenDRIM_SSHProtocolProvidesEndpoint_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(SSH_OpenDRIM_SSHProtocolProvidesEndpoint_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_SSHProtocolProvidesEndpoint_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_SSHProtocolProvidesEndpoint instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); OpenDRIM_SSHProtocolProvidesEndpoint_instances.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_SSHProtocolProvidesEndpoint_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_SSHProtocolProvidesEndpoint instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); OpenDRIM_SSHProtocolProvidesEndpoint_instances.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_populate(OpenDRIM_SSHProtocolProvidesEndpoint& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolProvidesEndpoint/cmpiOpenDRIM_SSHProtocolProvidesEndpoint.cppopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolProvidesEndpoint/cmpiOpenDRIM_SSHProtocolProvidesEndpoint0000644000175000017500000000620011415301347034313 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHProtocolProvidesEndpoint.h" CMPIObjectPath* SSH_OpenDRIM_SSHProtocolProvidesEndpoint_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHProtocolProvidesEndpoint& instance) { _E_; Objectpath op(broker, OpenDRIM_SSHProtocolProvidesEndpoint_classnames[0], OpenDRIM_SSHProtocolProvidesEndpoint_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* SSH_OpenDRIM_SSHProtocolProvidesEndpoint_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHProtocolProvidesEndpoint& instance) { _E_; Objectpath op(broker, SSH_OpenDRIM_SSHProtocolProvidesEndpoint_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void SSH_OpenDRIM_SSHProtocolProvidesEndpoint_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHProtocolProvidesEndpoint& 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 SSH_OpenDRIM_SSHProtocolProvidesEndpoint_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHProtocolProvidesEndpoint& 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_; } ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolProvidesEndpoint/assocOpenDRIM_SSHProtocolProvidesEndpoint.hopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolProvidesEndpoint/assocOpenDRIM_SSHProtocolProvidesEndpoin0000644000175000017500000000627611415301347034324 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef ASSOCOPENDRIM_SSHPROTOCOLPROVIDESENDPOINT_H_ #define ASSOCOPENDRIM_SSHPROTOCOLPROVIDESENDPOINT_H_ #include "OpenDRIM_SSHProtocolProvidesEndpointAccess.h" int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_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 SSH_OpenDRIM_SSHProtocolProvidesEndpoint_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 SSH_OpenDRIM_SSHProtocolProvidesEndpoint_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_SSHPROTOCOLPROVIDESENDPOINT_H_*/ ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolProvidesEndpoint/cmpiOpenDRIM_SSHProtocolProvidesEndpoint.hopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolProvidesEndpoint/cmpiOpenDRIM_SSHProtocolProvidesEndpoint0000644000175000017500000000446211415301347034323 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef CMPIOPENDRIM_SSHPROTOCOLPROVIDESENDPOINT_H_ #define CMPIOPENDRIM_SSHPROTOCOLPROVIDESENDPOINT_H_ #include "OpenDRIM_SSHProtocolProvidesEndpoint.h" CMPIObjectPath* SSH_OpenDRIM_SSHProtocolProvidesEndpoint_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHProtocolProvidesEndpoint& instance); CMPIInstance* SSH_OpenDRIM_SSHProtocolProvidesEndpoint_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHProtocolProvidesEndpoint& instance); void SSH_OpenDRIM_SSHProtocolProvidesEndpoint_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHProtocolProvidesEndpoint& instance); void SSH_OpenDRIM_SSHProtocolProvidesEndpoint_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHProtocolProvidesEndpoint& instance); #endif /*CMPIOPENDRIM_SSHPROTOCOLPROVIDESENDPOINT_H_*/ ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolProvidesEndpoint/assocOpenDRIM_SSHProtocolProvidesEndpoint.cppopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolProvidesEndpoint/assocOpenDRIM_SSHProtocolProvidesEndpoin0000644000175000017500000002077211415301347034321 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "assocOpenDRIM_SSHProtocolProvidesEndpoint.h" int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_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 = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_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(SSH_OpenDRIM_SSHProtocolProvidesEndpoint_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(SSH_OpenDRIM_SSHProtocolProvidesEndpoint_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_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(SSH_CIM_Service_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(SSH_CIM_Service_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, SSH_CIM_Service_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_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_Service _instance; SSH_CIM_Service_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(SSH_CIM_Service_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, SSH_CIM_Service_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_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(SSH_CIM_ProtocolEndpoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(SSH_CIM_ProtocolEndpoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, SSH_CIM_ProtocolEndpoint_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_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_ProtocolEndpoint _instance; SSH_CIM_ProtocolEndpoint_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(SSH_CIM_ProtocolEndpoint_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, SSH_CIM_ProtocolEndpoint_toCMPIInstance(broker, _instance)); */ _L_; return OK; } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolProvidesEndpoint/OpenDRIM_SSHProtocolProvidesEndpointProvider.cppopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolProvidesEndpoint/OpenDRIM_SSHProtocolProvidesEndpointProv0000644000175000017500000004273311415301347034324 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHProtocolProvidesEndpoint.h" #include "OpenDRIM_SSHProtocolProvidesEndpointAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define SSH_OpenDRIM_SSHProtocolProvidesEndpointProviderSetInstance SSH_OpenDRIM_SSHProtocolProvidesEndpointProviderModifyInstance #endif int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_init(const CMPIBroker* broker); int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus SSH_OpenDRIM_SSHProtocolProvidesEndpointProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolProvidesEndpointProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolProvidesEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolProvidesEndpointProviderEnumInstances(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 = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolProvidesEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolProvidesEndpointProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHProtocolProvidesEndpoint instance; SSH_OpenDRIM_SSHProtocolProvidesEndpoint_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolProvidesEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolProvidesEndpointProviderSetInstance(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_SSHProtocolProvidesEndpoint newInstance, oldInstance; SSH_OpenDRIM_SSHProtocolProvidesEndpoint_toCPP(_broker, ci, newInstance); SSH_OpenDRIM_SSHProtocolProvidesEndpoint_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolProvidesEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolProvidesEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolProvidesEndpointProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHProtocolProvidesEndpoint instance; SSH_OpenDRIM_SSHProtocolProvidesEndpoint_toCPP(_broker, ci, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_SSHProtocolProvidesEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolProvidesEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolProvidesEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolProvidesEndpointProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHProtocolProvidesEndpoint instance; SSH_OpenDRIM_SSHProtocolProvidesEndpoint_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolProvidesEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolProvidesEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolProvidesEndpointProviderExecQuery(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 SSH_OpenDRIM_SSHProtocolProvidesEndpointProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolProvidesEndpointProviderAssociatorNames(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 = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolProvidesEndpoint_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 SSH_OpenDRIM_SSHProtocolProvidesEndpointProviderAssociators(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 = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolProvidesEndpoint_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 SSH_OpenDRIM_SSHProtocolProvidesEndpointProviderReferenceNames(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 = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolProvidesEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolProvidesEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolProvidesEndpointProviderReferences(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 = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolProvidesEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolProvidesEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHProtocolProvidesEndpoint_init FAILED: " + (string) OpenDRIM_SSHProtocolProvidesEndpoint_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolProvidesEndpoint_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_unload(errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHProtocolProvidesEndpoint_unload FAILED: " + (string) OpenDRIM_SSHProtocolProvidesEndpoint_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define SSH_OpenDRIM_SSHProtocolProvidesEndpoint_INIT if (SSH_OpenDRIM_SSHProtocolProvidesEndpoint_init(_broker) < 0) return NULL CMInstanceMIStub(SSH_OpenDRIM_SSHProtocolProvidesEndpointProvider, SSH_OpenDRIM_SSHProtocolProvidesEndpointProvider, _broker, SSH_OpenDRIM_SSHProtocolProvidesEndpoint_INIT); CMAssociationMIStub(SSH_OpenDRIM_SSHProtocolProvidesEndpointProvider, SSH_OpenDRIM_SSHProtocolProvidesEndpointProvider, _broker, SSH_OpenDRIM_SSHProtocolProvidesEndpoint_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpoint/0000755000175000017500000000000011415301347022754 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpoint/Makefile.am0000644000175000017500000000406311415301347025013 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSSH_OpenDRIM_SSHProtocolEndpointProvider.la libcmpiSSH_OpenDRIM_SSHProtocolEndpointProvider_la_SOURCES = OpenDRIM_SSHProtocolEndpointAccess.cpp OpenDRIM_SSHProtocolEndpointProvider.cpp cmpiOpenDRIM_SSHProtocolEndpoint.cpp libcmpiSSH_OpenDRIM_SSHProtocolEndpointProvider_la_LIBADD = ../Common/libcmpiSSH_Common.la libcmpiSSH_OpenDRIM_SSHProtocolEndpointProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_SSHProtocolEndpoint.h OpenDRIM_SSHProtocolEndpoint.h OpenDRIM_SSHProtocolEndpointAccess.h opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpoint/OpenDRIM_SSHProtocolEndpoint.h0000644000175000017500000004715211415301347030453 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHPROTOCOLENDPOINT_H_ #define OPENDRIM_SSHPROTOCOLENDPOINT_H_ #include const static char* OpenDRIM_SSHProtocolEndpoint_classnames[] = {"OpenDRIM_SSHProtocolEndpoint"}; static string OpenDRIM_SSHProtocolEndpoint_NAMESPACE = _NAMESPACE; class OpenDRIM_SSHProtocolEndpoint { public: string InstanceID; bool InstanceID_isNULL; string Caption; bool Caption_isNULL; string ElementName; bool ElementName_isNULL; unsigned long long Generation; bool Generation_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; bool BroadcastResetSupported; bool BroadcastResetSupported_isNULL; vector EnabledSSHVersions; bool EnabledSSHVersions_isNULL; string OtherEnabledSSHVersion; bool OtherEnabledSSHVersion_isNULL; unsigned short SSHVersion; bool SSHVersion_isNULL; string OtherSSHVersion; bool OtherSSHVersion_isNULL; vector EnabledEncryptionAlgorithms; bool EnabledEncryptionAlgorithms_isNULL; string OtherEnabledEncryptionAlgorithm; bool OtherEnabledEncryptionAlgorithm_isNULL; unsigned short EncryptionAlgorithm; bool EncryptionAlgorithm_isNULL; string OtherEncryptionAlgorithm; bool OtherEncryptionAlgorithm_isNULL; unsigned int IdleTimeout; bool IdleTimeout_isNULL; bool KeepAlive; bool KeepAlive_isNULL; bool ForwardX11; bool ForwardX11_isNULL; bool Compression; bool Compression_isNULL; OpenDRIM_SSHProtocolEndpoint() { InstanceID_isNULL = true; Caption_isNULL = true; ElementName_isNULL = true; Generation_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; BroadcastResetSupported_isNULL = true; EnabledSSHVersions_isNULL = true; OtherEnabledSSHVersion_isNULL = true; SSHVersion_isNULL = true; OtherSSHVersion_isNULL = true; EnabledEncryptionAlgorithms_isNULL = true; OtherEnabledEncryptionAlgorithm_isNULL = true; EncryptionAlgorithm_isNULL = true; OtherEncryptionAlgorithm_isNULL = true; IdleTimeout_isNULL = true; KeepAlive_isNULL = true; ForwardX11_isNULL = true; Compression_isNULL = true; } ~OpenDRIM_SSHProtocolEndpoint() {} 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 getGeneration(unsigned long long& value) const { if (Generation_isNULL==true) return NOT_FOUND; value = Generation; return OK; } int setGeneration(const unsigned long long& newValue) { Generation = newValue; Generation_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 getBroadcastResetSupported(bool& value) const { if (BroadcastResetSupported_isNULL==true) return NOT_FOUND; value = BroadcastResetSupported; return OK; } int setBroadcastResetSupported(const bool& newValue) { BroadcastResetSupported = newValue; BroadcastResetSupported_isNULL = false; return OK; } int getEnabledSSHVersions(vector& value) const { if (EnabledSSHVersions_isNULL==true) return NOT_FOUND; value = EnabledSSHVersions; return OK; } int setEnabledSSHVersions(const vector& newValue) { EnabledSSHVersions = newValue; EnabledSSHVersions_isNULL = false; return OK; } int getOtherEnabledSSHVersion(string& value) const { if (OtherEnabledSSHVersion_isNULL==true) return NOT_FOUND; value = OtherEnabledSSHVersion; return OK; } int setOtherEnabledSSHVersion(const string& newValue) { OtherEnabledSSHVersion = newValue; OtherEnabledSSHVersion_isNULL = false; return OK; } int getSSHVersion(unsigned short& value) const { if (SSHVersion_isNULL==true) return NOT_FOUND; value = SSHVersion; return OK; } int setSSHVersion(const unsigned short& newValue) { SSHVersion = newValue; SSHVersion_isNULL = false; return OK; } int getOtherSSHVersion(string& value) const { if (OtherSSHVersion_isNULL==true) return NOT_FOUND; value = OtherSSHVersion; return OK; } int setOtherSSHVersion(const string& newValue) { OtherSSHVersion = newValue; OtherSSHVersion_isNULL = false; return OK; } int getEnabledEncryptionAlgorithms(vector& value) const { if (EnabledEncryptionAlgorithms_isNULL==true) return NOT_FOUND; value = EnabledEncryptionAlgorithms; return OK; } int setEnabledEncryptionAlgorithms(const vector& newValue) { EnabledEncryptionAlgorithms = newValue; EnabledEncryptionAlgorithms_isNULL = false; return OK; } int getOtherEnabledEncryptionAlgorithm(string& value) const { if (OtherEnabledEncryptionAlgorithm_isNULL==true) return NOT_FOUND; value = OtherEnabledEncryptionAlgorithm; return OK; } int setOtherEnabledEncryptionAlgorithm(const string& newValue) { OtherEnabledEncryptionAlgorithm = newValue; OtherEnabledEncryptionAlgorithm_isNULL = false; return OK; } int getEncryptionAlgorithm(unsigned short& value) const { if (EncryptionAlgorithm_isNULL==true) return NOT_FOUND; value = EncryptionAlgorithm; return OK; } int setEncryptionAlgorithm(const unsigned short& newValue) { EncryptionAlgorithm = newValue; EncryptionAlgorithm_isNULL = false; return OK; } int getOtherEncryptionAlgorithm(string& value) const { if (OtherEncryptionAlgorithm_isNULL==true) return NOT_FOUND; value = OtherEncryptionAlgorithm; return OK; } int setOtherEncryptionAlgorithm(const string& newValue) { OtherEncryptionAlgorithm = newValue; OtherEncryptionAlgorithm_isNULL = false; return OK; } int getIdleTimeout(unsigned int& value) const { if (IdleTimeout_isNULL==true) return NOT_FOUND; value = IdleTimeout; return OK; } int setIdleTimeout(const unsigned int& newValue) { IdleTimeout = newValue; IdleTimeout_isNULL = false; return OK; } int getKeepAlive(bool& value) const { if (KeepAlive_isNULL==true) return NOT_FOUND; value = KeepAlive; return OK; } int setKeepAlive(const bool& newValue) { KeepAlive = newValue; KeepAlive_isNULL = false; return OK; } int getForwardX11(bool& value) const { if (ForwardX11_isNULL==true) return NOT_FOUND; value = ForwardX11; return OK; } int setForwardX11(const bool& newValue) { ForwardX11 = newValue; ForwardX11_isNULL = false; return OK; } int getCompression(bool& value) const { if (Compression_isNULL==true) return NOT_FOUND; value = Compression; return OK; } int setCompression(const bool& newValue) { Compression = newValue; Compression_isNULL = false; return OK; } }; class OpenDRIM_SSHProtocolEndpoint_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_SSHProtocolEndpoint_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_SSHProtocolEndpoint_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_SSHProtocolEndpoint_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_SSHProtocolEndpoint_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_SSHProtocolEndpoint_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_SSHPROTOCOLENDPOINT_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpoint/cmpiOpenDRIM_SSHProtocolEndpoint.h0000644000175000017500000000500411415301347031312 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef CMPIOPENDRIM_SSHPROTOCOLENDPOINT_H_ #define CMPIOPENDRIM_SSHPROTOCOLENDPOINT_H_ #include "OpenDRIM_SSHProtocolEndpoint.h" CMPIObjectPath* SSH_OpenDRIM_SSHProtocolEndpoint_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHProtocolEndpoint& instance); CMPIInstance* SSH_OpenDRIM_SSHProtocolEndpoint_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHProtocolEndpoint& instance); void SSH_OpenDRIM_SSHProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHProtocolEndpoint& instance); void SSH_OpenDRIM_SSHProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHProtocolEndpoint& instance); void SSH_OpenDRIM_SSHProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_SSHProtocolEndpoint_RequestStateChange_In& args); void SSH_OpenDRIM_SSHProtocolEndpoint_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_SSHProtocolEndpoint_RequestStateChange_Out& args); #endif /*CMPIOPENDRIM_SSHPROTOCOLENDPOINT_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpoint/cmpiOpenDRIM_SSHProtocolEndpoint.cpp0000644000175000017500000003206111415301347031650 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHProtocolEndpoint.h" CMPIObjectPath* SSH_OpenDRIM_SSHProtocolEndpoint_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHProtocolEndpoint& instance) { _E_; Objectpath op(broker, OpenDRIM_SSHProtocolEndpoint_classnames[0], OpenDRIM_SSHProtocolEndpoint_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* SSH_OpenDRIM_SSHProtocolEndpoint_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHProtocolEndpoint& instance) { _E_; Objectpath op(broker, SSH_OpenDRIM_SSHProtocolEndpoint_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.Generation_isNULL) ci.setProperty("Generation", instance.Generation); 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.BroadcastResetSupported_isNULL) ci.setProperty("BroadcastResetSupported", instance.BroadcastResetSupported); if (!instance.EnabledSSHVersions_isNULL) ci.setProperty("EnabledSSHVersions", instance.EnabledSSHVersions); if (!instance.OtherEnabledSSHVersion_isNULL) ci.setProperty("OtherEnabledSSHVersion", instance.OtherEnabledSSHVersion); if (!instance.SSHVersion_isNULL) ci.setProperty("SSHVersion", instance.SSHVersion); if (!instance.OtherSSHVersion_isNULL) ci.setProperty("OtherSSHVersion", instance.OtherSSHVersion); if (!instance.EnabledEncryptionAlgorithms_isNULL) ci.setProperty("EnabledEncryptionAlgorithms", instance.EnabledEncryptionAlgorithms); if (!instance.OtherEnabledEncryptionAlgorithm_isNULL) ci.setProperty("OtherEnabledEncryptionAlgorithm", instance.OtherEnabledEncryptionAlgorithm); if (!instance.EncryptionAlgorithm_isNULL) ci.setProperty("EncryptionAlgorithm", instance.EncryptionAlgorithm); if (!instance.OtherEncryptionAlgorithm_isNULL) ci.setProperty("OtherEncryptionAlgorithm", instance.OtherEncryptionAlgorithm); if (!instance.IdleTimeout_isNULL) ci.setProperty("IdleTimeout", instance.IdleTimeout); if (!instance.KeepAlive_isNULL) ci.setProperty("KeepAlive", instance.KeepAlive); if (!instance.ForwardX11_isNULL) ci.setProperty("ForwardX11", instance.ForwardX11); if (!instance.Compression_isNULL) ci.setProperty("Compression", instance.Compression); _L_; return ci.getHdl(); } void SSH_OpenDRIM_SSHProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHProtocolEndpoint& 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 SSH_OpenDRIM_SSHProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHProtocolEndpoint& 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.getProperty("Generation", instance.Generation) == OK) instance.Generation_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("BroadcastResetSupported", instance.BroadcastResetSupported) == OK) instance.BroadcastResetSupported_isNULL = false; if (inst.getProperty("EnabledSSHVersions", instance.EnabledSSHVersions) == OK) instance.EnabledSSHVersions_isNULL = false; if (inst.getProperty("OtherEnabledSSHVersion", instance.OtherEnabledSSHVersion) == OK) instance.OtherEnabledSSHVersion_isNULL = false; if (inst.getProperty("SSHVersion", instance.SSHVersion) == OK) instance.SSHVersion_isNULL = false; if (inst.getProperty("OtherSSHVersion", instance.OtherSSHVersion) == OK) instance.OtherSSHVersion_isNULL = false; if (inst.getProperty("EnabledEncryptionAlgorithms", instance.EnabledEncryptionAlgorithms) == OK) instance.EnabledEncryptionAlgorithms_isNULL = false; if (inst.getProperty("OtherEnabledEncryptionAlgorithm", instance.OtherEnabledEncryptionAlgorithm) == OK) instance.OtherEnabledEncryptionAlgorithm_isNULL = false; if (inst.getProperty("EncryptionAlgorithm", instance.EncryptionAlgorithm) == OK) instance.EncryptionAlgorithm_isNULL = false; if (inst.getProperty("OtherEncryptionAlgorithm", instance.OtherEncryptionAlgorithm) == OK) instance.OtherEncryptionAlgorithm_isNULL = false; if (inst.getProperty("IdleTimeout", instance.IdleTimeout) == OK) instance.IdleTimeout_isNULL = false; if (inst.getProperty("KeepAlive", instance.KeepAlive) == OK) instance.KeepAlive_isNULL = false; if (inst.getProperty("ForwardX11", instance.ForwardX11) == OK) instance.ForwardX11_isNULL = false; if (inst.getProperty("Compression", instance.Compression) == OK) instance.Compression_isNULL = false; _L_; } void SSH_OpenDRIM_SSHProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_SSHProtocolEndpoint_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 SSH_OpenDRIM_SSHProtocolEndpoint_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_SSHProtocolEndpoint_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-ssh-1.0.0/OpenDRIM_SSHProtocolEndpoint/OpenDRIM_SSHProtocolEndpointProvider.cpp0000644000175000017500000003405411415301347032516 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHProtocolEndpoint.h" #include "OpenDRIM_SSHProtocolEndpointAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define SSH_OpenDRIM_SSHProtocolEndpointProviderSetInstance SSH_OpenDRIM_SSHProtocolEndpointProviderModifyInstance #endif int SSH_OpenDRIM_SSHProtocolEndpoint_init(const CMPIBroker* broker); int SSH_OpenDRIM_SSHProtocolEndpoint_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus SSH_OpenDRIM_SSHProtocolEndpointProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHProtocolEndpoint_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolEndpointProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolEndpoint_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_SSHProtocolEndpoint_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolEndpointProviderEnumInstances(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 = SSH_OpenDRIM_SSHProtocolEndpoint_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = SSH_OpenDRIM_SSHProtocolEndpoint_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolEndpointProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHProtocolEndpoint instance; SSH_OpenDRIM_SSHProtocolEndpoint_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolEndpoint_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = SSH_OpenDRIM_SSHProtocolEndpoint_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolEndpointProviderSetInstance(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_SSHProtocolEndpoint newInstance, oldInstance; SSH_OpenDRIM_SSHProtocolEndpoint_toCPP(_broker, ci, newInstance); SSH_OpenDRIM_SSHProtocolEndpoint_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolEndpoint_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHProtocolEndpoint_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolEndpointProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHProtocolEndpoint instance; SSH_OpenDRIM_SSHProtocolEndpoint_toCPP(_broker, ci, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_SSHProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHProtocolEndpoint_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHProtocolEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = SSH_OpenDRIM_SSHProtocolEndpoint_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolEndpointProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHProtocolEndpoint instance; SSH_OpenDRIM_SSHProtocolEndpoint_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHProtocolEndpoint_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolEndpointProviderExecQuery(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 SSH_OpenDRIM_SSHProtocolEndpointProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHProtocolEndpoint_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolEndpointProviderInvokeMethod(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_SSHProtocolEndpoint instance; SSH_OpenDRIM_SSHProtocolEndpoint_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"SystemCreationClassName", "Name", "SystemName", "CreationClassName"}; int errorCode = SSH_OpenDRIM_SSHProtocolEndpoint_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_SSHProtocolEndpoint_RequestStateChange_In inArgs; SSH_OpenDRIM_SSHProtocolEndpoint_toCPP(_broker, in, inArgs); OpenDRIM_SSHProtocolEndpoint_RequestStateChange_Out outArgs; errorCode = SSH_OpenDRIM_SSHProtocolEndpoint_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } SSH_OpenDRIM_SSHProtocolEndpoint_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="BroadcastReset") { unsigned int returnValue; errorCode = SSH_OpenDRIM_SSHProtocolEndpoint_BroadcastReset(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else { errorMessage = (string) OpenDRIM_SSHProtocolEndpoint_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 SSH_OpenDRIM_SSHProtocolEndpoint_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolEndpoint_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHProtocolEndpoint_init FAILED: " + (string) OpenDRIM_SSHProtocolEndpoint_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolEndpoint_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolEndpoint_unload(errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHProtocolEndpoint_unload FAILED: " + (string) OpenDRIM_SSHProtocolEndpoint_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define SSH_OpenDRIM_SSHProtocolEndpoint_INIT if (SSH_OpenDRIM_SSHProtocolEndpoint_init(_broker) < 0) return NULL CMInstanceMIStub(SSH_OpenDRIM_SSHProtocolEndpointProvider, SSH_OpenDRIM_SSHProtocolEndpointProvider, _broker, SSH_OpenDRIM_SSHProtocolEndpoint_INIT); CMMethodMIStub(SSH_OpenDRIM_SSHProtocolEndpointProvider, SSH_OpenDRIM_SSHProtocolEndpointProvider, _broker, SSH_OpenDRIM_SSHProtocolEndpoint_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpoint/OpenDRIM_SSHProtocolEndpointAccess.cpp0000644000175000017500000002320611415301347032122 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "OpenDRIM_SSHProtocolEndpointAccess.h" const string systemCreationClassName = "OpenDRIM_ComputerSystem"; const string creationClassName = "OpenDRIM_SSHProtocolEndpoint"; string systemName; int SSH_OpenDRIM_SSHProtocolEndpoint_load(const CMPIBroker* broker, string& errorMessage) { _E_; CF_assert(CF_getSystemName(systemName, errorMessage)); _L_; return OK; } int SSH_OpenDRIM_SSHProtocolEndpoint_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_SSHProtocolEndpoint_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; vector endpoints; CF_getActiveSSHSessionItem(endpoints, errorMessage); for (unsigned int i = 0; i < endpoints.size(); i++) { //Initialize an instance OpenDRIM_SSHProtocolEndpoint instance; instance.setSystemCreationClassName(systemCreationClassName); instance.setSystemName(systemName); instance.setCreationClassName(creationClassName); instance.setName(endpoints[i]); if (discriminant == "ei") CF_assert(SSH_OpenDRIM_SSHProtocolEndpoint_populate(instance, errorMessage)); result.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolEndpoint_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHProtocolEndpoint& instance, const char** properties, string& errorMessage) { _E_; vector::size_type index; vector if_endpoints; CF_getActiveSSHSessionItem(if_endpoints, errorMessage); if (instance.SystemCreationClassName == systemCreationClassName && instance.CreationClassName == creationClassName && instance.SystemName == systemName && CF_foundInList(instance.Name, if_endpoints, index)) { CF_assert(SSH_OpenDRIM_SSHProtocolEndpoint_populate(instance, errorMessage)); } else { errorMessage = "Invalid path"; return NOT_FOUND; } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolEndpoint_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolEndpoint& newInstance, const OpenDRIM_SSHProtocolEndpoint& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHProtocolEndpoint_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolEndpoint& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHProtocolEndpoint_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolEndpoint& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHProtocolEndpoint_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolEndpoint& instance, unsigned int& returnValue, const OpenDRIM_SSHProtocolEndpoint_RequestStateChange_In& in, OpenDRIM_SSHProtocolEndpoint_RequestStateChange_Out& out, string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_SSHProtocolEndpoint_BroadcastReset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolEndpoint& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_SSHProtocolEndpoint_populate(OpenDRIM_SSHProtocolEndpoint& 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] ElementName * [X] EnabledSSHVersions * [X] SSHVersion * [X] EnabledEncryptionAlgorithms * [X] EncryptionAlgorithm * [X] Idle Timeout * [X] KeepAlive * [X] ForwardX11 * [X] Compression * + Conditinal: * [X] OtherEnabledSSHVersion * [X] OtherSSHVersion * [X] OtherEnabledEncryptionAlgorithm * [X] OtherEncryptionAlgorithm */ instance.setNameFormat("network-interface-name"); instance.setProtocolIFType(IFTYPE_OTHER); instance.setOtherTypeDescription("SSH"); if (instance.ProtocolIFType == IFTYPE_OTHER) instance.setElementName("SSH Session: " + instance.Name); vector enabledSSHVersions; string enabled_ssh_versions; CF_getConfigItem("Protocol", enabled_ssh_versions, errorMessage); if(enabled_ssh_versions == "1") { enabledSSHVersions.push_back(SSHV_SSHv1); instance.setSSHVersion(SSHV_SSHv1); } else if (enabled_ssh_versions == "2") { enabledSSHVersions.push_back(SSHV_SSHv2); instance.setSSHVersion(SSHV_SSHv2); } else if (enabled_ssh_versions == "2,1" ||enabled_ssh_versions == "1,2"||enabled_ssh_versions == "") { enabledSSHVersions.push_back(SSHV_SSHv1); enabledSSHVersions.push_back(SSHV_SSHv2); instance.setSSHVersion(OTHER); instance.setOtherSSHVersion("SSHv1, SSHv2"); } else { enabledSSHVersions.push_back(SSHV_UNKNOWN); instance.setSSHVersion(SSHV_UNKNOWN); } instance.setEnabledSSHVersions(enabledSSHVersions); /* maybe needed to modified */ vector enabledEncryptionAlgorithms; enabledEncryptionAlgorithms.push_back(OTHER); enabledEncryptionAlgorithms.push_back(DES3); enabledEncryptionAlgorithms.push_back(RC4); instance.setEnabledEncryptionAlgorithms(enabledEncryptionAlgorithms); /* CIM Shcema 2.25.0 Final release version vector otherEnabledEncryptionAlgorithm; otherEnabledEncryptionAlgorithm.push_back("AES"); otherEnabledEncryptionAlgorithm.push_back("BLOWFISH"); otherEnabledEncryptionAlgorithm.push_back("CAST"); instance.setOtherEnabledEncryptionAlgorithm(otherEnabledEncryptionAlgorithm); */ // CIM Shcema 2.25.0 Experimental release version instance.setOtherEnabledEncryptionAlgorithm("AES, BLOWFISH, CAST"); string encryptionAlgorithm; CF_getConfigItem("Ciphers", encryptionAlgorithm, errorMessage); if (encryptionAlgorithm.size() != 0) { instance.setEncryptionAlgorithm(OTHER); /* CIM Shcema 2.25.0 Final release version vector otherEncryptionAlgorithm; otherEncryptionAlgorithm.push_back(encryptionAlgorithm); instance.setOtherEncryptionAlgorithm(otherEncryptionAlgorithm); */ // CIM Shcema 2.25.0 Experimental release version instance.setOtherEncryptionAlgorithm(encryptionAlgorithm); } else { instance.setEncryptionAlgorithm(OTHER); /* CIM Shcema 2.25.0 Final release version vector otherEncryptionAlgorithm; otherEncryptionAlgorithm.push_back("aes128-cbc"); otherEncryptionAlgorithm.push_back("3des-cbc"); otherEncryptionAlgorithm.push_back("blowfish-cbc"); otherEncryptionAlgorithm.push_back("cast128-cbc"); otherEncryptionAlgorithm.push_back("arcfour128"); otherEncryptionAlgorithm.push_back("arcfour256"); otherEncryptionAlgorithm.push_back("arcfour"); otherEncryptionAlgorithm.push_back("aes192-cbc"); otherEncryptionAlgorithm.push_back("aes256-cbc"); otherEncryptionAlgorithm.push_back("aes128-ctr"); otherEncryptionAlgorithm.push_back("aes192-ctr"); otherEncryptionAlgorithm.push_back("aes256-ctr"); */ // CIM Shcema 2.25.0 Experimental release version string otherEncryptionAlgorithm; otherEncryptionAlgorithm = "aes128-cbc, "; otherEncryptionAlgorithm += "3des-cbc, "; otherEncryptionAlgorithm += "blowfish-cbc, "; otherEncryptionAlgorithm += "cast128-cbc, "; otherEncryptionAlgorithm += "arcfour128, "; otherEncryptionAlgorithm += "arcfour256, "; otherEncryptionAlgorithm += "arcfour, "; otherEncryptionAlgorithm += "aes192-cbc, "; otherEncryptionAlgorithm += "aes256-cbc, "; otherEncryptionAlgorithm += "aes128-ctr, "; otherEncryptionAlgorithm += "aes192-ctr, "; otherEncryptionAlgorithm += "aes256-ctr"; instance.setOtherEncryptionAlgorithm(otherEncryptionAlgorithm); } instance.setIdleTimeout(0); string config_str; CF_getConfigItem("KeepAlive",config_str, errorMessage); instance.setKeepAlive(!CF_startsWithNoCase(config_str, "no")); CF_getConfigItem("X11Forwarding", config_str, errorMessage); instance.setForwardX11(CF_startsWithNoCase(config_str, "yes")); CF_getConfigItem("Compression", config_str, errorMessage); instance.setCompression(!CF_startsWithNoCase(config_str, "no")); _L_; return OK; } opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpoint/OpenDRIM_SSHProtocolEndpointAccess.h0000644000175000017500000000671111415301347031571 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHPROTOCOLENDPOINTACCESS_H_ #define OPENDRIM_SSHPROTOCOLENDPOINTACCESS_H_ #include "SSH_Common.h" #include "OpenDRIM_SSHProtocolEndpoint.h" int SSH_OpenDRIM_SSHProtocolEndpoint_load(const CMPIBroker* broker, string& errorMessage); int SSH_OpenDRIM_SSHProtocolEndpoint_unload(string& errorMessage); int SSH_OpenDRIM_SSHProtocolEndpoint_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHProtocolEndpoint_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHProtocolEndpoint& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHProtocolEndpoint_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolEndpoint& newInstance, const OpenDRIM_SSHProtocolEndpoint& oldInstance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHProtocolEndpoint_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolEndpoint& instance, string& errorMessage); int SSH_OpenDRIM_SSHProtocolEndpoint_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolEndpoint& instance, string& errorMessage); int SSH_OpenDRIM_SSHProtocolEndpoint_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolEndpoint& instance, unsigned int& returnValue, const OpenDRIM_SSHProtocolEndpoint_RequestStateChange_In& in, OpenDRIM_SSHProtocolEndpoint_RequestStateChange_Out& out, string& errorMessage); int SSH_OpenDRIM_SSHProtocolEndpoint_BroadcastReset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolEndpoint& instance, unsigned int& returnValue, string& errorMessage); int SSH_OpenDRIM_SSHProtocolEndpoint_populate(OpenDRIM_SSHProtocolEndpoint& instance, string& errorMessage); #endif /*OPENDRIM_SSHPROTOCOLENDPOINTACCESS_H_*/ opendrim-lmp-ssh-1.0.0/VERSION0000644000175000017500000000000611415301347016503 0ustar guillaumeguillaume1.0.0 opendrim-lmp-ssh-1.0.0/test/0000755000175000017500000000000011415301347016416 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/test/testOpenDRIM_HostedSSHAccessPoint.cpp0000644000175000017500000001117711415301347025426 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_HostedSSHAccessPoint.h" #include "OpenDRIM_HostedSSHAccessPointAccess.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_HostedSSHAccessPoint& instance) { os << " [OpenDRIM_HostedSSHAccessPoint]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); os << " [\\OpenDRIM_HostedSSHAccessPoint]" << endl; return os; } int main() { string errorMessage; int errorCode = SSH_OpenDRIM_HostedSSHAccessPoint_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = SSH_OpenDRIM_HostedSSHAccessPoint_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 = SSH_OpenDRIM_HostedSSHAccessPoint_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 = SSH_OpenDRIM_HostedSSHAccessPoint_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 = SSH_OpenDRIM_HostedSSHAccessPoint_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ssh-1.0.0/test/Makefile.am0000644000175000017500000002261011415301347020453 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# noinst_PROGRAMS = testOpenDRIM_SSHProtocolEndpoint testOpenDRIM_SSHProtocolCapabilities testOpenDRIM_TCPProtocolEndpoint testOpenDRIM_SSHSessionSettingData testOpenDRIM_SSHProtocolProvidesEndpoint testOpenDRIM_SSHCapabilities testOpenDRIM_HostedSSHAccessPoint testOpenDRIM_RegisteredSSHProfile testOpenDRIM_SSHConformsToProfile testOpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint testOpenDRIM_SSHProtocolService testOpenDRIM_SSHServiceAccessBySAP testOpenDRIM_SSHServiceSettingData testOpenDRIM_SSHSettingData testOpenDRIM_HostedSSHService testOpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint testOpenDRIM_SSHProtocolEndpoint_CPPFLAGS = -I../OpenDRIM_SSHProtocolEndpoint/ testOpenDRIM_SSHProtocolEndpoint_SOURCES = testOpenDRIM_SSHProtocolEndpoint.cpp testOpenDRIM_SSHProtocolEndpoint_LDADD = ../OpenDRIM_SSHProtocolEndpoint/libcmpiSSH_OpenDRIM_SSHProtocolEndpointProvider.la test-OpenDRIM_SSHProtocolEndpoint: testOpenDRIM_SSHProtocolEndpoint ./testOpenDRIM_SSHProtocolEndpoint # May have to be adjusted for direct invocation testOpenDRIM_SSHProtocolCapabilities_CPPFLAGS = -I../OpenDRIM_SSHProtocolCapabilities/ -I../null/ -I../null/ testOpenDRIM_SSHProtocolCapabilities_SOURCES = testOpenDRIM_SSHProtocolCapabilities.cpp testOpenDRIM_SSHProtocolCapabilities_LDADD = ../OpenDRIM_SSHProtocolCapabilities/libcmpiSSH_OpenDRIM_SSHProtocolCapabilitiesProvider.la test-OpenDRIM_SSHProtocolCapabilities: testOpenDRIM_SSHProtocolCapabilities ./testOpenDRIM_SSHProtocolCapabilities testOpenDRIM_TCPProtocolEndpoint_CPPFLAGS = -I../OpenDRIM_TCPProtocolEndpoint/ testOpenDRIM_TCPProtocolEndpoint_SOURCES = testOpenDRIM_TCPProtocolEndpoint.cpp testOpenDRIM_TCPProtocolEndpoint_LDADD = ../OpenDRIM_TCPProtocolEndpoint/libcmpiSSH_OpenDRIM_TCPProtocolEndpointProvider.la test-OpenDRIM_TCPProtocolEndpoint: testOpenDRIM_TCPProtocolEndpoint ./testOpenDRIM_TCPProtocolEndpoint # May have to be adjusted for direct invocation testOpenDRIM_SSHSessionSettingData_CPPFLAGS = -I../OpenDRIM_SSHSessionSettingData/ -I../null/ -I../null/ testOpenDRIM_SSHSessionSettingData_SOURCES = testOpenDRIM_SSHSessionSettingData.cpp testOpenDRIM_SSHSessionSettingData_LDADD = ../OpenDRIM_SSHSessionSettingData/libcmpiSSH_OpenDRIM_SSHSessionSettingDataProvider.la test-OpenDRIM_SSHSessionSettingData: testOpenDRIM_SSHSessionSettingData ./testOpenDRIM_SSHSessionSettingData # May have to be adjusted for direct invocation testOpenDRIM_SSHProtocolProvidesEndpoint_CPPFLAGS = -I../OpenDRIM_SSHProtocolProvidesEndpoint/ -I../null/ -I../null/ testOpenDRIM_SSHProtocolProvidesEndpoint_SOURCES = testOpenDRIM_SSHProtocolProvidesEndpoint.cpp testOpenDRIM_SSHProtocolProvidesEndpoint_LDADD = ../OpenDRIM_SSHProtocolProvidesEndpoint/libcmpiSSH_OpenDRIM_SSHProtocolProvidesEndpointProvider.la test-OpenDRIM_SSHProtocolProvidesEndpoint: testOpenDRIM_SSHProtocolProvidesEndpoint ./testOpenDRIM_SSHProtocolProvidesEndpoint testOpenDRIM_SSHCapabilities_CPPFLAGS = -I../OpenDRIM_SSHCapabilities/ testOpenDRIM_SSHCapabilities_SOURCES = testOpenDRIM_SSHCapabilities.cpp testOpenDRIM_SSHCapabilities_LDADD = ../OpenDRIM_SSHCapabilities/libcmpiSSH_OpenDRIM_SSHCapabilitiesProvider.la test-OpenDRIM_SSHCapabilities: testOpenDRIM_SSHCapabilities ./testOpenDRIM_SSHCapabilities testOpenDRIM_HostedSSHAccessPoint_CPPFLAGS = -I../OpenDRIM_HostedSSHAccessPoint/ testOpenDRIM_HostedSSHAccessPoint_SOURCES = testOpenDRIM_HostedSSHAccessPoint.cpp testOpenDRIM_HostedSSHAccessPoint_LDADD = ../OpenDRIM_HostedSSHAccessPoint/libcmpiSSH_OpenDRIM_HostedSSHAccessPointProvider.la test-OpenDRIM_HostedSSHAccessPoint: testOpenDRIM_HostedSSHAccessPoint ./testOpenDRIM_HostedSSHAccessPoint testOpenDRIM_RegisteredSSHProfile_CPPFLAGS = -I../OpenDRIM_RegisteredSSHProfile/ testOpenDRIM_RegisteredSSHProfile_SOURCES = testOpenDRIM_RegisteredSSHProfile.cpp testOpenDRIM_RegisteredSSHProfile_LDADD = ../OpenDRIM_RegisteredSSHProfile/libcmpiSSH_OpenDRIM_RegisteredSSHProfileProvider.la test-OpenDRIM_RegisteredSSHProfile: testOpenDRIM_RegisteredSSHProfile ./testOpenDRIM_RegisteredSSHProfile # May have to be adjusted for direct invocation testOpenDRIM_SSHConformsToProfile_CPPFLAGS = -I../OpenDRIM_SSHConformsToProfile/ -I../null/ -I../null/ testOpenDRIM_SSHConformsToProfile_SOURCES = testOpenDRIM_SSHConformsToProfile.cpp testOpenDRIM_SSHConformsToProfile_LDADD = ../OpenDRIM_SSHConformsToProfile/libcmpiSSH_OpenDRIM_SSHConformsToProfileProvider.la test-OpenDRIM_SSHConformsToProfile: testOpenDRIM_SSHConformsToProfile ./testOpenDRIM_SSHConformsToProfile # May have to be adjusted for direct invocation testOpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_CPPFLAGS = -I../OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/ -I../null/ -I../null/ testOpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_SOURCES = testOpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.cpp testOpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_LDADD = ../OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/libcmpiSSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProvider.la test-OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint: testOpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint ./testOpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint testOpenDRIM_SSHProtocolService_CPPFLAGS = -I../OpenDRIM_SSHProtocolService/ testOpenDRIM_SSHProtocolService_SOURCES = testOpenDRIM_SSHProtocolService.cpp testOpenDRIM_SSHProtocolService_LDADD = ../OpenDRIM_SSHProtocolService/libcmpiSSH_OpenDRIM_SSHProtocolServiceProvider.la test-OpenDRIM_SSHProtocolService: testOpenDRIM_SSHProtocolService ./testOpenDRIM_SSHProtocolService # May have to be adjusted for direct invocation testOpenDRIM_SSHServiceAccessBySAP_CPPFLAGS = -I../OpenDRIM_SSHServiceAccessBySAP/ -I../null/ -I../null/ testOpenDRIM_SSHServiceAccessBySAP_SOURCES = testOpenDRIM_SSHServiceAccessBySAP.cpp testOpenDRIM_SSHServiceAccessBySAP_LDADD = ../OpenDRIM_SSHServiceAccessBySAP/libcmpiSSH_OpenDRIM_SSHServiceAccessBySAPProvider.la test-OpenDRIM_SSHServiceAccessBySAP: testOpenDRIM_SSHServiceAccessBySAP ./testOpenDRIM_SSHServiceAccessBySAP # May have to be adjusted for direct invocation testOpenDRIM_SSHServiceSettingData_CPPFLAGS = -I../OpenDRIM_SSHServiceSettingData/ -I../null/ -I../null/ testOpenDRIM_SSHServiceSettingData_SOURCES = testOpenDRIM_SSHServiceSettingData.cpp testOpenDRIM_SSHServiceSettingData_LDADD = ../OpenDRIM_SSHServiceSettingData/libcmpiSSH_OpenDRIM_SSHServiceSettingDataProvider.la test-OpenDRIM_SSHServiceSettingData: testOpenDRIM_SSHServiceSettingData ./testOpenDRIM_SSHServiceSettingData testOpenDRIM_SSHSettingData_CPPFLAGS = -I../OpenDRIM_SSHSettingData/ testOpenDRIM_SSHSettingData_SOURCES = testOpenDRIM_SSHSettingData.cpp testOpenDRIM_SSHSettingData_LDADD = ../OpenDRIM_SSHSettingData/libcmpiSSH_OpenDRIM_SSHSettingDataProvider.la test-OpenDRIM_SSHSettingData: testOpenDRIM_SSHSettingData ./testOpenDRIM_SSHSettingData # May have to be adjusted for direct invocation testOpenDRIM_HostedSSHService_CPPFLAGS = -I../OpenDRIM_HostedSSHService/ -I../null/ -I../null/ testOpenDRIM_HostedSSHService_SOURCES = testOpenDRIM_HostedSSHService.cpp testOpenDRIM_HostedSSHService_LDADD = ../OpenDRIM_HostedSSHService/libcmpiSSH_OpenDRIM_HostedSSHServiceProvider.la test-OpenDRIM_HostedSSHService: testOpenDRIM_HostedSSHService ./testOpenDRIM_HostedSSHService # May have to be adjusted for direct invocation testOpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_CPPFLAGS = -I../OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/ -I../null/ -I../null/ testOpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_SOURCES = testOpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.cpp testOpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_LDADD = ../OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/libcmpiSSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProvider.la test-OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint: testOpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint ./testOpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint opendrim-lmp-ssh-1.0.0/test/testOpenDRIM_SSHProtocolProvidesEndpoint.cpp0000644000175000017500000001132311415301347027053 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHProtocolProvidesEndpoint.h" #include "OpenDRIM_SSHProtocolProvidesEndpointAccess.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_SSHProtocolProvidesEndpoint& instance) { os << " [OpenDRIM_SSHProtocolProvidesEndpoint]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); os << " [\\OpenDRIM_SSHProtocolProvidesEndpoint]" << endl; return os; } int main() { string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_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 = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_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 = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_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 = SSH_OpenDRIM_SSHProtocolProvidesEndpoint_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ssh-1.0.0/test/testOpenDRIM_TCPProtocolEndpoint.cpp0000644000175000017500000001517611415301347025342 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_TCPProtocolEndpoint.h" #include "OpenDRIM_TCPProtocolEndpointAccess.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_TCPProtocolEndpoint& instance) { os << " [OpenDRIM_TCPProtocolEndpoint]" << endl; ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("Caption", Caption, Caption_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("Generation", Generation, Generation_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); ToString("OtherTypeDescription", OtherTypeDescription, OtherTypeDescription_isNULL); ToString("BroadcastResetSupported", BroadcastResetSupported, BroadcastResetSupported_isNULL); ToString("PortNumber", PortNumber, PortNumber_isNULL); ToStringInt("ProtocolIFType", ProtocolIFType, ProtocolIFType_isNULL); os << " [\\OpenDRIM_TCPProtocolEndpoint]" << endl; return os; } int main() { string errorMessage; int errorCode = SSH_OpenDRIM_TCPProtocolEndpoint_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = SSH_OpenDRIM_TCPProtocolEndpoint_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 = SSH_OpenDRIM_TCPProtocolEndpoint_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 = SSH_OpenDRIM_TCPProtocolEndpoint_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 = SSH_OpenDRIM_TCPProtocolEndpoint_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ssh-1.0.0/test/testOpenDRIM_HostedSSHService.cpp0000644000175000017500000001111711415301347024605 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_HostedSSHService.h" #include "OpenDRIM_HostedSSHServiceAccess.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_HostedSSHService& instance) { os << " [OpenDRIM_HostedSSHService]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); os << " [\\OpenDRIM_HostedSSHService]" << endl; return os; } int main() { string errorMessage; int errorCode = SSH_OpenDRIM_HostedSSHService_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = SSH_OpenDRIM_HostedSSHService_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 = SSH_OpenDRIM_HostedSSHService_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 = SSH_OpenDRIM_HostedSSHService_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 = SSH_OpenDRIM_HostedSSHService_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ssh-1.0.0/test/testOpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.cpp0000644000175000017500000001163711415301347032277 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.h" #include "OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointAccess.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_TCPProtocolEndpointBindsToIPProtocolEndpoint& instance) { os << " [OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); os << " [\\OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint]" << endl; return os; } int main() { string errorMessage; int errorCode = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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 = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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 = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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 = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ssh-1.0.0/test/testOpenDRIM_SSHSessionSettingData.cpp0000644000175000017500000001174411415301347025617 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHSessionSettingData.h" #include "OpenDRIM_SSHSessionSettingDataAccess.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_SSHSessionSettingData& instance) { os << " [OpenDRIM_SSHSessionSettingData]" << endl; ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL); ToStringRef("SettingData", SettingData, SettingData_isNULL); ToStringInt("IsDefault", IsDefault, IsDefault_isNULL); ToStringInt("IsCurrent", IsCurrent, IsCurrent_isNULL); ToStringInt("IsNext", IsNext, IsNext_isNULL); ToStringInt("IsMinimum", IsMinimum, IsMinimum_isNULL); ToStringInt("IsMaximum", IsMaximum, IsMaximum_isNULL); ToStringInt("IsPending", IsPending, IsPending_isNULL); os << " [\\OpenDRIM_SSHSessionSettingData]" << endl; return os; } int main() { string errorMessage; int errorCode = SSH_OpenDRIM_SSHSessionSettingData_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = SSH_OpenDRIM_SSHSessionSettingData_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 = SSH_OpenDRIM_SSHSessionSettingData_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 = SSH_OpenDRIM_SSHSessionSettingData_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 = SSH_OpenDRIM_SSHSessionSettingData_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ssh-1.0.0/test/testOpenDRIM_SSHProtocolCapabilities.cpp0000644000175000017500000001140711415301347026153 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHProtocolCapabilities.h" #include "OpenDRIM_SSHProtocolCapabilitiesAccess.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_SSHProtocolCapabilities& instance) { os << " [OpenDRIM_SSHProtocolCapabilities]" << endl; ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL); ToStringRef("Capabilities", Capabilities, Capabilities_isNULL); ToStringArrayInt("Characteristics", Characteristics, Characteristics_isNULL); os << " [\\OpenDRIM_SSHProtocolCapabilities]" << endl; return os; } int main() { string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolCapabilities_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = SSH_OpenDRIM_SSHProtocolCapabilities_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 = SSH_OpenDRIM_SSHProtocolCapabilities_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 = SSH_OpenDRIM_SSHProtocolCapabilities_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 = SSH_OpenDRIM_SSHProtocolCapabilities_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ssh-1.0.0/test/testOpenDRIM_SSHConformsToProfile.cpp0000644000175000017500000001124611415301347025453 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHConformsToProfile.h" #include "OpenDRIM_SSHConformsToProfileAccess.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_SSHConformsToProfile& instance) { os << " [OpenDRIM_SSHConformsToProfile]" << endl; ToStringRef("ConformantStandard", ConformantStandard, ConformantStandard_isNULL); ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL); os << " [\\OpenDRIM_SSHConformsToProfile]" << endl; return os; } int main() { string errorMessage; int errorCode = SSH_OpenDRIM_SSHConformsToProfile_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = SSH_OpenDRIM_SSHConformsToProfile_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 = SSH_OpenDRIM_SSHConformsToProfile_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 = SSH_OpenDRIM_SSHConformsToProfile_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 = SSH_OpenDRIM_SSHConformsToProfile_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ssh-1.0.0/test/testOpenDRIM_SSHProtocolEndpoint.cpp0000644000175000017500000001700111415301347025336 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHProtocolEndpoint.h" #include "OpenDRIM_SSHProtocolEndpointAccess.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_SSHProtocolEndpoint& instance) { os << " [OpenDRIM_SSHProtocolEndpoint]" << endl; ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("Caption", Caption, Caption_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("Generation", Generation, Generation_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); ToString("BroadcastResetSupported", BroadcastResetSupported, BroadcastResetSupported_isNULL); ToStringArrayInt("EnabledSSHVersions", EnabledSSHVersions, EnabledSSHVersions_isNULL); ToString("OtherEnabledSSHVersion", OtherEnabledSSHVersion, OtherEnabledSSHVersion_isNULL); ToStringInt("SSHVersion", SSHVersion, SSHVersion_isNULL); ToString("OtherSSHVersion", OtherSSHVersion, OtherSSHVersion_isNULL); ToStringArrayInt("EnabledEncryptionAlgorithms", EnabledEncryptionAlgorithms, EnabledEncryptionAlgorithms_isNULL); ToString("OtherEnabledEncryptionAlgorithm", OtherEnabledEncryptionAlgorithm, OtherEnabledEncryptionAlgorithm_isNULL); ToStringInt("EncryptionAlgorithm", EncryptionAlgorithm, EncryptionAlgorithm_isNULL); ToString("OtherEncryptionAlgorithm", OtherEncryptionAlgorithm, OtherEncryptionAlgorithm_isNULL); ToString("IdleTimeout", IdleTimeout, IdleTimeout_isNULL); ToString("KeepAlive", KeepAlive, KeepAlive_isNULL); ToString("ForwardX11", ForwardX11, ForwardX11_isNULL); ToString("Compression", Compression, Compression_isNULL); os << " [\\OpenDRIM_SSHProtocolEndpoint]" << endl; return os; } int main() { string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolEndpoint_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = SSH_OpenDRIM_SSHProtocolEndpoint_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 = SSH_OpenDRIM_SSHProtocolEndpoint_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 = SSH_OpenDRIM_SSHProtocolEndpoint_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 = SSH_OpenDRIM_SSHProtocolEndpoint_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ssh-1.0.0/test/testOpenDRIM_SSHProtocolService.cpp0000644000175000017500000001535011415301347025163 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHProtocolService.h" #include "OpenDRIM_SSHProtocolServiceAccess.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_SSHProtocolService& instance) { os << " [OpenDRIM_SSHProtocolService]" << endl; ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("Generation", Generation, Generation_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("PrimaryOwnerName", PrimaryOwnerName, PrimaryOwnerName_isNULL); ToString("PrimaryOwnerContact", PrimaryOwnerContact, PrimaryOwnerContact_isNULL); ToString("StartMode", StartMode, StartMode_isNULL); ToString("Started", Started, Started_isNULL); ToStringInt("Protocol", Protocol, Protocol_isNULL); ToString("OtherProtocol", OtherProtocol, OtherProtocol_isNULL); ToStringInt("MaxConnections", MaxConnections, MaxConnections_isNULL); ToStringInt("CurrentActiveConnections", CurrentActiveConnections, CurrentActiveConnections_isNULL); os << " [\\OpenDRIM_SSHProtocolService]" << endl; return os; } int main() { string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolService_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = SSH_OpenDRIM_SSHProtocolService_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 = SSH_OpenDRIM_SSHProtocolService_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 = SSH_OpenDRIM_SSHProtocolService_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 = SSH_OpenDRIM_SSHProtocolService_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ssh-1.0.0/test/testOpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.cpp0000644000175000017500000001165311415301347032422 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.h" #include "OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointAccess.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_SSHProtocolEndpointBindsToTCPProtocolEndpoint& instance) { os << " [OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); os << " [\\OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint]" << endl; return os; } int main() { string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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 = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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 = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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 = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ssh-1.0.0/test/testOpenDRIM_RegisteredSSHProfile.cpp0000644000175000017500000001306611415301347025461 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredSSHProfile.h" #include "OpenDRIM_RegisteredSSHProfileAccess.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_RegisteredSSHProfile& instance) { os << " [OpenDRIM_RegisteredSSHProfile]" << endl; ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("Generation", Generation, Generation_isNULL); ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("OtherSpecificationType", OtherSpecificationType, OtherSpecificationType_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); ToStringInt("SpecificationType", SpecificationType, SpecificationType_isNULL); ToStringArray("ImplementedFeatures", ImplementedFeatures, ImplementedFeatures_isNULL); os << " [\\OpenDRIM_RegisteredSSHProfile]" << endl; return os; } int main() { string errorMessage; int errorCode = SSH_OpenDRIM_RegisteredSSHProfile_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = SSH_OpenDRIM_RegisteredSSHProfile_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 = SSH_OpenDRIM_RegisteredSSHProfile_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 = SSH_OpenDRIM_RegisteredSSHProfile_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 = SSH_OpenDRIM_RegisteredSSHProfile_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ssh-1.0.0/test/testOpenDRIM_SSHSettingData.cpp0000644000175000017500000001346211415301347024252 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHSettingData.h" #include "OpenDRIM_SSHSettingDataAccess.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_SSHSettingData& instance) { os << " [OpenDRIM_SSHSettingData]" << endl; ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("Generation", Generation, Generation_isNULL); ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("ConfigurationName", ConfigurationName, ConfigurationName_isNULL); ToStringInt("ChangeableType", ChangeableType, ChangeableType_isNULL); ToStringArrayInt("EnabledSSHVersions", EnabledSSHVersions, EnabledSSHVersions_isNULL); ToString("OtherEnabledSSHVersion", OtherEnabledSSHVersion, OtherEnabledSSHVersion_isNULL); ToStringInt("SSHVersion", SSHVersion, SSHVersion_isNULL); ToStringArray("OtherSSHVersion", OtherSSHVersion, OtherSSHVersion_isNULL); ToStringArrayInt("EnabledEncryptionAlgorithms", EnabledEncryptionAlgorithms, EnabledEncryptionAlgorithms_isNULL); ToStringArray("OtherEnabledEncryptionAlgorithm", OtherEnabledEncryptionAlgorithm, OtherEnabledEncryptionAlgorithm_isNULL); ToStringInt("EncryptionAlgorithm", EncryptionAlgorithm, EncryptionAlgorithm_isNULL); ToString("OtherEncryptionAlgorithm", OtherEncryptionAlgorithm, OtherEncryptionAlgorithm_isNULL); ToString("IdleTimeout", IdleTimeout, IdleTimeout_isNULL); ToString("KeepAlive", KeepAlive, KeepAlive_isNULL); ToString("ForwardX11", ForwardX11, ForwardX11_isNULL); ToString("Compression", Compression, Compression_isNULL); os << " [\\OpenDRIM_SSHSettingData]" << endl; return os; } int main() { string errorMessage; int errorCode = SSH_OpenDRIM_SSHSettingData_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = SSH_OpenDRIM_SSHSettingData_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 = SSH_OpenDRIM_SSHSettingData_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 = SSH_OpenDRIM_SSHSettingData_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 = SSH_OpenDRIM_SSHSettingData_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ssh-1.0.0/test/testOpenDRIM_SSHServiceSettingData.cpp0000644000175000017500000001174411415301347025574 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHServiceSettingData.h" #include "OpenDRIM_SSHServiceSettingDataAccess.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_SSHServiceSettingData& instance) { os << " [OpenDRIM_SSHServiceSettingData]" << endl; ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL); ToStringRef("SettingData", SettingData, SettingData_isNULL); ToStringInt("IsDefault", IsDefault, IsDefault_isNULL); ToStringInt("IsCurrent", IsCurrent, IsCurrent_isNULL); ToStringInt("IsNext", IsNext, IsNext_isNULL); ToStringInt("IsMinimum", IsMinimum, IsMinimum_isNULL); ToStringInt("IsMaximum", IsMaximum, IsMaximum_isNULL); ToStringInt("IsPending", IsPending, IsPending_isNULL); os << " [\\OpenDRIM_SSHServiceSettingData]" << endl; return os; } int main() { string errorMessage; int errorCode = SSH_OpenDRIM_SSHServiceSettingData_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = SSH_OpenDRIM_SSHServiceSettingData_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 = SSH_OpenDRIM_SSHServiceSettingData_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 = SSH_OpenDRIM_SSHServiceSettingData_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 = SSH_OpenDRIM_SSHServiceSettingData_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ssh-1.0.0/test/testOpenDRIM_SSHServiceAccessBySAP.cpp0000644000175000017500000001121311415301347025414 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHServiceAccessBySAP.h" #include "OpenDRIM_SSHServiceAccessBySAPAccess.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_SSHServiceAccessBySAP& instance) { os << " [OpenDRIM_SSHServiceAccessBySAP]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); os << " [\\OpenDRIM_SSHServiceAccessBySAP]" << endl; return os; } int main() { string errorMessage; int errorCode = SSH_OpenDRIM_SSHServiceAccessBySAP_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = SSH_OpenDRIM_SSHServiceAccessBySAP_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 = SSH_OpenDRIM_SSHServiceAccessBySAP_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 = SSH_OpenDRIM_SSHServiceAccessBySAP_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 = SSH_OpenDRIM_SSHServiceAccessBySAP_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ssh-1.0.0/test/testOpenDRIM_SSHCapabilities.cpp0000644000175000017500000001353311415301347024433 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHCapabilities.h" #include "OpenDRIM_SSHCapabilitiesAccess.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_SSHCapabilities& instance) { os << " [OpenDRIM_SSHCapabilities]" << endl; ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("Generation", Generation, Generation_isNULL); ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("ElementNameEditSupported", ElementNameEditSupported, ElementNameEditSupported_isNULL); ToStringInt("MaxElementNameLen", MaxElementNameLen, MaxElementNameLen_isNULL); ToStringArrayInt("RequestedStatesSupported", RequestedStatesSupported, RequestedStatesSupported_isNULL); ToString("ElementNameMask", ElementNameMask, ElementNameMask_isNULL); ToStringArrayInt("StateAwareness", StateAwareness, StateAwareness_isNULL); ToStringInt("MaxConnections", MaxConnections, MaxConnections_isNULL); ToStringInt("MaxListeningPorts", MaxListeningPorts, MaxListeningPorts_isNULL); ToString("ListeningPortManagementSupported", ListeningPortManagementSupported, ListeningPortManagementSupported_isNULL); ToStringArrayInt("SupportedSSHVersions", SupportedSSHVersions, SupportedSSHVersions_isNULL); ToString("OtherSupportedSSHVersion", OtherSupportedSSHVersion, OtherSupportedSSHVersion_isNULL); ToStringArrayInt("SupportedEncryptionAlgorithms", SupportedEncryptionAlgorithms, SupportedEncryptionAlgorithms_isNULL); ToString("OtherSupportedEncryptionAlgorithm", OtherSupportedEncryptionAlgorithm, OtherSupportedEncryptionAlgorithm_isNULL); os << " [\\OpenDRIM_SSHCapabilities]" << endl; return os; } int main() { string errorMessage; int errorCode = SSH_OpenDRIM_SSHCapabilities_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = SSH_OpenDRIM_SSHCapabilities_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 = SSH_OpenDRIM_SSHCapabilities_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 = SSH_OpenDRIM_SSHCapabilities_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 = SSH_OpenDRIM_SSHCapabilities_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolCapabilities/0000755000175000017500000000000011415301347023565 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolCapabilities/OpenDRIM_SSHProtocolCapabilitiesAccess.cpp0000644000175000017500000002542211415301347033546 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "OpenDRIM_SSHProtocolCapabilitiesAccess.h" int SSH_OpenDRIM_SSHProtocolCapabilities_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(SSH_CIM_Capabilities_load(broker, errorMessage)); CF_assert(SSH_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int SSH_OpenDRIM_SSHProtocolCapabilities_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(SSH_CIM_Capabilities_unload(errorMessage)); CF_assert(SSH_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int SSH_OpenDRIM_SSHProtocolCapabilities_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 SSH_OpenDRIM_SSHProtocolCapabilities_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(SSH_OpenDRIM_SSHProtocolCapabilities_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(SSH_OpenDRIM_SSHProtocolCapabilities_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; CF_assert(SSH_OpenDRIM_SSHProtocolCapabilities_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(SSH_OpenDRIM_SSHProtocolCapabilities_referenceCapabilitiesToManagedElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolCapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHProtocolCapabilities& 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(SSH_OpenDRIM_SSHProtocolCapabilities_getCapabilities(broker, ctx, Capabilities_objectpath, Capabilities_instance, NULL, errorMessage)); Objectpath ManagedElement_objectpath; instance.getManagedElement(ManagedElement_objectpath); Instance ManagedElement_instance; CF_assert(SSH_OpenDRIM_SSHProtocolCapabilities_getManagedElement(broker, ctx, ManagedElement_objectpath, ManagedElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(SSH_OpenDRIM_SSHProtocolCapabilities_isAssociated(Capabilities_instance, ManagedElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } CF_assert(SSH_OpenDRIM_SSHProtocolCapabilities_populate(instance, errorMessage)); _L_; return OK; } int SSH_OpenDRIM_SSHProtocolCapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolCapabilities& newInstance, const OpenDRIM_SSHProtocolCapabilities& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHProtocolCapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHProtocolCapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHProtocolCapabilities_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(SSH_OpenDRIM_SSHProtocolCapabilities_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(SSH_OpenDRIM_SSHProtocolCapabilities_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(SSH_OpenDRIM_SSHProtocolCapabilities_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(SSH_OpenDRIM_SSHProtocolCapabilities_enumerateCapabilitiess(broker, ctx, Capabilities_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(SSH_OpenDRIM_SSHProtocolCapabilities_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(SSH_OpenDRIM_SSHProtocolCapabilities_enumerateCapabilitiess(broker, ctx, Capabilities_instances, properties, false, errorMessage)); } for (size_t i=0; i& ManagedElement_instances, vector& OpenDRIM_SSHProtocolCapabilities_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_SSHProtocolCapabilities instance; instance.setCapabilities(((Instance) Capabilities_instance).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instances[i]).getObjectpath()); if (discriminant == "r") { CF_assert(SSH_OpenDRIM_SSHProtocolCapabilities_populate(instance, errorMessage)); } OpenDRIM_SSHProtocolCapabilities_instances.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolCapabilities_referenceManagedElementToCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& Capabilities_instances, vector& OpenDRIM_SSHProtocolCapabilities_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_SSHProtocolCapabilities instance; instance.setCapabilities(((Instance) Capabilities_instances[i]).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instance).getObjectpath()); if (discriminant == "r") { CF_assert(SSH_OpenDRIM_SSHProtocolCapabilities_populate(instance, errorMessage)); } OpenDRIM_SSHProtocolCapabilities_instances.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolCapabilities_populate(OpenDRIM_SSHProtocolCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolCapabilities/Makefile.am0000644000175000017500000000474411415301347025632 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSSH_OpenDRIM_SSHProtocolCapabilitiesProvider.la libcmpiSSH_OpenDRIM_SSHProtocolCapabilitiesProvider_la_SOURCES = OpenDRIM_SSHProtocolCapabilitiesAccess.cpp OpenDRIM_SSHProtocolCapabilitiesProvider.cpp cmpiOpenDRIM_SSHProtocolCapabilities.cpp assocOpenDRIM_SSHProtocolCapabilities.cpp # May have to be adjusted for direct invocation libcmpiSSH_OpenDRIM_SSHProtocolCapabilitiesProvider_la_CPPFLAGS = -I../CIM_Capabilities -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiSSH_OpenDRIM_SSHProtocolCapabilitiesProvider_la_LIBADD = ../Common/libcmpiSSH_Common.la #../CIM_Capabilities/libcmpiSSH_CIM_CapabilitiesProvider.la ../CIM_ManagedElement/libcmpiSSH_CIM_ManagedElementProvider.la libcmpiSSH_OpenDRIM_SSHProtocolCapabilitiesProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_SSHProtocolCapabilities.h OpenDRIM_SSHProtocolCapabilities.h OpenDRIM_SSHProtocolCapabilitiesAccess.h opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolCapabilities/OpenDRIM_SSHProtocolCapabilitiesAccess.h0000644000175000017500000001062011415301347033205 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHPROTOCOLCAPABILITIESACCESS_H_ #define OPENDRIM_SSHPROTOCOLCAPABILITIESACCESS_H_ #include "SSH_Common.h" #include "OpenDRIM_SSHProtocolCapabilities.h" #include "assocOpenDRIM_SSHProtocolCapabilities.h" int SSH_OpenDRIM_SSHProtocolCapabilities_load(const CMPIBroker* broker, string& errorMessage); int SSH_OpenDRIM_SSHProtocolCapabilities_unload(string& errorMessage); int SSH_OpenDRIM_SSHProtocolCapabilities_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHProtocolCapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHProtocolCapabilities& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHProtocolCapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolCapabilities& newInstance, const OpenDRIM_SSHProtocolCapabilities& oldInstance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHProtocolCapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolCapabilities& instance, string& errorMessage); int SSH_OpenDRIM_SSHProtocolCapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolCapabilities& instance, string& errorMessage); int SSH_OpenDRIM_SSHProtocolCapabilities_associatorCapabilitiesToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Capabilities_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHProtocolCapabilities_associatorManagedElementToCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const char** properties, vector& Capabilities_associatedInstances, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHProtocolCapabilities_referenceCapabilitiesToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Capabilities_instance, const vector& ManagedElement_instances, vector& OpenDRIM_SSHProtocolCapabilities_instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHProtocolCapabilities_referenceManagedElementToCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& Capabilities_instances, vector& OpenDRIM_SSHProtocolCapabilities_instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHProtocolCapabilities_populate(OpenDRIM_SSHProtocolCapabilities& instance, string& errorMessage); #endif /*OPENDRIM_SSHPROTOCOLCAPABILITIESACCESS_H_*/ ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolCapabilities/OpenDRIM_SSHProtocolCapabilitiesProvider.cppopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolCapabilities/OpenDRIM_SSHProtocolCapabilitiesProvider.cpp0000644000175000017500000004221711415301347034140 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHProtocolCapabilities.h" #include "OpenDRIM_SSHProtocolCapabilitiesAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define SSH_OpenDRIM_SSHProtocolCapabilitiesProviderSetInstance SSH_OpenDRIM_SSHProtocolCapabilitiesProviderModifyInstance #endif int SSH_OpenDRIM_SSHProtocolCapabilities_init(const CMPIBroker* broker); int SSH_OpenDRIM_SSHProtocolCapabilities_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus SSH_OpenDRIM_SSHProtocolCapabilitiesProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHProtocolCapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolCapabilitiesProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolCapabilities_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_SSHProtocolCapabilities_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolCapabilitiesProviderEnumInstances(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 = SSH_OpenDRIM_SSHProtocolCapabilities_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = SSH_OpenDRIM_SSHProtocolCapabilities_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolCapabilitiesProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHProtocolCapabilities instance; SSH_OpenDRIM_SSHProtocolCapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolCapabilities_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = SSH_OpenDRIM_SSHProtocolCapabilities_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolCapabilitiesProviderSetInstance(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_SSHProtocolCapabilities newInstance, oldInstance; SSH_OpenDRIM_SSHProtocolCapabilities_toCPP(_broker, ci, newInstance); SSH_OpenDRIM_SSHProtocolCapabilities_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolCapabilities_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHProtocolCapabilities_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolCapabilitiesProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHProtocolCapabilities instance; SSH_OpenDRIM_SSHProtocolCapabilities_toCPP(_broker, ci, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_SSHProtocolCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHProtocolCapabilities_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHProtocolCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = SSH_OpenDRIM_SSHProtocolCapabilities_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolCapabilitiesProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHProtocolCapabilities instance; SSH_OpenDRIM_SSHProtocolCapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHProtocolCapabilities_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolCapabilitiesProviderExecQuery(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 SSH_OpenDRIM_SSHProtocolCapabilitiesProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHProtocolCapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolCapabilitiesProviderAssociatorNames(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 = SSH_OpenDRIM_SSHProtocolCapabilities_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolCapabilities_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 SSH_OpenDRIM_SSHProtocolCapabilitiesProviderAssociators(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 = SSH_OpenDRIM_SSHProtocolCapabilities_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolCapabilities_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 SSH_OpenDRIM_SSHProtocolCapabilitiesProviderReferenceNames(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 = SSH_OpenDRIM_SSHProtocolCapabilities_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = SSH_OpenDRIM_SSHProtocolCapabilities_referenceCapabilitiesToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = SSH_OpenDRIM_SSHProtocolCapabilities_referenceManagedElementToCapabilities(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_SSHProtocolCapabilities_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolCapabilitiesProviderReferences(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 = SSH_OpenDRIM_SSHProtocolCapabilities_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = SSH_OpenDRIM_SSHProtocolCapabilities_referenceCapabilitiesToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = SSH_OpenDRIM_SSHProtocolCapabilities_referenceManagedElementToCapabilities(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = SSH_OpenDRIM_SSHProtocolCapabilities_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int SSH_OpenDRIM_SSHProtocolCapabilities_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolCapabilities_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHProtocolCapabilities_init FAILED: " + (string) OpenDRIM_SSHProtocolCapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolCapabilities_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolCapabilities_unload(errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHProtocolCapabilities_unload FAILED: " + (string) OpenDRIM_SSHProtocolCapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define SSH_OpenDRIM_SSHProtocolCapabilities_INIT if (SSH_OpenDRIM_SSHProtocolCapabilities_init(_broker) < 0) return NULL CMInstanceMIStub(SSH_OpenDRIM_SSHProtocolCapabilitiesProvider, SSH_OpenDRIM_SSHProtocolCapabilitiesProvider, _broker, SSH_OpenDRIM_SSHProtocolCapabilities_INIT); CMAssociationMIStub(SSH_OpenDRIM_SSHProtocolCapabilitiesProvider, SSH_OpenDRIM_SSHProtocolCapabilitiesProvider, _broker, SSH_OpenDRIM_SSHProtocolCapabilities_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolCapabilities/OpenDRIM_SSHProtocolCapabilities.h0000644000175000017500000000772611415301347032100 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHPROTOCOLCAPABILITIES_H_ #define OPENDRIM_SSHPROTOCOLCAPABILITIES_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_SSHProtocolCapabilities_classnames[] = {"OpenDRIM_SSHProtocolCapabilities"}; static string OpenDRIM_SSHProtocolCapabilities_NAMESPACE = _NAMESPACE; const static string Capabilities_role = "Capabilities"; const static char* Capabilities_classnames[] = {"OpenDRIM_SSHCapabilities"}; const static string Capabilities_NAMESPACE = _NAMESPACE; const static string ManagedElement_role = "ManagedElement"; const static char* ManagedElement_classnames[] = {"OpenDRIM_SSHProtocolService"}; const static string ManagedElement_NAMESPACE = _NAMESPACE; class OpenDRIM_SSHProtocolCapabilities { public: Objectpath ManagedElement; bool ManagedElement_isNULL; Objectpath Capabilities; bool Capabilities_isNULL; vector Characteristics; bool Characteristics_isNULL; OpenDRIM_SSHProtocolCapabilities() { ManagedElement_isNULL = true; Capabilities_isNULL = true; Characteristics_isNULL = true; } ~OpenDRIM_SSHProtocolCapabilities() {} 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_SSHPROTOCOLCAPABILITIES_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolCapabilities/cmpiOpenDRIM_SSHProtocolCapabilities.cpp0000644000175000017500000000655411415301347033302 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHProtocolCapabilities.h" CMPIObjectPath* SSH_OpenDRIM_SSHProtocolCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHProtocolCapabilities& instance) { _E_; Objectpath op(broker, OpenDRIM_SSHProtocolCapabilities_classnames[0], OpenDRIM_SSHProtocolCapabilities_NAMESPACE); if (!instance.ManagedElement_isNULL) op.addKey("ManagedElement", instance.ManagedElement); if (!instance.Capabilities_isNULL) op.addKey("Capabilities", instance.Capabilities); _L_; return op.getHdl(); } CMPIInstance* SSH_OpenDRIM_SSHProtocolCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHProtocolCapabilities& instance) { _E_; Objectpath op(broker, SSH_OpenDRIM_SSHProtocolCapabilities_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.Characteristics_isNULL) ci.setProperty("Characteristics", instance.Characteristics); _L_; return ci.getHdl(); } void SSH_OpenDRIM_SSHProtocolCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHProtocolCapabilities& 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 SSH_OpenDRIM_SSHProtocolCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHProtocolCapabilities& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("ManagedElement", instance.ManagedElement) == OK) instance.ManagedElement_isNULL = false; if (inst.getProperty("Capabilities", instance.Capabilities) == OK) instance.Capabilities_isNULL = false; if (inst.getProperty("Characteristics", instance.Characteristics) == OK) instance.Characteristics_isNULL = false; _L_; } opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolCapabilities/cmpiOpenDRIM_SSHProtocolCapabilities.h0000644000175000017500000000440211415301347032735 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef CMPIOPENDRIM_SSHPROTOCOLCAPABILITIES_H_ #define CMPIOPENDRIM_SSHPROTOCOLCAPABILITIES_H_ #include "OpenDRIM_SSHProtocolCapabilities.h" CMPIObjectPath* SSH_OpenDRIM_SSHProtocolCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHProtocolCapabilities& instance); CMPIInstance* SSH_OpenDRIM_SSHProtocolCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHProtocolCapabilities& instance); void SSH_OpenDRIM_SSHProtocolCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHProtocolCapabilities& instance); void SSH_OpenDRIM_SSHProtocolCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHProtocolCapabilities& instance); #endif /*CMPIOPENDRIM_SSHPROTOCOLCAPABILITIES_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolCapabilities/assocOpenDRIM_SSHProtocolCapabilities.h0000644000175000017500000000624411415301347033123 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef ASSOCOPENDRIM_SSHPROTOCOLCAPABILITIES_H_ #define ASSOCOPENDRIM_SSHPROTOCOLCAPABILITIES_H_ #include "OpenDRIM_SSHProtocolCapabilitiesAccess.h" int SSH_OpenDRIM_SSHProtocolCapabilities_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 SSH_OpenDRIM_SSHProtocolCapabilities_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 SSH_OpenDRIM_SSHProtocolCapabilities_enumerateCapabilitiess(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int SSH_OpenDRIM_SSHProtocolCapabilities_getCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHProtocolCapabilities_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int SSH_OpenDRIM_SSHProtocolCapabilities_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_SSHPROTOCOLCAPABILITIES_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolCapabilities/assocOpenDRIM_SSHProtocolCapabilities.cpp0000644000175000017500000002110211415301347033444 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "assocOpenDRIM_SSHProtocolCapabilities.h" int SSH_OpenDRIM_SSHProtocolCapabilities_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 = SSH_OpenDRIM_SSHProtocolCapabilities_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(SSH_OpenDRIM_SSHProtocolCapabilities_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(SSH_OpenDRIM_SSHProtocolCapabilities_associatorManagedElementToCapabilities(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolCapabilities_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(SSH_CIM_Capabilities_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(SSH_CIM_Capabilities_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, SSH_CIM_Capabilities_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int SSH_OpenDRIM_SSHProtocolCapabilities_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; SSH_CIM_Capabilities_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(SSH_CIM_Capabilities_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, SSH_CIM_Capabilities_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int SSH_OpenDRIM_SSHProtocolCapabilities_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(SSH_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(SSH_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, SSH_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int SSH_OpenDRIM_SSHProtocolCapabilities_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; SSH_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(SSH_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, SSH_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-ssh-1.0.0/acinclude.m40000644000175000017500000002106611415301347017635 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# AC_DEFUN([SHOW_COPYRIGHT], [ echo "################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public 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-ssh-1.0.0/Common/0000755000175000017500000000000011415301347016667 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/Common/Makefile.am0000644000175000017500000000335211415301347020726 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# commonlibdir = @COMMONLIBDIR@ commonlib_LTLIBRARIES = libcmpiSSH_Common.la libcmpiSSH_Common_la_SOURCES = SSH_Common.cpp libcmpiSSH_Common_la_LDFLAGS = -avoid-version libcmpiSSH_Common_la_LIBADD = -lopendrim noinst_HEADERS = SSH_Common.h opendrim-lmp-ssh-1.0.0/Common/SSH_Common.cpp0000644000175000017500000000435611415301347021350 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "SSH_Common.h" int CF_getConfigItem(const string& configItem, string& out_str, string& errorMessage) { string cmd = "grep -r "+configItem +" "+SSH_CONFIG_FILE; string out; CF_assert(CF_runCommandFL(cmd, out, errorMessage)); out_str = out.substr(out.find(" ")+1); return OK; } int CF_getActiveSSHSessionItem(vector& itemValue, string& errorMessage) { string cmd = "netstat -tn|grep tcp|grep ':22 ' |awk '{print $5}'|grep -v :22"; string cmd_output, stdErr; vector output; CF_assert(CF_runCommand(cmd, cmd_output, stdErr, errorMessage)); output.clear(); CF_splitText(output, cmd_output, '\n'); for (int i = 0; i # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef SSH_COMMON_H_ #define SSH_COMMON_H_ #include #include // Define EnableDefault Constants #define ED_ENABLE 2 #define ED_DISENABLE 3 //Define ProtocolIFType Constants #define IFTYPE_TCP 4111 #define IFTYPE_SSH 4401 #define IFTYPE_OTHER 1 //Define SSH Versions #define SSHV_UNKNOWN 0 #define SSHV_OTHER 1 #define SSHV_SSHv1 2 #define SSHV_SSHv2 3 //Define SSH Encription Algorithms #define UNKOWN 0 #define OTHER 1 #define DES 2 #define DES3 3 #define RC4 4 #define IDEA 5 #define SKIPJACK 6 const string SSH_CONFIG_FILE = "/etc/ssh/sshd_config"; // int CF_getConfigItem(const string& configItem, string& out_str, string& errorMessage); //get ip+port from active ssh session int CF_getActiveSSHSessionItem(vector& itemValue, string& errorMessage); #endif /*SSH_COMMON_H_*/ opendrim-lmp-ssh-1.0.0/configure.ac0000644000175000017500000001326011415301347017727 0ustar guillaumeguillaume# Process this file with autoconf to produce a configure script. ################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# 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), SSH provider package Copyright (C) 2010 Feng Zhanlei This program is being developed under the "OpenDRIM" project. The "OpenDRIM" project web page: http://opendrim.sourceforge.net The "OpenDRIM" project mailing list: opendrim@googlegroups.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public 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(SSH 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_SSHProtocolEndpoint/Makefile OpenDRIM_SSHProtocolCapabilities/Makefile OpenDRIM_TCPProtocolEndpoint/Makefile OpenDRIM_SSHSessionSettingData/Makefile OpenDRIM_SSHProtocolProvidesEndpoint/Makefile OpenDRIM_SSHCapabilities/Makefile OpenDRIM_HostedSSHAccessPoint/Makefile OpenDRIM_RegisteredSSHProfile/Makefile OpenDRIM_SSHConformsToProfile/Makefile OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/Makefile OpenDRIM_SSHProtocolService/Makefile OpenDRIM_SSHServiceAccessBySAP/Makefile OpenDRIM_SSHServiceSettingData/Makefile OpenDRIM_SSHSettingData/Makefile OpenDRIM_HostedSSHService/Makefile OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/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-ssh-1.0.0/OpenDRIM_HostedSSHService/0000755000175000017500000000000011415301347022221 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/OpenDRIM_HostedSSHService/Makefile.am0000644000175000017500000000455111415301347024262 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSSH_OpenDRIM_HostedSSHServiceProvider.la libcmpiSSH_OpenDRIM_HostedSSHServiceProvider_la_SOURCES = OpenDRIM_HostedSSHServiceAccess.cpp OpenDRIM_HostedSSHServiceProvider.cpp cmpiOpenDRIM_HostedSSHService.cpp assocOpenDRIM_HostedSSHService.cpp # May have to be adjusted for direct invocation libcmpiSSH_OpenDRIM_HostedSSHServiceProvider_la_CPPFLAGS = -I../CIM_System -I../CIM_Service # Uncomment the end for direct invocation, may have to be adjusted libcmpiSSH_OpenDRIM_HostedSSHServiceProvider_la_LIBADD = ../Common/libcmpiSSH_Common.la #../CIM_System/libcmpiSSH_CIM_SystemProvider.la ../CIM_Service/libcmpiSSH_CIM_ServiceProvider.la libcmpiSSH_OpenDRIM_HostedSSHServiceProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_HostedSSHService.h OpenDRIM_HostedSSHService.h OpenDRIM_HostedSSHServiceAccess.h opendrim-lmp-ssh-1.0.0/OpenDRIM_HostedSSHService/OpenDRIM_HostedSSHServiceProvider.cpp0000644000175000017500000004077511415301347031237 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_HostedSSHService.h" #include "OpenDRIM_HostedSSHServiceAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define SSH_OpenDRIM_HostedSSHServiceProviderSetInstance SSH_OpenDRIM_HostedSSHServiceProviderModifyInstance #endif int SSH_OpenDRIM_HostedSSHService_init(const CMPIBroker* broker); int SSH_OpenDRIM_HostedSSHService_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus SSH_OpenDRIM_HostedSSHServiceProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_HostedSSHService_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_HostedSSHServiceProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = SSH_OpenDRIM_HostedSSHService_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_HostedSSHService_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_HostedSSHServiceProviderEnumInstances(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 = SSH_OpenDRIM_HostedSSHService_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = SSH_OpenDRIM_HostedSSHService_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_HostedSSHServiceProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_HostedSSHService instance; SSH_OpenDRIM_HostedSSHService_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_HostedSSHService_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = SSH_OpenDRIM_HostedSSHService_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_HostedSSHServiceProviderSetInstance(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_HostedSSHService newInstance, oldInstance; SSH_OpenDRIM_HostedSSHService_toCPP(_broker, ci, newInstance); SSH_OpenDRIM_HostedSSHService_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = SSH_OpenDRIM_HostedSSHService_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_HostedSSHService_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_HostedSSHServiceProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_HostedSSHService instance; SSH_OpenDRIM_HostedSSHService_toCPP(_broker, ci, instance); string errorMessage; int errorCode = SSH_OpenDRIM_HostedSSHService_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_HostedSSHService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_HostedSSHService_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_HostedSSHService_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = SSH_OpenDRIM_HostedSSHService_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_HostedSSHServiceProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_HostedSSHService instance; SSH_OpenDRIM_HostedSSHService_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_HostedSSHService_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_HostedSSHService_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_HostedSSHServiceProviderExecQuery(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 SSH_OpenDRIM_HostedSSHServiceProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_HostedSSHService_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_HostedSSHServiceProviderAssociatorNames(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 = SSH_OpenDRIM_HostedSSHService_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHService_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 SSH_OpenDRIM_HostedSSHServiceProviderAssociators(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 = SSH_OpenDRIM_HostedSSHService_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHService_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 SSH_OpenDRIM_HostedSSHServiceProviderReferenceNames(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 = SSH_OpenDRIM_HostedSSHService_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = SSH_OpenDRIM_HostedSSHService_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = SSH_OpenDRIM_HostedSSHService_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_HostedSSHService_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus SSH_OpenDRIM_HostedSSHServiceProviderReferences(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 = SSH_OpenDRIM_HostedSSHService_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = SSH_OpenDRIM_HostedSSHService_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = SSH_OpenDRIM_HostedSSHService_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = SSH_OpenDRIM_HostedSSHService_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int SSH_OpenDRIM_HostedSSHService_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = SSH_OpenDRIM_HostedSSHService_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_HostedSSHService_init FAILED: " + (string) OpenDRIM_HostedSSHService_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int SSH_OpenDRIM_HostedSSHService_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = SSH_OpenDRIM_HostedSSHService_unload(errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_HostedSSHService_unload FAILED: " + (string) OpenDRIM_HostedSSHService_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define SSH_OpenDRIM_HostedSSHService_INIT if (SSH_OpenDRIM_HostedSSHService_init(_broker) < 0) return NULL CMInstanceMIStub(SSH_OpenDRIM_HostedSSHServiceProvider, SSH_OpenDRIM_HostedSSHServiceProvider, _broker, SSH_OpenDRIM_HostedSSHService_INIT); CMAssociationMIStub(SSH_OpenDRIM_HostedSSHServiceProvider, SSH_OpenDRIM_HostedSSHServiceProvider, _broker, SSH_OpenDRIM_HostedSSHService_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_HostedSSHService/cmpiOpenDRIM_HostedSSHService.h0000644000175000017500000000425611415301347030034 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef CMPIOPENDRIM_HOSTEDSSHSERVICE_H_ #define CMPIOPENDRIM_HOSTEDSSHSERVICE_H_ #include "OpenDRIM_HostedSSHService.h" CMPIObjectPath* SSH_OpenDRIM_HostedSSHService_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_HostedSSHService& instance); CMPIInstance* SSH_OpenDRIM_HostedSSHService_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_HostedSSHService& instance); void SSH_OpenDRIM_HostedSSHService_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_HostedSSHService& instance); void SSH_OpenDRIM_HostedSSHService_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_HostedSSHService& instance); #endif /*CMPIOPENDRIM_HOSTEDSSHSERVICE_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_HostedSSHService/cmpiOpenDRIM_HostedSSHService.cpp0000644000175000017500000000577411415301347030375 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_HostedSSHService.h" CMPIObjectPath* SSH_OpenDRIM_HostedSSHService_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_HostedSSHService& instance) { _E_; Objectpath op(broker, OpenDRIM_HostedSSHService_classnames[0], OpenDRIM_HostedSSHService_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* SSH_OpenDRIM_HostedSSHService_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_HostedSSHService& instance) { _E_; Objectpath op(broker, SSH_OpenDRIM_HostedSSHService_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void SSH_OpenDRIM_HostedSSHService_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_HostedSSHService& 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 SSH_OpenDRIM_HostedSSHService_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_HostedSSHService& 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-ssh-1.0.0/OpenDRIM_HostedSSHService/assocOpenDRIM_HostedSSHService.cpp0000644000175000017500000002037211415301347030544 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "assocOpenDRIM_HostedSSHService.h" int SSH_OpenDRIM_HostedSSHService_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 = SSH_OpenDRIM_HostedSSHService_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(SSH_OpenDRIM_HostedSSHService_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(SSH_OpenDRIM_HostedSSHService_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int SSH_OpenDRIM_HostedSSHService_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(SSH_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(SSH_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, SSH_CIM_System_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int SSH_OpenDRIM_HostedSSHService_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; SSH_CIM_System_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(SSH_CIM_System_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, SSH_CIM_System_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int SSH_OpenDRIM_HostedSSHService_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(SSH_CIM_Service_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(SSH_CIM_Service_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, SSH_CIM_Service_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int SSH_OpenDRIM_HostedSSHService_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_Service _instance; SSH_CIM_Service_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(SSH_CIM_Service_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, SSH_CIM_Service_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-ssh-1.0.0/OpenDRIM_HostedSSHService/assocOpenDRIM_HostedSSHService.h0000644000175000017500000000612011415301347030204 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef ASSOCOPENDRIM_HOSTEDSSHSERVICE_H_ #define ASSOCOPENDRIM_HOSTEDSSHSERVICE_H_ #include "OpenDRIM_HostedSSHServiceAccess.h" int SSH_OpenDRIM_HostedSSHService_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 SSH_OpenDRIM_HostedSSHService_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 SSH_OpenDRIM_HostedSSHService_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int SSH_OpenDRIM_HostedSSHService_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_HostedSSHService_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int SSH_OpenDRIM_HostedSSHService_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_HOSTEDSSHSERVICE_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_HostedSSHService/OpenDRIM_HostedSSHService.h0000644000175000017500000000654311415301347027164 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_HOSTEDSSHSERVICE_H_ #define OPENDRIM_HOSTEDSSHSERVICE_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_System.h" #include "CIM_SystemAccess.h" #include "cmpiCIM_Service.h" #include "CIM_ServiceAccess.h" */ const static char* OpenDRIM_HostedSSHService_classnames[] = {"OpenDRIM_HostedSSHService"}; static string OpenDRIM_HostedSSHService_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_SSHProtocolService"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_HostedSSHService { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; OpenDRIM_HostedSSHService() { Antecedent_isNULL = true; Dependent_isNULL = true; } ~OpenDRIM_HostedSSHService() {} 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_HOSTEDSSHSERVICE_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_HostedSSHService/OpenDRIM_HostedSSHServiceAccess.h0000644000175000017500000001022411415301347030275 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_HOSTEDSSHSERVICEACCESS_H_ #define OPENDRIM_HOSTEDSSHSERVICEACCESS_H_ #include "SSH_Common.h" #include "OpenDRIM_HostedSSHService.h" #include "assocOpenDRIM_HostedSSHService.h" int SSH_OpenDRIM_HostedSSHService_load(const CMPIBroker* broker, string& errorMessage); int SSH_OpenDRIM_HostedSSHService_unload(string& errorMessage); int SSH_OpenDRIM_HostedSSHService_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_HostedSSHService_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_HostedSSHService& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_HostedSSHService_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedSSHService& newInstance, const OpenDRIM_HostedSSHService& oldInstance, const char** properties, string& errorMessage); int SSH_OpenDRIM_HostedSSHService_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedSSHService& instance, string& errorMessage); int SSH_OpenDRIM_HostedSSHService_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedSSHService& instance, string& errorMessage); int SSH_OpenDRIM_HostedSSHService_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_HostedSSHService_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_HostedSSHService_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_HostedSSHService_instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_HostedSSHService_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_HostedSSHService_instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_HostedSSHService_populate(OpenDRIM_HostedSSHService& instance, string& errorMessage); #endif /*OPENDRIM_HOSTEDSSHSERVICEACCESS_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_HostedSSHService/OpenDRIM_HostedSSHServiceAccess.cpp0000644000175000017500000002422511415301347030636 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "OpenDRIM_HostedSSHServiceAccess.h" int SSH_OpenDRIM_HostedSSHService_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(SSH_CIM_System_load(broker, errorMessage)); CF_assert(SSH_CIM_Service_load(broker, errorMessage)); */ // TODO _L_; return OK; } int SSH_OpenDRIM_HostedSSHService_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(SSH_CIM_System_unload(errorMessage)); CF_assert(SSH_CIM_Service_unload(errorMessage)); */ // TODO _L_; return OK; } int SSH_OpenDRIM_HostedSSHService_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // Determine if the association can be established or not string computerSystem_name; CF_assert(Antecedent.getProperty("Name", computerSystem_name)); string protocolService_systemName; CF_assert(Dependent.getProperty("SystemName", protocolService_systemName)); if (computerSystem_name==protocolService_systemName) isAssociated=true; else isAssociated=false; _L_; return OK; } int SSH_OpenDRIM_HostedSSHService_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(SSH_OpenDRIM_HostedSSHService_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(SSH_OpenDRIM_HostedSSHService_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; CF_assert(SSH_OpenDRIM_HostedSSHService_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(SSH_OpenDRIM_HostedSSHService_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int SSH_OpenDRIM_HostedSSHService_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_HostedSSHService& 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(SSH_OpenDRIM_HostedSSHService_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(SSH_OpenDRIM_HostedSSHService_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(SSH_OpenDRIM_HostedSSHService_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int SSH_OpenDRIM_HostedSSHService_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedSSHService& newInstance, const OpenDRIM_HostedSSHService& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_HostedSSHService_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedSSHService& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_HostedSSHService_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedSSHService& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_HostedSSHService_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(SSH_OpenDRIM_HostedSSHService_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(SSH_OpenDRIM_HostedSSHService_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(SSH_OpenDRIM_HostedSSHService_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(SSH_OpenDRIM_HostedSSHService_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(SSH_OpenDRIM_HostedSSHService_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(SSH_OpenDRIM_HostedSSHService_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_HostedSSHService_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_HostedSSHService instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); OpenDRIM_HostedSSHService_instances.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_HostedSSHService_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_HostedSSHService_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_HostedSSHService instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); OpenDRIM_HostedSSHService_instances.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_HostedSSHService_populate(OpenDRIM_HostedSSHService& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-ssh-1.0.0/OpenDRIM_HostedSSHAccessPoint/0000755000175000017500000000000011415301347023034 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/OpenDRIM_HostedSSHAccessPoint/Makefile.am0000644000175000017500000000467211415301347025101 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSSH_OpenDRIM_HostedSSHAccessPointProvider.la libcmpiSSH_OpenDRIM_HostedSSHAccessPointProvider_la_SOURCES = OpenDRIM_HostedSSHAccessPointAccess.cpp OpenDRIM_HostedSSHAccessPointProvider.cpp cmpiOpenDRIM_HostedSSHAccessPoint.cpp assocOpenDRIM_HostedSSHAccessPoint.cpp # May have to be adjusted for direct invocation libcmpiSSH_OpenDRIM_HostedSSHAccessPointProvider_la_CPPFLAGS = -I../CIM_System -I../CIM_ServiceAccessPoint # Uncomment the end for direct invocation, may have to be adjusted libcmpiSSH_OpenDRIM_HostedSSHAccessPointProvider_la_LIBADD = ../Common/libcmpiSSH_Common.la #../CIM_System/libcmpiSSH_CIM_SystemProvider.la ../CIM_ServiceAccessPoint/libcmpiSSH_CIM_ServiceAccessPointProvider.la libcmpiSSH_OpenDRIM_HostedSSHAccessPointProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_HostedSSHAccessPoint.h OpenDRIM_HostedSSHAccessPoint.h OpenDRIM_HostedSSHAccessPointAccess.h opendrim-lmp-ssh-1.0.0/OpenDRIM_HostedSSHAccessPoint/cmpiOpenDRIM_HostedSSHAccessPoint.cpp0000644000175000017500000000605411415301347032013 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_HostedSSHAccessPoint.h" CMPIObjectPath* SSH_OpenDRIM_HostedSSHAccessPoint_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_HostedSSHAccessPoint& instance) { _E_; Objectpath op(broker, OpenDRIM_HostedSSHAccessPoint_classnames[0], OpenDRIM_HostedSSHAccessPoint_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* SSH_OpenDRIM_HostedSSHAccessPoint_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_HostedSSHAccessPoint& instance) { _E_; Objectpath op(broker, SSH_OpenDRIM_HostedSSHAccessPoint_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void SSH_OpenDRIM_HostedSSHAccessPoint_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_HostedSSHAccessPoint& 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 SSH_OpenDRIM_HostedSSHAccessPoint_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_HostedSSHAccessPoint& 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-ssh-1.0.0/OpenDRIM_HostedSSHAccessPoint/OpenDRIM_HostedSSHAccessPointAccess.cpp0000644000175000017500000002505711415301347032270 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "OpenDRIM_HostedSSHAccessPointAccess.h" int SSH_OpenDRIM_HostedSSHAccessPoint_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(SSH_CIM_System_load(broker, errorMessage)); CF_assert(SSH_CIM_ServiceAccessPoint_load(broker, errorMessage)); */ // TODO _L_; return OK; } int SSH_OpenDRIM_HostedSSHAccessPoint_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(SSH_CIM_System_unload(errorMessage)); CF_assert(SSH_CIM_ServiceAccessPoint_unload(errorMessage)); */ // TODO _L_; return OK; } int SSH_OpenDRIM_HostedSSHAccessPoint_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // Determine if the association can be established or not string computerSystem_name; CF_assert(Antecedent.getProperty("Name", computerSystem_name)); string protocolEndpoint_systemName; CF_assert(Dependent.getProperty("SystemName", protocolEndpoint_systemName)); string protocolEndpoint_className = Dependent.getClassname(); if (computerSystem_name == protocolEndpoint_systemName && (protocolEndpoint_className == "OpenDRIM_SSHProtocolEndpoint" || protocolEndpoint_className == "OpenDRIM_TCPProtocolEndpoint" )) isAssociated=true; else isAssociated=false; _L_; return OK; } int SSH_OpenDRIM_HostedSSHAccessPoint_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(SSH_OpenDRIM_HostedSSHAccessPoint_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(SSH_OpenDRIM_HostedSSHAccessPoint_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; CF_assert(SSH_OpenDRIM_HostedSSHAccessPoint_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(SSH_OpenDRIM_HostedSSHAccessPoint_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int SSH_OpenDRIM_HostedSSHAccessPoint_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_HostedSSHAccessPoint& 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(SSH_OpenDRIM_HostedSSHAccessPoint_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(SSH_OpenDRIM_HostedSSHAccessPoint_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(SSH_OpenDRIM_HostedSSHAccessPoint_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int SSH_OpenDRIM_HostedSSHAccessPoint_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedSSHAccessPoint& newInstance, const OpenDRIM_HostedSSHAccessPoint& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_HostedSSHAccessPoint_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedSSHAccessPoint& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_HostedSSHAccessPoint_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedSSHAccessPoint& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_HostedSSHAccessPoint_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(SSH_OpenDRIM_HostedSSHAccessPoint_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(SSH_OpenDRIM_HostedSSHAccessPoint_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(SSH_OpenDRIM_HostedSSHAccessPoint_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(SSH_OpenDRIM_HostedSSHAccessPoint_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(SSH_OpenDRIM_HostedSSHAccessPoint_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(SSH_OpenDRIM_HostedSSHAccessPoint_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_HostedSSHAccessPoint_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_HostedSSHAccessPoint instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); OpenDRIM_HostedSSHAccessPoint_instances.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_HostedSSHAccessPoint_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_HostedSSHAccessPoint_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_HostedSSHAccessPoint instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); OpenDRIM_HostedSSHAccessPoint_instances.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_HostedSSHAccessPoint_populate(OpenDRIM_HostedSSHAccessPoint& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-ssh-1.0.0/OpenDRIM_HostedSSHAccessPoint/OpenDRIM_HostedSSHAccessPoint.h0000644000175000017500000000662611415301347030614 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_HOSTEDSSHACCESSPOINT_H_ #define OPENDRIM_HOSTEDSSHACCESSPOINT_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_HostedSSHAccessPoint_classnames[] = {"OpenDRIM_HostedSSHAccessPoint"}; static string OpenDRIM_HostedSSHAccessPoint_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[] = {"CIM_ProtocolEndpoint"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_HostedSSHAccessPoint { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; OpenDRIM_HostedSSHAccessPoint() { Antecedent_isNULL = true; Dependent_isNULL = true; } ~OpenDRIM_HostedSSHAccessPoint() {} 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_HOSTEDSSHACCESSPOINT_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_HostedSSHAccessPoint/assocOpenDRIM_HostedSSHAccessPoint.cpp0000644000175000017500000002062211415301347032170 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "assocOpenDRIM_HostedSSHAccessPoint.h" int SSH_OpenDRIM_HostedSSHAccessPoint_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 = SSH_OpenDRIM_HostedSSHAccessPoint_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(SSH_OpenDRIM_HostedSSHAccessPoint_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(SSH_OpenDRIM_HostedSSHAccessPoint_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int SSH_OpenDRIM_HostedSSHAccessPoint_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(SSH_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(SSH_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, SSH_CIM_System_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int SSH_OpenDRIM_HostedSSHAccessPoint_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; SSH_CIM_System_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(SSH_CIM_System_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, SSH_CIM_System_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int SSH_OpenDRIM_HostedSSHAccessPoint_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(SSH_CIM_ServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(SSH_CIM_ServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, SSH_CIM_ServiceAccessPoint_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int SSH_OpenDRIM_HostedSSHAccessPoint_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; SSH_CIM_ServiceAccessPoint_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(SSH_CIM_ServiceAccessPoint_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, SSH_CIM_ServiceAccessPoint_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-ssh-1.0.0/OpenDRIM_HostedSSHAccessPoint/cmpiOpenDRIM_HostedSSHAccessPoint.h0000644000175000017500000000433611415301347031461 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef CMPIOPENDRIM_HOSTEDSSHACCESSPOINT_H_ #define CMPIOPENDRIM_HOSTEDSSHACCESSPOINT_H_ #include "OpenDRIM_HostedSSHAccessPoint.h" CMPIObjectPath* SSH_OpenDRIM_HostedSSHAccessPoint_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_HostedSSHAccessPoint& instance); CMPIInstance* SSH_OpenDRIM_HostedSSHAccessPoint_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_HostedSSHAccessPoint& instance); void SSH_OpenDRIM_HostedSSHAccessPoint_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_HostedSSHAccessPoint& instance); void SSH_OpenDRIM_HostedSSHAccessPoint_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_HostedSSHAccessPoint& instance); #endif /*CMPIOPENDRIM_HOSTEDSSHACCESSPOINT_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_HostedSSHAccessPoint/OpenDRIM_HostedSSHAccessPointProvider.cpp0000644000175000017500000004154511415301347032661 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_HostedSSHAccessPoint.h" #include "OpenDRIM_HostedSSHAccessPointAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define SSH_OpenDRIM_HostedSSHAccessPointProviderSetInstance SSH_OpenDRIM_HostedSSHAccessPointProviderModifyInstance #endif int SSH_OpenDRIM_HostedSSHAccessPoint_init(const CMPIBroker* broker); int SSH_OpenDRIM_HostedSSHAccessPoint_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus SSH_OpenDRIM_HostedSSHAccessPointProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_HostedSSHAccessPoint_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_HostedSSHAccessPointProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = SSH_OpenDRIM_HostedSSHAccessPoint_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHAccessPoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_HostedSSHAccessPoint_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_HostedSSHAccessPointProviderEnumInstances(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 = SSH_OpenDRIM_HostedSSHAccessPoint_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHAccessPoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = SSH_OpenDRIM_HostedSSHAccessPoint_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_HostedSSHAccessPointProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_HostedSSHAccessPoint instance; SSH_OpenDRIM_HostedSSHAccessPoint_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_HostedSSHAccessPoint_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHAccessPoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = SSH_OpenDRIM_HostedSSHAccessPoint_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_HostedSSHAccessPointProviderSetInstance(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_HostedSSHAccessPoint newInstance, oldInstance; SSH_OpenDRIM_HostedSSHAccessPoint_toCPP(_broker, ci, newInstance); SSH_OpenDRIM_HostedSSHAccessPoint_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = SSH_OpenDRIM_HostedSSHAccessPoint_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHAccessPoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_HostedSSHAccessPoint_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHAccessPoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_HostedSSHAccessPointProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_HostedSSHAccessPoint instance; SSH_OpenDRIM_HostedSSHAccessPoint_toCPP(_broker, ci, instance); string errorMessage; int errorCode = SSH_OpenDRIM_HostedSSHAccessPoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_HostedSSHAccessPoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_HostedSSHAccessPoint_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHAccessPoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_HostedSSHAccessPoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHAccessPoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = SSH_OpenDRIM_HostedSSHAccessPoint_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_HostedSSHAccessPointProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_HostedSSHAccessPoint instance; SSH_OpenDRIM_HostedSSHAccessPoint_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_HostedSSHAccessPoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHAccessPoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_HostedSSHAccessPoint_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHAccessPoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_HostedSSHAccessPointProviderExecQuery(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 SSH_OpenDRIM_HostedSSHAccessPointProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_HostedSSHAccessPoint_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_HostedSSHAccessPointProviderAssociatorNames(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 = SSH_OpenDRIM_HostedSSHAccessPoint_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHAccessPoint_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 SSH_OpenDRIM_HostedSSHAccessPointProviderAssociators(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 = SSH_OpenDRIM_HostedSSHAccessPoint_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHAccessPoint_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 SSH_OpenDRIM_HostedSSHAccessPointProviderReferenceNames(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 = SSH_OpenDRIM_HostedSSHAccessPoint_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHAccessPoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = SSH_OpenDRIM_HostedSSHAccessPoint_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = SSH_OpenDRIM_HostedSSHAccessPoint_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHAccessPoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_HostedSSHAccessPoint_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus SSH_OpenDRIM_HostedSSHAccessPointProviderReferences(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 = SSH_OpenDRIM_HostedSSHAccessPoint_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHAccessPoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = SSH_OpenDRIM_HostedSSHAccessPoint_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = SSH_OpenDRIM_HostedSSHAccessPoint_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedSSHAccessPoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = SSH_OpenDRIM_HostedSSHAccessPoint_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int SSH_OpenDRIM_HostedSSHAccessPoint_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = SSH_OpenDRIM_HostedSSHAccessPoint_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_HostedSSHAccessPoint_init FAILED: " + (string) OpenDRIM_HostedSSHAccessPoint_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int SSH_OpenDRIM_HostedSSHAccessPoint_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = SSH_OpenDRIM_HostedSSHAccessPoint_unload(errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_HostedSSHAccessPoint_unload FAILED: " + (string) OpenDRIM_HostedSSHAccessPoint_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define SSH_OpenDRIM_HostedSSHAccessPoint_INIT if (SSH_OpenDRIM_HostedSSHAccessPoint_init(_broker) < 0) return NULL CMInstanceMIStub(SSH_OpenDRIM_HostedSSHAccessPointProvider, SSH_OpenDRIM_HostedSSHAccessPointProvider, _broker, SSH_OpenDRIM_HostedSSHAccessPoint_INIT); CMAssociationMIStub(SSH_OpenDRIM_HostedSSHAccessPointProvider, SSH_OpenDRIM_HostedSSHAccessPointProvider, _broker, SSH_OpenDRIM_HostedSSHAccessPoint_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_HostedSSHAccessPoint/OpenDRIM_HostedSSHAccessPointAccess.h0000644000175000017500000001040411415301347031723 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_HOSTEDSSHACCESSPOINTACCESS_H_ #define OPENDRIM_HOSTEDSSHACCESSPOINTACCESS_H_ #include "SSH_Common.h" #include "OpenDRIM_HostedSSHAccessPoint.h" #include "assocOpenDRIM_HostedSSHAccessPoint.h" int SSH_OpenDRIM_HostedSSHAccessPoint_load(const CMPIBroker* broker, string& errorMessage); int SSH_OpenDRIM_HostedSSHAccessPoint_unload(string& errorMessage); int SSH_OpenDRIM_HostedSSHAccessPoint_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_HostedSSHAccessPoint_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_HostedSSHAccessPoint& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_HostedSSHAccessPoint_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedSSHAccessPoint& newInstance, const OpenDRIM_HostedSSHAccessPoint& oldInstance, const char** properties, string& errorMessage); int SSH_OpenDRIM_HostedSSHAccessPoint_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedSSHAccessPoint& instance, string& errorMessage); int SSH_OpenDRIM_HostedSSHAccessPoint_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedSSHAccessPoint& instance, string& errorMessage); int SSH_OpenDRIM_HostedSSHAccessPoint_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_HostedSSHAccessPoint_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_HostedSSHAccessPoint_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_HostedSSHAccessPoint_instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_HostedSSHAccessPoint_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_HostedSSHAccessPoint_instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_HostedSSHAccessPoint_populate(OpenDRIM_HostedSSHAccessPoint& instance, string& errorMessage); #endif /*OPENDRIM_HOSTEDSSHACCESSPOINTACCESS_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_HostedSSHAccessPoint/assocOpenDRIM_HostedSSHAccessPoint.h0000644000175000017500000000617011415301347031637 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef ASSOCOPENDRIM_HOSTEDSSHACCESSPOINT_H_ #define ASSOCOPENDRIM_HOSTEDSSHACCESSPOINT_H_ #include "OpenDRIM_HostedSSHAccessPointAccess.h" int SSH_OpenDRIM_HostedSSHAccessPoint_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 SSH_OpenDRIM_HostedSSHAccessPoint_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 SSH_OpenDRIM_HostedSSHAccessPoint_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int SSH_OpenDRIM_HostedSSHAccessPoint_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_HostedSSHAccessPoint_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int SSH_OpenDRIM_HostedSSHAccessPoint_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_HOSTEDSSHACCESSPOINT_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolService/0000755000175000017500000000000011415301347022574 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolService/cmpiOpenDRIM_SSHProtocolService.cpp0000644000175000017500000003203511415301347031311 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHProtocolService.h" CMPIObjectPath* SSH_OpenDRIM_SSHProtocolService_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHProtocolService& instance) { _E_; Objectpath op(broker, OpenDRIM_SSHProtocolService_classnames[0], OpenDRIM_SSHProtocolService_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* SSH_OpenDRIM_SSHProtocolService_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHProtocolService& instance) { _E_; Objectpath op(broker, SSH_OpenDRIM_SSHProtocolService_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.Generation_isNULL) ci.setProperty("Generation", instance.Generation); 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.PrimaryOwnerName_isNULL) ci.setProperty("PrimaryOwnerName", instance.PrimaryOwnerName); if (!instance.PrimaryOwnerContact_isNULL) ci.setProperty("PrimaryOwnerContact", instance.PrimaryOwnerContact); if (!instance.StartMode_isNULL) ci.setProperty("StartMode", instance.StartMode); if (!instance.Started_isNULL) ci.setProperty("Started", instance.Started); if (!instance.Protocol_isNULL) ci.setProperty("Protocol", instance.Protocol); if (!instance.OtherProtocol_isNULL) ci.setProperty("OtherProtocol", instance.OtherProtocol); if (!instance.MaxConnections_isNULL) ci.setProperty("MaxConnections", instance.MaxConnections); if (!instance.CurrentActiveConnections_isNULL) ci.setProperty("CurrentActiveConnections", instance.CurrentActiveConnections); _L_; return ci.getHdl(); } void SSH_OpenDRIM_SSHProtocolService_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHProtocolService& 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 SSH_OpenDRIM_SSHProtocolService_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHProtocolService& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getProperty("Generation", instance.Generation) == OK) instance.Generation_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("PrimaryOwnerName", instance.PrimaryOwnerName) == OK) instance.PrimaryOwnerName_isNULL = false; if (inst.getProperty("PrimaryOwnerContact", instance.PrimaryOwnerContact) == OK) instance.PrimaryOwnerContact_isNULL = false; if (inst.getProperty("StartMode", instance.StartMode) == OK) instance.StartMode_isNULL = false; if (inst.getProperty("Started", instance.Started) == OK) instance.Started_isNULL = false; if (inst.getProperty("Protocol", instance.Protocol) == OK) instance.Protocol_isNULL = false; if (inst.getProperty("OtherProtocol", instance.OtherProtocol) == OK) instance.OtherProtocol_isNULL = false; if (inst.getProperty("MaxConnections", instance.MaxConnections) == OK) instance.MaxConnections_isNULL = false; if (inst.getProperty("CurrentActiveConnections", instance.CurrentActiveConnections) == OK) instance.CurrentActiveConnections_isNULL = false; _L_; } void SSH_OpenDRIM_SSHProtocolService_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_SSHProtocolService_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 SSH_OpenDRIM_SSHProtocolService_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_SSHProtocolService_RequestStateChange_Out& args) { _E_; CMPIValue value; int errorMessage; Objectpath Job; errorMessage = args.getJob(Job); if (errorMessage == OK) { value = CT_toCMPI(Job); out->ft->addArg(out, "Job", &value, CMPI_ref); } _L_; } void SSH_OpenDRIM_SSHProtocolService_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_SSHProtocolService_ChangeAffectedElementsAssignedSequence_In& args) { _E_; CMPIStatus rc; CMPIData data; vector ManagedElements; data = in->ft->getArg(in, "ManagedElements", &rc); if (rc.rc == OK) { CT_ToC(broker, data, ManagedElements); args.setManagedElements(ManagedElements); } vector AssignedSequence; data = in->ft->getArg(in, "AssignedSequence", &rc); if (rc.rc == OK) { CT_ToC(data, AssignedSequence); args.setAssignedSequence(AssignedSequence); } Objectpath Job; data = in->ft->getArg(in, "Job", &rc); if (rc.rc == OK) { CT_ToC(broker, data, Job); args.setJob(Job); } _L_; } void SSH_OpenDRIM_SSHProtocolService_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_SSHProtocolService_ChangeAffectedElementsAssignedSequence_Out& args) { _E_; CMPIValue value; int errorMessage; Objectpath Job; errorMessage = args.getJob(Job); if (errorMessage == OK) { value = CT_toCMPI(Job); out->ft->addArg(out, "Job", &value, CMPI_ref); } _L_; } void SSH_OpenDRIM_SSHProtocolService_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_SSHProtocolService_ListenOnPort_In& args) { _E_; CMPIStatus rc; CMPIData data; unsigned int PortNumber; data = in->ft->getArg(in, "PortNumber", &rc); if (rc.rc == OK) { CT_ToC(data, PortNumber); args.setPortNumber(PortNumber); } Objectpath IPEndpoint; data = in->ft->getArg(in, "IPEndpoint", &rc); if (rc.rc == OK) { CT_ToC(broker, data, IPEndpoint); args.setIPEndpoint(IPEndpoint); } Objectpath TCPEndpoint; data = in->ft->getArg(in, "TCPEndpoint", &rc); if (rc.rc == OK) { CT_ToC(broker, data, TCPEndpoint); args.setTCPEndpoint(TCPEndpoint); } _L_; } void SSH_OpenDRIM_SSHProtocolService_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_SSHProtocolService_ListenOnPort_Out& args) { _E_; CMPIValue value; int errorMessage; Objectpath TCPEndpoint; errorMessage = args.getTCPEndpoint(TCPEndpoint); if (errorMessage == OK) { value = CT_toCMPI(TCPEndpoint); out->ft->addArg(out, "TCPEndpoint", &value, CMPI_ref); } _L_; } opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolService/Makefile.am0000644000175000017500000000405111415301347024630 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSSH_OpenDRIM_SSHProtocolServiceProvider.la libcmpiSSH_OpenDRIM_SSHProtocolServiceProvider_la_SOURCES = OpenDRIM_SSHProtocolServiceAccess.cpp OpenDRIM_SSHProtocolServiceProvider.cpp cmpiOpenDRIM_SSHProtocolService.cpp libcmpiSSH_OpenDRIM_SSHProtocolServiceProvider_la_LIBADD = ../Common/libcmpiSSH_Common.la libcmpiSSH_OpenDRIM_SSHProtocolServiceProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_SSHProtocolService.h OpenDRIM_SSHProtocolService.h OpenDRIM_SSHProtocolServiceAccess.h opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolService/OpenDRIM_SSHProtocolServiceAccess.h0000644000175000017500000001043011415301347031222 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHPROTOCOLSERVICEACCESS_H_ #define OPENDRIM_SSHPROTOCOLSERVICEACCESS_H_ #include "SSH_Common.h" #include "OpenDRIM_SSHProtocolService.h" int SSH_OpenDRIM_SSHProtocolService_load(const CMPIBroker* broker, string& errorMessage); int SSH_OpenDRIM_SSHProtocolService_unload(string& errorMessage); int SSH_OpenDRIM_SSHProtocolService_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHProtocolService_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHProtocolService& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHProtocolService_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolService& newInstance, const OpenDRIM_SSHProtocolService& oldInstance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHProtocolService_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolService& instance, string& errorMessage); int SSH_OpenDRIM_SSHProtocolService_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolService& instance, string& errorMessage); int SSH_OpenDRIM_SSHProtocolService_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolService& instance, unsigned int& returnValue, const OpenDRIM_SSHProtocolService_RequestStateChange_In& in, OpenDRIM_SSHProtocolService_RequestStateChange_Out& out, string& errorMessage); int SSH_OpenDRIM_SSHProtocolService_StartService(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolService& instance, unsigned int& returnValue, string& errorMessage); int SSH_OpenDRIM_SSHProtocolService_StopService(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolService& instance, unsigned int& returnValue, string& errorMessage); int SSH_OpenDRIM_SSHProtocolService_ChangeAffectedElementsAssignedSequence(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolService& instance, unsigned int& returnValue, const OpenDRIM_SSHProtocolService_ChangeAffectedElementsAssignedSequence_In& in, OpenDRIM_SSHProtocolService_ChangeAffectedElementsAssignedSequence_Out& out, string& errorMessage); int SSH_OpenDRIM_SSHProtocolService_ListenOnPort(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolService& instance, unsigned int& returnValue, const OpenDRIM_SSHProtocolService_ListenOnPort_In& in, OpenDRIM_SSHProtocolService_ListenOnPort_Out& out, string& errorMessage); int SSH_OpenDRIM_SSHProtocolService_populate(OpenDRIM_SSHProtocolService& instance, string& errorMessage); #endif /*OPENDRIM_SSHPROTOCOLSERVICEACCESS_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolService/cmpiOpenDRIM_SSHProtocolService.h0000644000175000017500000000615411415301347030761 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef CMPIOPENDRIM_SSHPROTOCOLSERVICE_H_ #define CMPIOPENDRIM_SSHPROTOCOLSERVICE_H_ #include "OpenDRIM_SSHProtocolService.h" CMPIObjectPath* SSH_OpenDRIM_SSHProtocolService_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHProtocolService& instance); CMPIInstance* SSH_OpenDRIM_SSHProtocolService_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHProtocolService& instance); void SSH_OpenDRIM_SSHProtocolService_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHProtocolService& instance); void SSH_OpenDRIM_SSHProtocolService_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHProtocolService& instance); void SSH_OpenDRIM_SSHProtocolService_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_SSHProtocolService_RequestStateChange_In& args); void SSH_OpenDRIM_SSHProtocolService_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_SSHProtocolService_RequestStateChange_Out& args); void SSH_OpenDRIM_SSHProtocolService_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_SSHProtocolService_ChangeAffectedElementsAssignedSequence_In& args); void SSH_OpenDRIM_SSHProtocolService_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_SSHProtocolService_ChangeAffectedElementsAssignedSequence_Out& args); void SSH_OpenDRIM_SSHProtocolService_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_SSHProtocolService_ListenOnPort_In& args); void SSH_OpenDRIM_SSHProtocolService_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_SSHProtocolService_ListenOnPort_Out& args); #endif /*CMPIOPENDRIM_SSHPROTOCOLSERVICE_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolService/OpenDRIM_SSHProtocolService.h0000644000175000017500000004657711415301347030125 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHPROTOCOLSERVICE_H_ #define OPENDRIM_SSHPROTOCOLSERVICE_H_ #include const static char* OpenDRIM_SSHProtocolService_classnames[] = {"OpenDRIM_SSHProtocolService"}; static string OpenDRIM_SSHProtocolService_NAMESPACE = _NAMESPACE; class OpenDRIM_SSHProtocolService { public: string InstanceID; bool InstanceID_isNULL; string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; unsigned long long Generation; bool Generation_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 PrimaryOwnerName; bool PrimaryOwnerName_isNULL; string PrimaryOwnerContact; bool PrimaryOwnerContact_isNULL; string StartMode; bool StartMode_isNULL; bool Started; bool Started_isNULL; unsigned short Protocol; bool Protocol_isNULL; string OtherProtocol; bool OtherProtocol_isNULL; unsigned short MaxConnections; bool MaxConnections_isNULL; unsigned short CurrentActiveConnections; bool CurrentActiveConnections_isNULL; OpenDRIM_SSHProtocolService() { InstanceID_isNULL = true; Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; Generation_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; PrimaryOwnerName_isNULL = true; PrimaryOwnerContact_isNULL = true; StartMode_isNULL = true; Started_isNULL = true; Protocol_isNULL = true; OtherProtocol_isNULL = true; MaxConnections_isNULL = true; CurrentActiveConnections_isNULL = true; } ~OpenDRIM_SSHProtocolService() {} 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 getGeneration(unsigned long long& value) const { if (Generation_isNULL==true) return NOT_FOUND; value = Generation; return OK; } int setGeneration(const unsigned long long& newValue) { Generation = newValue; Generation_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 getPrimaryOwnerName(string& value) const { if (PrimaryOwnerName_isNULL==true) return NOT_FOUND; value = PrimaryOwnerName; return OK; } int setPrimaryOwnerName(const string& newValue) { PrimaryOwnerName = newValue; PrimaryOwnerName_isNULL = false; return OK; } int getPrimaryOwnerContact(string& value) const { if (PrimaryOwnerContact_isNULL==true) return NOT_FOUND; value = PrimaryOwnerContact; return OK; } int setPrimaryOwnerContact(const string& newValue) { PrimaryOwnerContact = newValue; PrimaryOwnerContact_isNULL = false; return OK; } int getStartMode(string& value) const { if (StartMode_isNULL==true) return NOT_FOUND; value = StartMode; return OK; } int setStartMode(const string& newValue) { StartMode = newValue; StartMode_isNULL = false; return OK; } int getStarted(bool& value) const { if (Started_isNULL==true) return NOT_FOUND; value = Started; return OK; } int setStarted(const bool& newValue) { Started = newValue; Started_isNULL = false; return OK; } int getProtocol(unsigned short& value) const { if (Protocol_isNULL==true) return NOT_FOUND; value = Protocol; return OK; } int setProtocol(const unsigned short& newValue) { Protocol = newValue; Protocol_isNULL = false; return OK; } int getOtherProtocol(string& value) const { if (OtherProtocol_isNULL==true) return NOT_FOUND; value = OtherProtocol; return OK; } int setOtherProtocol(const string& newValue) { OtherProtocol = newValue; OtherProtocol_isNULL = false; return OK; } int getMaxConnections(unsigned short& value) const { if (MaxConnections_isNULL==true) return NOT_FOUND; value = MaxConnections; return OK; } int setMaxConnections(const unsigned short& newValue) { MaxConnections = newValue; MaxConnections_isNULL = false; return OK; } int getCurrentActiveConnections(unsigned short& value) const { if (CurrentActiveConnections_isNULL==true) return NOT_FOUND; value = CurrentActiveConnections; return OK; } int setCurrentActiveConnections(const unsigned short& newValue) { CurrentActiveConnections = newValue; CurrentActiveConnections_isNULL = false; return OK; } }; class OpenDRIM_SSHProtocolService_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_SSHProtocolService_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_SSHProtocolService_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_SSHProtocolService_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_SSHProtocolService_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_SSHProtocolService_RequestStateChange_Out() {} int getJob(Objectpath& value) const { if (Job_isNULL == true) return NOT_FOUND; value = Job; return OK; } int setJob(const Objectpath& newValue) { Job = newValue; Job_isNULL = false; return OK; } }; class OpenDRIM_SSHProtocolService_ChangeAffectedElementsAssignedSequence_In { public: vector ManagedElements; bool ManagedElements_isNULL; vector AssignedSequence; bool AssignedSequence_isNULL; Objectpath Job; bool Job_isNULL; OpenDRIM_SSHProtocolService_ChangeAffectedElementsAssignedSequence_In() { ManagedElements_isNULL = true; AssignedSequence_isNULL = true; Job_isNULL = true; } ~OpenDRIM_SSHProtocolService_ChangeAffectedElementsAssignedSequence_In() {} int getManagedElements(vector& value) const { if (ManagedElements_isNULL == true) return NOT_FOUND; value = ManagedElements; return OK; } int setManagedElements(const vector& newValue) { ManagedElements = newValue; ManagedElements_isNULL = false; return OK; } int getAssignedSequence(vector& value) const { if (AssignedSequence_isNULL == true) return NOT_FOUND; value = AssignedSequence; return OK; } int setAssignedSequence(const vector& newValue) { AssignedSequence = newValue; AssignedSequence_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; } }; class OpenDRIM_SSHProtocolService_ChangeAffectedElementsAssignedSequence_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_SSHProtocolService_ChangeAffectedElementsAssignedSequence_Out() { Job_isNULL = true; } ~OpenDRIM_SSHProtocolService_ChangeAffectedElementsAssignedSequence_Out() {} int getJob(Objectpath& value) const { if (Job_isNULL == true) return NOT_FOUND; value = Job; return OK; } int setJob(const Objectpath& newValue) { Job = newValue; Job_isNULL = false; return OK; } }; class OpenDRIM_SSHProtocolService_ListenOnPort_In { public: unsigned int PortNumber; bool PortNumber_isNULL; Objectpath IPEndpoint; bool IPEndpoint_isNULL; Objectpath TCPEndpoint; bool TCPEndpoint_isNULL; OpenDRIM_SSHProtocolService_ListenOnPort_In() { PortNumber_isNULL = true; IPEndpoint_isNULL = true; TCPEndpoint_isNULL = true; } ~OpenDRIM_SSHProtocolService_ListenOnPort_In() {} int getPortNumber(unsigned int& value) const { if (PortNumber_isNULL == true) return NOT_FOUND; value = PortNumber; return OK; } int setPortNumber(const unsigned int& newValue) { PortNumber = newValue; PortNumber_isNULL = false; return OK; } int getIPEndpoint(Objectpath& value) const { if (IPEndpoint_isNULL == true) return NOT_FOUND; value = IPEndpoint; return OK; } int setIPEndpoint(const Objectpath& newValue) { IPEndpoint = newValue; IPEndpoint_isNULL = false; return OK; } int getTCPEndpoint(Objectpath& value) const { if (TCPEndpoint_isNULL == true) return NOT_FOUND; value = TCPEndpoint; return OK; } int setTCPEndpoint(const Objectpath& newValue) { TCPEndpoint = newValue; TCPEndpoint_isNULL = false; return OK; } }; class OpenDRIM_SSHProtocolService_ListenOnPort_Out { public: Objectpath TCPEndpoint; bool TCPEndpoint_isNULL; OpenDRIM_SSHProtocolService_ListenOnPort_Out() { TCPEndpoint_isNULL = true; } ~OpenDRIM_SSHProtocolService_ListenOnPort_Out() {} int getTCPEndpoint(Objectpath& value) const { if (TCPEndpoint_isNULL == true) return NOT_FOUND; value = TCPEndpoint; return OK; } int setTCPEndpoint(const Objectpath& newValue) { TCPEndpoint = newValue; TCPEndpoint_isNULL = false; return OK; } }; #endif /*OPENDRIM_SSHPROTOCOLSERVICE_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolService/OpenDRIM_SSHProtocolServiceProvider.cpp0000644000175000017500000004006211415301347032152 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHProtocolService.h" #include "OpenDRIM_SSHProtocolServiceAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define SSH_OpenDRIM_SSHProtocolServiceProviderSetInstance SSH_OpenDRIM_SSHProtocolServiceProviderModifyInstance #endif int SSH_OpenDRIM_SSHProtocolService_init(const CMPIBroker* broker); int SSH_OpenDRIM_SSHProtocolService_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus SSH_OpenDRIM_SSHProtocolServiceProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHProtocolService_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolServiceProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolService_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_SSHProtocolService_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolServiceProviderEnumInstances(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 = SSH_OpenDRIM_SSHProtocolService_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = SSH_OpenDRIM_SSHProtocolService_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolServiceProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHProtocolService instance; SSH_OpenDRIM_SSHProtocolService_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolService_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = SSH_OpenDRIM_SSHProtocolService_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolServiceProviderSetInstance(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_SSHProtocolService newInstance, oldInstance; SSH_OpenDRIM_SSHProtocolService_toCPP(_broker, ci, newInstance); SSH_OpenDRIM_SSHProtocolService_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolService_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHProtocolService_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolServiceProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHProtocolService instance; SSH_OpenDRIM_SSHProtocolService_toCPP(_broker, ci, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolService_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_SSHProtocolService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHProtocolService_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHProtocolService_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = SSH_OpenDRIM_SSHProtocolService_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolServiceProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHProtocolService instance; SSH_OpenDRIM_SSHProtocolService_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolService_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHProtocolService_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolServiceProviderExecQuery(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 SSH_OpenDRIM_SSHProtocolServiceProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHProtocolService_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolServiceProviderInvokeMethod(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_SSHProtocolService instance; SSH_OpenDRIM_SSHProtocolService_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"SystemCreationClassName", "Name", "SystemName", "CreationClassName"}; int errorCode = SSH_OpenDRIM_SSHProtocolService_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_SSHProtocolService_RequestStateChange_In inArgs; SSH_OpenDRIM_SSHProtocolService_toCPP(_broker, in, inArgs); OpenDRIM_SSHProtocolService_RequestStateChange_Out outArgs; errorCode = SSH_OpenDRIM_SSHProtocolService_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } SSH_OpenDRIM_SSHProtocolService_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="StartService") { unsigned int returnValue; errorCode = SSH_OpenDRIM_SSHProtocolService_StartService(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="StopService") { unsigned int returnValue; errorCode = SSH_OpenDRIM_SSHProtocolService_StopService(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="ChangeAffectedElementsAssignedSequence") { unsigned int returnValue; OpenDRIM_SSHProtocolService_ChangeAffectedElementsAssignedSequence_In inArgs; SSH_OpenDRIM_SSHProtocolService_toCPP(_broker, in, inArgs); OpenDRIM_SSHProtocolService_ChangeAffectedElementsAssignedSequence_Out outArgs; errorCode = SSH_OpenDRIM_SSHProtocolService_ChangeAffectedElementsAssignedSequence(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } SSH_OpenDRIM_SSHProtocolService_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="ListenOnPort") { unsigned int returnValue; OpenDRIM_SSHProtocolService_ListenOnPort_In inArgs; SSH_OpenDRIM_SSHProtocolService_toCPP(_broker, in, inArgs); OpenDRIM_SSHProtocolService_ListenOnPort_Out outArgs; errorCode = SSH_OpenDRIM_SSHProtocolService_ListenOnPort(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolService_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } SSH_OpenDRIM_SSHProtocolService_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else { errorMessage = (string) OpenDRIM_SSHProtocolService_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 SSH_OpenDRIM_SSHProtocolService_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolService_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHProtocolService_init FAILED: " + (string) OpenDRIM_SSHProtocolService_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolService_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolService_unload(errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHProtocolService_unload FAILED: " + (string) OpenDRIM_SSHProtocolService_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define SSH_OpenDRIM_SSHProtocolService_INIT if (SSH_OpenDRIM_SSHProtocolService_init(_broker) < 0) return NULL CMInstanceMIStub(SSH_OpenDRIM_SSHProtocolServiceProvider, SSH_OpenDRIM_SSHProtocolServiceProvider, _broker, SSH_OpenDRIM_SSHProtocolService_INIT); CMMethodMIStub(SSH_OpenDRIM_SSHProtocolServiceProvider, SSH_OpenDRIM_SSHProtocolServiceProvider, _broker, SSH_OpenDRIM_SSHProtocolService_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolService/OpenDRIM_SSHProtocolServiceAccess.cpp0000644000175000017500000001554211415301347031566 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "OpenDRIM_SSHProtocolServiceAccess.h" const string systemCreationClassName = "OpenDRIM_ComputerSystem"; const string creationClassName = "OpenDRIM_SSHProtocolService"; const string name = "/usr/sbin/sshd"; string systemName; int SSH_OpenDRIM_SSHProtocolService_load(const CMPIBroker* broker, string& errorMessage) { _E_; CF_assert(CF_getSystemName(systemName, errorMessage)); _L_; return OK; } int SSH_OpenDRIM_SSHProtocolService_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_SSHProtocolService_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; if (!CF_isExist(name)) return OK; //Initialize an instance OpenDRIM_SSHProtocolService instance; instance.setSystemCreationClassName(systemCreationClassName); instance.setCreationClassName(creationClassName); instance.setSystemName(systemName); instance.setName(name); if (discriminant == "ei") CF_assert(SSH_OpenDRIM_SSHProtocolService_populate(instance, errorMessage)); result.push_back(instance); _L_; return OK; } int SSH_OpenDRIM_SSHProtocolService_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHProtocolService& instance, const char** properties, string& errorMessage) { _E_; if (instance.SystemCreationClassName != systemCreationClassName || instance.CreationClassName != creationClassName || instance.SystemName != systemName || instance.Name != name || !CF_isExist(name)) { errorMessage = "Invalid path"; return NOT_FOUND; } CF_assert(SSH_OpenDRIM_SSHProtocolService_populate(instance, errorMessage)); _L_; return OK; } int SSH_OpenDRIM_SSHProtocolService_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolService& newInstance, const OpenDRIM_SSHProtocolService& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHProtocolService_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolService& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHProtocolService_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolService& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHProtocolService_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolService& instance, unsigned int& returnValue, const OpenDRIM_SSHProtocolService_RequestStateChange_In& in, OpenDRIM_SSHProtocolService_RequestStateChange_Out& out, string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_SSHProtocolService_StartService(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolService& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_SSHProtocolService_StopService(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolService& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_SSHProtocolService_ChangeAffectedElementsAssignedSequence(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolService& instance, unsigned int& returnValue, const OpenDRIM_SSHProtocolService_ChangeAffectedElementsAssignedSequence_In& in, OpenDRIM_SSHProtocolService_ChangeAffectedElementsAssignedSequence_Out& out, string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_SSHProtocolService_ListenOnPort(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolService& instance, unsigned int& returnValue, const OpenDRIM_SSHProtocolService_ListenOnPort_In& in, OpenDRIM_SSHProtocolService_ListenOnPort_Out& out, string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_SSHProtocolService_populate(OpenDRIM_SSHProtocolService& instance, string& errorMessage) { _E_; /* * Properties to fill from profile * + Mandatory: * [X] SystemCreationClassName [KEY] * [X] CreationClassName [KEY] * [X] SystemName [KEY] * [X] Name [KEY] * [X] Protocol * [X] MaxConnections * [X] RequestedState * [X] EnabledState * [X] ElementName * [X] OperationalStatus * [X] HealthState */ string elementName; CF_assert(CF_getWhatisFL("sshd",elementName,errorMessage)); instance.setProtocol(2); // SSH string out_str; unsigned short maxSessions; CF_assert(CF_getConfigItem("MaxSession", out_str, errorMessage)); if (out_str.size() != 0) { maxSessions = atoi(out_str.c_str()); instance.setMaxConnections(maxSessions); } else instance.setMaxConnections(10); instance.setRequestedState(12); // Not Applicable instance.setEnabledState(5); // Not Applicable instance.setElementName(elementName); instance.setHealthState(0); // Unknown vector operationalStatus; string cmd = "ps aux | grep /usr/sbin/sshd | grep -v grep"; string stdout_msg, stderr_msg; CF_assert(CF_runCommand(cmd, stdout_msg, stderr_msg, errorMessage)); if (stdout_msg.size() > 0) operationalStatus.push_back(2); // OK else operationalStatus.push_back(10); // Stopped instance.setOperationalStatus(operationalStatus); _L_; return OK; } opendrim-lmp-ssh-1.0.0/TODO0000644000175000017500000000010111415301347016117 0ustar guillaumeguillaumeTODO for Major.Minor.Revision ========================= // TODO opendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/0000755000175000017500000000000011415301347027704 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointAccess.cppopendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/OpenDRIM_TCPProtocolEnd0000644000175000017500000002670511415301347034075 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointAccess.h" int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(SSH_CIM_ProtocolEndpoint_load(broker, errorMessage)); CF_assert(SSH_CIM_ServiceAccessPoint_load(broker, errorMessage)); */ // TODO _L_; return OK; } int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(SSH_CIM_ProtocolEndpoint_unload(errorMessage)); CF_assert(SSH_CIM_ServiceAccessPoint_unload(errorMessage)); */ // TODO _L_; return OK; } int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // Determine if the association can be established or not string IPProtocolEndpoint_systemName; CF_assert(Antecedent.getProperty("SystemName", IPProtocolEndpoint_systemName)); string TCPProtocolEndpoint_systemName; CF_assert(Dependent.getProperty("SystemName", TCPProtocolEndpoint_systemName)); if (TCPProtocolEndpoint_systemName == IPProtocolEndpoint_systemName) isAssociated = true; else isAssociated = false; _L_; return OK; } int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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(SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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(SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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; CF_assert(SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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(SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint& 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(SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint& newInstance, const OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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(SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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(SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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(SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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(SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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_TCPProtocolEndpointBindsToIPProtocolEndpoint instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_instances.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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_TCPProtocolEndpointBindsToIPProtocolEndpoint instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_instances.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_populate(OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/Makefile.am0000644000175000017500000000537011415301347031745 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProvider.la libcmpiSSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProvider_la_SOURCES = OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointAccess.cpp OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProvider.cpp cmpiOpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.cpp assocOpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.cpp # May have to be adjusted for direct invocation libcmpiSSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProvider_la_CPPFLAGS = -I../CIM_ProtocolEndpoint -I../CIM_ServiceAccessPoint # Uncomment the end for direct invocation, may have to be adjusted libcmpiSSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProvider_la_LIBADD = ../Common/libcmpiSSH_Common.la #../CIM_ProtocolEndpoint/libcmpiSSH_CIM_ProtocolEndpointProvider.la ../CIM_ServiceAccessPoint/libcmpiSSH_CIM_ServiceAccessPointProvider.la libcmpiSSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.h OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.h OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointAccess.h ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.hopendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/OpenDRIM_TCPProtocolEnd0000644000175000017500000000721611415301347034071 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_TCPPROTOCOLENDPOINTBINDSTOIPPROTOCOLENDPOINT_H_ #define OPENDRIM_TCPPROTOCOLENDPOINTBINDSTOIPPROTOCOLENDPOINT_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_ProtocolEndpoint.h" #include "CIM_ProtocolEndpointAccess.h" #include "cmpiCIM_ServiceAccessPoint.h" #include "CIM_ServiceAccessPointAccess.h" */ const static char* OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_classnames[] = {"OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint"}; static string OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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_TCPProtocolEndpoint"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint() { Antecedent_isNULL = true; Dependent_isNULL = true; } ~OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint() {} 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_TCPPROTOCOLENDPOINTBINDSTOIPPROTOCOLENDPOINT_H_*/ ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/cmpiOpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.cppopendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/cmpiOpenDRIM_TCPProtoco0000644000175000017500000000651411415301347034137 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.h" CMPIObjectPath* SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint& instance) { _E_; Objectpath op(broker, OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_classnames[0], OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint& instance) { _E_; Objectpath op(broker, SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint& 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 SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint& 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_; } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/assocOpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.hopendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/assocOpenDRIM_TCPProtoc0000644000175000017500000000655011415301347034140 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef ASSOCOPENDRIM_TCPPROTOCOLENDPOINTBINDSTOIPPROTOCOLENDPOINT_H_ #define ASSOCOPENDRIM_TCPPROTOCOLENDPOINTBINDSTOIPPROTOCOLENDPOINT_H_ #include "OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointAccess.h" int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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 SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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 SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_TCPPROTOCOLENDPOINTBINDSTOIPPROTOCOLENDPOINT_H_*/ ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProvider.cppopendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/OpenDRIM_TCPProtocolEnd0000644000175000017500000004572511415301347034100 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.h" #include "OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProviderSetInstance SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProviderModifyInstance #endif int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_init(const CMPIBroker* broker); int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProviderEnumInstances(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 = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint instance; SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProviderSetInstance(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_TCPProtocolEndpointBindsToIPProtocolEndpoint newInstance, oldInstance; SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_toCPP(_broker, ci, newInstance); SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint instance; SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_toCPP(_broker, ci, instance); string errorMessage; int errorCode = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint instance; SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProviderExecQuery(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 SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProviderAssociatorNames(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 = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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 SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProviderAssociators(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 = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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 SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProviderReferenceNames(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 = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProviderReferences(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 = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_init FAILED: " + (string) OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_unload(errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_unload FAILED: " + (string) OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_INIT if (SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_init(_broker) < 0) return NULL CMInstanceMIStub(SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProvider, SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProvider, _broker, SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_INIT); CMAssociationMIStub(SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProvider, SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProvider, _broker, SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/assocOpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.cppopendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/assocOpenDRIM_TCPProtoc0000644000175000017500000002154211415301347034136 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "assocOpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.h" int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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 = SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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(SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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(SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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(SSH_CIM_ProtocolEndpoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(SSH_CIM_ProtocolEndpoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, SSH_CIM_ProtocolEndpoint_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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_ProtocolEndpoint _instance; SSH_CIM_ProtocolEndpoint_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(SSH_CIM_ProtocolEndpoint_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, SSH_CIM_ProtocolEndpoint_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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(SSH_CIM_ServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(SSH_CIM_ServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, SSH_CIM_ServiceAccessPoint_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_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; SSH_CIM_ServiceAccessPoint_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(SSH_CIM_ServiceAccessPoint_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, SSH_CIM_ServiceAccessPoint_toCMPIInstance(broker, _instance)); */ _L_; return OK; } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/cmpiOpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.hopendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/cmpiOpenDRIM_TCPProtoco0000644000175000017500000000477611415301347034147 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef CMPIOPENDRIM_TCPPROTOCOLENDPOINTBINDSTOIPPROTOCOLENDPOINT_H_ #define CMPIOPENDRIM_TCPPROTOCOLENDPOINTBINDSTOIPPROTOCOLENDPOINT_H_ #include "OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.h" CMPIObjectPath* SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint& instance); CMPIInstance* SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint& instance); void SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint& instance); void SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint& instance); #endif /*CMPIOPENDRIM_TCPPROTOCOLENDPOINTBINDSTOIPPROTOCOLENDPOINT_H_*/ ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointAccess.hopendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint/OpenDRIM_TCPProtocolEnd0000644000175000017500000001164411415301347034071 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_TCPPROTOCOLENDPOINTBINDSTOIPPROTOCOLENDPOINTACCESS_H_ #define OPENDRIM_TCPPROTOCOLENDPOINTBINDSTOIPPROTOCOLENDPOINTACCESS_H_ #include "SSH_Common.h" #include "OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.h" #include "assocOpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.h" int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_load(const CMPIBroker* broker, string& errorMessage); int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_unload(string& errorMessage); int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint& newInstance, const OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint& oldInstance, const char** properties, string& errorMessage); int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint& instance, string& errorMessage); int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint& instance, string& errorMessage); int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint_populate(OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint& instance, string& errorMessage); #endif /*OPENDRIM_TCPPROTOCOLENDPOINTBINDSTOIPPROTOCOLENDPOINTACCESS_H_*/ opendrim-lmp-ssh-1.0.0/INSTALL0000644000175000017500000000667011415301347016501 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# --------------------------------------------------------- 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-ssh-1.0.0/OpenDRIM_RegisteredSSHProfile/0000755000175000017500000000000011415301347023070 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/OpenDRIM_RegisteredSSHProfile/Makefile.am0000644000175000017500000000407511415301347025132 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSSH_OpenDRIM_RegisteredSSHProfileProvider.la libcmpiSSH_OpenDRIM_RegisteredSSHProfileProvider_la_SOURCES = OpenDRIM_RegisteredSSHProfileAccess.cpp OpenDRIM_RegisteredSSHProfileProvider.cpp cmpiOpenDRIM_RegisteredSSHProfile.cpp libcmpiSSH_OpenDRIM_RegisteredSSHProfileProvider_la_LIBADD = ../Common/libcmpiSSH_Common.la libcmpiSSH_OpenDRIM_RegisteredSSHProfileProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_RegisteredSSHProfile.h OpenDRIM_RegisteredSSHProfile.h OpenDRIM_RegisteredSSHProfileAccess.h opendrim-lmp-ssh-1.0.0/OpenDRIM_RegisteredSSHProfile/OpenDRIM_RegisteredSSHProfileProvider.cpp0000644000175000017500000003605711415301347032753 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredSSHProfile.h" #include "OpenDRIM_RegisteredSSHProfileAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define SSH_OpenDRIM_RegisteredSSHProfileProviderSetInstance SSH_OpenDRIM_RegisteredSSHProfileProviderModifyInstance #endif int SSH_OpenDRIM_RegisteredSSHProfile_init(const CMPIBroker* broker); int SSH_OpenDRIM_RegisteredSSHProfile_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus SSH_OpenDRIM_RegisteredSSHProfileProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_RegisteredSSHProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_RegisteredSSHProfileProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = SSH_OpenDRIM_RegisteredSSHProfile_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSSHProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_RegisteredSSHProfile_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_RegisteredSSHProfileProviderEnumInstances(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 = SSH_OpenDRIM_RegisteredSSHProfile_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSSHProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = SSH_OpenDRIM_RegisteredSSHProfile_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_RegisteredSSHProfileProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredSSHProfile instance; SSH_OpenDRIM_RegisteredSSHProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_RegisteredSSHProfile_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSSHProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = SSH_OpenDRIM_RegisteredSSHProfile_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_RegisteredSSHProfileProviderSetInstance(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_RegisteredSSHProfile newInstance, oldInstance; SSH_OpenDRIM_RegisteredSSHProfile_toCPP(_broker, ci, newInstance); SSH_OpenDRIM_RegisteredSSHProfile_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = SSH_OpenDRIM_RegisteredSSHProfile_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSSHProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_RegisteredSSHProfile_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSSHProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_RegisteredSSHProfileProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredSSHProfile instance; SSH_OpenDRIM_RegisteredSSHProfile_toCPP(_broker, ci, instance); string errorMessage; int errorCode = SSH_OpenDRIM_RegisteredSSHProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_RegisteredSSHProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_RegisteredSSHProfile_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSSHProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_RegisteredSSHProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSSHProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = SSH_OpenDRIM_RegisteredSSHProfile_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_RegisteredSSHProfileProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredSSHProfile instance; SSH_OpenDRIM_RegisteredSSHProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_RegisteredSSHProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSSHProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_RegisteredSSHProfile_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSSHProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_RegisteredSSHProfileProviderExecQuery(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 SSH_OpenDRIM_RegisteredSSHProfileProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_RegisteredSSHProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_RegisteredSSHProfileProviderInvokeMethod(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_RegisteredSSHProfile instance; SSH_OpenDRIM_RegisteredSSHProfile_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"InstanceID"}; int errorCode = SSH_OpenDRIM_RegisteredSSHProfile_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSSHProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="CloseConformantInstances") { unsigned int returnValue; OpenDRIM_RegisteredSSHProfile_CloseConformantInstances_In inArgs; SSH_OpenDRIM_RegisteredSSHProfile_toCPP(_broker, in, inArgs); errorCode = SSH_OpenDRIM_RegisteredSSHProfile_CloseConformantInstances(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSSHProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="OpenConformantInstances") { unsigned int returnValue; OpenDRIM_RegisteredSSHProfile_OpenConformantInstances_In inArgs; SSH_OpenDRIM_RegisteredSSHProfile_toCPP(_broker, in, inArgs); OpenDRIM_RegisteredSSHProfile_OpenConformantInstances_Out outArgs; errorCode = SSH_OpenDRIM_RegisteredSSHProfile_OpenConformantInstances(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSSHProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } SSH_OpenDRIM_RegisteredSSHProfile_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="PullConformantInstances") { unsigned int returnValue; OpenDRIM_RegisteredSSHProfile_PullConformantInstances_In inArgs; SSH_OpenDRIM_RegisteredSSHProfile_toCPP(_broker, in, inArgs); OpenDRIM_RegisteredSSHProfile_PullConformantInstances_Out outArgs; errorCode = SSH_OpenDRIM_RegisteredSSHProfile_PullConformantInstances(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSSHProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } SSH_OpenDRIM_RegisteredSSHProfile_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else { errorMessage = (string) OpenDRIM_RegisteredSSHProfile_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 SSH_OpenDRIM_RegisteredSSHProfile_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = SSH_OpenDRIM_RegisteredSSHProfile_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_RegisteredSSHProfile_init FAILED: " + (string) OpenDRIM_RegisteredSSHProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int SSH_OpenDRIM_RegisteredSSHProfile_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = SSH_OpenDRIM_RegisteredSSHProfile_unload(errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_RegisteredSSHProfile_unload FAILED: " + (string) OpenDRIM_RegisteredSSHProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define SSH_OpenDRIM_RegisteredSSHProfile_INIT if (SSH_OpenDRIM_RegisteredSSHProfile_init(_broker) < 0) return NULL CMInstanceMIStub(SSH_OpenDRIM_RegisteredSSHProfileProvider, SSH_OpenDRIM_RegisteredSSHProfileProvider, _broker, SSH_OpenDRIM_RegisteredSSHProfile_INIT); CMMethodMIStub(SSH_OpenDRIM_RegisteredSSHProfileProvider, SSH_OpenDRIM_RegisteredSSHProfileProvider, _broker, SSH_OpenDRIM_RegisteredSSHProfile_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_RegisteredSSHProfile/OpenDRIM_RegisteredSSHProfile.h0000644000175000017500000004234411415301347030701 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_REGISTEREDSSHPROFILE_H_ #define OPENDRIM_REGISTEREDSSHPROFILE_H_ #include const static char* OpenDRIM_RegisteredSSHProfile_classnames[] = {"OpenDRIM_RegisteredSSHProfile"}; static string OpenDRIM_RegisteredSSHProfile_NAMESPACE = _INTEROP_NAMESPACE; class OpenDRIM_RegisteredSSHProfile { public: string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; unsigned long long Generation; bool Generation_isNULL; string InstanceID; bool InstanceID_isNULL; string OtherSpecificationType; bool OtherSpecificationType_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; unsigned short SpecificationType; bool SpecificationType_isNULL; vector ImplementedFeatures; bool ImplementedFeatures_isNULL; OpenDRIM_RegisteredSSHProfile() { Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; Generation_isNULL = true; InstanceID_isNULL = true; OtherSpecificationType_isNULL = true; RegisteredOrganization_isNULL = true; OtherRegisteredOrganization_isNULL = true; RegisteredName_isNULL = true; RegisteredVersion_isNULL = true; AdvertiseTypes_isNULL = true; AdvertiseTypeDescriptions_isNULL = true; SpecificationType_isNULL = true; ImplementedFeatures_isNULL = true; } ~OpenDRIM_RegisteredSSHProfile() {} 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 getGeneration(unsigned long long& value) const { if (Generation_isNULL==true) return NOT_FOUND; value = Generation; return OK; } int setGeneration(const unsigned long long& newValue) { Generation = newValue; Generation_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 getOtherSpecificationType(string& value) const { if (OtherSpecificationType_isNULL==true) return NOT_FOUND; value = OtherSpecificationType; return OK; } int setOtherSpecificationType(const string& newValue) { OtherSpecificationType = newValue; OtherSpecificationType_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; } int getSpecificationType(unsigned short& value) const { if (SpecificationType_isNULL==true) return NOT_FOUND; value = SpecificationType; return OK; } int setSpecificationType(const unsigned short& newValue) { SpecificationType = newValue; SpecificationType_isNULL = false; return OK; } int getImplementedFeatures(vector& value) const { if (ImplementedFeatures_isNULL==true) return NOT_FOUND; value = ImplementedFeatures; return OK; } int setImplementedFeatures(const vector& newValue) { ImplementedFeatures = newValue; ImplementedFeatures_isNULL = false; return OK; } }; class OpenDRIM_RegisteredSSHProfile_CloseConformantInstances_In { public: string EnumerationContext; bool EnumerationContext_isNULL; OpenDRIM_RegisteredSSHProfile_CloseConformantInstances_In() { EnumerationContext_isNULL = true; } ~OpenDRIM_RegisteredSSHProfile_CloseConformantInstances_In() {} int getEnumerationContext(string& value) const { if (EnumerationContext_isNULL == true) return NOT_FOUND; value = EnumerationContext; return OK; } int setEnumerationContext(const string& newValue) { EnumerationContext = newValue; EnumerationContext_isNULL = false; return OK; } }; class OpenDRIM_RegisteredSSHProfile_OpenConformantInstances_In { public: string ResultClass; bool ResultClass_isNULL; vector IncludedPropertyList; bool IncludedPropertyList_isNULL; unsigned int OperationTimeout; bool OperationTimeout_isNULL; bool ContinueOnError; bool ContinueOnError_isNULL; unsigned int MaxObjectCount; bool MaxObjectCount_isNULL; string EnumerationContext; bool EnumerationContext_isNULL; bool EndOfSequence; bool EndOfSequence_isNULL; vector InstanceType; bool InstanceType_isNULL; vector InstanceWithPathList; bool InstanceWithPathList_isNULL; OpenDRIM_RegisteredSSHProfile_OpenConformantInstances_In() { ResultClass_isNULL = true; IncludedPropertyList_isNULL = true; OperationTimeout_isNULL = true; ContinueOnError_isNULL = true; MaxObjectCount_isNULL = true; EnumerationContext_isNULL = true; EndOfSequence_isNULL = true; InstanceType_isNULL = true; InstanceWithPathList_isNULL = true; } ~OpenDRIM_RegisteredSSHProfile_OpenConformantInstances_In() {} int getResultClass(string& value) const { if (ResultClass_isNULL == true) return NOT_FOUND; value = ResultClass; return OK; } int setResultClass(const string& newValue) { ResultClass = newValue; ResultClass_isNULL = false; return OK; } int getIncludedPropertyList(vector& value) const { if (IncludedPropertyList_isNULL == true) return NOT_FOUND; value = IncludedPropertyList; return OK; } int setIncludedPropertyList(const vector& newValue) { IncludedPropertyList = newValue; IncludedPropertyList_isNULL = false; return OK; } int getOperationTimeout(unsigned int& value) const { if (OperationTimeout_isNULL == true) return NOT_FOUND; value = OperationTimeout; return OK; } int setOperationTimeout(const unsigned int& newValue) { OperationTimeout = newValue; OperationTimeout_isNULL = false; return OK; } int getContinueOnError(bool& value) const { if (ContinueOnError_isNULL == true) return NOT_FOUND; value = ContinueOnError; return OK; } int setContinueOnError(const bool& newValue) { ContinueOnError = newValue; ContinueOnError_isNULL = false; return OK; } int getMaxObjectCount(unsigned int& value) const { if (MaxObjectCount_isNULL == true) return NOT_FOUND; value = MaxObjectCount; return OK; } int setMaxObjectCount(const unsigned int& newValue) { MaxObjectCount = newValue; MaxObjectCount_isNULL = false; return OK; } int getEnumerationContext(string& value) const { if (EnumerationContext_isNULL == true) return NOT_FOUND; value = EnumerationContext; return OK; } int setEnumerationContext(const string& newValue) { EnumerationContext = newValue; EnumerationContext_isNULL = false; return OK; } int getEndOfSequence(bool& value) const { if (EndOfSequence_isNULL == true) return NOT_FOUND; value = EndOfSequence; return OK; } int setEndOfSequence(const bool& newValue) { EndOfSequence = newValue; EndOfSequence_isNULL = false; return OK; } int getInstanceType(vector& value) const { if (InstanceType_isNULL == true) return NOT_FOUND; value = InstanceType; return OK; } int setInstanceType(const vector& newValue) { InstanceType = newValue; InstanceType_isNULL = false; return OK; } int getInstanceWithPathList(vector& value) const { if (InstanceWithPathList_isNULL == true) return NOT_FOUND; value = InstanceWithPathList; return OK; } int setInstanceWithPathList(const vector& newValue) { InstanceWithPathList = newValue; InstanceWithPathList_isNULL = false; return OK; } }; class OpenDRIM_RegisteredSSHProfile_OpenConformantInstances_Out { public: string EnumerationContext; bool EnumerationContext_isNULL; bool EndOfSequence; bool EndOfSequence_isNULL; vector InstanceType; bool InstanceType_isNULL; vector InstanceWithPathList; bool InstanceWithPathList_isNULL; OpenDRIM_RegisteredSSHProfile_OpenConformantInstances_Out() { EnumerationContext_isNULL = true; EndOfSequence_isNULL = true; InstanceType_isNULL = true; InstanceWithPathList_isNULL = true; } ~OpenDRIM_RegisteredSSHProfile_OpenConformantInstances_Out() {} int getEnumerationContext(string& value) const { if (EnumerationContext_isNULL == true) return NOT_FOUND; value = EnumerationContext; return OK; } int setEnumerationContext(const string& newValue) { EnumerationContext = newValue; EnumerationContext_isNULL = false; return OK; } int getEndOfSequence(bool& value) const { if (EndOfSequence_isNULL == true) return NOT_FOUND; value = EndOfSequence; return OK; } int setEndOfSequence(const bool& newValue) { EndOfSequence = newValue; EndOfSequence_isNULL = false; return OK; } int getInstanceType(vector& value) const { if (InstanceType_isNULL == true) return NOT_FOUND; value = InstanceType; return OK; } int setInstanceType(const vector& newValue) { InstanceType = newValue; InstanceType_isNULL = false; return OK; } int getInstanceWithPathList(vector& value) const { if (InstanceWithPathList_isNULL == true) return NOT_FOUND; value = InstanceWithPathList; return OK; } int setInstanceWithPathList(const vector& newValue) { InstanceWithPathList = newValue; InstanceWithPathList_isNULL = false; return OK; } }; class OpenDRIM_RegisteredSSHProfile_PullConformantInstances_In { public: unsigned int MaxObjectCount; bool MaxObjectCount_isNULL; string EnumerationContext; bool EnumerationContext_isNULL; bool EndOfSequence; bool EndOfSequence_isNULL; vector InstanceType; bool InstanceType_isNULL; vector InstanceWithPathList; bool InstanceWithPathList_isNULL; OpenDRIM_RegisteredSSHProfile_PullConformantInstances_In() { MaxObjectCount_isNULL = true; EnumerationContext_isNULL = true; EndOfSequence_isNULL = true; InstanceType_isNULL = true; InstanceWithPathList_isNULL = true; } ~OpenDRIM_RegisteredSSHProfile_PullConformantInstances_In() {} int getMaxObjectCount(unsigned int& value) const { if (MaxObjectCount_isNULL == true) return NOT_FOUND; value = MaxObjectCount; return OK; } int setMaxObjectCount(const unsigned int& newValue) { MaxObjectCount = newValue; MaxObjectCount_isNULL = false; return OK; } int getEnumerationContext(string& value) const { if (EnumerationContext_isNULL == true) return NOT_FOUND; value = EnumerationContext; return OK; } int setEnumerationContext(const string& newValue) { EnumerationContext = newValue; EnumerationContext_isNULL = false; return OK; } int getEndOfSequence(bool& value) const { if (EndOfSequence_isNULL == true) return NOT_FOUND; value = EndOfSequence; return OK; } int setEndOfSequence(const bool& newValue) { EndOfSequence = newValue; EndOfSequence_isNULL = false; return OK; } int getInstanceType(vector& value) const { if (InstanceType_isNULL == true) return NOT_FOUND; value = InstanceType; return OK; } int setInstanceType(const vector& newValue) { InstanceType = newValue; InstanceType_isNULL = false; return OK; } int getInstanceWithPathList(vector& value) const { if (InstanceWithPathList_isNULL == true) return NOT_FOUND; value = InstanceWithPathList; return OK; } int setInstanceWithPathList(const vector& newValue) { InstanceWithPathList = newValue; InstanceWithPathList_isNULL = false; return OK; } }; class OpenDRIM_RegisteredSSHProfile_PullConformantInstances_Out { public: string EnumerationContext; bool EnumerationContext_isNULL; bool EndOfSequence; bool EndOfSequence_isNULL; vector InstanceType; bool InstanceType_isNULL; vector InstanceWithPathList; bool InstanceWithPathList_isNULL; OpenDRIM_RegisteredSSHProfile_PullConformantInstances_Out() { EnumerationContext_isNULL = true; EndOfSequence_isNULL = true; InstanceType_isNULL = true; InstanceWithPathList_isNULL = true; } ~OpenDRIM_RegisteredSSHProfile_PullConformantInstances_Out() {} int getEnumerationContext(string& value) const { if (EnumerationContext_isNULL == true) return NOT_FOUND; value = EnumerationContext; return OK; } int setEnumerationContext(const string& newValue) { EnumerationContext = newValue; EnumerationContext_isNULL = false; return OK; } int getEndOfSequence(bool& value) const { if (EndOfSequence_isNULL == true) return NOT_FOUND; value = EndOfSequence; return OK; } int setEndOfSequence(const bool& newValue) { EndOfSequence = newValue; EndOfSequence_isNULL = false; return OK; } int getInstanceType(vector& value) const { if (InstanceType_isNULL == true) return NOT_FOUND; value = InstanceType; return OK; } int setInstanceType(const vector& newValue) { InstanceType = newValue; InstanceType_isNULL = false; return OK; } int getInstanceWithPathList(vector& value) const { if (InstanceWithPathList_isNULL == true) return NOT_FOUND; value = InstanceWithPathList; return OK; } int setInstanceWithPathList(const vector& newValue) { InstanceWithPathList = newValue; InstanceWithPathList_isNULL = false; return OK; } }; #endif /*OPENDRIM_REGISTEREDSSHPROFILE_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_RegisteredSSHProfile/OpenDRIM_RegisteredSSHProfileAccess.h0000644000175000017500000000762611415301347032027 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_REGISTEREDSSHPROFILEACCESS_H_ #define OPENDRIM_REGISTEREDSSHPROFILEACCESS_H_ #include "SSH_Common.h" #include "OpenDRIM_RegisteredSSHProfile.h" int SSH_OpenDRIM_RegisteredSSHProfile_load(const CMPIBroker* broker, string& errorMessage); int SSH_OpenDRIM_RegisteredSSHProfile_unload(string& errorMessage); int SSH_OpenDRIM_RegisteredSSHProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_RegisteredSSHProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_RegisteredSSHProfile& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_RegisteredSSHProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredSSHProfile& newInstance, const OpenDRIM_RegisteredSSHProfile& oldInstance, const char** properties, string& errorMessage); int SSH_OpenDRIM_RegisteredSSHProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredSSHProfile& instance, string& errorMessage); int SSH_OpenDRIM_RegisteredSSHProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredSSHProfile& instance, string& errorMessage); int SSH_OpenDRIM_RegisteredSSHProfile_CloseConformantInstances(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredSSHProfile& instance, unsigned int& returnValue, const OpenDRIM_RegisteredSSHProfile_CloseConformantInstances_In& in, string& errorMessage); int SSH_OpenDRIM_RegisteredSSHProfile_OpenConformantInstances(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredSSHProfile& instance, unsigned int& returnValue, const OpenDRIM_RegisteredSSHProfile_OpenConformantInstances_In& in, OpenDRIM_RegisteredSSHProfile_OpenConformantInstances_Out& out, string& errorMessage); int SSH_OpenDRIM_RegisteredSSHProfile_PullConformantInstances(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredSSHProfile& instance, unsigned int& returnValue, const OpenDRIM_RegisteredSSHProfile_PullConformantInstances_In& in, OpenDRIM_RegisteredSSHProfile_PullConformantInstances_Out& out, string& errorMessage); int SSH_OpenDRIM_RegisteredSSHProfile_populate(OpenDRIM_RegisteredSSHProfile& instance, string& errorMessage); #endif /*OPENDRIM_REGISTEREDSSHPROFILEACCESS_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_RegisteredSSHProfile/cmpiOpenDRIM_RegisteredSSHProfile.cpp0000644000175000017500000002650311415301347032104 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredSSHProfile.h" CMPIObjectPath* SSH_OpenDRIM_RegisteredSSHProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RegisteredSSHProfile& instance) { _E_; Objectpath op(broker, OpenDRIM_RegisteredSSHProfile_classnames[0], OpenDRIM_RegisteredSSHProfile_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* SSH_OpenDRIM_RegisteredSSHProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RegisteredSSHProfile& instance) { _E_; Objectpath op(broker, SSH_OpenDRIM_RegisteredSSHProfile_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.Generation_isNULL) ci.setProperty("Generation", instance.Generation); if (!instance.OtherSpecificationType_isNULL) ci.setProperty("OtherSpecificationType", instance.OtherSpecificationType); 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); if (!instance.SpecificationType_isNULL) ci.setProperty("SpecificationType", instance.SpecificationType); if (!instance.ImplementedFeatures_isNULL) ci.setProperty("ImplementedFeatures", instance.ImplementedFeatures); _L_; return ci.getHdl(); } void SSH_OpenDRIM_RegisteredSSHProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RegisteredSSHProfile& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void SSH_OpenDRIM_RegisteredSSHProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RegisteredSSHProfile& 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("Generation", instance.Generation) == OK) instance.Generation_isNULL = false; if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("OtherSpecificationType", instance.OtherSpecificationType) == OK) instance.OtherSpecificationType_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; if (inst.getProperty("SpecificationType", instance.SpecificationType) == OK) instance.SpecificationType_isNULL = false; if (inst.getProperty("ImplementedFeatures", instance.ImplementedFeatures) == OK) instance.ImplementedFeatures_isNULL = false; _L_; } void SSH_OpenDRIM_RegisteredSSHProfile_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_RegisteredSSHProfile_CloseConformantInstances_In& args) { _E_; CMPIStatus rc; CMPIData data; string EnumerationContext; data = in->ft->getArg(in, "EnumerationContext", &rc); if (rc.rc == OK) { CT_ToC(data, EnumerationContext); args.setEnumerationContext(EnumerationContext); } _L_; } void SSH_OpenDRIM_RegisteredSSHProfile_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_RegisteredSSHProfile_OpenConformantInstances_In& args) { _E_; CMPIStatus rc; CMPIData data; string ResultClass; data = in->ft->getArg(in, "ResultClass", &rc); if (rc.rc == OK) { CT_ToC(data, ResultClass); args.setResultClass(ResultClass); } vector IncludedPropertyList; data = in->ft->getArg(in, "IncludedPropertyList", &rc); if (rc.rc == OK) { CT_ToC(data, IncludedPropertyList); args.setIncludedPropertyList(IncludedPropertyList); } unsigned int OperationTimeout; data = in->ft->getArg(in, "OperationTimeout", &rc); if (rc.rc == OK) { CT_ToC(data, OperationTimeout); args.setOperationTimeout(OperationTimeout); } bool ContinueOnError; data = in->ft->getArg(in, "ContinueOnError", &rc); if (rc.rc == OK) { CT_ToC(data, ContinueOnError); args.setContinueOnError(ContinueOnError); } unsigned int MaxObjectCount; data = in->ft->getArg(in, "MaxObjectCount", &rc); if (rc.rc == OK) { CT_ToC(data, MaxObjectCount); args.setMaxObjectCount(MaxObjectCount); } string EnumerationContext; data = in->ft->getArg(in, "EnumerationContext", &rc); if (rc.rc == OK) { CT_ToC(data, EnumerationContext); args.setEnumerationContext(EnumerationContext); } bool EndOfSequence; data = in->ft->getArg(in, "EndOfSequence", &rc); if (rc.rc == OK) { CT_ToC(data, EndOfSequence); args.setEndOfSequence(EndOfSequence); } vector InstanceType; data = in->ft->getArg(in, "InstanceType", &rc); if (rc.rc == OK) { CT_ToC(data, InstanceType); args.setInstanceType(InstanceType); } vector InstanceWithPathList; data = in->ft->getArg(in, "InstanceWithPathList", &rc); if (rc.rc == OK) { CT_ToC(data, InstanceWithPathList); args.setInstanceWithPathList(InstanceWithPathList); } _L_; } void SSH_OpenDRIM_RegisteredSSHProfile_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_RegisteredSSHProfile_OpenConformantInstances_Out& args) { _E_; CMPIValue value; int errorMessage; string EnumerationContext; errorMessage = args.getEnumerationContext(EnumerationContext); if (errorMessage == OK) { value = CT_toCMPI(broker, EnumerationContext); out->ft->addArg(out, "EnumerationContext", &value, CMPI_string); } bool EndOfSequence; errorMessage = args.getEndOfSequence(EndOfSequence); if (errorMessage == OK) { value = CT_toCMPI(EndOfSequence); out->ft->addArg(out, "EndOfSequence", &value, CMPI_boolean); } vector InstanceType; errorMessage = args.getInstanceType(InstanceType); if (errorMessage == OK) { value = CT_toCMPI(broker, InstanceType); out->ft->addArg(out, "InstanceType", &value, CMPI_uint16A); } vector InstanceWithPathList; errorMessage = args.getInstanceWithPathList(InstanceWithPathList); if (errorMessage == OK) { value = CT_toCMPI(broker, InstanceWithPathList); out->ft->addArg(out, "InstanceWithPathList", &value, CMPI_stringA); } _L_; } void SSH_OpenDRIM_RegisteredSSHProfile_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_RegisteredSSHProfile_PullConformantInstances_In& args) { _E_; CMPIStatus rc; CMPIData data; unsigned int MaxObjectCount; data = in->ft->getArg(in, "MaxObjectCount", &rc); if (rc.rc == OK) { CT_ToC(data, MaxObjectCount); args.setMaxObjectCount(MaxObjectCount); } string EnumerationContext; data = in->ft->getArg(in, "EnumerationContext", &rc); if (rc.rc == OK) { CT_ToC(data, EnumerationContext); args.setEnumerationContext(EnumerationContext); } bool EndOfSequence; data = in->ft->getArg(in, "EndOfSequence", &rc); if (rc.rc == OK) { CT_ToC(data, EndOfSequence); args.setEndOfSequence(EndOfSequence); } vector InstanceType; data = in->ft->getArg(in, "InstanceType", &rc); if (rc.rc == OK) { CT_ToC(data, InstanceType); args.setInstanceType(InstanceType); } vector InstanceWithPathList; data = in->ft->getArg(in, "InstanceWithPathList", &rc); if (rc.rc == OK) { CT_ToC(data, InstanceWithPathList); args.setInstanceWithPathList(InstanceWithPathList); } _L_; } void SSH_OpenDRIM_RegisteredSSHProfile_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_RegisteredSSHProfile_PullConformantInstances_Out& args) { _E_; CMPIValue value; int errorMessage; string EnumerationContext; errorMessage = args.getEnumerationContext(EnumerationContext); if (errorMessage == OK) { value = CT_toCMPI(broker, EnumerationContext); out->ft->addArg(out, "EnumerationContext", &value, CMPI_string); } bool EndOfSequence; errorMessage = args.getEndOfSequence(EndOfSequence); if (errorMessage == OK) { value = CT_toCMPI(EndOfSequence); out->ft->addArg(out, "EndOfSequence", &value, CMPI_boolean); } vector InstanceType; errorMessage = args.getInstanceType(InstanceType); if (errorMessage == OK) { value = CT_toCMPI(broker, InstanceType); out->ft->addArg(out, "InstanceType", &value, CMPI_uint16A); } vector InstanceWithPathList; errorMessage = args.getInstanceWithPathList(InstanceWithPathList); if (errorMessage == OK) { value = CT_toCMPI(broker, InstanceWithPathList); out->ft->addArg(out, "InstanceWithPathList", &value, CMPI_stringA); } _L_; } opendrim-lmp-ssh-1.0.0/OpenDRIM_RegisteredSSHProfile/cmpiOpenDRIM_RegisteredSSHProfile.h0000644000175000017500000000577411415301347031560 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef CMPIOPENDRIM_REGISTEREDSSHPROFILE_H_ #define CMPIOPENDRIM_REGISTEREDSSHPROFILE_H_ #include "OpenDRIM_RegisteredSSHProfile.h" CMPIObjectPath* SSH_OpenDRIM_RegisteredSSHProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RegisteredSSHProfile& instance); CMPIInstance* SSH_OpenDRIM_RegisteredSSHProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RegisteredSSHProfile& instance); void SSH_OpenDRIM_RegisteredSSHProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RegisteredSSHProfile& instance); void SSH_OpenDRIM_RegisteredSSHProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RegisteredSSHProfile& instance); void SSH_OpenDRIM_RegisteredSSHProfile_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_RegisteredSSHProfile_CloseConformantInstances_In& args); void SSH_OpenDRIM_RegisteredSSHProfile_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_RegisteredSSHProfile_OpenConformantInstances_In& args); void SSH_OpenDRIM_RegisteredSSHProfile_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_RegisteredSSHProfile_OpenConformantInstances_Out& args); void SSH_OpenDRIM_RegisteredSSHProfile_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_RegisteredSSHProfile_PullConformantInstances_In& args); void SSH_OpenDRIM_RegisteredSSHProfile_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_RegisteredSSHProfile_PullConformantInstances_Out& args); #endif /*CMPIOPENDRIM_REGISTEREDSSHPROFILE_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_RegisteredSSHProfile/OpenDRIM_RegisteredSSHProfileAccess.cpp0000644000175000017500000001154011415301347032350 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "OpenDRIM_RegisteredSSHProfileAccess.h" const string InstanceID = "OpenDRIM:SSHService:1.0.0"; int SSH_OpenDRIM_RegisteredSSHProfile_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_RegisteredSSHProfile_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_RegisteredSSHProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; OpenDRIM_RegisteredSSHProfile instance; instance.setInstanceID(InstanceID); if (discriminant == "ei") CF_assert(SSH_OpenDRIM_RegisteredSSHProfile_populate(instance, errorMessage)); result.push_back(instance); _L_; return OK; } int SSH_OpenDRIM_RegisteredSSHProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_RegisteredSSHProfile& instance, const char** properties, string& errorMessage) { _E_; if (instance.InstanceID != InstanceID) { errorMessage = "No instance"; return NOT_FOUND; } CF_assert(SSH_OpenDRIM_RegisteredSSHProfile_populate(instance, errorMessage)); _L_; return OK; } int SSH_OpenDRIM_RegisteredSSHProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredSSHProfile& newInstance, const OpenDRIM_RegisteredSSHProfile& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_RegisteredSSHProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredSSHProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_RegisteredSSHProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredSSHProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_RegisteredSSHProfile_CloseConformantInstances(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredSSHProfile& instance, unsigned int& returnValue, const OpenDRIM_RegisteredSSHProfile_CloseConformantInstances_In& in, string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_RegisteredSSHProfile_OpenConformantInstances(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredSSHProfile& instance, unsigned int& returnValue, const OpenDRIM_RegisteredSSHProfile_OpenConformantInstances_In& in, OpenDRIM_RegisteredSSHProfile_OpenConformantInstances_Out& out, string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_RegisteredSSHProfile_PullConformantInstances(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredSSHProfile& instance, unsigned int& returnValue, const OpenDRIM_RegisteredSSHProfile_PullConformantInstances_In& in, OpenDRIM_RegisteredSSHProfile_PullConformantInstances_Out& out, string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_RegisteredSSHProfile_populate(OpenDRIM_RegisteredSSHProfile& instance, string& errorMessage) { _E_; vector advertiseTypes; instance.setRegisteredName("SSH Service"); instance.setRegisteredVersion("1.0.0"); instance.setRegisteredOrganization(2); // DMTF advertiseTypes.push_back(2); // Not Advertised instance.setAdvertiseTypes(advertiseTypes); _L_; return OK; } opendrim-lmp-ssh-1.0.0/AUTHORS0000644000175000017500000000013511415301347016506 0ustar guillaumeguillaumeFeng Zhanlei Guillaume BOTTEX opendrim-lmp-ssh-1.0.0/packaging/0000755000175000017500000000000011415301347017363 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/packaging/debian/0000755000175000017500000000000011415306112020600 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/packaging/debian/postrm0000644000175000017500000000410511415301347022054 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_SSHProtocolEndpoint rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_SSHProtocolCapabilities rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_TCPProtocolEndpoint rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_SSHSessionSettingData rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_SSHProtocolProvidesEndpoint rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_SSHCapabilities rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_HostedSSHAccessPoint rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_RegisteredSSHProfile rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_SSHConformsToProfile rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_SSHProtocolService rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_SSHServiceAccessBySAP rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_SSHServiceSettingData rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_SSHSettingData rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_HostedSSHService rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint ;; 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-ssh-1.0.0/packaging/debian/source/0000755000175000017500000000000011415301347022105 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/packaging/debian/source/format0000644000175000017500000000001411415301347023313 0ustar guillaumeguillaume3.0 (quilt) opendrim-lmp-ssh-1.0.0/packaging/debian/copyright0000644000175000017500000000276711415301347022554 0ustar guillaumeguillaumeThis package was debianized by Guillaume BOTTEX on Wed, 7 Jul 2010 11:04:10 +0900. It was downloaded from http://opendrim.sourceforge.net/ Upstream Author: Feng Zhanlei Guillaume BOTTEX Copyright: Copyright (C) 2010 REDFLAG Feng Zhanlei Copyright (C) 2010 UXSystem Guillaume BOTTEX License: Linux Management Providers (LMP), SSH 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-ssh-1.0.0/packaging/debian/control0000644000175000017500000000127011415306112022203 0ustar guillaumeguillaumeSource: opendrim-lmp-ssh 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-ssh Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, sfcb, libopendrim0 (>= 1.1.3), cim-schema (>= 2.25.0) Description: OpenDRIM SSH provider Provides information about the management capabilities of ssh service. . Compliant with the DMTF SSH Service Profile v1.0.0 (DSP1017). opendrim-lmp-ssh-1.0.0/packaging/debian/prerm0000644000175000017500000000240511415301347021656 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-ssh VERSION=`cat /usr/share/doc/opendrim-lmp-ssh/VERSION` OPENDRIM_REG_DIR=/usr/share/OpenDRIM PROVIDER_SCRIPT_POST=SSH $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-ssh-1.0.0/packaging/debian/changelog0000644000175000017500000000024311415306031022451 0ustar guillaumeguillaumeopendrim-lmp-ssh (1.0.0-0ubuntu1) maverick; urgency=low * Initial release -- Guillaume BOTTEX Wed, 7 Jul 2010 11:04:10 +0900 opendrim-lmp-ssh-1.0.0/packaging/debian/postinst0000644000175000017500000000256211415301347022420 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-ssh VERSION=`cat /usr/share/doc/opendrim-lmp-ssh/VERSION` OPENDRIM_REG_DIR=/usr/share/OpenDRIM PROVIDER_SCRIPT_POST=SSH $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-ssh-1.0.0/packaging/debian/install0000644000175000017500000000004711415301347022177 0ustar guillaumeguillaumeusr/lib/cmpi/*.so usr/share/OpenDRIM/* opendrim-lmp-ssh-1.0.0/packaging/debian/rules0000755000175000017500000000353311415301347021671 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-ssh 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-ssh.sgml > opendrim-lmp-ssh.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-ssh-1.0.0/packaging/debian/docs0000644000175000017500000000003111415301347021452 0ustar guillaumeguillaumeNEWS README TODO VERSION opendrim-lmp-ssh-1.0.0/packaging/debian/compat0000644000175000017500000000000211415301347022003 0ustar guillaumeguillaume5 opendrim-lmp-ssh-1.0.0/packaging/opendrim-lmp-ssh.spec0000644000175000017500000000765111415301347023446 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# %define packageVersion 1 Version: %{version} Release: %{packageVersion}%{?dist} Vendor: OpenDRIM Summary: OpenDRIM SSH Provider Name: opendrim-lmp-ssh Group: Systems Management/Base License: GPL BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root URL: http://opendrim.sourceforge.net Source: %{name}-%{version}.tar.gz BuildRequires: autoconf, tog-pegasus-devel, libopendrim >= 1.1.1 Requires: tog-pegasus, libopendrim >= 1.1.1 %description %global PEGASUS_ARCH_LIB %{_lib} %global COMMONLIBDIR /usr/%PEGASUS_ARCH_LIB %global PROVIDERDIR %COMMONLIBDIR/Pegasus/providers %global OPENDRIM_REG_DIR /usr/share/OpenDRIM %global OPENDRIM_MOF_DIR /usr/share/OpenDRIM/%{name}/mof %global PROVIDER_SCRIPT_POST SSH %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-ssh-1.0.0/OpenDRIM_TCPProtocolEndpoint/0000755000175000017500000000000011415301347022745 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpoint/Makefile.am0000644000175000017500000000406311415301347025004 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSSH_OpenDRIM_TCPProtocolEndpointProvider.la libcmpiSSH_OpenDRIM_TCPProtocolEndpointProvider_la_SOURCES = OpenDRIM_TCPProtocolEndpointAccess.cpp OpenDRIM_TCPProtocolEndpointProvider.cpp cmpiOpenDRIM_TCPProtocolEndpoint.cpp libcmpiSSH_OpenDRIM_TCPProtocolEndpointProvider_la_LIBADD = ../Common/libcmpiSSH_Common.la libcmpiSSH_OpenDRIM_TCPProtocolEndpointProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_TCPProtocolEndpoint.h OpenDRIM_TCPProtocolEndpoint.h OpenDRIM_TCPProtocolEndpointAccess.h opendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpoint/cmpiOpenDRIM_TCPProtocolEndpoint.h0000644000175000017500000000500411415301347031274 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef CMPIOPENDRIM_TCPPROTOCOLENDPOINT_H_ #define CMPIOPENDRIM_TCPPROTOCOLENDPOINT_H_ #include "OpenDRIM_TCPProtocolEndpoint.h" CMPIObjectPath* SSH_OpenDRIM_TCPProtocolEndpoint_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_TCPProtocolEndpoint& instance); CMPIInstance* SSH_OpenDRIM_TCPProtocolEndpoint_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_TCPProtocolEndpoint& instance); void SSH_OpenDRIM_TCPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_TCPProtocolEndpoint& instance); void SSH_OpenDRIM_TCPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_TCPProtocolEndpoint& instance); void SSH_OpenDRIM_TCPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_TCPProtocolEndpoint_RequestStateChange_In& args); void SSH_OpenDRIM_TCPProtocolEndpoint_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_TCPProtocolEndpoint_RequestStateChange_Out& args); #endif /*CMPIOPENDRIM_TCPPROTOCOLENDPOINT_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpoint/OpenDRIM_TCPProtocolEndpointAccess.h0000644000175000017500000000671111415301347031553 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_TCPPROTOCOLENDPOINTACCESS_H_ #define OPENDRIM_TCPPROTOCOLENDPOINTACCESS_H_ #include "SSH_Common.h" #include "OpenDRIM_TCPProtocolEndpoint.h" int SSH_OpenDRIM_TCPProtocolEndpoint_load(const CMPIBroker* broker, string& errorMessage); int SSH_OpenDRIM_TCPProtocolEndpoint_unload(string& errorMessage); int SSH_OpenDRIM_TCPProtocolEndpoint_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_TCPProtocolEndpoint_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_TCPProtocolEndpoint& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_TCPProtocolEndpoint_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_TCPProtocolEndpoint& newInstance, const OpenDRIM_TCPProtocolEndpoint& oldInstance, const char** properties, string& errorMessage); int SSH_OpenDRIM_TCPProtocolEndpoint_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_TCPProtocolEndpoint& instance, string& errorMessage); int SSH_OpenDRIM_TCPProtocolEndpoint_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_TCPProtocolEndpoint& instance, string& errorMessage); int SSH_OpenDRIM_TCPProtocolEndpoint_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_TCPProtocolEndpoint& instance, unsigned int& returnValue, const OpenDRIM_TCPProtocolEndpoint_RequestStateChange_In& in, OpenDRIM_TCPProtocolEndpoint_RequestStateChange_Out& out, string& errorMessage); int SSH_OpenDRIM_TCPProtocolEndpoint_BroadcastReset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_TCPProtocolEndpoint& instance, unsigned int& returnValue, string& errorMessage); int SSH_OpenDRIM_TCPProtocolEndpoint_populate(OpenDRIM_TCPProtocolEndpoint& instance, string& errorMessage); #endif /*OPENDRIM_TCPPROTOCOLENDPOINTACCESS_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpoint/OpenDRIM_TCPProtocolEndpoint.h0000644000175000017500000003634611415301347030440 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_TCPPROTOCOLENDPOINT_H_ #define OPENDRIM_TCPPROTOCOLENDPOINT_H_ #include const static char* OpenDRIM_TCPProtocolEndpoint_classnames[] = {"OpenDRIM_TCPProtocolEndpoint"}; static string OpenDRIM_TCPProtocolEndpoint_NAMESPACE = _NAMESPACE; class OpenDRIM_TCPProtocolEndpoint { public: string InstanceID; bool InstanceID_isNULL; string Caption; bool Caption_isNULL; string ElementName; bool ElementName_isNULL; unsigned long long Generation; bool Generation_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; string OtherTypeDescription; bool OtherTypeDescription_isNULL; bool BroadcastResetSupported; bool BroadcastResetSupported_isNULL; unsigned int PortNumber; bool PortNumber_isNULL; unsigned short ProtocolIFType; bool ProtocolIFType_isNULL; OpenDRIM_TCPProtocolEndpoint() { InstanceID_isNULL = true; Caption_isNULL = true; ElementName_isNULL = true; Generation_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; OtherTypeDescription_isNULL = true; BroadcastResetSupported_isNULL = true; PortNumber_isNULL = true; ProtocolIFType_isNULL = true; } ~OpenDRIM_TCPProtocolEndpoint() {} 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 getGeneration(unsigned long long& value) const { if (Generation_isNULL==true) return NOT_FOUND; value = Generation; return OK; } int setGeneration(const unsigned long long& newValue) { Generation = newValue; Generation_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 getOtherTypeDescription(string& value) const { if (OtherTypeDescription_isNULL==true) return NOT_FOUND; value = OtherTypeDescription; return OK; } int setOtherTypeDescription(const string& newValue) { OtherTypeDescription = newValue; OtherTypeDescription_isNULL = false; return OK; } int getBroadcastResetSupported(bool& value) const { if (BroadcastResetSupported_isNULL==true) return NOT_FOUND; value = BroadcastResetSupported; return OK; } int setBroadcastResetSupported(const bool& newValue) { BroadcastResetSupported = newValue; BroadcastResetSupported_isNULL = false; return OK; } int getPortNumber(unsigned int& value) const { if (PortNumber_isNULL==true) return NOT_FOUND; value = PortNumber; return OK; } int setPortNumber(const unsigned int& newValue) { PortNumber = newValue; PortNumber_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; } }; class OpenDRIM_TCPProtocolEndpoint_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_TCPProtocolEndpoint_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_TCPProtocolEndpoint_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_TCPProtocolEndpoint_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_TCPProtocolEndpoint_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_TCPProtocolEndpoint_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_TCPPROTOCOLENDPOINT_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpoint/OpenDRIM_TCPProtocolEndpointAccess.cpp0000644000175000017500000001307111415301347032103 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "OpenDRIM_TCPProtocolEndpointAccess.h" const string systemCreationClassName = "OpenDRIM_ComputerSystem"; const string creationClassName = "OpenDRIM_TCPProtocolEndpoint"; const string name = "IP Interface"; string systemName; int SSH_OpenDRIM_TCPProtocolEndpoint_load(const CMPIBroker* broker, string& errorMessage) { _E_; CF_assert(CF_getSystemName(systemName, errorMessage)); _L_; return OK; } int SSH_OpenDRIM_TCPProtocolEndpoint_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_TCPProtocolEndpoint_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; //Initialize an instance OpenDRIM_TCPProtocolEndpoint instance; instance.setSystemCreationClassName(systemCreationClassName); instance.setSystemName(systemName); instance.setCreationClassName(creationClassName); instance.setName(name); if (discriminant == "ei") CF_assert (SSH_OpenDRIM_TCPProtocolEndpoint_populate(instance, errorMessage)); result.push_back(instance); _L_; return OK; } int SSH_OpenDRIM_TCPProtocolEndpoint_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_TCPProtocolEndpoint& instance, const char** properties, string& errorMessage) { _E_; if (instance.SystemCreationClassName == systemCreationClassName && instance.CreationClassName == creationClassName && instance.SystemName == systemName && instance.Name == name) { CF_assert(SSH_OpenDRIM_TCPProtocolEndpoint_populate(instance, errorMessage)); } else { errorMessage = "Invalid path"; return NOT_FOUND; } _L_; return OK; } int SSH_OpenDRIM_TCPProtocolEndpoint_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_TCPProtocolEndpoint& newInstance, const OpenDRIM_TCPProtocolEndpoint& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_TCPProtocolEndpoint_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_TCPProtocolEndpoint& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_TCPProtocolEndpoint_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_TCPProtocolEndpoint& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_TCPProtocolEndpoint_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_TCPProtocolEndpoint& instance, unsigned int& returnValue, const OpenDRIM_TCPProtocolEndpoint_RequestStateChange_In& in, OpenDRIM_TCPProtocolEndpoint_RequestStateChange_Out& out, string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_TCPProtocolEndpoint_BroadcastReset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_TCPProtocolEndpoint& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_TCPProtocolEndpoint_populate(OpenDRIM_TCPProtocolEndpoint& 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] ProtocalIFType * [X] ElementName * [X] PortNumber * + Other: * [X] TimeOfLastStateChange * [X] EnabledDefault */ instance.setNameFormat("network-interface-name"); instance.setProtocolIFType(IFTYPE_TCP); if (instance.ProtocolIFType == IFTYPE_TCP) instance.setElementName("IP interface bound to a SSH session or service"); string portNum; unsigned long number = 22; CF_getConfigItem("Port", portNum, errorMessage); if (strlen(portNum.c_str()) != 0) number = strtoul(portNum.c_str(), NULL, 10); instance.setPortNumber(number); instance.setEnabledDefault(ED_ENABLE); //TimeOfLastStateChange string modifiedTime; CF_assert(CF_lastModified(SSH_CONFIG_FILE, modifiedTime, errorMessage)); instance.setTimeOfLastStateChange(modifiedTime); _L_; return OK; } opendrim-lmp-ssh-1.0.0/OpenDRIM_TCPProtocolEndpoint/cmpiOpenDRIM_TCPProtocolEndpoint.cpp0000644000175000017500000002476211415301347031643 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_TCPProtocolEndpoint.h" CMPIObjectPath* SSH_OpenDRIM_TCPProtocolEndpoint_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_TCPProtocolEndpoint& instance) { _E_; Objectpath op(broker, OpenDRIM_TCPProtocolEndpoint_classnames[0], OpenDRIM_TCPProtocolEndpoint_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* SSH_OpenDRIM_TCPProtocolEndpoint_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_TCPProtocolEndpoint& instance) { _E_; Objectpath op(broker, SSH_OpenDRIM_TCPProtocolEndpoint_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.Generation_isNULL) ci.setProperty("Generation", instance.Generation); 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.OtherTypeDescription_isNULL) ci.setProperty("OtherTypeDescription", instance.OtherTypeDescription); if (!instance.BroadcastResetSupported_isNULL) ci.setProperty("BroadcastResetSupported", instance.BroadcastResetSupported); if (!instance.PortNumber_isNULL) ci.setProperty("PortNumber", instance.PortNumber); if (!instance.ProtocolIFType_isNULL) ci.setProperty("ProtocolIFType", instance.ProtocolIFType); _L_; return ci.getHdl(); } void SSH_OpenDRIM_TCPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_TCPProtocolEndpoint& 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 SSH_OpenDRIM_TCPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_TCPProtocolEndpoint& 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.getProperty("Generation", instance.Generation) == OK) instance.Generation_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("OtherTypeDescription", instance.OtherTypeDescription) == OK) instance.OtherTypeDescription_isNULL = false; if (inst.getProperty("BroadcastResetSupported", instance.BroadcastResetSupported) == OK) instance.BroadcastResetSupported_isNULL = false; if (inst.getProperty("PortNumber", instance.PortNumber) == OK) instance.PortNumber_isNULL = false; if (inst.getProperty("ProtocolIFType", instance.ProtocolIFType) == OK) instance.ProtocolIFType_isNULL = false; _L_; } void SSH_OpenDRIM_TCPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_TCPProtocolEndpoint_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 SSH_OpenDRIM_TCPProtocolEndpoint_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_TCPProtocolEndpoint_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-ssh-1.0.0/OpenDRIM_TCPProtocolEndpoint/OpenDRIM_TCPProtocolEndpointProvider.cpp0000644000175000017500000003405411415301347032500 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_TCPProtocolEndpoint.h" #include "OpenDRIM_TCPProtocolEndpointAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define SSH_OpenDRIM_TCPProtocolEndpointProviderSetInstance SSH_OpenDRIM_TCPProtocolEndpointProviderModifyInstance #endif int SSH_OpenDRIM_TCPProtocolEndpoint_init(const CMPIBroker* broker); int SSH_OpenDRIM_TCPProtocolEndpoint_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus SSH_OpenDRIM_TCPProtocolEndpointProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_TCPProtocolEndpoint_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_TCPProtocolEndpointProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = SSH_OpenDRIM_TCPProtocolEndpoint_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_TCPProtocolEndpoint_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_TCPProtocolEndpointProviderEnumInstances(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 = SSH_OpenDRIM_TCPProtocolEndpoint_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = SSH_OpenDRIM_TCPProtocolEndpoint_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_TCPProtocolEndpointProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_TCPProtocolEndpoint instance; SSH_OpenDRIM_TCPProtocolEndpoint_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_TCPProtocolEndpoint_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = SSH_OpenDRIM_TCPProtocolEndpoint_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_TCPProtocolEndpointProviderSetInstance(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_TCPProtocolEndpoint newInstance, oldInstance; SSH_OpenDRIM_TCPProtocolEndpoint_toCPP(_broker, ci, newInstance); SSH_OpenDRIM_TCPProtocolEndpoint_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = SSH_OpenDRIM_TCPProtocolEndpoint_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_TCPProtocolEndpoint_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_TCPProtocolEndpointProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_TCPProtocolEndpoint instance; SSH_OpenDRIM_TCPProtocolEndpoint_toCPP(_broker, ci, instance); string errorMessage; int errorCode = SSH_OpenDRIM_TCPProtocolEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_TCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_TCPProtocolEndpoint_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_TCPProtocolEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = SSH_OpenDRIM_TCPProtocolEndpoint_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_TCPProtocolEndpointProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_TCPProtocolEndpoint instance; SSH_OpenDRIM_TCPProtocolEndpoint_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_TCPProtocolEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_TCPProtocolEndpoint_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_TCPProtocolEndpointProviderExecQuery(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 SSH_OpenDRIM_TCPProtocolEndpointProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_TCPProtocolEndpoint_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_TCPProtocolEndpointProviderInvokeMethod(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_TCPProtocolEndpoint instance; SSH_OpenDRIM_TCPProtocolEndpoint_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"SystemCreationClassName", "Name", "SystemName", "CreationClassName"}; int errorCode = SSH_OpenDRIM_TCPProtocolEndpoint_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_TCPProtocolEndpoint_RequestStateChange_In inArgs; SSH_OpenDRIM_TCPProtocolEndpoint_toCPP(_broker, in, inArgs); OpenDRIM_TCPProtocolEndpoint_RequestStateChange_Out outArgs; errorCode = SSH_OpenDRIM_TCPProtocolEndpoint_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } SSH_OpenDRIM_TCPProtocolEndpoint_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="BroadcastReset") { unsigned int returnValue; errorCode = SSH_OpenDRIM_TCPProtocolEndpoint_BroadcastReset(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_TCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else { errorMessage = (string) OpenDRIM_TCPProtocolEndpoint_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 SSH_OpenDRIM_TCPProtocolEndpoint_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = SSH_OpenDRIM_TCPProtocolEndpoint_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_TCPProtocolEndpoint_init FAILED: " + (string) OpenDRIM_TCPProtocolEndpoint_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int SSH_OpenDRIM_TCPProtocolEndpoint_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = SSH_OpenDRIM_TCPProtocolEndpoint_unload(errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_TCPProtocolEndpoint_unload FAILED: " + (string) OpenDRIM_TCPProtocolEndpoint_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define SSH_OpenDRIM_TCPProtocolEndpoint_INIT if (SSH_OpenDRIM_TCPProtocolEndpoint_init(_broker) < 0) return NULL CMInstanceMIStub(SSH_OpenDRIM_TCPProtocolEndpointProvider, SSH_OpenDRIM_TCPProtocolEndpointProvider, _broker, SSH_OpenDRIM_TCPProtocolEndpoint_INIT); CMMethodMIStub(SSH_OpenDRIM_TCPProtocolEndpointProvider, SSH_OpenDRIM_TCPProtocolEndpointProvider, _broker, SSH_OpenDRIM_TCPProtocolEndpoint_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHServiceAccessBySAP/0000755000175000017500000000000011415301347023033 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHServiceAccessBySAP/Makefile.am0000644000175000017500000000471111415301347025072 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSSH_OpenDRIM_SSHServiceAccessBySAPProvider.la libcmpiSSH_OpenDRIM_SSHServiceAccessBySAPProvider_la_SOURCES = OpenDRIM_SSHServiceAccessBySAPAccess.cpp OpenDRIM_SSHServiceAccessBySAPProvider.cpp cmpiOpenDRIM_SSHServiceAccessBySAP.cpp assocOpenDRIM_SSHServiceAccessBySAP.cpp # May have to be adjusted for direct invocation libcmpiSSH_OpenDRIM_SSHServiceAccessBySAPProvider_la_CPPFLAGS = -I../CIM_Service -I../CIM_ServiceAccessPoint # Uncomment the end for direct invocation, may have to be adjusted libcmpiSSH_OpenDRIM_SSHServiceAccessBySAPProvider_la_LIBADD = ../Common/libcmpiSSH_Common.la #../CIM_Service/libcmpiSSH_CIM_ServiceProvider.la ../CIM_ServiceAccessPoint/libcmpiSSH_CIM_ServiceAccessPointProvider.la libcmpiSSH_OpenDRIM_SSHServiceAccessBySAPProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_SSHServiceAccessBySAP.h OpenDRIM_SSHServiceAccessBySAP.h OpenDRIM_SSHServiceAccessBySAPAccess.h opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHServiceAccessBySAP/OpenDRIM_SSHServiceAccessBySAP.h0000644000175000017500000000665511415301347030614 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHSERVICEACCESSBYSAP_H_ #define OPENDRIM_SSHSERVICEACCESSBYSAP_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_Service.h" #include "CIM_ServiceAccess.h" #include "cmpiCIM_ServiceAccessPoint.h" #include "CIM_ServiceAccessPointAccess.h" */ const static char* OpenDRIM_SSHServiceAccessBySAP_classnames[] = {"OpenDRIM_SSHServiceAccessBySAP"}; static string OpenDRIM_SSHServiceAccessBySAP_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"OpenDRIM_SSHProtocolService"}; const static string Antecedent_NAMESPACE = _NAMESPACE; const static string Dependent_role = "Dependent"; const static char* Dependent_classnames[] = {"OpenDRIM_TCPProtocolEndpoint"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_SSHServiceAccessBySAP { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; OpenDRIM_SSHServiceAccessBySAP() { Antecedent_isNULL = true; Dependent_isNULL = true; } ~OpenDRIM_SSHServiceAccessBySAP() {} 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_SSHSERVICEACCESSBYSAP_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHServiceAccessBySAP/cmpiOpenDRIM_SSHServiceAccessBySAP.h0000644000175000017500000000435211415301347031455 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef CMPIOPENDRIM_SSHSERVICEACCESSBYSAP_H_ #define CMPIOPENDRIM_SSHSERVICEACCESSBYSAP_H_ #include "OpenDRIM_SSHServiceAccessBySAP.h" CMPIObjectPath* SSH_OpenDRIM_SSHServiceAccessBySAP_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHServiceAccessBySAP& instance); CMPIInstance* SSH_OpenDRIM_SSHServiceAccessBySAP_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHServiceAccessBySAP& instance); void SSH_OpenDRIM_SSHServiceAccessBySAP_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHServiceAccessBySAP& instance); void SSH_OpenDRIM_SSHServiceAccessBySAP_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHServiceAccessBySAP& instance); #endif /*CMPIOPENDRIM_SSHSERVICEACCESSBYSAP_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHServiceAccessBySAP/assocOpenDRIM_SSHServiceAccessBySAP.h0000644000175000017500000000620211415301347031631 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef ASSOCOPENDRIM_SSHSERVICEACCESSBYSAP_H_ #define ASSOCOPENDRIM_SSHSERVICEACCESSBYSAP_H_ #include "OpenDRIM_SSHServiceAccessBySAPAccess.h" int SSH_OpenDRIM_SSHServiceAccessBySAP_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 SSH_OpenDRIM_SSHServiceAccessBySAP_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 SSH_OpenDRIM_SSHServiceAccessBySAP_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int SSH_OpenDRIM_SSHServiceAccessBySAP_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHServiceAccessBySAP_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int SSH_OpenDRIM_SSHServiceAccessBySAP_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_SSHSERVICEACCESSBYSAP_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHServiceAccessBySAP/OpenDRIM_SSHServiceAccessBySAPProvider.cpp0000644000175000017500000004167711415301347032665 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHServiceAccessBySAP.h" #include "OpenDRIM_SSHServiceAccessBySAPAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define SSH_OpenDRIM_SSHServiceAccessBySAPProviderSetInstance SSH_OpenDRIM_SSHServiceAccessBySAPProviderModifyInstance #endif int SSH_OpenDRIM_SSHServiceAccessBySAP_init(const CMPIBroker* broker); int SSH_OpenDRIM_SSHServiceAccessBySAP_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus SSH_OpenDRIM_SSHServiceAccessBySAPProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHServiceAccessBySAP_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHServiceAccessBySAPProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = SSH_OpenDRIM_SSHServiceAccessBySAP_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceAccessBySAP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_SSHServiceAccessBySAP_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHServiceAccessBySAPProviderEnumInstances(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 = SSH_OpenDRIM_SSHServiceAccessBySAP_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceAccessBySAP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = SSH_OpenDRIM_SSHServiceAccessBySAP_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHServiceAccessBySAPProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHServiceAccessBySAP instance; SSH_OpenDRIM_SSHServiceAccessBySAP_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHServiceAccessBySAP_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceAccessBySAP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = SSH_OpenDRIM_SSHServiceAccessBySAP_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHServiceAccessBySAPProviderSetInstance(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_SSHServiceAccessBySAP newInstance, oldInstance; SSH_OpenDRIM_SSHServiceAccessBySAP_toCPP(_broker, ci, newInstance); SSH_OpenDRIM_SSHServiceAccessBySAP_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHServiceAccessBySAP_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceAccessBySAP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHServiceAccessBySAP_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceAccessBySAP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHServiceAccessBySAPProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHServiceAccessBySAP instance; SSH_OpenDRIM_SSHServiceAccessBySAP_toCPP(_broker, ci, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHServiceAccessBySAP_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_SSHServiceAccessBySAP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHServiceAccessBySAP_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceAccessBySAP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHServiceAccessBySAP_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceAccessBySAP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = SSH_OpenDRIM_SSHServiceAccessBySAP_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHServiceAccessBySAPProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHServiceAccessBySAP instance; SSH_OpenDRIM_SSHServiceAccessBySAP_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHServiceAccessBySAP_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceAccessBySAP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHServiceAccessBySAP_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceAccessBySAP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHServiceAccessBySAPProviderExecQuery(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 SSH_OpenDRIM_SSHServiceAccessBySAPProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHServiceAccessBySAP_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHServiceAccessBySAPProviderAssociatorNames(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 = SSH_OpenDRIM_SSHServiceAccessBySAP_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceAccessBySAP_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 SSH_OpenDRIM_SSHServiceAccessBySAPProviderAssociators(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 = SSH_OpenDRIM_SSHServiceAccessBySAP_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceAccessBySAP_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 SSH_OpenDRIM_SSHServiceAccessBySAPProviderReferenceNames(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 = SSH_OpenDRIM_SSHServiceAccessBySAP_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceAccessBySAP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = SSH_OpenDRIM_SSHServiceAccessBySAP_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = SSH_OpenDRIM_SSHServiceAccessBySAP_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceAccessBySAP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_SSHServiceAccessBySAP_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHServiceAccessBySAPProviderReferences(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 = SSH_OpenDRIM_SSHServiceAccessBySAP_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceAccessBySAP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = SSH_OpenDRIM_SSHServiceAccessBySAP_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = SSH_OpenDRIM_SSHServiceAccessBySAP_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceAccessBySAP_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = SSH_OpenDRIM_SSHServiceAccessBySAP_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int SSH_OpenDRIM_SSHServiceAccessBySAP_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHServiceAccessBySAP_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHServiceAccessBySAP_init FAILED: " + (string) OpenDRIM_SSHServiceAccessBySAP_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int SSH_OpenDRIM_SSHServiceAccessBySAP_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHServiceAccessBySAP_unload(errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHServiceAccessBySAP_unload FAILED: " + (string) OpenDRIM_SSHServiceAccessBySAP_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define SSH_OpenDRIM_SSHServiceAccessBySAP_INIT if (SSH_OpenDRIM_SSHServiceAccessBySAP_init(_broker) < 0) return NULL CMInstanceMIStub(SSH_OpenDRIM_SSHServiceAccessBySAPProvider, SSH_OpenDRIM_SSHServiceAccessBySAPProvider, _broker, SSH_OpenDRIM_SSHServiceAccessBySAP_INIT); CMAssociationMIStub(SSH_OpenDRIM_SSHServiceAccessBySAPProvider, SSH_OpenDRIM_SSHServiceAccessBySAPProvider, _broker, SSH_OpenDRIM_SSHServiceAccessBySAP_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHServiceAccessBySAP/cmpiOpenDRIM_SSHServiceAccessBySAP.cpp0000644000175000017500000000607011415301347032007 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHServiceAccessBySAP.h" CMPIObjectPath* SSH_OpenDRIM_SSHServiceAccessBySAP_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHServiceAccessBySAP& instance) { _E_; Objectpath op(broker, OpenDRIM_SSHServiceAccessBySAP_classnames[0], OpenDRIM_SSHServiceAccessBySAP_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* SSH_OpenDRIM_SSHServiceAccessBySAP_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHServiceAccessBySAP& instance) { _E_; Objectpath op(broker, SSH_OpenDRIM_SSHServiceAccessBySAP_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void SSH_OpenDRIM_SSHServiceAccessBySAP_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHServiceAccessBySAP& 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 SSH_OpenDRIM_SSHServiceAccessBySAP_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHServiceAccessBySAP& 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-ssh-1.0.0/OpenDRIM_SSHServiceAccessBySAP/assocOpenDRIM_SSHServiceAccessBySAP.cpp0000644000175000017500000002065211415301347032171 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "assocOpenDRIM_SSHServiceAccessBySAP.h" int SSH_OpenDRIM_SSHServiceAccessBySAP_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 = SSH_OpenDRIM_SSHServiceAccessBySAP_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(SSH_OpenDRIM_SSHServiceAccessBySAP_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(SSH_OpenDRIM_SSHServiceAccessBySAP_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int SSH_OpenDRIM_SSHServiceAccessBySAP_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(SSH_CIM_Service_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(SSH_CIM_Service_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, SSH_CIM_Service_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int SSH_OpenDRIM_SSHServiceAccessBySAP_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_Service _instance; SSH_CIM_Service_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(SSH_CIM_Service_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, SSH_CIM_Service_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int SSH_OpenDRIM_SSHServiceAccessBySAP_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(SSH_CIM_ServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(SSH_CIM_ServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, SSH_CIM_ServiceAccessPoint_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int SSH_OpenDRIM_SSHServiceAccessBySAP_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; SSH_CIM_ServiceAccessPoint_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(SSH_CIM_ServiceAccessPoint_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, SSH_CIM_ServiceAccessPoint_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHServiceAccessBySAP/OpenDRIM_SSHServiceAccessBySAPAccess.cpp0000644000175000017500000002470011415301347032260 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "OpenDRIM_SSHServiceAccessBySAPAccess.h" int SSH_OpenDRIM_SSHServiceAccessBySAP_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(SSH_CIM_Service_load(broker, errorMessage)); CF_assert(SSH_CIM_ServiceAccessPoint_load(broker, errorMessage)); */ // TODO _L_; return OK; } int SSH_OpenDRIM_SSHServiceAccessBySAP_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(SSH_CIM_Service_unload(errorMessage)); CF_assert(SSH_CIM_ServiceAccessPoint_unload(errorMessage)); */ // TODO _L_; return OK; } int SSH_OpenDRIM_SSHServiceAccessBySAP_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // Determine if the association can be established or not string SSHProtocolService_systemName; CF_assert(Antecedent.getProperty("SystemName", SSHProtocolService_systemName)); string TCPProtocolEndpoint_systemName; CF_assert(Dependent.getProperty("SystemName", TCPProtocolEndpoint_systemName)); if (SSHProtocolService_systemName == TCPProtocolEndpoint_systemName) isAssociated = true; else isAssociated = false; _L_; return OK; } int SSH_OpenDRIM_SSHServiceAccessBySAP_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(SSH_OpenDRIM_SSHServiceAccessBySAP_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(SSH_OpenDRIM_SSHServiceAccessBySAP_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; CF_assert(SSH_OpenDRIM_SSHServiceAccessBySAP_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(SSH_OpenDRIM_SSHServiceAccessBySAP_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int SSH_OpenDRIM_SSHServiceAccessBySAP_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHServiceAccessBySAP& 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(SSH_OpenDRIM_SSHServiceAccessBySAP_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(SSH_OpenDRIM_SSHServiceAccessBySAP_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(SSH_OpenDRIM_SSHServiceAccessBySAP_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int SSH_OpenDRIM_SSHServiceAccessBySAP_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHServiceAccessBySAP& newInstance, const OpenDRIM_SSHServiceAccessBySAP& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHServiceAccessBySAP_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHServiceAccessBySAP& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHServiceAccessBySAP_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHServiceAccessBySAP& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHServiceAccessBySAP_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(SSH_OpenDRIM_SSHServiceAccessBySAP_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(SSH_OpenDRIM_SSHServiceAccessBySAP_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(SSH_OpenDRIM_SSHServiceAccessBySAP_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(SSH_OpenDRIM_SSHServiceAccessBySAP_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(SSH_OpenDRIM_SSHServiceAccessBySAP_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(SSH_OpenDRIM_SSHServiceAccessBySAP_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_SSHServiceAccessBySAP_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_SSHServiceAccessBySAP instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); OpenDRIM_SSHServiceAccessBySAP_instances.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_SSHServiceAccessBySAP_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_SSHServiceAccessBySAP_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_SSHServiceAccessBySAP instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); OpenDRIM_SSHServiceAccessBySAP_instances.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_SSHServiceAccessBySAP_populate(OpenDRIM_SSHServiceAccessBySAP& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHServiceAccessBySAP/OpenDRIM_SSHServiceAccessBySAPAccess.h0000644000175000017500000001044011415301347031721 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHSERVICEACCESSBYSAPACCESS_H_ #define OPENDRIM_SSHSERVICEACCESSBYSAPACCESS_H_ #include "SSH_Common.h" #include "OpenDRIM_SSHServiceAccessBySAP.h" #include "assocOpenDRIM_SSHServiceAccessBySAP.h" int SSH_OpenDRIM_SSHServiceAccessBySAP_load(const CMPIBroker* broker, string& errorMessage); int SSH_OpenDRIM_SSHServiceAccessBySAP_unload(string& errorMessage); int SSH_OpenDRIM_SSHServiceAccessBySAP_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHServiceAccessBySAP_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHServiceAccessBySAP& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHServiceAccessBySAP_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHServiceAccessBySAP& newInstance, const OpenDRIM_SSHServiceAccessBySAP& oldInstance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHServiceAccessBySAP_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHServiceAccessBySAP& instance, string& errorMessage); int SSH_OpenDRIM_SSHServiceAccessBySAP_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHServiceAccessBySAP& instance, string& errorMessage); int SSH_OpenDRIM_SSHServiceAccessBySAP_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHServiceAccessBySAP_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHServiceAccessBySAP_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_SSHServiceAccessBySAP_instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHServiceAccessBySAP_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_SSHServiceAccessBySAP_instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHServiceAccessBySAP_populate(OpenDRIM_SSHServiceAccessBySAP& instance, string& errorMessage); #endif /*OPENDRIM_SSHSERVICEACCESSBYSAPACCESS_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHServiceSettingData/0000755000175000017500000000000011415301347023202 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHServiceSettingData/cmpiOpenDRIM_SSHServiceSettingData.cpp0000644000175000017500000001026211415301347032323 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHServiceSettingData.h" CMPIObjectPath* SSH_OpenDRIM_SSHServiceSettingData_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHServiceSettingData& instance) { _E_; Objectpath op(broker, OpenDRIM_SSHServiceSettingData_classnames[0], OpenDRIM_SSHServiceSettingData_NAMESPACE); if (!instance.ManagedElement_isNULL) op.addKey("ManagedElement", instance.ManagedElement); if (!instance.SettingData_isNULL) op.addKey("SettingData", instance.SettingData); _L_; return op.getHdl(); } CMPIInstance* SSH_OpenDRIM_SSHServiceSettingData_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHServiceSettingData& instance) { _E_; Objectpath op(broker, SSH_OpenDRIM_SSHServiceSettingData_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.IsDefault_isNULL) ci.setProperty("IsDefault", instance.IsDefault); if (!instance.IsCurrent_isNULL) ci.setProperty("IsCurrent", instance.IsCurrent); if (!instance.IsNext_isNULL) ci.setProperty("IsNext", instance.IsNext); if (!instance.IsMinimum_isNULL) ci.setProperty("IsMinimum", instance.IsMinimum); if (!instance.IsMaximum_isNULL) ci.setProperty("IsMaximum", instance.IsMaximum); if (!instance.IsPending_isNULL) ci.setProperty("IsPending", instance.IsPending); _L_; return ci.getHdl(); } void SSH_OpenDRIM_SSHServiceSettingData_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHServiceSettingData& 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 SSH_OpenDRIM_SSHServiceSettingData_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHServiceSettingData& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("ManagedElement", instance.ManagedElement) == OK) instance.ManagedElement_isNULL = false; if (inst.getProperty("SettingData", instance.SettingData) == OK) instance.SettingData_isNULL = false; if (inst.getProperty("IsDefault", instance.IsDefault) == OK) instance.IsDefault_isNULL = false; if (inst.getProperty("IsCurrent", instance.IsCurrent) == OK) instance.IsCurrent_isNULL = false; if (inst.getProperty("IsNext", instance.IsNext) == OK) instance.IsNext_isNULL = false; if (inst.getProperty("IsMinimum", instance.IsMinimum) == OK) instance.IsMinimum_isNULL = false; if (inst.getProperty("IsMaximum", instance.IsMaximum) == OK) instance.IsMaximum_isNULL = false; if (inst.getProperty("IsPending", instance.IsPending) == OK) instance.IsPending_isNULL = false; _L_; } opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHServiceSettingData/assocOpenDRIM_SSHServiceSettingData.h0000644000175000017500000000621611415301347032154 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef ASSOCOPENDRIM_SSHSERVICESETTINGDATA_H_ #define ASSOCOPENDRIM_SSHSERVICESETTINGDATA_H_ #include "OpenDRIM_SSHServiceSettingDataAccess.h" int SSH_OpenDRIM_SSHServiceSettingData_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 SSH_OpenDRIM_SSHServiceSettingData_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 SSH_OpenDRIM_SSHServiceSettingData_enumerateSettingDatas(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int SSH_OpenDRIM_SSHServiceSettingData_getSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHServiceSettingData_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int SSH_OpenDRIM_SSHServiceSettingData_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_SSHSERVICESETTINGDATA_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHServiceSettingData/Makefile.am0000644000175000017500000000471111415301347025241 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSSH_OpenDRIM_SSHServiceSettingDataProvider.la libcmpiSSH_OpenDRIM_SSHServiceSettingDataProvider_la_SOURCES = OpenDRIM_SSHServiceSettingDataAccess.cpp OpenDRIM_SSHServiceSettingDataProvider.cpp cmpiOpenDRIM_SSHServiceSettingData.cpp assocOpenDRIM_SSHServiceSettingData.cpp # May have to be adjusted for direct invocation libcmpiSSH_OpenDRIM_SSHServiceSettingDataProvider_la_CPPFLAGS = -I../CIM_SettingData -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiSSH_OpenDRIM_SSHServiceSettingDataProvider_la_LIBADD = ../Common/libcmpiSSH_Common.la #../CIM_SettingData/libcmpiSSH_CIM_SettingDataProvider.la ../CIM_ManagedElement/libcmpiSSH_CIM_ManagedElementProvider.la libcmpiSSH_OpenDRIM_SSHServiceSettingDataProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_SSHServiceSettingData.h OpenDRIM_SSHServiceSettingData.h OpenDRIM_SSHServiceSettingDataAccess.h opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHServiceSettingData/cmpiOpenDRIM_SSHServiceSettingData.h0000644000175000017500000000435211415301347031773 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef CMPIOPENDRIM_SSHSERVICESETTINGDATA_H_ #define CMPIOPENDRIM_SSHSERVICESETTINGDATA_H_ #include "OpenDRIM_SSHServiceSettingData.h" CMPIObjectPath* SSH_OpenDRIM_SSHServiceSettingData_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHServiceSettingData& instance); CMPIInstance* SSH_OpenDRIM_SSHServiceSettingData_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHServiceSettingData& instance); void SSH_OpenDRIM_SSHServiceSettingData_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHServiceSettingData& instance); void SSH_OpenDRIM_SSHServiceSettingData_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHServiceSettingData& instance); #endif /*CMPIOPENDRIM_SSHSERVICESETTINGDATA_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHServiceSettingData/OpenDRIM_SSHServiceSettingDataAccess.cpp0000644000175000017500000002526511415301347032605 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "OpenDRIM_SSHServiceSettingDataAccess.h" int SSH_OpenDRIM_SSHServiceSettingData_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(SSH_CIM_SettingData_load(broker, errorMessage)); CF_assert(SSH_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int SSH_OpenDRIM_SSHServiceSettingData_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(SSH_CIM_SettingData_unload(errorMessage)); CF_assert(SSH_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int SSH_OpenDRIM_SSHServiceSettingData_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 SSH_OpenDRIM_SSHServiceSettingData_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(SSH_OpenDRIM_SSHServiceSettingData_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(SSH_OpenDRIM_SSHServiceSettingData_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; CF_assert(SSH_OpenDRIM_SSHServiceSettingData_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(SSH_OpenDRIM_SSHServiceSettingData_referenceSettingDataToManagedElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int SSH_OpenDRIM_SSHServiceSettingData_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHServiceSettingData& 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(SSH_OpenDRIM_SSHServiceSettingData_getSettingData(broker, ctx, SettingData_objectpath, SettingData_instance, NULL, errorMessage)); Objectpath ManagedElement_objectpath; instance.getManagedElement(ManagedElement_objectpath); Instance ManagedElement_instance; CF_assert(SSH_OpenDRIM_SSHServiceSettingData_getManagedElement(broker, ctx, ManagedElement_objectpath, ManagedElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(SSH_OpenDRIM_SSHServiceSettingData_isAssociated(SettingData_instance, ManagedElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } CF_assert(SSH_OpenDRIM_SSHServiceSettingData_populate(instance, errorMessage)); _L_; return OK; } int SSH_OpenDRIM_SSHServiceSettingData_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHServiceSettingData& newInstance, const OpenDRIM_SSHServiceSettingData& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHServiceSettingData_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHServiceSettingData& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHServiceSettingData_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHServiceSettingData& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHServiceSettingData_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(SSH_OpenDRIM_SSHServiceSettingData_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(SSH_OpenDRIM_SSHServiceSettingData_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(SSH_OpenDRIM_SSHServiceSettingData_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(SSH_OpenDRIM_SSHServiceSettingData_enumerateSettingDatas(broker, ctx, SettingData_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(SSH_OpenDRIM_SSHServiceSettingData_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(SSH_OpenDRIM_SSHServiceSettingData_enumerateSettingDatas(broker, ctx, SettingData_instances, properties, false, errorMessage)); } for (size_t i=0; i& ManagedElement_instances, vector& OpenDRIM_SSHServiceSettingData_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_SSHServiceSettingData instance; instance.setSettingData(((Instance) SettingData_instance).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instances[i]).getObjectpath()); if (discriminant == "r") { CF_assert(SSH_OpenDRIM_SSHServiceSettingData_populate(instance, errorMessage)); } OpenDRIM_SSHServiceSettingData_instances.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_SSHServiceSettingData_referenceManagedElementToSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& SettingData_instances, vector& OpenDRIM_SSHServiceSettingData_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_SSHServiceSettingData instance; instance.setSettingData(((Instance) SettingData_instances[i]).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instance).getObjectpath()); if (discriminant == "r") { CF_assert(SSH_OpenDRIM_SSHServiceSettingData_populate(instance, errorMessage)); } OpenDRIM_SSHServiceSettingData_instances.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_SSHServiceSettingData_populate(OpenDRIM_SSHServiceSettingData& instance, string& errorMessage) { _E_; instance.setIsNext(1); instance.setIsDefault(1); _L_; return OK; } opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHServiceSettingData/OpenDRIM_SSHServiceSettingData.h0000644000175000017500000001275311415301347031126 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHSERVICESETTINGDATA_H_ #define OPENDRIM_SSHSERVICESETTINGDATA_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_SSHServiceSettingData_classnames[] = {"OpenDRIM_SSHServiceSettingData"}; static string OpenDRIM_SSHServiceSettingData_NAMESPACE = _NAMESPACE; const static string SettingData_role = "SettingData"; const static char* SettingData_classnames[] = {"OpenDRIM_SSHSettingData"}; const static string SettingData_NAMESPACE = _NAMESPACE; const static string ManagedElement_role = "ManagedElement"; const static char* ManagedElement_classnames[] = {"OpenDRIM_SSHProtocolService"}; const static string ManagedElement_NAMESPACE = _NAMESPACE; class OpenDRIM_SSHServiceSettingData { public: Objectpath ManagedElement; bool ManagedElement_isNULL; Objectpath SettingData; bool SettingData_isNULL; unsigned short IsDefault; bool IsDefault_isNULL; unsigned short IsCurrent; bool IsCurrent_isNULL; unsigned short IsNext; bool IsNext_isNULL; unsigned short IsMinimum; bool IsMinimum_isNULL; unsigned short IsMaximum; bool IsMaximum_isNULL; unsigned short IsPending; bool IsPending_isNULL; OpenDRIM_SSHServiceSettingData() { ManagedElement_isNULL = true; SettingData_isNULL = true; IsDefault_isNULL = true; IsCurrent_isNULL = true; IsNext_isNULL = true; IsMinimum_isNULL = true; IsMaximum_isNULL = true; IsPending_isNULL = true; } ~OpenDRIM_SSHServiceSettingData() {} string getKeys() const { return CF_toLowCase(".ManagedElement=\"" + CF_quoteString(ManagedElement.toString()) + "\""".SettingData=\"" + CF_quoteString(SettingData.toString()) + "\""); } int getManagedElement(Objectpath& value) const { if (ManagedElement_isNULL==true) return NOT_FOUND; value = ManagedElement; return OK; } int setManagedElement(const Objectpath& newValue) { ManagedElement = newValue; ManagedElement.setNamespace(ManagedElement_NAMESPACE); ManagedElement_isNULL = false; return OK; } int getSettingData(Objectpath& value) const { if (SettingData_isNULL==true) return NOT_FOUND; value = SettingData; return OK; } int setSettingData(const Objectpath& newValue) { SettingData = newValue; SettingData.setNamespace(SettingData_NAMESPACE); SettingData_isNULL = false; return OK; } int getIsDefault(unsigned short& value) const { if (IsDefault_isNULL==true) return NOT_FOUND; value = IsDefault; return OK; } int setIsDefault(const unsigned short& newValue) { IsDefault = newValue; IsDefault_isNULL = false; return OK; } int getIsCurrent(unsigned short& value) const { if (IsCurrent_isNULL==true) return NOT_FOUND; value = IsCurrent; return OK; } int setIsCurrent(const unsigned short& newValue) { IsCurrent = newValue; IsCurrent_isNULL = false; return OK; } int getIsNext(unsigned short& value) const { if (IsNext_isNULL==true) return NOT_FOUND; value = IsNext; return OK; } int setIsNext(const unsigned short& newValue) { IsNext = newValue; IsNext_isNULL = false; return OK; } int getIsMinimum(unsigned short& value) const { if (IsMinimum_isNULL==true) return NOT_FOUND; value = IsMinimum; return OK; } int setIsMinimum(const unsigned short& newValue) { IsMinimum = newValue; IsMinimum_isNULL = false; return OK; } int getIsMaximum(unsigned short& value) const { if (IsMaximum_isNULL==true) return NOT_FOUND; value = IsMaximum; return OK; } int setIsMaximum(const unsigned short& newValue) { IsMaximum = newValue; IsMaximum_isNULL = false; return OK; } int getIsPending(unsigned short& value) const { if (IsPending_isNULL==true) return NOT_FOUND; value = IsPending; return OK; } int setIsPending(const unsigned short& newValue) { IsPending = newValue; IsPending_isNULL = false; return OK; } }; #endif /*OPENDRIM_SSHSERVICESETTINGDATA_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHServiceSettingData/OpenDRIM_SSHServiceSettingDataProvider.cpp0000644000175000017500000004172711415301347033177 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHServiceSettingData.h" #include "OpenDRIM_SSHServiceSettingDataAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define SSH_OpenDRIM_SSHServiceSettingDataProviderSetInstance SSH_OpenDRIM_SSHServiceSettingDataProviderModifyInstance #endif int SSH_OpenDRIM_SSHServiceSettingData_init(const CMPIBroker* broker); int SSH_OpenDRIM_SSHServiceSettingData_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus SSH_OpenDRIM_SSHServiceSettingDataProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHServiceSettingData_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHServiceSettingDataProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = SSH_OpenDRIM_SSHServiceSettingData_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_SSHServiceSettingData_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHServiceSettingDataProviderEnumInstances(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 = SSH_OpenDRIM_SSHServiceSettingData_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = SSH_OpenDRIM_SSHServiceSettingData_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHServiceSettingDataProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHServiceSettingData instance; SSH_OpenDRIM_SSHServiceSettingData_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHServiceSettingData_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = SSH_OpenDRIM_SSHServiceSettingData_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHServiceSettingDataProviderSetInstance(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_SSHServiceSettingData newInstance, oldInstance; SSH_OpenDRIM_SSHServiceSettingData_toCPP(_broker, ci, newInstance); SSH_OpenDRIM_SSHServiceSettingData_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHServiceSettingData_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHServiceSettingData_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHServiceSettingDataProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHServiceSettingData instance; SSH_OpenDRIM_SSHServiceSettingData_toCPP(_broker, ci, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHServiceSettingData_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_SSHServiceSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHServiceSettingData_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHServiceSettingData_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = SSH_OpenDRIM_SSHServiceSettingData_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHServiceSettingDataProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHServiceSettingData instance; SSH_OpenDRIM_SSHServiceSettingData_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHServiceSettingData_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHServiceSettingData_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHServiceSettingDataProviderExecQuery(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 SSH_OpenDRIM_SSHServiceSettingDataProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHServiceSettingData_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHServiceSettingDataProviderAssociatorNames(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 = SSH_OpenDRIM_SSHServiceSettingData_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceSettingData_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 SSH_OpenDRIM_SSHServiceSettingDataProviderAssociators(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 = SSH_OpenDRIM_SSHServiceSettingData_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceSettingData_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 SSH_OpenDRIM_SSHServiceSettingDataProviderReferenceNames(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 = SSH_OpenDRIM_SSHServiceSettingData_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = SSH_OpenDRIM_SSHServiceSettingData_referenceSettingDataToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = SSH_OpenDRIM_SSHServiceSettingData_referenceManagedElementToSettingData(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_SSHServiceSettingData_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHServiceSettingDataProviderReferences(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 = SSH_OpenDRIM_SSHServiceSettingData_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = SSH_OpenDRIM_SSHServiceSettingData_referenceSettingDataToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = SSH_OpenDRIM_SSHServiceSettingData_referenceManagedElementToSettingData(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHServiceSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = SSH_OpenDRIM_SSHServiceSettingData_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int SSH_OpenDRIM_SSHServiceSettingData_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHServiceSettingData_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHServiceSettingData_init FAILED: " + (string) OpenDRIM_SSHServiceSettingData_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int SSH_OpenDRIM_SSHServiceSettingData_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHServiceSettingData_unload(errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHServiceSettingData_unload FAILED: " + (string) OpenDRIM_SSHServiceSettingData_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define SSH_OpenDRIM_SSHServiceSettingData_INIT if (SSH_OpenDRIM_SSHServiceSettingData_init(_broker) < 0) return NULL CMInstanceMIStub(SSH_OpenDRIM_SSHServiceSettingDataProvider, SSH_OpenDRIM_SSHServiceSettingDataProvider, _broker, SSH_OpenDRIM_SSHServiceSettingData_INIT); CMAssociationMIStub(SSH_OpenDRIM_SSHServiceSettingDataProvider, SSH_OpenDRIM_SSHServiceSettingDataProvider, _broker, SSH_OpenDRIM_SSHServiceSettingData_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHServiceSettingData/OpenDRIM_SSHServiceSettingDataAccess.h0000644000175000017500000001052011415301347032236 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHSERVICESETTINGDATAACCESS_H_ #define OPENDRIM_SSHSERVICESETTINGDATAACCESS_H_ #include "SSH_Common.h" #include "OpenDRIM_SSHServiceSettingData.h" #include "assocOpenDRIM_SSHServiceSettingData.h" int SSH_OpenDRIM_SSHServiceSettingData_load(const CMPIBroker* broker, string& errorMessage); int SSH_OpenDRIM_SSHServiceSettingData_unload(string& errorMessage); int SSH_OpenDRIM_SSHServiceSettingData_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHServiceSettingData_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHServiceSettingData& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHServiceSettingData_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHServiceSettingData& newInstance, const OpenDRIM_SSHServiceSettingData& oldInstance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHServiceSettingData_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHServiceSettingData& instance, string& errorMessage); int SSH_OpenDRIM_SSHServiceSettingData_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHServiceSettingData& instance, string& errorMessage); int SSH_OpenDRIM_SSHServiceSettingData_associatorSettingDataToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& SettingData_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHServiceSettingData_associatorManagedElementToSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const char** properties, vector& SettingData_associatedInstances, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHServiceSettingData_referenceSettingDataToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& SettingData_instance, const vector& ManagedElement_instances, vector& OpenDRIM_SSHServiceSettingData_instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHServiceSettingData_referenceManagedElementToSettingData(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& SettingData_instances, vector& OpenDRIM_SSHServiceSettingData_instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHServiceSettingData_populate(OpenDRIM_SSHServiceSettingData& instance, string& errorMessage); #endif /*OPENDRIM_SSHSERVICESETTINGDATAACCESS_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHServiceSettingData/assocOpenDRIM_SSHServiceSettingData.cpp0000644000175000017500000002101211415301347032476 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "assocOpenDRIM_SSHServiceSettingData.h" int SSH_OpenDRIM_SSHServiceSettingData_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 = SSH_OpenDRIM_SSHServiceSettingData_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(SSH_OpenDRIM_SSHServiceSettingData_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(SSH_OpenDRIM_SSHServiceSettingData_associatorManagedElementToSettingData(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int SSH_OpenDRIM_SSHServiceSettingData_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(SSH_CIM_SettingData_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(SSH_CIM_SettingData_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, SSH_CIM_SettingData_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int SSH_OpenDRIM_SSHServiceSettingData_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; SSH_CIM_SettingData_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(SSH_CIM_SettingData_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, SSH_CIM_SettingData_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int SSH_OpenDRIM_SSHServiceSettingData_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(SSH_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(SSH_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, SSH_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int SSH_OpenDRIM_SSHServiceSettingData_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; SSH_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(SSH_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, SSH_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-ssh-1.0.0/mof/0000755000175000017500000000000011415301347016220 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/mof/OpenDRIM_HostedSSHAccessPoint.mof0000644000175000017500000000316711415301347024327 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ [Provider("cmpi:cmpiSSH_OpenDRIM_HostedSSHAccessPointProvider")] class OpenDRIM_HostedSSHAccessPoint:CIM_HostedAccessPoint { }; opendrim-lmp-ssh-1.0.0/mof/OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint.mof0000644000175000017500000000325311415301347031173 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ [Association, Provider("cmpi:cmpiSSH_OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpointProvider")] class OpenDRIM_TCPProtocolEndpointBindsToIPProtocolEndpoint:CIM_BindsTo { }; opendrim-lmp-ssh-1.0.0/mof/OpenDRIM_SSHServiceAccessBySAP.mof0000644000175000017500000000321011415301347024313 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ [Association, Provider("cmpi:cmpiSSH_OpenDRIM_SSHServiceAccessBySAPProvider")] class OpenDRIM_SSHServiceAccessBySAP:CIM_ServiceAccessBySAP { }; opendrim-lmp-ssh-1.0.0/mof/OpenDRIM_RegisteredSSHProfile.mof0000644000175000017500000000316711415301347024363 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ [Provider("cmpi:cmpiSSH_OpenDRIM_RegisteredSSHProfileProvider")] class OpenDRIM_RegisteredSSHProfile:CIM_RegisteredProfile { }; opendrim-lmp-ssh-1.0.0/mof/OpenDRIM_HostedSSHService.mof0000644000175000017500000000317111415301347023507 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ [Association, Provider("cmpi:cmpiSSH_OpenDRIM_HostedSSHServiceProvider")] class OpenDRIM_HostedSSHService:CIM_HostedService { }; opendrim-lmp-ssh-1.0.0/mof/OpenDRIM_SSHProtocolProvidesEndpoint.mof0000644000175000017500000000322211415301347025753 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ [Association, Provider("cmpi:cmpiSSH_OpenDRIM_SSHProtocolProvidesEndpointProvider")] class OpenDRIM_SSHProtocolProvidesEndpoint:CIM_ProvidesEndpoint { }; opendrim-lmp-ssh-1.0.0/mof/OpenDRIM_SSHSettingData.mof0000644000175000017500000000315011415301347023144 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ [Provider("cmpi:cmpiSSH_OpenDRIM_SSHSettingDataProvider")] class OpenDRIM_SSHSettingData:CIM_SSHSettingData { }; opendrim-lmp-ssh-1.0.0/mof/OpenDRIM_SSHProtocolEndpoint.mof0000644000175000017500000000316711415301347024247 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ [Provider("cmpi:cmpiSSH_OpenDRIM_SSHProtocolEndpointProvider")] class OpenDRIM_SSHProtocolEndpoint:CIM_SSHProtocolEndpoint { }; opendrim-lmp-ssh-1.0.0/mof/OpenDRIM_TCPProtocolEndpoint.mof0000644000175000017500000000316711415301347024240 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ [Provider("cmpi:cmpiSSH_OpenDRIM_TCPProtocolEndpointProvider")] class OpenDRIM_TCPProtocolEndpoint:CIM_TCPProtocolEndpoint { }; opendrim-lmp-ssh-1.0.0/mof/OpenDRIM_SSHCapabilities.mof0000644000175000017500000000315311415301347023331 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ [Provider("cmpi:cmpiSSH_OpenDRIM_SSHCapabilitiesProvider")] class OpenDRIM_SSHCapabilities:CIM_SSHCapabilities { }; opendrim-lmp-ssh-1.0.0/mof/OpenDRIM_SSHProtocolCapabilities.mof0000644000175000017500000000321511415301347025052 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ [Association, Provider("cmpi:cmpiSSH_OpenDRIM_SSHProtocolCapabilitiesProvider")] class OpenDRIM_SSHProtocolCapabilities:CIM_ElementCapabilities { }; opendrim-lmp-ssh-1.0.0/mof/OpenDRIM_SSHServiceSettingData.mof0000644000175000017500000000321011415301347024462 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ [Association, Provider("cmpi:cmpiSSH_OpenDRIM_SSHServiceSettingDataProvider")] class OpenDRIM_SSHServiceSettingData:CIM_ElementSettingData { }; opendrim-lmp-ssh-1.0.0/mof/OpenDRIM_SSHSessionSettingData.mof0000644000175000017500000000321011415301347024505 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ [Association, Provider("cmpi:cmpiSSH_OpenDRIM_SSHSessionSettingDataProvider")] class OpenDRIM_SSHSessionSettingData:CIM_ElementSettingData { }; opendrim-lmp-ssh-1.0.0/mof/OpenDRIM_SSHConformsToProfile.mof0000644000175000017500000000321411415301347024350 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ [Association, Provider("cmpi:cmpiSSH_OpenDRIM_SSHConformsToProfileProvider")] class OpenDRIM_SSHConformsToProfile:CIM_ElementConformsToProfile { }; opendrim-lmp-ssh-1.0.0/mof/OpenDRIM_SSHProtocolService.mof0000644000175000017500000000316111415301347024061 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ [Provider("cmpi:cmpiSSH_OpenDRIM_SSHProtocolServiceProvider")] class OpenDRIM_SSHProtocolService:CIM_ProtocolService { }; opendrim-lmp-ssh-1.0.0/mof/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.mof0000644000175000017500000000325511415301347031322 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ [Association, Provider("cmpi:cmpiSSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProvider")] class OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint:CIM_BindsTo { }; opendrim-lmp-ssh-1.0.0/COPYING0000644000175000017500000004310311415301347016473 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-ssh-1.0.0/NEWS0000644000175000017500000000017511415301347016141 0ustar guillaumeguillaumeInitial Release 1.0.0 ========================= // TODO Changes in Major.Minor.Revision ========================= // TODO opendrim-lmp-ssh-1.0.0/LICENSE0000644000175000017500000004325411415301347016454 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-ssh-1.0.0/OpenDRIM_SSHSettingData/0000755000175000017500000000000011415301347021661 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHSettingData/cmpiOpenDRIM_SSHSettingData.h0000644000175000017500000000422611415301347027131 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef CMPIOPENDRIM_SSHSETTINGDATA_H_ #define CMPIOPENDRIM_SSHSETTINGDATA_H_ #include "OpenDRIM_SSHSettingData.h" CMPIObjectPath* SSH_OpenDRIM_SSHSettingData_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHSettingData& instance); CMPIInstance* SSH_OpenDRIM_SSHSettingData_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHSettingData& instance); void SSH_OpenDRIM_SSHSettingData_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHSettingData& instance); void SSH_OpenDRIM_SSHSettingData_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHSettingData& instance); #endif /*CMPIOPENDRIM_SSHSETTINGDATA_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHSettingData/Makefile.am0000644000175000017500000000400111415301347023710 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSSH_OpenDRIM_SSHSettingDataProvider.la libcmpiSSH_OpenDRIM_SSHSettingDataProvider_la_SOURCES = OpenDRIM_SSHSettingDataAccess.cpp OpenDRIM_SSHSettingDataProvider.cpp cmpiOpenDRIM_SSHSettingData.cpp libcmpiSSH_OpenDRIM_SSHSettingDataProvider_la_LIBADD = ../Common/libcmpiSSH_Common.la libcmpiSSH_OpenDRIM_SSHSettingDataProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_SSHSettingData.h OpenDRIM_SSHSettingData.h OpenDRIM_SSHSettingDataAccess.h opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHSettingData/OpenDRIM_SSHSettingDataProvider.cpp0000644000175000017500000002474511415301347030336 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHSettingData.h" #include "OpenDRIM_SSHSettingDataAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define SSH_OpenDRIM_SSHSettingDataProviderSetInstance SSH_OpenDRIM_SSHSettingDataProviderModifyInstance #endif int SSH_OpenDRIM_SSHSettingData_init(const CMPIBroker* broker); int SSH_OpenDRIM_SSHSettingData_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus SSH_OpenDRIM_SSHSettingDataProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHSettingData_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHSettingDataProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = SSH_OpenDRIM_SSHSettingData_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_SSHSettingData_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHSettingDataProviderEnumInstances(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 = SSH_OpenDRIM_SSHSettingData_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = SSH_OpenDRIM_SSHSettingData_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHSettingDataProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHSettingData instance; SSH_OpenDRIM_SSHSettingData_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHSettingData_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = SSH_OpenDRIM_SSHSettingData_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHSettingDataProviderSetInstance(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_SSHSettingData newInstance, oldInstance; SSH_OpenDRIM_SSHSettingData_toCPP(_broker, ci, newInstance); SSH_OpenDRIM_SSHSettingData_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHSettingData_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHSettingData_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHSettingDataProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHSettingData instance; SSH_OpenDRIM_SSHSettingData_toCPP(_broker, ci, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHSettingData_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_SSHSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHSettingData_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHSettingData_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = SSH_OpenDRIM_SSHSettingData_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHSettingDataProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHSettingData instance; SSH_OpenDRIM_SSHSettingData_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHSettingData_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHSettingData_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHSettingData_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHSettingDataProviderExecQuery(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 SSH_OpenDRIM_SSHSettingData_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHSettingData_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHSettingData_init FAILED: " + (string) OpenDRIM_SSHSettingData_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int SSH_OpenDRIM_SSHSettingData_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHSettingData_unload(errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHSettingData_unload FAILED: " + (string) OpenDRIM_SSHSettingData_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define SSH_OpenDRIM_SSHSettingData_INIT if (SSH_OpenDRIM_SSHSettingData_init(_broker) < 0) return NULL CMInstanceMIStub(SSH_OpenDRIM_SSHSettingDataProvider, SSH_OpenDRIM_SSHSettingDataProvider, _broker, SSH_OpenDRIM_SSHSettingData_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHSettingData/cmpiOpenDRIM_SSHSettingData.cpp0000644000175000017500000001520711415301347027465 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHSettingData.h" CMPIObjectPath* SSH_OpenDRIM_SSHSettingData_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHSettingData& instance) { _E_; Objectpath op(broker, OpenDRIM_SSHSettingData_classnames[0], OpenDRIM_SSHSettingData_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* SSH_OpenDRIM_SSHSettingData_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHSettingData& instance) { _E_; Objectpath op(broker, SSH_OpenDRIM_SSHSettingData_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.Generation_isNULL) ci.setProperty("Generation", instance.Generation); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.ConfigurationName_isNULL) ci.setProperty("ConfigurationName", instance.ConfigurationName); if (!instance.ChangeableType_isNULL) ci.setProperty("ChangeableType", instance.ChangeableType); if (!instance.EnabledSSHVersions_isNULL) ci.setProperty("EnabledSSHVersions", instance.EnabledSSHVersions); if (!instance.OtherEnabledSSHVersion_isNULL) ci.setProperty("OtherEnabledSSHVersion", instance.OtherEnabledSSHVersion); if (!instance.SSHVersion_isNULL) ci.setProperty("SSHVersion", instance.SSHVersion); if (!instance.OtherSSHVersion_isNULL) ci.setProperty("OtherSSHVersion", instance.OtherSSHVersion); if (!instance.EnabledEncryptionAlgorithms_isNULL) ci.setProperty("EnabledEncryptionAlgorithms", instance.EnabledEncryptionAlgorithms); if (!instance.OtherEnabledEncryptionAlgorithm_isNULL) ci.setProperty("OtherEnabledEncryptionAlgorithm", instance.OtherEnabledEncryptionAlgorithm); if (!instance.EncryptionAlgorithm_isNULL) ci.setProperty("EncryptionAlgorithm", instance.EncryptionAlgorithm); if (!instance.OtherEncryptionAlgorithm_isNULL) ci.setProperty("OtherEncryptionAlgorithm", instance.OtherEncryptionAlgorithm); if (!instance.IdleTimeout_isNULL) ci.setProperty("IdleTimeout", instance.IdleTimeout); if (!instance.KeepAlive_isNULL) ci.setProperty("KeepAlive", instance.KeepAlive); if (!instance.ForwardX11_isNULL) ci.setProperty("ForwardX11", instance.ForwardX11); if (!instance.Compression_isNULL) ci.setProperty("Compression", instance.Compression); _L_; return ci.getHdl(); } void SSH_OpenDRIM_SSHSettingData_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHSettingData& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void SSH_OpenDRIM_SSHSettingData_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHSettingData& 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("Generation", instance.Generation) == OK) instance.Generation_isNULL = false; if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getProperty("ConfigurationName", instance.ConfigurationName) == OK) instance.ConfigurationName_isNULL = false; if (inst.getProperty("ChangeableType", instance.ChangeableType) == OK) instance.ChangeableType_isNULL = false; if (inst.getProperty("EnabledSSHVersions", instance.EnabledSSHVersions) == OK) instance.EnabledSSHVersions_isNULL = false; if (inst.getProperty("OtherEnabledSSHVersion", instance.OtherEnabledSSHVersion) == OK) instance.OtherEnabledSSHVersion_isNULL = false; if (inst.getProperty("SSHVersion", instance.SSHVersion) == OK) instance.SSHVersion_isNULL = false; if (inst.getProperty("OtherSSHVersion", instance.OtherSSHVersion) == OK) instance.OtherSSHVersion_isNULL = false; if (inst.getProperty("EnabledEncryptionAlgorithms", instance.EnabledEncryptionAlgorithms) == OK) instance.EnabledEncryptionAlgorithms_isNULL = false; if (inst.getProperty("OtherEnabledEncryptionAlgorithm", instance.OtherEnabledEncryptionAlgorithm) == OK) instance.OtherEnabledEncryptionAlgorithm_isNULL = false; if (inst.getProperty("EncryptionAlgorithm", instance.EncryptionAlgorithm) == OK) instance.EncryptionAlgorithm_isNULL = false; if (inst.getProperty("OtherEncryptionAlgorithm", instance.OtherEncryptionAlgorithm) == OK) instance.OtherEncryptionAlgorithm_isNULL = false; if (inst.getProperty("IdleTimeout", instance.IdleTimeout) == OK) instance.IdleTimeout_isNULL = false; if (inst.getProperty("KeepAlive", instance.KeepAlive) == OK) instance.KeepAlive_isNULL = false; if (inst.getProperty("ForwardX11", instance.ForwardX11) == OK) instance.ForwardX11_isNULL = false; if (inst.getProperty("Compression", instance.Compression) == OK) instance.Compression_isNULL = false; _L_; } opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHSettingData/OpenDRIM_SSHSettingDataAccess.cpp0000644000175000017500000001475411415301347027744 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "OpenDRIM_SSHSettingDataAccess.h" const string InstanceID = "OpenDRIM:SSHSettingData"; int SSH_OpenDRIM_SSHSettingData_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_SSHSettingData_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_SSHSettingData_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; if (!CF_isExist("/usr/sbin/sshd")) return OK; OpenDRIM_SSHSettingData instance; instance.setInstanceID(InstanceID); if (discriminant == "ei") CF_assert(SSH_OpenDRIM_SSHSettingData_populate(instance, errorMessage)); result.push_back(instance); _L_; return OK; } int SSH_OpenDRIM_SSHSettingData_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHSettingData& instance, const char** properties, string& errorMessage) { _E_; if (instance.InstanceID != InstanceID || !CF_isExist("/usr/sbin/sshd")) { errorMessage = "Invalid path"; return NOT_FOUND; } CF_assert(SSH_OpenDRIM_SSHSettingData_populate(instance, errorMessage)); _L_; return OK; } int SSH_OpenDRIM_SSHSettingData_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHSettingData& newInstance, const OpenDRIM_SSHSettingData& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHSettingData_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHSettingData& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHSettingData_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHSettingData& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHSettingData_populate(OpenDRIM_SSHSettingData& instance, string& errorMessage) { _E_; /* * Properties to fill from profile * + Mandatory: * [X] InstanceID [KEY] * [X] ElementName * [X] EnabledSSHVersions * [X] SSHVersion * [X] EnabledEncryptionAlgorithm * [X] EncryptionAlgorithm * [X] IdleTimeout * [X] KeepAlive * [X] ForwardX11 * [X] Compression * + Conditional: * [X] OtherEnabledSSHVersion * [X] OtherSSHVersion * [X] OtherEnabledEncryptionAlgorithm * [X] OtherEncryptionAlgorithm */ instance.setElementName("SSH Service Settings"); vector enabledSSHVersions; string enabled_ssh_versions; CF_getConfigItem("Protocol", enabled_ssh_versions, errorMessage); if(enabled_ssh_versions == "1") { enabledSSHVersions.push_back(SSHV_SSHv1); instance.setEnabledSSHVersions(enabledSSHVersions); instance.setSSHVersion(SSHV_SSHv1); } else if (enabled_ssh_versions == "2") { enabledSSHVersions.push_back(SSHV_SSHv2); instance.setEnabledSSHVersions(enabledSSHVersions); instance.setSSHVersion(SSHV_SSHv2); } else if (enabled_ssh_versions == "1,2"||enabled_ssh_versions == "2,1"||enabled_ssh_versions == "") { enabledSSHVersions.push_back(SSHV_SSHv1); enabledSSHVersions.push_back(SSHV_SSHv2); instance.setEnabledSSHVersions(enabledSSHVersions); instance.setSSHVersion(SSHV_OTHER); vector otherSSHVersion; otherSSHVersion.push_back("ssh1"); otherSSHVersion.push_back("ssh2"); instance.setOtherSSHVersion(otherSSHVersion); } else { enabledSSHVersions.push_back(SSHV_UNKNOWN); instance.setEnabledSSHVersions(enabledSSHVersions); instance.setSSHVersion(SSHV_UNKNOWN); } vector enabledEncryptionAlgorithms; enabledEncryptionAlgorithms.push_back(OTHER); enabledEncryptionAlgorithms.push_back(DES3); enabledEncryptionAlgorithms.push_back(RC4); instance.setEnabledEncryptionAlgorithms(enabledEncryptionAlgorithms); vector otherEnabledEncryptionAlgorithm; otherEnabledEncryptionAlgorithm.push_back("AES"); otherEnabledEncryptionAlgorithm.push_back("BLOWFISH"); otherEnabledEncryptionAlgorithm.push_back("CAST"); instance.setOtherEnabledEncryptionAlgorithm(otherEnabledEncryptionAlgorithm); string encryptionAlgorithm; CF_getConfigItem("Ciphers", encryptionAlgorithm, errorMessage); instance.setEncryptionAlgorithm(OTHER); if (encryptionAlgorithm.size() != 0) instance.setOtherEncryptionAlgorithm(encryptionAlgorithm); else { string otherEncryptionAlgorithm = "aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr"; instance.setOtherEncryptionAlgorithm(otherEncryptionAlgorithm); } instance.setIdleTimeout(0); string config_str; CF_getConfigItem("KeepAlive",config_str, errorMessage); instance.setKeepAlive(!CF_startsWithNoCase(config_str, "no")); CF_getConfigItem("X11Forwarding", config_str, errorMessage); instance.setForwardX11(CF_startsWithNoCase(config_str, "yes")); CF_getConfigItem("Compression", config_str, errorMessage); instance.setCompression(!CF_startsWithNoCase(config_str, "no")); _L_; return OK; } opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHSettingData/OpenDRIM_SSHSettingDataAccess.h0000644000175000017500000000554011415301347027402 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHSETTINGDATAACCESS_H_ #define OPENDRIM_SSHSETTINGDATAACCESS_H_ #include "SSH_Common.h" #include "OpenDRIM_SSHSettingData.h" int SSH_OpenDRIM_SSHSettingData_load(const CMPIBroker* broker, string& errorMessage); int SSH_OpenDRIM_SSHSettingData_unload(string& errorMessage); int SSH_OpenDRIM_SSHSettingData_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHSettingData_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHSettingData& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHSettingData_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHSettingData& newInstance, const OpenDRIM_SSHSettingData& oldInstance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHSettingData_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHSettingData& instance, string& errorMessage); int SSH_OpenDRIM_SSHSettingData_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHSettingData& instance, string& errorMessage); int SSH_OpenDRIM_SSHSettingData_populate(OpenDRIM_SSHSettingData& instance, string& errorMessage); #endif /*OPENDRIM_SSHSETTINGDATAACCESS_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHSettingData/OpenDRIM_SSHSettingData.h0000644000175000017500000002216211415301347026257 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHSETTINGDATA_H_ #define OPENDRIM_SSHSETTINGDATA_H_ #include const static char* OpenDRIM_SSHSettingData_classnames[] = {"OpenDRIM_SSHSettingData"}; static string OpenDRIM_SSHSettingData_NAMESPACE = _NAMESPACE; class OpenDRIM_SSHSettingData { public: string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; unsigned long long Generation; bool Generation_isNULL; string InstanceID; bool InstanceID_isNULL; string ElementName; bool ElementName_isNULL; string ConfigurationName; bool ConfigurationName_isNULL; unsigned short ChangeableType; bool ChangeableType_isNULL; vector EnabledSSHVersions; bool EnabledSSHVersions_isNULL; string OtherEnabledSSHVersion; bool OtherEnabledSSHVersion_isNULL; unsigned short SSHVersion; bool SSHVersion_isNULL; vector OtherSSHVersion; bool OtherSSHVersion_isNULL; vector EnabledEncryptionAlgorithms; bool EnabledEncryptionAlgorithms_isNULL; vector OtherEnabledEncryptionAlgorithm; bool OtherEnabledEncryptionAlgorithm_isNULL; unsigned short EncryptionAlgorithm; bool EncryptionAlgorithm_isNULL; string OtherEncryptionAlgorithm; bool OtherEncryptionAlgorithm_isNULL; unsigned int IdleTimeout; bool IdleTimeout_isNULL; bool KeepAlive; bool KeepAlive_isNULL; bool ForwardX11; bool ForwardX11_isNULL; bool Compression; bool Compression_isNULL; OpenDRIM_SSHSettingData() { Caption_isNULL = true; Description_isNULL = true; Generation_isNULL = true; InstanceID_isNULL = true; ElementName_isNULL = true; ConfigurationName_isNULL = true; ChangeableType_isNULL = true; EnabledSSHVersions_isNULL = true; OtherEnabledSSHVersion_isNULL = true; SSHVersion_isNULL = true; OtherSSHVersion_isNULL = true; EnabledEncryptionAlgorithms_isNULL = true; OtherEnabledEncryptionAlgorithm_isNULL = true; EncryptionAlgorithm_isNULL = true; OtherEncryptionAlgorithm_isNULL = true; IdleTimeout_isNULL = true; KeepAlive_isNULL = true; ForwardX11_isNULL = true; Compression_isNULL = true; } ~OpenDRIM_SSHSettingData() {} 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 getGeneration(unsigned long long& value) const { if (Generation_isNULL==true) return NOT_FOUND; value = Generation; return OK; } int setGeneration(const unsigned long long& newValue) { Generation = newValue; Generation_isNULL = false; return OK; } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getConfigurationName(string& value) const { if (ConfigurationName_isNULL==true) return NOT_FOUND; value = ConfigurationName; return OK; } int setConfigurationName(const string& newValue) { ConfigurationName = newValue; ConfigurationName_isNULL = false; return OK; } int getChangeableType(unsigned short& value) const { if (ChangeableType_isNULL==true) return NOT_FOUND; value = ChangeableType; return OK; } int setChangeableType(const unsigned short& newValue) { ChangeableType = newValue; ChangeableType_isNULL = false; return OK; } int getEnabledSSHVersions(vector& value) const { if (EnabledSSHVersions_isNULL==true) return NOT_FOUND; value = EnabledSSHVersions; return OK; } int setEnabledSSHVersions(const vector& newValue) { EnabledSSHVersions = newValue; EnabledSSHVersions_isNULL = false; return OK; } int getOtherEnabledSSHVersion(string& value) const { if (OtherEnabledSSHVersion_isNULL==true) return NOT_FOUND; value = OtherEnabledSSHVersion; return OK; } int setOtherEnabledSSHVersion(const string& newValue) { OtherEnabledSSHVersion = newValue; OtherEnabledSSHVersion_isNULL = false; return OK; } int getSSHVersion(unsigned short& value) const { if (SSHVersion_isNULL==true) return NOT_FOUND; value = SSHVersion; return OK; } int setSSHVersion(const unsigned short& newValue) { SSHVersion = newValue; SSHVersion_isNULL = false; return OK; } int getOtherSSHVersion(vector& value) const { if (OtherSSHVersion_isNULL==true) return NOT_FOUND; value = OtherSSHVersion; return OK; } int setOtherSSHVersion(const vector& newValue) { OtherSSHVersion = newValue; OtherSSHVersion_isNULL = false; return OK; } int getEnabledEncryptionAlgorithms(vector& value) const { if (EnabledEncryptionAlgorithms_isNULL==true) return NOT_FOUND; value = EnabledEncryptionAlgorithms; return OK; } int setEnabledEncryptionAlgorithms(const vector& newValue) { EnabledEncryptionAlgorithms = newValue; EnabledEncryptionAlgorithms_isNULL = false; return OK; } int getOtherEnabledEncryptionAlgorithm(vector& value) const { if (OtherEnabledEncryptionAlgorithm_isNULL==true) return NOT_FOUND; value = OtherEnabledEncryptionAlgorithm; return OK; } int setOtherEnabledEncryptionAlgorithm(const vector& newValue) { OtherEnabledEncryptionAlgorithm = newValue; OtherEnabledEncryptionAlgorithm_isNULL = false; return OK; } int getEncryptionAlgorithm(unsigned short& value) const { if (EncryptionAlgorithm_isNULL==true) return NOT_FOUND; value = EncryptionAlgorithm; return OK; } int setEncryptionAlgorithm(const unsigned short& newValue) { EncryptionAlgorithm = newValue; EncryptionAlgorithm_isNULL = false; return OK; } int getOtherEncryptionAlgorithm(string& value) const { if (OtherEncryptionAlgorithm_isNULL==true) return NOT_FOUND; value = OtherEncryptionAlgorithm; return OK; } int setOtherEncryptionAlgorithm(const string& newValue) { OtherEncryptionAlgorithm = newValue; OtherEncryptionAlgorithm_isNULL = false; return OK; } int getIdleTimeout(unsigned int& value) const { if (IdleTimeout_isNULL==true) return NOT_FOUND; value = IdleTimeout; return OK; } int setIdleTimeout(const unsigned int& newValue) { IdleTimeout = newValue; IdleTimeout_isNULL = false; return OK; } int getKeepAlive(bool& value) const { if (KeepAlive_isNULL==true) return NOT_FOUND; value = KeepAlive; return OK; } int setKeepAlive(const bool& newValue) { KeepAlive = newValue; KeepAlive_isNULL = false; return OK; } int getForwardX11(bool& value) const { if (ForwardX11_isNULL==true) return NOT_FOUND; value = ForwardX11; return OK; } int setForwardX11(const bool& newValue) { ForwardX11 = newValue; ForwardX11_isNULL = false; return OK; } int getCompression(bool& value) const { if (Compression_isNULL==true) return NOT_FOUND; value = Compression; return OK; } int setCompression(const bool& newValue) { Compression = newValue; Compression_isNULL = false; return OK; } }; #endif /*OPENDRIM_SSHSETTINGDATA_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHConformsToProfile/0000755000175000017500000000000011415301347023064 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHConformsToProfile/Makefile.am0000644000175000017500000000471711415301347025131 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSSH_OpenDRIM_SSHConformsToProfileProvider.la libcmpiSSH_OpenDRIM_SSHConformsToProfileProvider_la_SOURCES = OpenDRIM_SSHConformsToProfileAccess.cpp OpenDRIM_SSHConformsToProfileProvider.cpp cmpiOpenDRIM_SSHConformsToProfile.cpp assocOpenDRIM_SSHConformsToProfile.cpp # May have to be adjusted for direct invocation libcmpiSSH_OpenDRIM_SSHConformsToProfileProvider_la_CPPFLAGS = -I../CIM_RegisteredProfile -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiSSH_OpenDRIM_SSHConformsToProfileProvider_la_LIBADD = ../Common/libcmpiSSH_Common.la #../CIM_RegisteredProfile/libcmpiSSH_CIM_RegisteredProfileProvider.la ../CIM_ManagedElement/libcmpiSSH_CIM_ManagedElementProvider.la libcmpiSSH_OpenDRIM_SSHConformsToProfileProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_SSHConformsToProfile.h OpenDRIM_SSHConformsToProfile.h OpenDRIM_SSHConformsToProfileAccess.h opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHConformsToProfile/OpenDRIM_SSHConformsToProfileAccess.cpp0000644000175000017500000002507311415301347032346 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "OpenDRIM_SSHConformsToProfileAccess.h" int SSH_OpenDRIM_SSHConformsToProfile_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(SSH_CIM_RegisteredProfile_load(broker, errorMessage)); CF_assert(SSH_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int SSH_OpenDRIM_SSHConformsToProfile_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(SSH_CIM_RegisteredProfile_unload(errorMessage)); CF_assert(SSH_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int SSH_OpenDRIM_SSHConformsToProfile_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 SSH_OpenDRIM_SSHConformsToProfile_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(SSH_OpenDRIM_SSHConformsToProfile_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(SSH_OpenDRIM_SSHConformsToProfile_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; CF_assert(SSH_OpenDRIM_SSHConformsToProfile_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(SSH_OpenDRIM_SSHConformsToProfile_referenceConformantStandardToManagedElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int SSH_OpenDRIM_SSHConformsToProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHConformsToProfile& 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(SSH_OpenDRIM_SSHConformsToProfile_getConformantStandard(broker, ctx, ConformantStandard_objectpath, ConformantStandard_instance, NULL, errorMessage)); Objectpath ManagedElement_objectpath; instance.getManagedElement(ManagedElement_objectpath); Instance ManagedElement_instance; CF_assert(SSH_OpenDRIM_SSHConformsToProfile_getManagedElement(broker, ctx, ManagedElement_objectpath, ManagedElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(SSH_OpenDRIM_SSHConformsToProfile_isAssociated(ConformantStandard_instance, ManagedElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int SSH_OpenDRIM_SSHConformsToProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHConformsToProfile& newInstance, const OpenDRIM_SSHConformsToProfile& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHConformsToProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHConformsToProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHConformsToProfile_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(SSH_OpenDRIM_SSHConformsToProfile_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(SSH_OpenDRIM_SSHConformsToProfile_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(SSH_OpenDRIM_SSHConformsToProfile_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(SSH_OpenDRIM_SSHConformsToProfile_enumerateConformantStandards(broker, ctx, ConformantStandard_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(SSH_OpenDRIM_SSHConformsToProfile_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(SSH_OpenDRIM_SSHConformsToProfile_enumerateConformantStandards(broker, ctx, ConformantStandard_instances, properties, false, errorMessage)); } for (size_t i=0; i& ManagedElement_instances, vector& OpenDRIM_SSHConformsToProfile_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_SSHConformsToProfile instance; instance.setConformantStandard(((Instance) ConformantStandard_instance).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instances[i]).getObjectpath()); OpenDRIM_SSHConformsToProfile_instances.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_SSHConformsToProfile_referenceManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& ConformantStandard_instances, vector& OpenDRIM_SSHConformsToProfile_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_SSHConformsToProfile instance; instance.setConformantStandard(((Instance) ConformantStandard_instances[i]).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instance).getObjectpath()); OpenDRIM_SSHConformsToProfile_instances.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_SSHConformsToProfile_populate(OpenDRIM_SSHConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHConformsToProfile/assocOpenDRIM_SSHConformsToProfile.cpp0000644000175000017500000002123211415301347032246 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "assocOpenDRIM_SSHConformsToProfile.h" int SSH_OpenDRIM_SSHConformsToProfile_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 = SSH_OpenDRIM_SSHConformsToProfile_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(SSH_OpenDRIM_SSHConformsToProfile_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(SSH_OpenDRIM_SSHConformsToProfile_associatorManagedElementToConformantStandard(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int SSH_OpenDRIM_SSHConformsToProfile_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(SSH_CIM_RegisteredProfile_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(SSH_CIM_RegisteredProfile_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, SSH_CIM_RegisteredProfile_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int SSH_OpenDRIM_SSHConformsToProfile_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; SSH_CIM_RegisteredProfile_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(SSH_CIM_RegisteredProfile_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, SSH_CIM_RegisteredProfile_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int SSH_OpenDRIM_SSHConformsToProfile_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(SSH_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(SSH_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, SSH_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int SSH_OpenDRIM_SSHConformsToProfile_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; SSH_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(SSH_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, SSH_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHConformsToProfile/OpenDRIM_SSHConformsToProfile.h0000644000175000017500000000723611415301347030672 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHCONFORMSTOPROFILE_H_ #define OPENDRIM_SSHCONFORMSTOPROFILE_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_SSHConformsToProfile_classnames[] = {"OpenDRIM_SSHConformsToProfile"}; static string OpenDRIM_SSHConformsToProfile_NAMESPACE = _INTEROP_NAMESPACE; const static string ConformantStandard_role = "ConformantStandard"; const static char* ConformantStandard_classnames[] = {"OpenDRIM_RegisteredSSHProfile"}; const static string ConformantStandard_NAMESPACE = _INTEROP_NAMESPACE; const static string ManagedElement_role = "ManagedElement"; const static char* ManagedElement_classnames[] = {"OpenDRIM_SSHProtocolService"}; const static string ManagedElement_NAMESPACE = _NAMESPACE; class OpenDRIM_SSHConformsToProfile { public: Objectpath ConformantStandard; bool ConformantStandard_isNULL; Objectpath ManagedElement; bool ManagedElement_isNULL; OpenDRIM_SSHConformsToProfile() { ConformantStandard_isNULL = true; ManagedElement_isNULL = true; } ~OpenDRIM_SSHConformsToProfile() {} 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_SSHCONFORMSTOPROFILE_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHConformsToProfile/OpenDRIM_SSHConformsToProfileProvider.cpp0000644000175000017500000004163111415301347032735 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHConformsToProfile.h" #include "OpenDRIM_SSHConformsToProfileAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define SSH_OpenDRIM_SSHConformsToProfileProviderSetInstance SSH_OpenDRIM_SSHConformsToProfileProviderModifyInstance #endif int SSH_OpenDRIM_SSHConformsToProfile_init(const CMPIBroker* broker); int SSH_OpenDRIM_SSHConformsToProfile_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus SSH_OpenDRIM_SSHConformsToProfileProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHConformsToProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHConformsToProfileProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = SSH_OpenDRIM_SSHConformsToProfile_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_SSHConformsToProfile_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHConformsToProfileProviderEnumInstances(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 = SSH_OpenDRIM_SSHConformsToProfile_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = SSH_OpenDRIM_SSHConformsToProfile_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHConformsToProfileProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHConformsToProfile instance; SSH_OpenDRIM_SSHConformsToProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHConformsToProfile_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = SSH_OpenDRIM_SSHConformsToProfile_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHConformsToProfileProviderSetInstance(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_SSHConformsToProfile newInstance, oldInstance; SSH_OpenDRIM_SSHConformsToProfile_toCPP(_broker, ci, newInstance); SSH_OpenDRIM_SSHConformsToProfile_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHConformsToProfile_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHConformsToProfile_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHConformsToProfileProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHConformsToProfile instance; SSH_OpenDRIM_SSHConformsToProfile_toCPP(_broker, ci, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_SSHConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHConformsToProfile_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = SSH_OpenDRIM_SSHConformsToProfile_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHConformsToProfileProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHConformsToProfile instance; SSH_OpenDRIM_SSHConformsToProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHConformsToProfile_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHConformsToProfileProviderExecQuery(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 SSH_OpenDRIM_SSHConformsToProfileProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHConformsToProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHConformsToProfileProviderAssociatorNames(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 = SSH_OpenDRIM_SSHConformsToProfile_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHConformsToProfile_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 SSH_OpenDRIM_SSHConformsToProfileProviderAssociators(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 = SSH_OpenDRIM_SSHConformsToProfile_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHConformsToProfile_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 SSH_OpenDRIM_SSHConformsToProfileProviderReferenceNames(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 = SSH_OpenDRIM_SSHConformsToProfile_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = SSH_OpenDRIM_SSHConformsToProfile_referenceConformantStandardToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = SSH_OpenDRIM_SSHConformsToProfile_referenceManagedElementToConformantStandard(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_SSHConformsToProfile_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHConformsToProfileProviderReferences(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 = SSH_OpenDRIM_SSHConformsToProfile_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = SSH_OpenDRIM_SSHConformsToProfile_referenceConformantStandardToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = SSH_OpenDRIM_SSHConformsToProfile_referenceManagedElementToConformantStandard(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = SSH_OpenDRIM_SSHConformsToProfile_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int SSH_OpenDRIM_SSHConformsToProfile_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHConformsToProfile_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHConformsToProfile_init FAILED: " + (string) OpenDRIM_SSHConformsToProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int SSH_OpenDRIM_SSHConformsToProfile_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHConformsToProfile_unload(errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHConformsToProfile_unload FAILED: " + (string) OpenDRIM_SSHConformsToProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define SSH_OpenDRIM_SSHConformsToProfile_INIT if (SSH_OpenDRIM_SSHConformsToProfile_init(_broker) < 0) return NULL CMInstanceMIStub(SSH_OpenDRIM_SSHConformsToProfileProvider, SSH_OpenDRIM_SSHConformsToProfileProvider, _broker, SSH_OpenDRIM_SSHConformsToProfile_INIT); CMAssociationMIStub(SSH_OpenDRIM_SSHConformsToProfileProvider, SSH_OpenDRIM_SSHConformsToProfileProvider, _broker, SSH_OpenDRIM_SSHConformsToProfile_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHConformsToProfile/cmpiOpenDRIM_SSHConformsToProfile.cpp0000644000175000017500000000624111415301347032071 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHConformsToProfile.h" CMPIObjectPath* SSH_OpenDRIM_SSHConformsToProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHConformsToProfile& instance) { _E_; Objectpath op(broker, OpenDRIM_SSHConformsToProfile_classnames[0], OpenDRIM_SSHConformsToProfile_NAMESPACE); if (!instance.ConformantStandard_isNULL) op.addKey("ConformantStandard", instance.ConformantStandard); if (!instance.ManagedElement_isNULL) op.addKey("ManagedElement", instance.ManagedElement); _L_; return op.getHdl(); } CMPIInstance* SSH_OpenDRIM_SSHConformsToProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHConformsToProfile& instance) { _E_; Objectpath op(broker, SSH_OpenDRIM_SSHConformsToProfile_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void SSH_OpenDRIM_SSHConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHConformsToProfile& 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 SSH_OpenDRIM_SSHConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHConformsToProfile& 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-ssh-1.0.0/OpenDRIM_SSHConformsToProfile/OpenDRIM_SSHConformsToProfileAccess.h0000644000175000017500000001055411415301347032011 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHCONFORMSTOPROFILEACCESS_H_ #define OPENDRIM_SSHCONFORMSTOPROFILEACCESS_H_ #include "SSH_Common.h" #include "OpenDRIM_SSHConformsToProfile.h" #include "assocOpenDRIM_SSHConformsToProfile.h" int SSH_OpenDRIM_SSHConformsToProfile_load(const CMPIBroker* broker, string& errorMessage); int SSH_OpenDRIM_SSHConformsToProfile_unload(string& errorMessage); int SSH_OpenDRIM_SSHConformsToProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHConformsToProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHConformsToProfile& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHConformsToProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHConformsToProfile& newInstance, const OpenDRIM_SSHConformsToProfile& oldInstance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHConformsToProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHConformsToProfile& instance, string& errorMessage); int SSH_OpenDRIM_SSHConformsToProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHConformsToProfile& instance, string& errorMessage); int SSH_OpenDRIM_SSHConformsToProfile_associatorConformantStandardToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ConformantStandard_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHConformsToProfile_associatorManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const char** properties, vector& ConformantStandard_associatedInstances, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHConformsToProfile_referenceConformantStandardToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ConformantStandard_instance, const vector& ManagedElement_instances, vector& OpenDRIM_SSHConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHConformsToProfile_referenceManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& ConformantStandard_instances, vector& OpenDRIM_SSHConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHConformsToProfile_populate(OpenDRIM_SSHConformsToProfile& instance, string& errorMessage); #endif /*OPENDRIM_SSHCONFORMSTOPROFILEACCESS_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHConformsToProfile/assocOpenDRIM_SSHConformsToProfile.h0000644000175000017500000000622211415301347031715 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef ASSOCOPENDRIM_SSHCONFORMSTOPROFILE_H_ #define ASSOCOPENDRIM_SSHCONFORMSTOPROFILE_H_ #include "OpenDRIM_SSHConformsToProfileAccess.h" int SSH_OpenDRIM_SSHConformsToProfile_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 SSH_OpenDRIM_SSHConformsToProfile_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 SSH_OpenDRIM_SSHConformsToProfile_enumerateConformantStandards(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int SSH_OpenDRIM_SSHConformsToProfile_getConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHConformsToProfile_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int SSH_OpenDRIM_SSHConformsToProfile_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_SSHCONFORMSTOPROFILE_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHConformsToProfile/cmpiOpenDRIM_SSHConformsToProfile.h0000644000175000017500000000433611415301347031541 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef CMPIOPENDRIM_SSHCONFORMSTOPROFILE_H_ #define CMPIOPENDRIM_SSHCONFORMSTOPROFILE_H_ #include "OpenDRIM_SSHConformsToProfile.h" CMPIObjectPath* SSH_OpenDRIM_SSHConformsToProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHConformsToProfile& instance); CMPIInstance* SSH_OpenDRIM_SSHConformsToProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHConformsToProfile& instance); void SSH_OpenDRIM_SSHConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHConformsToProfile& instance); void SSH_OpenDRIM_SSHConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHConformsToProfile& instance); #endif /*CMPIOPENDRIM_SSHCONFORMSTOPROFILE_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/0000755000175000017500000000000011415301347030031 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/cmpiOpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.cppopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/cmpiOpenDRIM_SSHProtoc0000644000175000017500000000653011415301347034112 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.h" CMPIObjectPath* SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint& instance) { _E_; Objectpath op(broker, OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_classnames[0], OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint& instance) { _E_; Objectpath op(broker, SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint& 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 SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint& 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-ssh-1.0.0/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/Makefile.am0000644000175000017500000000540411415301347032070 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProvider.la libcmpiSSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProvider_la_SOURCES = OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointAccess.cpp OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProvider.cpp cmpiOpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.cpp assocOpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.cpp # May have to be adjusted for direct invocation libcmpiSSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProvider_la_CPPFLAGS = -I../CIM_ProtocolEndpoint -I../CIM_ServiceAccessPoint # Uncomment the end for direct invocation, may have to be adjusted libcmpiSSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProvider_la_LIBADD = ../Common/libcmpiSSH_Common.la #../CIM_ProtocolEndpoint/libcmpiSSH_CIM_ProtocolEndpointProvider.la ../CIM_ServiceAccessPoint/libcmpiSSH_CIM_ServiceAccessPointProvider.la libcmpiSSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.h OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.h OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointAccess.h ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProvider.cppopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/OpenDRIM_SSHProtocolEn0000644000175000017500000004605711415301347034067 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.h" #include "OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProviderSetInstance SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProviderModifyInstance #endif int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_init(const CMPIBroker* broker); int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProviderEnumInstances(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 = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint instance; SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProviderSetInstance(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_SSHProtocolEndpointBindsToTCPProtocolEndpoint newInstance, oldInstance; SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_toCPP(_broker, ci, newInstance); SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint instance; SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_toCPP(_broker, ci, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint instance; SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProviderExecQuery(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 SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProviderAssociatorNames(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 = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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 SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProviderAssociators(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 = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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 SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProviderReferenceNames(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 = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProviderReferences(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 = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_init FAILED: " + (string) OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_unload(errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_unload FAILED: " + (string) OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_INIT if (SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_init(_broker) < 0) return NULL CMInstanceMIStub(SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProvider, SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProvider, _broker, SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_INIT); CMAssociationMIStub(SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProvider, SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointProvider, _broker, SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.hopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/OpenDRIM_SSHProtocolEn0000644000175000017500000000723011415301347034055 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHPROTOCOLENDPOINTBINDSTOTCPPROTOCOLENDPOINT_H_ #define OPENDRIM_SSHPROTOCOLENDPOINTBINDSTOTCPPROTOCOLENDPOINT_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_ProtocolEndpoint.h" #include "CIM_ProtocolEndpointAccess.h" #include "cmpiCIM_ServiceAccessPoint.h" #include "CIM_ServiceAccessPointAccess.h" */ const static char* OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_classnames[] = {"OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint"}; static string OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"OpenDRIM_TCPProtocolEndpoint"}; const static string Antecedent_NAMESPACE = _NAMESPACE; const static string Dependent_role = "Dependent"; const static char* Dependent_classnames[] = {"OpenDRIM_SSHProtocolEndpoint"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint() { Antecedent_isNULL = true; Dependent_isNULL = true; } ~OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint() {} 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_SSHPROTOCOLENDPOINTBINDSTOTCPPROTOCOLENDPOINT_H_*/ ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/assocOpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.cppopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/assocOpenDRIM_SSHProto0000644000175000017500000002156211415301347034131 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "assocOpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.h" int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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 = SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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(SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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(SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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(SSH_CIM_ProtocolEndpoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(SSH_CIM_ProtocolEndpoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, SSH_CIM_ProtocolEndpoint_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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_ProtocolEndpoint _instance; SSH_CIM_ProtocolEndpoint_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(SSH_CIM_ProtocolEndpoint_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, SSH_CIM_ProtocolEndpoint_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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(SSH_CIM_ServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(SSH_CIM_ServiceAccessPoint_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, SSH_CIM_ServiceAccessPoint_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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; SSH_CIM_ServiceAccessPoint_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(SSH_CIM_ServiceAccessPoint_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, SSH_CIM_ServiceAccessPoint_toCMPIInstance(broker, _instance)); */ _L_; return OK; } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/assocOpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.hopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/assocOpenDRIM_SSHProto0000644000175000017500000000656211415301347034134 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef ASSOCOPENDRIM_SSHPROTOCOLENDPOINTBINDSTOTCPPROTOCOLENDPOINT_H_ #define ASSOCOPENDRIM_SSHPROTOCOLENDPOINTBINDSTOTCPPROTOCOLENDPOINT_H_ #include "OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointAccess.h" int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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 SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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 SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_SSHPROTOCOLENDPOINTBINDSTOTCPPROTOCOLENDPOINT_H_*/ ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/cmpiOpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.hopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/cmpiOpenDRIM_SSHProtoc0000644000175000017500000000501211415301347034104 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef CMPIOPENDRIM_SSHPROTOCOLENDPOINTBINDSTOTCPPROTOCOLENDPOINT_H_ #define CMPIOPENDRIM_SSHPROTOCOLENDPOINTBINDSTOTCPPROTOCOLENDPOINT_H_ #include "OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.h" CMPIObjectPath* SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint& instance); CMPIInstance* SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint& instance); void SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint& instance); void SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint& instance); #endif /*CMPIOPENDRIM_SSHPROTOCOLENDPOINTBINDSTOTCPPROTOCOLENDPOINT_H_*/ ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointAccess.cppopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/OpenDRIM_SSHProtocolEn0000644000175000017500000002676411415301347034072 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointAccess.h" int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(SSH_CIM_ProtocolEndpoint_load(broker, errorMessage)); CF_assert(SSH_CIM_ServiceAccessPoint_load(broker, errorMessage)); */ // TODO _L_; return OK; } int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(SSH_CIM_ProtocolEndpoint_unload(errorMessage)); CF_assert(SSH_CIM_ServiceAccessPoint_unload(errorMessage)); */ // TODO _L_; return OK; } int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // Determine if the association can be established or not string TCPProtocolEndpoint_systemName; CF_assert(Antecedent.getProperty("SystemName", TCPProtocolEndpoint_systemName)); string SSHProtocolEndpoint_systemName; CF_assert(Dependent.getProperty("SystemName", SSHProtocolEndpoint_systemName)); if (TCPProtocolEndpoint_systemName == SSHProtocolEndpoint_systemName) isAssociated = true; else isAssociated = false; _L_; return OK; } int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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(SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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(SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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; CF_assert(SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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(SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint& 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(SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint& newInstance, const OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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(SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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(SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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(SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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(SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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_SSHProtocolEndpointBindsToTCPProtocolEndpoint instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_instances.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_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_SSHProtocolEndpointBindsToTCPProtocolEndpoint instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_instances.push_back(instance); } _L_; return OK; } int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_populate(OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpointAccess.hopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint/OpenDRIM_SSHProtocolEn0000644000175000017500000001170011415301347034052 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHPROTOCOLENDPOINTBINDSTOTCPPROTOCOLENDPOINTACCESS_H_ #define OPENDRIM_SSHPROTOCOLENDPOINTBINDSTOTCPPROTOCOLENDPOINTACCESS_H_ #include "SSH_Common.h" #include "OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.h" #include "assocOpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint.h" int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_load(const CMPIBroker* broker, string& errorMessage); int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_unload(string& errorMessage); int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint& newInstance, const OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint& oldInstance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint& instance, string& errorMessage); int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint& instance, string& errorMessage); int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint_populate(OpenDRIM_SSHProtocolEndpointBindsToTCPProtocolEndpoint& instance, string& errorMessage); #endif /*OPENDRIM_SSHPROTOCOLENDPOINTBINDSTOTCPPROTOCOLENDPOINTACCESS_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHCapabilities/0000755000175000017500000000000011415301347022043 5ustar guillaumeguillaumeopendrim-lmp-ssh-1.0.0/OpenDRIM_SSHCapabilities/OpenDRIM_SSHCapabilities.h0000644000175000017500000002511411415301347026623 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHCAPABILITIES_H_ #define OPENDRIM_SSHCAPABILITIES_H_ #include const static char* OpenDRIM_SSHCapabilities_classnames[] = {"OpenDRIM_SSHCapabilities"}; static string OpenDRIM_SSHCapabilities_NAMESPACE = _NAMESPACE; class OpenDRIM_SSHCapabilities { public: string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; unsigned long long Generation; bool Generation_isNULL; string InstanceID; bool InstanceID_isNULL; string ElementName; bool ElementName_isNULL; bool ElementNameEditSupported; bool ElementNameEditSupported_isNULL; unsigned short MaxElementNameLen; bool MaxElementNameLen_isNULL; vector RequestedStatesSupported; bool RequestedStatesSupported_isNULL; string ElementNameMask; bool ElementNameMask_isNULL; vector StateAwareness; bool StateAwareness_isNULL; unsigned short MaxConnections; bool MaxConnections_isNULL; unsigned short MaxListeningPorts; bool MaxListeningPorts_isNULL; bool ListeningPortManagementSupported; bool ListeningPortManagementSupported_isNULL; vector SupportedSSHVersions; bool SupportedSSHVersions_isNULL; string OtherSupportedSSHVersion; bool OtherSupportedSSHVersion_isNULL; vector SupportedEncryptionAlgorithms; bool SupportedEncryptionAlgorithms_isNULL; string OtherSupportedEncryptionAlgorithm; bool OtherSupportedEncryptionAlgorithm_isNULL; OpenDRIM_SSHCapabilities() { Caption_isNULL = true; Description_isNULL = true; Generation_isNULL = true; InstanceID_isNULL = true; ElementName_isNULL = true; ElementNameEditSupported_isNULL = true; MaxElementNameLen_isNULL = true; RequestedStatesSupported_isNULL = true; ElementNameMask_isNULL = true; StateAwareness_isNULL = true; MaxConnections_isNULL = true; MaxListeningPorts_isNULL = true; ListeningPortManagementSupported_isNULL = true; SupportedSSHVersions_isNULL = true; OtherSupportedSSHVersion_isNULL = true; SupportedEncryptionAlgorithms_isNULL = true; OtherSupportedEncryptionAlgorithm_isNULL = true; } ~OpenDRIM_SSHCapabilities() {} 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 getGeneration(unsigned long long& value) const { if (Generation_isNULL==true) return NOT_FOUND; value = Generation; return OK; } int setGeneration(const unsigned long long& newValue) { Generation = newValue; Generation_isNULL = false; return OK; } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getElementNameEditSupported(bool& value) const { if (ElementNameEditSupported_isNULL==true) return NOT_FOUND; value = ElementNameEditSupported; return OK; } int setElementNameEditSupported(const bool& newValue) { ElementNameEditSupported = newValue; ElementNameEditSupported_isNULL = false; return OK; } int getMaxElementNameLen(unsigned short& value) const { if (MaxElementNameLen_isNULL==true) return NOT_FOUND; value = MaxElementNameLen; return OK; } int setMaxElementNameLen(const unsigned short& newValue) { MaxElementNameLen = newValue; MaxElementNameLen_isNULL = false; return OK; } int getRequestedStatesSupported(vector& value) const { if (RequestedStatesSupported_isNULL==true) return NOT_FOUND; value = RequestedStatesSupported; return OK; } int setRequestedStatesSupported(const vector& newValue) { RequestedStatesSupported = newValue; RequestedStatesSupported_isNULL = false; return OK; } int getElementNameMask(string& value) const { if (ElementNameMask_isNULL==true) return NOT_FOUND; value = ElementNameMask; return OK; } int setElementNameMask(const string& newValue) { ElementNameMask = newValue; ElementNameMask_isNULL = false; return OK; } int getStateAwareness(vector& value) const { if (StateAwareness_isNULL==true) return NOT_FOUND; value = StateAwareness; return OK; } int setStateAwareness(const vector& newValue) { StateAwareness = newValue; StateAwareness_isNULL = false; return OK; } int getMaxConnections(unsigned short& value) const { if (MaxConnections_isNULL==true) return NOT_FOUND; value = MaxConnections; return OK; } int setMaxConnections(const unsigned short& newValue) { MaxConnections = newValue; MaxConnections_isNULL = false; return OK; } int getMaxListeningPorts(unsigned short& value) const { if (MaxListeningPorts_isNULL==true) return NOT_FOUND; value = MaxListeningPorts; return OK; } int setMaxListeningPorts(const unsigned short& newValue) { MaxListeningPorts = newValue; MaxListeningPorts_isNULL = false; return OK; } int getListeningPortManagementSupported(bool& value) const { if (ListeningPortManagementSupported_isNULL==true) return NOT_FOUND; value = ListeningPortManagementSupported; return OK; } int setListeningPortManagementSupported(const bool& newValue) { ListeningPortManagementSupported = newValue; ListeningPortManagementSupported_isNULL = false; return OK; } int getSupportedSSHVersions(vector& value) const { if (SupportedSSHVersions_isNULL==true) return NOT_FOUND; value = SupportedSSHVersions; return OK; } int setSupportedSSHVersions(const vector& newValue) { SupportedSSHVersions = newValue; SupportedSSHVersions_isNULL = false; return OK; } int getOtherSupportedSSHVersion(string& value) const { if (OtherSupportedSSHVersion_isNULL==true) return NOT_FOUND; value = OtherSupportedSSHVersion; return OK; } int setOtherSupportedSSHVersion(const string& newValue) { OtherSupportedSSHVersion = newValue; OtherSupportedSSHVersion_isNULL = false; return OK; } int getSupportedEncryptionAlgorithms(vector& value) const { if (SupportedEncryptionAlgorithms_isNULL==true) return NOT_FOUND; value = SupportedEncryptionAlgorithms; return OK; } int setSupportedEncryptionAlgorithms(const vector& newValue) { SupportedEncryptionAlgorithms = newValue; SupportedEncryptionAlgorithms_isNULL = false; return OK; } int getOtherSupportedEncryptionAlgorithm(string& value) const { if (OtherSupportedEncryptionAlgorithm_isNULL==true) return NOT_FOUND; value = OtherSupportedEncryptionAlgorithm; return OK; } int setOtherSupportedEncryptionAlgorithm(const string& newValue) { OtherSupportedEncryptionAlgorithm = newValue; OtherSupportedEncryptionAlgorithm_isNULL = false; return OK; } }; class OpenDRIM_SSHCapabilities_CreateGoalSettings_In { public: vector TemplateGoalSettings; bool TemplateGoalSettings_isNULL; vector SupportedGoalSettings; bool SupportedGoalSettings_isNULL; OpenDRIM_SSHCapabilities_CreateGoalSettings_In() { TemplateGoalSettings_isNULL = true; SupportedGoalSettings_isNULL = true; } ~OpenDRIM_SSHCapabilities_CreateGoalSettings_In() {} int getTemplateGoalSettings(vector& value) const { if (TemplateGoalSettings_isNULL == true) return NOT_FOUND; value = TemplateGoalSettings; return OK; } int setTemplateGoalSettings(const vector& newValue) { TemplateGoalSettings = newValue; TemplateGoalSettings_isNULL = false; return OK; } int getSupportedGoalSettings(vector& value) const { if (SupportedGoalSettings_isNULL == true) return NOT_FOUND; value = SupportedGoalSettings; return OK; } int setSupportedGoalSettings(const vector& newValue) { SupportedGoalSettings = newValue; SupportedGoalSettings_isNULL = false; return OK; } }; class OpenDRIM_SSHCapabilities_CreateGoalSettings_Out { public: vector SupportedGoalSettings; bool SupportedGoalSettings_isNULL; OpenDRIM_SSHCapabilities_CreateGoalSettings_Out() { SupportedGoalSettings_isNULL = true; } ~OpenDRIM_SSHCapabilities_CreateGoalSettings_Out() {} int getSupportedGoalSettings(vector& value) const { if (SupportedGoalSettings_isNULL == true) return NOT_FOUND; value = SupportedGoalSettings; return OK; } int setSupportedGoalSettings(const vector& newValue) { SupportedGoalSettings = newValue; SupportedGoalSettings_isNULL = false; return OK; } }; #endif /*OPENDRIM_SSHCAPABILITIES_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHCapabilities/Makefile.am0000644000175000017500000000401311415301347024075 0ustar guillaumeguillaume################################################################################# # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ################################################################################# providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSSH_OpenDRIM_SSHCapabilitiesProvider.la libcmpiSSH_OpenDRIM_SSHCapabilitiesProvider_la_SOURCES = OpenDRIM_SSHCapabilitiesAccess.cpp OpenDRIM_SSHCapabilitiesProvider.cpp cmpiOpenDRIM_SSHCapabilities.cpp libcmpiSSH_OpenDRIM_SSHCapabilitiesProvider_la_LIBADD = ../Common/libcmpiSSH_Common.la libcmpiSSH_OpenDRIM_SSHCapabilitiesProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_SSHCapabilities.h OpenDRIM_SSHCapabilities.h OpenDRIM_SSHCapabilitiesAccess.h opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHCapabilities/cmpiOpenDRIM_SSHCapabilities.cpp0000644000175000017500000001714311415301347030032 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHCapabilities.h" CMPIObjectPath* SSH_OpenDRIM_SSHCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHCapabilities& instance) { _E_; Objectpath op(broker, OpenDRIM_SSHCapabilities_classnames[0], OpenDRIM_SSHCapabilities_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* SSH_OpenDRIM_SSHCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHCapabilities& instance) { _E_; Objectpath op(broker, SSH_OpenDRIM_SSHCapabilities_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.Generation_isNULL) ci.setProperty("Generation", instance.Generation); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.ElementNameEditSupported_isNULL) ci.setProperty("ElementNameEditSupported", instance.ElementNameEditSupported); if (!instance.MaxElementNameLen_isNULL) ci.setProperty("MaxElementNameLen", instance.MaxElementNameLen); if (!instance.RequestedStatesSupported_isNULL) ci.setProperty("RequestedStatesSupported", instance.RequestedStatesSupported); if (!instance.ElementNameMask_isNULL) ci.setProperty("ElementNameMask", instance.ElementNameMask); if (!instance.StateAwareness_isNULL) ci.setProperty("StateAwareness", instance.StateAwareness); if (!instance.MaxConnections_isNULL) ci.setProperty("MaxConnections", instance.MaxConnections); if (!instance.MaxListeningPorts_isNULL) ci.setProperty("MaxListeningPorts", instance.MaxListeningPorts); if (!instance.ListeningPortManagementSupported_isNULL) ci.setProperty("ListeningPortManagementSupported", instance.ListeningPortManagementSupported); if (!instance.SupportedSSHVersions_isNULL) ci.setProperty("SupportedSSHVersions", instance.SupportedSSHVersions); if (!instance.OtherSupportedSSHVersion_isNULL) ci.setProperty("OtherSupportedSSHVersion", instance.OtherSupportedSSHVersion); if (!instance.SupportedEncryptionAlgorithms_isNULL) ci.setProperty("SupportedEncryptionAlgorithms", instance.SupportedEncryptionAlgorithms); if (!instance.OtherSupportedEncryptionAlgorithm_isNULL) ci.setProperty("OtherSupportedEncryptionAlgorithm", instance.OtherSupportedEncryptionAlgorithm); _L_; return ci.getHdl(); } void SSH_OpenDRIM_SSHCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHCapabilities& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void SSH_OpenDRIM_SSHCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHCapabilities& 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("Generation", instance.Generation) == OK) instance.Generation_isNULL = false; if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getProperty("ElementNameEditSupported", instance.ElementNameEditSupported) == OK) instance.ElementNameEditSupported_isNULL = false; if (inst.getProperty("MaxElementNameLen", instance.MaxElementNameLen) == OK) instance.MaxElementNameLen_isNULL = false; if (inst.getProperty("RequestedStatesSupported", instance.RequestedStatesSupported) == OK) instance.RequestedStatesSupported_isNULL = false; if (inst.getProperty("ElementNameMask", instance.ElementNameMask) == OK) instance.ElementNameMask_isNULL = false; if (inst.getProperty("StateAwareness", instance.StateAwareness) == OK) instance.StateAwareness_isNULL = false; if (inst.getProperty("MaxConnections", instance.MaxConnections) == OK) instance.MaxConnections_isNULL = false; if (inst.getProperty("MaxListeningPorts", instance.MaxListeningPorts) == OK) instance.MaxListeningPorts_isNULL = false; if (inst.getProperty("ListeningPortManagementSupported", instance.ListeningPortManagementSupported) == OK) instance.ListeningPortManagementSupported_isNULL = false; if (inst.getProperty("SupportedSSHVersions", instance.SupportedSSHVersions) == OK) instance.SupportedSSHVersions_isNULL = false; if (inst.getProperty("OtherSupportedSSHVersion", instance.OtherSupportedSSHVersion) == OK) instance.OtherSupportedSSHVersion_isNULL = false; if (inst.getProperty("SupportedEncryptionAlgorithms", instance.SupportedEncryptionAlgorithms) == OK) instance.SupportedEncryptionAlgorithms_isNULL = false; if (inst.getProperty("OtherSupportedEncryptionAlgorithm", instance.OtherSupportedEncryptionAlgorithm) == OK) instance.OtherSupportedEncryptionAlgorithm_isNULL = false; _L_; } void SSH_OpenDRIM_SSHCapabilities_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_SSHCapabilities_CreateGoalSettings_In& args) { _E_; CMPIStatus rc; CMPIData data; vector TemplateGoalSettings; data = in->ft->getArg(in, "TemplateGoalSettings", &rc); if (rc.rc == OK) { CT_ToC(data, TemplateGoalSettings); args.setTemplateGoalSettings(TemplateGoalSettings); } vector SupportedGoalSettings; data = in->ft->getArg(in, "SupportedGoalSettings", &rc); if (rc.rc == OK) { CT_ToC(data, SupportedGoalSettings); args.setSupportedGoalSettings(SupportedGoalSettings); } _L_; } void SSH_OpenDRIM_SSHCapabilities_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_SSHCapabilities_CreateGoalSettings_Out& args) { _E_; CMPIValue value; int errorMessage; vector SupportedGoalSettings; errorMessage = args.getSupportedGoalSettings(SupportedGoalSettings); if (errorMessage == OK) { value = CT_toCMPI(broker, SupportedGoalSettings); out->ft->addArg(out, "SupportedGoalSettings", &value, CMPI_stringA); } _L_; } opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHCapabilities/OpenDRIM_SSHCapabilitiesProvider.cpp0000644000175000017500000003226411415301347030675 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "cmpiOpenDRIM_SSHCapabilities.h" #include "OpenDRIM_SSHCapabilitiesAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define SSH_OpenDRIM_SSHCapabilitiesProviderSetInstance SSH_OpenDRIM_SSHCapabilitiesProviderModifyInstance #endif int SSH_OpenDRIM_SSHCapabilities_init(const CMPIBroker* broker); int SSH_OpenDRIM_SSHCapabilities_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus SSH_OpenDRIM_SSHCapabilitiesProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHCapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHCapabilitiesProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = SSH_OpenDRIM_SSHCapabilities_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = SSH_OpenDRIM_SSHCapabilities_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHCapabilitiesProviderEnumInstances(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 = SSH_OpenDRIM_SSHCapabilities_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = SSH_OpenDRIM_SSHCapabilities_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHCapabilitiesProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHCapabilities instance; SSH_OpenDRIM_SSHCapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHCapabilities_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = SSH_OpenDRIM_SSHCapabilities_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHCapabilitiesProviderSetInstance(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_SSHCapabilities newInstance, oldInstance; SSH_OpenDRIM_SSHCapabilities_toCPP(_broker, ci, newInstance); SSH_OpenDRIM_SSHCapabilities_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHCapabilities_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHCapabilities_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHCapabilitiesProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHCapabilities instance; SSH_OpenDRIM_SSHCapabilities_toCPP(_broker, ci, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_SSHCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHCapabilities_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = SSH_OpenDRIM_SSHCapabilities_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHCapabilitiesProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SSHCapabilities instance; SSH_OpenDRIM_SSHCapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = SSH_OpenDRIM_SSHCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = SSH_OpenDRIM_SSHCapabilities_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHCapabilitiesProviderExecQuery(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 SSH_OpenDRIM_SSHCapabilitiesProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = SSH_OpenDRIM_SSHCapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus SSH_OpenDRIM_SSHCapabilitiesProviderInvokeMethod(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_SSHCapabilities instance; SSH_OpenDRIM_SSHCapabilities_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"InstanceID"}; int errorCode = SSH_OpenDRIM_SSHCapabilities_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="CreateGoalSettings") { unsigned short returnValue; OpenDRIM_SSHCapabilities_CreateGoalSettings_In inArgs; SSH_OpenDRIM_SSHCapabilities_toCPP(_broker, in, inArgs); OpenDRIM_SSHCapabilities_CreateGoalSettings_Out outArgs; errorCode = SSH_OpenDRIM_SSHCapabilities_CreateGoalSettings(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SSHCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } SSH_OpenDRIM_SSHCapabilities_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint16, CMPI_uint16); } else { errorMessage = (string) OpenDRIM_SSHCapabilities_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 SSH_OpenDRIM_SSHCapabilities_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHCapabilities_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHCapabilities_init FAILED: " + (string) OpenDRIM_SSHCapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int SSH_OpenDRIM_SSHCapabilities_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = SSH_OpenDRIM_SSHCapabilities_unload(errorMessage); if (errorCode != OK) { errorMessage += "SSH_OpenDRIM_SSHCapabilities_unload FAILED: " + (string) OpenDRIM_SSHCapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define SSH_OpenDRIM_SSHCapabilities_INIT if (SSH_OpenDRIM_SSHCapabilities_init(_broker) < 0) return NULL CMInstanceMIStub(SSH_OpenDRIM_SSHCapabilitiesProvider, SSH_OpenDRIM_SSHCapabilitiesProvider, _broker, SSH_OpenDRIM_SSHCapabilities_INIT); CMMethodMIStub(SSH_OpenDRIM_SSHCapabilitiesProvider, SSH_OpenDRIM_SSHCapabilitiesProvider, _broker, SSH_OpenDRIM_SSHCapabilities_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHCapabilities/cmpiOpenDRIM_SSHCapabilities.h0000644000175000017500000000470411415301347027476 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef CMPIOPENDRIM_SSHCAPABILITIES_H_ #define CMPIOPENDRIM_SSHCAPABILITIES_H_ #include "OpenDRIM_SSHCapabilities.h" CMPIObjectPath* SSH_OpenDRIM_SSHCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SSHCapabilities& instance); CMPIInstance* SSH_OpenDRIM_SSHCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SSHCapabilities& instance); void SSH_OpenDRIM_SSHCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SSHCapabilities& instance); void SSH_OpenDRIM_SSHCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SSHCapabilities& instance); void SSH_OpenDRIM_SSHCapabilities_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_SSHCapabilities_CreateGoalSettings_In& args); void SSH_OpenDRIM_SSHCapabilities_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_SSHCapabilities_CreateGoalSettings_Out& args); #endif /*CMPIOPENDRIM_SSHCAPABILITIES_H_*/ opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHCapabilities/OpenDRIM_SSHCapabilitiesAccess.cpp0000644000175000017500000001242411415301347030300 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #include "OpenDRIM_SSHCapabilitiesAccess.h" const string InstanceID = "OpenDRIM:SSHCapabilities"; int SSH_OpenDRIM_SSHCapabilities_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_SSHCapabilities_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_SSHCapabilities_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; if (!CF_isExist("/usr/sbin/sshd")) return OK; OpenDRIM_SSHCapabilities instance; instance.setInstanceID(InstanceID); if (discriminant == "ei") CF_assert(SSH_OpenDRIM_SSHCapabilities_populate(instance, errorMessage)); result.push_back(instance); _L_; return OK; } int SSH_OpenDRIM_SSHCapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHCapabilities& instance, const char** properties, string& errorMessage) { _E_; if (instance.InstanceID != InstanceID || !CF_isExist("/usr/sbin/sshd")) { errorMessage = "No instance"; return NOT_FOUND; } CF_assert(SSH_OpenDRIM_SSHCapabilities_populate(instance, errorMessage)); _L_; return OK; } int SSH_OpenDRIM_SSHCapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHCapabilities& newInstance, const OpenDRIM_SSHCapabilities& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHCapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHCapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int SSH_OpenDRIM_SSHCapabilities_CreateGoalSettings(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHCapabilities& instance, unsigned short& returnValue, const OpenDRIM_SSHCapabilities_CreateGoalSettings_In& in, OpenDRIM_SSHCapabilities_CreateGoalSettings_Out& out, string& errorMessage) { _E_; // TODO _L_; return OK; } int SSH_OpenDRIM_SSHCapabilities_populate(OpenDRIM_SSHCapabilities& instance, string& errorMessage) { _E_; /* * Properties to fill from profile * + Mandatory: * [X] InstanceID [KEY] * [X] ElementName * [X] RequestedStatesSupported * [X] ElementNameEditSupported * [X] MaxConnections * [X] SupportedSSHVersions * [X] SupportedEncryptionAlgorithms * [X] ListeningPortManagementSupported * [X] MaxListeningPorts * + Conditional: * [X] MaxElementNameLen * [X] OtherSupportedSSHVersion * [X] OtherSupportedEncryptionAlgorithm */ instance.setElementName("SSH Service Capabilities"); instance.setElementNameEditSupported(false); string out_str; unsigned short maxSessions; CF_assert(CF_getConfigItem("MaxSession", out_str, errorMessage)); if (out_str.size() != 0) { maxSessions = atoi(out_str.c_str()); instance.setMaxConnections(maxSessions); } else instance.setMaxConnections(10); vector supportedSSHVersions; supportedSSHVersions.push_back(SSHV_SSHv1); supportedSSHVersions.push_back(SSHV_SSHv2); instance.setSupportedSSHVersions(supportedSSHVersions); vector supportedEncryptionAlgorithms; supportedEncryptionAlgorithms.push_back(OTHER); supportedEncryptionAlgorithms.push_back(DES3); supportedEncryptionAlgorithms.push_back(RC4); instance.setSupportedEncryptionAlgorithms(supportedEncryptionAlgorithms); instance.setOtherSupportedEncryptionAlgorithm("AES, BLOWFISH, CAST"); instance.setListeningPortManagementSupported(false); instance.setMaxListeningPorts(1); _L_; return OK; } opendrim-lmp-ssh-1.0.0/OpenDRIM_SSHCapabilities/OpenDRIM_SSHCapabilitiesAccess.h0000644000175000017500000000625011415301347027745 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), SSH provider package # Copyright (C) 2010 Feng Zhanlei, REDFLAG # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by Guillaume BOTTEX , UXSystem, 2010 ###############################################################################*/ #ifndef OPENDRIM_SSHCAPABILITIESACCESS_H_ #define OPENDRIM_SSHCAPABILITIESACCESS_H_ #include "SSH_Common.h" #include "OpenDRIM_SSHCapabilities.h" int SSH_OpenDRIM_SSHCapabilities_load(const CMPIBroker* broker, string& errorMessage); int SSH_OpenDRIM_SSHCapabilities_unload(string& errorMessage); int SSH_OpenDRIM_SSHCapabilities_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int SSH_OpenDRIM_SSHCapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SSHCapabilities& instance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHCapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHCapabilities& newInstance, const OpenDRIM_SSHCapabilities& oldInstance, const char** properties, string& errorMessage); int SSH_OpenDRIM_SSHCapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHCapabilities& instance, string& errorMessage); int SSH_OpenDRIM_SSHCapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHCapabilities& instance, string& errorMessage); int SSH_OpenDRIM_SSHCapabilities_CreateGoalSettings(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SSHCapabilities& instance, unsigned short& returnValue, const OpenDRIM_SSHCapabilities_CreateGoalSettings_In& in, OpenDRIM_SSHCapabilities_CreateGoalSettings_Out& out, string& errorMessage); int SSH_OpenDRIM_SSHCapabilities_populate(OpenDRIM_SSHCapabilities& instance, string& errorMessage); #endif /*OPENDRIM_SSHCAPABILITIESACCESS_H_*/ opendrim-lmp-ssh-1.0.0/README0000644000175000017500000000103311415301347016314 0ustar guillaumeguillaume--------------------------------------------------------- REQUIREMENTS --------------------------------------------------------- For compliling: * gcc >= 3.2.0 * cmpi header files >= ver 86 * autoconf >= 2.57 * automake >= 1.5 * libtool (preferably >= 1.8.5) * OpenDRIM Common Library >= 1.1.1 For running: * OpenPegasus >= 2.5.2 OR SBLIM sfcb >= 1.2.0 OR OpenWBEM >= 3.2.2 * Interop package (for sfcb and OpenPegasus only) * In the case of pegasus installed from sources, the PEGASUS_HOME and PEGASUS_ROOT variable MUST be defined!